@dontdrinkandroot/ngx-material-extensions 0.0.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_index.scss +149 -0
- package/{esm2015/dontdrinkandroot-ngx-material-extensions.js → esm2020/dontdrinkandroot-ngx-material-extensions.mjs} +1 -1
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +1 -1
- package/esm2020/src/ddr-material-extensions.module.mjs +51 -0
- package/esm2020/src/gridlist/grid-tile-lazy-image-container.directive.mjs +55 -0
- package/esm2020/src/gridlist/grid-tile-lazy-img.directive.mjs +115 -0
- package/esm2020/src/sidenav/sidenav-container.component.mjs +39 -0
- package/esm2020/src/sidenav/sidenav-toggle.component.mjs +29 -0
- package/esm2020/src/sidenav/sidenav.service.mjs +65 -0
- package/fesm2015/dontdrinkandroot-ngx-material-extensions.mjs +346 -0
- package/fesm2015/dontdrinkandroot-ngx-material-extensions.mjs.map +1 -0
- package/fesm2020/dontdrinkandroot-ngx-material-extensions.mjs +346 -0
- package/fesm2020/dontdrinkandroot-ngx-material-extensions.mjs.map +1 -0
- package/{dontdrinkandroot-ngx-material-extensions.d.ts → index.d.ts} +1 -0
- package/package.json +26 -14
- package/src/ddr-material-extensions.module.d.ts +12 -0
- package/src/gridlist/grid-tile-lazy-image-container.directive.d.ts +3 -0
- package/src/gridlist/grid-tile-lazy-img.directive.d.ts +3 -0
- package/src/sidenav/sidenav-container.component.d.ts +3 -0
- package/src/sidenav/sidenav-toggle.component.d.ts +3 -0
- package/src/sidenav/sidenav.service.d.ts +3 -0
- package/bundles/dontdrinkandroot-ngx-material-extensions.umd.js +0 -619
- package/bundles/dontdrinkandroot-ngx-material-extensions.umd.js.map +0 -1
- package/bundles/dontdrinkandroot-ngx-material-extensions.umd.min.js +0 -2
- package/bundles/dontdrinkandroot-ngx-material-extensions.umd.min.js.map +0 -1
- package/dontdrinkandroot-ngx-material-extensions.metadata.json +0 -1
- package/esm2015/src/ddr-material-extensions.module.js +0 -34
- package/esm2015/src/gridlist/grid-tile-lazy-image-container.directive.js +0 -47
- package/esm2015/src/gridlist/grid-tile-lazy-img.directive.js +0 -102
- package/esm2015/src/sidenav/sidenav-container.component.js +0 -39
- package/esm2015/src/sidenav/sidenav-toggle.component.js +0 -23
- package/esm2015/src/sidenav/sidenav.service.js +0 -66
- package/fesm2015/dontdrinkandroot-ngx-material-extensions.js +0 -305
- package/fesm2015/dontdrinkandroot-ngx-material-extensions.js.map +0 -1
- package/style.scss +0 -130
|
@@ -1,619 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/cdk/layout'), require('rxjs/operators'), require('@angular/router'), require('@angular/material/button'), require('@angular/material/icon'), require('@angular/material/sidenav'), require('@dontdrinkandroot/ngx-extensions'), require('@angular/common')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@dontdrinkandroot/ngx-material-extensions', ['exports', '@angular/core', '@angular/cdk/layout', 'rxjs/operators', '@angular/router', '@angular/material/button', '@angular/material/icon', '@angular/material/sidenav', '@dontdrinkandroot/ngx-extensions', '@angular/common'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.dontdrinkandroot = global.dontdrinkandroot || {}, global.dontdrinkandroot['ngx-material-extensions'] = {}), global.ng.core, global.ng.cdk.layout, global.rxjs.operators, global.ng.router, global.ng.material.button, global.ng.material.icon, global.ng.material.sidenav, global.ngxExtensions, global.ng.common));
|
|
5
|
-
}(this, (function (exports, i0, i1, operators, i2, button, icon, sidenav, ngxExtensions, common) { 'use strict';
|
|
6
|
-
|
|
7
|
-
var SidenavService = /** @class */ (function () {
|
|
8
|
-
function SidenavService(breakpointObserver, router) {
|
|
9
|
-
var _this = this;
|
|
10
|
-
this.breakpointObserver = breakpointObserver;
|
|
11
|
-
this.router = router;
|
|
12
|
-
this.stayOpenOnLargeScreen = false;
|
|
13
|
-
this.largeBreakpoints = [
|
|
14
|
-
i1.Breakpoints.Medium,
|
|
15
|
-
i1.Breakpoints.Large,
|
|
16
|
-
i1.Breakpoints.XLarge
|
|
17
|
-
];
|
|
18
|
-
this.screenLarge$ = this.breakpointObserver.observe(this.largeBreakpoints).pipe(operators.map(function (result) { return result.matches; }));
|
|
19
|
-
this.mode$ = this.screenLarge$.pipe(operators.map(function (large) { return large && _this.stayOpenOnLargeScreen ? 'side' : 'over'; }));
|
|
20
|
-
this.opened$ = this.screenLarge$.pipe(operators.map(function (large) { return large && _this.stayOpenOnLargeScreen; }));
|
|
21
|
-
this.router.events.subscribe(function (event) {
|
|
22
|
-
if (event instanceof i2.NavigationStart) {
|
|
23
|
-
_this.closeSidebar();
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
SidenavService.prototype.setSidenav = function (sidenav) {
|
|
28
|
-
this.sidenav = sidenav;
|
|
29
|
-
};
|
|
30
|
-
SidenavService.prototype.getStayOpenOnLargeScreen = function () {
|
|
31
|
-
return this.stayOpenOnLargeScreen;
|
|
32
|
-
};
|
|
33
|
-
SidenavService.prototype.setStayOpenOnLargeScreen = function (value) {
|
|
34
|
-
this.stayOpenOnLargeScreen = value;
|
|
35
|
-
};
|
|
36
|
-
SidenavService.prototype.toggle = function () {
|
|
37
|
-
if (null == this.sidenav) {
|
|
38
|
-
return Promise.reject('No MatSidenav found. Use setSidenav() of SidenavService');
|
|
39
|
-
}
|
|
40
|
-
if (!(this.stayOpenOnLargeScreen && this.breakpointObserver.isMatched(this.largeBreakpoints))) {
|
|
41
|
-
return this.sidenav.toggle();
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
SidenavService.prototype.closeSidebar = function () {
|
|
45
|
-
if (!(this.stayOpenOnLargeScreen && this.breakpointObserver.isMatched(this.largeBreakpoints))) {
|
|
46
|
-
this.sidenav.close();
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
SidenavService.prototype.getModeObservable = function () {
|
|
50
|
-
return this.mode$;
|
|
51
|
-
};
|
|
52
|
-
SidenavService.prototype.getOpenedObservable = function () {
|
|
53
|
-
return this.opened$;
|
|
54
|
-
};
|
|
55
|
-
return SidenavService;
|
|
56
|
-
}());
|
|
57
|
-
SidenavService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SidenavService_Factory() { return new SidenavService(i0.ɵɵinject(i1.BreakpointObserver), i0.ɵɵinject(i2.Router)); }, token: SidenavService, providedIn: "root" });
|
|
58
|
-
SidenavService.decorators = [
|
|
59
|
-
{ type: i0.Injectable, args: [{
|
|
60
|
-
providedIn: 'root'
|
|
61
|
-
},] }
|
|
62
|
-
];
|
|
63
|
-
SidenavService.ctorParameters = function () { return [
|
|
64
|
-
{ type: i1.BreakpointObserver },
|
|
65
|
-
{ type: i2.Router }
|
|
66
|
-
]; };
|
|
67
|
-
|
|
68
|
-
var SidenavContainerComponent = /** @class */ (function () {
|
|
69
|
-
function SidenavContainerComponent(sidenavService, breakpointObserver) {
|
|
70
|
-
this.sidenavService = sidenavService;
|
|
71
|
-
this.breakpointObserver = breakpointObserver;
|
|
72
|
-
this.stayOpenOnLargeScreen = false;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* @override
|
|
76
|
-
*/
|
|
77
|
-
SidenavContainerComponent.prototype.ngOnChanges = function (changes) {
|
|
78
|
-
this.sidenavService.setStayOpenOnLargeScreen(changes.stayOpenOnLargeScreen.currentValue);
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* @override
|
|
82
|
-
*/
|
|
83
|
-
SidenavContainerComponent.prototype.ngOnInit = function () {
|
|
84
|
-
this.sidenavService.setSidenav(this.sidenav);
|
|
85
|
-
this.mode$ = this.sidenavService.getModeObservable();
|
|
86
|
-
this.opened$ = this.sidenavService.getOpenedObservable();
|
|
87
|
-
};
|
|
88
|
-
return SidenavContainerComponent;
|
|
89
|
-
}());
|
|
90
|
-
SidenavContainerComponent.decorators = [
|
|
91
|
-
{ type: i0.Component, args: [{
|
|
92
|
-
selector: 'ddr-mat-sidenav-container',
|
|
93
|
-
template: "<mat-sidenav-container [ngClass]=\"(mode$|async)\">\n <mat-sidenav\n #sidenav\n fixedInViewport=\"true\"\n [mode]=\"(mode$|async)\"\n [opened]=\"(opened$|async)\">\n <ng-content select=\"[slot=mat-sidenav]\"></ng-content>\n </mat-sidenav>\n <mat-sidenav-content>\n <ng-content select=\"[slot=mat-sidenav-content]\"></ng-content>\n </mat-sidenav-content>\n</mat-sidenav-container>\n"
|
|
94
|
-
},] }
|
|
95
|
-
];
|
|
96
|
-
SidenavContainerComponent.ctorParameters = function () { return [
|
|
97
|
-
{ type: SidenavService },
|
|
98
|
-
{ type: i1.BreakpointObserver }
|
|
99
|
-
]; };
|
|
100
|
-
SidenavContainerComponent.propDecorators = {
|
|
101
|
-
sidenav: [{ type: i0.ViewChild, args: ['sidenav', { static: true },] }],
|
|
102
|
-
stayOpenOnLargeScreen: [{ type: i0.Input }]
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
var SidenavToggleComponent = /** @class */ (function () {
|
|
106
|
-
function SidenavToggleComponent(sidenavService) {
|
|
107
|
-
this.sidenavService = sidenavService;
|
|
108
|
-
}
|
|
109
|
-
SidenavToggleComponent.prototype.toggleSidenav = function () {
|
|
110
|
-
this.sidenavService.toggle();
|
|
111
|
-
};
|
|
112
|
-
return SidenavToggleComponent;
|
|
113
|
-
}());
|
|
114
|
-
SidenavToggleComponent.decorators = [
|
|
115
|
-
{ type: i0.Component, args: [{
|
|
116
|
-
selector: 'ddr-mat-sidenav-toggle',
|
|
117
|
-
template: "\n <button mat-icon-button (click)=\"toggleSidenav()\">\n <mat-icon>menu</mat-icon>\n </button>"
|
|
118
|
-
},] }
|
|
119
|
-
];
|
|
120
|
-
SidenavToggleComponent.ctorParameters = function () { return [
|
|
121
|
-
{ type: SidenavService }
|
|
122
|
-
]; };
|
|
123
|
-
|
|
124
|
-
/*! *****************************************************************************
|
|
125
|
-
Copyright (c) Microsoft Corporation.
|
|
126
|
-
|
|
127
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
128
|
-
purpose with or without fee is hereby granted.
|
|
129
|
-
|
|
130
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
131
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
132
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
133
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
134
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
135
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
136
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
137
|
-
***************************************************************************** */
|
|
138
|
-
/* global Reflect, Promise */
|
|
139
|
-
var extendStatics = function (d, b) {
|
|
140
|
-
extendStatics = Object.setPrototypeOf ||
|
|
141
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
142
|
-
function (d, b) { for (var p in b)
|
|
143
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
144
|
-
d[p] = b[p]; };
|
|
145
|
-
return extendStatics(d, b);
|
|
146
|
-
};
|
|
147
|
-
function __extends(d, b) {
|
|
148
|
-
extendStatics(d, b);
|
|
149
|
-
function __() { this.constructor = d; }
|
|
150
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
151
|
-
}
|
|
152
|
-
var __assign = function () {
|
|
153
|
-
__assign = Object.assign || function __assign(t) {
|
|
154
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
155
|
-
s = arguments[i];
|
|
156
|
-
for (var p in s)
|
|
157
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
158
|
-
t[p] = s[p];
|
|
159
|
-
}
|
|
160
|
-
return t;
|
|
161
|
-
};
|
|
162
|
-
return __assign.apply(this, arguments);
|
|
163
|
-
};
|
|
164
|
-
function __rest(s, e) {
|
|
165
|
-
var t = {};
|
|
166
|
-
for (var p in s)
|
|
167
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
168
|
-
t[p] = s[p];
|
|
169
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
170
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
171
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
172
|
-
t[p[i]] = s[p[i]];
|
|
173
|
-
}
|
|
174
|
-
return t;
|
|
175
|
-
}
|
|
176
|
-
function __decorate(decorators, target, key, desc) {
|
|
177
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
178
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
179
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
180
|
-
else
|
|
181
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
182
|
-
if (d = decorators[i])
|
|
183
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
184
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
185
|
-
}
|
|
186
|
-
function __param(paramIndex, decorator) {
|
|
187
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
188
|
-
}
|
|
189
|
-
function __metadata(metadataKey, metadataValue) {
|
|
190
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
191
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
192
|
-
}
|
|
193
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
194
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
195
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
196
|
-
function fulfilled(value) { try {
|
|
197
|
-
step(generator.next(value));
|
|
198
|
-
}
|
|
199
|
-
catch (e) {
|
|
200
|
-
reject(e);
|
|
201
|
-
} }
|
|
202
|
-
function rejected(value) { try {
|
|
203
|
-
step(generator["throw"](value));
|
|
204
|
-
}
|
|
205
|
-
catch (e) {
|
|
206
|
-
reject(e);
|
|
207
|
-
} }
|
|
208
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
209
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
function __generator(thisArg, body) {
|
|
213
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
214
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
215
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
216
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
217
|
-
function step(op) {
|
|
218
|
-
if (f)
|
|
219
|
-
throw new TypeError("Generator is already executing.");
|
|
220
|
-
while (_)
|
|
221
|
-
try {
|
|
222
|
-
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)
|
|
223
|
-
return t;
|
|
224
|
-
if (y = 0, t)
|
|
225
|
-
op = [op[0] & 2, t.value];
|
|
226
|
-
switch (op[0]) {
|
|
227
|
-
case 0:
|
|
228
|
-
case 1:
|
|
229
|
-
t = op;
|
|
230
|
-
break;
|
|
231
|
-
case 4:
|
|
232
|
-
_.label++;
|
|
233
|
-
return { value: op[1], done: false };
|
|
234
|
-
case 5:
|
|
235
|
-
_.label++;
|
|
236
|
-
y = op[1];
|
|
237
|
-
op = [0];
|
|
238
|
-
continue;
|
|
239
|
-
case 7:
|
|
240
|
-
op = _.ops.pop();
|
|
241
|
-
_.trys.pop();
|
|
242
|
-
continue;
|
|
243
|
-
default:
|
|
244
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
245
|
-
_ = 0;
|
|
246
|
-
continue;
|
|
247
|
-
}
|
|
248
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
249
|
-
_.label = op[1];
|
|
250
|
-
break;
|
|
251
|
-
}
|
|
252
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
253
|
-
_.label = t[1];
|
|
254
|
-
t = op;
|
|
255
|
-
break;
|
|
256
|
-
}
|
|
257
|
-
if (t && _.label < t[2]) {
|
|
258
|
-
_.label = t[2];
|
|
259
|
-
_.ops.push(op);
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
if (t[2])
|
|
263
|
-
_.ops.pop();
|
|
264
|
-
_.trys.pop();
|
|
265
|
-
continue;
|
|
266
|
-
}
|
|
267
|
-
op = body.call(thisArg, _);
|
|
268
|
-
}
|
|
269
|
-
catch (e) {
|
|
270
|
-
op = [6, e];
|
|
271
|
-
y = 0;
|
|
272
|
-
}
|
|
273
|
-
finally {
|
|
274
|
-
f = t = 0;
|
|
275
|
-
}
|
|
276
|
-
if (op[0] & 5)
|
|
277
|
-
throw op[1];
|
|
278
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
282
|
-
if (k2 === undefined)
|
|
283
|
-
k2 = k;
|
|
284
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
285
|
-
}) : (function (o, m, k, k2) {
|
|
286
|
-
if (k2 === undefined)
|
|
287
|
-
k2 = k;
|
|
288
|
-
o[k2] = m[k];
|
|
289
|
-
});
|
|
290
|
-
function __exportStar(m, o) {
|
|
291
|
-
for (var p in m)
|
|
292
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
293
|
-
__createBinding(o, m, p);
|
|
294
|
-
}
|
|
295
|
-
function __values(o) {
|
|
296
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
297
|
-
if (m)
|
|
298
|
-
return m.call(o);
|
|
299
|
-
if (o && typeof o.length === "number")
|
|
300
|
-
return {
|
|
301
|
-
next: function () {
|
|
302
|
-
if (o && i >= o.length)
|
|
303
|
-
o = void 0;
|
|
304
|
-
return { value: o && o[i++], done: !o };
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
308
|
-
}
|
|
309
|
-
function __read(o, n) {
|
|
310
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
311
|
-
if (!m)
|
|
312
|
-
return o;
|
|
313
|
-
var i = m.call(o), r, ar = [], e;
|
|
314
|
-
try {
|
|
315
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
316
|
-
ar.push(r.value);
|
|
317
|
-
}
|
|
318
|
-
catch (error) {
|
|
319
|
-
e = { error: error };
|
|
320
|
-
}
|
|
321
|
-
finally {
|
|
322
|
-
try {
|
|
323
|
-
if (r && !r.done && (m = i["return"]))
|
|
324
|
-
m.call(i);
|
|
325
|
-
}
|
|
326
|
-
finally {
|
|
327
|
-
if (e)
|
|
328
|
-
throw e.error;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
return ar;
|
|
332
|
-
}
|
|
333
|
-
function __spread() {
|
|
334
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
335
|
-
ar = ar.concat(__read(arguments[i]));
|
|
336
|
-
return ar;
|
|
337
|
-
}
|
|
338
|
-
function __spreadArrays() {
|
|
339
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
340
|
-
s += arguments[i].length;
|
|
341
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
342
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
343
|
-
r[k] = a[j];
|
|
344
|
-
return r;
|
|
345
|
-
}
|
|
346
|
-
;
|
|
347
|
-
function __await(v) {
|
|
348
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
349
|
-
}
|
|
350
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
351
|
-
if (!Symbol.asyncIterator)
|
|
352
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
353
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
354
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
355
|
-
function verb(n) { if (g[n])
|
|
356
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
357
|
-
function resume(n, v) { try {
|
|
358
|
-
step(g[n](v));
|
|
359
|
-
}
|
|
360
|
-
catch (e) {
|
|
361
|
-
settle(q[0][3], e);
|
|
362
|
-
} }
|
|
363
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
364
|
-
function fulfill(value) { resume("next", value); }
|
|
365
|
-
function reject(value) { resume("throw", value); }
|
|
366
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
367
|
-
resume(q[0][0], q[0][1]); }
|
|
368
|
-
}
|
|
369
|
-
function __asyncDelegator(o) {
|
|
370
|
-
var i, p;
|
|
371
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
372
|
-
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; }
|
|
373
|
-
}
|
|
374
|
-
function __asyncValues(o) {
|
|
375
|
-
if (!Symbol.asyncIterator)
|
|
376
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
377
|
-
var m = o[Symbol.asyncIterator], i;
|
|
378
|
-
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);
|
|
379
|
-
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); }); }; }
|
|
380
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
381
|
-
}
|
|
382
|
-
function __makeTemplateObject(cooked, raw) {
|
|
383
|
-
if (Object.defineProperty) {
|
|
384
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
385
|
-
}
|
|
386
|
-
else {
|
|
387
|
-
cooked.raw = raw;
|
|
388
|
-
}
|
|
389
|
-
return cooked;
|
|
390
|
-
}
|
|
391
|
-
;
|
|
392
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
393
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
394
|
-
}) : function (o, v) {
|
|
395
|
-
o["default"] = v;
|
|
396
|
-
};
|
|
397
|
-
function __importStar(mod) {
|
|
398
|
-
if (mod && mod.__esModule)
|
|
399
|
-
return mod;
|
|
400
|
-
var result = {};
|
|
401
|
-
if (mod != null)
|
|
402
|
-
for (var k in mod)
|
|
403
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
404
|
-
__createBinding(result, mod, k);
|
|
405
|
-
__setModuleDefault(result, mod);
|
|
406
|
-
return result;
|
|
407
|
-
}
|
|
408
|
-
function __importDefault(mod) {
|
|
409
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
410
|
-
}
|
|
411
|
-
function __classPrivateFieldGet(receiver, privateMap) {
|
|
412
|
-
if (!privateMap.has(receiver)) {
|
|
413
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
414
|
-
}
|
|
415
|
-
return privateMap.get(receiver);
|
|
416
|
-
}
|
|
417
|
-
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
418
|
-
if (!privateMap.has(receiver)) {
|
|
419
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
420
|
-
}
|
|
421
|
-
privateMap.set(receiver, value);
|
|
422
|
-
return value;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
var GridTileLazyImgDirective = /** @class */ (function () {
|
|
426
|
-
function GridTileLazyImgDirective(element, cd) {
|
|
427
|
-
this.element = element;
|
|
428
|
-
this.cd = cd;
|
|
429
|
-
this.hostSrc = 'assets/placeholder.gif';
|
|
430
|
-
this.hostStyleObjectFit = 'contain';
|
|
431
|
-
this.hostStyleOpacity = 0;
|
|
432
|
-
this.offset = 1000;
|
|
433
|
-
this.objectFit = 'cover';
|
|
434
|
-
this.displayed = false;
|
|
435
|
-
}
|
|
436
|
-
GridTileLazyImgDirective.prototype.recheck = function () {
|
|
437
|
-
this.displayed = false;
|
|
438
|
-
this.check();
|
|
439
|
-
};
|
|
440
|
-
GridTileLazyImgDirective.prototype.check = function () {
|
|
441
|
-
if (this.displayed
|
|
442
|
-
|| this.isHidden(this.element.nativeElement)
|
|
443
|
-
|| !this.isInsideViewport(this.element.nativeElement, this.offset)) {
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
this.displayed = true;
|
|
447
|
-
var dimension = this.getDimension();
|
|
448
|
-
if (null != this.maxLoadedDimension
|
|
449
|
-
&& this.maxLoadedDimension.width >= dimension.width
|
|
450
|
-
&& this.maxLoadedDimension.height >= dimension.height) {
|
|
451
|
-
return;
|
|
452
|
-
}
|
|
453
|
-
this.maxLoadedDimension = dimension;
|
|
454
|
-
this.hostStyleWidthPx = dimension.width;
|
|
455
|
-
this.hostStyleHeightPx = dimension.height;
|
|
456
|
-
var wantedSize;
|
|
457
|
-
if (this.objectFit === 'cover') {
|
|
458
|
-
wantedSize = ngxExtensions.NumberUtils.getNextPowerOfTwo(Math.max(dimension.width, dimension.height));
|
|
459
|
-
this.hostStyleObjectFit = 'cover';
|
|
460
|
-
}
|
|
461
|
-
else {
|
|
462
|
-
wantedSize = ngxExtensions.NumberUtils.getNextPowerOfTwo(Math.min(dimension.width, dimension.height));
|
|
463
|
-
this.hostStyleObjectFit = 'contain';
|
|
464
|
-
}
|
|
465
|
-
this.hostSrc = ngxExtensions.StringUtils.updateUrlParameter(this.src, 'size', String(wantedSize));
|
|
466
|
-
this.hostStyleOpacity = 1;
|
|
467
|
-
this.cd.detectChanges();
|
|
468
|
-
};
|
|
469
|
-
/**
|
|
470
|
-
* @override
|
|
471
|
-
*/
|
|
472
|
-
GridTileLazyImgDirective.prototype.ngOnChanges = function (changes) {
|
|
473
|
-
this.displayed = false;
|
|
474
|
-
this.maxLoadedDimension = null;
|
|
475
|
-
this.hostStyleOpacity = 0;
|
|
476
|
-
if (this.element.nativeElement.parentElement.offsetWidth > 0) {
|
|
477
|
-
this.check();
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
GridTileLazyImgDirective.prototype.isInsideViewport = function (nativeElement, offset) {
|
|
481
|
-
// console.log('isInsideViewport');
|
|
482
|
-
var ownerDocument = nativeElement.ownerDocument;
|
|
483
|
-
var documentTop = window.pageYOffset || ownerDocument.body.scrollTop;
|
|
484
|
-
var documentLeft = window.pageXOffset || ownerDocument.body.scrollLeft;
|
|
485
|
-
var documentWidth = window.innerWidth || (ownerDocument.documentElement.clientWidth || document.body.clientWidth);
|
|
486
|
-
var documentHeight = window.innerHeight || (ownerDocument.documentElement.clientHeight || document.body.clientHeight);
|
|
487
|
-
var topOffset = nativeElement.getBoundingClientRect().top + documentTop - ownerDocument.documentElement.clientTop;
|
|
488
|
-
var leftOffset = nativeElement.getBoundingClientRect().left + documentLeft - ownerDocument.documentElement.clientLeft;
|
|
489
|
-
// console.log(documentWidth, documentHeight, topOffset, leftOffset);
|
|
490
|
-
var isBelowViewport = documentHeight + documentTop <= topOffset - offset;
|
|
491
|
-
var isAtRightOfViewport = documentWidth + window.pageXOffset <= leftOffset - offset;
|
|
492
|
-
var isAboveViewport = documentTop >= topOffset + offset + nativeElement.offsetHeight;
|
|
493
|
-
var isAtLeftOfViewport = documentLeft >= leftOffset + offset + nativeElement.offsetWidth;
|
|
494
|
-
return !isBelowViewport && !isAboveViewport && !isAtRightOfViewport && !isAtLeftOfViewport;
|
|
495
|
-
};
|
|
496
|
-
GridTileLazyImgDirective.prototype.getDimension = function () {
|
|
497
|
-
return {
|
|
498
|
-
width: this.element.nativeElement.parentElement.offsetWidth,
|
|
499
|
-
height: this.element.nativeElement.parentElement.offsetHeight,
|
|
500
|
-
};
|
|
501
|
-
};
|
|
502
|
-
GridTileLazyImgDirective.prototype.isHidden = function (nativeElement) {
|
|
503
|
-
// console.log('isHidden');
|
|
504
|
-
return window.getComputedStyle(nativeElement).display === 'none';
|
|
505
|
-
};
|
|
506
|
-
return GridTileLazyImgDirective;
|
|
507
|
-
}());
|
|
508
|
-
GridTileLazyImgDirective.decorators = [
|
|
509
|
-
{ type: i0.Directive, args: [{ selector: '[ddrGridTileLazyImg]' },] }
|
|
510
|
-
];
|
|
511
|
-
GridTileLazyImgDirective.ctorParameters = function () { return [
|
|
512
|
-
{ type: i0.ElementRef },
|
|
513
|
-
{ type: i0.ChangeDetectorRef }
|
|
514
|
-
]; };
|
|
515
|
-
GridTileLazyImgDirective.propDecorators = {
|
|
516
|
-
src: [{ type: i0.Input, args: ['ddrGridTileLazyImg',] }],
|
|
517
|
-
hostSrc: [{ type: i0.HostBinding, args: ['src',] }],
|
|
518
|
-
hostStyleObjectFit: [{ type: i0.HostBinding, args: ['style.object-fit',] }],
|
|
519
|
-
hostStyleWidthPx: [{ type: i0.HostBinding, args: ['style.width.px',] }],
|
|
520
|
-
hostStyleHeightPx: [{ type: i0.HostBinding, args: ['style.height.px',] }],
|
|
521
|
-
hostStyleOpacity: [{ type: i0.HostBinding, args: ['style.opacity',] }],
|
|
522
|
-
offset: [{ type: i0.Input }],
|
|
523
|
-
objectFit: [{ type: i0.Input }]
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
var GridTileLazyImageContainerDirective = /** @class */ (function () {
|
|
527
|
-
function GridTileLazyImageContainerDirective() {
|
|
528
|
-
}
|
|
529
|
-
GridTileLazyImageContainerDirective.prototype.windowResized = function ($event) {
|
|
530
|
-
if (null != this.lazyImages) {
|
|
531
|
-
this.lazyImages.forEach(function (lazyImage, index) { return lazyImage.recheck(); });
|
|
532
|
-
}
|
|
533
|
-
};
|
|
534
|
-
GridTileLazyImageContainerDirective.prototype.windowScroll = function ($event) {
|
|
535
|
-
if (null != this.lazyImages) {
|
|
536
|
-
this.lazyImages.forEach(function (lazyImage, index) { return lazyImage.check(); });
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
/**
|
|
540
|
-
* @override
|
|
541
|
-
*/
|
|
542
|
-
GridTileLazyImageContainerDirective.prototype.ngAfterContentInit = function () {
|
|
543
|
-
var _this = this;
|
|
544
|
-
this.lazyImages.forEach(function (lazyImage, index) { return lazyImage.check(); });
|
|
545
|
-
this.changeSubscription = this.lazyImages.changes.subscribe(function () {
|
|
546
|
-
/* Wait one tick until layout is ready */
|
|
547
|
-
setTimeout(function () { return _this.lazyImages.forEach(function (lazyImage, index) { return lazyImage.recheck(); }); }, 1);
|
|
548
|
-
});
|
|
549
|
-
};
|
|
550
|
-
/**
|
|
551
|
-
* @override
|
|
552
|
-
*/
|
|
553
|
-
GridTileLazyImageContainerDirective.prototype.ngOnDestroy = function () {
|
|
554
|
-
this.changeSubscription.unsubscribe();
|
|
555
|
-
};
|
|
556
|
-
return GridTileLazyImageContainerDirective;
|
|
557
|
-
}());
|
|
558
|
-
GridTileLazyImageContainerDirective.decorators = [
|
|
559
|
-
{ type: i0.Directive, args: [{ selector: '[ddrGridTileLazyImgContainer]' },] }
|
|
560
|
-
];
|
|
561
|
-
GridTileLazyImageContainerDirective.propDecorators = {
|
|
562
|
-
lazyImages: [{ type: i0.ContentChildren, args: [GridTileLazyImgDirective, { descendants: true },] }],
|
|
563
|
-
windowResized: [{ type: i0.HostListener, args: ['window:resize', ['$event'],] }],
|
|
564
|
-
windowScroll: [{ type: i0.HostListener, args: ['window:scroll', ['$event'],] }]
|
|
565
|
-
};
|
|
566
|
-
__decorate([
|
|
567
|
-
ngxExtensions.Debounce()
|
|
568
|
-
], GridTileLazyImageContainerDirective.prototype, "windowResized", null);
|
|
569
|
-
__decorate([
|
|
570
|
-
ngxExtensions.Limit()
|
|
571
|
-
], GridTileLazyImageContainerDirective.prototype, "windowScroll", null);
|
|
572
|
-
|
|
573
|
-
var DdrMaterialExtensionsModule = /** @class */ (function () {
|
|
574
|
-
function DdrMaterialExtensionsModule() {
|
|
575
|
-
}
|
|
576
|
-
return DdrMaterialExtensionsModule;
|
|
577
|
-
}());
|
|
578
|
-
DdrMaterialExtensionsModule.decorators = [
|
|
579
|
-
{ type: i0.NgModule, args: [{
|
|
580
|
-
declarations: [
|
|
581
|
-
SidenavToggleComponent,
|
|
582
|
-
GridTileLazyImageContainerDirective,
|
|
583
|
-
GridTileLazyImgDirective,
|
|
584
|
-
SidenavContainerComponent
|
|
585
|
-
],
|
|
586
|
-
imports: [
|
|
587
|
-
common.CommonModule,
|
|
588
|
-
sidenav.MatSidenavModule,
|
|
589
|
-
icon.MatIconModule,
|
|
590
|
-
button.MatButtonModule
|
|
591
|
-
],
|
|
592
|
-
exports: [
|
|
593
|
-
SidenavToggleComponent,
|
|
594
|
-
GridTileLazyImageContainerDirective,
|
|
595
|
-
GridTileLazyImgDirective,
|
|
596
|
-
SidenavContainerComponent
|
|
597
|
-
]
|
|
598
|
-
},] }
|
|
599
|
-
];
|
|
600
|
-
|
|
601
|
-
/*
|
|
602
|
-
* Public API Surface of ngx-material-extensions
|
|
603
|
-
*/
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* Generated bundle index. Do not edit.
|
|
607
|
-
*/
|
|
608
|
-
|
|
609
|
-
exports.DdrMaterialExtensionsModule = DdrMaterialExtensionsModule;
|
|
610
|
-
exports.GridTileLazyImageContainerDirective = GridTileLazyImageContainerDirective;
|
|
611
|
-
exports.GridTileLazyImgDirective = GridTileLazyImgDirective;
|
|
612
|
-
exports.SidenavContainerComponent = SidenavContainerComponent;
|
|
613
|
-
exports.SidenavService = SidenavService;
|
|
614
|
-
exports.SidenavToggleComponent = SidenavToggleComponent;
|
|
615
|
-
|
|
616
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
617
|
-
|
|
618
|
-
})));
|
|
619
|
-
//# sourceMappingURL=dontdrinkandroot-ngx-material-extensions.umd.js.map
|