@skyux/core 5.9.5 → 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 (39) hide show
  1. package/bundles/skyux-core-testing.umd.js +30 -0
  2. package/bundles/skyux-core.umd.js +764 -739
  3. package/documentation.json +149 -146
  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/numeric/numeric.pipe.js +3 -4
  9. package/esm2015/lib/modules/numeric/numeric.pipe.js.map +1 -1
  10. package/esm2015/lib/modules/numeric/numeric.service.js +1 -1
  11. package/esm2015/lib/modules/numeric/numeric.service.js.map +1 -1
  12. package/esm2015/lib/modules/resize-observer/resize-observer-media-query.service.js +42 -29
  13. package/esm2015/lib/modules/resize-observer/resize-observer-media-query.service.js.map +1 -1
  14. package/esm2015/lib/modules/resize-observer/resize-observer.service.js +16 -10
  15. package/esm2015/lib/modules/resize-observer/resize-observer.service.js.map +1 -1
  16. package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js +28 -25
  17. package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js.map +1 -1
  18. package/esm2015/testing/core-testing.module.js +29 -0
  19. package/esm2015/testing/core-testing.module.js.map +1 -0
  20. package/esm2015/testing/mock-media-query.service.js +2 -0
  21. package/esm2015/testing/mock-media-query.service.js.map +1 -1
  22. package/esm2015/testing/mock-ui-config.service.js.map +1 -1
  23. package/esm2015/testing/public-api.js +1 -0
  24. package/esm2015/testing/public-api.js.map +1 -1
  25. package/fesm2015/skyux-core-testing.js +28 -2
  26. package/fesm2015/skyux-core-testing.js.map +1 -1
  27. package/fesm2015/skyux-core.js +103 -77
  28. package/fesm2015/skyux-core.js.map +1 -1
  29. package/lib/modules/adapter-service/adapter.service.d.ts +1 -1
  30. package/lib/modules/affix/affix.service.d.ts +1 -1
  31. package/lib/modules/numeric/numeric.pipe.d.ts +3 -4
  32. package/lib/modules/numeric/numeric.service.d.ts +1 -1
  33. package/lib/modules/resize-observer/resize-observer-media-query.service.d.ts +2 -5
  34. package/lib/modules/resize-observer/resize-observer.service.d.ts +1 -2
  35. package/lib/modules/scrollable-host/scrollable-host.service.d.ts +7 -4
  36. package/package.json +2 -2
  37. package/testing/core-testing.module.d.ts +6 -0
  38. package/testing/mock-ui-config.service.d.ts +2 -1
  39. package/testing/public-api.d.ts +1 -0
@@ -45,225 +45,545 @@
45
45
  args: [{}]
46
46
  }] });
47
47
 
48
- exports.SkyMediaBreakpoints = void 0;
49
- (function (SkyMediaBreakpoints) {
50
- /**
51
- * Indicates screen widths of 767px or less.
52
- */
53
- SkyMediaBreakpoints[SkyMediaBreakpoints["xs"] = 1] = "xs";
54
- /**
55
- * Indicates screen widths of 768px to 991px.
56
- */
57
- SkyMediaBreakpoints[SkyMediaBreakpoints["sm"] = 2] = "sm";
58
- /**
59
- * Indicates screen widths of 992px to 1199px.
60
- */
61
- SkyMediaBreakpoints[SkyMediaBreakpoints["md"] = 3] = "md";
62
- /**
63
- * Indicates screen widths of 1200px or greater.
64
- */
65
- SkyMediaBreakpoints[SkyMediaBreakpoints["lg"] = 4] = "lg";
66
- })(exports.SkyMediaBreakpoints || (exports.SkyMediaBreakpoints = {}));
48
+ /*! *****************************************************************************
49
+ Copyright (c) Microsoft Corporation.
67
50
 
68
- var SKY_TABBABLE_SELECTOR = [
69
- 'a[href]',
70
- 'area[href]',
71
- 'input:not([disabled])',
72
- 'button:not([disabled])',
73
- 'select:not([disabled])',
74
- 'textarea:not([disabled])',
75
- 'iframe',
76
- 'object',
77
- 'embed',
78
- '*[contenteditable=true]:not([disabled])',
79
- '*[tabindex]:not([disabled])',
80
- ].join(', ');
81
- var SkyCoreAdapterService = /** @class */ (function () {
82
- function SkyCoreAdapterService(rendererFactory) {
83
- this.rendererFactory = rendererFactory;
84
- this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
85
- }
86
- /**
87
- * Set the responsive container CSS class for a given element.
88
- *
89
- * @param elementRef - The element that will recieve the new CSS class.
90
- * @param breakpoint - The SkyMediaBreakpoint will determine which class
91
- * gets set. For example a SkyMediaBreakpoint of `xs` will set a CSS class of `sky-responsive-container-xs`.
92
- */
93
- SkyCoreAdapterService.prototype.setResponsiveContainerClass = function (elementRef, breakpoint) {
94
- 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');
99
- var newClass;
100
- switch (breakpoint) {
101
- case exports.SkyMediaBreakpoints.xs: {
102
- newClass = 'sky-responsive-container-xs';
103
- break;
104
- }
105
- case exports.SkyMediaBreakpoints.sm: {
106
- newClass = 'sky-responsive-container-sm';
107
- break;
108
- }
109
- case exports.SkyMediaBreakpoints.md: {
110
- newClass = 'sky-responsive-container-md';
111
- break;
112
- }
113
- default: {
114
- newClass = 'sky-responsive-container-lg';
115
- break;
116
- }
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];
117
85
  }
118
- this.renderer.addClass(nativeEl, newClass);
86
+ return t;
119
87
  };
120
- /**
121
- * This method temporarily enables/disables pointer events.
122
- * This is helpful to prevent iFrames from interfering with drag events.
123
- *
124
- * @param enable - Set to `true` to enable pointer events. Set to `false` to disable.
125
- */
126
- SkyCoreAdapterService.prototype.toggleIframePointerEvents = function (enable) {
127
- var iframes = document.querySelectorAll('iframe');
128
- for (var i = 0; i < iframes.length; i++) {
129
- // Setting to empty string will allow iframe to fall back to its prior CSS assignment.
130
- iframes[i].style.pointerEvents = enable ? '' : 'none';
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]];
131
99
  }
132
- };
133
- /**
134
- * Focuses on the first element found with an `autofocus` attribute inside the supplied `elementRef`.
135
- *
136
- * @param elementRef - The element to search within.
137
- * @return Returns `true` if a child element with autofocus is found.
138
- */
139
- SkyCoreAdapterService.prototype.applyAutoFocus = function (elementRef) {
140
- if (!elementRef) {
141
- return false;
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));
142
124
  }
143
- var elementWithAutoFocus = elementRef.nativeElement.querySelector('[autofocus]');
144
- // Child was found with the autofocus property. Set focus and return true.
145
- if (elementWithAutoFocus) {
146
- elementWithAutoFocus.focus();
147
- return true;
125
+ catch (e) {
126
+ reject(e);
127
+ } }
128
+ function rejected(value) { try {
129
+ step(generator["throw"](value));
148
130
  }
149
- // No children were found with autofocus property. Return false.
150
- return false;
151
- };
152
- /**
153
- * Sets focus on the first focusable child of the `elementRef` parameter.
154
- * If no focusable children are found, and `focusOnContainerIfNoChildrenFound` is `true`,
155
- * focus will be set on the container element.
156
- *
157
- * @param elementRef - The element to search within.
158
- * @param containerSelector - A CSS selector indicating the container that should
159
- * recieve focus if no focusable children are found.
160
- * @param focusOnContainerIfNoChildrenFound - It set to `true`, the container will
161
- * recieve focus if no focusable children are found.
162
- */
163
- SkyCoreAdapterService.prototype.getFocusableChildrenAndApplyFocus = function (elementRef, containerSelector, focusOnContainerIfNoChildrenFound) {
164
- if (focusOnContainerIfNoChildrenFound === void 0) { focusOnContainerIfNoChildrenFound = false; }
165
- var containerElement = elementRef.nativeElement.querySelector(containerSelector);
166
- if (containerElement) {
167
- var focusableChildren = this.getFocusableChildren(containerElement);
168
- // Focus first focusable child if available. Otherwise, set focus on container.
169
- if (!this.focusFirstElement(focusableChildren) &&
170
- focusOnContainerIfNoChildrenFound) {
171
- containerElement.focus();
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, _);
172
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);
173
251
  }
174
- };
175
- /**
176
- * Returns an array of all focusable children of provided `element`.
177
- *
178
- * @param element - The HTMLElement to search within.
179
- * @param options - Options for getting focusable children.
180
- */
181
- SkyCoreAdapterService.prototype.getFocusableChildren = function (element, options) {
182
- var _this = this;
183
- if (!element) {
184
- return [];
185
- }
186
- var elements = Array.prototype.slice.call(element.querySelectorAll(SKY_TABBABLE_SELECTOR));
187
- // Unless ignoreTabIndex = true, filter out elements with tabindex = -1.
188
- if (!options || !options.ignoreTabIndex) {
189
- elements = elements.filter(function (el) {
190
- return el.tabIndex !== -1;
191
- });
252
+ finally {
253
+ if (e)
254
+ throw e.error;
192
255
  }
193
- // Unless ignoreVisibility = true, filter out elements that are not visible.
194
- if (!options || !options.ignoreVisibility) {
195
- elements = elements.filter(function (el) {
196
- return _this.isVisible(el);
197
- });
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
+ }
198
282
  }
199
- return elements;
200
- };
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
+
366
+ exports.SkyMediaBreakpoints = void 0;
367
+ (function (SkyMediaBreakpoints) {
201
368
  /**
202
- * Returns the clientWidth of the provided elementRef.
203
- * @param elementRef - The element to calculate width from.
369
+ * Indicates screen widths of 767px or less.
204
370
  */
205
- SkyCoreAdapterService.prototype.getWidth = function (elementRef) {
206
- return elementRef.nativeElement.clientWidth;
207
- };
371
+ SkyMediaBreakpoints[SkyMediaBreakpoints["xs"] = 1] = "xs";
208
372
  /**
209
- * Checks if an event target has a higher z-index than a given element.
210
- * @param target The event target element.
211
- * @param element The element to test against. A z-index must be explicitly set for this element.
373
+ * Indicates screen widths of 768px to 991px.
212
374
  */
213
- SkyCoreAdapterService.prototype.isTargetAboveElement = function (target, element) {
214
- var zIndex = getComputedStyle(element).zIndex;
215
- var el = target;
216
- while (el) {
217
- // Getting the computed style only works for elements that exist in the DOM.
218
- // In certain scenarios, an element is removed after a click event; by the time the event
219
- // bubbles up to other elements, however, the element has been removed and the computed style returns empty.
220
- // In this case, we'll need to check the z-index directly, via the style property.
221
- var targetZIndex = getComputedStyle(el).zIndex || el.style.zIndex;
222
- if (targetZIndex !== '' &&
223
- targetZIndex !== 'auto' &&
224
- +targetZIndex > +zIndex) {
225
- return true;
226
- }
227
- el = el.parentElement;
228
- }
229
- return false;
230
- };
375
+ SkyMediaBreakpoints[SkyMediaBreakpoints["sm"] = 2] = "sm";
231
376
  /**
232
- * Remove inline height styles from the provided elements.
233
- * @param elementRef - The element to search within.
234
- * @param selector - The CSS selector to use when finding elements for removing height.
377
+ * Indicates screen widths of 992px to 1199px.
235
378
  */
236
- SkyCoreAdapterService.prototype.resetHeight = function (elementRef, selector) {
237
- var children = elementRef.nativeElement.querySelectorAll(selector);
238
- /* istanbul ignore else */
239
- if (children.length > 0) {
240
- for (var i = 0; i < children.length; i++) {
241
- // Setting style attributes with Web API requires null instead of undefined.
242
- // tslint:disable-next-line: no-null-keyword
243
- children[i].style.height = null;
244
- }
245
- }
246
- };
379
+ SkyMediaBreakpoints[SkyMediaBreakpoints["md"] = 3] = "md";
247
380
  /**
248
- * Sets all element heights to match the height of the tallest element.
249
- * @param elementRef - The element to search within.
250
- * @param selector - The CSS selector to use when finding elements for syncing height.
381
+ * Indicates screen widths of 1200px or greater.
251
382
  */
252
- SkyCoreAdapterService.prototype.syncMaxHeight = function (elementRef, selector) {
253
- var children = elementRef.nativeElement.querySelectorAll(selector);
254
- /* istanbul ignore else */
255
- if (children.length > 0) {
256
- var maxHeight = 0;
257
- for (var i = 0; i < children.length; i++) {
258
- maxHeight = Math.max(maxHeight, children[i].offsetHeight);
259
- }
260
- for (var i = 0; i < children.length; i++) {
261
- children[i].style.height = maxHeight + 'px';
262
- }
263
- }
264
- };
265
- SkyCoreAdapterService.prototype.focusFirstElement = function (list) {
266
- if (list.length > 0) {
383
+ SkyMediaBreakpoints[SkyMediaBreakpoints["lg"] = 4] = "lg";
384
+ })(exports.SkyMediaBreakpoints || (exports.SkyMediaBreakpoints = {}));
385
+
386
+ var _SkyCoreAdapterService_renderer;
387
+ var SKY_TABBABLE_SELECTOR = [
388
+ 'a[href]',
389
+ 'area[href]',
390
+ 'input:not([disabled])',
391
+ 'button:not([disabled])',
392
+ 'select:not([disabled])',
393
+ 'textarea:not([disabled])',
394
+ 'iframe',
395
+ 'object',
396
+ 'embed',
397
+ '*[contenteditable=true]:not([disabled])',
398
+ '*[tabindex]:not([disabled])',
399
+ ].join(', ');
400
+ var SkyCoreAdapterService = /** @class */ (function () {
401
+ function SkyCoreAdapterService(rendererFactory) {
402
+ this.rendererFactory = rendererFactory;
403
+ _SkyCoreAdapterService_renderer.set(this, void 0);
404
+ __classPrivateFieldSet(this, _SkyCoreAdapterService_renderer, this.rendererFactory.createRenderer(undefined, null), "f");
405
+ }
406
+ /**
407
+ * Set the responsive container CSS class for a given element.
408
+ *
409
+ * @param elementRef - The element that will recieve the new CSS class.
410
+ * @param breakpoint - The SkyMediaBreakpoint will determine which class
411
+ * gets set. For example a SkyMediaBreakpoint of `xs` will set a CSS class of `sky-responsive-container-xs`.
412
+ */
413
+ SkyCoreAdapterService.prototype.setResponsiveContainerClass = function (elementRef, breakpoint) {
414
+ var nativeEl = elementRef.nativeElement;
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');
419
+ var newClass;
420
+ switch (breakpoint) {
421
+ case exports.SkyMediaBreakpoints.xs: {
422
+ newClass = 'sky-responsive-container-xs';
423
+ break;
424
+ }
425
+ case exports.SkyMediaBreakpoints.sm: {
426
+ newClass = 'sky-responsive-container-sm';
427
+ break;
428
+ }
429
+ case exports.SkyMediaBreakpoints.md: {
430
+ newClass = 'sky-responsive-container-md';
431
+ break;
432
+ }
433
+ default: {
434
+ newClass = 'sky-responsive-container-lg';
435
+ break;
436
+ }
437
+ }
438
+ __classPrivateFieldGet(this, _SkyCoreAdapterService_renderer, "f").addClass(nativeEl, newClass);
439
+ };
440
+ /**
441
+ * This method temporarily enables/disables pointer events.
442
+ * This is helpful to prevent iFrames from interfering with drag events.
443
+ *
444
+ * @param enable - Set to `true` to enable pointer events. Set to `false` to disable.
445
+ */
446
+ SkyCoreAdapterService.prototype.toggleIframePointerEvents = function (enable) {
447
+ var iframes = document.querySelectorAll('iframe');
448
+ for (var i = 0; i < iframes.length; i++) {
449
+ // Setting to empty string will allow iframe to fall back to its prior CSS assignment.
450
+ iframes[i].style.pointerEvents = enable ? '' : 'none';
451
+ }
452
+ };
453
+ /**
454
+ * Focuses on the first element found with an `autofocus` attribute inside the supplied `elementRef`.
455
+ *
456
+ * @param elementRef - The element to search within.
457
+ * @return Returns `true` if a child element with autofocus is found.
458
+ */
459
+ SkyCoreAdapterService.prototype.applyAutoFocus = function (elementRef) {
460
+ if (!elementRef) {
461
+ return false;
462
+ }
463
+ var elementWithAutoFocus = elementRef.nativeElement.querySelector('[autofocus]');
464
+ // Child was found with the autofocus property. Set focus and return true.
465
+ if (elementWithAutoFocus) {
466
+ elementWithAutoFocus.focus();
467
+ return true;
468
+ }
469
+ // No children were found with autofocus property. Return false.
470
+ return false;
471
+ };
472
+ /**
473
+ * Sets focus on the first focusable child of the `elementRef` parameter.
474
+ * If no focusable children are found, and `focusOnContainerIfNoChildrenFound` is `true`,
475
+ * focus will be set on the container element.
476
+ *
477
+ * @param elementRef - The element to search within.
478
+ * @param containerSelector - A CSS selector indicating the container that should
479
+ * recieve focus if no focusable children are found.
480
+ * @param focusOnContainerIfNoChildrenFound - It set to `true`, the container will
481
+ * recieve focus if no focusable children are found.
482
+ */
483
+ SkyCoreAdapterService.prototype.getFocusableChildrenAndApplyFocus = function (elementRef, containerSelector, focusOnContainerIfNoChildrenFound) {
484
+ if (focusOnContainerIfNoChildrenFound === void 0) { focusOnContainerIfNoChildrenFound = false; }
485
+ var containerElement = elementRef.nativeElement.querySelector(containerSelector);
486
+ if (containerElement) {
487
+ var focusableChildren = this.getFocusableChildren(containerElement);
488
+ // Focus first focusable child if available. Otherwise, set focus on container.
489
+ if (!this.focusFirstElement(focusableChildren) &&
490
+ focusOnContainerIfNoChildrenFound) {
491
+ containerElement.focus();
492
+ }
493
+ }
494
+ };
495
+ /**
496
+ * Returns an array of all focusable children of provided `element`.
497
+ *
498
+ * @param element - The HTMLElement to search within.
499
+ * @param options - Options for getting focusable children.
500
+ */
501
+ SkyCoreAdapterService.prototype.getFocusableChildren = function (element, options) {
502
+ var _this = this;
503
+ if (!element) {
504
+ return [];
505
+ }
506
+ var elements = Array.prototype.slice.call(element.querySelectorAll(SKY_TABBABLE_SELECTOR));
507
+ // Unless ignoreTabIndex = true, filter out elements with tabindex = -1.
508
+ if (!options || !options.ignoreTabIndex) {
509
+ elements = elements.filter(function (el) {
510
+ return el.tabIndex !== -1;
511
+ });
512
+ }
513
+ // Unless ignoreVisibility = true, filter out elements that are not visible.
514
+ if (!options || !options.ignoreVisibility) {
515
+ elements = elements.filter(function (el) {
516
+ return _this.isVisible(el);
517
+ });
518
+ }
519
+ return elements;
520
+ };
521
+ /**
522
+ * Returns the clientWidth of the provided elementRef.
523
+ * @param elementRef - The element to calculate width from.
524
+ */
525
+ SkyCoreAdapterService.prototype.getWidth = function (elementRef) {
526
+ return elementRef.nativeElement.clientWidth;
527
+ };
528
+ /**
529
+ * Checks if an event target has a higher z-index than a given element.
530
+ * @param target The event target element.
531
+ * @param element The element to test against. A z-index must be explicitly set for this element.
532
+ */
533
+ SkyCoreAdapterService.prototype.isTargetAboveElement = function (target, element) {
534
+ var zIndex = getComputedStyle(element).zIndex;
535
+ var el = target;
536
+ while (el) {
537
+ // Getting the computed style only works for elements that exist in the DOM.
538
+ // In certain scenarios, an element is removed after a click event; by the time the event
539
+ // bubbles up to other elements, however, the element has been removed and the computed style returns empty.
540
+ // In this case, we'll need to check the z-index directly, via the style property.
541
+ var targetZIndex = getComputedStyle(el).zIndex || el.style.zIndex;
542
+ if (targetZIndex !== '' &&
543
+ targetZIndex !== 'auto' &&
544
+ +targetZIndex > +zIndex) {
545
+ return true;
546
+ }
547
+ el = el.parentElement;
548
+ }
549
+ return false;
550
+ };
551
+ /**
552
+ * Remove inline height styles from the provided elements.
553
+ * @param elementRef - The element to search within.
554
+ * @param selector - The CSS selector to use when finding elements for removing height.
555
+ */
556
+ SkyCoreAdapterService.prototype.resetHeight = function (elementRef, selector) {
557
+ var children = elementRef.nativeElement.querySelectorAll(selector);
558
+ /* istanbul ignore else */
559
+ if (children.length > 0) {
560
+ for (var i = 0; i < children.length; i++) {
561
+ // Setting style attributes with Web API requires null instead of undefined.
562
+ // tslint:disable-next-line: no-null-keyword
563
+ children[i].style.height = null;
564
+ }
565
+ }
566
+ };
567
+ /**
568
+ * Sets all element heights to match the height of the tallest element.
569
+ * @param elementRef - The element to search within.
570
+ * @param selector - The CSS selector to use when finding elements for syncing height.
571
+ */
572
+ SkyCoreAdapterService.prototype.syncMaxHeight = function (elementRef, selector) {
573
+ var children = elementRef.nativeElement.querySelectorAll(selector);
574
+ /* istanbul ignore else */
575
+ if (children.length > 0) {
576
+ var maxHeight = 0;
577
+ for (var i = 0; i < children.length; i++) {
578
+ maxHeight = Math.max(maxHeight, children[i].offsetHeight);
579
+ }
580
+ for (var i = 0; i < children.length; i++) {
581
+ children[i].style.height = maxHeight + 'px';
582
+ }
583
+ }
584
+ };
585
+ SkyCoreAdapterService.prototype.focusFirstElement = function (list) {
586
+ if (list.length > 0) {
267
587
  list[0].focus();
268
588
  return true;
269
589
  }
@@ -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: [{
@@ -1618,477 +1942,159 @@
1618
1942
  var mq = matchMedia(breakpoint.mediaQueryString);
1619
1943
  var listener = function (event) {
1620
1944
  // 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);
1632
- }
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);
1699
- };
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;
1709
- }());
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
- SkyCoreResourcesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyCoreResourcesModule, exports: [i1.SkyI18nModule] });
1712
- SkyCoreResourcesModule.ɵinj = 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,
1721
- args: [{
1722
- exports: [i1.SkyI18nModule],
1723
- providers: [
1724
- {
1725
- provide: i1.SKY_LIB_RESOURCES_PROVIDERS,
1726
- useClass: SkyCoreResourcesProvider,
1727
- multi: true,
1728
- },
1729
- ],
1730
- }]
1731
- }] });
1732
-
1733
- /**
1734
- * Provides arguments for the number to format.
1735
- */
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;
1771
- }
1772
- return NumericOptions;
1773
- }());
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 };
1932
- }
1933
- }
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);
1970
- }
1971
- catch (error) {
1972
- e = { error: error };
1973
- }
1974
- finally {
1975
- try {
1976
- if (r && !r.done && (m = i["return"]))
1977
- m.call(i);
1978
- }
1979
- finally {
1980
- if (e)
1981
- throw e.error;
1982
- }
1983
- }
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];
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) {
@@ -2187,7 +2193,7 @@
2187
2193
  configurable: true
2188
2194
  });
2189
2195
  /**
2190
- * Shortens with or without symbol (K/M/B/T) depending on value of number.
2196
+ * Formats a number based on the provided options.
2191
2197
  * @param value The number to format.
2192
2198
  * @param options Format options.
2193
2199
  */
@@ -2357,10 +2363,6 @@
2357
2363
  * M for millions, B for billions, and T for trillions. The pipe also formats for currency.
2358
2364
  * Be sure you have a space after the two curly brackets opening the pipe and
2359
2365
  * a space before the two curly brackets closing the pipe or it will not work.
2360
- * Usage:
2361
- * ```
2362
- * {{ value | skyNumeric(config) }}
2363
- * ```
2364
2366
  */
2365
2367
  var SkyNumericPipe = /** @class */ (function () {
2366
2368
  function SkyNumericPipe(localeProvider, numericService, changeDetector) {
@@ -2382,6 +2384,9 @@
2382
2384
  this.ngUnsubscribe.next();
2383
2385
  this.ngUnsubscribe.complete();
2384
2386
  };
2387
+ /**
2388
+ * Formats a number based on the provided options.
2389
+ */
2385
2390
  SkyNumericPipe.prototype.transform = function (value, config) {
2386
2391
  var _a;
2387
2392
  var newCacheKey = (config ? JSON.stringify(config, Object.keys(config).sort()) : '') +
@@ -2912,6 +2917,7 @@
2912
2917
  }]
2913
2918
  }] });
2914
2919
 
2920
+ var _SkyResizeObserverService_resizeObserver, _SkyResizeObserverService_tracking;
2915
2921
  /**
2916
2922
  * Service to create rxjs observables for changes to the content box dimensions of elements.
2917
2923
  */
@@ -2919,13 +2925,14 @@
2919
2925
  function SkyResizeObserverService(zone) {
2920
2926
  var _this = this;
2921
2927
  this.zone = zone;
2922
- this._tracking = [];
2923
- 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) {
2924
2931
  entries.forEach(function (entry) { return _this.callback(entry); });
2925
- });
2932
+ }), "f");
2926
2933
  }
2927
2934
  SkyResizeObserverService.prototype.ngOnDestroy = function () {
2928
- this._resizeObserver.disconnect();
2935
+ __classPrivateFieldGet(this, _SkyResizeObserverService_resizeObserver, "f").disconnect();
2929
2936
  };
2930
2937
  /**
2931
2938
  * Create rxjs observable to get size changes for an element ref.
@@ -2935,22 +2942,22 @@
2935
2942
  };
2936
2943
  SkyResizeObserverService.prototype.observeAndTrack = function (element) {
2937
2944
  var _this = this;
2938
- var checkTracking = this._tracking.findIndex(function (value) {
2945
+ var checkTracking = __classPrivateFieldGet(this, _SkyResizeObserverService_tracking, "f").findIndex(function (value) {
2939
2946
  return !value.subject.closed && value.element === element.nativeElement;
2940
2947
  });
2941
2948
  if (checkTracking === -1) {
2942
- this._resizeObserver.observe(element.nativeElement);
2949
+ __classPrivateFieldGet(this, _SkyResizeObserverService_resizeObserver, "f").observe(element.nativeElement);
2943
2950
  }
2944
2951
  var subject = new rxjs.Subject();
2945
2952
  var subjectObservable = subject.pipe(operators.finalize(function () {
2946
2953
  // Are there any other tracking entries still watching this element?
2947
- var checkTracking = _this._tracking.findIndex(function (value) {
2954
+ var checkTracking = __classPrivateFieldGet(_this, _SkyResizeObserverService_tracking, "f").findIndex(function (value) {
2948
2955
  return (value.subject !== subject &&
2949
2956
  !value.subject.closed &&
2950
2957
  value.element === element.nativeElement);
2951
2958
  });
2952
2959
  if (checkTracking === -1) {
2953
- _this._resizeObserver.unobserve(element.nativeElement);
2960
+ __classPrivateFieldGet(_this, _SkyResizeObserverService_resizeObserver, "f").unobserve(element.nativeElement);
2954
2961
  }
2955
2962
  }));
2956
2963
  var tracking = {
@@ -2958,16 +2965,18 @@
2958
2965
  subject: subject,
2959
2966
  subjectObservable: subjectObservable,
2960
2967
  };
2961
- this._tracking.push(tracking);
2968
+ __classPrivateFieldGet(this, _SkyResizeObserverService_tracking, "f").push(tracking);
2962
2969
  return tracking;
2963
2970
  };
2964
2971
  SkyResizeObserverService.prototype.callback = function (entry) {
2965
2972
  var _this = this;
2966
- this._tracking
2973
+ __classPrivateFieldGet(this, _SkyResizeObserverService_tracking, "f")
2967
2974
  .filter(function (value) { return !(value.subject.closed || value.subject.isStopped); })
2968
2975
  .forEach(function (value) {
2969
2976
  /* istanbul ignore else */
2970
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.
2971
2980
  _this.zone.run(function () {
2972
2981
  value.subject.next(entry);
2973
2982
  });
@@ -2976,6 +2985,7 @@
2976
2985
  };
2977
2986
  return SkyResizeObserverService;
2978
2987
  }());
2988
+ _SkyResizeObserverService_resizeObserver = new WeakMap(), _SkyResizeObserverService_tracking = new WeakMap();
2979
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 });
2980
2990
  SkyResizeObserverService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverService, providedIn: 'any' });
2981
2991
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverService, decorators: [{
@@ -2985,6 +2995,7 @@
2985
2995
  }]
2986
2996
  }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }]; } });
2987
2997
 
2998
+ var _SkyResizeObserverMediaQueryService_breakpoints, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, _SkyResizeObserverMediaQueryService_stopListening, _SkyResizeObserverMediaQueryService_target;
2988
2999
  /**
2989
3000
  * Acts like `SkyMediaQueryService` for a container element, emitting the same responsive breakpoints.
2990
3001
  */
@@ -2992,9 +3003,9 @@
2992
3003
  function SkyResizeObserverMediaQueryService(resizeObserverService) {
2993
3004
  var _this = this;
2994
3005
  this.resizeObserverService = resizeObserverService;
2995
- this._breakpoints = [
3006
+ _SkyResizeObserverMediaQueryService_breakpoints.set(this, [
2996
3007
  {
2997
- check: function (width) { return width <= 767; },
3008
+ check: function (width) { return width > 0 && width <= 767; },
2998
3009
  name: exports.SkyMediaBreakpoints.xs,
2999
3010
  },
3000
3011
  {
@@ -3009,11 +3020,12 @@
3009
3020
  check: function (width) { return width > 1199; },
3010
3021
  name: exports.SkyMediaBreakpoints.lg,
3011
3022
  },
3012
- ];
3013
- this._currentBreakpointObservable = new rxjs.ReplaySubject(1);
3014
- this._stopListening = new rxjs.Subject();
3015
- this._stopListening.subscribe(function () {
3016
- _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");
3017
3029
  _this.updateBreakpoint(undefined);
3018
3030
  });
3019
3031
  }
@@ -3028,10 +3040,10 @@
3028
3040
  configurable: true
3029
3041
  });
3030
3042
  SkyResizeObserverMediaQueryService.prototype.ngOnDestroy = function () {
3031
- this._stopListening.next();
3043
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").next();
3032
3044
  this._currentBreakpoint = undefined;
3033
- this._stopListening.complete();
3034
- this._currentBreakpointObservable.complete();
3045
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").complete();
3046
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, "f").complete();
3035
3047
  };
3036
3048
  /**
3037
3049
  * @internal
@@ -3045,25 +3057,21 @@
3045
3057
  */
3046
3058
  SkyResizeObserverMediaQueryService.prototype.observe = function (element) {
3047
3059
  var _this = this;
3048
- if (this._target) {
3049
- if (this._target === element) {
3060
+ if (__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_target, "f")) {
3061
+ if (__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_target, "f") === element) {
3050
3062
  return this;
3051
3063
  }
3052
- this._stopListening.next();
3053
- }
3054
- this._target = element;
3055
- var width = element.nativeElement.offsetWidth;
3056
- if (width) {
3057
- var breakpoint = this.checkBreakpoint(width);
3058
- this.updateBreakpoint(breakpoint);
3064
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").next();
3059
3065
  }
3060
- this._resizeSubscription = this.resizeObserverService
3066
+ __classPrivateFieldSet(this, _SkyResizeObserverMediaQueryService_target, element, "f");
3067
+ this.checkWidth(element);
3068
+ this.resizeObserverService
3061
3069
  .observe(element)
3062
- .pipe(operators.takeUntil(this._stopListening))
3070
+ .pipe(operators.takeUntil(__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f")))
3063
3071
  .subscribe(function (value) {
3064
3072
  var breakpoint = _this.checkBreakpoint(value.contentRect.width);
3065
3073
  /* istanbul ignore else */
3066
- if (breakpoint !== _this._currentBreakpoint) {
3074
+ if (breakpoint !== _this.current) {
3067
3075
  _this.updateBreakpoint(breakpoint);
3068
3076
  }
3069
3077
  });
@@ -3073,26 +3081,40 @@
3073
3081
  * Stop watching the container element.
3074
3082
  */
3075
3083
  SkyResizeObserverMediaQueryService.prototype.unobserve = function () {
3076
- this._stopListening.next();
3084
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f").next();
3077
3085
  };
3078
3086
  /**
3079
3087
  * Subscribes to element size changes that cross breakpoints.
3080
3088
  */
3081
3089
  SkyResizeObserverMediaQueryService.prototype.subscribe = function (listener) {
3082
- return this._currentBreakpointObservable
3083
- .pipe(operators.takeUntil(this._stopListening))
3084
- .subscribe(listener);
3090
+ return __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, "f")
3091
+ .pipe(operators.takeUntil(__classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_stopListening, "f")))
3092
+ .subscribe(function (value) {
3093
+ listener(value);
3094
+ });
3085
3095
  };
3086
3096
  SkyResizeObserverMediaQueryService.prototype.updateBreakpoint = function (breakpoint) {
3087
3097
  this._currentBreakpoint = breakpoint;
3088
- this._currentBreakpointObservable.next(breakpoint);
3098
+ __classPrivateFieldGet(this, _SkyResizeObserverMediaQueryService_currentBreakpointObservable, "f").next(breakpoint);
3089
3099
  };
3090
3100
  SkyResizeObserverMediaQueryService.prototype.checkBreakpoint = function (width) {
3091
- var _a;
3092
- 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
+ }
3106
+ };
3107
+ SkyResizeObserverMediaQueryService.prototype.checkWidth = function (element) {
3108
+ var width = element.nativeElement.offsetWidth || 0;
3109
+ var breakpoint = this.checkBreakpoint(width);
3110
+ /* istanbul ignore else */
3111
+ if (breakpoint !== this._currentBreakpoint) {
3112
+ this.updateBreakpoint(breakpoint);
3113
+ }
3093
3114
  };
3094
3115
  return SkyResizeObserverMediaQueryService;
3095
3116
  }());
3117
+ _SkyResizeObserverMediaQueryService_breakpoints = new WeakMap(), _SkyResizeObserverMediaQueryService_currentBreakpointObservable = new WeakMap(), _SkyResizeObserverMediaQueryService_stopListening = new WeakMap(), _SkyResizeObserverMediaQueryService_target = new WeakMap();
3096
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 });
3097
3119
  SkyResizeObserverMediaQueryService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverMediaQueryService, providedIn: 'any' });
3098
3120
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverMediaQueryService, decorators: [{
@@ -3134,8 +3156,7 @@
3134
3156
  /**
3135
3157
  * Returns an observable which emits the given element's current scrollable host
3136
3158
  * @param elementRef The element whose scrollable host is being requested
3137
- * @param completionObservable An observable which alerts the internal observers that they should complete
3138
- * @returns An observable which emits the current scrollable host
3159
+ * @returns An observable which emits the current scrollable host element.
3139
3160
  * @internal
3140
3161
  */
3141
3162
  SkyScrollableHostService.prototype.watchScrollableHost = function (elementRef) {
@@ -3146,11 +3167,13 @@
3146
3167
  return new rxjs.Observable(function (subscriber) {
3147
3168
  subscribers.push(subscriber);
3148
3169
  var scrollableHost = _this.findScrollableHost(elementRef.nativeElement);
3170
+ // Setup mutation observers only once, for all subscribers.
3149
3171
  if (subscribers.length === 1) {
3150
3172
  parentMutationObserver = _this.mutationObserverSvc.create(function () {
3151
3173
  var newScrollableHost = _this.findScrollableHost(elementRef.nativeElement);
3174
+ // Reset observer if scrollable host changes.
3152
3175
  if (newScrollableHost !== scrollableHost &&
3153
- elementRef.nativeElement.offsetParent) {
3176
+ _this.isElementVisible(elementRef)) {
3154
3177
  scrollableHost = newScrollableHost;
3155
3178
  _this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
3156
3179
  notifySubscribers(subscribers, scrollableHost);
@@ -3158,7 +3181,9 @@
3158
3181
  });
3159
3182
  _this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
3160
3183
  documentHiddenElementMutationObserver = _this.mutationObserverSvc.create(function () {
3161
- 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.
3162
3187
  scrollableHost = undefined;
3163
3188
  _this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
3164
3189
  notifySubscribers(subscribers, scrollableHost);
@@ -3166,10 +3191,11 @@
3166
3191
  });
3167
3192
  _this.observeDocumentHiddenElementChanges(documentHiddenElementMutationObserver);
3168
3193
  }
3194
+ // Emit the scrollable host to the subscriber.
3169
3195
  subscriber.next(scrollableHost);
3196
+ // Teardown callback for the subscription.
3170
3197
  subscriber.add(function () {
3171
3198
  var subIndex = subscribers.indexOf(subscriber);
3172
- /* sanity check */
3173
3199
  /* istanbul ignore else */
3174
3200
  if (subIndex >= 0) {
3175
3201
  subscribers.splice(subIndex, 1);
@@ -3184,7 +3210,6 @@
3184
3210
  /**
3185
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.
3186
3212
  * @param elementRef The element whose scrollable host scroll events are being requested
3187
- * @param completionObservable An observable which alerts the internal observers that they should complete
3188
3213
  * @returns An observable which emits when the elements scrollable host is scrolled or is changed
3189
3214
  */
3190
3215
  SkyScrollableHostService.prototype.watchScrollableHostScrollEvents = function (elementRef) {
@@ -3196,6 +3221,7 @@
3196
3221
  var scrollEventSubscription;
3197
3222
  return new rxjs.Observable(function (subscriber) {
3198
3223
  subscribers.push(subscriber);
3224
+ // Setup mutation observers only once, for all subscribers.
3199
3225
  if (subscribers.length === 1) {
3200
3226
  scrollableHostSubscription = _this.watchScrollableHost(elementRef).subscribe(function (newScrollableHost) {
3201
3227
  newScrollableHostObservable.next();
@@ -3205,6 +3231,8 @@
3205
3231
  }
3206
3232
  scrollableHost = newScrollableHost;
3207
3233
  newScrollableHostObservable = new rxjs.Subject();
3234
+ // Only subscribe to scroll events if the host element is defined.
3235
+ /* istanbul ignore else */
3208
3236
  if (newScrollableHost) {
3209
3237
  scrollEventSubscription = rxjs.fromEvent(newScrollableHost, 'scroll')
3210
3238
  .pipe(operators.takeUntil(newScrollableHostObservable))
@@ -3214,9 +3242,9 @@
3214
3242
  }
3215
3243
  });
3216
3244
  }
3245
+ // Teardown callback for the subscription.
3217
3246
  subscriber.add(function () {
3218
3247
  var subIndex = subscribers.indexOf(subscriber);
3219
- /* sanity check */
3220
3248
  /* istanbul ignore else */
3221
3249
  if (subIndex >= 0) {
3222
3250
  subscribers.splice(subIndex, 1);
@@ -3233,7 +3261,6 @@
3233
3261
  var regex = /(auto|scroll)/;
3234
3262
  var windowObj = this.windowRef.nativeWindow;
3235
3263
  var bodyObj = windowObj.document.body;
3236
- /* Sanity check */
3237
3264
  if (!element) {
3238
3265
  return windowObj;
3239
3266
  }
@@ -3241,7 +3268,7 @@
3241
3268
  var parent = element;
3242
3269
  do {
3243
3270
  parent = parent.parentNode;
3244
- /* 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.
3245
3272
  if (!(parent instanceof HTMLElement)) {
3246
3273
  return windowObj;
3247
3274
  }
@@ -3264,22 +3291,20 @@
3264
3291
  };
3265
3292
  SkyScrollableHostService.prototype.observeForScrollableHostChanges = function (element, mutationObserver) {
3266
3293
  mutationObserver.disconnect();
3267
- if (element instanceof HTMLElement) {
3268
- mutationObserver.observe(element, {
3269
- attributes: true,
3270
- attributeFilter: ['class', 'style'],
3271
- childList: true,
3272
- subtree: true,
3273
- });
3274
- }
3275
- else {
3276
- mutationObserver.observe(document.documentElement, {
3277
- attributes: true,
3278
- attributeFilter: ['class', 'style'],
3279
- childList: true,
3280
- subtree: true,
3281
- });
3282
- }
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;
3283
3308
  };
3284
3309
  return SkyScrollableHostService;
3285
3310
  }());