@skyux/core 5.9.7 → 5.10.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.
Files changed (33) hide show
  1. package/bundles/skyux-core-testing.umd.js +30 -0
  2. package/bundles/skyux-core.umd.js +1000 -980
  3. package/documentation.json +104 -104
  4. package/esm2015/lib/modules/adapter-service/adapter.service.js +10 -6
  5. package/esm2015/lib/modules/adapter-service/adapter.service.js.map +1 -1
  6. package/esm2015/lib/modules/affix/affix.service.js +6 -2
  7. package/esm2015/lib/modules/affix/affix.service.js.map +1 -1
  8. package/esm2015/lib/modules/resize-observer/resize-observer-media-query.service.js +28 -21
  9. package/esm2015/lib/modules/resize-observer/resize-observer-media-query.service.js.map +1 -1
  10. package/esm2015/lib/modules/resize-observer/resize-observer.service.js +16 -10
  11. package/esm2015/lib/modules/resize-observer/resize-observer.service.js.map +1 -1
  12. package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js +28 -25
  13. package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js.map +1 -1
  14. package/esm2015/testing/core-testing.module.js +29 -0
  15. package/esm2015/testing/core-testing.module.js.map +1 -0
  16. package/esm2015/testing/mock-media-query.service.js +2 -0
  17. package/esm2015/testing/mock-media-query.service.js.map +1 -1
  18. package/esm2015/testing/mock-ui-config.service.js.map +1 -1
  19. package/esm2015/testing/public-api.js +1 -0
  20. package/esm2015/testing/public-api.js.map +1 -1
  21. package/fesm2015/skyux-core-testing.js +28 -2
  22. package/fesm2015/skyux-core-testing.js.map +1 -1
  23. package/fesm2015/skyux-core.js +85 -64
  24. package/fesm2015/skyux-core.js.map +1 -1
  25. package/lib/modules/adapter-service/adapter.service.d.ts +1 -1
  26. package/lib/modules/affix/affix.service.d.ts +1 -1
  27. package/lib/modules/resize-observer/resize-observer-media-query.service.d.ts +1 -4
  28. package/lib/modules/resize-observer/resize-observer.service.d.ts +1 -2
  29. package/lib/modules/scrollable-host/scrollable-host.service.d.ts +7 -4
  30. package/package.json +2 -2
  31. package/testing/core-testing.module.d.ts +6 -0
  32. package/testing/mock-ui-config.service.d.ts +2 -1
  33. package/testing/public-api.d.ts +1 -0
@@ -45,6 +45,324 @@
45
45
  args: [{}]
46
46
  }] });
47
47
 
48
+ /*! *****************************************************************************
49
+ Copyright (c) Microsoft Corporation.
50
+
51
+ Permission to use, copy, modify, and/or distribute this software for any
52
+ purpose with or without fee is hereby granted.
53
+
54
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
55
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
56
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
57
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
58
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
59
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
60
+ PERFORMANCE OF THIS SOFTWARE.
61
+ ***************************************************************************** */
62
+ /* global Reflect, Promise */
63
+ var extendStatics = function (d, b) {
64
+ extendStatics = Object.setPrototypeOf ||
65
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
66
+ function (d, b) { for (var p in b)
67
+ if (Object.prototype.hasOwnProperty.call(b, p))
68
+ d[p] = b[p]; };
69
+ return extendStatics(d, b);
70
+ };
71
+ function __extends(d, b) {
72
+ if (typeof b !== "function" && b !== null)
73
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
74
+ extendStatics(d, b);
75
+ function __() { this.constructor = d; }
76
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
77
+ }
78
+ var __assign = function () {
79
+ __assign = Object.assign || function __assign(t) {
80
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
81
+ s = arguments[i];
82
+ for (var p in s)
83
+ if (Object.prototype.hasOwnProperty.call(s, p))
84
+ t[p] = s[p];
85
+ }
86
+ return t;
87
+ };
88
+ return __assign.apply(this, arguments);
89
+ };
90
+ function __rest(s, e) {
91
+ var t = {};
92
+ for (var p in s)
93
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
94
+ t[p] = s[p];
95
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
96
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
97
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
98
+ t[p[i]] = s[p[i]];
99
+ }
100
+ return t;
101
+ }
102
+ function __decorate(decorators, target, key, desc) {
103
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
104
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
105
+ r = Reflect.decorate(decorators, target, key, desc);
106
+ else
107
+ for (var i = decorators.length - 1; i >= 0; i--)
108
+ if (d = decorators[i])
109
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
110
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
111
+ }
112
+ function __param(paramIndex, decorator) {
113
+ return function (target, key) { decorator(target, key, paramIndex); };
114
+ }
115
+ function __metadata(metadataKey, metadataValue) {
116
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
117
+ return Reflect.metadata(metadataKey, metadataValue);
118
+ }
119
+ function __awaiter(thisArg, _arguments, P, generator) {
120
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
121
+ return new (P || (P = Promise))(function (resolve, reject) {
122
+ function fulfilled(value) { try {
123
+ step(generator.next(value));
124
+ }
125
+ catch (e) {
126
+ reject(e);
127
+ } }
128
+ function rejected(value) { try {
129
+ step(generator["throw"](value));
130
+ }
131
+ catch (e) {
132
+ reject(e);
133
+ } }
134
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
135
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
136
+ });
137
+ }
138
+ function __generator(thisArg, body) {
139
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
140
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
141
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
142
+ function verb(n) { return function (v) { return step([n, v]); }; }
143
+ function step(op) {
144
+ if (f)
145
+ throw new TypeError("Generator is already executing.");
146
+ while (_)
147
+ try {
148
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
149
+ return t;
150
+ if (y = 0, t)
151
+ op = [op[0] & 2, t.value];
152
+ switch (op[0]) {
153
+ case 0:
154
+ case 1:
155
+ t = op;
156
+ break;
157
+ case 4:
158
+ _.label++;
159
+ return { value: op[1], done: false };
160
+ case 5:
161
+ _.label++;
162
+ y = op[1];
163
+ op = [0];
164
+ continue;
165
+ case 7:
166
+ op = _.ops.pop();
167
+ _.trys.pop();
168
+ continue;
169
+ default:
170
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
171
+ _ = 0;
172
+ continue;
173
+ }
174
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
175
+ _.label = op[1];
176
+ break;
177
+ }
178
+ if (op[0] === 6 && _.label < t[1]) {
179
+ _.label = t[1];
180
+ t = op;
181
+ break;
182
+ }
183
+ if (t && _.label < t[2]) {
184
+ _.label = t[2];
185
+ _.ops.push(op);
186
+ break;
187
+ }
188
+ if (t[2])
189
+ _.ops.pop();
190
+ _.trys.pop();
191
+ continue;
192
+ }
193
+ op = body.call(thisArg, _);
194
+ }
195
+ catch (e) {
196
+ op = [6, e];
197
+ y = 0;
198
+ }
199
+ finally {
200
+ f = t = 0;
201
+ }
202
+ if (op[0] & 5)
203
+ throw op[1];
204
+ return { value: op[0] ? op[1] : void 0, done: true };
205
+ }
206
+ }
207
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
208
+ if (k2 === undefined)
209
+ k2 = k;
210
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
211
+ }) : (function (o, m, k, k2) {
212
+ if (k2 === undefined)
213
+ k2 = k;
214
+ o[k2] = m[k];
215
+ });
216
+ function __exportStar(m, o) {
217
+ for (var p in m)
218
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
219
+ __createBinding(o, m, p);
220
+ }
221
+ function __values(o) {
222
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
223
+ if (m)
224
+ return m.call(o);
225
+ if (o && typeof o.length === "number")
226
+ return {
227
+ next: function () {
228
+ if (o && i >= o.length)
229
+ o = void 0;
230
+ return { value: o && o[i++], done: !o };
231
+ }
232
+ };
233
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
234
+ }
235
+ function __read(o, n) {
236
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
237
+ if (!m)
238
+ return o;
239
+ var i = m.call(o), r, ar = [], e;
240
+ try {
241
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
242
+ ar.push(r.value);
243
+ }
244
+ catch (error) {
245
+ e = { error: error };
246
+ }
247
+ finally {
248
+ try {
249
+ if (r && !r.done && (m = i["return"]))
250
+ m.call(i);
251
+ }
252
+ finally {
253
+ if (e)
254
+ throw e.error;
255
+ }
256
+ }
257
+ return ar;
258
+ }
259
+ /** @deprecated */
260
+ function __spread() {
261
+ for (var ar = [], i = 0; i < arguments.length; i++)
262
+ ar = ar.concat(__read(arguments[i]));
263
+ return ar;
264
+ }
265
+ /** @deprecated */
266
+ function __spreadArrays() {
267
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
268
+ s += arguments[i].length;
269
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
270
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
271
+ r[k] = a[j];
272
+ return r;
273
+ }
274
+ function __spreadArray(to, from, pack) {
275
+ if (pack || arguments.length === 2)
276
+ for (var i = 0, l = from.length, ar; i < l; i++) {
277
+ if (ar || !(i in from)) {
278
+ if (!ar)
279
+ ar = Array.prototype.slice.call(from, 0, i);
280
+ ar[i] = from[i];
281
+ }
282
+ }
283
+ return to.concat(ar || Array.prototype.slice.call(from));
284
+ }
285
+ function __await(v) {
286
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
287
+ }
288
+ function __asyncGenerator(thisArg, _arguments, generator) {
289
+ if (!Symbol.asyncIterator)
290
+ throw new TypeError("Symbol.asyncIterator is not defined.");
291
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
292
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
293
+ function verb(n) { if (g[n])
294
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
295
+ function resume(n, v) { try {
296
+ step(g[n](v));
297
+ }
298
+ catch (e) {
299
+ settle(q[0][3], e);
300
+ } }
301
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
302
+ function fulfill(value) { resume("next", value); }
303
+ function reject(value) { resume("throw", value); }
304
+ function settle(f, v) { if (f(v), q.shift(), q.length)
305
+ resume(q[0][0], q[0][1]); }
306
+ }
307
+ function __asyncDelegator(o) {
308
+ var i, p;
309
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
310
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
311
+ }
312
+ function __asyncValues(o) {
313
+ if (!Symbol.asyncIterator)
314
+ throw new TypeError("Symbol.asyncIterator is not defined.");
315
+ var m = o[Symbol.asyncIterator], i;
316
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
317
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
318
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
319
+ }
320
+ function __makeTemplateObject(cooked, raw) {
321
+ if (Object.defineProperty) {
322
+ Object.defineProperty(cooked, "raw", { value: raw });
323
+ }
324
+ else {
325
+ cooked.raw = raw;
326
+ }
327
+ return cooked;
328
+ }
329
+ ;
330
+ var __setModuleDefault = Object.create ? (function (o, v) {
331
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
332
+ }) : function (o, v) {
333
+ o["default"] = v;
334
+ };
335
+ function __importStar(mod) {
336
+ if (mod && mod.__esModule)
337
+ return mod;
338
+ var result = {};
339
+ if (mod != null)
340
+ for (var k in mod)
341
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
342
+ __createBinding(result, mod, k);
343
+ __setModuleDefault(result, mod);
344
+ return result;
345
+ }
346
+ function __importDefault(mod) {
347
+ return (mod && mod.__esModule) ? mod : { default: mod };
348
+ }
349
+ function __classPrivateFieldGet(receiver, state, kind, f) {
350
+ if (kind === "a" && !f)
351
+ throw new TypeError("Private accessor was defined without a getter");
352
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
353
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
354
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
355
+ }
356
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
357
+ if (kind === "m")
358
+ throw new TypeError("Private method is not writable");
359
+ if (kind === "a" && !f)
360
+ throw new TypeError("Private accessor was defined without a setter");
361
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
362
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
363
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
364
+ }
365
+
48
366
  exports.SkyMediaBreakpoints = void 0;
49
367
  (function (SkyMediaBreakpoints) {
50
368
  /**
@@ -65,6 +383,7 @@
65
383
  SkyMediaBreakpoints[SkyMediaBreakpoints["lg"] = 4] = "lg";
66
384
  })(exports.SkyMediaBreakpoints || (exports.SkyMediaBreakpoints = {}));
67
385
 
386
+ var _SkyCoreAdapterService_renderer;
68
387
  var SKY_TABBABLE_SELECTOR = [
69
388
  'a[href]',
70
389
  'area[href]',
@@ -81,7 +400,8 @@
81
400
  var SkyCoreAdapterService = /** @class */ (function () {
82
401
  function SkyCoreAdapterService(rendererFactory) {
83
402
  this.rendererFactory = rendererFactory;
84
- this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
403
+ _SkyCoreAdapterService_renderer.set(this, void 0);
404
+ __classPrivateFieldSet(this, _SkyCoreAdapterService_renderer, this.rendererFactory.createRenderer(undefined, null), "f");
85
405
  }
86
406
  /**
87
407
  * Set the responsive container CSS class for a given element.
@@ -92,10 +412,10 @@
92
412
  */
93
413
  SkyCoreAdapterService.prototype.setResponsiveContainerClass = function (elementRef, breakpoint) {
94
414
  var nativeEl = elementRef.nativeElement;
95
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-xs');
96
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-sm');
97
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-md');
98
- this.renderer.removeClass(nativeEl, 'sky-responsive-container-lg');
415
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-xs');
416
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-sm');
417
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-md');
418
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-lg');
99
419
  var newClass;
100
420
  switch (breakpoint) {
101
421
  case exports.SkyMediaBreakpoints.xs: {
@@ -115,7 +435,7 @@
115
435
  break;
116
436
  }
117
437
  }
118
- this.renderer.addClass(nativeEl, newClass);
438
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").addClass(nativeEl, newClass);
119
439
  };
120
440
  /**
121
441
  * This method temporarily enables/disables pointer events.
@@ -282,6 +602,7 @@
282
602
  };
283
603
  return SkyCoreAdapterService;
284
604
  }());
605
+ _SkyCoreAdapterService_renderer = new WeakMap();
285
606
  SkyCoreAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreAdapterService, deps: [{ token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
286
607
  SkyCoreAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreAdapterService, providedIn: 'root' });
287
608
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreAdapterService, decorators: [{
@@ -763,19 +1084,22 @@
763
1084
  return SkyAffixer;
764
1085
  }());
765
1086
 
1087
+ var _SkyAffixService_renderer;
766
1088
  var SkyAffixService = /** @class */ (function () {
767
1089
  function SkyAffixService(rendererFactory) {
768
- this.renderer = rendererFactory.createRenderer(undefined, undefined);
1090
+ _SkyAffixService_renderer.set(this, void 0);
1091
+ __classPrivateFieldSet(this, _SkyAffixService_renderer, rendererFactory.createRenderer(undefined, null), "f");
769
1092
  }
770
1093
  /**
771
1094
  * Creates an instance of [[SkyAffixer]].
772
1095
  * @param affixed The element to be affixed.
773
1096
  */
774
1097
  SkyAffixService.prototype.createAffixer = function (affixed) {
775
- return new SkyAffixer(affixed.nativeElement, this.renderer);
1098
+ return new SkyAffixer(affixed.nativeElement, __classPrivateFieldGet(this, _SkyAffixService_renderer, "f"));
776
1099
  };
777
1100
  return SkyAffixService;
778
1101
  }());
1102
+ _SkyAffixService_renderer = new WeakMap();
779
1103
  SkyAffixService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixService, deps: [{ token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
780
1104
  SkyAffixService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixService, providedIn: 'root' });
781
1105
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAffixService, decorators: [{
@@ -1095,1000 +1419,682 @@
1095
1419
  var found = this.itemRefs.find(function (i) { return i.componentRef.hostView === viewRef; });
1096
1420
  this.itemRefs.splice(this.itemRefs.indexOf(found), 1);
1097
1421
  };
1098
- SkyDockComponent.prototype.setOptions = function (options) {
1099
- var _a, _b;
1100
- this.options = options;
1101
- switch ((_a = this.options) === null || _a === void 0 ? void 0 : _a.location) {
1102
- case exports.SkyDockLocation.BeforeElement:
1103
- this.domAdapter.unbindDock(this.elementRef);
1104
- break;
1105
- case exports.SkyDockLocation.ElementBottom:
1106
- this.domAdapter.setSticky(this.elementRef);
1107
- break;
1108
- case exports.SkyDockLocation.BodyBottom:
1109
- default:
1110
- this.domAdapter.watchDomChanges(this.elementRef);
1111
- break;
1112
- }
1113
- if ((_b = this.options) === null || _b === void 0 ? void 0 : _b.zIndex) {
1114
- this.domAdapter.setZIndex(this.options.zIndex, this.elementRef);
1115
- }
1116
- };
1117
- SkyDockComponent.prototype.sortItemsByStackOrder = function () {
1118
- var _this = this;
1119
- this.itemRefs.sort(sortByStackOrder);
1120
- // Reassign the correct index for each view.
1121
- this.itemRefs.forEach(function (item, i) { return _this.target.move(item.componentRef.hostView, i); });
1122
- };
1123
- SkyDockComponent.prototype.getHighestStackOrder = function () {
1124
- if (this.itemRefs.length === 0) {
1125
- return 0;
1126
- }
1127
- return this.itemRefs[0].stackOrder + 1;
1128
- };
1129
- return SkyDockComponent;
1130
- }());
1131
- SkyDockComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ElementRef }, { token: i0__namespace.Injector }, { token: SkyDockDomAdapterService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1132
- SkyDockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyDockComponent, selector: "sky-dock", providers: [SkyDockDomAdapterService], viewQueries: [{ propertyName: "target", first: true, predicate: ["target"], descendants: true, read: i0.ViewContainerRef, static: true }], ngImport: i0__namespace, template: "<ng-container #target></ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host:not(.sky-dock-unbound){position:fixed;left:0;bottom:0;right:0}:host.sky-dock-sticky{position:sticky}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1133
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockComponent, decorators: [{
1134
- type: i0.Component,
1135
- args: [{
1136
- selector: 'sky-dock',
1137
- template: "<ng-container #target></ng-container>\n",
1138
- styles: [":host{display:flex;flex-direction:column;width:100%}:host:not(.sky-dock-unbound){position:fixed;left:0;bottom:0;right:0}:host.sky-dock-sticky{position:sticky}\n"],
1139
- providers: [SkyDockDomAdapterService],
1140
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1141
- }]
1142
- }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ElementRef }, { type: i0__namespace.Injector }, { type: SkyDockDomAdapterService }]; }, propDecorators: { target: [{
1143
- type: i0.ViewChild,
1144
- args: ['target', {
1145
- read: i0.ViewContainerRef,
1146
- static: true,
1147
- }]
1148
- }] } });
1149
-
1150
- var SkyDockModule = /** @class */ (function () {
1151
- function SkyDockModule() {
1152
- }
1153
- return SkyDockModule;
1154
- }());
1155
- SkyDockModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1156
- SkyDockModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, declarations: [SkyDockComponent], imports: [i4.CommonModule] });
1157
- SkyDockModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, providers: [MutationObserverService], imports: [[i4.CommonModule]] });
1158
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, decorators: [{
1159
- type: i0.NgModule,
1160
- args: [{
1161
- imports: [i4.CommonModule],
1162
- declarations: [SkyDockComponent],
1163
- entryComponents: [SkyDockComponent],
1164
- providers: [MutationObserverService],
1165
- }]
1166
- }] });
1167
-
1168
- /**
1169
- * The location on the page where the dynamic component should be rendered.
1170
- */
1171
- exports.SkyDynamicComponentLocation = void 0;
1172
- (function (SkyDynamicComponentLocation) {
1173
- /**
1174
- * Renders the dynamic component before a given element.
1175
- */
1176
- SkyDynamicComponentLocation[SkyDynamicComponentLocation["BeforeElement"] = 0] = "BeforeElement";
1177
- /**
1178
- * Renders the dynamic component as the last element inside the BODY element.
1179
- */
1180
- SkyDynamicComponentLocation[SkyDynamicComponentLocation["BodyBottom"] = 1] = "BodyBottom";
1181
- /**
1182
- * Renders the dynamic component as the first element inside the BODY element.
1183
- */
1184
- SkyDynamicComponentLocation[SkyDynamicComponentLocation["BodyTop"] = 2] = "BodyTop";
1185
- /**
1186
- * Renders the dynamic component as the last element inside a given element.
1187
- */
1188
- SkyDynamicComponentLocation[SkyDynamicComponentLocation["ElementBottom"] = 3] = "ElementBottom";
1189
- /**
1190
- * Renders the dynamic component as the first element inside a given element.
1191
- */
1192
- SkyDynamicComponentLocation[SkyDynamicComponentLocation["ElementTop"] = 4] = "ElementTop";
1193
- })(exports.SkyDynamicComponentLocation || (exports.SkyDynamicComponentLocation = {}));
1194
-
1195
- /**
1196
- * @internal
1197
- */
1198
- function getWindow() {
1199
- return window;
1200
- }
1201
- /**
1202
- * The application window reference service references the global window variable.
1203
- * After users inject SkyAppWindowRef into a component, they can use the service to interact with
1204
- * window properties and event handlers by referencing its nativeWindow property.
1205
- */
1206
- var SkyAppWindowRef = /** @class */ (function () {
1207
- function SkyAppWindowRef() {
1208
- }
1209
- Object.defineProperty(SkyAppWindowRef.prototype, "nativeWindow", {
1210
- /**
1211
- * References the global `window` variable.
1212
- */
1213
- get: function () {
1214
- return getWindow();
1215
- },
1216
- enumerable: false,
1217
- configurable: true
1218
- });
1219
- return SkyAppWindowRef;
1220
- }());
1221
- SkyAppWindowRef.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppWindowRef, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1222
- SkyAppWindowRef.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppWindowRef, providedIn: 'root' });
1223
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppWindowRef, decorators: [{
1224
- type: i0.Injectable,
1225
- args: [{
1226
- providedIn: 'root',
1227
- }]
1228
- }] });
1229
-
1230
- /**
1231
- * Angular service for creating and rendering a dynamic component.
1232
- */
1233
- var SkyDynamicComponentService = /** @class */ (function () {
1234
- function SkyDynamicComponentService(componentFactoryResolver, applicationRef, injector, windowRef, rendererFactory) {
1235
- this.componentFactoryResolver = componentFactoryResolver;
1236
- this.applicationRef = applicationRef;
1237
- this.injector = injector;
1238
- this.windowRef = windowRef;
1239
- // Based on suggestions from https://github.com/angular/angular/issues/17824
1240
- // for accessing an instance of Renderer2 in a service since Renderer2 can't
1241
- // be injected into a service. Passing undefined for both parameters results
1242
- // in the default renderer which is what we want here.
1243
- this.renderer = rendererFactory.createRenderer(undefined, undefined);
1244
- }
1245
- /**
1246
- * Creates an instance of the specified component and adds it to the specified location
1247
- * on the page.
1248
- * @param options Options for creating the dynamic component.
1249
- */
1250
- SkyDynamicComponentService.prototype.createComponent = function (componentType, options) {
1251
- options = options || {
1252
- location: exports.SkyDynamicComponentLocation.BodyBottom,
1253
- };
1254
- var componentRef = this.componentFactoryResolver
1255
- .resolveComponentFactory(componentType)
1256
- .create(this.injector);
1257
- this.applicationRef.attachView(componentRef.hostView);
1258
- var el = this.getRootNode(componentRef);
1259
- var bodyEl = this.windowRef.nativeWindow.document.body;
1260
- switch (options.location) {
1261
- case exports.SkyDynamicComponentLocation.BeforeElement:
1262
- this.renderer.insertBefore(options.referenceEl.parentElement, el, options.referenceEl);
1263
- break;
1264
- case exports.SkyDynamicComponentLocation.ElementTop:
1265
- this.renderer.insertBefore(options.referenceEl, el, options.referenceEl.firstChild);
1266
- break;
1267
- case exports.SkyDynamicComponentLocation.ElementBottom:
1268
- this.renderer.appendChild(options.referenceEl, el);
1269
- break;
1270
- case exports.SkyDynamicComponentLocation.BodyTop:
1271
- this.renderer.insertBefore(bodyEl, el, bodyEl.firstChild);
1272
- break;
1273
- default:
1274
- this.renderer.appendChild(bodyEl, el);
1275
- break;
1276
- }
1277
- return componentRef;
1278
- };
1279
- /**
1280
- * Removes a component ref from the page
1281
- * @param componentRef Component ref for the component being removed
1282
- */
1283
- SkyDynamicComponentService.prototype.removeComponent = function (componentRef) {
1284
- if (!componentRef) {
1285
- return;
1286
- }
1287
- this.applicationRef.detachView(componentRef.hostView);
1288
- componentRef.destroy();
1289
- };
1290
- SkyDynamicComponentService.prototype.getRootNode = function (componentRef) {
1291
- // Technique for retrieving the component's root node taken from here:
1292
- // https://malcoded.com/posts/angular-dynamic-components
1293
- return componentRef.hostView.rootNodes[0];
1294
- };
1295
- return SkyDynamicComponentService;
1296
- }());
1297
- SkyDynamicComponentService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentService, deps: [{ token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ApplicationRef }, { token: i0__namespace.Injector }, { token: SkyAppWindowRef }, { token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1298
- SkyDynamicComponentService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentService, providedIn: 'any' });
1299
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentService, decorators: [{
1300
- type: i0.Injectable,
1301
- args: [{
1302
- // Must be 'any' so that the component is created in the context of its module's injector.
1303
- // If set to 'root', the component's dependency injections would only be derived from the root
1304
- // injector and may loose context if the component is created within a lazy-loaded module.
1305
- providedIn: 'any',
1306
- }]
1307
- }], ctorParameters: function () { return [{ type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ApplicationRef }, { type: i0__namespace.Injector }, { type: SkyAppWindowRef }, { type: i0__namespace.RendererFactory2 }]; } });
1308
-
1309
- /**
1310
- * This service docks components to specific areas on the page.
1311
- */
1312
- var SkyDockService = /** @class */ (function () {
1313
- function SkyDockService(dynamicComponentService) {
1314
- this.dynamicComponentService = dynamicComponentService;
1315
- }
1316
- Object.defineProperty(SkyDockService.prototype, "items", {
1317
- /**
1318
- * Returns all docked items.
1319
- */
1320
- get: function () {
1321
- return SkyDockService._items;
1322
- },
1323
- enumerable: false,
1324
- configurable: true
1325
- });
1326
- /**
1327
- * Docks a component to the bottom of the page.
1328
- * @param component The component to dock.
1329
- * @param config Options that affect the docking action.
1330
- */
1331
- SkyDockService.prototype.insertComponent = function (component, config) {
1332
- var _this = this;
1333
- if (!SkyDockService.dockRef) {
1334
- this.createDock();
1335
- }
1336
- var itemRef = SkyDockService.dockRef.instance.insertComponent(component, config);
1337
- var item = new SkyDockItem(itemRef.componentRef.instance, itemRef.stackOrder);
1338
- item.destroyed.subscribe(function () {
1339
- SkyDockService.dockRef.instance.removeItem(itemRef);
1340
- SkyDockService._items.splice(SkyDockService._items.indexOf(item), 1);
1341
- if (SkyDockService._items.length === 0) {
1342
- _this.destroyDock();
1343
- }
1344
- });
1345
- SkyDockService._items.push(item);
1346
- SkyDockService._items.sort(sortByStackOrder);
1347
- return item;
1348
- };
1349
- /**
1350
- * Sets options for the positioning and styling of the dock component. Since the dock service is a
1351
- * singleton instance, these options will be applied to all components inserted into the dock. In
1352
- * order to create a seperate dock with different options, consumers should provide a different
1353
- * instance of the dock service.
1354
- * @param options The options for positioning and styling
1355
- */
1356
- SkyDockService.prototype.setDockOptions = function (options) {
1422
+ SkyDockComponent.prototype.setOptions = function (options) {
1423
+ var _a, _b;
1357
1424
  this.options = options;
1358
- };
1359
- SkyDockService.prototype.createDock = function () {
1360
- var dockOptions;
1361
- if (this.options) {
1362
- var dynamicLocation = void 0;
1363
- switch (this.options.location) {
1364
- case exports.SkyDockLocation.BeforeElement:
1365
- dynamicLocation = exports.SkyDynamicComponentLocation.BeforeElement;
1366
- break;
1367
- case exports.SkyDockLocation.ElementBottom:
1368
- dynamicLocation = exports.SkyDynamicComponentLocation.ElementBottom;
1369
- break;
1370
- default:
1371
- dynamicLocation = exports.SkyDynamicComponentLocation.BodyTop;
1372
- break;
1373
- }
1374
- dockOptions = {
1375
- location: dynamicLocation,
1376
- referenceEl: this.options.referenceEl,
1377
- };
1425
+ switch ((_a = this.options) === null || _a === void 0 ? void 0 : _a.location) {
1426
+ case exports.SkyDockLocation.BeforeElement:
1427
+ this.domAdapter.unbindDock(this.elementRef);
1428
+ break;
1429
+ case exports.SkyDockLocation.ElementBottom:
1430
+ this.domAdapter.setSticky(this.elementRef);
1431
+ break;
1432
+ case exports.SkyDockLocation.BodyBottom:
1433
+ default:
1434
+ this.domAdapter.watchDomChanges(this.elementRef);
1435
+ break;
1436
+ }
1437
+ if ((_b = this.options) === null || _b === void 0 ? void 0 : _b.zIndex) {
1438
+ this.domAdapter.setZIndex(this.options.zIndex, this.elementRef);
1378
1439
  }
1379
- SkyDockService.dockRef = this.dynamicComponentService.createComponent(SkyDockComponent, dockOptions);
1380
- SkyDockService.dockRef.instance.setOptions(this.options);
1381
1440
  };
1382
- SkyDockService.prototype.destroyDock = function () {
1383
- this.dynamicComponentService.removeComponent(SkyDockService.dockRef);
1384
- SkyDockService.dockRef = undefined;
1441
+ SkyDockComponent.prototype.sortItemsByStackOrder = function () {
1442
+ var _this = this;
1443
+ this.itemRefs.sort(sortByStackOrder);
1444
+ // Reassign the correct index for each view.
1445
+ this.itemRefs.forEach(function (item, i) { return _this.target.move(item.componentRef.hostView, i); });
1385
1446
  };
1386
- return SkyDockService;
1447
+ SkyDockComponent.prototype.getHighestStackOrder = function () {
1448
+ if (this.itemRefs.length === 0) {
1449
+ return 0;
1450
+ }
1451
+ return this.itemRefs[0].stackOrder + 1;
1452
+ };
1453
+ return SkyDockComponent;
1387
1454
  }());
1388
- SkyDockService._items = [];
1389
- SkyDockServicefac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockService, deps: [{ token: SkyDynamicComponentService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1390
- SkyDockService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockService, providedIn: 'any' });
1391
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockService, decorators: [{
1392
- type: i0.Injectable,
1455
+ SkyDockComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ElementRef }, { token: i0__namespace.Injector }, { token: SkyDockDomAdapterService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1456
+ SkyDockComponentcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyDockComponent, selector: "sky-dock", providers: [SkyDockDomAdapterService], viewQueries: [{ propertyName: "target", first: true, predicate: ["target"], descendants: true, read: i0.ViewContainerRef, static: true }], ngImport: i0__namespace, template: "<ng-container #target></ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host:not(.sky-dock-unbound){position:fixed;left:0;bottom:0;right:0}:host.sky-dock-sticky{position:sticky}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1457
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockComponent, decorators: [{
1458
+ type: i0.Component,
1393
1459
  args: [{
1394
- // Must be 'any' so that the dock component is created in the context of its module's injector.
1395
- // If set to 'root', the component's dependency injections would only be derived from the root
1396
- // injector and may loose context if the dock was opened from within a lazy-loaded module.
1397
- providedIn: 'any',
1460
+ selector: 'sky-dock',
1461
+ template: "<ng-container #target></ng-container>\n",
1462
+ styles: [":host{display:flex;flex-direction:column;width:100%}:host:not(.sky-dock-unbound){position:fixed;left:0;bottom:0;right:0}:host.sky-dock-sticky{position:sticky}\n"],
1463
+ providers: [SkyDockDomAdapterService],
1464
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1398
1465
  }]
1399
- }], ctorParameters: function () { return [{ type: SkyDynamicComponentService }]; } });
1466
+ }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ElementRef }, { type: i0__namespace.Injector }, { type: SkyDockDomAdapterService }]; }, propDecorators: { target: [{
1467
+ type: i0.ViewChild,
1468
+ args: ['target', {
1469
+ read: i0.ViewContainerRef,
1470
+ static: true,
1471
+ }]
1472
+ }] } });
1400
1473
 
1401
- /**
1402
- * Provides services required to create dynamic components on the page.
1403
- * @deprecated The `SkyDynamicComponentService` no longer needs the `SkyDynamicComponentModule`.
1404
- * The `SkyDynamicComponentModule` can be removed from your project.
1405
- */
1406
- var SkyDynamicComponentModule = /** @class */ (function () {
1407
- function SkyDynamicComponentModule() {
1474
+ var SkyDockModule = /** @class */ (function () {
1475
+ function SkyDockModule() {
1408
1476
  }
1409
- return SkyDynamicComponentModule;
1477
+ return SkyDockModule;
1410
1478
  }());
1411
- SkyDynamicComponentModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1412
- SkyDynamicComponentModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule });
1413
- SkyDynamicComponentModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule });
1414
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule, decorators: [{
1479
+ SkyDockModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1480
+ SkyDockModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, declarations: [SkyDockComponent], imports: [i4.CommonModule] });
1481
+ SkyDockModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, providers: [MutationObserverService], imports: [[i4.CommonModule]] });
1482
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockModule, decorators: [{
1415
1483
  type: i0.NgModule,
1416
- args: [{}]
1417
- }] });
1418
-
1419
- var SkyAppFormat = /** @class */ (function () {
1420
- function SkyAppFormat() {
1421
- }
1422
- SkyAppFormat.prototype.formatText = function (format) {
1423
- var args = [];
1424
- for (var _i = 1; _i < arguments.length; _i++) {
1425
- args[_i - 1] = arguments[_i];
1426
- }
1427
- return String(format).replace(/\{(\d+)\}/g, function (match, capture) {
1428
- return args[parseInt(capture, 10)];
1429
- });
1430
- };
1431
- return SkyAppFormat;
1432
- }());
1433
- SkyAppFormat.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppFormat, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1434
- SkyAppFormat.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppFormat, providedIn: 'root' });
1435
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppFormat, decorators: [{
1436
- type: i0.Injectable,
1437
1484
  args: [{
1438
- providedIn: 'root',
1485
+ imports: [i4.CommonModule],
1486
+ declarations: [SkyDockComponent],
1487
+ entryComponents: [SkyDockComponent],
1488
+ providers: [MutationObserverService],
1439
1489
  }]
1440
1490
  }] });
1441
1491
 
1442
- var idIndex = 0;
1443
- function generateId() {
1444
- idIndex++;
1445
- return "sky-id-gen__" + idIndex;
1492
+ /**
1493
+ * The location on the page where the dynamic component should be rendered.
1494
+ */
1495
+ exports.SkyDynamicComponentLocation = void 0;
1496
+ (function (SkyDynamicComponentLocation) {
1497
+ /**
1498
+ * Renders the dynamic component before a given element.
1499
+ */
1500
+ SkyDynamicComponentLocation[SkyDynamicComponentLocation["BeforeElement"] = 0] = "BeforeElement";
1501
+ /**
1502
+ * Renders the dynamic component as the last element inside the BODY element.
1503
+ */
1504
+ SkyDynamicComponentLocation[SkyDynamicComponentLocation["BodyBottom"] = 1] = "BodyBottom";
1505
+ /**
1506
+ * Renders the dynamic component as the first element inside the BODY element.
1507
+ */
1508
+ SkyDynamicComponentLocation[SkyDynamicComponentLocation["BodyTop"] = 2] = "BodyTop";
1509
+ /**
1510
+ * Renders the dynamic component as the last element inside a given element.
1511
+ */
1512
+ SkyDynamicComponentLocation[SkyDynamicComponentLocation["ElementBottom"] = 3] = "ElementBottom";
1513
+ /**
1514
+ * Renders the dynamic component as the first element inside a given element.
1515
+ */
1516
+ SkyDynamicComponentLocation[SkyDynamicComponentLocation["ElementTop"] = 4] = "ElementTop";
1517
+ })(exports.SkyDynamicComponentLocation || (exports.SkyDynamicComponentLocation = {}));
1518
+
1519
+ /**
1520
+ * @internal
1521
+ */
1522
+ function getWindow() {
1523
+ return window;
1446
1524
  }
1447
1525
  /**
1448
- * Sets the element's `id` attribute to a unique ID. To reference this unique ID on other elements,
1449
- * such as in a `label` element's `for` attribute, assign this directive to a template reference
1450
- * variable, then use its `id` property.
1526
+ * The application window reference service references the global window variable.
1527
+ * After users inject SkyAppWindowRef into a component, they can use the service to interact with
1528
+ * window properties and event handlers by referencing its nativeWindow property.
1451
1529
  */
1452
- var SkyIdDirective = /** @class */ (function () {
1453
- function SkyIdDirective(elRef, renderer) {
1454
- // Generate and apply the ID before the template is rendered
1455
- // to avoid a changed-after-checked error.
1456
- var id = generateId();
1457
- renderer.setAttribute(elRef.nativeElement, 'id', id);
1458
- this._id = id;
1530
+ var SkyAppWindowRef = /** @class */ (function () {
1531
+ function SkyAppWindowRef() {
1459
1532
  }
1460
- Object.defineProperty(SkyIdDirective.prototype, "id", {
1533
+ Object.defineProperty(SkyAppWindowRef.prototype, "nativeWindow", {
1534
+ /**
1535
+ * References the global `window` variable.
1536
+ */
1461
1537
  get: function () {
1462
- return this._id;
1538
+ return getWindow();
1463
1539
  },
1464
1540
  enumerable: false,
1465
1541
  configurable: true
1466
1542
  });
1467
- return SkyIdDirective;
1468
- }());
1469
- SkyIdDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1470
- SkyIdDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyIdDirective, selector: "[skyId]", exportAs: ["skyId"], ngImport: i0__namespace });
1471
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdDirective, decorators: [{
1472
- type: i0.Directive,
1473
- args: [{
1474
- selector: '[skyId]',
1475
- exportAs: 'skyId',
1476
- }]
1477
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Renderer2 }]; } });
1478
-
1479
- var SkyIdModule = /** @class */ (function () {
1480
- function SkyIdModule() {
1481
- }
1482
- return SkyIdModule;
1543
+ return SkyAppWindowRef;
1483
1544
  }());
1484
- SkyIdModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1485
- SkyIdModulemod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule, declarations: [SkyIdDirective], exports: [SkyIdDirective] });
1486
- SkyIdModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule });
1487
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule, decorators: [{
1488
- type: i0.NgModule,
1545
+ SkyAppWindowRef.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppWindowRef, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1546
+ SkyAppWindowRefprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppWindowRef, providedIn: 'root' });
1547
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppWindowRef, decorators: [{
1548
+ type: i0.Injectable,
1489
1549
  args: [{
1490
- declarations: [SkyIdDirective],
1491
- exports: [SkyIdDirective],
1550
+ providedIn: 'root',
1492
1551
  }]
1493
1552
  }] });
1494
1553
 
1495
1554
  /**
1496
- * @deprecated The `SkyLogService` no longer needs the `SkyLogModule`.
1497
- * The `SkyLogModule` can be removed from your project.
1498
- */
1499
- var SkyLogModule = /** @class */ (function () {
1500
- function SkyLogModule() {
1501
- }
1502
- return SkyLogModule;
1503
- }());
1504
- SkyLogModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1505
- SkyLogModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule });
1506
- SkyLogModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule });
1507
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule, decorators: [{
1508
- type: i0.NgModule,
1509
- args: [{}]
1510
- }] });
1511
-
1512
- /**
1513
- * @deprecated The `SkyLogService` will be removed in the next major version of `@skyux/core`.
1555
+ * Angular service for creating and rendering a dynamic component.
1514
1556
  */
1515
- var SkyLogService = /** @class */ (function () {
1516
- function SkyLogService() {
1557
+ var SkyDynamicComponentService = /** @class */ (function () {
1558
+ function SkyDynamicComponentService(componentFactoryResolver, applicationRef, injector, windowRef, rendererFactory) {
1559
+ this.componentFactoryResolver = componentFactoryResolver;
1560
+ this.applicationRef = applicationRef;
1561
+ this.injector = injector;
1562
+ this.windowRef = windowRef;
1563
+ // Based on suggestions from https://github.com/angular/angular/issues/17824
1564
+ // for accessing an instance of Renderer2 in a service since Renderer2 can't
1565
+ // be injected into a service. Passing undefined for both parameters results
1566
+ // in the default renderer which is what we want here.
1567
+ this.renderer = rendererFactory.createRenderer(undefined, undefined);
1517
1568
  }
1518
- SkyLogService.prototype.warn = function (message) {
1519
- var optionalParams = [];
1520
- for (var _i = 1; _i < arguments.length; _i++) {
1521
- optionalParams[_i - 1] = arguments[_i];
1569
+ /**
1570
+ * Creates an instance of the specified component and adds it to the specified location
1571
+ * on the page.
1572
+ * @param options Options for creating the dynamic component.
1573
+ */
1574
+ SkyDynamicComponentService.prototype.createComponent = function (componentType, options) {
1575
+ options = options || {
1576
+ location: exports.SkyDynamicComponentLocation.BodyBottom,
1577
+ };
1578
+ var componentRef = this.componentFactoryResolver
1579
+ .resolveComponentFactory(componentType)
1580
+ .create(this.injector);
1581
+ this.applicationRef.attachView(componentRef.hostView);
1582
+ var el = this.getRootNode(componentRef);
1583
+ var bodyEl = this.windowRef.nativeWindow.document.body;
1584
+ switch (options.location) {
1585
+ case exports.SkyDynamicComponentLocation.BeforeElement:
1586
+ this.renderer.insertBefore(options.referenceEl.parentElement, el, options.referenceEl);
1587
+ break;
1588
+ case exports.SkyDynamicComponentLocation.ElementTop:
1589
+ this.renderer.insertBefore(options.referenceEl, el, options.referenceEl.firstChild);
1590
+ break;
1591
+ case exports.SkyDynamicComponentLocation.ElementBottom:
1592
+ this.renderer.appendChild(options.referenceEl, el);
1593
+ break;
1594
+ case exports.SkyDynamicComponentLocation.BodyTop:
1595
+ this.renderer.insertBefore(bodyEl, el, bodyEl.firstChild);
1596
+ break;
1597
+ default:
1598
+ this.renderer.appendChild(bodyEl, el);
1599
+ break;
1522
1600
  }
1523
- /*istanbul ignore else */
1524
- if (window.console) {
1525
- // eslint-disable-next-line prefer-spread,prefer-rest-params
1526
- window.console.warn.apply(window.console, arguments);
1601
+ return componentRef;
1602
+ };
1603
+ /**
1604
+ * Removes a component ref from the page
1605
+ * @param componentRef Component ref for the component being removed
1606
+ */
1607
+ SkyDynamicComponentService.prototype.removeComponent = function (componentRef) {
1608
+ if (!componentRef) {
1609
+ return;
1527
1610
  }
1611
+ this.applicationRef.detachView(componentRef.hostView);
1612
+ componentRef.destroy();
1528
1613
  };
1529
- return SkyLogService;
1614
+ SkyDynamicComponentService.prototype.getRootNode = function (componentRef) {
1615
+ // Technique for retrieving the component's root node taken from here:
1616
+ // https://malcoded.com/posts/angular-dynamic-components
1617
+ return componentRef.hostView.rootNodes[0];
1618
+ };
1619
+ return SkyDynamicComponentService;
1530
1620
  }());
1531
- SkyLogService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1532
- SkyLogService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogService, providedIn: 'root' });
1533
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogService, decorators: [{
1621
+ SkyDynamicComponentService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentService, deps: [{ token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ApplicationRef }, { token: i0__namespace.Injector }, { token: SkyAppWindowRef }, { token: i0__namespace.RendererFactory2 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1622
+ SkyDynamicComponentService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentService, providedIn: 'any' });
1623
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentService, decorators: [{
1534
1624
  type: i0.Injectable,
1535
1625
  args: [{
1536
- providedIn: 'root',
1626
+ // Must be 'any' so that the component is created in the context of its module's injector.
1627
+ // If set to 'root', the component's dependency injections would only be derived from the root
1628
+ // injector and may loose context if the component is created within a lazy-loaded module.
1629
+ providedIn: 'any',
1537
1630
  }]
1538
- }] });
1631
+ }], ctorParameters: function () { return [{ type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ApplicationRef }, { type: i0__namespace.Injector }, { type: SkyAppWindowRef }, { type: i0__namespace.RendererFactory2 }]; } });
1539
1632
 
1540
1633
  /**
1541
- * @deprecated The `SkyMediaQueryService` no longer needs the `SkyMediaQueryModule`.
1542
- * The `SkyMediaQueryModule` can be removed from your project.
1634
+ * This service docks components to specific areas on the page.
1543
1635
  */
1544
- var SkyMediaQueryModule = /** @class */ (function () {
1545
- function SkyMediaQueryModule() {
1546
- }
1547
- return SkyMediaQueryModule;
1548
- }());
1549
- SkyMediaQueryModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1550
- SkyMediaQueryModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule });
1551
- SkyMediaQueryModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule });
1552
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule, decorators: [{
1553
- type: i0.NgModule,
1554
- args: [{}]
1555
- }] });
1556
-
1557
- var SkyMediaQueryService = /** @class */ (function () {
1558
- function SkyMediaQueryService(zone) {
1559
- this.zone = zone;
1560
- this.currentSubject = new rxjs.BehaviorSubject(this.current);
1561
- this._current = exports.SkyMediaBreakpoints.md;
1562
- this.breakpoints = [
1563
- {
1564
- mediaQueryString: SkyMediaQueryService.xs,
1565
- name: exports.SkyMediaBreakpoints.xs,
1566
- },
1567
- {
1568
- mediaQueryString: SkyMediaQueryService.sm,
1569
- name: exports.SkyMediaBreakpoints.sm,
1570
- },
1571
- {
1572
- mediaQueryString: SkyMediaQueryService.md,
1573
- name: exports.SkyMediaBreakpoints.md,
1574
- },
1575
- {
1576
- mediaQueryString: SkyMediaQueryService.lg,
1577
- name: exports.SkyMediaBreakpoints.lg,
1578
- },
1579
- ];
1580
- this.mediaQueries = [];
1581
- this.addListeners();
1636
+ var SkyDockService = /** @class */ (function () {
1637
+ function SkyDockService(dynamicComponentService) {
1638
+ this.dynamicComponentService = dynamicComponentService;
1582
1639
  }
1583
- Object.defineProperty(SkyMediaQueryService.prototype, "current", {
1640
+ Object.defineProperty(SkyDockService.prototype, "items", {
1584
1641
  /**
1585
- * Returns the current breakpoint.
1642
+ * Returns all docked items.
1586
1643
  */
1587
1644
  get: function () {
1588
- return this._current;
1645
+ return SkyDockService._items;
1589
1646
  },
1590
1647
  enumerable: false,
1591
1648
  configurable: true
1592
1649
  });
1593
- SkyMediaQueryService.prototype.ngOnDestroy = function () {
1594
- this.removeListeners();
1595
- this.currentSubject.complete();
1596
- };
1597
1650
  /**
1598
- * Subscribes to screen size changes.
1599
- * @param listener Specifies a function that is called when breakpoints change.
1651
+ * Docks a component to the bottom of the page.
1652
+ * @param component The component to dock.
1653
+ * @param config Options that affect the docking action.
1600
1654
  */
1601
- SkyMediaQueryService.prototype.subscribe = function (listener) {
1602
- return this.currentSubject.subscribe({
1603
- next: function (breakpoints) {
1604
- listener(breakpoints);
1605
- },
1655
+ SkyDockService.prototype.insertComponent = function (component, config) {
1656
+ var _this = this;
1657
+ if (!SkyDockService.dockRef) {
1658
+ this.createDock();
1659
+ }
1660
+ var itemRef = SkyDockService.dockRef.instance.insertComponent(component, config);
1661
+ var item = new SkyDockItem(itemRef.componentRef.instance, itemRef.stackOrder);
1662
+ item.destroyed.subscribe(function () {
1663
+ SkyDockService.dockRef.instance.removeItem(itemRef);
1664
+ SkyDockService._items.splice(SkyDockService._items.indexOf(item), 1);
1665
+ if (SkyDockService._items.length === 0) {
1666
+ _this.destroyDock();
1667
+ }
1606
1668
  });
1669
+ SkyDockService._items.push(item);
1670
+ SkyDockService._items.sort(sortByStackOrder);
1671
+ return item;
1607
1672
  };
1608
1673
  /**
1609
- * @internal
1674
+ * Sets options for the positioning and styling of the dock component. Since the dock service is a
1675
+ * singleton instance, these options will be applied to all components inserted into the dock. In
1676
+ * order to create a seperate dock with different options, consumers should provide a different
1677
+ * instance of the dock service.
1678
+ * @param options The options for positioning and styling
1610
1679
  */
1611
- SkyMediaQueryService.prototype.destroy = function () {
1612
- this.removeListeners();
1613
- this.currentSubject.complete();
1680
+ SkyDockService.prototype.setDockOptions = function (options) {
1681
+ this.options = options;
1614
1682
  };
1615
- SkyMediaQueryService.prototype.addListeners = function () {
1616
- var _this = this;
1617
- this.mediaQueries = this.breakpoints.map(function (breakpoint) {
1618
- var mq = matchMedia(breakpoint.mediaQueryString);
1619
- var listener = function (event) {
1620
- // Run the check outside of Angular's change detection since Angular
1621
- // does not wrap matchMedia listeners in NgZone.
1622
- // See: https://blog.assaf.co/angular-2-change-detection-zones-and-an-example/
1623
- _this.zone.run(function () {
1624
- if (event.matches) {
1625
- _this.notifyBreakpointChange(breakpoint.name);
1626
- }
1627
- });
1628
- };
1629
- mq.addListener(listener);
1630
- if (mq.matches) {
1631
- _this.notifyBreakpointChange(breakpoint.name);
1683
+ SkyDockService.prototype.createDock = function () {
1684
+ var dockOptions;
1685
+ if (this.options) {
1686
+ var dynamicLocation = void 0;
1687
+ switch (this.options.location) {
1688
+ case exports.SkyDockLocation.BeforeElement:
1689
+ dynamicLocation = exports.SkyDynamicComponentLocation.BeforeElement;
1690
+ break;
1691
+ case exports.SkyDockLocation.ElementBottom:
1692
+ dynamicLocation = exports.SkyDynamicComponentLocation.ElementBottom;
1693
+ break;
1694
+ default:
1695
+ dynamicLocation = exports.SkyDynamicComponentLocation.BodyTop;
1696
+ break;
1632
1697
  }
1633
- return {
1634
- mediaQueryList: mq,
1635
- listener: listener,
1636
- };
1637
- });
1638
- };
1639
- SkyMediaQueryService.prototype.removeListeners = function () {
1640
- this.mediaQueries.forEach(function (mediaQuery) {
1641
- mediaQuery.mediaQueryList.removeListener(mediaQuery.listener);
1642
- });
1643
- this.mediaQueries = [];
1644
- };
1645
- SkyMediaQueryService.prototype.notifyBreakpointChange = function (breakpoint) {
1646
- this._current = breakpoint;
1647
- this.currentSubject.next(breakpoint);
1648
- };
1649
- return SkyMediaQueryService;
1650
- }());
1651
- /**
1652
- * The size for the `xs` breakpoint.
1653
- * @default "(max-width: 767px)"
1654
- */
1655
- SkyMediaQueryService.xs = '(max-width: 767px)';
1656
- /**
1657
- * The size for the `sm` breakpoint.
1658
- * @default "(min-width: 768px) and (max-width: 991px)"
1659
- */
1660
- SkyMediaQueryService.sm = '(min-width: 768px) and (max-width: 991px)';
1661
- /**
1662
- * The size for the `md` breakpoint.
1663
- * @default "(min-width: 992px) and (max-width: 1199px)"
1664
- */
1665
- SkyMediaQueryService.md = '(min-width: 992px) and (max-width: 1199px)';
1666
- /**
1667
- * The size for the `lg` breakpoint.
1668
- * @default "(min-width: 1200px)"
1669
- */
1670
- SkyMediaQueryService.lg = '(min-width: 1200px)';
1671
- SkyMediaQueryService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryService, deps: [{ token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1672
- SkyMediaQueryService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryService, providedIn: 'root' });
1673
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryService, decorators: [{
1674
- type: i0.Injectable,
1675
- args: [{
1676
- providedIn: 'root',
1677
- }]
1678
- }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }]; } });
1679
-
1680
- /**
1681
- * NOTICE: DO NOT MODIFY THIS FILE!
1682
- * The contents of this file were automatically generated by
1683
- * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-core' schematic.
1684
- * To update this file, simply rerun the command.
1685
- */
1686
- var RESOURCES = {
1687
- 'EN-US': {
1688
- skyux_numeric_billions_symbol: { message: 'B' },
1689
- skyux_numeric_millions_symbol: { message: 'M' },
1690
- skyux_numeric_thousands_symbol: { message: 'K' },
1691
- skyux_numeric_trillions_symbol: { message: 'T' },
1692
- },
1693
- };
1694
- var SkyCoreResourcesProvider = /** @class */ (function () {
1695
- function SkyCoreResourcesProvider() {
1696
- }
1697
- SkyCoreResourcesProvider.prototype.getString = function (localeInfo, name) {
1698
- return i1.getLibStringForLocale(RESOURCES, localeInfo.locale, name);
1698
+ dockOptions = {
1699
+ location: dynamicLocation,
1700
+ referenceEl: this.options.referenceEl,
1701
+ };
1702
+ }
1703
+ SkyDockService.dockRef = this.dynamicComponentService.createComponent(SkyDockComponent, dockOptions);
1704
+ SkyDockService.dockRef.instance.setOptions(this.options);
1699
1705
  };
1700
- return SkyCoreResourcesProvider;
1701
- }());
1702
- /**
1703
- * Import into any component library module that needs to use resource strings.
1704
- */
1705
- var SkyCoreResourcesModule = /** @class */ (function () {
1706
- function SkyCoreResourcesModule() {
1707
- }
1708
- return SkyCoreResourcesModule;
1706
+ SkyDockService.prototype.destroyDock = function () {
1707
+ this.dynamicComponentService.removeComponent(SkyDockService.dockRef);
1708
+ SkyDockService.dockRef = undefined;
1709
+ };
1710
+ return SkyDockService;
1709
1711
  }());
1710
- SkyCoreResourcesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1711
- SkyCoreResourcesModulemod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, exports: [i1.SkyI18nModule] });
1712
- SkyCoreResourcesModuleinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, providers: [
1713
- {
1714
- provide: i1.SKY_LIB_RESOURCES_PROVIDERS,
1715
- useClass: SkyCoreResourcesProvider,
1716
- multi: true,
1717
- },
1718
- ], imports: [i1.SkyI18nModule] });
1719
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, decorators: [{
1720
- type: i0.NgModule,
1712
+ SkyDockService._items = [];
1713
+ SkyDockServicefac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockService, deps: [{ token: SkyDynamicComponentService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1714
+ SkyDockServiceprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockService, providedIn: 'any' });
1715
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDockService, decorators: [{
1716
+ type: i0.Injectable,
1721
1717
  args: [{
1722
- exports: [i1.SkyI18nModule],
1723
- providers: [
1724
- {
1725
- provide: i1.SKY_LIB_RESOURCES_PROVIDERS,
1726
- useClass: SkyCoreResourcesProvider,
1727
- multi: true,
1728
- },
1729
- ],
1718
+ // Must be 'any' so that the dock component is created in the context of its module's injector.
1719
+ // If set to 'root', the component's dependency injections would only be derived from the root
1720
+ // injector and may loose context if the dock was opened from within a lazy-loaded module.
1721
+ providedIn: 'any',
1730
1722
  }]
1731
- }] });
1723
+ }], ctorParameters: function () { return [{ type: SkyDynamicComponentService }]; } });
1732
1724
 
1733
1725
  /**
1734
- * Provides arguments for the number to format.
1726
+ * Provides services required to create dynamic components on the page.
1727
+ * @deprecated The `SkyDynamicComponentService` no longer needs the `SkyDynamicComponentModule`.
1728
+ * The `SkyDynamicComponentModule` can be removed from your project.
1735
1729
  */
1736
- var NumericOptions = /** @class */ (function () {
1737
- function NumericOptions() {
1738
- /**
1739
- * Specifies the maximum number of digits after the decimal separator.
1740
- * @default 1
1741
- */
1742
- this.digits = 1;
1743
- /**
1744
- * Specifies how to format the number. Options are `currency` or `number`.
1745
- * @default "number"
1746
- */
1747
- this.format = 'number';
1748
- /**
1749
- * Specifies the format of the currency.
1750
- * @default "standard"
1751
- */
1752
- this.currencySign = 'standard';
1753
- /**
1754
- * Specifies the ISO4217 currency code to use for currency formatting. If you do not specify a
1755
- * currency code, the component uses the browser's culture to determine the currency unless your
1756
- * SPA provides a different culture with `SkyAppLocaleProvider`.
1757
- * @default "USD"
1758
- */
1759
- this.iso = 'USD';
1760
- /**
1761
- * Indicates whether to shorten numbers to rounded numbers and abbreviation characters
1762
- * such as K for thousands, M for millions, B for billions, and T for trillions.
1763
- */
1764
- this.truncate = true;
1765
- /**
1766
- * Specifies the starting point after which numbers are shortened to rounded numbers
1767
- * and abbreviation characters.
1768
- * @default 0
1769
- */
1770
- this.truncateAfter = 0;
1730
+ var SkyDynamicComponentModule = /** @class */ (function () {
1731
+ function SkyDynamicComponentModule() {
1771
1732
  }
1772
- return NumericOptions;
1733
+ return SkyDynamicComponentModule;
1773
1734
  }());
1774
-
1775
- /*! *****************************************************************************
1776
- Copyright (c) Microsoft Corporation.
1777
-
1778
- Permission to use, copy, modify, and/or distribute this software for any
1779
- purpose with or without fee is hereby granted.
1780
-
1781
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1782
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1783
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1784
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1785
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1786
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1787
- PERFORMANCE OF THIS SOFTWARE.
1788
- ***************************************************************************** */
1789
- /* global Reflect, Promise */
1790
- var extendStatics = function (d, b) {
1791
- extendStatics = Object.setPrototypeOf ||
1792
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1793
- function (d, b) { for (var p in b)
1794
- if (Object.prototype.hasOwnProperty.call(b, p))
1795
- d[p] = b[p]; };
1796
- return extendStatics(d, b);
1797
- };
1798
- function __extends(d, b) {
1799
- if (typeof b !== "function" && b !== null)
1800
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1801
- extendStatics(d, b);
1802
- function __() { this.constructor = d; }
1803
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1804
- }
1805
- var __assign = function () {
1806
- __assign = Object.assign || function __assign(t) {
1807
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1808
- s = arguments[i];
1809
- for (var p in s)
1810
- if (Object.prototype.hasOwnProperty.call(s, p))
1811
- t[p] = s[p];
1812
- }
1813
- return t;
1814
- };
1815
- return __assign.apply(this, arguments);
1816
- };
1817
- function __rest(s, e) {
1818
- var t = {};
1819
- for (var p in s)
1820
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1821
- t[p] = s[p];
1822
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1823
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1824
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1825
- t[p[i]] = s[p[i]];
1826
- }
1827
- return t;
1828
- }
1829
- function __decorate(decorators, target, key, desc) {
1830
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1831
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1832
- r = Reflect.decorate(decorators, target, key, desc);
1833
- else
1834
- for (var i = decorators.length - 1; i >= 0; i--)
1835
- if (d = decorators[i])
1836
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1837
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1838
- }
1839
- function __param(paramIndex, decorator) {
1840
- return function (target, key) { decorator(target, key, paramIndex); };
1841
- }
1842
- function __metadata(metadataKey, metadataValue) {
1843
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1844
- return Reflect.metadata(metadataKey, metadataValue);
1845
- }
1846
- function __awaiter(thisArg, _arguments, P, generator) {
1847
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1848
- return new (P || (P = Promise))(function (resolve, reject) {
1849
- function fulfilled(value) { try {
1850
- step(generator.next(value));
1851
- }
1852
- catch (e) {
1853
- reject(e);
1854
- } }
1855
- function rejected(value) { try {
1856
- step(generator["throw"](value));
1857
- }
1858
- catch (e) {
1859
- reject(e);
1860
- } }
1861
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1862
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1863
- });
1864
- }
1865
- function __generator(thisArg, body) {
1866
- var _ = { label: 0, sent: function () { if (t[0] & 1)
1867
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1868
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
1869
- function verb(n) { return function (v) { return step([n, v]); }; }
1870
- function step(op) {
1871
- if (f)
1872
- throw new TypeError("Generator is already executing.");
1873
- while (_)
1874
- try {
1875
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
1876
- return t;
1877
- if (y = 0, t)
1878
- op = [op[0] & 2, t.value];
1879
- switch (op[0]) {
1880
- case 0:
1881
- case 1:
1882
- t = op;
1883
- break;
1884
- case 4:
1885
- _.label++;
1886
- return { value: op[1], done: false };
1887
- case 5:
1888
- _.label++;
1889
- y = op[1];
1890
- op = [0];
1891
- continue;
1892
- case 7:
1893
- op = _.ops.pop();
1894
- _.trys.pop();
1895
- continue;
1896
- default:
1897
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
1898
- _ = 0;
1899
- continue;
1900
- }
1901
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
1902
- _.label = op[1];
1903
- break;
1904
- }
1905
- if (op[0] === 6 && _.label < t[1]) {
1906
- _.label = t[1];
1907
- t = op;
1908
- break;
1909
- }
1910
- if (t && _.label < t[2]) {
1911
- _.label = t[2];
1912
- _.ops.push(op);
1913
- break;
1914
- }
1915
- if (t[2])
1916
- _.ops.pop();
1917
- _.trys.pop();
1918
- continue;
1919
- }
1920
- op = body.call(thisArg, _);
1921
- }
1922
- catch (e) {
1923
- op = [6, e];
1924
- y = 0;
1925
- }
1926
- finally {
1927
- f = t = 0;
1928
- }
1929
- if (op[0] & 5)
1930
- throw op[1];
1931
- return { value: op[0] ? op[1] : void 0, done: true };
1735
+ SkyDynamicComponentModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1736
+ SkyDynamicComponentModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule });
1737
+ SkyDynamicComponentModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule });
1738
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyDynamicComponentModule, decorators: [{
1739
+ type: i0.NgModule,
1740
+ args: [{}]
1741
+ }] });
1742
+
1743
+ var SkyAppFormat = /** @class */ (function () {
1744
+ function SkyAppFormat() {
1932
1745
  }
1746
+ SkyAppFormat.prototype.formatText = function (format) {
1747
+ var args = [];
1748
+ for (var _i = 1; _i < arguments.length; _i++) {
1749
+ args[_i - 1] = arguments[_i];
1750
+ }
1751
+ return String(format).replace(/\{(\d+)\}/g, function (match, capture) {
1752
+ return args[parseInt(capture, 10)];
1753
+ });
1754
+ };
1755
+ return SkyAppFormat;
1756
+ }());
1757
+ SkyAppFormat.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppFormat, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1758
+ SkyAppFormat.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppFormat, providedIn: 'root' });
1759
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppFormat, decorators: [{
1760
+ type: i0.Injectable,
1761
+ args: [{
1762
+ providedIn: 'root',
1763
+ }]
1764
+ }] });
1765
+
1766
+ var idIndex = 0;
1767
+ function generateId() {
1768
+ idIndex++;
1769
+ return "sky-id-gen__" + idIndex;
1933
1770
  }
1934
- var __createBinding = Object.create ? (function (o, m, k, k2) {
1935
- if (k2 === undefined)
1936
- k2 = k;
1937
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
1938
- }) : (function (o, m, k, k2) {
1939
- if (k2 === undefined)
1940
- k2 = k;
1941
- o[k2] = m[k];
1942
- });
1943
- function __exportStar(m, o) {
1944
- for (var p in m)
1945
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
1946
- __createBinding(o, m, p);
1947
- }
1948
- function __values(o) {
1949
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1950
- if (m)
1951
- return m.call(o);
1952
- if (o && typeof o.length === "number")
1953
- return {
1954
- next: function () {
1955
- if (o && i >= o.length)
1956
- o = void 0;
1957
- return { value: o && o[i++], done: !o };
1958
- }
1959
- };
1960
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1961
- }
1962
- function __read(o, n) {
1963
- var m = typeof Symbol === "function" && o[Symbol.iterator];
1964
- if (!m)
1965
- return o;
1966
- var i = m.call(o), r, ar = [], e;
1967
- try {
1968
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
1969
- ar.push(r.value);
1771
+ /**
1772
+ * Sets the element's `id` attribute to a unique ID. To reference this unique ID on other elements,
1773
+ * such as in a `label` element's `for` attribute, assign this directive to a template reference
1774
+ * variable, then use its `id` property.
1775
+ */
1776
+ var SkyIdDirective = /** @class */ (function () {
1777
+ function SkyIdDirective(elRef, renderer) {
1778
+ // Generate and apply the ID before the template is rendered
1779
+ // to avoid a changed-after-checked error.
1780
+ var id = generateId();
1781
+ renderer.setAttribute(elRef.nativeElement, 'id', id);
1782
+ this._id = id;
1970
1783
  }
1971
- catch (error) {
1972
- e = { error: error };
1784
+ Object.defineProperty(SkyIdDirective.prototype, "id", {
1785
+ get: function () {
1786
+ return this._id;
1787
+ },
1788
+ enumerable: false,
1789
+ configurable: true
1790
+ });
1791
+ return SkyIdDirective;
1792
+ }());
1793
+ SkyIdDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1794
+ SkyIdDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyIdDirective, selector: "[skyId]", exportAs: ["skyId"], ngImport: i0__namespace });
1795
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdDirective, decorators: [{
1796
+ type: i0.Directive,
1797
+ args: [{
1798
+ selector: '[skyId]',
1799
+ exportAs: 'skyId',
1800
+ }]
1801
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Renderer2 }]; } });
1802
+
1803
+ var SkyIdModule = /** @class */ (function () {
1804
+ function SkyIdModule() {
1973
1805
  }
1974
- finally {
1975
- try {
1976
- if (r && !r.done && (m = i["return"]))
1977
- m.call(i);
1806
+ return SkyIdModule;
1807
+ }());
1808
+ SkyIdModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1809
+ SkyIdModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule, declarations: [SkyIdDirective], exports: [SkyIdDirective] });
1810
+ SkyIdModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule });
1811
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyIdModule, decorators: [{
1812
+ type: i0.NgModule,
1813
+ args: [{
1814
+ declarations: [SkyIdDirective],
1815
+ exports: [SkyIdDirective],
1816
+ }]
1817
+ }] });
1818
+
1819
+ /**
1820
+ * @deprecated The `SkyLogService` no longer needs the `SkyLogModule`.
1821
+ * The `SkyLogModule` can be removed from your project.
1822
+ */
1823
+ var SkyLogModule = /** @class */ (function () {
1824
+ function SkyLogModule() {
1825
+ }
1826
+ return SkyLogModule;
1827
+ }());
1828
+ SkyLogModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1829
+ SkyLogModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule });
1830
+ SkyLogModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule });
1831
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogModule, decorators: [{
1832
+ type: i0.NgModule,
1833
+ args: [{}]
1834
+ }] });
1835
+
1836
+ /**
1837
+ * @deprecated The `SkyLogService` will be removed in the next major version of `@skyux/core`.
1838
+ */
1839
+ var SkyLogService = /** @class */ (function () {
1840
+ function SkyLogService() {
1841
+ }
1842
+ SkyLogService.prototype.warn = function (message) {
1843
+ var optionalParams = [];
1844
+ for (var _i = 1; _i < arguments.length; _i++) {
1845
+ optionalParams[_i - 1] = arguments[_i];
1978
1846
  }
1979
- finally {
1980
- if (e)
1981
- throw e.error;
1847
+ /*istanbul ignore else */
1848
+ if (window.console) {
1849
+ // eslint-disable-next-line prefer-spread,prefer-rest-params
1850
+ window.console.warn.apply(window.console, arguments);
1982
1851
  }
1852
+ };
1853
+ return SkyLogService;
1854
+ }());
1855
+ SkyLogService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1856
+ SkyLogService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogService, providedIn: 'root' });
1857
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyLogService, decorators: [{
1858
+ type: i0.Injectable,
1859
+ args: [{
1860
+ providedIn: 'root',
1861
+ }]
1862
+ }] });
1863
+
1864
+ /**
1865
+ * @deprecated The `SkyMediaQueryService` no longer needs the `SkyMediaQueryModule`.
1866
+ * The `SkyMediaQueryModule` can be removed from your project.
1867
+ */
1868
+ var SkyMediaQueryModule = /** @class */ (function () {
1869
+ function SkyMediaQueryModule() {
1983
1870
  }
1984
- return ar;
1985
- }
1986
- /** @deprecated */
1987
- function __spread() {
1988
- for (var ar = [], i = 0; i < arguments.length; i++)
1989
- ar = ar.concat(__read(arguments[i]));
1990
- return ar;
1991
- }
1992
- /** @deprecated */
1993
- function __spreadArrays() {
1994
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
1995
- s += arguments[i].length;
1996
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
1997
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
1998
- r[k] = a[j];
1999
- return r;
2000
- }
2001
- function __spreadArray(to, from, pack) {
2002
- if (pack || arguments.length === 2)
2003
- for (var i = 0, l = from.length, ar; i < l; i++) {
2004
- if (ar || !(i in from)) {
2005
- if (!ar)
2006
- ar = Array.prototype.slice.call(from, 0, i);
2007
- ar[i] = from[i];
1871
+ return SkyMediaQueryModule;
1872
+ }());
1873
+ SkyMediaQueryModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1874
+ SkyMediaQueryModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule });
1875
+ SkyMediaQueryModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule });
1876
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryModule, decorators: [{
1877
+ type: i0.NgModule,
1878
+ args: [{}]
1879
+ }] });
1880
+
1881
+ var SkyMediaQueryService = /** @class */ (function () {
1882
+ function SkyMediaQueryService(zone) {
1883
+ this.zone = zone;
1884
+ this.currentSubject = new rxjs.BehaviorSubject(this.current);
1885
+ this._current = exports.SkyMediaBreakpoints.md;
1886
+ this.breakpoints = [
1887
+ {
1888
+ mediaQueryString: SkyMediaQueryService.xs,
1889
+ name: exports.SkyMediaBreakpoints.xs,
1890
+ },
1891
+ {
1892
+ mediaQueryString: SkyMediaQueryService.sm,
1893
+ name: exports.SkyMediaBreakpoints.sm,
1894
+ },
1895
+ {
1896
+ mediaQueryString: SkyMediaQueryService.md,
1897
+ name: exports.SkyMediaBreakpoints.md,
1898
+ },
1899
+ {
1900
+ mediaQueryString: SkyMediaQueryService.lg,
1901
+ name: exports.SkyMediaBreakpoints.lg,
1902
+ },
1903
+ ];
1904
+ this.mediaQueries = [];
1905
+ this.addListeners();
1906
+ }
1907
+ Object.defineProperty(SkyMediaQueryService.prototype, "current", {
1908
+ /**
1909
+ * Returns the current breakpoint.
1910
+ */
1911
+ get: function () {
1912
+ return this._current;
1913
+ },
1914
+ enumerable: false,
1915
+ configurable: true
1916
+ });
1917
+ SkyMediaQueryService.prototype.ngOnDestroy = function () {
1918
+ this.removeListeners();
1919
+ this.currentSubject.complete();
1920
+ };
1921
+ /**
1922
+ * Subscribes to screen size changes.
1923
+ * @param listener Specifies a function that is called when breakpoints change.
1924
+ */
1925
+ SkyMediaQueryService.prototype.subscribe = function (listener) {
1926
+ return this.currentSubject.subscribe({
1927
+ next: function (breakpoints) {
1928
+ listener(breakpoints);
1929
+ },
1930
+ });
1931
+ };
1932
+ /**
1933
+ * @internal
1934
+ */
1935
+ SkyMediaQueryService.prototype.destroy = function () {
1936
+ this.removeListeners();
1937
+ this.currentSubject.complete();
1938
+ };
1939
+ SkyMediaQueryService.prototype.addListeners = function () {
1940
+ var _this = this;
1941
+ this.mediaQueries = this.breakpoints.map(function (breakpoint) {
1942
+ var mq = matchMedia(breakpoint.mediaQueryString);
1943
+ var listener = function (event) {
1944
+ // Run the check outside of Angular's change detection since Angular
1945
+ // does not wrap matchMedia listeners in NgZone.
1946
+ // See: https://blog.assaf.co/angular-2-change-detection-zones-and-an-example/
1947
+ _this.zone.run(function () {
1948
+ if (event.matches) {
1949
+ _this.notifyBreakpointChange(breakpoint.name);
1950
+ }
1951
+ });
1952
+ };
1953
+ mq.addListener(listener);
1954
+ if (mq.matches) {
1955
+ _this.notifyBreakpointChange(breakpoint.name);
2008
1956
  }
2009
- }
2010
- return to.concat(ar || Array.prototype.slice.call(from));
2011
- }
2012
- function __await(v) {
2013
- return this instanceof __await ? (this.v = v, this) : new __await(v);
2014
- }
2015
- function __asyncGenerator(thisArg, _arguments, generator) {
2016
- if (!Symbol.asyncIterator)
2017
- throw new TypeError("Symbol.asyncIterator is not defined.");
2018
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
2019
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
2020
- function verb(n) { if (g[n])
2021
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
2022
- function resume(n, v) { try {
2023
- step(g[n](v));
1957
+ return {
1958
+ mediaQueryList: mq,
1959
+ listener: listener,
1960
+ };
1961
+ });
1962
+ };
1963
+ SkyMediaQueryService.prototype.removeListeners = function () {
1964
+ this.mediaQueries.forEach(function (mediaQuery) {
1965
+ mediaQuery.mediaQueryList.removeListener(mediaQuery.listener);
1966
+ });
1967
+ this.mediaQueries = [];
1968
+ };
1969
+ SkyMediaQueryService.prototype.notifyBreakpointChange = function (breakpoint) {
1970
+ this._current = breakpoint;
1971
+ this.currentSubject.next(breakpoint);
1972
+ };
1973
+ return SkyMediaQueryService;
1974
+ }());
1975
+ /**
1976
+ * The size for the `xs` breakpoint.
1977
+ * @default "(max-width: 767px)"
1978
+ */
1979
+ SkyMediaQueryService.xs = '(max-width: 767px)';
1980
+ /**
1981
+ * The size for the `sm` breakpoint.
1982
+ * @default "(min-width: 768px) and (max-width: 991px)"
1983
+ */
1984
+ SkyMediaQueryService.sm = '(min-width: 768px) and (max-width: 991px)';
1985
+ /**
1986
+ * The size for the `md` breakpoint.
1987
+ * @default "(min-width: 992px) and (max-width: 1199px)"
1988
+ */
1989
+ SkyMediaQueryService.md = '(min-width: 992px) and (max-width: 1199px)';
1990
+ /**
1991
+ * The size for the `lg` breakpoint.
1992
+ * @default "(min-width: 1200px)"
1993
+ */
1994
+ SkyMediaQueryService.lg = '(min-width: 1200px)';
1995
+ SkyMediaQueryService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryService, deps: [{ token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1996
+ SkyMediaQueryService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryService, providedIn: 'root' });
1997
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyMediaQueryService, decorators: [{
1998
+ type: i0.Injectable,
1999
+ args: [{
2000
+ providedIn: 'root',
2001
+ }]
2002
+ }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }]; } });
2003
+
2004
+ /**
2005
+ * NOTICE: DO NOT MODIFY THIS FILE!
2006
+ * The contents of this file were automatically generated by
2007
+ * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-core' schematic.
2008
+ * To update this file, simply rerun the command.
2009
+ */
2010
+ var RESOURCES = {
2011
+ 'EN-US': {
2012
+ skyux_numeric_billions_symbol: { message: 'B' },
2013
+ skyux_numeric_millions_symbol: { message: 'M' },
2014
+ skyux_numeric_thousands_symbol: { message: 'K' },
2015
+ skyux_numeric_trillions_symbol: { message: 'T' },
2016
+ },
2017
+ };
2018
+ var SkyCoreResourcesProvider = /** @class */ (function () {
2019
+ function SkyCoreResourcesProvider() {
2024
2020
  }
2025
- catch (e) {
2026
- settle(q[0][3], e);
2027
- } }
2028
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
2029
- function fulfill(value) { resume("next", value); }
2030
- function reject(value) { resume("throw", value); }
2031
- function settle(f, v) { if (f(v), q.shift(), q.length)
2032
- resume(q[0][0], q[0][1]); }
2033
- }
2034
- function __asyncDelegator(o) {
2035
- var i, p;
2036
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
2037
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
2038
- }
2039
- function __asyncValues(o) {
2040
- if (!Symbol.asyncIterator)
2041
- throw new TypeError("Symbol.asyncIterator is not defined.");
2042
- var m = o[Symbol.asyncIterator], i;
2043
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
2044
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
2045
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
2046
- }
2047
- function __makeTemplateObject(cooked, raw) {
2048
- if (Object.defineProperty) {
2049
- Object.defineProperty(cooked, "raw", { value: raw });
2021
+ SkyCoreResourcesProvider.prototype.getString = function (localeInfo, name) {
2022
+ return i1.getLibStringForLocale(RESOURCES, localeInfo.locale, name);
2023
+ };
2024
+ return SkyCoreResourcesProvider;
2025
+ }());
2026
+ /**
2027
+ * Import into any component library module that needs to use resource strings.
2028
+ */
2029
+ var SkyCoreResourcesModule = /** @class */ (function () {
2030
+ function SkyCoreResourcesModule() {
2050
2031
  }
2051
- else {
2052
- cooked.raw = raw;
2032
+ return SkyCoreResourcesModule;
2033
+ }());
2034
+ SkyCoreResourcesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2035
+ SkyCoreResourcesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, exports: [i1.SkyI18nModule] });
2036
+ SkyCoreResourcesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, providers: [
2037
+ {
2038
+ provide: i1.SKY_LIB_RESOURCES_PROVIDERS,
2039
+ useClass: SkyCoreResourcesProvider,
2040
+ multi: true,
2041
+ },
2042
+ ], imports: [i1.SkyI18nModule] });
2043
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, decorators: [{
2044
+ type: i0.NgModule,
2045
+ args: [{
2046
+ exports: [i1.SkyI18nModule],
2047
+ providers: [
2048
+ {
2049
+ provide: i1.SKY_LIB_RESOURCES_PROVIDERS,
2050
+ useClass: SkyCoreResourcesProvider,
2051
+ multi: true,
2052
+ },
2053
+ ],
2054
+ }]
2055
+ }] });
2056
+
2057
+ /**
2058
+ * Provides arguments for the number to format.
2059
+ */
2060
+ var NumericOptions = /** @class */ (function () {
2061
+ function NumericOptions() {
2062
+ /**
2063
+ * Specifies the maximum number of digits after the decimal separator.
2064
+ * @default 1
2065
+ */
2066
+ this.digits = 1;
2067
+ /**
2068
+ * Specifies how to format the number. Options are `currency` or `number`.
2069
+ * @default "number"
2070
+ */
2071
+ this.format = 'number';
2072
+ /**
2073
+ * Specifies the format of the currency.
2074
+ * @default "standard"
2075
+ */
2076
+ this.currencySign = 'standard';
2077
+ /**
2078
+ * Specifies the ISO4217 currency code to use for currency formatting. If you do not specify a
2079
+ * currency code, the component uses the browser's culture to determine the currency unless your
2080
+ * SPA provides a different culture with `SkyAppLocaleProvider`.
2081
+ * @default "USD"
2082
+ */
2083
+ this.iso = 'USD';
2084
+ /**
2085
+ * Indicates whether to shorten numbers to rounded numbers and abbreviation characters
2086
+ * such as K for thousands, M for millions, B for billions, and T for trillions.
2087
+ */
2088
+ this.truncate = true;
2089
+ /**
2090
+ * Specifies the starting point after which numbers are shortened to rounded numbers
2091
+ * and abbreviation characters.
2092
+ * @default 0
2093
+ */
2094
+ this.truncateAfter = 0;
2053
2095
  }
2054
- return cooked;
2055
- }
2056
- ;
2057
- var __setModuleDefault = Object.create ? (function (o, v) {
2058
- Object.defineProperty(o, "default", { enumerable: true, value: v });
2059
- }) : function (o, v) {
2060
- o["default"] = v;
2061
- };
2062
- function __importStar(mod) {
2063
- if (mod && mod.__esModule)
2064
- return mod;
2065
- var result = {};
2066
- if (mod != null)
2067
- for (var k in mod)
2068
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
2069
- __createBinding(result, mod, k);
2070
- __setModuleDefault(result, mod);
2071
- return result;
2072
- }
2073
- function __importDefault(mod) {
2074
- return (mod && mod.__esModule) ? mod : { default: mod };
2075
- }
2076
- function __classPrivateFieldGet(receiver, state, kind, f) {
2077
- if (kind === "a" && !f)
2078
- throw new TypeError("Private accessor was defined without a getter");
2079
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2080
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
2081
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2082
- }
2083
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
2084
- if (kind === "m")
2085
- throw new TypeError("Private method is not writable");
2086
- if (kind === "a" && !f)
2087
- throw new TypeError("Private accessor was defined without a setter");
2088
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2089
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
2090
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
2091
- }
2096
+ return NumericOptions;
2097
+ }());
2092
2098
 
2093
2099
  /* tslint:disable:no-null-keyword */
2094
2100
  function isNumeric(value) {
@@ -2911,6 +2917,7 @@
2911
2917
  }]
2912
2918
  }] });
2913
2919
 
2920
+ var _SkyResizeObserverService_resizeObserver, _SkyResizeObserverService_tracking;
2914
2921
  /**
2915
2922
  * Service to create rxjs observables for changes to the content box dimensions of elements.
2916
2923
  */
@@ -2918,13 +2925,14 @@
2918
2925
  function SkyResizeObserverService(zone) {
2919
2926
  var _this = this;
2920
2927
  this.zone = zone;
2921
- this._tracking = [];
2922
- this._resizeObserver = new ResizeObserver(function (entries) {
2928
+ _SkyResizeObserverService_resizeObserver.set(this, void 0);
2929
+ _SkyResizeObserverService_tracking.set(this, []);
2930
+ __classPrivateFieldSet(this, _SkyResizeObserverService_resizeObserver, new ResizeObserver(function (entries) {
2923
2931
  entries.forEach(function (entry) { return _this.callback(entry); });
2924
- });
2932
+ }), "f");
2925
2933
  }
2926
2934
  SkyResizeObserverService.prototype.ngOnDestroy = function () {
2927
- this._resizeObserver.disconnect();
2935
+ __classPrivateFieldGet(this, _SkyResizeObserverService_resizeObserver, "f").disconnect();
2928
2936
  };
2929
2937
  /**
2930
2938
  * Create rxjs observable to get size changes for an element ref.
@@ -2934,22 +2942,22 @@
2934
2942
  };
2935
2943
  SkyResizeObserverService.prototype.observeAndTrack = function (element) {
2936
2944
  var _this = this;
2937
- var checkTracking = this._tracking.findIndex(function (value) {
2945
+ var checkTracking = __classPrivateFieldGet(this, _SkyResizeObserverService_tracking, "f").findIndex(function (value) {
2938
2946
  return !value.subject.closed && value.element === element.nativeElement;
2939
2947
  });
2940
2948
  if (checkTracking === -1) {
2941
- this._resizeObserver.observe(element.nativeElement);
2949
+ __classPrivateFieldGet(this, _SkyResizeObserverService_resizeObserver, "f").observe(element.nativeElement);
2942
2950
  }
2943
2951
  var subject = new rxjs.Subject();
2944
2952
  var subjectObservable = subject.pipe(operators.finalize(function () {
2945
2953
  // Are there any other tracking entries still watching this element?
2946
- var checkTracking = _this._tracking.findIndex(function (value) {
2954
+ var checkTracking = __classPrivateFieldGet(_this, _SkyResizeObserverService_tracking, "f").findIndex(function (value) {
2947
2955
  return (value.subject !== subject &&
2948
2956
  !value.subject.closed &&
2949
2957
  value.element === element.nativeElement);
2950
2958
  });
2951
2959
  if (checkTracking === -1) {
2952
- _this._resizeObserver.unobserve(element.nativeElement);
2960
+ __classPrivateFieldGet(_this, _SkyResizeObserverService_resizeObserver, "f").unobserve(element.nativeElement);
2953
2961
  }
2954
2962
  }));
2955
2963
  var tracking = {
@@ -2957,16 +2965,18 @@
2957
2965
  subject: subject,
2958
2966
  subjectObservable: subjectObservable,
2959
2967
  };
2960
- this._tracking.push(tracking);
2968
+ __classPrivateFieldGet(this, _SkyResizeObserverService_tracking, "f").push(tracking);
2961
2969
  return tracking;
2962
2970
  };
2963
2971
  SkyResizeObserverService.prototype.callback = function (entry) {
2964
2972
  var _this = this;
2965
- this._tracking
2973
+ __classPrivateFieldGet(this, _SkyResizeObserverService_tracking, "f")
2966
2974
  .filter(function (value) { return !(value.subject.closed || value.subject.isStopped); })
2967
2975
  .forEach(function (value) {
2968
2976
  /* istanbul ignore else */
2969
2977
  if (value.element === entry.target) {
2978
+ // Execute the callback within NgZone because Angular does not "monkey patch"
2979
+ // ResizeObserver like it does for other features in the DOM.
2970
2980
  _this.zone.run(function () {
2971
2981
  value.subject.next(entry);
2972
2982
  });
@@ -2975,6 +2985,7 @@
2975
2985
  };
2976
2986
  return SkyResizeObserverService;
2977
2987
  }());
2988
+ _SkyResizeObserverService_resizeObserver = new WeakMap(), _SkyResizeObserverService_tracking = new WeakMap();
2978
2989
  SkyResizeObserverService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverService, deps: [{ token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2979
2990
  SkyResizeObserverService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverService, providedIn: 'any' });
2980
2991
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverService, decorators: [{
@@ -2984,6 +2995,7 @@
2984
2995
  }]
2985
2996
  }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }]; } });
2986
2997
 
2998
+ var _SkyResizeObserverMediaQueryService_breakpoints, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, _SkyResizeObserverMediaQueryService_stopListening, _SkyResizeObserverMediaQueryService_target;
2987
2999
  /**
2988
3000
  * Acts like `SkyMediaQueryService` for a container element, emitting the same responsive breakpoints.
2989
3001
  */
@@ -2991,7 +3003,7 @@
2991
3003
  function SkyResizeObserverMediaQueryService(resizeObserverService) {
2992
3004
  var _this = this;
2993
3005
  this.resizeObserverService = resizeObserverService;
2994
- this._breakpoints = [
3006
+ _SkyResizeObserverMediaQueryService_breakpoints.set(this, [
2995
3007
  {
2996
3008
  check: function (width) { return width > 0 && width <= 767; },
2997
3009
  name: exports.SkyMediaBreakpoints.xs,
@@ -3008,11 +3020,12 @@
3008
3020
  check: function (width) { return width > 1199; },
3009
3021
  name: exports.SkyMediaBreakpoints.lg,
3010
3022
  },
3011
- ];
3012
- this._currentBreakpointObservable = new rxjs.ReplaySubject(1);
3013
- this._stopListening = new rxjs.Subject();
3014
- this._stopListening.subscribe(function () {
3015
- _this._target = undefined;
3023
+ ]);
3024
+ _SkyResizeObserverMediaQueryService_currentBreakpointObservable.set(this, new rxjs.ReplaySubject(1));
3025
+ _SkyResizeObserverMediaQueryService_stopListening.set(this, new rxjs.Subject());
3026
+ _SkyResizeObserverMediaQueryService_target.set(this, void 0);
3027
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").subscribe(function () {
3028
+ __classPrivateFieldSet(_this, _SkyResizeObserverMediaQueryService_target, undefined, "f");
3016
3029
  _this.updateBreakpoint(undefined);
3017
3030
  });
3018
3031
  }
@@ -3027,10 +3040,10 @@
3027
3040
  configurable: true
3028
3041
  });
3029
3042
  SkyResizeObserverMediaQueryService.prototype.ngOnDestroy = function () {
3030
- this._stopListening.next();
3043
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").next();
3031
3044
  this._currentBreakpoint = undefined;
3032
- this._stopListening.complete();
3033
- this._currentBreakpointObservable.complete();
3045
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").complete();
3046
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, "f").complete();
3034
3047
  };
3035
3048
  /**
3036
3049
  * @internal
@@ -3044,21 +3057,21 @@
3044
3057
  */
3045
3058
  SkyResizeObserverMediaQueryService.prototype.observe = function (element) {
3046
3059
  var _this = this;
3047
- if (this._target) {
3048
- if (this._target === element) {
3060
+ if (__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_target, "f")) {
3061
+ if (__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_target, "f") === element) {
3049
3062
  return this;
3050
3063
  }
3051
- this._stopListening.next();
3064
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").next();
3052
3065
  }
3053
- this._target = element;
3066
+ __classPrivateFieldSet(this, _SkyResizeObserverMediaQueryService_target, element, "f");
3054
3067
  this.checkWidth(element);
3055
3068
  this.resizeObserverService
3056
3069
  .observe(element)
3057
- .pipe(operators.takeUntil(this._stopListening))
3070
+ .pipe(operators.takeUntil(__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f")))
3058
3071
  .subscribe(function (value) {
3059
3072
  var breakpoint = _this.checkBreakpoint(value.contentRect.width);
3060
3073
  /* istanbul ignore else */
3061
- if (breakpoint !== _this._currentBreakpoint) {
3074
+ if (breakpoint !== _this.current) {
3062
3075
  _this.updateBreakpoint(breakpoint);
3063
3076
  }
3064
3077
  });
@@ -3068,25 +3081,28 @@
3068
3081
  * Stop watching the container element.
3069
3082
  */
3070
3083
  SkyResizeObserverMediaQueryService.prototype.unobserve = function () {
3071
- this._stopListening.next();
3084
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").next();
3072
3085
  };
3073
3086
  /**
3074
3087
  * Subscribes to element size changes that cross breakpoints.
3075
3088
  */
3076
3089
  SkyResizeObserverMediaQueryService.prototype.subscribe = function (listener) {
3077
- return this._currentBreakpointObservable
3078
- .pipe(operators.takeUntil(this._stopListening))
3090
+ return __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, "f")
3091
+ .pipe(operators.takeUntil(__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f")))
3079
3092
  .subscribe(function (value) {
3080
3093
  listener(value);
3081
3094
  });
3082
3095
  };
3083
3096
  SkyResizeObserverMediaQueryService.prototype.updateBreakpoint = function (breakpoint) {
3084
3097
  this._currentBreakpoint = breakpoint;
3085
- this._currentBreakpointObservable.next(breakpoint);
3098
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, "f").next(breakpoint);
3086
3099
  };
3087
3100
  SkyResizeObserverMediaQueryService.prototype.checkBreakpoint = function (width) {
3088
- var _a;
3089
- return (_a = this._breakpoints.find(function (breakpoint) { return breakpoint.check(width); })) === null || _a === void 0 ? void 0 : _a.name;
3101
+ var breakpoint = __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_breakpoints, "f").find(function (breakpoint) { return breakpoint.check(width); });
3102
+ /* istanbul ignore else */
3103
+ if (breakpoint) {
3104
+ return breakpoint.name;
3105
+ }
3090
3106
  };
3091
3107
  SkyResizeObserverMediaQueryService.prototype.checkWidth = function (element) {
3092
3108
  var width = element.nativeElement.offsetWidth || 0;
@@ -3098,6 +3114,7 @@
3098
3114
  };
3099
3115
  return SkyResizeObserverMediaQueryService;
3100
3116
  }());
3117
+ _SkyResizeObserverMediaQueryService_breakpoints = new WeakMap(), _SkyResizeObserverMediaQueryService_currentBreakpointObservable = new WeakMap(), _SkyResizeObserverMediaQueryService_stopListening = new WeakMap(), _SkyResizeObserverMediaQueryService_target = new WeakMap();
3101
3118
  SkyResizeObserverMediaQueryService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverMediaQueryService, deps: [{ token: SkyResizeObserverService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3102
3119
  SkyResizeObserverMediaQueryService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverMediaQueryService, providedIn: 'any' });
3103
3120
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverMediaQueryService, decorators: [{
@@ -3139,8 +3156,7 @@
3139
3156
  /**
3140
3157
  * Returns an observable which emits the given element's current scrollable host
3141
3158
  * @param elementRef The element whose scrollable host is being requested
3142
- * @param completionObservable An observable which alerts the internal observers that they should complete
3143
- * @returns An observable which emits the current scrollable host
3159
+ * @returns An observable which emits the current scrollable host element.
3144
3160
  * @internal
3145
3161
  */
3146
3162
  SkyScrollableHostService.prototype.watchScrollableHost = function (elementRef) {
@@ -3151,11 +3167,13 @@
3151
3167
  return new rxjs.Observable(function (subscriber) {
3152
3168
  subscribers.push(subscriber);
3153
3169
  var scrollableHost = _this.findScrollableHost(elementRef.nativeElement);
3170
+ // Setup mutation observers only once, for all subscribers.
3154
3171
  if (subscribers.length === 1) {
3155
3172
  parentMutationObserver = _this.mutationObserverSvc.create(function () {
3156
3173
  var newScrollableHost = _this.findScrollableHost(elementRef.nativeElement);
3174
+ // Reset observer if scrollable host changes.
3157
3175
  if (newScrollableHost !== scrollableHost &&
3158
- elementRef.nativeElement.offsetParent) {
3176
+ _this.isElementVisible(elementRef)) {
3159
3177
  scrollableHost = newScrollableHost;
3160
3178
  _this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
3161
3179
  notifySubscribers(subscribers, scrollableHost);
@@ -3163,7 +3181,9 @@
3163
3181
  });
3164
3182
  _this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
3165
3183
  documentHiddenElementMutationObserver = _this.mutationObserverSvc.create(function () {
3166
- if (scrollableHost && !elementRef.nativeElement.offsetParent) {
3184
+ if (scrollableHost && !_this.isElementVisible(elementRef)) {
3185
+ // If the scrollable host is not visible, set it to undefined and unsubscribe from its mutation changes.
3186
+ // Then, observe the document element so that a new scrollable host can be found.
3167
3187
  scrollableHost = undefined;
3168
3188
  _this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
3169
3189
  notifySubscribers(subscribers, scrollableHost);
@@ -3171,10 +3191,11 @@
3171
3191
  });
3172
3192
  _this.observeDocumentHiddenElementChanges(documentHiddenElementMutationObserver);
3173
3193
  }
3194
+ // Emit the scrollable host to the subscriber.
3174
3195
  subscriber.next(scrollableHost);
3196
+ // Teardown callback for the subscription.
3175
3197
  subscriber.add(function () {
3176
3198
  var subIndex = subscribers.indexOf(subscriber);
3177
- /* sanity check */
3178
3199
  /* istanbul ignore else */
3179
3200
  if (subIndex >= 0) {
3180
3201
  subscribers.splice(subIndex, 1);
@@ -3189,7 +3210,6 @@
3189
3210
  /**
3190
3211
  * Returns an observable which emits whenever the element's scrollable host emits a scroll event. The observable will always emit the scroll events from the elements current scrollable host and will update based on any scrollable host changes. The observable will also emit once whenever the scrollable host changes.
3191
3212
  * @param elementRef The element whose scrollable host scroll events are being requested
3192
- * @param completionObservable An observable which alerts the internal observers that they should complete
3193
3213
  * @returns An observable which emits when the elements scrollable host is scrolled or is changed
3194
3214
  */
3195
3215
  SkyScrollableHostService.prototype.watchScrollableHostScrollEvents = function (elementRef) {
@@ -3201,6 +3221,7 @@
3201
3221
  var scrollEventSubscription;
3202
3222
  return new rxjs.Observable(function (subscriber) {
3203
3223
  subscribers.push(subscriber);
3224
+ // Setup mutation observers only once, for all subscribers.
3204
3225
  if (subscribers.length === 1) {
3205
3226
  scrollableHostSubscription = _this.watchScrollableHost(elementRef).subscribe(function (newScrollableHost) {
3206
3227
  newScrollableHostObservable.next();
@@ -3210,6 +3231,8 @@
3210
3231
  }
3211
3232
  scrollableHost = newScrollableHost;
3212
3233
  newScrollableHostObservable = new rxjs.Subject();
3234
+ // Only subscribe to scroll events if the host element is defined.
3235
+ /* istanbul ignore else */
3213
3236
  if (newScrollableHost) {
3214
3237
  scrollEventSubscription = rxjs.fromEvent(newScrollableHost, 'scroll')
3215
3238
  .pipe(operators.takeUntil(newScrollableHostObservable))
@@ -3219,9 +3242,9 @@
3219
3242
  }
3220
3243
  });
3221
3244
  }
3245
+ // Teardown callback for the subscription.
3222
3246
  subscriber.add(function () {
3223
3247
  var subIndex = subscribers.indexOf(subscriber);
3224
- /* sanity check */
3225
3248
  /* istanbul ignore else */
3226
3249
  if (subIndex >= 0) {
3227
3250
  subscribers.splice(subIndex, 1);
@@ -3238,7 +3261,6 @@
3238
3261
  var regex = /(auto|scroll)/;
3239
3262
  var windowObj = this.windowRef.nativeWindow;
3240
3263
  var bodyObj = windowObj.document.body;
3241
- /* Sanity check */
3242
3264
  if (!element) {
3243
3265
  return windowObj;
3244
3266
  }
@@ -3246,7 +3268,7 @@
3246
3268
  var parent = element;
3247
3269
  do {
3248
3270
  parent = parent.parentNode;
3249
- /* Sanity check for if this function is called for an element which has been removed from the DOM */
3271
+ // Return `window` if the parent element has been removed from the DOM.
3250
3272
  if (!(parent instanceof HTMLElement)) {
3251
3273
  return windowObj;
3252
3274
  }
@@ -3269,22 +3291,20 @@
3269
3291
  };
3270
3292
  SkyScrollableHostService.prototype.observeForScrollableHostChanges = function (element, mutationObserver) {
3271
3293
  mutationObserver.disconnect();
3272
- if (element instanceof HTMLElement) {
3273
- mutationObserver.observe(element, {
3274
- attributes: true,
3275
- attributeFilter: ['class', 'style'],
3276
- childList: true,
3277
- subtree: true,
3278
- });
3279
- }
3280
- else {
3281
- mutationObserver.observe(document.documentElement, {
3282
- attributes: true,
3283
- attributeFilter: ['class', 'style'],
3284
- childList: true,
3285
- subtree: true,
3286
- });
3287
- }
3294
+ var target = element instanceof HTMLElement ? element : document.documentElement;
3295
+ mutationObserver.observe(target, {
3296
+ attributes: true,
3297
+ attributeFilter: ['class', 'style'],
3298
+ childList: true,
3299
+ subtree: true,
3300
+ });
3301
+ };
3302
+ /**
3303
+ * Determines if an element is "visible" in the DOM.
3304
+ * @see https://stackoverflow.com/a/11639664/6178885
3305
+ */
3306
+ SkyScrollableHostService.prototype.isElementVisible = function (elementRef) {
3307
+ return elementRef.nativeElement.offsetParent;
3288
3308
  };
3289
3309
  return SkyScrollableHostService;
3290
3310
  }());