1 | (function (global, factory) {
|
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('tslib'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@angular/forms'), require('@angular/router'), require('@angular/cdk/a11y'), require('@angular/cdk/portal'), require('@angular/cdk/overlay'), require('@angular/cdk/platform'), require('@angular/platform-browser'), require('@angular/animations'), require('intersection-observer'), require('@angular/cdk/bidi'), require('@angular/cdk/table'), require('@angular/cdk/coercion'), require('@angular/cdk/collections'), require('@angular/cdk/keycodes')) :
|
3 | typeof define === 'function' && define.amd ? define(['exports', '@angular/core', 'tslib', '@angular/common', 'rxjs', 'rxjs/operators', '@angular/forms', '@angular/router', '@angular/cdk/a11y', '@angular/cdk/portal', '@angular/cdk/overlay', '@angular/cdk/platform', '@angular/platform-browser', '@angular/animations', 'intersection-observer', '@angular/cdk/bidi', '@angular/cdk/table', '@angular/cdk/coercion', '@angular/cdk/collections', '@angular/cdk/keycodes'], factory) :
|
4 | (factory((global.nb = global.nb || {}, global.nb.theme = global.nb.theme || {}),global.ng.core,global.tslib,global.ng.common,global.Rx,global.Rx.operators,global.ng.forms,global.ng.router,global.ng.cdk.a11y,global.ng.cdk.portal,global.ng.cdk.overlay,global.ng.cdk.platform,global.ng.platformBrowser,global.ng.animations,global['intersection-observer'],global.ng.cdk.bidi,global.ng.cdk.table,global.ng.cdk.coercion,global.ng.cdk.collections,global.ng.cdk.keycodes));
|
5 | }(this, (function (exports,i0,tslib,_angular_common,rxjs,rxjs_operators,_angular_forms,_angular_router,_angular_cdk_a11y,_angular_cdk_portal,_angular_cdk_overlay,i1,_angular_platformBrowser,_angular_animations,intersectionObserver,_angular_cdk_bidi,_angular_cdk_table,_angular_cdk_coercion,_angular_cdk_collections,_angular_cdk_keycodes) { 'use strict';
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | var NB_THEME_OPTIONS = new i0.InjectionToken('Nebular Theme Options');
|
13 | var NB_MEDIA_BREAKPOINTS = new i0.InjectionToken('Nebular Media Breakpoints');
|
14 | var NB_BUILT_IN_JS_THEMES = new i0.InjectionToken('Nebular Built-in JS Themes');
|
15 | var NB_JS_THEMES = new i0.InjectionToken('Nebular JS Themes');
|
16 |
|
17 |
|
18 |
|
19 | var NB_WINDOW = new i0.InjectionToken('Window');
|
20 | var NB_DOCUMENT = new i0.InjectionToken('Document');
|
21 |
|
22 | var palette = {
|
23 | primary: '#3366ff',
|
24 | success: '#00d68f',
|
25 | info: '#0095ff',
|
26 | warning: '#ffaa00',
|
27 | danger: '#ff3d71',
|
28 | };
|
29 | var DEFAULT_THEME = {
|
30 | name: 'default',
|
31 | variables: {
|
32 | fontMain: 'Open Sans, sans-serif',
|
33 | fontSecondary: 'Raleway, sans-serif',
|
34 | bg: '#ffffff',
|
35 | bg2: '#f7f9fc',
|
36 | bg3: '#edf1f7',
|
37 | bg4: '#e4e9f2',
|
38 | border: '#ffffff',
|
39 | border2: '#f7f9fc',
|
40 | border3: '#edf1f7',
|
41 | border4: '#e4e9f2',
|
42 | border5: '#c5cee0',
|
43 | fg: '#8f9bb3',
|
44 | fgHeading: '#1a2138',
|
45 | fgText: '#1a2138',
|
46 | fgHighlight: palette.primary,
|
47 | layoutBg: '#f7f9fc',
|
48 | separator: '#edf1f7',
|
49 | primary: palette.primary,
|
50 | success: palette.success,
|
51 | info: palette.info,
|
52 | warning: palette.warning,
|
53 | danger: palette.danger,
|
54 | primaryLight: '#598bff',
|
55 | successLight: '#2ce69b',
|
56 | infoLight: '#42aaff',
|
57 | warningLight: '#ffc94d',
|
58 | dangerLight: '#ff708d',
|
59 | },
|
60 | };
|
61 |
|
62 | var palette$1 = {
|
63 | primary: '#a16eff',
|
64 | success: '#00d68f',
|
65 | info: '#0095ff',
|
66 | warning: '#ffaa00',
|
67 | danger: '#ff3d71',
|
68 | };
|
69 | var COSMIC_THEME = {
|
70 | name: 'cosmic',
|
71 | variables: {
|
72 | fontMain: 'Open Sans, sans-serif',
|
73 | fontSecondary: 'Raleway, sans-serif',
|
74 | bg: '#323259',
|
75 | bg2: '#252547',
|
76 | bg3: '#1b1b38',
|
77 | bg4: '#13132b',
|
78 | border: '#323259',
|
79 | border2: '#252547',
|
80 | border3: '#1b1b38',
|
81 | border4: '#13132b',
|
82 | border5: '#13132b',
|
83 | fg: '#b4b4db',
|
84 | fgHeading: '#ffffff',
|
85 | fgText: '#ffffff',
|
86 | fgHighlight: palette$1.primary,
|
87 | layoutBg: '#151a30',
|
88 | separator: '#151a30',
|
89 | primary: palette$1.primary,
|
90 | success: palette$1.success,
|
91 | info: palette$1.info,
|
92 | warning: palette$1.warning,
|
93 | danger: palette$1.danger,
|
94 | primaryLight: '#b18aff',
|
95 | successLight: '#2ce69b',
|
96 | infoLight: '#42aaff',
|
97 | warningLight: '#ffc94d',
|
98 | dangerLight: '#ff708d',
|
99 | },
|
100 | };
|
101 |
|
102 | var palette$2 = {
|
103 | primary: '#73a1ff',
|
104 | success: '#5dcfe3',
|
105 | info: '#ba7fec',
|
106 | warning: '#ffa36b',
|
107 | danger: '#ff6b83',
|
108 | };
|
109 | var CORPORATE_THEME = {
|
110 | name: 'corporate',
|
111 | base: 'default',
|
112 | variables: {
|
113 | fontMain: 'Open Sans, sans-serif',
|
114 | fontSecondary: 'Raleway, sans-serif',
|
115 | bg: '#ffffff',
|
116 | bg2: '#f7f9fc',
|
117 | bg3: '#edf1f7',
|
118 | bg4: '#e4e9f2',
|
119 | border: '#ffffff',
|
120 | border2: '#f7f9fc',
|
121 | border3: '#edf1f7',
|
122 | border4: '#e4e9f2',
|
123 | border5: '#c5cee0',
|
124 | fg: '#8f9bb3',
|
125 | fgHeading: '#1a2138',
|
126 | fgText: '#1a2138',
|
127 | fgHighlight: palette$2.primary,
|
128 | layoutBg: '#f7f9fc',
|
129 | separator: '#edf1f7',
|
130 | primary: palette$2.primary,
|
131 | success: palette$2.success,
|
132 | info: palette$2.info,
|
133 | warning: palette$2.warning,
|
134 | danger: palette$2.danger,
|
135 | primaryLight: '#598bff',
|
136 | successLight: '#2ce69b',
|
137 | infoLight: '#42aaff',
|
138 | warningLight: '#ffc94d',
|
139 | dangerLight: '#ff708d',
|
140 | },
|
141 | };
|
142 |
|
143 | var palette$3 = {
|
144 | primary: '#3366ff',
|
145 | success: '#00d68f',
|
146 | info: '#0095ff',
|
147 | warning: '#ffaa00',
|
148 | danger: '#ff3d71',
|
149 | };
|
150 | var DARK_THEME = {
|
151 | name: 'dark',
|
152 | variables: {
|
153 | fontMain: 'Open Sans, sans-serif',
|
154 | fontSecondary: 'Raleway, sans-serif',
|
155 | bg: '#222b45',
|
156 | bg2: '#1a2138',
|
157 | bg3: '#151a30',
|
158 | bg4: '#101426',
|
159 | border: '#222b45',
|
160 | border2: '#1a2138',
|
161 | border3: '#151a30',
|
162 | border4: '#101426',
|
163 | border5: '#101426',
|
164 | fg: '#8f9bb3',
|
165 | fgHeading: '#ffffff',
|
166 | fgText: '#ffffff',
|
167 | fgHighlight: palette$3.primary,
|
168 | layoutBg: '#1b1b38',
|
169 | separator: '#1b1b38',
|
170 | primary: palette$3.primary,
|
171 | success: palette$3.success,
|
172 | info: palette$3.info,
|
173 | warning: palette$3.warning,
|
174 | danger: palette$3.danger,
|
175 | primaryLight: '#598bff',
|
176 | successLight: '#2ce69b',
|
177 | infoLight: '#42aaff',
|
178 | warningLight: '#ffc94d',
|
179 | dangerLight: '#ff708d',
|
180 | },
|
181 | };
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 | var BUILT_IN_THEMES = [
|
189 | DEFAULT_THEME,
|
190 | COSMIC_THEME,
|
191 | CORPORATE_THEME,
|
192 | DARK_THEME,
|
193 | ];
|
194 |
|
195 |
|
196 |
|
197 |
|
198 | var NbJSThemesRegistry = (function () {
|
199 | function NbJSThemesRegistry(builtInThemes, newThemes) {
|
200 | var _this = this;
|
201 | if (newThemes === void 0) { newThemes = []; }
|
202 | this.themes = {};
|
203 | var themes = this.combineByNames(newThemes, builtInThemes);
|
204 | themes.forEach(function (theme) {
|
205 | _this.register(theme, theme.name, theme.base);
|
206 | });
|
207 | }
|
208 | |
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 | NbJSThemesRegistry.prototype.register = function (config, themeName, baseTheme) {
|
215 | var base = this.has(baseTheme) ? this.get(baseTheme) : {};
|
216 | this.themes[themeName] = this.mergeDeep({}, base, config);
|
217 | };
|
218 | |
219 |
|
220 |
|
221 |
|
222 |
|
223 | NbJSThemesRegistry.prototype.has = function (themeName) {
|
224 | return !!this.themes[themeName];
|
225 | };
|
226 | |
227 |
|
228 |
|
229 |
|
230 |
|
231 | NbJSThemesRegistry.prototype.get = function (themeName) {
|
232 | if (!this.themes[themeName]) {
|
233 | throw Error("NbThemeConfig: no theme '" + themeName + "' found registered.");
|
234 | }
|
235 | return JSON.parse(JSON.stringify(this.themes[themeName]));
|
236 | };
|
237 | NbJSThemesRegistry.prototype.combineByNames = function (newThemes, oldThemes) {
|
238 | var _this = this;
|
239 | if (newThemes) {
|
240 | var mergedThemes_1 = [];
|
241 | newThemes.forEach(function (theme) {
|
242 | var sameOld = oldThemes.find(function (tm) { return tm.name === theme.name; })
|
243 | || {};
|
244 | var mergedTheme = _this.mergeDeep({}, sameOld, theme);
|
245 | mergedThemes_1.push(mergedTheme);
|
246 | });
|
247 | oldThemes.forEach(function (theme) {
|
248 | if (!mergedThemes_1.find(function (tm) { return tm.name === theme.name; })) {
|
249 | mergedThemes_1.push(theme);
|
250 | }
|
251 | });
|
252 | return mergedThemes_1;
|
253 | }
|
254 | return oldThemes;
|
255 | };
|
256 | NbJSThemesRegistry.prototype.isObject = function (item) {
|
257 | return item && typeof item === 'object' && !Array.isArray(item);
|
258 | };
|
259 |
|
260 | NbJSThemesRegistry.prototype.mergeDeep = function (target) {
|
261 | var _a, _b;
|
262 | var sources = [];
|
263 | for (var _i = 1; _i < arguments.length; _i++) {
|
264 | sources[_i - 1] = arguments[_i];
|
265 | }
|
266 | if (!sources.length) {
|
267 | return target;
|
268 | }
|
269 | var source = sources.shift();
|
270 | if (this.isObject(target) && this.isObject(source)) {
|
271 | for (var key in source) {
|
272 | if (this.isObject(source[key])) {
|
273 | if (!target[key]) {
|
274 | Object.assign(target, (_a = {}, _a[key] = {}, _a));
|
275 | }
|
276 | this.mergeDeep(target[key], source[key]);
|
277 | }
|
278 | else {
|
279 | Object.assign(target, (_b = {}, _b[key] = source[key], _b));
|
280 | }
|
281 | }
|
282 | }
|
283 | return this.mergeDeep.apply(this, tslib.__spreadArray([target], sources));
|
284 | };
|
285 | NbJSThemesRegistry.decorators = [
|
286 | { type: i0.Injectable }
|
287 | ];
|
288 | NbJSThemesRegistry.ctorParameters = function () { return [
|
289 | { type: Array, decorators: [{ type: i0.Inject, args: [NB_BUILT_IN_JS_THEMES,] }] },
|
290 | { type: Array, decorators: [{ type: i0.Inject, args: [NB_JS_THEMES,] }] }
|
291 | ]; };
|
292 | return NbJSThemesRegistry;
|
293 | }());
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 | var DEFAULT_MEDIA_BREAKPOINTS = [
|
301 | {
|
302 | name: 'xs',
|
303 | width: 0,
|
304 | },
|
305 | {
|
306 | name: 'is',
|
307 | width: 400,
|
308 | },
|
309 | {
|
310 | name: 'sm',
|
311 | width: 576,
|
312 | },
|
313 | {
|
314 | name: 'md',
|
315 | width: 768,
|
316 | },
|
317 | {
|
318 | name: 'lg',
|
319 | width: 992,
|
320 | },
|
321 | {
|
322 | name: 'xl',
|
323 | width: 1200,
|
324 | },
|
325 | {
|
326 | name: 'xxl',
|
327 | width: 1400,
|
328 | },
|
329 | {
|
330 | name: 'xxxl',
|
331 | width: 1600,
|
332 | },
|
333 | ];
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 | var NbMediaBreakpointsService = (function () {
|
341 | function NbMediaBreakpointsService(breakpoints) {
|
342 | this.breakpoints = breakpoints;
|
343 | this.breakpointsMap = this.breakpoints.reduce(function (res, b) {
|
344 | res[b.name] = b.width;
|
345 | return res;
|
346 | }, {});
|
347 | }
|
348 | |
349 |
|
350 |
|
351 |
|
352 |
|
353 | NbMediaBreakpointsService.prototype.getByWidth = function (width) {
|
354 | var unknown = { name: 'unknown', width: width };
|
355 | var breakpoints = this.getBreakpoints();
|
356 | return breakpoints
|
357 | .find(function (point, index) {
|
358 | var next = breakpoints[index + 1];
|
359 | return width >= point.width && (!next || width < next.width);
|
360 | }) || unknown;
|
361 | };
|
362 | |
363 |
|
364 |
|
365 |
|
366 |
|
367 | NbMediaBreakpointsService.prototype.getByName = function (name) {
|
368 | var unknown = { name: 'unknown', width: NaN };
|
369 | var breakpoints = this.getBreakpoints();
|
370 | return breakpoints.find(function (point) { return name === point.name; }) || unknown;
|
371 | };
|
372 | |
373 |
|
374 |
|
375 |
|
376 | NbMediaBreakpointsService.prototype.getBreakpoints = function () {
|
377 | return this.breakpoints;
|
378 | };
|
379 | |
380 |
|
381 |
|
382 |
|
383 | NbMediaBreakpointsService.prototype.getBreakpointsMap = function () {
|
384 | return this.breakpointsMap;
|
385 | };
|
386 | NbMediaBreakpointsService.decorators = [
|
387 | { type: i0.Injectable }
|
388 | ];
|
389 | NbMediaBreakpointsService.ctorParameters = function () { return [
|
390 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_MEDIA_BREAKPOINTS,] }] }
|
391 | ]; };
|
392 | return NbMediaBreakpointsService;
|
393 | }());
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 | var NbThemeService = (function () {
|
404 | function NbThemeService(options, breakpointService, jsThemesRegistry) {
|
405 | this.options = options;
|
406 | this.breakpointService = breakpointService;
|
407 | this.jsThemesRegistry = jsThemesRegistry;
|
408 | this.themeChanges$ = new rxjs.ReplaySubject(1);
|
409 | this.appendLayoutClass$ = new rxjs.Subject();
|
410 | this.removeLayoutClass$ = new rxjs.Subject();
|
411 | this.changeWindowWidth$ = new rxjs.ReplaySubject(2);
|
412 | if (options && options.name) {
|
413 | this.changeTheme(options.name);
|
414 | }
|
415 | }
|
416 | |
417 |
|
418 |
|
419 |
|
420 | NbThemeService.prototype.changeTheme = function (name) {
|
421 | this.themeChanges$.next({ name: name, previous: this.currentTheme });
|
422 | this.currentTheme = name;
|
423 | };
|
424 | NbThemeService.prototype.changeWindowWidth = function (width) {
|
425 | this.changeWindowWidth$.next(width);
|
426 | };
|
427 | |
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 | NbThemeService.prototype.getJsTheme = function () {
|
434 | var _this = this;
|
435 | return this.onThemeChange().pipe(rxjs_operators.map(function (theme) {
|
436 | return _this.jsThemesRegistry.get(theme.name);
|
437 | }));
|
438 | };
|
439 | |
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 | NbThemeService.prototype.onMediaQueryChange = function () {
|
448 | var _this = this;
|
449 | return this.changeWindowWidth$
|
450 | .pipe(rxjs_operators.startWith(undefined), rxjs_operators.pairwise(), rxjs_operators.map(function (_a) {
|
451 | var prevWidth = _a[0], width = _a[1];
|
452 | return [
|
453 | _this.breakpointService.getByWidth(prevWidth),
|
454 | _this.breakpointService.getByWidth(width),
|
455 | ];
|
456 | }), rxjs_operators.filter(function (_a) {
|
457 | var prevPoint = _a[0], point = _a[1];
|
458 | return prevPoint.name !== point.name;
|
459 | }), rxjs_operators.distinctUntilChanged(null, function (params) { return params[0].name + params[1].name; }), rxjs_operators.share());
|
460 | };
|
461 | |
462 |
|
463 |
|
464 |
|
465 | NbThemeService.prototype.onThemeChange = function () {
|
466 | return this.themeChanges$.pipe(rxjs_operators.share());
|
467 | };
|
468 | |
469 |
|
470 |
|
471 |
|
472 | NbThemeService.prototype.appendLayoutClass = function (className) {
|
473 | this.appendLayoutClass$.next(className);
|
474 | };
|
475 | |
476 |
|
477 |
|
478 |
|
479 | NbThemeService.prototype.onAppendLayoutClass = function () {
|
480 | return this.appendLayoutClass$.pipe(rxjs_operators.share());
|
481 | };
|
482 | |
483 |
|
484 |
|
485 |
|
486 | NbThemeService.prototype.removeLayoutClass = function (className) {
|
487 | this.removeLayoutClass$.next(className);
|
488 | };
|
489 | |
490 |
|
491 |
|
492 |
|
493 | NbThemeService.prototype.onRemoveLayoutClass = function () {
|
494 | return this.removeLayoutClass$.pipe(rxjs_operators.share());
|
495 | };
|
496 | NbThemeService.decorators = [
|
497 | { type: i0.Injectable }
|
498 | ];
|
499 | NbThemeService.ctorParameters = function () { return [
|
500 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_THEME_OPTIONS,] }] },
|
501 | { type: NbMediaBreakpointsService },
|
502 | { type: NbJSThemesRegistry }
|
503 | ]; };
|
504 | return NbThemeService;
|
505 | }());
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 | var NbSpinnerService = (function () {
|
516 | function NbSpinnerService(document) {
|
517 | this.document = document;
|
518 | this.loaders = [];
|
519 | this.selector = 'nb-global-spinner';
|
520 | }
|
521 | |
522 |
|
523 |
|
524 |
|
525 |
|
526 | NbSpinnerService.prototype.registerLoader = function (method) {
|
527 | this.loaders.push(method);
|
528 | };
|
529 | |
530 |
|
531 |
|
532 | NbSpinnerService.prototype.clear = function () {
|
533 | this.loaders = [];
|
534 | };
|
535 | |
536 |
|
537 |
|
538 | NbSpinnerService.prototype.load = function () {
|
539 | this.showSpinner();
|
540 | this.executeAll();
|
541 | };
|
542 | NbSpinnerService.prototype.executeAll = function (done) {
|
543 | var _this = this;
|
544 | if (done === void 0) { done = function () { }; }
|
545 | Promise.all(this.loaders).then(function (values) {
|
546 | _this.hideSpinner();
|
547 | done.call(null, values);
|
548 | })
|
549 | .catch(function (error) {
|
550 |
|
551 | console.error(error);
|
552 | });
|
553 | };
|
554 |
|
555 | NbSpinnerService.prototype.showSpinner = function () {
|
556 | var el = this.getSpinnerElement();
|
557 | if (el) {
|
558 | el.style['display'] = 'block';
|
559 | }
|
560 | };
|
561 | NbSpinnerService.prototype.hideSpinner = function () {
|
562 | var el = this.getSpinnerElement();
|
563 | if (el) {
|
564 | el.style['display'] = 'none';
|
565 | }
|
566 | };
|
567 | NbSpinnerService.prototype.getSpinnerElement = function () {
|
568 | return this.document.getElementById(this.selector);
|
569 | };
|
570 | NbSpinnerService.decorators = [
|
571 | { type: i0.Injectable }
|
572 | ];
|
573 | NbSpinnerService.ctorParameters = function () { return [
|
574 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] }
|
575 | ]; };
|
576 | return NbSpinnerService;
|
577 | }());
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 | (function (NbLayoutDirection) {
|
584 | NbLayoutDirection["LTR"] = "ltr";
|
585 | NbLayoutDirection["RTL"] = "rtl";
|
586 | })(exports.NbLayoutDirection || (exports.NbLayoutDirection = {}));
|
587 |
|
588 |
|
589 |
|
590 |
|
591 | var NB_LAYOUT_DIRECTION = new i0.InjectionToken('Layout direction');
|
592 |
|
593 |
|
594 |
|
595 |
|
596 | var NbLayoutDirectionService = (function () {
|
597 | function NbLayoutDirectionService(direction) {
|
598 | if (direction === void 0) { direction = exports.NbLayoutDirection.LTR; }
|
599 | this.direction = direction;
|
600 | this.$directionChange = new rxjs.ReplaySubject(1);
|
601 | this.setDirection(direction);
|
602 | }
|
603 | |
604 |
|
605 |
|
606 |
|
607 | NbLayoutDirectionService.prototype.isLtr = function () {
|
608 | return this.direction === exports.NbLayoutDirection.LTR;
|
609 | };
|
610 | |
611 |
|
612 |
|
613 |
|
614 | NbLayoutDirectionService.prototype.isRtl = function () {
|
615 | return this.direction === exports.NbLayoutDirection.RTL;
|
616 | };
|
617 | |
618 |
|
619 |
|
620 |
|
621 | NbLayoutDirectionService.prototype.getDirection = function () {
|
622 | return this.direction;
|
623 | };
|
624 | |
625 |
|
626 |
|
627 |
|
628 | NbLayoutDirectionService.prototype.setDirection = function (direction) {
|
629 | this.direction = direction;
|
630 | this.$directionChange.next(direction);
|
631 | };
|
632 | |
633 |
|
634 |
|
635 |
|
636 | NbLayoutDirectionService.prototype.onDirectionChange = function () {
|
637 | return this.$directionChange.pipe(rxjs_operators.share());
|
638 | };
|
639 | NbLayoutDirectionService.decorators = [
|
640 | { type: i0.Injectable }
|
641 | ];
|
642 | NbLayoutDirectionService.ctorParameters = function () { return [
|
643 | { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [NB_LAYOUT_DIRECTION,] }] }
|
644 | ]; };
|
645 | return NbLayoutDirectionService;
|
646 | }());
|
647 |
|
648 |
|
649 |
|
650 |
|
651 |
|
652 |
|
653 |
|
654 |
|
655 |
|
656 |
|
657 | var NbLayoutScrollService = (function () {
|
658 | function NbLayoutScrollService() {
|
659 | this.scrollPositionReq$ = new rxjs.Subject();
|
660 | this.manualScroll$ = new rxjs.Subject();
|
661 | this.scroll$ = new rxjs.Subject();
|
662 | this.scrollable$ = new rxjs.Subject();
|
663 | }
|
664 | |
665 |
|
666 |
|
667 |
|
668 |
|
669 | NbLayoutScrollService.prototype.getPosition = function () {
|
670 | var _this = this;
|
671 | return new rxjs.Observable(function (observer) {
|
672 | var listener = new rxjs.Subject();
|
673 | listener.subscribe(observer);
|
674 | _this.scrollPositionReq$.next({ listener: listener });
|
675 | return function () { return listener.complete(); };
|
676 | });
|
677 | };
|
678 | |
679 |
|
680 |
|
681 |
|
682 |
|
683 |
|
684 | NbLayoutScrollService.prototype.scrollTo = function (x, y) {
|
685 | if (x === void 0) { x = null; }
|
686 | if (y === void 0) { y = null; }
|
687 | this.manualScroll$.next({ x: x, y: y });
|
688 | };
|
689 | |
690 |
|
691 |
|
692 |
|
693 |
|
694 | NbLayoutScrollService.prototype.onScroll = function () {
|
695 | return this.scroll$.pipe(rxjs_operators.share());
|
696 | };
|
697 | |
698 |
|
699 |
|
700 |
|
701 | NbLayoutScrollService.prototype.onManualScroll = function () {
|
702 | return this.manualScroll$.pipe(rxjs_operators.share());
|
703 | };
|
704 | |
705 |
|
706 |
|
707 |
|
708 | NbLayoutScrollService.prototype.onGetPosition = function () {
|
709 | return this.scrollPositionReq$;
|
710 | };
|
711 | NbLayoutScrollService.prototype.onScrollableChange = function () {
|
712 | return this.scrollable$.pipe(rxjs_operators.share());
|
713 | };
|
714 | |
715 |
|
716 |
|
717 |
|
718 | NbLayoutScrollService.prototype.fireScrollChange = function (event) {
|
719 | this.scroll$.next(event);
|
720 | };
|
721 | NbLayoutScrollService.prototype.scrollable = function (scrollable) {
|
722 | this.scrollable$.next(scrollable);
|
723 | };
|
724 | NbLayoutScrollService.decorators = [
|
725 | { type: i0.Injectable }
|
726 | ];
|
727 | return NbLayoutScrollService;
|
728 | }());
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 | var NbLayoutRulerService = (function () {
|
737 | function NbLayoutRulerService() {
|
738 | this.contentDimensionsReq$ = new rxjs.Subject();
|
739 | }
|
740 | |
741 |
|
742 |
|
743 |
|
744 | NbLayoutRulerService.prototype.getDimensions = function () {
|
745 | var _this = this;
|
746 | return new rxjs.Observable(function (observer) {
|
747 | var listener = new rxjs.Subject();
|
748 | listener.subscribe(observer);
|
749 | _this.contentDimensionsReq$.next({ listener: listener });
|
750 | return function () { return listener.complete(); };
|
751 | });
|
752 | };
|
753 | |
754 |
|
755 |
|
756 |
|
757 | NbLayoutRulerService.prototype.onGetDimensions = function () {
|
758 | return this.contentDimensionsReq$;
|
759 | };
|
760 | NbLayoutRulerService.decorators = [
|
761 | { type: i0.Injectable }
|
762 | ];
|
763 | return NbLayoutRulerService;
|
764 | }());
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 | var NbSharedModule = (function () {
|
772 | function NbSharedModule() {
|
773 | }
|
774 | NbSharedModule.decorators = [
|
775 | { type: i0.NgModule, args: [{
|
776 | exports: [
|
777 | _angular_common.CommonModule,
|
778 |
|
779 | _angular_forms.FormsModule,
|
780 | _angular_router.RouterModule,
|
781 | ],
|
782 | },] }
|
783 | ];
|
784 | return NbSharedModule;
|
785 | }());
|
786 |
|
787 |
|
788 |
|
789 |
|
790 | var NbFocusTrap = (function (_super) {
|
791 | tslib.__extends(NbFocusTrap, _super);
|
792 | function NbFocusTrap(element, checker, ngZone, document, deferAnchors) {
|
793 | var _this = _super.call(this, element, checker, ngZone, document, deferAnchors) || this;
|
794 | _this.element = element;
|
795 | _this.checker = checker;
|
796 | _this.ngZone = ngZone;
|
797 | _this.document = document;
|
798 | _this.savePreviouslyFocusedElement();
|
799 | return _this;
|
800 | }
|
801 | NbFocusTrap.prototype.restoreFocus = function () {
|
802 | this.previouslyFocusedElement.focus();
|
803 | this.destroy();
|
804 | };
|
805 | NbFocusTrap.prototype.blurPreviouslyFocusedElement = function () {
|
806 | this.previouslyFocusedElement.blur();
|
807 | };
|
808 | NbFocusTrap.prototype.savePreviouslyFocusedElement = function () {
|
809 | this.previouslyFocusedElement = this.document.activeElement;
|
810 | };
|
811 | return NbFocusTrap;
|
812 | }(_angular_cdk_a11y.FocusTrap));
|
813 | var NbFocusTrapFactoryService = (function (_super) {
|
814 | tslib.__extends(NbFocusTrapFactoryService, _super);
|
815 | function NbFocusTrapFactoryService(checker, ngZone, document) {
|
816 | var _this = _super.call(this, checker, ngZone, document) || this;
|
817 | _this.checker = checker;
|
818 | _this.ngZone = ngZone;
|
819 | _this.document = document;
|
820 | return _this;
|
821 | }
|
822 | NbFocusTrapFactoryService.prototype.create = function (element, deferCaptureElements) {
|
823 | return new NbFocusTrap(element, this.checker, this.ngZone, this.document, deferCaptureElements);
|
824 | };
|
825 | NbFocusTrapFactoryService.decorators = [
|
826 | { type: i0.Injectable }
|
827 | ];
|
828 | NbFocusTrapFactoryService.ctorParameters = function () { return [
|
829 | { type: _angular_cdk_a11y.InteractivityChecker },
|
830 | { type: i0.NgZone },
|
831 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] }
|
832 | ]; };
|
833 | return NbFocusTrapFactoryService;
|
834 | }(_angular_cdk_a11y.FocusTrapFactory));
|
835 |
|
836 | var NbFocusKeyManager = (function (_super) {
|
837 | tslib.__extends(NbFocusKeyManager, _super);
|
838 | function NbFocusKeyManager() {
|
839 | return _super !== null && _super.apply(this, arguments) || this;
|
840 | }
|
841 | return NbFocusKeyManager;
|
842 | }(_angular_cdk_a11y.FocusKeyManager));
|
843 | var NbFocusKeyManagerFactoryService = (function () {
|
844 | function NbFocusKeyManagerFactoryService() {
|
845 | }
|
846 | NbFocusKeyManagerFactoryService.prototype.create = function (items) {
|
847 | return new NbFocusKeyManager(items);
|
848 | };
|
849 | return NbFocusKeyManagerFactoryService;
|
850 | }());
|
851 |
|
852 | var NbActiveDescendantKeyManager = (function (_super) {
|
853 | tslib.__extends(NbActiveDescendantKeyManager, _super);
|
854 | function NbActiveDescendantKeyManager() {
|
855 | return _super !== null && _super.apply(this, arguments) || this;
|
856 | }
|
857 | return NbActiveDescendantKeyManager;
|
858 | }(_angular_cdk_a11y.ActiveDescendantKeyManager));
|
859 | var NbActiveDescendantKeyManagerFactoryService = (function () {
|
860 | function NbActiveDescendantKeyManagerFactoryService() {
|
861 | }
|
862 | NbActiveDescendantKeyManagerFactoryService.prototype.create = function (items) {
|
863 | return new NbActiveDescendantKeyManager(items);
|
864 | };
|
865 | return NbActiveDescendantKeyManagerFactoryService;
|
866 | }());
|
867 | var NbKeyManagerActiveItemMode;
|
868 | (function (NbKeyManagerActiveItemMode) {
|
869 | NbKeyManagerActiveItemMode[NbKeyManagerActiveItemMode["RESET_ACTIVE"] = -1] = "RESET_ACTIVE";
|
870 | NbKeyManagerActiveItemMode[NbKeyManagerActiveItemMode["FIRST_ACTIVE"] = 0] = "FIRST_ACTIVE";
|
871 | })(NbKeyManagerActiveItemMode || (NbKeyManagerActiveItemMode = {}));
|
872 |
|
873 | var NbFocusMonitor = (function (_super) {
|
874 | tslib.__extends(NbFocusMonitor, _super);
|
875 | function NbFocusMonitor() {
|
876 | return _super !== null && _super.apply(this, arguments) || this;
|
877 | }
|
878 | NbFocusMonitor.decorators = [
|
879 | { type: i0.Injectable }
|
880 | ];
|
881 | return NbFocusMonitor;
|
882 | }(_angular_cdk_a11y.FocusMonitor));
|
883 | var NbA11yModule = (function () {
|
884 | function NbA11yModule() {
|
885 | }
|
886 | NbA11yModule.forRoot = function () {
|
887 | return {
|
888 | ngModule: NbA11yModule,
|
889 | providers: [
|
890 | NbFocusTrapFactoryService,
|
891 | NbFocusKeyManagerFactoryService,
|
892 | NbActiveDescendantKeyManagerFactoryService,
|
893 | { provide: NbFocusMonitor, useClass: _angular_cdk_a11y.FocusMonitor },
|
894 | ],
|
895 | };
|
896 | };
|
897 | NbA11yModule.decorators = [
|
898 | { type: i0.NgModule, args: [{},] }
|
899 | ];
|
900 | return NbA11yModule;
|
901 | }());
|
902 |
|
903 | var NbPortalDirective = (function (_super) {
|
904 | tslib.__extends(NbPortalDirective, _super);
|
905 | function NbPortalDirective() {
|
906 | return _super !== null && _super.apply(this, arguments) || this;
|
907 | }
|
908 | NbPortalDirective.decorators = [
|
909 | { type: i0.Directive, args: [{ selector: '[nbPortal]' },] }
|
910 | ];
|
911 | return NbPortalDirective;
|
912 | }(_angular_cdk_portal.CdkPortal));
|
913 | var NbPortalOutletDirective = (function (_super) {
|
914 | tslib.__extends(NbPortalOutletDirective, _super);
|
915 | function NbPortalOutletDirective() {
|
916 | return _super !== null && _super.apply(this, arguments) || this;
|
917 | }
|
918 | NbPortalOutletDirective.decorators = [
|
919 | { type: i0.Directive, args: [{ selector: '[nbPortalOutlet]' },] }
|
920 | ];
|
921 | return NbPortalOutletDirective;
|
922 | }(_angular_cdk_portal.CdkPortalOutlet));
|
923 | var NbComponentPortal = (function (_super) {
|
924 | tslib.__extends(NbComponentPortal, _super);
|
925 | function NbComponentPortal() {
|
926 | return _super !== null && _super.apply(this, arguments) || this;
|
927 | }
|
928 | return NbComponentPortal;
|
929 | }(_angular_cdk_portal.ComponentPortal));
|
930 | var NbOverlay = (function (_super) {
|
931 | tslib.__extends(NbOverlay, _super);
|
932 | function NbOverlay() {
|
933 | return _super !== null && _super.apply(this, arguments) || this;
|
934 | }
|
935 | NbOverlay.decorators = [
|
936 | { type: i0.Injectable }
|
937 | ];
|
938 | return NbOverlay;
|
939 | }(_angular_cdk_overlay.Overlay));
|
940 | var NbOverlayPositionBuilder = (function (_super) {
|
941 | tslib.__extends(NbOverlayPositionBuilder, _super);
|
942 | function NbOverlayPositionBuilder() {
|
943 | return _super !== null && _super.apply(this, arguments) || this;
|
944 | }
|
945 | NbOverlayPositionBuilder.decorators = [
|
946 | { type: i0.Injectable }
|
947 | ];
|
948 | return NbOverlayPositionBuilder;
|
949 | }(_angular_cdk_overlay.OverlayPositionBuilder));
|
950 | var NbTemplatePortal = (function (_super) {
|
951 | tslib.__extends(NbTemplatePortal, _super);
|
952 | function NbTemplatePortal(template, viewContainerRef, context) {
|
953 | return _super.call(this, template, viewContainerRef, context) || this;
|
954 | }
|
955 | return NbTemplatePortal;
|
956 | }(_angular_cdk_portal.TemplatePortal));
|
957 | var NbOverlayContainer = (function (_super) {
|
958 | tslib.__extends(NbOverlayContainer, _super);
|
959 | function NbOverlayContainer() {
|
960 | return _super !== null && _super.apply(this, arguments) || this;
|
961 | }
|
962 | NbOverlayContainer.decorators = [
|
963 | { type: i0.Injectable }
|
964 | ];
|
965 | return NbOverlayContainer;
|
966 | }(_angular_cdk_overlay.OverlayContainer));
|
967 | var NbFlexibleConnectedPositionStrategy = (function (_super) {
|
968 | tslib.__extends(NbFlexibleConnectedPositionStrategy, _super);
|
969 | function NbFlexibleConnectedPositionStrategy() {
|
970 | return _super !== null && _super.apply(this, arguments) || this;
|
971 | }
|
972 | return NbFlexibleConnectedPositionStrategy;
|
973 | }(_angular_cdk_overlay.FlexibleConnectedPositionStrategy));
|
974 | var NbPortalInjector = (function (_super) {
|
975 | tslib.__extends(NbPortalInjector, _super);
|
976 | function NbPortalInjector() {
|
977 | return _super !== null && _super.apply(this, arguments) || this;
|
978 | }
|
979 | return NbPortalInjector;
|
980 | }(_angular_cdk_portal.PortalInjector));
|
981 | var CDK_MODULES = [_angular_cdk_overlay.OverlayModule, _angular_cdk_portal.PortalModule];
|
982 |
|
983 |
|
984 |
|
985 |
|
986 | var NbCdkMappingModule = (function () {
|
987 | function NbCdkMappingModule() {
|
988 | }
|
989 | NbCdkMappingModule.forRoot = function () {
|
990 | return {
|
991 | ngModule: NbCdkMappingModule,
|
992 | providers: [
|
993 | NbOverlay,
|
994 | NbOverlayPositionBuilder,
|
995 | ],
|
996 | };
|
997 | };
|
998 | NbCdkMappingModule.decorators = [
|
999 | { type: i0.NgModule, args: [{
|
1000 | imports: tslib.__spreadArray([], CDK_MODULES),
|
1001 | exports: tslib.__spreadArray(tslib.__spreadArray([], CDK_MODULES), [
|
1002 | NbPortalDirective,
|
1003 | NbPortalOutletDirective,
|
1004 | ]),
|
1005 | declarations: [NbPortalDirective, NbPortalOutletDirective],
|
1006 | },] }
|
1007 | ];
|
1008 | return NbCdkMappingModule;
|
1009 | }());
|
1010 |
|
1011 | var NbPlatform = (function (_super) {
|
1012 | tslib.__extends(NbPlatform, _super);
|
1013 | function NbPlatform() {
|
1014 | return _super !== null && _super.apply(this, arguments) || this;
|
1015 | }
|
1016 | NbPlatform.ɵprov = i0.ɵɵdefineInjectable({ factory: function NbPlatform_Factory() { return new i1.Platform(i0.ɵɵinject(i0.PLATFORM_ID)); }, token: NbPlatform, providedIn: "root" });
|
1017 | NbPlatform.decorators = [
|
1018 | { type: i0.Injectable, args: [{
|
1019 | providedIn: 'root',
|
1020 | useClass: i1.Platform,
|
1021 | },] }
|
1022 | ];
|
1023 | return NbPlatform;
|
1024 | }(i1.Platform));
|
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 |
|
1030 |
|
1031 |
|
1032 |
|
1033 | var NbOverlayContainerAdapter = (function (_super) {
|
1034 | tslib.__extends(NbOverlayContainerAdapter, _super);
|
1035 | function NbOverlayContainerAdapter() {
|
1036 | return _super !== null && _super.apply(this, arguments) || this;
|
1037 | }
|
1038 | NbOverlayContainerAdapter.prototype.setContainer = function (container) {
|
1039 | this.container = container;
|
1040 | };
|
1041 | NbOverlayContainerAdapter.prototype.clearContainer = function () {
|
1042 | this.container = null;
|
1043 | this._containerElement = null;
|
1044 | };
|
1045 | NbOverlayContainerAdapter.prototype._createContainer = function () {
|
1046 | var container = this._document.createElement('div');
|
1047 | container.classList.add('cdk-overlay-container');
|
1048 | this.container.appendChild(container);
|
1049 | this._containerElement = container;
|
1050 | };
|
1051 | NbOverlayContainerAdapter.decorators = [
|
1052 | { type: i0.Injectable }
|
1053 | ];
|
1054 | return NbOverlayContainerAdapter;
|
1055 | }(NbOverlayContainer));
|
1056 |
|
1057 | var NbViewportRulerAdapter = (function (_super) {
|
1058 | tslib.__extends(NbViewportRulerAdapter, _super);
|
1059 | function NbViewportRulerAdapter(platform, ngZone, ruler, scroll, document) {
|
1060 | var _this = _super.call(this, platform, ngZone, document) || this;
|
1061 | _this.ruler = ruler;
|
1062 | _this.scroll = scroll;
|
1063 | return _this;
|
1064 | }
|
1065 | NbViewportRulerAdapter.prototype.getViewportSize = function () {
|
1066 | var res;
|
1067 | |
1068 |
|
1069 |
|
1070 |
|
1071 | this.ruler.getDimensions()
|
1072 | .pipe(rxjs_operators.map(function (dimensions) { return ({ width: dimensions.clientWidth, height: dimensions.clientHeight }); }))
|
1073 | .subscribe(function (rect) { return res = rect; });
|
1074 | return res;
|
1075 | };
|
1076 | NbViewportRulerAdapter.prototype.getViewportScrollPosition = function () {
|
1077 | var res;
|
1078 | |
1079 |
|
1080 |
|
1081 |
|
1082 | this.scroll.getPosition()
|
1083 | .pipe(rxjs_operators.map(function (position) { return ({ top: position.y, left: position.x }); }))
|
1084 | .subscribe(function (position) { return res = position; });
|
1085 | return res;
|
1086 | };
|
1087 | NbViewportRulerAdapter.decorators = [
|
1088 | { type: i0.Injectable }
|
1089 | ];
|
1090 | NbViewportRulerAdapter.ctorParameters = function () { return [
|
1091 | { type: NbPlatform },
|
1092 | { type: i0.NgZone },
|
1093 | { type: NbLayoutRulerService },
|
1094 | { type: NbLayoutScrollService },
|
1095 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] }
|
1096 | ]; };
|
1097 | return NbViewportRulerAdapter;
|
1098 | }(_angular_cdk_overlay.ViewportRuler));
|
1099 |
|
1100 | (function (NbGlobalLogicalPosition) {
|
1101 | NbGlobalLogicalPosition["TOP_START"] = "top-start";
|
1102 | NbGlobalLogicalPosition["TOP_END"] = "top-end";
|
1103 | NbGlobalLogicalPosition["BOTTOM_START"] = "bottom-start";
|
1104 | NbGlobalLogicalPosition["BOTTOM_END"] = "bottom-end";
|
1105 | })(exports.NbGlobalLogicalPosition || (exports.NbGlobalLogicalPosition = {}));
|
1106 |
|
1107 | (function (NbGlobalPhysicalPosition) {
|
1108 | NbGlobalPhysicalPosition["TOP_RIGHT"] = "top-right";
|
1109 | NbGlobalPhysicalPosition["TOP_LEFT"] = "top-left";
|
1110 | NbGlobalPhysicalPosition["BOTTOM_RIGHT"] = "bottom-right";
|
1111 | NbGlobalPhysicalPosition["BOTTOM_LEFT"] = "bottom-left";
|
1112 | })(exports.NbGlobalPhysicalPosition || (exports.NbGlobalPhysicalPosition = {}));
|
1113 | var NbPositionHelper = (function () {
|
1114 | function NbPositionHelper(layoutDirection) {
|
1115 | this.layoutDirection = layoutDirection;
|
1116 | }
|
1117 | NbPositionHelper.prototype.toLogicalPosition = function (position) {
|
1118 | if (Object.values(exports.NbGlobalLogicalPosition).includes(position)) {
|
1119 | return position;
|
1120 | }
|
1121 | if (this.layoutDirection.isLtr()) {
|
1122 | return this.toLogicalPositionWhenLtr(position);
|
1123 | }
|
1124 | else {
|
1125 | return this.toLogicalPositionWhenRtl(position);
|
1126 | }
|
1127 | };
|
1128 | NbPositionHelper.prototype.toPhysicalPosition = function (position) {
|
1129 | if (Object.values(exports.NbGlobalPhysicalPosition).includes(position)) {
|
1130 | return position;
|
1131 | }
|
1132 | if (this.layoutDirection.isLtr()) {
|
1133 | return this.toPhysicalPositionWhenLtr(position);
|
1134 | }
|
1135 | else {
|
1136 | return this.toPhysicalPositionWhenRtl(position);
|
1137 | }
|
1138 | };
|
1139 | NbPositionHelper.prototype.isTopPosition = function (position) {
|
1140 | var logicalPosition = this.toLogicalPosition(position);
|
1141 | return logicalPosition === exports.NbGlobalLogicalPosition.TOP_END
|
1142 | || logicalPosition === exports.NbGlobalLogicalPosition.TOP_START;
|
1143 | };
|
1144 | NbPositionHelper.prototype.isRightPosition = function (position) {
|
1145 | var physicalPosition = this.toPhysicalPosition(position);
|
1146 | return physicalPosition === exports.NbGlobalPhysicalPosition.TOP_RIGHT
|
1147 | || physicalPosition === exports.NbGlobalPhysicalPosition.BOTTOM_RIGHT;
|
1148 | };
|
1149 | NbPositionHelper.prototype.toLogicalPositionWhenLtr = function (position) {
|
1150 | switch (position) {
|
1151 | case exports.NbGlobalPhysicalPosition.TOP_RIGHT:
|
1152 | return exports.NbGlobalLogicalPosition.TOP_END;
|
1153 | case exports.NbGlobalPhysicalPosition.TOP_LEFT:
|
1154 | return exports.NbGlobalLogicalPosition.TOP_START;
|
1155 | case exports.NbGlobalPhysicalPosition.BOTTOM_RIGHT:
|
1156 | return exports.NbGlobalLogicalPosition.BOTTOM_END;
|
1157 | case exports.NbGlobalPhysicalPosition.BOTTOM_LEFT:
|
1158 | return exports.NbGlobalLogicalPosition.BOTTOM_START;
|
1159 | }
|
1160 | };
|
1161 | NbPositionHelper.prototype.toLogicalPositionWhenRtl = function (position) {
|
1162 | switch (position) {
|
1163 | case exports.NbGlobalPhysicalPosition.TOP_RIGHT:
|
1164 | return exports.NbGlobalLogicalPosition.TOP_START;
|
1165 | case exports.NbGlobalPhysicalPosition.TOP_LEFT:
|
1166 | return exports.NbGlobalLogicalPosition.TOP_END;
|
1167 | case exports.NbGlobalPhysicalPosition.BOTTOM_RIGHT:
|
1168 | return exports.NbGlobalLogicalPosition.BOTTOM_START;
|
1169 | case exports.NbGlobalPhysicalPosition.BOTTOM_LEFT:
|
1170 | return exports.NbGlobalLogicalPosition.BOTTOM_END;
|
1171 | }
|
1172 | };
|
1173 | NbPositionHelper.prototype.toPhysicalPositionWhenLtr = function (position) {
|
1174 | switch (position) {
|
1175 | case exports.NbGlobalLogicalPosition.TOP_START:
|
1176 | return exports.NbGlobalPhysicalPosition.TOP_LEFT;
|
1177 | case exports.NbGlobalLogicalPosition.TOP_END:
|
1178 | return exports.NbGlobalPhysicalPosition.TOP_RIGHT;
|
1179 | case exports.NbGlobalLogicalPosition.BOTTOM_START:
|
1180 | return exports.NbGlobalPhysicalPosition.BOTTOM_LEFT;
|
1181 | case exports.NbGlobalLogicalPosition.BOTTOM_END:
|
1182 | return exports.NbGlobalPhysicalPosition.BOTTOM_RIGHT;
|
1183 | }
|
1184 | };
|
1185 | NbPositionHelper.prototype.toPhysicalPositionWhenRtl = function (position) {
|
1186 | switch (position) {
|
1187 | case exports.NbGlobalLogicalPosition.TOP_START:
|
1188 | return exports.NbGlobalPhysicalPosition.TOP_RIGHT;
|
1189 | case exports.NbGlobalLogicalPosition.TOP_END:
|
1190 | return exports.NbGlobalPhysicalPosition.TOP_LEFT;
|
1191 | case exports.NbGlobalLogicalPosition.BOTTOM_START:
|
1192 | return exports.NbGlobalPhysicalPosition.BOTTOM_RIGHT;
|
1193 | case exports.NbGlobalLogicalPosition.BOTTOM_END:
|
1194 | return exports.NbGlobalPhysicalPosition.BOTTOM_LEFT;
|
1195 | }
|
1196 | };
|
1197 | NbPositionHelper.decorators = [
|
1198 | { type: i0.Injectable }
|
1199 | ];
|
1200 | NbPositionHelper.ctorParameters = function () { return [
|
1201 | { type: NbLayoutDirectionService }
|
1202 | ]; };
|
1203 | return NbPositionHelper;
|
1204 | }());
|
1205 |
|
1206 | var _a;
|
1207 |
|
1208 | (function (NbAdjustment) {
|
1209 | NbAdjustment["NOOP"] = "noop";
|
1210 | NbAdjustment["CLOCKWISE"] = "clockwise";
|
1211 | NbAdjustment["COUNTERCLOCKWISE"] = "counterclockwise";
|
1212 | NbAdjustment["VERTICAL"] = "vertical";
|
1213 | NbAdjustment["HORIZONTAL"] = "horizontal";
|
1214 | })(exports.NbAdjustment || (exports.NbAdjustment = {}));
|
1215 |
|
1216 | (function (NbPosition) {
|
1217 | NbPosition["TOP"] = "top";
|
1218 | NbPosition["BOTTOM"] = "bottom";
|
1219 | NbPosition["LEFT"] = "left";
|
1220 | NbPosition["RIGHT"] = "right";
|
1221 | NbPosition["START"] = "start";
|
1222 | NbPosition["END"] = "end";
|
1223 | NbPosition["TOP_END"] = "top-end";
|
1224 | NbPosition["TOP_START"] = "top-start";
|
1225 | NbPosition["BOTTOM_END"] = "bottom-end";
|
1226 | NbPosition["BOTTOM_START"] = "bottom-start";
|
1227 | NbPosition["END_TOP"] = "end-top";
|
1228 | NbPosition["END_BOTTOM"] = "end-bottom";
|
1229 | NbPosition["START_TOP"] = "start-top";
|
1230 | NbPosition["START_BOTTOM"] = "start-bottom";
|
1231 | })(exports.NbPosition || (exports.NbPosition = {}));
|
1232 | var POSITIONS = (_a = {},
|
1233 | _a[exports.NbPosition.RIGHT] = function (offset) {
|
1234 | return { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: offset };
|
1235 | },
|
1236 | _a[exports.NbPosition.BOTTOM] = function (offset) {
|
1237 | return { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: offset };
|
1238 | },
|
1239 | _a[exports.NbPosition.LEFT] = function (offset) {
|
1240 | return { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -offset };
|
1241 | },
|
1242 | _a[exports.NbPosition.TOP] = function (offset) {
|
1243 | return { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -offset };
|
1244 | },
|
1245 | _a[exports.NbPosition.START] = function (offset) {
|
1246 | return this[exports.NbPosition.LEFT](offset);
|
1247 | },
|
1248 | _a[exports.NbPosition.END] = function (offset) {
|
1249 | return this[exports.NbPosition.RIGHT](offset);
|
1250 | },
|
1251 | _a[exports.NbPosition.END_TOP] = function (offset) {
|
1252 | return { originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom', offsetX: offset };
|
1253 | },
|
1254 | _a[exports.NbPosition.END_BOTTOM] = function (offset) {
|
1255 | return { originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: offset };
|
1256 | },
|
1257 | _a[exports.NbPosition.BOTTOM_START] = function (offset) {
|
1258 | return { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: offset };
|
1259 | },
|
1260 | _a[exports.NbPosition.BOTTOM_END] = function (offset) {
|
1261 | return { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: offset };
|
1262 | },
|
1263 | _a[exports.NbPosition.START_TOP] = function (offset) {
|
1264 | return { originX: 'start', originY: 'bottom', overlayX: 'end', overlayY: 'bottom', offsetX: -offset };
|
1265 | },
|
1266 | _a[exports.NbPosition.START_BOTTOM] = function (offset) {
|
1267 | return { originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top', offsetX: -offset };
|
1268 | },
|
1269 | _a[exports.NbPosition.TOP_START] = function (offset) {
|
1270 | return { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -offset };
|
1271 | },
|
1272 | _a[exports.NbPosition.TOP_END] = function (offset) {
|
1273 | return { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -offset };
|
1274 | },
|
1275 | _a);
|
1276 | var COUNTER_CLOCKWISE_POSITIONS = [
|
1277 | exports.NbPosition.TOP,
|
1278 | exports.NbPosition.TOP_END,
|
1279 | exports.NbPosition.TOP_START,
|
1280 | exports.NbPosition.START,
|
1281 | exports.NbPosition.START_TOP,
|
1282 | exports.NbPosition.START_BOTTOM,
|
1283 | exports.NbPosition.BOTTOM,
|
1284 | exports.NbPosition.BOTTOM_START,
|
1285 | exports.NbPosition.BOTTOM_END,
|
1286 | exports.NbPosition.END,
|
1287 | exports.NbPosition.END_BOTTOM,
|
1288 | exports.NbPosition.END_TOP,
|
1289 | ];
|
1290 | var CLOCKWISE_POSITIONS = [
|
1291 | exports.NbPosition.TOP,
|
1292 | exports.NbPosition.TOP_START,
|
1293 | exports.NbPosition.TOP_END,
|
1294 | exports.NbPosition.END,
|
1295 | exports.NbPosition.END_TOP,
|
1296 | exports.NbPosition.END_BOTTOM,
|
1297 | exports.NbPosition.BOTTOM,
|
1298 | exports.NbPosition.BOTTOM_END,
|
1299 | exports.NbPosition.BOTTOM_START,
|
1300 | exports.NbPosition.START,
|
1301 | exports.NbPosition.START_BOTTOM,
|
1302 | exports.NbPosition.START_TOP,
|
1303 | ];
|
1304 | var VERTICAL_POSITIONS = [exports.NbPosition.BOTTOM, exports.NbPosition.TOP];
|
1305 | var HORIZONTAL_POSITIONS = [exports.NbPosition.START, exports.NbPosition.END];
|
1306 | function comparePositions(p1, p2) {
|
1307 | return p1.originX === p2.originX
|
1308 | && p1.originY === p2.originY
|
1309 | && p1.overlayX === p2.overlayX
|
1310 | && p1.overlayY === p2.overlayY;
|
1311 | }
|
1312 |
|
1313 |
|
1314 |
|
1315 |
|
1316 | var NbAdjustableConnectedPositionStrategy = (function (_super) {
|
1317 | tslib.__extends(NbAdjustableConnectedPositionStrategy, _super);
|
1318 | function NbAdjustableConnectedPositionStrategy() {
|
1319 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
1320 | _this._offset = 15;
|
1321 | _this.positionChange = _this.positionChanges.pipe(rxjs_operators.map(function (positionChange) { return positionChange.connectionPair; }), rxjs_operators.map(function (connectionPair) {
|
1322 | return _this.appliedPositions.find(function (_a) {
|
1323 | var connectedPosition = _a.connectedPosition;
|
1324 | return comparePositions(connectedPosition, connectionPair);
|
1325 | }).key;
|
1326 | }));
|
1327 | return _this;
|
1328 | }
|
1329 | NbAdjustableConnectedPositionStrategy.prototype.attach = function (overlayRef) {
|
1330 | |
1331 |
|
1332 |
|
1333 |
|
1334 | this.applyPositions();
|
1335 | _super.prototype.attach.call(this, overlayRef);
|
1336 | };
|
1337 | NbAdjustableConnectedPositionStrategy.prototype.apply = function () {
|
1338 | this.applyPositions();
|
1339 | _super.prototype.apply.call(this);
|
1340 | };
|
1341 | NbAdjustableConnectedPositionStrategy.prototype.position = function (position) {
|
1342 | this._position = position;
|
1343 | return this;
|
1344 | };
|
1345 | NbAdjustableConnectedPositionStrategy.prototype.adjustment = function (adjustment) {
|
1346 | this._adjustment = adjustment;
|
1347 | return this;
|
1348 | };
|
1349 | NbAdjustableConnectedPositionStrategy.prototype.offset = function (offset) {
|
1350 | this._offset = offset;
|
1351 | return this;
|
1352 | };
|
1353 | NbAdjustableConnectedPositionStrategy.prototype.applyPositions = function () {
|
1354 | var positions = this.createPositions();
|
1355 | this.persistChosenPositions(positions);
|
1356 | this.withPositions(this.appliedPositions.map(function (_a) {
|
1357 | var connectedPosition = _a.connectedPosition;
|
1358 | return connectedPosition;
|
1359 | }));
|
1360 | };
|
1361 | NbAdjustableConnectedPositionStrategy.prototype.createPositions = function () {
|
1362 | switch (this._adjustment) {
|
1363 | case exports.NbAdjustment.NOOP:
|
1364 | return [this._position];
|
1365 | case exports.NbAdjustment.CLOCKWISE:
|
1366 | return this.reorderPreferredPositions(CLOCKWISE_POSITIONS);
|
1367 | case exports.NbAdjustment.COUNTERCLOCKWISE:
|
1368 | return this.reorderPreferredPositions(COUNTER_CLOCKWISE_POSITIONS);
|
1369 | case exports.NbAdjustment.HORIZONTAL:
|
1370 | return this.reorderPreferredPositions(HORIZONTAL_POSITIONS);
|
1371 | case exports.NbAdjustment.VERTICAL:
|
1372 | return this.reorderPreferredPositions(VERTICAL_POSITIONS);
|
1373 | }
|
1374 | };
|
1375 | NbAdjustableConnectedPositionStrategy.prototype.persistChosenPositions = function (positions) {
|
1376 | var _this = this;
|
1377 | this.appliedPositions = positions.map(function (position) { return ({
|
1378 | key: position,
|
1379 | connectedPosition: POSITIONS[position](_this._offset),
|
1380 | }); });
|
1381 | };
|
1382 | NbAdjustableConnectedPositionStrategy.prototype.reorderPreferredPositions = function (positions) {
|
1383 |
|
1384 | var startPositionIndex = positions.indexOf(this.mapToLogicalPosition(this._position));
|
1385 | var firstPart = positions.slice(startPositionIndex);
|
1386 | var secondPart = positions.slice(0, startPositionIndex);
|
1387 | return firstPart.concat(secondPart);
|
1388 | };
|
1389 | NbAdjustableConnectedPositionStrategy.prototype.mapToLogicalPosition = function (position) {
|
1390 | if (position === exports.NbPosition.LEFT) {
|
1391 | return exports.NbPosition.START;
|
1392 | }
|
1393 | if (position === exports.NbPosition.RIGHT) {
|
1394 | return exports.NbPosition.END;
|
1395 | }
|
1396 | return position;
|
1397 | };
|
1398 | return NbAdjustableConnectedPositionStrategy;
|
1399 | }(NbFlexibleConnectedPositionStrategy));
|
1400 | var NbGlobalPositionStrategy = (function (_super) {
|
1401 | tslib.__extends(NbGlobalPositionStrategy, _super);
|
1402 | function NbGlobalPositionStrategy() {
|
1403 | return _super !== null && _super.apply(this, arguments) || this;
|
1404 | }
|
1405 | NbGlobalPositionStrategy.prototype.position = function (position) {
|
1406 | switch (position) {
|
1407 | case exports.NbGlobalLogicalPosition.TOP_START:
|
1408 | return this.top().left();
|
1409 | case exports.NbGlobalLogicalPosition.TOP_END:
|
1410 | return this.top().right();
|
1411 | case exports.NbGlobalLogicalPosition.BOTTOM_START:
|
1412 | return this.bottom().left();
|
1413 | case exports.NbGlobalLogicalPosition.BOTTOM_END:
|
1414 | return this.bottom().right();
|
1415 | }
|
1416 | };
|
1417 | return NbGlobalPositionStrategy;
|
1418 | }(_angular_cdk_overlay.GlobalPositionStrategy));
|
1419 | var NbPositionBuilderService = (function () {
|
1420 | function NbPositionBuilderService(document, viewportRuler, platform, positionBuilder, overlayContainer) {
|
1421 | this.document = document;
|
1422 | this.viewportRuler = viewportRuler;
|
1423 | this.platform = platform;
|
1424 | this.positionBuilder = positionBuilder;
|
1425 | this.overlayContainer = overlayContainer;
|
1426 | }
|
1427 | NbPositionBuilderService.prototype.global = function () {
|
1428 | return new NbGlobalPositionStrategy();
|
1429 | };
|
1430 | NbPositionBuilderService.prototype.connectedTo = function (elementRef) {
|
1431 | return new NbAdjustableConnectedPositionStrategy(elementRef, this.viewportRuler, this.document, this.platform, this.overlayContainer)
|
1432 | .withFlexibleDimensions(false)
|
1433 | .withPush(false);
|
1434 | };
|
1435 | NbPositionBuilderService.decorators = [
|
1436 | { type: i0.Injectable }
|
1437 | ];
|
1438 | NbPositionBuilderService.ctorParameters = function () { return [
|
1439 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
1440 | { type: NbViewportRulerAdapter },
|
1441 | { type: NbPlatform },
|
1442 | { type: NbOverlayPositionBuilder },
|
1443 | { type: NbOverlayContainerAdapter }
|
1444 | ]; };
|
1445 | return NbPositionBuilderService;
|
1446 | }());
|
1447 |
|
1448 | var NbPositionedContainerComponent = (function () {
|
1449 | function NbPositionedContainerComponent() {
|
1450 | }
|
1451 | Object.defineProperty(NbPositionedContainerComponent.prototype, "top", {
|
1452 | get: function () {
|
1453 | return this.position === exports.NbPosition.TOP;
|
1454 | },
|
1455 | enumerable: false,
|
1456 | configurable: true
|
1457 | });
|
1458 | Object.defineProperty(NbPositionedContainerComponent.prototype, "topStart", {
|
1459 | get: function () {
|
1460 | return this.position === exports.NbPosition.TOP_START;
|
1461 | },
|
1462 | enumerable: false,
|
1463 | configurable: true
|
1464 | });
|
1465 | Object.defineProperty(NbPositionedContainerComponent.prototype, "topEnd", {
|
1466 | get: function () {
|
1467 | return this.position === exports.NbPosition.TOP_END;
|
1468 | },
|
1469 | enumerable: false,
|
1470 | configurable: true
|
1471 | });
|
1472 | Object.defineProperty(NbPositionedContainerComponent.prototype, "right", {
|
1473 | get: function () {
|
1474 | return this.position === exports.NbPosition.RIGHT || this.position === exports.NbPosition.END;
|
1475 | },
|
1476 | enumerable: false,
|
1477 | configurable: true
|
1478 | });
|
1479 | Object.defineProperty(NbPositionedContainerComponent.prototype, "endTop", {
|
1480 | get: function () {
|
1481 | return this.position === exports.NbPosition.END_TOP;
|
1482 | },
|
1483 | enumerable: false,
|
1484 | configurable: true
|
1485 | });
|
1486 | Object.defineProperty(NbPositionedContainerComponent.prototype, "endBottom", {
|
1487 | get: function () {
|
1488 | return this.position === exports.NbPosition.END_BOTTOM;
|
1489 | },
|
1490 | enumerable: false,
|
1491 | configurable: true
|
1492 | });
|
1493 | Object.defineProperty(NbPositionedContainerComponent.prototype, "bottom", {
|
1494 | get: function () {
|
1495 | return this.position === exports.NbPosition.BOTTOM;
|
1496 | },
|
1497 | enumerable: false,
|
1498 | configurable: true
|
1499 | });
|
1500 | Object.defineProperty(NbPositionedContainerComponent.prototype, "bottomStart", {
|
1501 | get: function () {
|
1502 | return this.position === exports.NbPosition.BOTTOM_START;
|
1503 | },
|
1504 | enumerable: false,
|
1505 | configurable: true
|
1506 | });
|
1507 | Object.defineProperty(NbPositionedContainerComponent.prototype, "bottomEnd", {
|
1508 | get: function () {
|
1509 | return this.position === exports.NbPosition.BOTTOM_END;
|
1510 | },
|
1511 | enumerable: false,
|
1512 | configurable: true
|
1513 | });
|
1514 | Object.defineProperty(NbPositionedContainerComponent.prototype, "left", {
|
1515 | get: function () {
|
1516 | return this.position === exports.NbPosition.LEFT || this.position === exports.NbPosition.START;
|
1517 | },
|
1518 | enumerable: false,
|
1519 | configurable: true
|
1520 | });
|
1521 | Object.defineProperty(NbPositionedContainerComponent.prototype, "startTop", {
|
1522 | get: function () {
|
1523 | return this.position === exports.NbPosition.START_TOP;
|
1524 | },
|
1525 | enumerable: false,
|
1526 | configurable: true
|
1527 | });
|
1528 | Object.defineProperty(NbPositionedContainerComponent.prototype, "startBottom", {
|
1529 | get: function () {
|
1530 | return this.position === exports.NbPosition.START_BOTTOM;
|
1531 | },
|
1532 | enumerable: false,
|
1533 | configurable: true
|
1534 | });
|
1535 | NbPositionedContainerComponent.decorators = [
|
1536 | { type: i0.Component, args: [{
|
1537 | template: ''
|
1538 | },] }
|
1539 | ];
|
1540 | NbPositionedContainerComponent.propDecorators = {
|
1541 | position: [{ type: i0.Input }],
|
1542 | top: [{ type: i0.HostBinding, args: ['class.nb-overlay-top',] }],
|
1543 | topStart: [{ type: i0.HostBinding, args: ['class.nb-overlay-top-start',] }],
|
1544 | topEnd: [{ type: i0.HostBinding, args: ['class.nb-overlay-top-end',] }],
|
1545 | right: [{ type: i0.HostBinding, args: ['class.nb-overlay-right',] }],
|
1546 | endTop: [{ type: i0.HostBinding, args: ['class.nb-overlay-end-top',] }],
|
1547 | endBottom: [{ type: i0.HostBinding, args: ['class.nb-overlay-end-bottom',] }],
|
1548 | bottom: [{ type: i0.HostBinding, args: ['class.nb-overlay-bottom',] }],
|
1549 | bottomStart: [{ type: i0.HostBinding, args: ['class.nb-overlay-bottom-start',] }],
|
1550 | bottomEnd: [{ type: i0.HostBinding, args: ['class.nb-overlay-bottom-end',] }],
|
1551 | left: [{ type: i0.HostBinding, args: ['class.nb-overlay-left',] }],
|
1552 | startTop: [{ type: i0.HostBinding, args: ['class.nb-overlay-start-top',] }],
|
1553 | startBottom: [{ type: i0.HostBinding, args: ['class.nb-overlay-start-bottom',] }]
|
1554 | };
|
1555 | return NbPositionedContainerComponent;
|
1556 | }());
|
1557 | var NbOverlayContainerComponent = (function () {
|
1558 | function NbOverlayContainerComponent(vcr, injector, changeDetectorRef) {
|
1559 | this.vcr = vcr;
|
1560 | this.injector = injector;
|
1561 | this.changeDetectorRef = changeDetectorRef;
|
1562 | this.isAttached = false;
|
1563 | }
|
1564 | Object.defineProperty(NbOverlayContainerComponent.prototype, "isStringContent", {
|
1565 | get: function () {
|
1566 | return !!this.content;
|
1567 | },
|
1568 | enumerable: false,
|
1569 | configurable: true
|
1570 | });
|
1571 | NbOverlayContainerComponent.prototype.attachComponentPortal = function (portal, context) {
|
1572 | portal.injector = this.createChildInjector(portal.componentFactoryResolver);
|
1573 | var componentRef = this.portalOutlet.attachComponentPortal(portal);
|
1574 | if (context) {
|
1575 | Object.assign(componentRef.instance, context);
|
1576 | }
|
1577 | componentRef.changeDetectorRef.markForCheck();
|
1578 | componentRef.changeDetectorRef.detectChanges();
|
1579 | this.isAttached = true;
|
1580 | return componentRef;
|
1581 | };
|
1582 | NbOverlayContainerComponent.prototype.attachTemplatePortal = function (portal) {
|
1583 | var templateRef = this.portalOutlet.attachTemplatePortal(portal);
|
1584 | templateRef.detectChanges();
|
1585 | this.isAttached = true;
|
1586 | return templateRef;
|
1587 | };
|
1588 | NbOverlayContainerComponent.prototype.attachStringContent = function (content) {
|
1589 | this.content = content;
|
1590 | this.changeDetectorRef.markForCheck();
|
1591 | this.changeDetectorRef.detectChanges();
|
1592 | this.isAttached = true;
|
1593 | };
|
1594 | NbOverlayContainerComponent.prototype.detach = function () {
|
1595 | if (this.portalOutlet.hasAttached()) {
|
1596 | this.portalOutlet.detach();
|
1597 | }
|
1598 | this.attachStringContent(null);
|
1599 | this.isAttached = false;
|
1600 | };
|
1601 | NbOverlayContainerComponent.prototype.createChildInjector = function (cfr) {
|
1602 | return new NbPortalInjector(this.injector, new WeakMap([
|
1603 | [i0.ComponentFactoryResolver, cfr],
|
1604 | ]));
|
1605 | };
|
1606 | NbOverlayContainerComponent.decorators = [
|
1607 | { type: i0.Component, args: [{
|
1608 | selector: 'nb-overlay-container',
|
1609 | template: "\n <div *ngIf=\"isStringContent\" class=\"primitive-overlay\">{{ content }}</div>\n <ng-template nbPortalOutlet></ng-template>\n "
|
1610 | },] }
|
1611 | ];
|
1612 | NbOverlayContainerComponent.ctorParameters = function () { return [
|
1613 | { type: i0.ViewContainerRef },
|
1614 | { type: i0.Injector },
|
1615 | { type: i0.ChangeDetectorRef }
|
1616 | ]; };
|
1617 | NbOverlayContainerComponent.propDecorators = {
|
1618 | portalOutlet: [{ type: i0.ViewChild, args: [NbPortalOutletDirective, { static: true },] }]
|
1619 | };
|
1620 | return NbOverlayContainerComponent;
|
1621 | }());
|
1622 |
|
1623 | function patch(container, containerContext) {
|
1624 | Object.assign(container.instance, containerContext);
|
1625 | container.changeDetectorRef.detectChanges();
|
1626 | return container;
|
1627 | }
|
1628 | function createContainer(ref, container, context, componentFactoryResolver) {
|
1629 | var containerRef = ref.attach(new NbComponentPortal(container, null, null, componentFactoryResolver));
|
1630 | patch(containerRef, context);
|
1631 | return containerRef;
|
1632 | }
|
1633 | var NbOverlayService = (function () {
|
1634 | function NbOverlayService(overlay, layoutDirection) {
|
1635 | this.overlay = overlay;
|
1636 | this.layoutDirection = layoutDirection;
|
1637 | }
|
1638 | Object.defineProperty(NbOverlayService.prototype, "scrollStrategies", {
|
1639 | get: function () {
|
1640 | return this.overlay.scrollStrategies;
|
1641 | },
|
1642 | enumerable: false,
|
1643 | configurable: true
|
1644 | });
|
1645 | NbOverlayService.prototype.create = function (config) {
|
1646 | var overlayRef = this.overlay.create(config);
|
1647 | this.layoutDirection.onDirectionChange()
|
1648 | .subscribe(function (dir) { return overlayRef.setDirection(dir); });
|
1649 | return overlayRef;
|
1650 | };
|
1651 | NbOverlayService.decorators = [
|
1652 | { type: i0.Injectable }
|
1653 | ];
|
1654 | NbOverlayService.ctorParameters = function () { return [
|
1655 | { type: NbOverlay },
|
1656 | { type: NbLayoutDirectionService }
|
1657 | ]; };
|
1658 | return NbOverlayService;
|
1659 | }());
|
1660 |
|
1661 | var NbScrollDispatcherAdapter = (function (_super) {
|
1662 | tslib.__extends(NbScrollDispatcherAdapter, _super);
|
1663 | function NbScrollDispatcherAdapter(ngZone, platform, scrollService, document) {
|
1664 | var _this = _super.call(this, ngZone, platform, document) || this;
|
1665 | _this.scrollService = scrollService;
|
1666 | return _this;
|
1667 | }
|
1668 | NbScrollDispatcherAdapter.prototype.scrolled = function (auditTimeInMs) {
|
1669 | return rxjs.merge(_super.prototype.scrolled.call(this, auditTimeInMs), this.scrollService.onScroll());
|
1670 | };
|
1671 | NbScrollDispatcherAdapter.decorators = [
|
1672 | { type: i0.Injectable }
|
1673 | ];
|
1674 | NbScrollDispatcherAdapter.ctorParameters = function () { return [
|
1675 | { type: i0.NgZone },
|
1676 | { type: NbPlatform },
|
1677 | { type: NbLayoutScrollService },
|
1678 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] }
|
1679 | ]; };
|
1680 | return NbScrollDispatcherAdapter;
|
1681 | }(_angular_cdk_overlay.ScrollDispatcher));
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 | var NbBlockScrollStrategyAdapter = (function (_super) {
|
1688 | tslib.__extends(NbBlockScrollStrategyAdapter, _super);
|
1689 | function NbBlockScrollStrategyAdapter(document, viewportRuler, scrollService) {
|
1690 | var _this = _super.call(this, viewportRuler, document) || this;
|
1691 | _this.scrollService = scrollService;
|
1692 | return _this;
|
1693 | }
|
1694 | NbBlockScrollStrategyAdapter.prototype.enable = function () {
|
1695 | _super.prototype.enable.call(this);
|
1696 | this.scrollService.scrollable(false);
|
1697 | };
|
1698 | NbBlockScrollStrategyAdapter.prototype.disable = function () {
|
1699 | _super.prototype.disable.call(this);
|
1700 | this.scrollService.scrollable(true);
|
1701 | };
|
1702 | NbBlockScrollStrategyAdapter.decorators = [
|
1703 | { type: i0.Injectable }
|
1704 | ];
|
1705 | NbBlockScrollStrategyAdapter.ctorParameters = function () { return [
|
1706 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
1707 | { type: NbViewportRulerAdapter },
|
1708 | { type: NbLayoutScrollService }
|
1709 | ]; };
|
1710 | return NbBlockScrollStrategyAdapter;
|
1711 | }(_angular_cdk_overlay.BlockScrollStrategy));
|
1712 | var NbScrollStrategyOptions = (function (_super) {
|
1713 | tslib.__extends(NbScrollStrategyOptions, _super);
|
1714 | function NbScrollStrategyOptions(scrollService, scrollDispatcher, viewportRuler, ngZone, document) {
|
1715 | var _this = _super.call(this, scrollDispatcher, viewportRuler, ngZone, document) || this;
|
1716 | _this.scrollService = scrollService;
|
1717 | _this.scrollDispatcher = scrollDispatcher;
|
1718 | _this.viewportRuler = viewportRuler;
|
1719 | _this.ngZone = ngZone;
|
1720 | _this.document = document;
|
1721 | _this.block = function () { return new NbBlockScrollStrategyAdapter(_this.document, _this.viewportRuler, _this.scrollService); };
|
1722 | return _this;
|
1723 | }
|
1724 | NbScrollStrategyOptions.decorators = [
|
1725 | { type: i0.Injectable }
|
1726 | ];
|
1727 | NbScrollStrategyOptions.ctorParameters = function () { return [
|
1728 | { type: NbLayoutScrollService },
|
1729 | { type: _angular_cdk_overlay.ScrollDispatcher },
|
1730 | { type: NbViewportRulerAdapter },
|
1731 | { type: i0.NgZone },
|
1732 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] }
|
1733 | ]; };
|
1734 | return NbScrollStrategyOptions;
|
1735 | }(_angular_cdk_overlay.ScrollStrategyOptions));
|
1736 |
|
1737 | var NbCdkAdapterModule = (function () {
|
1738 | function NbCdkAdapterModule() {
|
1739 | }
|
1740 | NbCdkAdapterModule.forRoot = function () {
|
1741 | return {
|
1742 | ngModule: NbCdkAdapterModule,
|
1743 | providers: [
|
1744 | NbViewportRulerAdapter,
|
1745 | NbOverlayContainerAdapter,
|
1746 | NbBlockScrollStrategyAdapter,
|
1747 | NbScrollDispatcherAdapter,
|
1748 | NbScrollStrategyOptions,
|
1749 | { provide: _angular_cdk_overlay.OverlayContainer, useExisting: NbOverlayContainerAdapter },
|
1750 | { provide: NbOverlayContainer, useExisting: NbOverlayContainerAdapter },
|
1751 | { provide: _angular_cdk_overlay.ScrollDispatcher, useExisting: NbScrollDispatcherAdapter },
|
1752 | { provide: _angular_cdk_overlay.ScrollStrategyOptions, useExisting: NbScrollStrategyOptions },
|
1753 | ],
|
1754 | };
|
1755 | };
|
1756 | NbCdkAdapterModule.decorators = [
|
1757 | { type: i0.NgModule, args: [{},] }
|
1758 | ];
|
1759 | return NbCdkAdapterModule;
|
1760 | }());
|
1761 |
|
1762 | (function (NbTrigger) {
|
1763 | NbTrigger["NOOP"] = "noop";
|
1764 | NbTrigger["CLICK"] = "click";
|
1765 | NbTrigger["HOVER"] = "hover";
|
1766 | NbTrigger["HINT"] = "hint";
|
1767 | NbTrigger["FOCUS"] = "focus";
|
1768 | })(exports.NbTrigger || (exports.NbTrigger = {}));
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 | var NbTriggerStrategyBase = (function () {
|
1774 | function NbTriggerStrategyBase(document, host, container) {
|
1775 | this.document = document;
|
1776 | this.host = host;
|
1777 | this.container = container;
|
1778 | this.destroyed$ = new rxjs.Subject();
|
1779 | }
|
1780 | NbTriggerStrategyBase.prototype.destroy = function () {
|
1781 | this.destroyed$.next();
|
1782 | };
|
1783 | NbTriggerStrategyBase.prototype.isNotOnHostOrContainer = function (event) {
|
1784 | return !this.isOnHost(event) && !this.isOnContainer(event);
|
1785 | };
|
1786 | NbTriggerStrategyBase.prototype.isOnHostOrContainer = function (event) {
|
1787 | return this.isOnHost(event) || this.isOnContainer(event);
|
1788 | };
|
1789 | NbTriggerStrategyBase.prototype.isOnHost = function (_a) {
|
1790 | var target = _a.target;
|
1791 | return this.host.contains(target);
|
1792 | };
|
1793 | NbTriggerStrategyBase.prototype.isOnContainer = function (_a) {
|
1794 | var target = _a.target;
|
1795 | return this.container() && this.container().location.nativeElement.contains(target);
|
1796 | };
|
1797 | return NbTriggerStrategyBase;
|
1798 | }());
|
1799 |
|
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 |
|
1805 | var NbClickTriggerStrategy = (function (_super) {
|
1806 | tslib.__extends(NbClickTriggerStrategy, _super);
|
1807 | function NbClickTriggerStrategy() {
|
1808 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 | _this.click$ = rxjs.fromEvent(_this.document, 'click')
|
1814 | .pipe(rxjs_operators.map(function (event) { return [!_this.container() && _this.isOnHost(event), event]; }), rxjs_operators.share(), rxjs_operators.takeUntil(_this.destroyed$));
|
1815 | _this.show$ = _this.click$
|
1816 | .pipe(rxjs_operators.filter(function (_a) {
|
1817 | var shouldShow = _a[0];
|
1818 | return shouldShow;
|
1819 | }), rxjs_operators.map(function (_a) {
|
1820 | var event = _a[1];
|
1821 | return event;
|
1822 | }), rxjs_operators.takeUntil(_this.destroyed$));
|
1823 | _this.hide$ = _this.click$
|
1824 | .pipe(rxjs_operators.filter(function (_a) {
|
1825 | var shouldShow = _a[0], event = _a[1];
|
1826 | return !shouldShow && !_this.isOnContainer(event);
|
1827 | }), rxjs_operators.map(function (_a) {
|
1828 | var event = _a[1];
|
1829 | return event;
|
1830 | }), rxjs_operators.takeUntil(_this.destroyed$));
|
1831 | return _this;
|
1832 | }
|
1833 | return NbClickTriggerStrategy;
|
1834 | }(NbTriggerStrategyBase));
|
1835 |
|
1836 |
|
1837 |
|
1838 |
|
1839 |
|
1840 | var NbHoverTriggerStrategy = (function (_super) {
|
1841 | tslib.__extends(NbHoverTriggerStrategy, _super);
|
1842 | function NbHoverTriggerStrategy() {
|
1843 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
1844 | _this.show$ = rxjs.fromEvent(_this.host, 'mouseenter')
|
1845 | .pipe(rxjs_operators.filter(function () { return !_this.container(); }),
|
1846 |
|
1847 |
|
1848 | rxjs_operators.delay(100),
|
1849 |
|
1850 | rxjs_operators.takeUntil(rxjs.fromEvent(_this.host, 'mouseleave')), rxjs_operators.repeat(), rxjs_operators.takeUntil(_this.destroyed$));
|
1851 | _this.hide$ = rxjs.fromEvent(_this.host, 'mouseleave')
|
1852 | .pipe(rxjs_operators.switchMap(function () { return rxjs.fromEvent(_this.document, 'mousemove')
|
1853 | .pipe(rxjs_operators.debounceTime(100), rxjs_operators.takeWhile(function () { return !!_this.container(); }), rxjs_operators.filter(function (event) { return _this.isNotOnHostOrContainer(event); })); }), rxjs_operators.takeUntil(_this.destroyed$));
|
1854 | return _this;
|
1855 | }
|
1856 | return NbHoverTriggerStrategy;
|
1857 | }(NbTriggerStrategyBase));
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 |
|
1863 | var NbHintTriggerStrategy = (function (_super) {
|
1864 | tslib.__extends(NbHintTriggerStrategy, _super);
|
1865 | function NbHintTriggerStrategy() {
|
1866 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
1867 | _this.show$ = rxjs.fromEvent(_this.host, 'mouseenter')
|
1868 | .pipe(
|
1869 |
|
1870 |
|
1871 | rxjs_operators.delay(100),
|
1872 |
|
1873 | rxjs_operators.takeUntil(rxjs.fromEvent(_this.host, 'mouseleave')), rxjs_operators.repeat(), rxjs_operators.takeUntil(_this.destroyed$));
|
1874 | _this.hide$ = rxjs.fromEvent(_this.host, 'mouseleave')
|
1875 | .pipe(rxjs_operators.takeUntil(_this.destroyed$));
|
1876 | return _this;
|
1877 | }
|
1878 | return NbHintTriggerStrategy;
|
1879 | }(NbTriggerStrategyBase));
|
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 |
|
1885 | var NbFocusTriggerStrategy = (function (_super) {
|
1886 | tslib.__extends(NbFocusTriggerStrategy, _super);
|
1887 | function NbFocusTriggerStrategy() {
|
1888 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
1889 | _this.focusOut$ = rxjs.fromEvent(_this.host, 'focusout')
|
1890 | .pipe(rxjs_operators.switchMap(function () { return rxjs.fromEvent(_this.document, 'focusin')
|
1891 | .pipe(rxjs_operators.takeWhile(function () { return !!_this.container(); }), rxjs_operators.filter(function (event) { return _this.isNotOnHostOrContainer(event); })); }), rxjs_operators.takeUntil(_this.destroyed$));
|
1892 | _this.clickIn$ = rxjs.fromEvent(_this.host, 'click')
|
1893 | .pipe(rxjs_operators.filter(function () { return !_this.container(); }), rxjs_operators.takeUntil(_this.destroyed$));
|
1894 | _this.clickOut$ = rxjs.fromEvent(_this.document, 'click')
|
1895 | .pipe(rxjs_operators.filter(function () { return !!_this.container(); }), rxjs_operators.filter(function (event) { return _this.isNotOnHostOrContainer(event); }), rxjs_operators.takeUntil(_this.destroyed$));
|
1896 | _this.tabKeyPress$ = rxjs.fromEvent(_this.document, 'keydown')
|
1897 | .pipe(rxjs_operators.filter(function (event) { return event.keyCode === 9; }), rxjs_operators.filter(function () { return !!_this.container(); }), rxjs_operators.takeUntil(_this.destroyed$));
|
1898 | _this.show$ = rxjs.merge(rxjs.fromEvent(_this.host, 'focusin'), _this.clickIn$)
|
1899 | .pipe(rxjs_operators.filter(function () { return !_this.container(); }), rxjs_operators.debounceTime(100),
|
1900 |
|
1901 | rxjs_operators.takeUntil(rxjs.fromEvent(_this.host, 'focusout')), rxjs_operators.repeat(), rxjs_operators.takeUntil(_this.destroyed$));
|
1902 | _this.hide$ = rxjs.merge(_this.focusOut$, _this.tabKeyPress$, _this.clickOut$)
|
1903 | .pipe(rxjs_operators.takeUntil(_this.destroyed$));
|
1904 | return _this;
|
1905 | }
|
1906 | return NbFocusTriggerStrategy;
|
1907 | }(NbTriggerStrategyBase));
|
1908 |
|
1909 |
|
1910 |
|
1911 | var NbNoopTriggerStrategy = (function (_super) {
|
1912 | tslib.__extends(NbNoopTriggerStrategy, _super);
|
1913 | function NbNoopTriggerStrategy() {
|
1914 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
1915 | _this.show$ = rxjs.EMPTY;
|
1916 | _this.hide$ = rxjs.EMPTY;
|
1917 | return _this;
|
1918 | }
|
1919 | return NbNoopTriggerStrategy;
|
1920 | }(NbTriggerStrategyBase));
|
1921 | var NbTriggerStrategyBuilderService = (function () {
|
1922 | function NbTriggerStrategyBuilderService(_document) {
|
1923 | this._document = _document;
|
1924 | }
|
1925 | NbTriggerStrategyBuilderService.prototype.trigger = function (trigger$$1) {
|
1926 | this._trigger = trigger$$1;
|
1927 | return this;
|
1928 | };
|
1929 | NbTriggerStrategyBuilderService.prototype.host = function (host) {
|
1930 | this._host = host;
|
1931 | return this;
|
1932 | };
|
1933 | NbTriggerStrategyBuilderService.prototype.container = function (container) {
|
1934 | this._container = container;
|
1935 | return this;
|
1936 | };
|
1937 | NbTriggerStrategyBuilderService.prototype.build = function () {
|
1938 | switch (this._trigger) {
|
1939 | case exports.NbTrigger.CLICK:
|
1940 | return new NbClickTriggerStrategy(this._document, this._host, this._container);
|
1941 | case exports.NbTrigger.HINT:
|
1942 | return new NbHintTriggerStrategy(this._document, this._host, this._container);
|
1943 | case exports.NbTrigger.HOVER:
|
1944 | return new NbHoverTriggerStrategy(this._document, this._host, this._container);
|
1945 | case exports.NbTrigger.FOCUS:
|
1946 | return new NbFocusTriggerStrategy(this._document, this._host, this._container);
|
1947 | case exports.NbTrigger.NOOP:
|
1948 | return new NbNoopTriggerStrategy(this._document, this._host, this._container);
|
1949 | default:
|
1950 | throw new Error('Trigger have to be provided');
|
1951 | }
|
1952 | };
|
1953 | NbTriggerStrategyBuilderService.decorators = [
|
1954 | { type: i0.Injectable }
|
1955 | ];
|
1956 | NbTriggerStrategyBuilderService.ctorParameters = function () { return [
|
1957 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] }
|
1958 | ]; };
|
1959 | return NbTriggerStrategyBuilderService;
|
1960 | }());
|
1961 |
|
1962 | var NbOverlayModule = (function () {
|
1963 | function NbOverlayModule() {
|
1964 | }
|
1965 | NbOverlayModule.forRoot = function () {
|
1966 | return {
|
1967 | ngModule: NbOverlayModule,
|
1968 | providers: tslib.__spreadArray(tslib.__spreadArray(tslib.__spreadArray([
|
1969 | NbPositionBuilderService,
|
1970 | NbTriggerStrategyBuilderService,
|
1971 | NbOverlayService,
|
1972 | NbPositionHelper
|
1973 | ], NbCdkMappingModule.forRoot().providers), NbCdkAdapterModule.forRoot().providers), NbA11yModule.forRoot().providers),
|
1974 | };
|
1975 | };
|
1976 | NbOverlayModule.decorators = [
|
1977 | { type: i0.NgModule, args: [{
|
1978 | imports: [
|
1979 | NbCdkMappingModule,
|
1980 | NbSharedModule,
|
1981 | ],
|
1982 | declarations: [
|
1983 | NbPositionedContainerComponent,
|
1984 | NbOverlayContainerComponent,
|
1985 | ],
|
1986 | exports: [
|
1987 | NbCdkMappingModule,
|
1988 | NbCdkAdapterModule,
|
1989 | NbOverlayContainerComponent,
|
1990 | ],
|
1991 | },] }
|
1992 | ];
|
1993 | return NbOverlayModule;
|
1994 | }());
|
1995 |
|
1996 |
|
1997 |
|
1998 |
|
1999 |
|
2000 |
|
2001 | var NbStatusService = (function () {
|
2002 | function NbStatusService() {
|
2003 | this.coreStatuses = ['basic', 'primary', 'info', 'warning', 'danger', 'control'];
|
2004 | }
|
2005 | NbStatusService.prototype.isCoreStatus = function (status) {
|
2006 | return this.coreStatuses.includes(status);
|
2007 | };
|
2008 | NbStatusService.prototype.isCustomStatus = function (status) {
|
2009 | if (this.isValidStatusString(status)) {
|
2010 | return !this.isCoreStatus(status);
|
2011 | }
|
2012 | return false;
|
2013 | };
|
2014 | NbStatusService.prototype.getStatusClass = function (status) {
|
2015 | if (this.isValidStatusString(status)) {
|
2016 | return "status-" + status;
|
2017 | }
|
2018 | return undefined;
|
2019 | };
|
2020 | NbStatusService.prototype.isValidStatusString = function (status) {
|
2021 | return typeof status === 'string' && status.length > 0;
|
2022 | };
|
2023 | NbStatusService.decorators = [
|
2024 | { type: i0.Injectable }
|
2025 | ];
|
2026 | return NbStatusService;
|
2027 | }());
|
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 |
|
2033 |
|
2034 | function windowFactory(platformId) {
|
2035 | if (_angular_common.isPlatformBrowser(platformId)) {
|
2036 | return window;
|
2037 | }
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 | return undefined;
|
2043 | }
|
2044 | var NbThemeModule = (function () {
|
2045 | function NbThemeModule() {
|
2046 | }
|
2047 |
|
2048 | |
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 | NbThemeModule.forRoot = function (nbThemeOptions, nbJSThemes, nbMediaBreakpoints, layoutDirection) {
|
2059 | if (nbThemeOptions === void 0) { nbThemeOptions = { name: 'default' }; }
|
2060 | return {
|
2061 | ngModule: NbThemeModule,
|
2062 | providers: tslib.__spreadArray(tslib.__spreadArray([
|
2063 | { provide: NB_THEME_OPTIONS, useValue: nbThemeOptions || {} },
|
2064 | { provide: NB_BUILT_IN_JS_THEMES, useValue: BUILT_IN_THEMES },
|
2065 | { provide: NB_JS_THEMES, useValue: nbJSThemes || [] },
|
2066 | { provide: NB_MEDIA_BREAKPOINTS, useValue: nbMediaBreakpoints || DEFAULT_MEDIA_BREAKPOINTS },
|
2067 | { provide: NB_DOCUMENT, useExisting: _angular_common.DOCUMENT },
|
2068 | { provide: NB_WINDOW, useFactory: windowFactory, deps: [i0.PLATFORM_ID] },
|
2069 | NbJSThemesRegistry,
|
2070 | NbThemeService,
|
2071 | NbMediaBreakpointsService,
|
2072 | NbSpinnerService,
|
2073 | { provide: NB_LAYOUT_DIRECTION, useValue: layoutDirection || exports.NbLayoutDirection.LTR },
|
2074 | NbLayoutDirectionService,
|
2075 | NbLayoutScrollService,
|
2076 | NbLayoutRulerService
|
2077 | ], NbOverlayModule.forRoot().providers), [
|
2078 | NbStatusService,
|
2079 | ]),
|
2080 | };
|
2081 | };
|
2082 | NbThemeModule.decorators = [
|
2083 | { type: i0.NgModule, args: [{
|
2084 | imports: [
|
2085 | _angular_common.CommonModule,
|
2086 | ],
|
2087 | exports: [],
|
2088 | },] }
|
2089 | ];
|
2090 | return NbThemeModule;
|
2091 | }());
|
2092 |
|
2093 | var NbColorHelper = (function () {
|
2094 | function NbColorHelper() {
|
2095 | }
|
2096 | NbColorHelper.shade = function (color, weight) {
|
2097 | return NbColorHelper.mix('#000000', color, weight);
|
2098 | };
|
2099 | NbColorHelper.tint = function (color, weight) {
|
2100 | return NbColorHelper.mix('#ffffff', color, weight);
|
2101 | };
|
2102 | NbColorHelper.mix = function (color1, color2, weight) {
|
2103 | var d2h = function (d) { return d.toString(16); };
|
2104 | var h2d = function (h) { return parseInt(h, 16); };
|
2105 | var result = '#';
|
2106 | for (var i = 1; i < 7; i += 2) {
|
2107 | var firstPart = h2d(color1.substr(i, 2));
|
2108 | var secondPart = h2d(color2.substr(i, 2));
|
2109 | var resultPart = d2h(Math.floor(secondPart + (firstPart - secondPart) * (weight / 100.0)));
|
2110 | result += ('0' + resultPart).slice(-2);
|
2111 | }
|
2112 | return result;
|
2113 | };
|
2114 | NbColorHelper.hexToRgbA = function (hex, alpha) {
|
2115 | var c;
|
2116 | if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {
|
2117 | c = hex.substring(1).split('');
|
2118 | if (c.length === 3) {
|
2119 | c = [c[0], c[0], c[1], c[1], c[2], c[2]];
|
2120 | }
|
2121 | c = '0x' + c.join('');
|
2122 | return 'rgba(' + [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') + ',' + alpha + ')';
|
2123 | }
|
2124 | throw new Error('Bad Hex');
|
2125 | };
|
2126 | return NbColorHelper;
|
2127 | }());
|
2128 |
|
2129 | (function (NbIconPackType) {
|
2130 | NbIconPackType["SVG"] = "svg";
|
2131 | NbIconPackType["FONT"] = "font";
|
2132 | })(exports.NbIconPackType || (exports.NbIconPackType = {}));
|
2133 |
|
2134 | var NbFontIcon = (function () {
|
2135 | function NbFontIcon(name, content, params) {
|
2136 | if (params === void 0) { params = {}; }
|
2137 | this.name = name;
|
2138 | this.content = content;
|
2139 | this.params = params;
|
2140 | }
|
2141 | NbFontIcon.prototype.getClasses = function (options) {
|
2142 | var classes = [];
|
2143 | if (this.params.packClass) {
|
2144 | classes.push(this.params.packClass);
|
2145 | }
|
2146 | var name = this.params.iconClassPrefix ? this.params.iconClassPrefix + "-" + this.name : this.name;
|
2147 | classes.push(name);
|
2148 | return classes;
|
2149 | };
|
2150 | NbFontIcon.prototype.getContent = function (options) {
|
2151 | return this.content;
|
2152 | };
|
2153 | return NbFontIcon;
|
2154 | }());
|
2155 | var NbSvgIcon = (function () {
|
2156 | function NbSvgIcon(name, content, params) {
|
2157 | if (params === void 0) { params = {}; }
|
2158 | this.name = name;
|
2159 | this.content = content;
|
2160 | this.params = params;
|
2161 | }
|
2162 | NbSvgIcon.prototype.getClasses = function (options) {
|
2163 | var classes = [];
|
2164 | if (this.params.packClass) {
|
2165 | classes.push(this.params.packClass);
|
2166 | }
|
2167 | return classes;
|
2168 | };
|
2169 | NbSvgIcon.prototype.getContent = function (options) {
|
2170 | return this.content;
|
2171 | };
|
2172 | return NbSvgIcon;
|
2173 | }());
|
2174 |
|
2175 |
|
2176 |
|
2177 |
|
2178 |
|
2179 |
|
2180 | var NbIconDefinition = (function () {
|
2181 | function NbIconDefinition() {
|
2182 | }
|
2183 | return NbIconDefinition;
|
2184 | }());
|
2185 | function throwPackNotFoundError(name) {
|
2186 | throw Error("Icon Pack '" + name + "' is not registered");
|
2187 | }
|
2188 | function throwNoDefaultPackError() {
|
2189 | throw Error('Default pack is not registered.');
|
2190 | }
|
2191 | function throwWrongPackTypeError(name, type, desiredType) {
|
2192 | throw Error("Pack '" + name + "' is not an '" + desiredType + "' Pack and its type is '" + type + "'");
|
2193 | }
|
2194 |
|
2195 |
|
2196 |
|
2197 | var NbIconLibraries = (function () {
|
2198 | function NbIconLibraries() {
|
2199 | this.packs = new Map();
|
2200 | }
|
2201 | |
2202 |
|
2203 |
|
2204 |
|
2205 |
|
2206 |
|
2207 | NbIconLibraries.prototype.registerSvgPack = function (name, icons, params) {
|
2208 | if (params === void 0) { params = {}; }
|
2209 | this.packs.set(name, {
|
2210 | name: name,
|
2211 | icons: new Map(Object.entries(icons)),
|
2212 | params: params,
|
2213 | type: exports.NbIconPackType.SVG,
|
2214 | });
|
2215 | };
|
2216 | |
2217 |
|
2218 |
|
2219 |
|
2220 |
|
2221 | NbIconLibraries.prototype.registerFontPack = function (name, params) {
|
2222 | if (params === void 0) { params = {}; }
|
2223 | this.packs.set(name, {
|
2224 | name: name,
|
2225 | params: params,
|
2226 | icons: new Map(),
|
2227 | type: exports.NbIconPackType.FONT,
|
2228 | });
|
2229 | };
|
2230 | |
2231 |
|
2232 |
|
2233 |
|
2234 | NbIconLibraries.prototype.getPack = function (name) {
|
2235 | return this.packs.get(name);
|
2236 | };
|
2237 | |
2238 |
|
2239 |
|
2240 |
|
2241 | NbIconLibraries.prototype.setDefaultPack = function (name) {
|
2242 | if (!this.packs.has(name)) {
|
2243 | throwPackNotFoundError(name);
|
2244 | }
|
2245 | this.defaultPack = this.packs.get(name);
|
2246 | };
|
2247 | |
2248 |
|
2249 |
|
2250 |
|
2251 |
|
2252 |
|
2253 |
|
2254 | NbIconLibraries.prototype.getSvgIcon = function (name, pack) {
|
2255 | var iconsPack = pack ? this.getPackOrThrow(pack) : this.getDefaultPackOrThrow();
|
2256 | if (iconsPack.type !== exports.NbIconPackType.SVG) {
|
2257 | throwWrongPackTypeError(iconsPack.name, iconsPack.type, 'SVG');
|
2258 | }
|
2259 | var icon = this.getIconFromPack(name, iconsPack);
|
2260 | if (!icon) {
|
2261 | return null;
|
2262 | }
|
2263 | return {
|
2264 | name: name,
|
2265 | pack: iconsPack.name,
|
2266 | type: exports.NbIconPackType.SVG,
|
2267 | icon: this.createSvgIcon(name, icon, iconsPack.params),
|
2268 | };
|
2269 | };
|
2270 | |
2271 |
|
2272 |
|
2273 |
|
2274 |
|
2275 |
|
2276 |
|
2277 | NbIconLibraries.prototype.getFontIcon = function (name, pack) {
|
2278 | var iconsPack = pack ? this.getPackOrThrow(pack) : this.getDefaultPackOrThrow();
|
2279 | if (iconsPack.type !== exports.NbIconPackType.FONT) {
|
2280 | throwWrongPackTypeError(iconsPack.name, iconsPack.type, 'Font');
|
2281 | }
|
2282 | var icon = this.getIconFromPack(name, iconsPack);
|
2283 | return {
|
2284 | name: name,
|
2285 | pack: iconsPack.name,
|
2286 | type: exports.NbIconPackType.FONT,
|
2287 | icon: this.createFontIcon(name, icon ? icon : '', iconsPack.params),
|
2288 | };
|
2289 | };
|
2290 | |
2291 |
|
2292 |
|
2293 |
|
2294 |
|
2295 |
|
2296 |
|
2297 | NbIconLibraries.prototype.getIcon = function (name, pack) {
|
2298 | var iconsPack = pack ? this.getPackOrThrow(pack) : this.getDefaultPackOrThrow();
|
2299 | if (iconsPack.type === exports.NbIconPackType.SVG) {
|
2300 | return this.getSvgIcon(name, pack);
|
2301 | }
|
2302 | return this.getFontIcon(name, pack);
|
2303 | };
|
2304 | NbIconLibraries.prototype.createSvgIcon = function (name, content, params) {
|
2305 | return content instanceof NbSvgIcon ? content : new NbSvgIcon(name, content, params);
|
2306 | };
|
2307 | NbIconLibraries.prototype.createFontIcon = function (name, content, params) {
|
2308 | return content instanceof NbFontIcon ? content : new NbFontIcon(name, content, params);
|
2309 | };
|
2310 | NbIconLibraries.prototype.getPackOrThrow = function (name) {
|
2311 | var pack = this.packs.get(name);
|
2312 | if (!pack) {
|
2313 | throwPackNotFoundError(name);
|
2314 | }
|
2315 | return pack;
|
2316 | };
|
2317 | NbIconLibraries.prototype.getDefaultPackOrThrow = function () {
|
2318 | if (!this.defaultPack) {
|
2319 | throwNoDefaultPackError();
|
2320 | }
|
2321 | return this.defaultPack;
|
2322 | };
|
2323 | NbIconLibraries.prototype.getIconFromPack = function (name, pack) {
|
2324 | if (pack.icons.has(name)) {
|
2325 | return pack.icons.get(name);
|
2326 | }
|
2327 | return null;
|
2328 | };
|
2329 | NbIconLibraries.ɵprov = i0.ɵɵdefineInjectable({ factory: function NbIconLibraries_Factory() { return new NbIconLibraries(); }, token: NbIconLibraries, providedIn: "root" });
|
2330 | NbIconLibraries.decorators = [
|
2331 | { type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
2332 | ];
|
2333 | return NbIconLibraries;
|
2334 | }());
|
2335 |
|
2336 |
|
2337 |
|
2338 |
|
2339 |
|
2340 |
|
2341 |
|
2342 |
|
2343 |
|
2344 |
|
2345 |
|
2346 |
|
2347 |
|
2348 |
|
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 |
|
2354 |
|
2355 |
|
2356 |
|
2357 |
|
2358 |
|
2359 |
|
2360 |
|
2361 |
|
2362 |
|
2363 |
|
2364 |
|
2365 |
|
2366 |
|
2367 |
|
2368 |
|
2369 |
|
2370 |
|
2371 |
|
2372 |
|
2373 |
|
2374 |
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 |
|
2382 |
|
2383 |
|
2384 |
|
2385 |
|
2386 |
|
2387 |
|
2388 |
|
2389 |
|
2390 |
|
2391 |
|
2392 |
|
2393 |
|
2394 |
|
2395 |
|
2396 |
|
2397 |
|
2398 |
|
2399 |
|
2400 |
|
2401 |
|
2402 |
|
2403 |
|
2404 |
|
2405 |
|
2406 |
|
2407 |
|
2408 |
|
2409 |
|
2410 |
|
2411 |
|
2412 |
|
2413 |
|
2414 |
|
2415 |
|
2416 |
|
2417 |
|
2418 |
|
2419 |
|
2420 |
|
2421 | var NbIconComponent = (function () {
|
2422 | function NbIconComponent(sanitizer, iconLibrary, el, renderer, statusService) {
|
2423 | this.sanitizer = sanitizer;
|
2424 | this.iconLibrary = iconLibrary;
|
2425 | this.el = el;
|
2426 | this.renderer = renderer;
|
2427 | this.statusService = statusService;
|
2428 | this.prevClasses = [];
|
2429 | this.html = '';
|
2430 | }
|
2431 | Object.defineProperty(NbIconComponent.prototype, "primary", {
|
2432 | get: function () {
|
2433 | return this.status === 'primary';
|
2434 | },
|
2435 | enumerable: false,
|
2436 | configurable: true
|
2437 | });
|
2438 | Object.defineProperty(NbIconComponent.prototype, "info", {
|
2439 | get: function () {
|
2440 | return this.status === 'info';
|
2441 | },
|
2442 | enumerable: false,
|
2443 | configurable: true
|
2444 | });
|
2445 | Object.defineProperty(NbIconComponent.prototype, "success", {
|
2446 | get: function () {
|
2447 | return this.status === 'success';
|
2448 | },
|
2449 | enumerable: false,
|
2450 | configurable: true
|
2451 | });
|
2452 | Object.defineProperty(NbIconComponent.prototype, "warning", {
|
2453 | get: function () {
|
2454 | return this.status === 'warning';
|
2455 | },
|
2456 | enumerable: false,
|
2457 | configurable: true
|
2458 | });
|
2459 | Object.defineProperty(NbIconComponent.prototype, "danger", {
|
2460 | get: function () {
|
2461 | return this.status === 'danger';
|
2462 | },
|
2463 | enumerable: false,
|
2464 | configurable: true
|
2465 | });
|
2466 | Object.defineProperty(NbIconComponent.prototype, "basic", {
|
2467 | get: function () {
|
2468 | return this.status === 'basic';
|
2469 | },
|
2470 | enumerable: false,
|
2471 | configurable: true
|
2472 | });
|
2473 | Object.defineProperty(NbIconComponent.prototype, "control", {
|
2474 | get: function () {
|
2475 | return this.status === 'control';
|
2476 | },
|
2477 | enumerable: false,
|
2478 | configurable: true
|
2479 | });
|
2480 | Object.defineProperty(NbIconComponent.prototype, "additionalClasses", {
|
2481 | get: function () {
|
2482 | if (this.statusService.isCustomStatus(this.status)) {
|
2483 | return [this.statusService.getStatusClass(this.status)];
|
2484 | }
|
2485 | return [];
|
2486 | },
|
2487 | enumerable: false,
|
2488 | configurable: true
|
2489 | });
|
2490 | Object.defineProperty(NbIconComponent.prototype, "config", {
|
2491 | |
2492 |
|
2493 |
|
2494 |
|
2495 |
|
2496 | get: function () {
|
2497 | return this._config;
|
2498 | },
|
2499 | set: function (value) {
|
2500 | if (!value) {
|
2501 | return;
|
2502 | }
|
2503 | this._config = value;
|
2504 | if (typeof value === 'string') {
|
2505 | this.icon = value;
|
2506 | }
|
2507 | else {
|
2508 | this.icon = value.icon;
|
2509 | this.pack = value.pack;
|
2510 | this.status = value.status;
|
2511 | this.options = value.options;
|
2512 | }
|
2513 | },
|
2514 | enumerable: false,
|
2515 | configurable: true
|
2516 | });
|
2517 | NbIconComponent.prototype.ngOnInit = function () {
|
2518 | this.iconDef = this.renderIcon(this.icon, this.pack, this.options);
|
2519 | };
|
2520 | NbIconComponent.prototype.ngOnChanges = function () {
|
2521 | var iconDef = this.iconLibrary.getIcon(this.icon, this.pack);
|
2522 | if (iconDef) {
|
2523 | this.renderIcon(this.icon, this.pack, this.options);
|
2524 | }
|
2525 | else {
|
2526 | this.clearIcon();
|
2527 | }
|
2528 | };
|
2529 | NbIconComponent.prototype.renderIcon = function (name, pack, options) {
|
2530 | var iconDefinition = this.iconLibrary.getIcon(name, pack);
|
2531 | if (!iconDefinition) {
|
2532 | return;
|
2533 | }
|
2534 | var content = iconDefinition.icon.getContent(options);
|
2535 | if (content) {
|
2536 | this.html = this.sanitizer.bypassSecurityTrustHtml(content);
|
2537 | }
|
2538 | this.assignClasses(iconDefinition.icon.getClasses(options));
|
2539 | return iconDefinition;
|
2540 | };
|
2541 | NbIconComponent.prototype.clearIcon = function () {
|
2542 | this.html = '';
|
2543 | this.assignClasses([]);
|
2544 | };
|
2545 | NbIconComponent.prototype.assignClasses = function (classes) {
|
2546 | var _this = this;
|
2547 | this.prevClasses.forEach(function (className) {
|
2548 | _this.renderer.removeClass(_this.el.nativeElement, className);
|
2549 | });
|
2550 | classes.forEach(function (className) {
|
2551 | _this.renderer.addClass(_this.el.nativeElement, className);
|
2552 | });
|
2553 | this.prevClasses = classes;
|
2554 | };
|
2555 | NbIconComponent.decorators = [
|
2556 | { type: i0.Component, args: [{
|
2557 | selector: 'nb-icon',
|
2558 | template: '',
|
2559 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
2560 | styles: [":host{display:inline-block}\n"]
|
2561 | },] }
|
2562 | ];
|
2563 | NbIconComponent.ctorParameters = function () { return [
|
2564 | { type: _angular_platformBrowser.DomSanitizer },
|
2565 | { type: NbIconLibraries },
|
2566 | { type: i0.ElementRef },
|
2567 | { type: i0.Renderer2 },
|
2568 | { type: NbStatusService }
|
2569 | ]; };
|
2570 | NbIconComponent.propDecorators = {
|
2571 | html: [{ type: i0.HostBinding, args: ['innerHtml',] }],
|
2572 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
2573 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
2574 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
2575 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
2576 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
2577 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
2578 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
2579 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }],
|
2580 | icon: [{ type: i0.Input }],
|
2581 | pack: [{ type: i0.Input }],
|
2582 | options: [{ type: i0.Input }],
|
2583 | status: [{ type: i0.Input }],
|
2584 | config: [{ type: i0.Input }]
|
2585 | };
|
2586 | return NbIconComponent;
|
2587 | }());
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 |
|
2593 |
|
2594 | var NbIconModule = (function () {
|
2595 | function NbIconModule(iconsLibrary) {
|
2596 | this.iconsLibrary = iconsLibrary;
|
2597 | this.essentialsPackName = 'nebular-essentials';
|
2598 |
|
2599 | if (this.iconsLibrary.getPack(this.essentialsPackName)) {
|
2600 | return;
|
2601 | }
|
2602 |
|
2603 | this.iconsLibrary.registerSvgPack(this.essentialsPackName, {
|
2604 | 'chevron-down-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="chevron-down"><rect width="24" height="24" opacity="0"/><path d="M12 15.5a1 1 0 0 1-.71-.29l-4-4a1 1 0 1 1 1.42-1.42L12 13.1l3.3-3.18a1 1 0 1 1 1.38 1.44l-4 3.86a1 1 0 0 1-.68.28z"/></g></g></svg>',
|
2605 | 'chevron-up-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="chevron-up"><rect width="24" height="24" transform="rotate(180 12 12)" opacity="0"/><path d="M16 14.5a1 1 0 0 1-.71-.29L12 10.9l-3.3 3.18a1 1 0 0 1-1.41 0 1 1 0 0 1 0-1.42l4-3.86a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1 0 1.42 1 1 0 0 1-.69.28z"/></g></g></svg>',
|
2606 | 'chevron-left-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="chevron-left"><rect width="24" height="24" transform="rotate(90 12 12)" opacity="0"/><path d="M13.36 17a1 1 0 0 1-.72-.31l-3.86-4a1 1 0 0 1 0-1.4l4-4a1 1 0 1 1 1.42 1.42L10.9 12l3.18 3.3a1 1 0 0 1 0 1.41 1 1 0 0 1-.72.29z"/></g></g></svg>',
|
2607 | 'chevron-right-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="chevron-right"><rect width="24" height="24" transform="rotate(-90 12 12)" opacity="0"/><path d="M10.5 17a1 1 0 0 1-.71-.29 1 1 0 0 1 0-1.42L13.1 12 9.92 8.69a1 1 0 0 1 0-1.41 1 1 0 0 1 1.42 0l3.86 4a1 1 0 0 1 0 1.4l-4 4a1 1 0 0 1-.7.32z"/></g></g></svg>',
|
2608 | 'checkmark-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="checkmark"><rect width="24" height="24" opacity="0"/><path d="M9.86 18a1 1 0 0 1-.73-.32l-4.86-5.17a1 1 0 1 1 1.46-1.37l4.12 4.39 8.41-9.2a1 1 0 1 1 1.48 1.34l-9.14 10a1 1 0 0 1-.73.33z"/></g></g></svg>',
|
2609 | 'paper-plane-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="paper-plane"><rect width="24" height="24" opacity="0"/><path d="M21 4a1.31 1.31 0 0 0-.06-.27v-.09a1 1 0 0 0-.2-.3 1 1 0 0 0-.29-.19h-.09a.86.86 0 0 0-.31-.15H20a1 1 0 0 0-.3 0l-18 6a1 1 0 0 0 0 1.9l8.53 2.84 2.84 8.53a1 1 0 0 0 1.9 0l6-18A1 1 0 0 0 21 4zm-4.7 2.29l-5.57 5.57L5.16 10zM14 18.84l-1.86-5.57 5.57-5.57z"/></g></g></svg>',
|
2610 | 'file-text-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="file-text"><rect width="24" height="24" opacity="0"/><path d="M15 16H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2z"/><path d="M9 14h3a1 1 0 0 0 0-2H9a1 1 0 0 0 0 2z"/><path d="M19.74 8.33l-5.44-6a1 1 0 0 0-.74-.33h-7A2.53 2.53 0 0 0 4 4.5v15A2.53 2.53 0 0 0 6.56 22h10.88A2.53 2.53 0 0 0 20 19.5V9a1 1 0 0 0-.26-.67zM14 5l2.74 3h-2a.79.79 0 0 1-.74-.85zm3.44 15H6.56a.53.53 0 0 1-.56-.5v-15a.53.53 0 0 1 .56-.5H12v3.15A2.79 2.79 0 0 0 14.71 10H18v9.5a.53.53 0 0 1-.56.5z"/></g></g></svg>',
|
2611 | 'alert-triangle-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="alert-triangle"><rect width="24" height="24" transform="rotate(90 12 12)" opacity="0"/><path d="M22.56 16.3L14.89 3.58a3.43 3.43 0 0 0-5.78 0L1.44 16.3a3 3 0 0 0-.05 3A3.37 3.37 0 0 0 4.33 21h15.34a3.37 3.37 0 0 0 2.94-1.66 3 3 0 0 0-.05-3.04zm-1.7 2.05a1.31 1.31 0 0 1-1.19.65H4.33a1.31 1.31 0 0 1-1.19-.65 1 1 0 0 1 0-1l7.68-12.73a1.48 1.48 0 0 1 2.36 0l7.67 12.72a1 1 0 0 1 .01 1.01z"/><circle cx="12" cy="16" r="1"/><path d="M12 8a1 1 0 0 0-1 1v4a1 1 0 0 0 2 0V9a1 1 0 0 0-1-1z"/></g></g></svg>',
|
2612 | 'question-mark-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="question-mark"><rect width="24" height="24" transform="rotate(180 12 12)" opacity="0"/><path d="M17 9A5 5 0 0 0 7 9a1 1 0 0 0 2 0 3 3 0 1 1 3 3 1 1 0 0 0-1 1v2a1 1 0 0 0 2 0v-1.1A5 5 0 0 0 17 9z"/><circle cx="12" cy="19" r="1"/></g></g></svg>',
|
2613 | 'email-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="email"><rect width="24" height="24" opacity="0"/><path d="M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3zm-.67 2L12 10.75 5.67 6zM19 18H5a1 1 0 0 1-1-1V7.25l7.4 5.55a1 1 0 0 0 .6.2 1 1 0 0 0 .6-.2L20 7.25V17a1 1 0 0 1-1 1z"/></g></g></svg>',
|
2614 | 'flash-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="flash"><rect width="24" height="24" opacity="0"/><path d="M11.11 23a1 1 0 0 1-.34-.06 1 1 0 0 1-.65-1.05l.77-7.09H5a1 1 0 0 1-.83-1.56l7.89-11.8a1 1 0 0 1 1.17-.38 1 1 0 0 1 .65 1l-.77 7.14H19a1 1 0 0 1 .83 1.56l-7.89 11.8a1 1 0 0 1-.83.44zM6.87 12.8H12a1 1 0 0 1 .74.33 1 1 0 0 1 .25.78l-.45 4.15 4.59-6.86H12a1 1 0 0 1-1-1.11l.45-4.15z"/></g></g></svg>',
|
2615 | 'search-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="search"><rect width="24" height="24" opacity="0"/><path d="M20.71 19.29l-3.4-3.39A7.92 7.92 0 0 0 19 11a8 8 0 1 0-8 8 7.92 7.92 0 0 0 4.9-1.69l3.39 3.4a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zM5 11a6 6 0 1 1 6 6 6 6 0 0 1-6-6z"/></g></g></svg>',
|
2616 | 'close-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="close"><rect width="24" height="24" transform="rotate(180 12 12)" opacity="0"/><path d="M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29-4.3 4.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.29-4.3 4.29 4.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"/></g></g></svg>',
|
2617 | 'collapse-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="collapse"><rect width="24" height="24" transform="rotate(180 12 12)" opacity="0"/><path d="M19 9h-2.58l3.29-3.29a1 1 0 1 0-1.42-1.42L15 7.57V5a1 1 0 0 0-1-1 1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 0-2z"/><path d="M10 13H5a1 1 0 0 0 0 2h2.57l-3.28 3.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L9 16.42V19a1 1 0 0 0 1 1 1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1z"/></g></g></svg>',
|
2618 | 'expand-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="expand"><rect width="24" height="24" transform="rotate(180 12 12)" opacity="0"/><path d="M20 5a1 1 0 0 0-1-1h-5a1 1 0 0 0 0 2h2.57l-3.28 3.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L18 7.42V10a1 1 0 0 0 1 1 1 1 0 0 0 1-1z"/><path d="M10.71 13.29a1 1 0 0 0-1.42 0L6 16.57V14a1 1 0 0 0-1-1 1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 0-2H7.42l3.29-3.29a1 1 0 0 0 0-1.42z"/></g></g></svg>',
|
2619 | 'minus-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="100%" height="100%" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="minus"><rect width="24" height="24" transform="rotate(180 12 12)" opacity="0"/><path d="M19 13H5a1 1 0 0 1 0-2h14a1 1 0 0 1 0 2z"/></g></g></svg>',
|
2620 | 'minus-bold-outline': '<svg xmlns:xlink="http://www.w3.org/1999/xlink" fill="currentColor" viewBox="0 0 8 2" width="100%" height="100%"><defs><rect id="nb-mbo" y="3" width="8" height="2" rx="1"/></defs><use xlink:href="#nb-mbo" transform="translate(0 -3)" fill-rule="evenodd"/></svg>',
|
2621 | 'checkmark-bold-outline': '<svg xmlns:xlink="http://www.w3.org/1999/xlink" fill="currentColor" viewBox="0 0 8 7" width="100%" height="100%"><defs><path id="nb-cbo" d="M6.039 1.43a1.11 1.11 0 0 1 1.517-.228c.483.342.588.998.234 1.466L4.431 7.1a1 1 0 0 1-1.492.115L.317 4.677a1.023 1.023 0 0 1 .002-1.483 1.113 1.113 0 0 1 1.535.002l1.641 1.59L6.04 1.428z"/></defs><use xlink:href="#nb-cbo" transform="translate(0 -1)" fill-rule="evenodd"/></svg>',
|
2622 | 'arrow-back': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g data-name="Layer 2"><g data-name="arrow-back"><rect width="24" height="24" transform="rotate(90 12 12)" opacity="0"/><path d="M19 11H7.14l3.63-4.36a1 1 0 1 0-1.54-1.28l-5 6a1.19 1.19 0 0 0-.09.15c0 .05 0 .08-.07.13A1 1 0 0 0 4 12a1 1 0 0 0 .07.36c0 .05 0 .08.07.13a1.19 1.19 0 0 0 .09.15l5 6A1 1 0 0 0 10 19a1 1 0 0 0 .64-.23 1 1 0 0 0 .13-1.41L7.14 13H19a1 1 0 0 0 0-2z"/></g></g></svg>',
|
2623 | });
|
2624 |
|
2625 | }
|
2626 | NbIconModule.decorators = [
|
2627 | { type: i0.NgModule, args: [{
|
2628 | imports: [
|
2629 | _angular_common.CommonModule,
|
2630 | ],
|
2631 | declarations: [
|
2632 | NbIconComponent,
|
2633 | ],
|
2634 | exports: [
|
2635 | NbIconComponent,
|
2636 | ],
|
2637 | },] }
|
2638 | ];
|
2639 | NbIconModule.ctorParameters = function () { return [
|
2640 | { type: NbIconLibraries }
|
2641 | ]; };
|
2642 | return NbIconModule;
|
2643 | }());
|
2644 |
|
2645 |
|
2646 |
|
2647 |
|
2648 |
|
2649 |
|
2650 |
|
2651 |
|
2652 |
|
2653 |
|
2654 |
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 |
|
2661 |
|
2662 |
|
2663 |
|
2664 |
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 |
|
2672 |
|
2673 |
|
2674 |
|
2675 |
|
2676 | var NbCardHeaderComponent = (function () {
|
2677 | function NbCardHeaderComponent() {
|
2678 | }
|
2679 | NbCardHeaderComponent.decorators = [
|
2680 | { type: i0.Component, args: [{
|
2681 | selector: 'nb-card-header',
|
2682 | template: "<ng-content></ng-content>"
|
2683 | },] }
|
2684 | ];
|
2685 | return NbCardHeaderComponent;
|
2686 | }());
|
2687 |
|
2688 |
|
2689 |
|
2690 |
|
2691 | var NbCardBodyComponent = (function () {
|
2692 | function NbCardBodyComponent() {
|
2693 | }
|
2694 | NbCardBodyComponent.decorators = [
|
2695 | { type: i0.Component, args: [{
|
2696 | selector: 'nb-card-body',
|
2697 | template: "<ng-content></ng-content>"
|
2698 | },] }
|
2699 | ];
|
2700 | return NbCardBodyComponent;
|
2701 | }());
|
2702 |
|
2703 |
|
2704 |
|
2705 |
|
2706 | var NbCardFooterComponent = (function () {
|
2707 | function NbCardFooterComponent() {
|
2708 | }
|
2709 | NbCardFooterComponent.decorators = [
|
2710 | { type: i0.Component, args: [{
|
2711 | selector: 'nb-card-footer',
|
2712 | template: "<ng-content></ng-content>"
|
2713 | },] }
|
2714 | ];
|
2715 | return NbCardFooterComponent;
|
2716 | }());
|
2717 |
|
2718 |
|
2719 |
|
2720 |
|
2721 |
|
2722 |
|
2723 |
|
2724 |
|
2725 |
|
2726 |
|
2727 |
|
2728 |
|
2729 |
|
2730 |
|
2731 |
|
2732 |
|
2733 |
|
2734 |
|
2735 |
|
2736 |
|
2737 |
|
2738 |
|
2739 |
|
2740 |
|
2741 |
|
2742 |
|
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 |
|
2750 |
|
2751 |
|
2752 |
|
2753 |
|
2754 |
|
2755 |
|
2756 |
|
2757 |
|
2758 |
|
2759 |
|
2760 |
|
2761 |
|
2762 |
|
2763 |
|
2764 |
|
2765 |
|
2766 |
|
2767 |
|
2768 |
|
2769 |
|
2770 |
|
2771 |
|
2772 |
|
2773 |
|
2774 |
|
2775 |
|
2776 |
|
2777 |
|
2778 |
|
2779 |
|
2780 |
|
2781 |
|
2782 |
|
2783 |
|
2784 |
|
2785 |
|
2786 |
|
2787 |
|
2788 |
|
2789 |
|
2790 |
|
2791 |
|
2792 |
|
2793 |
|
2794 |
|
2795 |
|
2796 |
|
2797 | var NbCardComponent = (function () {
|
2798 | function NbCardComponent(statusService) {
|
2799 | this.statusService = statusService;
|
2800 | this._size = '';
|
2801 | |
2802 |
|
2803 |
|
2804 |
|
2805 | this.status = '';
|
2806 | |
2807 |
|
2808 |
|
2809 |
|
2810 | this.accent = '';
|
2811 | }
|
2812 | Object.defineProperty(NbCardComponent.prototype, "size", {
|
2813 | |
2814 |
|
2815 |
|
2816 |
|
2817 | get: function () {
|
2818 | return this._size;
|
2819 | },
|
2820 | set: function (value) {
|
2821 | this._size = value;
|
2822 | },
|
2823 | enumerable: false,
|
2824 | configurable: true
|
2825 | });
|
2826 | Object.defineProperty(NbCardComponent.prototype, "tiny", {
|
2827 | get: function () {
|
2828 | return this.size === 'tiny';
|
2829 | },
|
2830 | enumerable: false,
|
2831 | configurable: true
|
2832 | });
|
2833 | Object.defineProperty(NbCardComponent.prototype, "small", {
|
2834 | get: function () {
|
2835 | return this.size === 'small';
|
2836 | },
|
2837 | enumerable: false,
|
2838 | configurable: true
|
2839 | });
|
2840 | Object.defineProperty(NbCardComponent.prototype, "medium", {
|
2841 | get: function () {
|
2842 | return this.size === 'medium';
|
2843 | },
|
2844 | enumerable: false,
|
2845 | configurable: true
|
2846 | });
|
2847 | Object.defineProperty(NbCardComponent.prototype, "large", {
|
2848 | get: function () {
|
2849 | return this.size === 'large';
|
2850 | },
|
2851 | enumerable: false,
|
2852 | configurable: true
|
2853 | });
|
2854 | Object.defineProperty(NbCardComponent.prototype, "giant", {
|
2855 | get: function () {
|
2856 | return this.size === 'giant';
|
2857 | },
|
2858 | enumerable: false,
|
2859 | configurable: true
|
2860 | });
|
2861 | Object.defineProperty(NbCardComponent.prototype, "primary", {
|
2862 | get: function () {
|
2863 | return this.status === 'primary';
|
2864 | },
|
2865 | enumerable: false,
|
2866 | configurable: true
|
2867 | });
|
2868 | Object.defineProperty(NbCardComponent.prototype, "info", {
|
2869 | get: function () {
|
2870 | return this.status === 'info';
|
2871 | },
|
2872 | enumerable: false,
|
2873 | configurable: true
|
2874 | });
|
2875 | Object.defineProperty(NbCardComponent.prototype, "success", {
|
2876 | get: function () {
|
2877 | return this.status === 'success';
|
2878 | },
|
2879 | enumerable: false,
|
2880 | configurable: true
|
2881 | });
|
2882 | Object.defineProperty(NbCardComponent.prototype, "warning", {
|
2883 | get: function () {
|
2884 | return this.status === 'warning';
|
2885 | },
|
2886 | enumerable: false,
|
2887 | configurable: true
|
2888 | });
|
2889 | Object.defineProperty(NbCardComponent.prototype, "danger", {
|
2890 | get: function () {
|
2891 | return this.status === 'danger';
|
2892 | },
|
2893 | enumerable: false,
|
2894 | configurable: true
|
2895 | });
|
2896 | Object.defineProperty(NbCardComponent.prototype, "basic", {
|
2897 | get: function () {
|
2898 | return this.status === 'basic';
|
2899 | },
|
2900 | enumerable: false,
|
2901 | configurable: true
|
2902 | });
|
2903 | Object.defineProperty(NbCardComponent.prototype, "control", {
|
2904 | get: function () {
|
2905 | return this.status === 'control';
|
2906 | },
|
2907 | enumerable: false,
|
2908 | configurable: true
|
2909 | });
|
2910 | Object.defineProperty(NbCardComponent.prototype, "hasAccent", {
|
2911 | get: function () {
|
2912 | return this.accent;
|
2913 | },
|
2914 | enumerable: false,
|
2915 | configurable: true
|
2916 | });
|
2917 | Object.defineProperty(NbCardComponent.prototype, "primaryAccent", {
|
2918 | get: function () {
|
2919 | return this.accent === 'primary';
|
2920 | },
|
2921 | enumerable: false,
|
2922 | configurable: true
|
2923 | });
|
2924 | Object.defineProperty(NbCardComponent.prototype, "infoAccent", {
|
2925 | get: function () {
|
2926 | return this.accent === 'info';
|
2927 | },
|
2928 | enumerable: false,
|
2929 | configurable: true
|
2930 | });
|
2931 | Object.defineProperty(NbCardComponent.prototype, "successAccent", {
|
2932 | get: function () {
|
2933 | return this.accent === 'success';
|
2934 | },
|
2935 | enumerable: false,
|
2936 | configurable: true
|
2937 | });
|
2938 | Object.defineProperty(NbCardComponent.prototype, "warningAccent", {
|
2939 | get: function () {
|
2940 | return this.accent === 'warning';
|
2941 | },
|
2942 | enumerable: false,
|
2943 | configurable: true
|
2944 | });
|
2945 | Object.defineProperty(NbCardComponent.prototype, "dangerAccent", {
|
2946 | get: function () {
|
2947 | return this.accent === 'danger';
|
2948 | },
|
2949 | enumerable: false,
|
2950 | configurable: true
|
2951 | });
|
2952 | Object.defineProperty(NbCardComponent.prototype, "basicAccent", {
|
2953 | get: function () {
|
2954 | return this.accent === 'basic';
|
2955 | },
|
2956 | enumerable: false,
|
2957 | configurable: true
|
2958 | });
|
2959 | Object.defineProperty(NbCardComponent.prototype, "controlAccent", {
|
2960 | get: function () {
|
2961 | return this.accent === 'control';
|
2962 | },
|
2963 | enumerable: false,
|
2964 | configurable: true
|
2965 | });
|
2966 | Object.defineProperty(NbCardComponent.prototype, "additionalClasses", {
|
2967 | get: function () {
|
2968 | if (this.statusService.isCustomStatus(this.status)) {
|
2969 | return [this.statusService.getStatusClass(this.status)];
|
2970 | }
|
2971 | return [];
|
2972 | },
|
2973 | enumerable: false,
|
2974 | configurable: true
|
2975 | });
|
2976 | NbCardComponent.decorators = [
|
2977 | { type: i0.Component, args: [{
|
2978 | selector: 'nb-card',
|
2979 | template: "\n <ng-content select=\"nb-card-header\"></ng-content>\n <ng-content select=\"nb-card-body\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"nb-card-footer\"></ng-content>\n ",
|
2980 | styles: [":host{display:flex;flex-direction:column}\n"]
|
2981 | },] }
|
2982 | ];
|
2983 | NbCardComponent.ctorParameters = function () { return [
|
2984 | { type: NbStatusService }
|
2985 | ]; };
|
2986 | NbCardComponent.propDecorators = {
|
2987 | size: [{ type: i0.Input }],
|
2988 | status: [{ type: i0.Input }],
|
2989 | accent: [{ type: i0.Input }],
|
2990 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
2991 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
2992 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
2993 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
2994 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }],
|
2995 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
2996 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
2997 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
2998 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
2999 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
3000 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
3001 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
3002 | hasAccent: [{ type: i0.HostBinding, args: ['class.accent',] }],
|
3003 | primaryAccent: [{ type: i0.HostBinding, args: ['class.accent-primary',] }],
|
3004 | infoAccent: [{ type: i0.HostBinding, args: ['class.accent-info',] }],
|
3005 | successAccent: [{ type: i0.HostBinding, args: ['class.accent-success',] }],
|
3006 | warningAccent: [{ type: i0.HostBinding, args: ['class.accent-warning',] }],
|
3007 | dangerAccent: [{ type: i0.HostBinding, args: ['class.accent-danger',] }],
|
3008 | basicAccent: [{ type: i0.HostBinding, args: ['class.accent-basic',] }],
|
3009 | controlAccent: [{ type: i0.HostBinding, args: ['class.accent-control',] }],
|
3010 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }]
|
3011 | };
|
3012 | return NbCardComponent;
|
3013 | }());
|
3014 |
|
3015 |
|
3016 |
|
3017 |
|
3018 |
|
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 |
|
3026 |
|
3027 |
|
3028 |
|
3029 |
|
3030 |
|
3031 |
|
3032 |
|
3033 |
|
3034 |
|
3035 |
|
3036 |
|
3037 |
|
3038 |
|
3039 |
|
3040 |
|
3041 |
|
3042 |
|
3043 |
|
3044 |
|
3045 |
|
3046 |
|
3047 |
|
3048 |
|
3049 |
|
3050 |
|
3051 |
|
3052 |
|
3053 |
|
3054 |
|
3055 |
|
3056 |
|
3057 |
|
3058 |
|
3059 |
|
3060 |
|
3061 |
|
3062 |
|
3063 |
|
3064 |
|
3065 |
|
3066 |
|
3067 |
|
3068 |
|
3069 | var NbRevealCardComponent = (function () {
|
3070 | function NbRevealCardComponent() {
|
3071 | |
3072 |
|
3073 |
|
3074 |
|
3075 | this.revealed = false;
|
3076 | |
3077 |
|
3078 |
|
3079 |
|
3080 | this.showToggleButton = true;
|
3081 | }
|
3082 | NbRevealCardComponent.prototype.toggle = function () {
|
3083 | this.revealed = !this.revealed;
|
3084 | };
|
3085 | NbRevealCardComponent.decorators = [
|
3086 | { type: i0.Component, args: [{
|
3087 | selector: 'nb-reveal-card',
|
3088 | template: "\n <ng-content select=\"nb-card-front\"></ng-content>\n <div class=\"second-card-container\">\n <ng-content select=\"nb-card-back\"></ng-content>\n </div>\n <a *ngIf=\"showToggleButton\" class=\"reveal-button\" (click)=\"toggle()\">\n <nb-icon icon=\"chevron-down-outline\" pack=\"nebular-essentials\" aria-hidden=\"true\"></nb-icon>\n </a>\n ",
|
3089 | styles: [":host{display:block;position:relative;overflow:hidden}:host .second-card-container{position:absolute;top:100%;right:0;left:0;overflow:hidden;transition:top 0s 0.5s}:host ::ng-deep nb-card-front nb-card,:host ::ng-deep nb-card-back nb-card{box-shadow:none;margin:0}:host ::ng-deep nb-card-front{display:block;height:100%}:host ::ng-deep nb-card-back{position:absolute;left:0;top:100%;width:100%;transition:top 0.5s}:host .reveal-button{cursor:pointer;position:absolute;right:0;bottom:0;transform:rotate(180deg);transition:transform 0.3s}:host(.revealed) .second-card-container{top:0;transition:none}:host(.revealed) .second-card-container ::ng-deep nb-card-back{top:0}:host(.revealed) .reveal-button{transform:none}\n"]
|
3090 | },] }
|
3091 | ];
|
3092 | NbRevealCardComponent.propDecorators = {
|
3093 | revealed: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.revealed',] }],
|
3094 | showToggleButton: [{ type: i0.Input }]
|
3095 | };
|
3096 | return NbRevealCardComponent;
|
3097 | }());
|
3098 |
|
3099 |
|
3100 |
|
3101 |
|
3102 |
|
3103 |
|
3104 |
|
3105 |
|
3106 |
|
3107 |
|
3108 |
|
3109 |
|
3110 |
|
3111 |
|
3112 |
|
3113 |
|
3114 |
|
3115 |
|
3116 |
|
3117 |
|
3118 |
|
3119 |
|
3120 |
|
3121 |
|
3122 |
|
3123 |
|
3124 |
|
3125 |
|
3126 |
|
3127 |
|
3128 |
|
3129 |
|
3130 |
|
3131 |
|
3132 |
|
3133 |
|
3134 |
|
3135 |
|
3136 |
|
3137 |
|
3138 |
|
3139 |
|
3140 |
|
3141 |
|
3142 |
|
3143 |
|
3144 |
|
3145 |
|
3146 |
|
3147 |
|
3148 |
|
3149 |
|
3150 |
|
3151 |
|
3152 |
|
3153 |
|
3154 | var NbFlipCardComponent = (function () {
|
3155 | function NbFlipCardComponent() {
|
3156 | |
3157 |
|
3158 |
|
3159 |
|
3160 | this.flipped = false;
|
3161 | |
3162 |
|
3163 |
|
3164 |
|
3165 | this.showToggleButton = true;
|
3166 | }
|
3167 | NbFlipCardComponent.prototype.toggle = function () {
|
3168 | this.flipped = !this.flipped;
|
3169 | };
|
3170 | NbFlipCardComponent.decorators = [
|
3171 | { type: i0.Component, args: [{
|
3172 | selector: 'nb-flip-card',
|
3173 | template: "\n <div class=\"flipcard-body\">\n <div class=\"front-container\">\n <ng-content select=\"nb-card-front\"></ng-content>\n <a *ngIf=\"showToggleButton\" class=\"flip-button\" (click)=\"toggle()\">\n <nb-icon icon=\"chevron-left-outline\" pack=\"nebular-essentials\" aria-hidden=\"true\"></nb-icon>\n </a>\n </div>\n <div class=\"back-container\">\n <ng-content select=\"nb-card-back\"></ng-content>\n <a *ngIf=\"showToggleButton\" class=\"flip-button\" (click)=\"toggle()\">\n <nb-icon icon=\"chevron-left-outline\" pack=\"nebular-essentials\" aria-hidden=\"true\"></nb-icon>\n </a>\n </div>\n </div>\n ",
|
3174 | styles: [":host{display:block;perspective:1200px;position:relative}:host-context(.flipped) .flipcard-body{transform:rotateY(-180deg)}:host-context(.flipped) .flipcard-body .front-container{opacity:0;transition:opacity 0s 0.25s;backface-visibility:hidden;-webkit-backface-visibility:hidden}:host-context(.flipped) .flipcard-body .front-container .flip-button{opacity:0;z-index:-1}:host-context(.flipped) .flipcard-body .back-container{backface-visibility:visible;-webkit-backface-visibility:visible}.flipcard-body{display:flex;transition:transform 0.5s;transform-style:preserve-3d}.flipcard-body .front-container,.flipcard-body .back-container{flex:1}.flipcard-body .front-container .flip-button,.flipcard-body .back-container .flip-button{cursor:pointer;position:absolute;right:0;bottom:0;opacity:1;transition:opacity 0s 0.15s}.flipcard-body .front-container{backface-visibility:visible;-webkit-backface-visibility:visible;transition:opacity 0s 0.2s}.flipcard-body .back-container{backface-visibility:hidden;-webkit-backface-visibility:hidden;transform:rotateY(180deg)}\n"]
|
3175 | },] }
|
3176 | ];
|
3177 | NbFlipCardComponent.propDecorators = {
|
3178 | flipped: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.flipped',] }],
|
3179 | showToggleButton: [{ type: i0.Input }]
|
3180 | };
|
3181 | return NbFlipCardComponent;
|
3182 | }());
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 |
|
3189 | var NbCardFrontComponent = (function () {
|
3190 | function NbCardFrontComponent() {
|
3191 | }
|
3192 | NbCardFrontComponent.decorators = [
|
3193 | { type: i0.Component, args: [{
|
3194 | selector: 'nb-card-front',
|
3195 | template: '<ng-content select="nb-card"></ng-content>'
|
3196 | },] }
|
3197 | ];
|
3198 | return NbCardFrontComponent;
|
3199 | }());
|
3200 |
|
3201 |
|
3202 |
|
3203 |
|
3204 |
|
3205 | var NbCardBackComponent = (function () {
|
3206 | function NbCardBackComponent() {
|
3207 | }
|
3208 | NbCardBackComponent.decorators = [
|
3209 | { type: i0.Component, args: [{
|
3210 | selector: 'nb-card-back',
|
3211 | template: '<ng-content select="nb-card"></ng-content>'
|
3212 | },] }
|
3213 | ];
|
3214 | return NbCardBackComponent;
|
3215 | }());
|
3216 |
|
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 |
|
3222 | var NB_CARD_COMPONENTS = [
|
3223 | NbCardComponent,
|
3224 | NbCardBodyComponent,
|
3225 | NbCardFooterComponent,
|
3226 | NbCardHeaderComponent,
|
3227 | NbRevealCardComponent,
|
3228 | NbFlipCardComponent,
|
3229 | NbCardFrontComponent,
|
3230 | NbCardBackComponent,
|
3231 | ];
|
3232 | var NbCardModule = (function () {
|
3233 | function NbCardModule() {
|
3234 | }
|
3235 | NbCardModule.decorators = [
|
3236 | { type: i0.NgModule, args: [{
|
3237 | imports: [
|
3238 | NbSharedModule,
|
3239 | NbIconModule,
|
3240 | ],
|
3241 | declarations: tslib.__spreadArray([], NB_CARD_COMPONENTS),
|
3242 | exports: tslib.__spreadArray([], NB_CARD_COMPONENTS),
|
3243 | },] }
|
3244 | ];
|
3245 | return NbCardModule;
|
3246 | }());
|
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 |
|
3252 |
|
3253 |
|
3254 | (function (NbCalendarViewMode) {
|
3255 | NbCalendarViewMode["YEAR"] = "year";
|
3256 | NbCalendarViewMode["MONTH"] = "month";
|
3257 | NbCalendarViewMode["DATE"] = "date";
|
3258 | })(exports.NbCalendarViewMode || (exports.NbCalendarViewMode = {}));
|
3259 |
|
3260 | (function (NbCalendarSize) {
|
3261 | NbCalendarSize["MEDIUM"] = "medium";
|
3262 | NbCalendarSize["LARGE"] = "large";
|
3263 | })(exports.NbCalendarSize || (exports.NbCalendarSize = {}));
|
3264 |
|
3265 |
|
3266 |
|
3267 |
|
3268 |
|
3269 |
|
3270 | function convertToBoolProperty(val) {
|
3271 | if (typeof val === 'string') {
|
3272 | val = val.toLowerCase().trim();
|
3273 | return (val === 'true' || val === '');
|
3274 | }
|
3275 | return !!val;
|
3276 | }
|
3277 |
|
3278 | function firstChildNotComment(node) {
|
3279 | var children = Array
|
3280 | .from(node.childNodes)
|
3281 | .filter(function (child) { return child.nodeType !== Node.COMMENT_NODE; });
|
3282 | return children[0];
|
3283 | }
|
3284 | function lastChildNotComment(node) {
|
3285 | var children = Array
|
3286 | .from(node.childNodes)
|
3287 | .filter(function (child) { return child.nodeType !== Node.COMMENT_NODE; });
|
3288 | return children[children.length - 1];
|
3289 | }
|
3290 |
|
3291 |
|
3292 |
|
3293 |
|
3294 |
|
3295 |
|
3296 |
|
3297 |
|
3298 |
|
3299 |
|
3300 |
|
3301 |
|
3302 |
|
3303 |
|
3304 |
|
3305 |
|
3306 |
|
3307 |
|
3308 |
|
3309 |
|
3310 |
|
3311 |
|
3312 |
|
3313 |
|
3314 |
|
3315 |
|
3316 |
|
3317 |
|
3318 |
|
3319 |
|
3320 |
|
3321 |
|
3322 |
|
3323 |
|
3324 |
|
3325 |
|
3326 |
|
3327 |
|
3328 |
|
3329 |
|
3330 |
|
3331 |
|
3332 |
|
3333 |
|
3334 |
|
3335 |
|
3336 |
|
3337 |
|
3338 |
|
3339 |
|
3340 |
|
3341 |
|
3342 |
|
3343 |
|
3344 |
|
3345 |
|
3346 |
|
3347 |
|
3348 |
|
3349 |
|
3350 |
|
3351 |
|
3352 |
|
3353 |
|
3354 |
|
3355 |
|
3356 |
|
3357 |
|
3358 |
|
3359 |
|
3360 |
|
3361 |
|
3362 |
|
3363 |
|
3364 |
|
3365 |
|
3366 |
|
3367 |
|
3368 |
|
3369 |
|
3370 |
|
3371 |
|
3372 |
|
3373 |
|
3374 |
|
3375 |
|
3376 |
|
3377 |
|
3378 |
|
3379 |
|
3380 |
|
3381 |
|
3382 |
|
3383 |
|
3384 |
|
3385 |
|
3386 |
|
3387 |
|
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 |
|
3393 |
|
3394 |
|
3395 |
|
3396 |
|
3397 |
|
3398 |
|
3399 |
|
3400 |
|
3401 |
|
3402 |
|
3403 |
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 |
|
3410 |
|
3411 |
|
3412 |
|
3413 |
|
3414 |
|
3415 |
|
3416 |
|
3417 |
|
3418 |
|
3419 |
|
3420 |
|
3421 |
|
3422 |
|
3423 |
|
3424 |
|
3425 |
|
3426 |
|
3427 |
|
3428 |
|
3429 |
|
3430 |
|
3431 |
|
3432 |
|
3433 |
|
3434 |
|
3435 |
|
3436 |
|
3437 |
|
3438 |
|
3439 |
|
3440 |
|
3441 |
|
3442 |
|
3443 |
|
3444 |
|
3445 |
|
3446 |
|
3447 |
|
3448 |
|
3449 |
|
3450 |
|
3451 |
|
3452 |
|
3453 |
|
3454 |
|
3455 |
|
3456 |
|
3457 |
|
3458 |
|
3459 |
|
3460 |
|
3461 |
|
3462 |
|
3463 |
|
3464 |
|
3465 |
|
3466 |
|
3467 |
|
3468 |
|
3469 |
|
3470 |
|
3471 |
|
3472 |
|
3473 | var NbCalendarComponent = (function () {
|
3474 | function NbCalendarComponent() {
|
3475 | |
3476 |
|
3477 |
|
3478 |
|
3479 | this.boundingMonth = true;
|
3480 | |
3481 |
|
3482 |
|
3483 | this.startView = exports.NbCalendarViewMode.DATE;
|
3484 | |
3485 |
|
3486 |
|
3487 |
|
3488 | this.size = exports.NbCalendarSize.MEDIUM;
|
3489 | |
3490 |
|
3491 |
|
3492 | this.showNavigation = true;
|
3493 | this._showWeekNumber = false;
|
3494 | |
3495 |
|
3496 |
|
3497 | this.weekNumberSymbol = '#';
|
3498 | |
3499 |
|
3500 |
|
3501 | this.dateChange = new i0.EventEmitter();
|
3502 | }
|
3503 | Object.defineProperty(NbCalendarComponent.prototype, "showWeekNumber", {
|
3504 | |
3505 |
|
3506 |
|
3507 |
|
3508 | get: function () {
|
3509 | return this._showWeekNumber;
|
3510 | },
|
3511 | set: function (value) {
|
3512 | this._showWeekNumber = convertToBoolProperty(value);
|
3513 | },
|
3514 | enumerable: false,
|
3515 | configurable: true
|
3516 | });
|
3517 | NbCalendarComponent.decorators = [
|
3518 | { type: i0.Component, args: [{
|
3519 | selector: 'nb-calendar',
|
3520 | template: "\n <nb-base-calendar\n [boundingMonth]=\"boundingMonth\"\n [startView]=\"startView\"\n [date]=\"date\"\n [min]=\"min\"\n [max]=\"max\"\n [filter]=\"filter\"\n [dayCellComponent]=\"dayCellComponent\"\n [monthCellComponent]=\"monthCellComponent\"\n [yearCellComponent]=\"yearCellComponent\"\n [size]=\"size\"\n [visibleDate]=\"visibleDate\"\n [showNavigation]=\"showNavigation\"\n [showWeekNumber]=\"showWeekNumber\"\n [weekNumberSymbol]=\"weekNumberSymbol\"\n (dateChange)=\"dateChange.emit($event)\"\n ></nb-base-calendar>\n "
|
3521 | },] }
|
3522 | ];
|
3523 | NbCalendarComponent.propDecorators = {
|
3524 | boundingMonth: [{ type: i0.Input }],
|
3525 | startView: [{ type: i0.Input }],
|
3526 | min: [{ type: i0.Input }],
|
3527 | max: [{ type: i0.Input }],
|
3528 | filter: [{ type: i0.Input }],
|
3529 | dayCellComponent: [{ type: i0.Input }],
|
3530 | monthCellComponent: [{ type: i0.Input }],
|
3531 | yearCellComponent: [{ type: i0.Input }],
|
3532 | size: [{ type: i0.Input }],
|
3533 | visibleDate: [{ type: i0.Input }],
|
3534 | showNavigation: [{ type: i0.Input }],
|
3535 | date: [{ type: i0.Input }],
|
3536 | showWeekNumber: [{ type: i0.Input }],
|
3537 | weekNumberSymbol: [{ type: i0.Input }],
|
3538 | dateChange: [{ type: i0.Output }]
|
3539 | };
|
3540 | return NbCalendarComponent;
|
3541 | }());
|
3542 |
|
3543 | var NbButton = (function () {
|
3544 | function NbButton(renderer, hostElement, cd, zone, statusService) {
|
3545 | this.renderer = renderer;
|
3546 | this.hostElement = hostElement;
|
3547 | this.cd = cd;
|
3548 | this.zone = zone;
|
3549 | this.statusService = statusService;
|
3550 | |
3551 |
|
3552 |
|
3553 |
|
3554 | this.size = 'medium';
|
3555 | |
3556 |
|
3557 |
|
3558 |
|
3559 | this.status = 'basic';
|
3560 | |
3561 |
|
3562 |
|
3563 | this.shape = 'rectangle';
|
3564 | |
3565 |
|
3566 |
|
3567 | this.appearance = 'filled';
|
3568 | this._fullWidth = false;
|
3569 | this._disabled = false;
|
3570 | }
|
3571 | Object.defineProperty(NbButton.prototype, "filled", {
|
3572 | |
3573 |
|
3574 |
|
3575 | get: function () {
|
3576 | return this.appearance === 'filled';
|
3577 | },
|
3578 | set: function (value) {
|
3579 | if (convertToBoolProperty(value)) {
|
3580 | this.appearance = 'filled';
|
3581 | }
|
3582 | },
|
3583 | enumerable: false,
|
3584 | configurable: true
|
3585 | });
|
3586 | Object.defineProperty(NbButton.prototype, "outline", {
|
3587 | |
3588 |
|
3589 |
|
3590 | get: function () {
|
3591 | return this.appearance === 'outline';
|
3592 | },
|
3593 | set: function (value) {
|
3594 | if (convertToBoolProperty(value)) {
|
3595 | this.appearance = 'outline';
|
3596 | }
|
3597 | },
|
3598 | enumerable: false,
|
3599 | configurable: true
|
3600 | });
|
3601 | Object.defineProperty(NbButton.prototype, "ghost", {
|
3602 | |
3603 |
|
3604 |
|
3605 | get: function () {
|
3606 | return this.appearance === 'ghost';
|
3607 | },
|
3608 | set: function (value) {
|
3609 | if (convertToBoolProperty(value)) {
|
3610 | this.appearance = 'ghost';
|
3611 | }
|
3612 | },
|
3613 | enumerable: false,
|
3614 | configurable: true
|
3615 | });
|
3616 | Object.defineProperty(NbButton.prototype, "fullWidth", {
|
3617 | |
3618 |
|
3619 |
|
3620 | get: function () {
|
3621 | return this._fullWidth;
|
3622 | },
|
3623 | set: function (value) {
|
3624 | this._fullWidth = convertToBoolProperty(value);
|
3625 | },
|
3626 | enumerable: false,
|
3627 | configurable: true
|
3628 | });
|
3629 | Object.defineProperty(NbButton.prototype, "disabled", {
|
3630 | |
3631 |
|
3632 |
|
3633 | get: function () {
|
3634 | return this._disabled;
|
3635 | },
|
3636 | set: function (value) {
|
3637 | if (this.disabled !== convertToBoolProperty(value)) {
|
3638 | this._disabled = !this.disabled;
|
3639 | this.renderer.setProperty(this.hostElement.nativeElement, 'disabled', this.disabled);
|
3640 | }
|
3641 | },
|
3642 | enumerable: false,
|
3643 | configurable: true
|
3644 | });
|
3645 | Object.defineProperty(NbButton.prototype, "tabbable", {
|
3646 |
|
3647 | get: function () {
|
3648 | if (this.disabled) {
|
3649 | return '-1';
|
3650 | }
|
3651 | if (this.tabIndex == null) {
|
3652 | return '0';
|
3653 | }
|
3654 | return this.tabIndex.toString();
|
3655 | },
|
3656 | enumerable: false,
|
3657 | configurable: true
|
3658 | });
|
3659 | Object.defineProperty(NbButton.prototype, "tiny", {
|
3660 | get: function () {
|
3661 | return this.size === 'tiny';
|
3662 | },
|
3663 | enumerable: false,
|
3664 | configurable: true
|
3665 | });
|
3666 | Object.defineProperty(NbButton.prototype, "small", {
|
3667 | get: function () {
|
3668 | return this.size === 'small';
|
3669 | },
|
3670 | enumerable: false,
|
3671 | configurable: true
|
3672 | });
|
3673 | Object.defineProperty(NbButton.prototype, "medium", {
|
3674 | get: function () {
|
3675 | return this.size === 'medium';
|
3676 | },
|
3677 | enumerable: false,
|
3678 | configurable: true
|
3679 | });
|
3680 | Object.defineProperty(NbButton.prototype, "large", {
|
3681 | get: function () {
|
3682 | return this.size === 'large';
|
3683 | },
|
3684 | enumerable: false,
|
3685 | configurable: true
|
3686 | });
|
3687 | Object.defineProperty(NbButton.prototype, "giant", {
|
3688 | get: function () {
|
3689 | return this.size === 'giant';
|
3690 | },
|
3691 | enumerable: false,
|
3692 | configurable: true
|
3693 | });
|
3694 | Object.defineProperty(NbButton.prototype, "rectangle", {
|
3695 | get: function () {
|
3696 | return this.shape === 'rectangle';
|
3697 | },
|
3698 | enumerable: false,
|
3699 | configurable: true
|
3700 | });
|
3701 | Object.defineProperty(NbButton.prototype, "round", {
|
3702 | get: function () {
|
3703 | return this.shape === 'round';
|
3704 | },
|
3705 | enumerable: false,
|
3706 | configurable: true
|
3707 | });
|
3708 | Object.defineProperty(NbButton.prototype, "semiRound", {
|
3709 | get: function () {
|
3710 | return this.shape === 'semi-round';
|
3711 | },
|
3712 | enumerable: false,
|
3713 | configurable: true
|
3714 | });
|
3715 | Object.defineProperty(NbButton.prototype, "iconLeft", {
|
3716 | get: function () {
|
3717 | var el = this.hostElement.nativeElement;
|
3718 | var icon = this.iconElement;
|
3719 | return !!(icon && firstChildNotComment(el) === icon);
|
3720 | },
|
3721 | enumerable: false,
|
3722 | configurable: true
|
3723 | });
|
3724 | Object.defineProperty(NbButton.prototype, "iconRight", {
|
3725 | get: function () {
|
3726 | var el = this.hostElement.nativeElement;
|
3727 | var icon = this.iconElement;
|
3728 | return !!(icon && lastChildNotComment(el) === icon);
|
3729 | },
|
3730 | enumerable: false,
|
3731 | configurable: true
|
3732 | });
|
3733 | Object.defineProperty(NbButton.prototype, "additionalClasses", {
|
3734 | get: function () {
|
3735 | if (this.statusService.isCustomStatus(this.status)) {
|
3736 | return [this.statusService.getStatusClass(this.status)];
|
3737 | }
|
3738 | return [];
|
3739 | },
|
3740 | enumerable: false,
|
3741 | configurable: true
|
3742 | });
|
3743 | NbButton.prototype.ngAfterViewInit = function () {
|
3744 | var _this = this;
|
3745 |
|
3746 | this.zone.runOutsideAngular(function () { return setTimeout(function () {
|
3747 | _this.renderer.addClass(_this.hostElement.nativeElement, 'nb-transition');
|
3748 | }); });
|
3749 | };
|
3750 | |
3751 |
|
3752 |
|
3753 | NbButton.prototype.updateProperties = function (config) {
|
3754 | var isPropertyChanged = false;
|
3755 | for (var key in config) {
|
3756 | if (config.hasOwnProperty(key) && this[key] !== config[key]) {
|
3757 | this[key] = config[key];
|
3758 | isPropertyChanged = true;
|
3759 | }
|
3760 | }
|
3761 | if (isPropertyChanged) {
|
3762 | this.cd.markForCheck();
|
3763 | }
|
3764 | };
|
3765 | Object.defineProperty(NbButton.prototype, "iconElement", {
|
3766 | get: function () {
|
3767 | var el = this.hostElement.nativeElement;
|
3768 | return el.querySelector('nb-icon');
|
3769 | },
|
3770 | enumerable: false,
|
3771 | configurable: true
|
3772 | });
|
3773 | NbButton.decorators = [
|
3774 | { type: i0.Directive }
|
3775 | ];
|
3776 | NbButton.ctorParameters = function () { return [
|
3777 | { type: i0.Renderer2 },
|
3778 | { type: i0.ElementRef },
|
3779 | { type: i0.ChangeDetectorRef },
|
3780 | { type: i0.NgZone },
|
3781 | { type: NbStatusService }
|
3782 | ]; };
|
3783 | NbButton.propDecorators = {
|
3784 | size: [{ type: i0.Input }],
|
3785 | status: [{ type: i0.Input }],
|
3786 | shape: [{ type: i0.Input }],
|
3787 | appearance: [{ type: i0.Input }],
|
3788 | filled: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.appearance-filled',] }],
|
3789 | outline: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.appearance-outline',] }],
|
3790 | ghost: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.appearance-ghost',] }],
|
3791 | fullWidth: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.full-width',] }],
|
3792 | disabled: [{ type: i0.Input }, { type: i0.HostBinding, args: ['attr.aria-disabled',] }, { type: i0.HostBinding, args: ['class.btn-disabled',] }],
|
3793 | tabIndex: [{ type: i0.Input }],
|
3794 | tabbable: [{ type: i0.HostBinding, args: ['attr.tabindex',] }],
|
3795 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
3796 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
3797 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
3798 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
3799 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }],
|
3800 | rectangle: [{ type: i0.HostBinding, args: ['class.shape-rectangle',] }],
|
3801 | round: [{ type: i0.HostBinding, args: ['class.shape-round',] }],
|
3802 | semiRound: [{ type: i0.HostBinding, args: ['class.shape-semi-round',] }],
|
3803 | iconLeft: [{ type: i0.HostBinding, args: ['class.icon-start',] }],
|
3804 | iconRight: [{ type: i0.HostBinding, args: ['class.icon-end',] }],
|
3805 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }]
|
3806 | };
|
3807 | return NbButton;
|
3808 | }());
|
3809 |
|
3810 |
|
3811 |
|
3812 |
|
3813 |
|
3814 |
|
3815 |
|
3816 |
|
3817 |
|
3818 |
|
3819 |
|
3820 |
|
3821 |
|
3822 |
|
3823 |
|
3824 |
|
3825 |
|
3826 |
|
3827 |
|
3828 |
|
3829 |
|
3830 |
|
3831 |
|
3832 |
|
3833 |
|
3834 |
|
3835 |
|
3836 |
|
3837 |
|
3838 |
|
3839 |
|
3840 |
|
3841 |
|
3842 |
|
3843 |
|
3844 |
|
3845 |
|
3846 |
|
3847 |
|
3848 |
|
3849 |
|
3850 |
|
3851 |
|
3852 |
|
3853 |
|
3854 |
|
3855 |
|
3856 |
|
3857 |
|
3858 |
|
3859 |
|
3860 |
|
3861 |
|
3862 |
|
3863 |
|
3864 |
|
3865 |
|
3866 |
|
3867 |
|
3868 |
|
3869 |
|
3870 |
|
3871 |
|
3872 |
|
3873 |
|
3874 |
|
3875 |
|
3876 |
|
3877 |
|
3878 |
|
3879 |
|
3880 |
|
3881 |
|
3882 |
|
3883 |
|
3884 |
|
3885 |
|
3886 |
|
3887 |
|
3888 |
|
3889 |
|
3890 |
|
3891 |
|
3892 |
|
3893 |
|
3894 |
|
3895 |
|
3896 |
|
3897 |
|
3898 |
|
3899 |
|
3900 |
|
3901 |
|
3902 |
|
3903 |
|
3904 |
|
3905 |
|
3906 |
|
3907 |
|
3908 |
|
3909 |
|
3910 |
|
3911 |
|
3912 |
|
3913 |
|
3914 |
|
3915 |
|
3916 |
|
3917 |
|
3918 |
|
3919 |
|
3920 |
|
3921 |
|
3922 |
|
3923 |
|
3924 |
|
3925 |
|
3926 |
|
3927 |
|
3928 |
|
3929 |
|
3930 |
|
3931 |
|
3932 |
|
3933 |
|
3934 |
|
3935 |
|
3936 |
|
3937 |
|
3938 |
|
3939 |
|
3940 |
|
3941 |
|
3942 |
|
3943 |
|
3944 |
|
3945 |
|
3946 |
|
3947 |
|
3948 |
|
3949 |
|
3950 |
|
3951 |
|
3952 |
|
3953 |
|
3954 |
|
3955 |
|
3956 |
|
3957 |
|
3958 |
|
3959 |
|
3960 |
|
3961 |
|
3962 |
|
3963 |
|
3964 |
|
3965 |
|
3966 |
|
3967 |
|
3968 |
|
3969 |
|
3970 |
|
3971 |
|
3972 |
|
3973 |
|
3974 |
|
3975 |
|
3976 |
|
3977 |
|
3978 |
|
3979 |
|
3980 |
|
3981 |
|
3982 |
|
3983 |
|
3984 |
|
3985 |
|
3986 |
|
3987 |
|
3988 |
|
3989 |
|
3990 |
|
3991 |
|
3992 |
|
3993 |
|
3994 |
|
3995 |
|
3996 |
|
3997 |
|
3998 |
|
3999 |
|
4000 |
|
4001 |
|
4002 |
|
4003 |
|
4004 |
|
4005 |
|
4006 |
|
4007 |
|
4008 |
|
4009 |
|
4010 |
|
4011 |
|
4012 |
|
4013 |
|
4014 |
|
4015 |
|
4016 |
|
4017 |
|
4018 |
|
4019 |
|
4020 |
|
4021 |
|
4022 |
|
4023 |
|
4024 |
|
4025 |
|
4026 |
|
4027 |
|
4028 |
|
4029 |
|
4030 |
|
4031 |
|
4032 |
|
4033 |
|
4034 |
|
4035 |
|
4036 |
|
4037 |
|
4038 |
|
4039 |
|
4040 |
|
4041 |
|
4042 |
|
4043 |
|
4044 |
|
4045 |
|
4046 |
|
4047 |
|
4048 |
|
4049 |
|
4050 |
|
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 |
|
4056 |
|
4057 |
|
4058 |
|
4059 |
|
4060 |
|
4061 |
|
4062 |
|
4063 |
|
4064 |
|
4065 |
|
4066 |
|
4067 |
|
4068 |
|
4069 |
|
4070 |
|
4071 |
|
4072 |
|
4073 |
|
4074 |
|
4075 |
|
4076 |
|
4077 |
|
4078 |
|
4079 |
|
4080 |
|
4081 |
|
4082 |
|
4083 |
|
4084 |
|
4085 |
|
4086 |
|
4087 |
|
4088 |
|
4089 |
|
4090 |
|
4091 |
|
4092 |
|
4093 |
|
4094 |
|
4095 |
|
4096 |
|
4097 |
|
4098 |
|
4099 |
|
4100 |
|
4101 |
|
4102 |
|
4103 |
|
4104 |
|
4105 |
|
4106 |
|
4107 |
|
4108 |
|
4109 |
|
4110 |
|
4111 |
|
4112 |
|
4113 |
|
4114 |
|
4115 |
|
4116 |
|
4117 |
|
4118 |
|
4119 |
|
4120 |
|
4121 |
|
4122 |
|
4123 |
|
4124 |
|
4125 |
|
4126 |
|
4127 |
|
4128 |
|
4129 |
|
4130 |
|
4131 |
|
4132 |
|
4133 |
|
4134 |
|
4135 |
|
4136 |
|
4137 |
|
4138 |
|
4139 |
|
4140 |
|
4141 |
|
4142 |
|
4143 |
|
4144 |
|
4145 |
|
4146 |
|
4147 |
|
4148 |
|
4149 |
|
4150 |
|
4151 |
|
4152 |
|
4153 |
|
4154 |
|
4155 |
|
4156 |
|
4157 |
|
4158 |
|
4159 |
|
4160 |
|
4161 |
|
4162 |
|
4163 |
|
4164 |
|
4165 |
|
4166 |
|
4167 |
|
4168 |
|
4169 |
|
4170 |
|
4171 |
|
4172 |
|
4173 |
|
4174 |
|
4175 |
|
4176 |
|
4177 |
|
4178 |
|
4179 |
|
4180 |
|
4181 |
|
4182 |
|
4183 |
|
4184 |
|
4185 |
|
4186 |
|
4187 |
|
4188 |
|
4189 |
|
4190 |
|
4191 |
|
4192 |
|
4193 |
|
4194 |
|
4195 |
|
4196 |
|
4197 |
|
4198 |
|
4199 |
|
4200 |
|
4201 |
|
4202 |
|
4203 |
|
4204 |
|
4205 |
|
4206 |
|
4207 |
|
4208 |
|
4209 |
|
4210 |
|
4211 |
|
4212 |
|
4213 |
|
4214 |
|
4215 |
|
4216 |
|
4217 |
|
4218 |
|
4219 |
|
4220 |
|
4221 |
|
4222 |
|
4223 |
|
4224 |
|
4225 |
|
4226 |
|
4227 |
|
4228 |
|
4229 |
|
4230 |
|
4231 |
|
4232 |
|
4233 |
|
4234 |
|
4235 |
|
4236 |
|
4237 |
|
4238 |
|
4239 |
|
4240 |
|
4241 |
|
4242 |
|
4243 |
|
4244 |
|
4245 |
|
4246 |
|
4247 |
|
4248 |
|
4249 |
|
4250 |
|
4251 |
|
4252 |
|
4253 |
|
4254 |
|
4255 |
|
4256 |
|
4257 |
|
4258 |
|
4259 |
|
4260 |
|
4261 |
|
4262 |
|
4263 |
|
4264 |
|
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 |
|
4271 |
|
4272 |
|
4273 |
|
4274 |
|
4275 |
|
4276 |
|
4277 |
|
4278 |
|
4279 |
|
4280 |
|
4281 |
|
4282 |
|
4283 |
|
4284 |
|
4285 |
|
4286 |
|
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 |
|
4292 |
|
4293 |
|
4294 |
|
4295 |
|
4296 |
|
4297 |
|
4298 |
|
4299 |
|
4300 |
|
4301 |
|
4302 |
|
4303 |
|
4304 |
|
4305 |
|
4306 |
|
4307 |
|
4308 |
|
4309 |
|
4310 |
|
4311 |
|
4312 |
|
4313 |
|
4314 |
|
4315 |
|
4316 |
|
4317 |
|
4318 |
|
4319 | var NbButtonComponent = (function (_super) {
|
4320 | tslib.__extends(NbButtonComponent, _super);
|
4321 | function NbButtonComponent(renderer, hostElement, cd, zone, statusService) {
|
4322 | var _this = _super.call(this, renderer, hostElement, cd, zone, statusService) || this;
|
4323 | _this.renderer = renderer;
|
4324 | _this.hostElement = hostElement;
|
4325 | _this.cd = cd;
|
4326 | _this.zone = zone;
|
4327 | _this.statusService = statusService;
|
4328 | return _this;
|
4329 | }
|
4330 | Object.defineProperty(NbButtonComponent.prototype, "hero", {
|
4331 | |
4332 |
|
4333 |
|
4334 | get: function () {
|
4335 | return this.appearance === 'hero';
|
4336 | },
|
4337 | set: function (value) {
|
4338 | if (convertToBoolProperty(value)) {
|
4339 | this.appearance = 'hero';
|
4340 | }
|
4341 | },
|
4342 | enumerable: false,
|
4343 | configurable: true
|
4344 | });
|
4345 | Object.defineProperty(NbButtonComponent.prototype, "primary", {
|
4346 | get: function () {
|
4347 | return this.status === 'primary';
|
4348 | },
|
4349 | enumerable: false,
|
4350 | configurable: true
|
4351 | });
|
4352 | Object.defineProperty(NbButtonComponent.prototype, "info", {
|
4353 | get: function () {
|
4354 | return this.status === 'info';
|
4355 | },
|
4356 | enumerable: false,
|
4357 | configurable: true
|
4358 | });
|
4359 | Object.defineProperty(NbButtonComponent.prototype, "success", {
|
4360 | get: function () {
|
4361 | return this.status === 'success';
|
4362 | },
|
4363 | enumerable: false,
|
4364 | configurable: true
|
4365 | });
|
4366 | Object.defineProperty(NbButtonComponent.prototype, "warning", {
|
4367 | get: function () {
|
4368 | return this.status === 'warning';
|
4369 | },
|
4370 | enumerable: false,
|
4371 | configurable: true
|
4372 | });
|
4373 | Object.defineProperty(NbButtonComponent.prototype, "danger", {
|
4374 | get: function () {
|
4375 | return this.status === 'danger';
|
4376 | },
|
4377 | enumerable: false,
|
4378 | configurable: true
|
4379 | });
|
4380 | Object.defineProperty(NbButtonComponent.prototype, "basic", {
|
4381 | get: function () {
|
4382 | return this.status === 'basic';
|
4383 | },
|
4384 | enumerable: false,
|
4385 | configurable: true
|
4386 | });
|
4387 | Object.defineProperty(NbButtonComponent.prototype, "control", {
|
4388 | get: function () {
|
4389 | return this.status === 'control';
|
4390 | },
|
4391 | enumerable: false,
|
4392 | configurable: true
|
4393 | });
|
4394 | |
4395 |
|
4396 |
|
4397 |
|
4398 |
|
4399 |
|
4400 |
|
4401 |
|
4402 |
|
4403 |
|
4404 | NbButtonComponent.prototype.onClick = function (event) {
|
4405 | if (this.disabled) {
|
4406 | event.preventDefault();
|
4407 | event.stopImmediatePropagation();
|
4408 | }
|
4409 | };
|
4410 | NbButtonComponent.decorators = [
|
4411 | { type: i0.Component, args: [{
|
4412 | selector: 'button[nbButton],a[nbButton],input[type="button"][nbButton],input[type="submit"][nbButton]',
|
4413 | template: "\n <ng-content></ng-content>\n ",
|
4414 | providers: [
|
4415 | { provide: NbButton, useExisting: NbButtonComponent },
|
4416 | ],
|
4417 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
4418 | },] }
|
4419 | ];
|
4420 | NbButtonComponent.ctorParameters = function () { return [
|
4421 | { type: i0.Renderer2 },
|
4422 | { type: i0.ElementRef },
|
4423 | { type: i0.ChangeDetectorRef },
|
4424 | { type: i0.NgZone },
|
4425 | { type: NbStatusService }
|
4426 | ]; };
|
4427 | NbButtonComponent.propDecorators = {
|
4428 | hero: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.appearance-hero',] }],
|
4429 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
4430 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
4431 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
4432 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
4433 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
4434 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
4435 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
4436 | onClick: [{ type: i0.HostListener, args: ['click', ['$event'],] }]
|
4437 | };
|
4438 | return NbButtonComponent;
|
4439 | }(NbButton));
|
4440 |
|
4441 |
|
4442 |
|
4443 |
|
4444 |
|
4445 |
|
4446 | var NB_BUTTON_COMPONENTS = [
|
4447 | NbButtonComponent,
|
4448 | ];
|
4449 | var NbButtonModule = (function () {
|
4450 | function NbButtonModule() {
|
4451 | }
|
4452 | NbButtonModule.decorators = [
|
4453 | { type: i0.NgModule, args: [{
|
4454 | imports: [
|
4455 | NbSharedModule,
|
4456 | ],
|
4457 | declarations: tslib.__spreadArray([], NB_BUTTON_COMPONENTS),
|
4458 | exports: tslib.__spreadArray([], NB_BUTTON_COMPONENTS),
|
4459 | },] }
|
4460 | ];
|
4461 | return NbButtonModule;
|
4462 | }());
|
4463 |
|
4464 |
|
4465 |
|
4466 |
|
4467 |
|
4468 |
|
4469 | var NbDateService = (function () {
|
4470 | function NbDateService() {
|
4471 | this.DAYS_IN_WEEK = 7;
|
4472 | |
4473 |
|
4474 |
|
4475 | this.HOURS_IN_DAY_PERIOD = 12;
|
4476 | }
|
4477 | NbDateService.prototype.setLocale = function (locale) {
|
4478 | this.locale = locale;
|
4479 | };
|
4480 | |
4481 |
|
4482 |
|
4483 | NbDateService.prototype.isBetween = function (date, start, end) {
|
4484 | return this.compareDates(date, start) > 0 && this.compareDates(date, end) < 0;
|
4485 | };
|
4486 |
|
4487 | |
4488 |
|
4489 |
|
4490 | NbDateService.prototype.isSameDaySafe = function (date1, date2) {
|
4491 | return date1 && date2 && this.isSameDay(date1, date2);
|
4492 | };
|
4493 |
|
4494 | |
4495 |
|
4496 |
|
4497 | NbDateService.prototype.isSameMonthSafe = function (date1, date2) {
|
4498 | return date1 && date2 && this.isSameMonth(date1, date2);
|
4499 | };
|
4500 | |
4501 |
|
4502 |
|
4503 | NbDateService.prototype.isSameYearSafe = function (date1, date2) {
|
4504 | return date1 && date2 && this.isSameYear(date1, date2);
|
4505 | };
|
4506 | NbDateService.prototype.isSameHourAndMinute = function (date1, date2) {
|
4507 | return this.isSameHour(date1, date2) && this.isSameMinute(date1, date2);
|
4508 | };
|
4509 | NbDateService.prototype.isSameHour = function (date1, date2) {
|
4510 | return this.getHours(date1) === this.getHours(date2);
|
4511 | };
|
4512 | NbDateService.prototype.isSameMinute = function (date1, date2) {
|
4513 | return this.getMinutes(date1) === this.getMinutes(date2);
|
4514 | };
|
4515 | NbDateService.prototype.getTwentyFourHoursFormat = function () {
|
4516 | return 'HH:mm';
|
4517 | };
|
4518 | NbDateService.prototype.getTwentyFourHoursFormatWithSeconds = function () {
|
4519 | return 'HH:mm:ss';
|
4520 | };
|
4521 | NbDateService.prototype.getTwelveHoursFormatWithSeconds = function () {
|
4522 | return 'hh:mm:ss a';
|
4523 | };
|
4524 | NbDateService.prototype.getDayPeriod = function (date) {
|
4525 | var isFirstDayPeriod = this.getHours(date) < this.HOURS_IN_DAY_PERIOD;
|
4526 | if (isFirstDayPeriod) {
|
4527 | return "AM" ;
|
4528 | }
|
4529 | else {
|
4530 | return "PM" ;
|
4531 | }
|
4532 | };
|
4533 | return NbDateService;
|
4534 | }());
|
4535 |
|
4536 |
|
4537 |
|
4538 |
|
4539 |
|
4540 |
|
4541 | var batch = function (target, batchSize, offset) {
|
4542 | if (offset === void 0) { offset = 0; }
|
4543 | return target.reduce(function (res, item, index) {
|
4544 | var chunkIndex = Math.floor((index + offset) / batchSize);
|
4545 | if (!res[chunkIndex]) {
|
4546 | res[chunkIndex] = [];
|
4547 | }
|
4548 | res[chunkIndex].push(item);
|
4549 | return res;
|
4550 | }, []);
|
4551 | };
|
4552 |
|
4553 |
|
4554 |
|
4555 | var rangeFromTo = function (from$$1, to, producer) {
|
4556 | if (to === void 0) { to = 0; }
|
4557 | if (producer === void 0) { producer = function (i) { return i; }; }
|
4558 | var arr = [];
|
4559 | for (var i = from$$1; i < to; i++) {
|
4560 | arr.push(producer(i));
|
4561 | }
|
4562 | return arr;
|
4563 | };
|
4564 |
|
4565 |
|
4566 |
|
4567 | var range = function (bound, producer) {
|
4568 | if (producer === void 0) { producer = function (i) { return i; }; }
|
4569 | return rangeFromTo(0, bound, producer);
|
4570 | };
|
4571 |
|
4572 |
|
4573 |
|
4574 |
|
4575 |
|
4576 |
|
4577 | var NbCalendarMonthModelService = (function () {
|
4578 | function NbCalendarMonthModelService(dateService) {
|
4579 | this.dateService = dateService;
|
4580 | }
|
4581 | NbCalendarMonthModelService.prototype.createDaysGrid = function (activeMonth, boundingMonth) {
|
4582 | if (boundingMonth === void 0) { boundingMonth = true; }
|
4583 | var weeks = this.createDates(activeMonth);
|
4584 | return this.withBoundingMonths(weeks, activeMonth, boundingMonth);
|
4585 | };
|
4586 | NbCalendarMonthModelService.prototype.createDates = function (activeMonth) {
|
4587 | var days = this.createDateRangeForMonth(activeMonth);
|
4588 | var startOfWeekDayDiff = this.getStartOfWeekDayDiff(activeMonth);
|
4589 | return batch(days, this.dateService.DAYS_IN_WEEK, startOfWeekDayDiff);
|
4590 | };
|
4591 | NbCalendarMonthModelService.prototype.withBoundingMonths = function (weeks, activeMonth, boundingMonth) {
|
4592 | var withBoundingMonths = weeks;
|
4593 | if (this.isShouldAddPrevBoundingMonth(withBoundingMonths)) {
|
4594 | withBoundingMonths = this.addPrevBoundingMonth(withBoundingMonths, activeMonth, boundingMonth);
|
4595 | }
|
4596 | if (this.isShouldAddNextBoundingMonth(withBoundingMonths)) {
|
4597 | withBoundingMonths = this.addNextBoundingMonth(withBoundingMonths, activeMonth, boundingMonth);
|
4598 | }
|
4599 | return withBoundingMonths;
|
4600 | };
|
4601 | NbCalendarMonthModelService.prototype.addPrevBoundingMonth = function (weeks, activeMonth, boundingMonth) {
|
4602 | var firstWeek = weeks.shift();
|
4603 | var requiredItems = this.dateService.DAYS_IN_WEEK - firstWeek.length;
|
4604 | firstWeek.unshift.apply(firstWeek, this.createPrevBoundingDays(activeMonth, boundingMonth, requiredItems));
|
4605 | return tslib.__spreadArray([firstWeek], weeks);
|
4606 | };
|
4607 | NbCalendarMonthModelService.prototype.addNextBoundingMonth = function (weeks, activeMonth, boundingMonth) {
|
4608 | var lastWeek = weeks.pop();
|
4609 | var requiredItems = this.dateService.DAYS_IN_WEEK - lastWeek.length;
|
4610 | lastWeek.push.apply(lastWeek, this.createNextBoundingDays(activeMonth, boundingMonth, requiredItems));
|
4611 | return tslib.__spreadArray(tslib.__spreadArray([], weeks), [lastWeek]);
|
4612 | };
|
4613 | NbCalendarMonthModelService.prototype.createPrevBoundingDays = function (activeMonth, boundingMonth, requiredItems) {
|
4614 | var month = this.dateService.addMonth(activeMonth, -1);
|
4615 | var daysInMonth = this.dateService.getNumberOfDaysInMonth(month);
|
4616 | return this.createDateRangeForMonth(month)
|
4617 | .slice(daysInMonth - requiredItems)
|
4618 | .map(function (date) { return boundingMonth ? date : null; });
|
4619 | };
|
4620 | NbCalendarMonthModelService.prototype.createNextBoundingDays = function (activeMonth, boundingMonth, requiredItems) {
|
4621 | var month = this.dateService.addMonth(activeMonth, 1);
|
4622 | return this.createDateRangeForMonth(month)
|
4623 | .slice(0, requiredItems)
|
4624 | .map(function (date) { return boundingMonth ? date : null; });
|
4625 | };
|
4626 | NbCalendarMonthModelService.prototype.getStartOfWeekDayDiff = function (date) {
|
4627 | var startOfMonth = this.dateService.getMonthStart(date);
|
4628 | return this.getWeekStartDiff(startOfMonth);
|
4629 | };
|
4630 | NbCalendarMonthModelService.prototype.getWeekStartDiff = function (date) {
|
4631 | return (7 - this.dateService.getFirstDayOfWeek() + this.dateService.getDayOfWeek(date)) % 7;
|
4632 | };
|
4633 | NbCalendarMonthModelService.prototype.isShouldAddPrevBoundingMonth = function (weeks) {
|
4634 | return weeks[0].length < this.dateService.DAYS_IN_WEEK;
|
4635 | };
|
4636 | NbCalendarMonthModelService.prototype.isShouldAddNextBoundingMonth = function (weeks) {
|
4637 | return weeks[weeks.length - 1].length < this.dateService.DAYS_IN_WEEK;
|
4638 | };
|
4639 | NbCalendarMonthModelService.prototype.createDateRangeForMonth = function (date) {
|
4640 | var _this = this;
|
4641 | var daysInMonth = this.dateService.getNumberOfDaysInMonth(date);
|
4642 | return range(daysInMonth, function (i) {
|
4643 | var year = _this.dateService.getYear(date);
|
4644 | var month = _this.dateService.getMonth(date);
|
4645 | return _this.dateService.createDate(year, month, i + 1);
|
4646 | });
|
4647 | };
|
4648 | NbCalendarMonthModelService.decorators = [
|
4649 | { type: i0.Injectable }
|
4650 | ];
|
4651 | NbCalendarMonthModelService.ctorParameters = function () { return [
|
4652 | { type: NbDateService }
|
4653 | ]; };
|
4654 | return NbCalendarMonthModelService;
|
4655 | }());
|
4656 |
|
4657 |
|
4658 |
|
4659 |
|
4660 |
|
4661 |
|
4662 | var NbCalendarDayCellComponent = (function () {
|
4663 | function NbCalendarDayCellComponent(dateService) {
|
4664 | this.dateService = dateService;
|
4665 | this.size = exports.NbCalendarSize.MEDIUM;
|
4666 | this.select = new i0.EventEmitter(true);
|
4667 | this.dayCellClass = true;
|
4668 | }
|
4669 | Object.defineProperty(NbCalendarDayCellComponent.prototype, "today", {
|
4670 | get: function () {
|
4671 | return this.dateService.isSameDaySafe(this.date, this.dateService.today());
|
4672 | },
|
4673 | enumerable: false,
|
4674 | configurable: true
|
4675 | });
|
4676 | Object.defineProperty(NbCalendarDayCellComponent.prototype, "boundingMonth", {
|
4677 | get: function () {
|
4678 | return !this.dateService.isSameMonthSafe(this.date, this.visibleDate);
|
4679 | },
|
4680 | enumerable: false,
|
4681 | configurable: true
|
4682 | });
|
4683 | Object.defineProperty(NbCalendarDayCellComponent.prototype, "selected", {
|
4684 | get: function () {
|
4685 | return this.dateService.isSameDaySafe(this.date, this.selectedValue);
|
4686 | },
|
4687 | enumerable: false,
|
4688 | configurable: true
|
4689 | });
|
4690 | Object.defineProperty(NbCalendarDayCellComponent.prototype, "empty", {
|
4691 | get: function () {
|
4692 | return !this.date;
|
4693 | },
|
4694 | enumerable: false,
|
4695 | configurable: true
|
4696 | });
|
4697 | Object.defineProperty(NbCalendarDayCellComponent.prototype, "disabled", {
|
4698 | get: function () {
|
4699 | return this.smallerThanMin() || this.greaterThanMax() || this.dontFitFilter();
|
4700 | },
|
4701 | enumerable: false,
|
4702 | configurable: true
|
4703 | });
|
4704 | Object.defineProperty(NbCalendarDayCellComponent.prototype, "isLarge", {
|
4705 | get: function () {
|
4706 | return this.size === exports.NbCalendarSize.LARGE;
|
4707 | },
|
4708 | enumerable: false,
|
4709 | configurable: true
|
4710 | });
|
4711 | Object.defineProperty(NbCalendarDayCellComponent.prototype, "day", {
|
4712 | get: function () {
|
4713 | return this.date && this.dateService.getDate(this.date);
|
4714 | },
|
4715 | enumerable: false,
|
4716 | configurable: true
|
4717 | });
|
4718 | NbCalendarDayCellComponent.prototype.onClick = function () {
|
4719 | if (this.disabled || this.empty) {
|
4720 | return;
|
4721 | }
|
4722 | this.select.emit(this.date);
|
4723 | };
|
4724 | NbCalendarDayCellComponent.prototype.smallerThanMin = function () {
|
4725 | return this.date && this.min && this.dateService.compareDates(this.date, this.min) < 0;
|
4726 | };
|
4727 | NbCalendarDayCellComponent.prototype.greaterThanMax = function () {
|
4728 | return this.date && this.max && this.dateService.compareDates(this.date, this.max) > 0;
|
4729 | };
|
4730 | NbCalendarDayCellComponent.prototype.dontFitFilter = function () {
|
4731 | return this.date && this.filter && !this.filter(this.date);
|
4732 | };
|
4733 | NbCalendarDayCellComponent.decorators = [
|
4734 | { type: i0.Component, args: [{
|
4735 | selector: 'nb-calendar-day-cell',
|
4736 | template: "\n <div class=\"cell-content\">\n {{ day }}\n </div>\n ",
|
4737 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
4738 | },] }
|
4739 | ];
|
4740 | NbCalendarDayCellComponent.ctorParameters = function () { return [
|
4741 | { type: NbDateService }
|
4742 | ]; };
|
4743 | NbCalendarDayCellComponent.propDecorators = {
|
4744 | date: [{ type: i0.Input }],
|
4745 | selectedValue: [{ type: i0.Input }],
|
4746 | visibleDate: [{ type: i0.Input }],
|
4747 | min: [{ type: i0.Input }],
|
4748 | max: [{ type: i0.Input }],
|
4749 | filter: [{ type: i0.Input }],
|
4750 | size: [{ type: i0.Input }],
|
4751 | select: [{ type: i0.Output }],
|
4752 | today: [{ type: i0.HostBinding, args: ['class.today',] }],
|
4753 | boundingMonth: [{ type: i0.HostBinding, args: ['class.bounding-month',] }],
|
4754 | selected: [{ type: i0.HostBinding, args: ['class.selected',] }],
|
4755 | empty: [{ type: i0.HostBinding, args: ['class.empty',] }],
|
4756 | disabled: [{ type: i0.HostBinding, args: ['class.disabled',] }],
|
4757 | isLarge: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
4758 | dayCellClass: [{ type: i0.HostBinding, args: ['class.day-cell',] }],
|
4759 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
4760 | };
|
4761 | return NbCalendarDayCellComponent;
|
4762 | }());
|
4763 |
|
4764 |
|
4765 |
|
4766 |
|
4767 |
|
4768 |
|
4769 |
|
4770 |
|
4771 |
|
4772 | var NbCalendarDayPickerComponent = (function () {
|
4773 | function NbCalendarDayPickerComponent(monthModel) {
|
4774 | this.monthModel = monthModel;
|
4775 | |
4776 |
|
4777 |
|
4778 |
|
4779 | this.boundingMonths = true;
|
4780 | this.cellComponent = NbCalendarDayCellComponent;
|
4781 | |
4782 |
|
4783 |
|
4784 |
|
4785 | this.size = exports.NbCalendarSize.MEDIUM;
|
4786 | this._showWeekNumber = false;
|
4787 | |
4788 |
|
4789 |
|
4790 | this.dateChange = new i0.EventEmitter();
|
4791 | }
|
4792 | Object.defineProperty(NbCalendarDayPickerComponent.prototype, "setCellComponent", {
|
4793 | |
4794 |
|
4795 |
|
4796 | set: function (cellComponent) {
|
4797 | if (cellComponent) {
|
4798 | this.cellComponent = cellComponent;
|
4799 | }
|
4800 | },
|
4801 | enumerable: false,
|
4802 | configurable: true
|
4803 | });
|
4804 | Object.defineProperty(NbCalendarDayPickerComponent.prototype, "showWeekNumber", {
|
4805 | |
4806 |
|
4807 |
|
4808 |
|
4809 | get: function () {
|
4810 | return this._showWeekNumber;
|
4811 | },
|
4812 | set: function (value) {
|
4813 | this._showWeekNumber = convertToBoolProperty(value);
|
4814 | },
|
4815 | enumerable: false,
|
4816 | configurable: true
|
4817 | });
|
4818 | Object.defineProperty(NbCalendarDayPickerComponent.prototype, "large", {
|
4819 | get: function () {
|
4820 | return this.size === exports.NbCalendarSize.LARGE;
|
4821 | },
|
4822 | enumerable: false,
|
4823 | configurable: true
|
4824 | });
|
4825 | NbCalendarDayPickerComponent.prototype.ngOnChanges = function (_a) {
|
4826 | var visibleDate = _a.visibleDate, boundingMonths = _a.boundingMonths;
|
4827 | if (visibleDate || boundingMonths) {
|
4828 | this.weeks = this.monthModel.createDaysGrid(this.visibleDate, this.boundingMonths);
|
4829 | }
|
4830 | };
|
4831 | NbCalendarDayPickerComponent.prototype.onSelect = function (day) {
|
4832 | this.dateChange.emit(day);
|
4833 | };
|
4834 | NbCalendarDayPickerComponent.decorators = [
|
4835 | { type: i0.Component, args: [{
|
4836 | selector: 'nb-calendar-day-picker',
|
4837 | template: "\n <nb-calendar-week-numbers *ngIf=\"showWeekNumber\"\n [weeks]=\"weeks\"\n [size]=\"size\"\n [weekNumberSymbol]=\"weekNumberSymbol\">\n </nb-calendar-week-numbers>\n <div class=\"days-container\">\n <nb-calendar-days-names [size]=\"size\"></nb-calendar-days-names>\n <nb-calendar-picker\n [data]=\"weeks\"\n [visibleDate]=\"visibleDate\"\n [selectedValue]=\"date\"\n [cellComponent]=\"cellComponent\"\n [min]=\"min\"\n [max]=\"max\"\n [filter]=\"filter\"\n [size]=\"size\"\n (select)=\"onSelect($event)\">\n </nb-calendar-picker>\n </div>\n ",
|
4838 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
4839 | styles: [":host{display:flex}.days-container{width:100%}\n"]
|
4840 | },] }
|
4841 | ];
|
4842 | NbCalendarDayPickerComponent.ctorParameters = function () { return [
|
4843 | { type: NbCalendarMonthModelService }
|
4844 | ]; };
|
4845 | NbCalendarDayPickerComponent.propDecorators = {
|
4846 | visibleDate: [{ type: i0.Input }],
|
4847 | boundingMonths: [{ type: i0.Input }],
|
4848 | min: [{ type: i0.Input }],
|
4849 | max: [{ type: i0.Input }],
|
4850 | filter: [{ type: i0.Input }],
|
4851 | setCellComponent: [{ type: i0.Input, args: ['cellComponent',] }],
|
4852 | size: [{ type: i0.Input }],
|
4853 | date: [{ type: i0.Input }],
|
4854 | showWeekNumber: [{ type: i0.Input }],
|
4855 | weekNumberSymbol: [{ type: i0.Input }],
|
4856 | dateChange: [{ type: i0.Output }],
|
4857 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }]
|
4858 | };
|
4859 | return NbCalendarDayPickerComponent;
|
4860 | }());
|
4861 |
|
4862 |
|
4863 |
|
4864 |
|
4865 |
|
4866 |
|
4867 | var NbCalendarDaysNamesComponent = (function () {
|
4868 | function NbCalendarDaysNamesComponent(dateService) {
|
4869 | this.dateService = dateService;
|
4870 | }
|
4871 | Object.defineProperty(NbCalendarDaysNamesComponent.prototype, "isLarge", {
|
4872 | get: function () {
|
4873 | return this.size === exports.NbCalendarSize.LARGE;
|
4874 | },
|
4875 | enumerable: false,
|
4876 | configurable: true
|
4877 | });
|
4878 | NbCalendarDaysNamesComponent.prototype.ngOnInit = function () {
|
4879 | var days = this.createDaysNames();
|
4880 | this.days = this.shiftStartOfWeek(days);
|
4881 | };
|
4882 | NbCalendarDaysNamesComponent.prototype.createDaysNames = function () {
|
4883 | return this.dateService.getDayOfWeekNames()
|
4884 | .map(this.markIfHoliday);
|
4885 | };
|
4886 | NbCalendarDaysNamesComponent.prototype.shiftStartOfWeek = function (days) {
|
4887 | for (var i = 0; i < this.dateService.getFirstDayOfWeek(); i++) {
|
4888 | days.push(days.shift());
|
4889 | }
|
4890 | return days;
|
4891 | };
|
4892 | NbCalendarDaysNamesComponent.prototype.markIfHoliday = function (name, i) {
|
4893 | return { name: name, isHoliday: i % 6 === 0 };
|
4894 | };
|
4895 | NbCalendarDaysNamesComponent.decorators = [
|
4896 | { type: i0.Component, args: [{
|
4897 | selector: 'nb-calendar-days-names',
|
4898 | template: "\n <div class=\"day\" *ngFor=\"let day of days\" [class.holiday]=\"day.isHoliday\">{{ day.name }}</div>\n ",
|
4899 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
4900 | styles: [":host{display:flex;justify-content:space-between}:host .day{display:flex;align-items:center;justify-content:center}\n"]
|
4901 | },] }
|
4902 | ];
|
4903 | NbCalendarDaysNamesComponent.ctorParameters = function () { return [
|
4904 | { type: NbDateService }
|
4905 | ]; };
|
4906 | NbCalendarDaysNamesComponent.propDecorators = {
|
4907 | size: [{ type: i0.Input }],
|
4908 | isLarge: [{ type: i0.HostBinding, args: ['class.size-large',] }]
|
4909 | };
|
4910 | return NbCalendarDaysNamesComponent;
|
4911 | }());
|
4912 |
|
4913 |
|
4914 |
|
4915 |
|
4916 |
|
4917 |
|
4918 | var NbCalendarMonthCellComponent = (function () {
|
4919 | function NbCalendarMonthCellComponent(dateService) {
|
4920 | this.dateService = dateService;
|
4921 | this.size = exports.NbCalendarSize.MEDIUM;
|
4922 | this.select = new i0.EventEmitter(true);
|
4923 | this.monthCellClass = true;
|
4924 | }
|
4925 | Object.defineProperty(NbCalendarMonthCellComponent.prototype, "selected", {
|
4926 | get: function () {
|
4927 | return this.dateService.isSameMonthSafe(this.date, this.selectedValue);
|
4928 | },
|
4929 | enumerable: false,
|
4930 | configurable: true
|
4931 | });
|
4932 | Object.defineProperty(NbCalendarMonthCellComponent.prototype, "today", {
|
4933 | get: function () {
|
4934 | return this.dateService.isSameMonthSafe(this.date, this.dateService.today());
|
4935 | },
|
4936 | enumerable: false,
|
4937 | configurable: true
|
4938 | });
|
4939 | Object.defineProperty(NbCalendarMonthCellComponent.prototype, "disabled", {
|
4940 | get: function () {
|
4941 | return this.smallerThanMin() || this.greaterThanMax();
|
4942 | },
|
4943 | enumerable: false,
|
4944 | configurable: true
|
4945 | });
|
4946 | Object.defineProperty(NbCalendarMonthCellComponent.prototype, "isLarge", {
|
4947 | get: function () {
|
4948 | return this.size === exports.NbCalendarSize.LARGE;
|
4949 | },
|
4950 | enumerable: false,
|
4951 | configurable: true
|
4952 | });
|
4953 | Object.defineProperty(NbCalendarMonthCellComponent.prototype, "month", {
|
4954 | get: function () {
|
4955 | return this.dateService.getMonthName(this.date);
|
4956 | },
|
4957 | enumerable: false,
|
4958 | configurable: true
|
4959 | });
|
4960 | NbCalendarMonthCellComponent.prototype.onClick = function () {
|
4961 | if (this.disabled) {
|
4962 | return;
|
4963 | }
|
4964 | this.select.emit(this.date);
|
4965 | };
|
4966 | NbCalendarMonthCellComponent.prototype.smallerThanMin = function () {
|
4967 | return this.date && this.min && this.dateService.compareDates(this.monthEnd(), this.min) < 0;
|
4968 | };
|
4969 | NbCalendarMonthCellComponent.prototype.greaterThanMax = function () {
|
4970 | return this.date && this.max && this.dateService.compareDates(this.monthStart(), this.max) > 0;
|
4971 | };
|
4972 | NbCalendarMonthCellComponent.prototype.monthStart = function () {
|
4973 | return this.dateService.getMonthStart(this.date);
|
4974 | };
|
4975 | NbCalendarMonthCellComponent.prototype.monthEnd = function () {
|
4976 | return this.dateService.getMonthEnd(this.date);
|
4977 | };
|
4978 | NbCalendarMonthCellComponent.decorators = [
|
4979 | { type: i0.Component, args: [{
|
4980 | selector: 'nb-calendar-month-cell',
|
4981 | template: "\n <div class=\"cell-content\">\n {{ month }}\n </div>\n ",
|
4982 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
4983 | },] }
|
4984 | ];
|
4985 | NbCalendarMonthCellComponent.ctorParameters = function () { return [
|
4986 | { type: NbDateService }
|
4987 | ]; };
|
4988 | NbCalendarMonthCellComponent.propDecorators = {
|
4989 | date: [{ type: i0.Input }],
|
4990 | selectedValue: [{ type: i0.Input }],
|
4991 | min: [{ type: i0.Input }],
|
4992 | max: [{ type: i0.Input }],
|
4993 | size: [{ type: i0.Input }],
|
4994 | select: [{ type: i0.Output }],
|
4995 | selected: [{ type: i0.HostBinding, args: ['class.selected',] }],
|
4996 | today: [{ type: i0.HostBinding, args: ['class.today',] }],
|
4997 | disabled: [{ type: i0.HostBinding, args: ['class.disabled',] }],
|
4998 | isLarge: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
4999 | monthCellClass: [{ type: i0.HostBinding, args: ['class.month-cell',] }],
|
5000 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
5001 | };
|
5002 | return NbCalendarMonthCellComponent;
|
5003 | }());
|
5004 |
|
5005 |
|
5006 |
|
5007 |
|
5008 |
|
5009 |
|
5010 | var MONTHS_IN_VIEW = 12;
|
5011 | var MONTHS_IN_COLUMN = 4;
|
5012 | var NbCalendarMonthPickerComponent = (function () {
|
5013 | function NbCalendarMonthPickerComponent(dateService) {
|
5014 | this.dateService = dateService;
|
5015 | this.size = exports.NbCalendarSize.MEDIUM;
|
5016 | this.monthChange = new i0.EventEmitter();
|
5017 | this.cellComponent = NbCalendarMonthCellComponent;
|
5018 | }
|
5019 | Object.defineProperty(NbCalendarMonthPickerComponent.prototype, "_cellComponent", {
|
5020 | set: function (cellComponent) {
|
5021 | if (cellComponent) {
|
5022 | this.cellComponent = cellComponent;
|
5023 | }
|
5024 | },
|
5025 | enumerable: false,
|
5026 | configurable: true
|
5027 | });
|
5028 | Object.defineProperty(NbCalendarMonthPickerComponent.prototype, "large", {
|
5029 | get: function () {
|
5030 | return this.size === exports.NbCalendarSize.LARGE;
|
5031 | },
|
5032 | enumerable: false,
|
5033 | configurable: true
|
5034 | });
|
5035 | NbCalendarMonthPickerComponent.prototype.ngOnChanges = function (changes) {
|
5036 | if (changes.month) {
|
5037 | this.initMonths();
|
5038 | }
|
5039 | };
|
5040 | NbCalendarMonthPickerComponent.prototype.initMonths = function () {
|
5041 | var date = this.dateService.getDate(this.month);
|
5042 | var year = this.dateService.getYear(this.month);
|
5043 | var firstMonth = this.dateService.createDate(year, 0, date);
|
5044 | var months = [firstMonth];
|
5045 | for (var monthIndex = 1; monthIndex < MONTHS_IN_VIEW; monthIndex++) {
|
5046 | months.push(this.dateService.addMonth(firstMonth, monthIndex));
|
5047 | }
|
5048 | this.months = batch(months, MONTHS_IN_COLUMN);
|
5049 | };
|
5050 | NbCalendarMonthPickerComponent.prototype.onSelect = function (month) {
|
5051 | this.monthChange.emit(month);
|
5052 | };
|
5053 | NbCalendarMonthPickerComponent.decorators = [
|
5054 | { type: i0.Component, args: [{
|
5055 | selector: 'nb-calendar-month-picker',
|
5056 | template: "\n <nb-calendar-picker\n [data]=\"months\"\n [min]=\"min\"\n [max]=\"max\"\n [filter]=\"filter\"\n [selectedValue]=\"date\"\n [visibleDate]=\"month\"\n [cellComponent]=\"cellComponent\"\n [size]=\"size\"\n (select)=\"onSelect($event)\">\n </nb-calendar-picker>\n ",
|
5057 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
5058 | },] }
|
5059 | ];
|
5060 | NbCalendarMonthPickerComponent.ctorParameters = function () { return [
|
5061 | { type: NbDateService }
|
5062 | ]; };
|
5063 | NbCalendarMonthPickerComponent.propDecorators = {
|
5064 | min: [{ type: i0.Input }],
|
5065 | max: [{ type: i0.Input }],
|
5066 | filter: [{ type: i0.Input }],
|
5067 | size: [{ type: i0.Input }],
|
5068 | month: [{ type: i0.Input }],
|
5069 | date: [{ type: i0.Input }],
|
5070 | monthChange: [{ type: i0.Output }],
|
5071 | _cellComponent: [{ type: i0.Input, args: ['cellComponent',] }],
|
5072 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }]
|
5073 | };
|
5074 | return NbCalendarMonthPickerComponent;
|
5075 | }());
|
5076 |
|
5077 |
|
5078 |
|
5079 |
|
5080 |
|
5081 |
|
5082 | var NbCalendarYearModelService = (function () {
|
5083 | function NbCalendarYearModelService(dateService) {
|
5084 | this.dateService = dateService;
|
5085 | this.yearsInView = 12;
|
5086 | this.yearsInRow = 4;
|
5087 | }
|
5088 | NbCalendarYearModelService.prototype.getYearsInView = function () {
|
5089 | return this.yearsInView;
|
5090 | };
|
5091 | NbCalendarYearModelService.prototype.getYearsInRow = function () {
|
5092 | return this.yearsInRow;
|
5093 | };
|
5094 | NbCalendarYearModelService.prototype.getViewYears = function (viewYear) {
|
5095 | var _this = this;
|
5096 | var year = this.dateService.getYear(viewYear);
|
5097 | var viewStartYear;
|
5098 | if (year >= 0) {
|
5099 | viewStartYear = year - (year % this.yearsInView);
|
5100 | }
|
5101 | else {
|
5102 | viewStartYear = year - (year % this.yearsInView + this.yearsInView);
|
5103 | }
|
5104 | var years = range(this.yearsInView).map(function (i) { return _this.copyWithYear(viewStartYear + i, viewYear); });
|
5105 | return batch(years, this.yearsInRow);
|
5106 | };
|
5107 | NbCalendarYearModelService.prototype.copyWithYear = function (year, date) {
|
5108 | return this.dateService.createDate(year, this.dateService.getMonth(date), this.dateService.getDate(date));
|
5109 | };
|
5110 | NbCalendarYearModelService.decorators = [
|
5111 | { type: i0.Injectable }
|
5112 | ];
|
5113 | NbCalendarYearModelService.ctorParameters = function () { return [
|
5114 | { type: NbDateService }
|
5115 | ]; };
|
5116 | return NbCalendarYearModelService;
|
5117 | }());
|
5118 |
|
5119 |
|
5120 |
|
5121 |
|
5122 |
|
5123 |
|
5124 | var NbCalendarViewModeComponent = (function () {
|
5125 | function NbCalendarViewModeComponent(dateService, yearModelService) {
|
5126 | this.dateService = dateService;
|
5127 | this.yearModelService = yearModelService;
|
5128 | this.viewMode = exports.NbCalendarViewMode.DATE;
|
5129 | this.changeMode = new i0.EventEmitter(true);
|
5130 | }
|
5131 | NbCalendarViewModeComponent.prototype.getText = function () {
|
5132 | if (!this.date) {
|
5133 | return '';
|
5134 | }
|
5135 | switch (this.viewMode) {
|
5136 | case exports.NbCalendarViewMode.DATE: {
|
5137 | var month = this.dateService.getMonthName(this.date, _angular_common.TranslationWidth.Wide);
|
5138 | var year = this.dateService.getYear(this.date);
|
5139 | return month + " " + year;
|
5140 | }
|
5141 | case exports.NbCalendarViewMode.MONTH:
|
5142 | return "" + this.dateService.getYear(this.date);
|
5143 | case exports.NbCalendarViewMode.YEAR:
|
5144 | return this.getFirstYear() + " - " + this.getLastYear();
|
5145 | }
|
5146 | };
|
5147 | NbCalendarViewModeComponent.prototype.getIcon = function () {
|
5148 | if (this.viewMode === exports.NbCalendarViewMode.DATE) {
|
5149 | return 'chevron-down-outline';
|
5150 | }
|
5151 | return 'chevron-up-outline';
|
5152 | };
|
5153 | NbCalendarViewModeComponent.prototype.getFirstYear = function () {
|
5154 | var years = this.yearModelService.getViewYears(this.date);
|
5155 | return this.dateService.getYear(years[0][0]).toString();
|
5156 | };
|
5157 | NbCalendarViewModeComponent.prototype.getLastYear = function () {
|
5158 | var years = this.yearModelService.getViewYears(this.date);
|
5159 | var lastRow = years[years.length - 1];
|
5160 | var lastYear = lastRow[lastRow.length - 1];
|
5161 | return this.dateService.getYear(lastYear).toString();
|
5162 | };
|
5163 | NbCalendarViewModeComponent.decorators = [
|
5164 | { type: i0.Component, args: [{
|
5165 | selector: 'nb-calendar-view-mode',
|
5166 | template: "\n <button nbButton (click)=\"changeMode.emit()\" ghost status=\"basic\">\n {{ getText() }}\n <nb-icon [icon]=\"getIcon()\" pack=\"nebular-essentials\"></nb-icon>\n </button>\n ",
|
5167 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
5168 | },] }
|
5169 | ];
|
5170 | NbCalendarViewModeComponent.ctorParameters = function () { return [
|
5171 | { type: NbDateService },
|
5172 | { type: NbCalendarYearModelService }
|
5173 | ]; };
|
5174 | NbCalendarViewModeComponent.propDecorators = {
|
5175 | date: [{ type: i0.Input }],
|
5176 | viewMode: [{ type: i0.Input }],
|
5177 | changeMode: [{ type: i0.Output }]
|
5178 | };
|
5179 | return NbCalendarViewModeComponent;
|
5180 | }());
|
5181 |
|
5182 |
|
5183 |
|
5184 |
|
5185 |
|
5186 |
|
5187 | var NbCalendarPageableNavigationComponent = (function () {
|
5188 | function NbCalendarPageableNavigationComponent(directionService) {
|
5189 | this.directionService = directionService;
|
5190 | this.next = new i0.EventEmitter();
|
5191 | this.prev = new i0.EventEmitter();
|
5192 | }
|
5193 | Object.defineProperty(NbCalendarPageableNavigationComponent.prototype, "isLtr", {
|
5194 | get: function () {
|
5195 | return this.directionService.isLtr();
|
5196 | },
|
5197 | enumerable: false,
|
5198 | configurable: true
|
5199 | });
|
5200 | NbCalendarPageableNavigationComponent.decorators = [
|
5201 | { type: i0.Component, args: [{
|
5202 | selector: 'nb-calendar-pageable-navigation',
|
5203 | template: "\n <button nbButton (click)=\"prev.emit()\" ghost status=\"basic\" class=\"prev-month\">\n <nb-icon [icon]=\"isLtr ? 'chevron-left-outline' : 'chevron-right-outline'\" pack=\"nebular-essentials\"></nb-icon>\n </button>\n <button nbButton (click)=\"next.emit()\" ghost status=\"basic\" class=\"next-month\">\n <nb-icon [icon]=\"isLtr ? 'chevron-right-outline' : 'chevron-left-outline'\" pack=\"nebular-essentials\"></nb-icon>\n </button>\n ",
|
5204 | styles: [":host{display:flex;align-items:center;justify-content:flex-start}\n"]
|
5205 | },] }
|
5206 | ];
|
5207 | NbCalendarPageableNavigationComponent.ctorParameters = function () { return [
|
5208 | { type: NbLayoutDirectionService }
|
5209 | ]; };
|
5210 | NbCalendarPageableNavigationComponent.propDecorators = {
|
5211 | next: [{ type: i0.Output }],
|
5212 | prev: [{ type: i0.Output }]
|
5213 | };
|
5214 | return NbCalendarPageableNavigationComponent;
|
5215 | }());
|
5216 |
|
5217 |
|
5218 |
|
5219 |
|
5220 |
|
5221 |
|
5222 | var NbCalendarPickerComponent = (function () {
|
5223 | function NbCalendarPickerComponent() {
|
5224 | this.size = exports.NbCalendarSize.MEDIUM;
|
5225 | this.select = new i0.EventEmitter();
|
5226 | }
|
5227 | Object.defineProperty(NbCalendarPickerComponent.prototype, "isLarge", {
|
5228 | get: function () {
|
5229 | return this.size === exports.NbCalendarSize.LARGE;
|
5230 | },
|
5231 | enumerable: false,
|
5232 | configurable: true
|
5233 | });
|
5234 | NbCalendarPickerComponent.decorators = [
|
5235 | { type: i0.Component, args: [{
|
5236 | selector: 'nb-calendar-picker',
|
5237 | template: "\n <nb-calendar-picker-row\n *ngFor=\"let row of data\"\n [row]=\"row\"\n [visibleDate]=\"visibleDate\"\n [selectedValue]=\"selectedValue\"\n [component]=\"cellComponent\"\n [min]=\"min\"\n [max]=\"max\"\n [filter]=\"filter\"\n [size]=\"size\"\n (select)=\"select.emit($event)\">\n </nb-calendar-picker-row>\n ",
|
5238 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
5239 | },] }
|
5240 | ];
|
5241 | NbCalendarPickerComponent.propDecorators = {
|
5242 | data: [{ type: i0.Input }],
|
5243 | visibleDate: [{ type: i0.Input }],
|
5244 | selectedValue: [{ type: i0.Input }],
|
5245 | cellComponent: [{ type: i0.Input }],
|
5246 | min: [{ type: i0.Input }],
|
5247 | max: [{ type: i0.Input }],
|
5248 | filter: [{ type: i0.Input }],
|
5249 | size: [{ type: i0.Input }],
|
5250 | select: [{ type: i0.Output }],
|
5251 | isLarge: [{ type: i0.HostBinding, args: ['class.size-large',] }]
|
5252 | };
|
5253 | return NbCalendarPickerComponent;
|
5254 | }());
|
5255 |
|
5256 |
|
5257 |
|
5258 |
|
5259 |
|
5260 |
|
5261 | var NbCalendarPickerRowComponent = (function () {
|
5262 | function NbCalendarPickerRowComponent(cfr) {
|
5263 | this.cfr = cfr;
|
5264 | this.size = exports.NbCalendarSize.MEDIUM;
|
5265 | this.select = new i0.EventEmitter();
|
5266 | }
|
5267 | NbCalendarPickerRowComponent.prototype.ngOnChanges = function () {
|
5268 | var _this = this;
|
5269 | var factory = this.cfr.resolveComponentFactory(this.component);
|
5270 | this.containerRef.clear();
|
5271 | this.row.forEach(function (date) {
|
5272 | var component = _this.containerRef.createComponent(factory);
|
5273 | _this.patchWithContext(component.instance, date);
|
5274 | component.changeDetectorRef.detectChanges();
|
5275 | });
|
5276 | };
|
5277 | NbCalendarPickerRowComponent.prototype.patchWithContext = function (component, date) {
|
5278 | component.visibleDate = this.visibleDate;
|
5279 | component.selectedValue = this.selectedValue;
|
5280 | component.date = date;
|
5281 | component.min = this.min;
|
5282 | component.max = this.max;
|
5283 | component.filter = this.filter;
|
5284 | component.size = this.size;
|
5285 | component.select.subscribe(this.select.emit.bind(this.select));
|
5286 | };
|
5287 | NbCalendarPickerRowComponent.decorators = [
|
5288 | { type: i0.Component, args: [{
|
5289 | selector: 'nb-calendar-picker-row',
|
5290 | template: '<ng-template></ng-template>',
|
5291 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
5292 | styles: ["\n :host {\n display: flex;\n justify-content: space-between;\n }\n "]
|
5293 | },] }
|
5294 | ];
|
5295 | NbCalendarPickerRowComponent.ctorParameters = function () { return [
|
5296 | { type: i0.ComponentFactoryResolver }
|
5297 | ]; };
|
5298 | NbCalendarPickerRowComponent.propDecorators = {
|
5299 | row: [{ type: i0.Input }],
|
5300 | selectedValue: [{ type: i0.Input }],
|
5301 | visibleDate: [{ type: i0.Input }],
|
5302 | component: [{ type: i0.Input }],
|
5303 | min: [{ type: i0.Input }],
|
5304 | max: [{ type: i0.Input }],
|
5305 | filter: [{ type: i0.Input }],
|
5306 | size: [{ type: i0.Input }],
|
5307 | select: [{ type: i0.Output }],
|
5308 | containerRef: [{ type: i0.ViewChild, args: [i0.TemplateRef, { read: i0.ViewContainerRef, static: true },] }]
|
5309 | };
|
5310 | return NbCalendarPickerRowComponent;
|
5311 | }());
|
5312 |
|
5313 |
|
5314 |
|
5315 |
|
5316 |
|
5317 |
|
5318 | var NbCalendarYearCellComponent = (function () {
|
5319 | function NbCalendarYearCellComponent(dateService) {
|
5320 | this.dateService = dateService;
|
5321 | this.size = exports.NbCalendarSize.MEDIUM;
|
5322 | this.select = new i0.EventEmitter(true);
|
5323 | this.yearCellClass = true;
|
5324 | }
|
5325 | Object.defineProperty(NbCalendarYearCellComponent.prototype, "selected", {
|
5326 | get: function () {
|
5327 | return this.dateService.isSameYearSafe(this.date, this.selectedValue);
|
5328 | },
|
5329 | enumerable: false,
|
5330 | configurable: true
|
5331 | });
|
5332 | Object.defineProperty(NbCalendarYearCellComponent.prototype, "today", {
|
5333 | get: function () {
|
5334 | return this.dateService.isSameYearSafe(this.date, this.dateService.today());
|
5335 | },
|
5336 | enumerable: false,
|
5337 | configurable: true
|
5338 | });
|
5339 | Object.defineProperty(NbCalendarYearCellComponent.prototype, "disabled", {
|
5340 | get: function () {
|
5341 | return this.smallerThanMin() || this.greaterThanMax();
|
5342 | },
|
5343 | enumerable: false,
|
5344 | configurable: true
|
5345 | });
|
5346 | Object.defineProperty(NbCalendarYearCellComponent.prototype, "isLarge", {
|
5347 | get: function () {
|
5348 | return this.size === exports.NbCalendarSize.LARGE;
|
5349 | },
|
5350 | enumerable: false,
|
5351 | configurable: true
|
5352 | });
|
5353 | Object.defineProperty(NbCalendarYearCellComponent.prototype, "year", {
|
5354 | get: function () {
|
5355 | return this.dateService.getYear(this.date);
|
5356 | },
|
5357 | enumerable: false,
|
5358 | configurable: true
|
5359 | });
|
5360 | NbCalendarYearCellComponent.prototype.onClick = function () {
|
5361 | if (this.disabled) {
|
5362 | return;
|
5363 | }
|
5364 | this.select.emit(this.date);
|
5365 | };
|
5366 | NbCalendarYearCellComponent.prototype.smallerThanMin = function () {
|
5367 | return this.date && this.min && this.dateService.compareDates(this.yearEnd(), this.min) < 0;
|
5368 | };
|
5369 | NbCalendarYearCellComponent.prototype.greaterThanMax = function () {
|
5370 | return this.date && this.max && this.dateService.compareDates(this.yearStart(), this.max) > 0;
|
5371 | };
|
5372 | NbCalendarYearCellComponent.prototype.yearStart = function () {
|
5373 | return this.dateService.getYearStart(this.date);
|
5374 | };
|
5375 | NbCalendarYearCellComponent.prototype.yearEnd = function () {
|
5376 | return this.dateService.getYearEnd(this.date);
|
5377 | };
|
5378 | NbCalendarYearCellComponent.decorators = [
|
5379 | { type: i0.Component, args: [{
|
5380 | selector: 'nb-calendar-year-cell',
|
5381 | template: "\n <div class=\"cell-content\">\n {{ year }}\n </div>\n ",
|
5382 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
5383 | },] }
|
5384 | ];
|
5385 | NbCalendarYearCellComponent.ctorParameters = function () { return [
|
5386 | { type: NbDateService }
|
5387 | ]; };
|
5388 | NbCalendarYearCellComponent.propDecorators = {
|
5389 | date: [{ type: i0.Input }],
|
5390 | min: [{ type: i0.Input }],
|
5391 | max: [{ type: i0.Input }],
|
5392 | selectedValue: [{ type: i0.Input }],
|
5393 | size: [{ type: i0.Input }],
|
5394 | select: [{ type: i0.Output }],
|
5395 | selected: [{ type: i0.HostBinding, args: ['class.selected',] }],
|
5396 | today: [{ type: i0.HostBinding, args: ['class.today',] }],
|
5397 | disabled: [{ type: i0.HostBinding, args: ['class.disabled',] }],
|
5398 | isLarge: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
5399 | yearCellClass: [{ type: i0.HostBinding, args: ['class.year-cell',] }],
|
5400 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
5401 | };
|
5402 | return NbCalendarYearCellComponent;
|
5403 | }());
|
5404 |
|
5405 |
|
5406 |
|
5407 |
|
5408 |
|
5409 |
|
5410 | var NbCalendarYearPickerComponent = (function () {
|
5411 | function NbCalendarYearPickerComponent(dateService, yearModelService) {
|
5412 | this.dateService = dateService;
|
5413 | this.yearModelService = yearModelService;
|
5414 | this.cellComponent = NbCalendarYearCellComponent;
|
5415 | this.size = exports.NbCalendarSize.MEDIUM;
|
5416 | this.yearChange = new i0.EventEmitter();
|
5417 | }
|
5418 | Object.defineProperty(NbCalendarYearPickerComponent.prototype, "_cellComponent", {
|
5419 | set: function (cellComponent) {
|
5420 | if (cellComponent) {
|
5421 | this.cellComponent = cellComponent;
|
5422 | }
|
5423 | },
|
5424 | enumerable: false,
|
5425 | configurable: true
|
5426 | });
|
5427 | Object.defineProperty(NbCalendarYearPickerComponent.prototype, "large", {
|
5428 | get: function () {
|
5429 | return this.size === exports.NbCalendarSize.LARGE;
|
5430 | },
|
5431 | enumerable: false,
|
5432 | configurable: true
|
5433 | });
|
5434 | NbCalendarYearPickerComponent.prototype.ngOnChanges = function () {
|
5435 | this.years = this.yearModelService.getViewYears(this.year);
|
5436 | };
|
5437 | NbCalendarYearPickerComponent.prototype.onSelect = function (year) {
|
5438 | this.yearChange.emit(year);
|
5439 | };
|
5440 | NbCalendarYearPickerComponent.decorators = [
|
5441 | { type: i0.Component, args: [{
|
5442 | selector: 'nb-calendar-year-picker',
|
5443 | template: "\n <nb-calendar-picker\n [data]=\"years\"\n [min]=\"min\"\n [max]=\"max\"\n [filter]=\"filter\"\n [selectedValue]=\"date\"\n [visibleDate]=\"year\"\n [cellComponent]=\"cellComponent\"\n [size]=\"size\"\n (select)=\"onSelect($event)\">\n </nb-calendar-picker>\n ",
|
5444 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
5445 | },] }
|
5446 | ];
|
5447 | NbCalendarYearPickerComponent.ctorParameters = function () { return [
|
5448 | { type: NbDateService },
|
5449 | { type: NbCalendarYearModelService }
|
5450 | ]; };
|
5451 | NbCalendarYearPickerComponent.propDecorators = {
|
5452 | date: [{ type: i0.Input }],
|
5453 | min: [{ type: i0.Input }],
|
5454 | max: [{ type: i0.Input }],
|
5455 | filter: [{ type: i0.Input }],
|
5456 | _cellComponent: [{ type: i0.Input, args: ['cellComponent',] }],
|
5457 | size: [{ type: i0.Input }],
|
5458 | year: [{ type: i0.Input }],
|
5459 | yearChange: [{ type: i0.Output }],
|
5460 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }]
|
5461 | };
|
5462 | return NbCalendarYearPickerComponent;
|
5463 | }());
|
5464 |
|
5465 |
|
5466 |
|
5467 |
|
5468 |
|
5469 |
|
5470 | var NbCalendarWeekNumberComponent = (function () {
|
5471 | function NbCalendarWeekNumberComponent(dateService) {
|
5472 | this.dateService = dateService;
|
5473 | }
|
5474 | Object.defineProperty(NbCalendarWeekNumberComponent.prototype, "isLarge", {
|
5475 | get: function () {
|
5476 | return this.size === exports.NbCalendarSize.LARGE;
|
5477 | },
|
5478 | enumerable: false,
|
5479 | configurable: true
|
5480 | });
|
5481 | NbCalendarWeekNumberComponent.prototype.ngOnChanges = function (changes) {
|
5482 | if (changes.weeks) {
|
5483 | this.weekNumbers = this.getWeeks();
|
5484 | }
|
5485 | };
|
5486 | NbCalendarWeekNumberComponent.prototype.getWeeks = function () {
|
5487 | var _this = this;
|
5488 | return this.weeks.map(function (week) {
|
5489 |
|
5490 |
|
5491 | var lastDay = tslib.__spreadArray([], week).reverse().find(function (day) { return !!day; });
|
5492 |
|
5493 |
|
5494 | return _this.dateService.getWeekNumber(lastDay);
|
5495 | });
|
5496 | };
|
5497 | NbCalendarWeekNumberComponent.decorators = [
|
5498 | { type: i0.Component, args: [{
|
5499 | selector: 'nb-calendar-week-numbers',
|
5500 | template: "\n <div class=\"sign-container\">\n <div class=\"sign\">{{ weekNumberSymbol }}</div>\n </div>\n <div class=\"week-number\" *ngFor=\"let weekNumber of weekNumbers\">{{ weekNumber }}</div>\n ",
|
5501 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
5502 | styles: [":host{display:flex;flex-direction:column}\n"]
|
5503 | },] }
|
5504 | ];
|
5505 | NbCalendarWeekNumberComponent.ctorParameters = function () { return [
|
5506 | { type: NbDateService }
|
5507 | ]; };
|
5508 | NbCalendarWeekNumberComponent.propDecorators = {
|
5509 | weeks: [{ type: i0.Input }],
|
5510 | size: [{ type: i0.Input }],
|
5511 | weekNumberSymbol: [{ type: i0.Input }],
|
5512 | isLarge: [{ type: i0.HostBinding, args: ['class.size-large',] }]
|
5513 | };
|
5514 | return NbCalendarWeekNumberComponent;
|
5515 | }());
|
5516 |
|
5517 |
|
5518 |
|
5519 |
|
5520 |
|
5521 |
|
5522 |
|
5523 |
|
5524 |
|
5525 |
|
5526 | var NbNativeDateService = (function (_super) {
|
5527 | tslib.__extends(NbNativeDateService, _super);
|
5528 | function NbNativeDateService(locale) {
|
5529 | var _this = _super.call(this) || this;
|
5530 | _this.setLocale(locale);
|
5531 | return _this;
|
5532 | }
|
5533 | NbNativeDateService.prototype.setLocale = function (locale) {
|
5534 | _super.prototype.setLocale.call(this, locale);
|
5535 | this.datePipe = new _angular_common.DatePipe(locale);
|
5536 | };
|
5537 | NbNativeDateService.prototype.setHours = function (date, hour) {
|
5538 | var result = this.clone(date);
|
5539 | result.setHours(hour);
|
5540 | return result;
|
5541 | };
|
5542 | NbNativeDateService.prototype.setMinutes = function (date, minute) {
|
5543 | var result = this.clone(date);
|
5544 | result.setMinutes(minute);
|
5545 | return result;
|
5546 | };
|
5547 | NbNativeDateService.prototype.setSeconds = function (date, second) {
|
5548 | var result = this.clone(date);
|
5549 | result.setSeconds(second);
|
5550 | return result;
|
5551 | };
|
5552 | NbNativeDateService.prototype.setMilliseconds = function (date, second) {
|
5553 | var result = this.clone(date);
|
5554 | result.setMilliseconds(second);
|
5555 | return result;
|
5556 | };
|
5557 | NbNativeDateService.prototype.isValidDateString = function (date, format) {
|
5558 | return !isNaN(this.parse(date, format).getTime());
|
5559 | };
|
5560 | NbNativeDateService.prototype.isValidTimeString = function (date, format) {
|
5561 | return this.isValidDateString(date, format);
|
5562 | };
|
5563 | NbNativeDateService.prototype.today = function () {
|
5564 | return new Date();
|
5565 | };
|
5566 | NbNativeDateService.prototype.getLocaleTimeFormat = function () {
|
5567 | return _angular_common.getLocaleTimeFormat(this.locale, _angular_common.FormatWidth.Short);
|
5568 | };
|
5569 | NbNativeDateService.prototype.getDate = function (date) {
|
5570 | return date.getDate();
|
5571 | };
|
5572 | NbNativeDateService.prototype.getMonth = function (date) {
|
5573 | return date.getMonth();
|
5574 | };
|
5575 | NbNativeDateService.prototype.getYear = function (date) {
|
5576 | return date.getFullYear();
|
5577 | };
|
5578 | NbNativeDateService.prototype.getDayOfWeek = function (date) {
|
5579 | return date.getDay();
|
5580 | };
|
5581 | |
5582 |
|
5583 |
|
5584 |
|
5585 | NbNativeDateService.prototype.getFirstDayOfWeek = function () {
|
5586 | return _angular_common.getLocaleFirstDayOfWeek(this.locale);
|
5587 | };
|
5588 | NbNativeDateService.prototype.getMonthName = function (date, style$$1) {
|
5589 | if (style$$1 === void 0) { style$$1 = _angular_common.TranslationWidth.Abbreviated; }
|
5590 | var index = date.getMonth();
|
5591 | return this.getMonthNameByIndex(index, style$$1);
|
5592 | };
|
5593 | NbNativeDateService.prototype.getMonthNameByIndex = function (index, style$$1) {
|
5594 | if (style$$1 === void 0) { style$$1 = _angular_common.TranslationWidth.Abbreviated; }
|
5595 | return _angular_common.getLocaleMonthNames(this.locale, _angular_common.FormStyle.Format, style$$1)[index];
|
5596 | };
|
5597 | NbNativeDateService.prototype.getDayOfWeekNames = function () {
|
5598 | return tslib.__spreadArray([], _angular_common.getLocaleDayNames(this.locale, _angular_common.FormStyle.Format, _angular_common.TranslationWidth.Short));
|
5599 | };
|
5600 | NbNativeDateService.prototype.format = function (date, format) {
|
5601 | return this.datePipe.transform(date, format);
|
5602 | };
|
5603 | |
5604 |
|
5605 |
|
5606 | NbNativeDateService.prototype.parse = function (date, format) {
|
5607 | return new Date(Date.parse(date));
|
5608 | };
|
5609 | NbNativeDateService.prototype.addDay = function (date, num) {
|
5610 | return this.createDate(date.getFullYear(), date.getMonth(), date.getDate() + num);
|
5611 | };
|
5612 | NbNativeDateService.prototype.addMonth = function (date, num) {
|
5613 | var month = this.createDate(date.getFullYear(), date.getMonth() + num, 1);
|
5614 |
|
5615 |
|
5616 | month.setDate(Math.min(date.getDate(), this.getMonthEnd(month).getDate()));
|
5617 | return month;
|
5618 | };
|
5619 | NbNativeDateService.prototype.addMinutes = function (date, minute) {
|
5620 | var result = new Date(date);
|
5621 | result.setMinutes(date.getMinutes() + minute);
|
5622 | return result;
|
5623 | };
|
5624 | NbNativeDateService.prototype.addHours = function (date, hour) {
|
5625 | var result = new Date(date);
|
5626 | result.setHours(date.getHours() + hour);
|
5627 | return result;
|
5628 | };
|
5629 | NbNativeDateService.prototype.getHours = function (date) {
|
5630 | return date.getHours();
|
5631 | };
|
5632 | NbNativeDateService.prototype.getMinutes = function (date) {
|
5633 | return date.getMinutes();
|
5634 | };
|
5635 | NbNativeDateService.prototype.getSeconds = function (date) {
|
5636 | return date.getSeconds();
|
5637 | };
|
5638 | NbNativeDateService.prototype.getMilliseconds = function (date) {
|
5639 | return date.getMilliseconds();
|
5640 | };
|
5641 | NbNativeDateService.prototype.addYear = function (date, num) {
|
5642 | return this.createDate(date.getFullYear() + num, date.getMonth(), date.getDate());
|
5643 | };
|
5644 | NbNativeDateService.prototype.clone = function (date) {
|
5645 | return new Date(date.getTime());
|
5646 | };
|
5647 | NbNativeDateService.prototype.compareDates = function (date1, date2) {
|
5648 | return date1.getTime() - date2.getTime();
|
5649 | };
|
5650 | NbNativeDateService.prototype.createDate = function (year, month, date) {
|
5651 | var result = new Date(year, month, date);
|
5652 |
|
5653 |
|
5654 | if (year >= 0 && year < 100) {
|
5655 | result.setFullYear(result.getFullYear() - 1900);
|
5656 | }
|
5657 | return result;
|
5658 | };
|
5659 | NbNativeDateService.prototype.getMonthEnd = function (date) {
|
5660 | return this.createDate(date.getFullYear(), date.getMonth() + 1, 0);
|
5661 | };
|
5662 | NbNativeDateService.prototype.getMonthStart = function (date) {
|
5663 | return this.createDate(date.getFullYear(), date.getMonth(), 1);
|
5664 | };
|
5665 | NbNativeDateService.prototype.getNumberOfDaysInMonth = function (date) {
|
5666 | return this.getMonthEnd(date).getDate();
|
5667 | };
|
5668 | NbNativeDateService.prototype.getYearEnd = function (date) {
|
5669 | return this.createDate(date.getFullYear(), 11, 31);
|
5670 | };
|
5671 | NbNativeDateService.prototype.getYearStart = function (date) {
|
5672 | return this.createDate(date.getFullYear(), 0, 1);
|
5673 | };
|
5674 | NbNativeDateService.prototype.valueOf = function (date) {
|
5675 | return date.valueOf();
|
5676 | };
|
5677 | NbNativeDateService.prototype.isSameDay = function (date1, date2) {
|
5678 | return this.isSameMonth(date1, date2) &&
|
5679 | date1.getDate() === date2.getDate();
|
5680 | };
|
5681 | NbNativeDateService.prototype.isSameMonth = function (date1, date2) {
|
5682 | return this.isSameYear(date1, date2) &&
|
5683 | date1.getMonth() === date2.getMonth();
|
5684 | };
|
5685 | NbNativeDateService.prototype.isSameYear = function (date1, date2) {
|
5686 | return date1.getFullYear() === date2.getFullYear();
|
5687 | };
|
5688 | NbNativeDateService.prototype.getId = function () {
|
5689 | return 'native';
|
5690 | };
|
5691 | NbNativeDateService.prototype.getWeekNumber = function (date) {
|
5692 | return parseInt(this.datePipe.transform(date, 'w'), 10);
|
5693 | };
|
5694 | NbNativeDateService.prototype.getDateFormat = function () {
|
5695 | return 'yyyy-MM-dd';
|
5696 | };
|
5697 | NbNativeDateService.prototype.getTwelveHoursFormat = function () {
|
5698 | return 'hh:mm a';
|
5699 | };
|
5700 | NbNativeDateService.decorators = [
|
5701 | { type: i0.Injectable }
|
5702 | ];
|
5703 | NbNativeDateService.ctorParameters = function () { return [
|
5704 | { type: String, decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] }
|
5705 | ]; };
|
5706 | return NbNativeDateService;
|
5707 | }(NbDateService));
|
5708 |
|
5709 | var NbCalendarTimeModelService = (function () {
|
5710 | function NbCalendarTimeModelService(dateService) {
|
5711 | this.dateService = dateService;
|
5712 | this.MINUTES_AND_SECONDS = 60;
|
5713 | }
|
5714 | NbCalendarTimeModelService.prototype.getHoursRange = function (step) {
|
5715 | if (step === void 0) { step = this.MINUTES_AND_SECONDS; }
|
5716 | var date = this.getResetTime();
|
5717 | var endDate = this.dateService.addDay(date, 1);
|
5718 | var result = [];
|
5719 | while (this.dateService.compareDates(date, endDate) < 0) {
|
5720 | result.push(date);
|
5721 | date = this.dateService.addMinutes(date, step);
|
5722 | }
|
5723 | return result;
|
5724 | };
|
5725 | NbCalendarTimeModelService.prototype.getResetTime = function () {
|
5726 | var today = this.dateService.today();
|
5727 | today = this.dateService.setHours(today, 0);
|
5728 | today = this.dateService.setMinutes(today, 0);
|
5729 | today = this.dateService.setSeconds(today, 0);
|
5730 | today = this.dateService.setMilliseconds(today, 0);
|
5731 | return today;
|
5732 | };
|
5733 | NbCalendarTimeModelService.prototype.paddToTwoSymbols = function (n) {
|
5734 | if (n < 10) {
|
5735 | return '0' + n;
|
5736 | }
|
5737 | return n.toString();
|
5738 | };
|
5739 | NbCalendarTimeModelService.prototype.buildDateFormat = function (twelveHoursFormat, withSeconds) {
|
5740 | if (withSeconds === void 0) { withSeconds = false; }
|
5741 | if (twelveHoursFormat) {
|
5742 | return this.dateService.getDateFormat() + " " + this.dateService.getTwelveHoursFormat();
|
5743 | }
|
5744 | if (withSeconds) {
|
5745 | return this.dateService.getDateFormat() + " " + this.dateService.getTwentyFourHoursFormatWithSeconds();
|
5746 | }
|
5747 | return this.dateService.getDateFormat() + " " + this.dateService.getTwentyFourHoursFormat();
|
5748 | };
|
5749 | NbCalendarTimeModelService.decorators = [
|
5750 | { type: i0.Injectable }
|
5751 | ];
|
5752 | NbCalendarTimeModelService.ctorParameters = function () { return [
|
5753 | { type: NbDateService }
|
5754 | ]; };
|
5755 | return NbCalendarTimeModelService;
|
5756 | }());
|
5757 |
|
5758 | var NbCalendarActionsComponent = (function () {
|
5759 | function NbCalendarActionsComponent() {
|
5760 | this._applyButtonText = 'ok';
|
5761 | this._currentTimeButtonText = 'now';
|
5762 | this.setCurrentTime = new i0.EventEmitter();
|
5763 | this.saveValue = new i0.EventEmitter();
|
5764 | }
|
5765 | Object.defineProperty(NbCalendarActionsComponent.prototype, "applyButtonText", {
|
5766 | set: function (value) {
|
5767 | if (value) {
|
5768 | this._applyButtonText = value;
|
5769 | }
|
5770 | },
|
5771 | enumerable: false,
|
5772 | configurable: true
|
5773 | });
|
5774 |
|
5775 | Object.defineProperty(NbCalendarActionsComponent.prototype, "applyText", {
|
5776 | get: function () {
|
5777 | return this._applyButtonText;
|
5778 | },
|
5779 | enumerable: false,
|
5780 | configurable: true
|
5781 | });
|
5782 |
|
5783 | Object.defineProperty(NbCalendarActionsComponent.prototype, "currentTimeButtonText", {
|
5784 | set: function (value) {
|
5785 | if (value) {
|
5786 | this._currentTimeButtonText = value;
|
5787 | }
|
5788 | },
|
5789 | enumerable: false,
|
5790 | configurable: true
|
5791 | });
|
5792 | Object.defineProperty(NbCalendarActionsComponent.prototype, "currentTimeText", {
|
5793 | get: function () {
|
5794 | return this._currentTimeButtonText;
|
5795 | },
|
5796 | enumerable: false,
|
5797 | configurable: true
|
5798 | });
|
5799 |
|
5800 | NbCalendarActionsComponent.decorators = [
|
5801 | { type: i0.Component, args: [{
|
5802 | selector: 'nb-calendar-actions',
|
5803 | template: "\n <button\n nbButton\n ghost\n status=\"primary\"\n size=\"small\"\n (click)=\"setCurrentTime.emit()\">\n {{ currentTimeText }}</button>\n <button\n nbButton\n status=\"primary\"\n size=\"small\"\n (click)=\"saveValue.emit()\">\n {{ applyText }}</button>\n ",
|
5804 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
5805 | styles: [":host{display:flex;justify-content:space-between}\n"]
|
5806 | },] }
|
5807 | ];
|
5808 | NbCalendarActionsComponent.propDecorators = {
|
5809 | applyButtonText: [{ type: i0.Input }],
|
5810 | currentTimeButtonText: [{ type: i0.Input }],
|
5811 | setCurrentTime: [{ type: i0.Output }],
|
5812 | saveValue: [{ type: i0.Output }]
|
5813 | };
|
5814 | return NbCalendarActionsComponent;
|
5815 | }());
|
5816 |
|
5817 |
|
5818 |
|
5819 |
|
5820 |
|
5821 |
|
5822 | var SERVICES = [
|
5823 | { provide: NbDateService, useClass: NbNativeDateService },
|
5824 | _angular_common.DatePipe,
|
5825 | NbCalendarMonthModelService,
|
5826 | NbCalendarYearModelService,
|
5827 | NbCalendarTimeModelService,
|
5828 | ];
|
5829 | var COMPONENTS = [
|
5830 | NbCalendarViewModeComponent,
|
5831 | NbCalendarPageableNavigationComponent,
|
5832 | NbCalendarDaysNamesComponent,
|
5833 | NbCalendarYearPickerComponent,
|
5834 | NbCalendarMonthPickerComponent,
|
5835 | NbCalendarDayPickerComponent,
|
5836 | NbCalendarDayCellComponent,
|
5837 | NbCalendarActionsComponent,
|
5838 | NbCalendarMonthCellComponent,
|
5839 | NbCalendarYearCellComponent,
|
5840 | NbCalendarPickerRowComponent,
|
5841 | NbCalendarPickerComponent,
|
5842 | NbCalendarWeekNumberComponent,
|
5843 | ];
|
5844 |
|
5845 |
|
5846 |
|
5847 |
|
5848 |
|
5849 |
|
5850 |
|
5851 |
|
5852 |
|
5853 |
|
5854 |
|
5855 |
|
5856 |
|
5857 |
|
5858 |
|
5859 |
|
5860 |
|
5861 | var NbCalendarKitModule = (function () {
|
5862 | function NbCalendarKitModule() {
|
5863 | }
|
5864 | NbCalendarKitModule.decorators = [
|
5865 | { type: i0.NgModule, args: [{
|
5866 | imports: [NbSharedModule, NbButtonModule, NbIconModule],
|
5867 | exports: tslib.__spreadArray([], COMPONENTS),
|
5868 | declarations: tslib.__spreadArray([], COMPONENTS),
|
5869 | providers: tslib.__spreadArray([], SERVICES),
|
5870 | entryComponents: [
|
5871 | NbCalendarDayCellComponent,
|
5872 | NbCalendarMonthCellComponent,
|
5873 | NbCalendarYearCellComponent,
|
5874 | ],
|
5875 | },] }
|
5876 | ];
|
5877 | return NbCalendarKitModule;
|
5878 | }());
|
5879 |
|
5880 |
|
5881 |
|
5882 |
|
5883 |
|
5884 |
|
5885 |
|
5886 |
|
5887 |
|
5888 |
|
5889 |
|
5890 | var NbBaseCalendarComponent = (function () {
|
5891 | function NbBaseCalendarComponent(dateService, yearModelService) {
|
5892 | this.dateService = dateService;
|
5893 | this.yearModelService = yearModelService;
|
5894 | |
5895 |
|
5896 |
|
5897 |
|
5898 | this.boundingMonth = true;
|
5899 | |
5900 |
|
5901 |
|
5902 | this.activeViewMode = exports.NbCalendarViewMode.DATE;
|
5903 | |
5904 |
|
5905 |
|
5906 |
|
5907 | this.size = exports.NbCalendarSize.MEDIUM;
|
5908 | |
5909 |
|
5910 |
|
5911 | this.showNavigation = true;
|
5912 | this._showWeekNumber = false;
|
5913 | |
5914 |
|
5915 |
|
5916 | this.dateChange = new i0.EventEmitter();
|
5917 | this.ViewMode = exports.NbCalendarViewMode;
|
5918 | }
|
5919 | Object.defineProperty(NbBaseCalendarComponent.prototype, "showWeekNumber", {
|
5920 | |
5921 |
|
5922 |
|
5923 |
|
5924 | get: function () {
|
5925 | return this._showWeekNumber;
|
5926 | },
|
5927 | set: function (value) {
|
5928 | this._showWeekNumber = convertToBoolProperty(value);
|
5929 | },
|
5930 | enumerable: false,
|
5931 | configurable: true
|
5932 | });
|
5933 | NbBaseCalendarComponent.prototype.ngOnInit = function () {
|
5934 | if (!this.visibleDate) {
|
5935 | this.visibleDate = this.dateService.today();
|
5936 | }
|
5937 | };
|
5938 | Object.defineProperty(NbBaseCalendarComponent.prototype, "large", {
|
5939 | get: function () {
|
5940 | return this.size === exports.NbCalendarSize.LARGE;
|
5941 | },
|
5942 | enumerable: false,
|
5943 | configurable: true
|
5944 | });
|
5945 | NbBaseCalendarComponent.prototype.setViewMode = function (viewMode) {
|
5946 | this.activeViewMode = viewMode;
|
5947 | };
|
5948 | NbBaseCalendarComponent.prototype.setVisibleDate = function (visibleDate) {
|
5949 | this.visibleDate = visibleDate;
|
5950 | };
|
5951 | NbBaseCalendarComponent.prototype.prevMonth = function () {
|
5952 | this.changeVisibleMonth(-1);
|
5953 | };
|
5954 | NbBaseCalendarComponent.prototype.nextMonth = function () {
|
5955 | this.changeVisibleMonth(1);
|
5956 | };
|
5957 | NbBaseCalendarComponent.prototype.prevYear = function () {
|
5958 | this.changeVisibleYear(-1);
|
5959 | };
|
5960 | NbBaseCalendarComponent.prototype.nextYear = function () {
|
5961 | this.changeVisibleYear(1);
|
5962 | };
|
5963 | NbBaseCalendarComponent.prototype.prevYears = function () {
|
5964 | this.changeVisibleYears(-1);
|
5965 | };
|
5966 | NbBaseCalendarComponent.prototype.nextYears = function () {
|
5967 | this.changeVisibleYears(1);
|
5968 | };
|
5969 | NbBaseCalendarComponent.prototype.navigatePrev = function () {
|
5970 | switch (this.activeViewMode) {
|
5971 | case exports.NbCalendarViewMode.DATE:
|
5972 | return this.prevMonth();
|
5973 | case exports.NbCalendarViewMode.MONTH:
|
5974 | return this.prevYear();
|
5975 | case exports.NbCalendarViewMode.YEAR:
|
5976 | return this.prevYears();
|
5977 | }
|
5978 | };
|
5979 | NbBaseCalendarComponent.prototype.navigateNext = function () {
|
5980 | switch (this.activeViewMode) {
|
5981 | case exports.NbCalendarViewMode.DATE:
|
5982 | return this.nextMonth();
|
5983 | case exports.NbCalendarViewMode.MONTH:
|
5984 | return this.nextYear();
|
5985 | case exports.NbCalendarViewMode.YEAR:
|
5986 | return this.nextYears();
|
5987 | }
|
5988 | };
|
5989 | NbBaseCalendarComponent.prototype.onChangeViewMode = function () {
|
5990 | if (this.activeViewMode === exports.NbCalendarViewMode.DATE) {
|
5991 | return this.setViewMode(exports.NbCalendarViewMode.YEAR);
|
5992 | }
|
5993 | this.setViewMode(exports.NbCalendarViewMode.DATE);
|
5994 | };
|
5995 | NbBaseCalendarComponent.prototype.changeVisibleMonth = function (direction) {
|
5996 | this.visibleDate = this.dateService.addMonth(this.visibleDate, direction);
|
5997 | };
|
5998 | NbBaseCalendarComponent.prototype.changeVisibleYear = function (direction) {
|
5999 | this.visibleDate = this.dateService.addYear(this.visibleDate, direction);
|
6000 | };
|
6001 | NbBaseCalendarComponent.prototype.changeVisibleYears = function (direction) {
|
6002 | this.visibleDate = this.dateService.addYear(this.visibleDate, direction * this.yearModelService.getYearsInView());
|
6003 | };
|
6004 | NbBaseCalendarComponent.decorators = [
|
6005 | { type: i0.Component, args: [{
|
6006 | selector: 'nb-base-calendar',
|
6007 | template: "<nb-card>\n <nb-card-header *ngIf=\"showNavigation\" class=\"calendar-navigation\">\n <nb-calendar-view-mode [date]=\"visibleDate\"\n [viewMode]=\"activeViewMode\"\n (changeMode)=\"onChangeViewMode()\">\n </nb-calendar-view-mode>\n\n <nb-calendar-pageable-navigation (prev)=\"navigatePrev()\" (next)=\"navigateNext()\">\n </nb-calendar-pageable-navigation>\n </nb-card-header>\n\n <nb-card-body [ngSwitch]=\"activeViewMode\">\n\n <nb-calendar-day-picker *ngSwitchCase=\"ViewMode.DATE\"\n [boundingMonths]=\"boundingMonth\"\n [cellComponent]=\"dayCellComponent\"\n [min]=\"min\"\n [max]=\"max\"\n [filter]=\"filter\"\n [visibleDate]=\"visibleDate\"\n [size]=\"size\"\n [date]=\"date\"\n [showWeekNumber]=\"showWeekNumber\"\n (dateChange)=\"dateChange.emit($any($event))\"\n [weekNumberSymbol]=\"weekNumberSymbol\">\n </nb-calendar-day-picker>\n\n <nb-calendar-year-picker *ngSwitchCase=\"ViewMode.YEAR\"\n [cellComponent]=\"yearCellComponent\"\n [date]=\"$any(date)\"\n [min]=\"min\"\n [max]=\"max\"\n [filter]=\"filter\"\n [size]=\"size\"\n [year]=\"visibleDate\"\n (yearChange)=\"setVisibleDate($event); setViewMode(ViewMode.MONTH)\">\n </nb-calendar-year-picker>\n\n <nb-calendar-month-picker *ngSwitchCase=\"ViewMode.MONTH\"\n [cellComponent]=\"monthCellComponent\"\n [min]=\"min\"\n [max]=\"max\"\n [filter]=\"filter\"\n [size]=\"size\"\n [month]=\"visibleDate\"\n [date]=\"$any(date)\"\n (monthChange)=\"setVisibleDate($event); setViewMode(ViewMode.DATE)\">\n </nb-calendar-month-picker>\n\n </nb-card-body>\n\n</nb-card>\n"
|
6008 | },] }
|
6009 | ];
|
6010 | NbBaseCalendarComponent.ctorParameters = function () { return [
|
6011 | { type: NbDateService },
|
6012 | { type: NbCalendarYearModelService }
|
6013 | ]; };
|
6014 | NbBaseCalendarComponent.propDecorators = {
|
6015 | boundingMonth: [{ type: i0.Input }],
|
6016 | activeViewMode: [{ type: i0.Input, args: ['startView',] }],
|
6017 | min: [{ type: i0.Input }],
|
6018 | max: [{ type: i0.Input }],
|
6019 | filter: [{ type: i0.Input }],
|
6020 | dayCellComponent: [{ type: i0.Input }],
|
6021 | monthCellComponent: [{ type: i0.Input }],
|
6022 | yearCellComponent: [{ type: i0.Input }],
|
6023 | size: [{ type: i0.Input }],
|
6024 | visibleDate: [{ type: i0.Input }],
|
6025 | showNavigation: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.has-navigation',] }],
|
6026 | date: [{ type: i0.Input }],
|
6027 | showWeekNumber: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.has-week-number',] }],
|
6028 | weekNumberSymbol: [{ type: i0.Input }],
|
6029 | dateChange: [{ type: i0.Output }],
|
6030 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }]
|
6031 | };
|
6032 | return NbBaseCalendarComponent;
|
6033 | }());
|
6034 |
|
6035 |
|
6036 |
|
6037 |
|
6038 |
|
6039 |
|
6040 | var NbBaseCalendarModule = (function () {
|
6041 | function NbBaseCalendarModule() {
|
6042 | }
|
6043 | NbBaseCalendarModule.decorators = [
|
6044 | { type: i0.NgModule, args: [{
|
6045 | imports: [NbCalendarKitModule, NbSharedModule, NbCardModule],
|
6046 | exports: [NbBaseCalendarComponent],
|
6047 | declarations: [NbBaseCalendarComponent],
|
6048 | },] }
|
6049 | ];
|
6050 | return NbBaseCalendarModule;
|
6051 | }());
|
6052 |
|
6053 |
|
6054 |
|
6055 |
|
6056 |
|
6057 |
|
6058 | var NbCalendarModule = (function () {
|
6059 | function NbCalendarModule() {
|
6060 | }
|
6061 | NbCalendarModule.decorators = [
|
6062 | { type: i0.NgModule, args: [{
|
6063 | imports: [NbBaseCalendarModule],
|
6064 | exports: [NbCalendarComponent],
|
6065 | declarations: [NbCalendarComponent],
|
6066 | },] }
|
6067 | ];
|
6068 | return NbCalendarModule;
|
6069 | }());
|
6070 |
|
6071 |
|
6072 |
|
6073 |
|
6074 |
|
6075 |
|
6076 | var NbBaseCalendarRangeCell = (function () {
|
6077 | function NbBaseCalendarRangeCell() {
|
6078 | }
|
6079 | Object.defineProperty(NbBaseCalendarRangeCell.prototype, "hasRange", {
|
6080 | get: function () {
|
6081 | return !!(this.selectedValue && this.selectedValue.start && this.selectedValue.end);
|
6082 | },
|
6083 | enumerable: false,
|
6084 | configurable: true
|
6085 | });
|
6086 | return NbBaseCalendarRangeCell;
|
6087 | }());
|
6088 |
|
6089 |
|
6090 |
|
6091 |
|
6092 |
|
6093 |
|
6094 | var NbCalendarRangeDayCellComponent = (function (_super) {
|
6095 | tslib.__extends(NbCalendarRangeDayCellComponent, _super);
|
6096 | function NbCalendarRangeDayCellComponent(dateService) {
|
6097 | var _this = _super.call(this) || this;
|
6098 | _this.dateService = dateService;
|
6099 | _this.size = exports.NbCalendarSize.MEDIUM;
|
6100 | _this.select = new i0.EventEmitter(true);
|
6101 | _this.rangeCellClass = true;
|
6102 | _this.dayCellClass = true;
|
6103 | return _this;
|
6104 | }
|
6105 | Object.defineProperty(NbCalendarRangeDayCellComponent.prototype, "inRange", {
|
6106 | get: function () {
|
6107 | if (this.date && this.hasRange) {
|
6108 | return this.isInRange(this.date, this.selectedValue);
|
6109 | }
|
6110 | return false;
|
6111 | },
|
6112 | enumerable: false,
|
6113 | configurable: true
|
6114 | });
|
6115 | Object.defineProperty(NbCalendarRangeDayCellComponent.prototype, "start", {
|
6116 | get: function () {
|
6117 | return this.date && this.hasRange && this.dateService.isSameDay(this.date, this.selectedValue.start);
|
6118 | },
|
6119 | enumerable: false,
|
6120 | configurable: true
|
6121 | });
|
6122 | Object.defineProperty(NbCalendarRangeDayCellComponent.prototype, "end", {
|
6123 | get: function () {
|
6124 | return this.date && this.hasRange && this.dateService.isSameDay(this.date, this.selectedValue.end);
|
6125 | },
|
6126 | enumerable: false,
|
6127 | configurable: true
|
6128 | });
|
6129 | Object.defineProperty(NbCalendarRangeDayCellComponent.prototype, "today", {
|
6130 | get: function () {
|
6131 | return this.date && this.dateService.isSameDay(this.date, this.dateService.today());
|
6132 | },
|
6133 | enumerable: false,
|
6134 | configurable: true
|
6135 | });
|
6136 | Object.defineProperty(NbCalendarRangeDayCellComponent.prototype, "boundingMonth", {
|
6137 | get: function () {
|
6138 | return !this.dateService.isSameMonthSafe(this.date, this.visibleDate);
|
6139 | },
|
6140 | enumerable: false,
|
6141 | configurable: true
|
6142 | });
|
6143 | Object.defineProperty(NbCalendarRangeDayCellComponent.prototype, "selected", {
|
6144 | get: function () {
|
6145 | if (this.inRange) {
|
6146 | return true;
|
6147 | }
|
6148 | if (this.selectedValue) {
|
6149 | return this.dateService.isSameDaySafe(this.date, this.selectedValue.start);
|
6150 | }
|
6151 | },
|
6152 | enumerable: false,
|
6153 | configurable: true
|
6154 | });
|
6155 | Object.defineProperty(NbCalendarRangeDayCellComponent.prototype, "empty", {
|
6156 | get: function () {
|
6157 | return !this.date;
|
6158 | },
|
6159 | enumerable: false,
|
6160 | configurable: true
|
6161 | });
|
6162 | Object.defineProperty(NbCalendarRangeDayCellComponent.prototype, "disabled", {
|
6163 | get: function () {
|
6164 | return this.smallerThanMin() || this.greaterThanMax() || this.dontFitFilter();
|
6165 | },
|
6166 | enumerable: false,
|
6167 | configurable: true
|
6168 | });
|
6169 | Object.defineProperty(NbCalendarRangeDayCellComponent.prototype, "isLarge", {
|
6170 | get: function () {
|
6171 | return this.size === exports.NbCalendarSize.LARGE;
|
6172 | },
|
6173 | enumerable: false,
|
6174 | configurable: true
|
6175 | });
|
6176 | Object.defineProperty(NbCalendarRangeDayCellComponent.prototype, "day", {
|
6177 | get: function () {
|
6178 | return this.date && this.dateService.getDate(this.date);
|
6179 | },
|
6180 | enumerable: false,
|
6181 | configurable: true
|
6182 | });
|
6183 | NbCalendarRangeDayCellComponent.prototype.onClick = function () {
|
6184 | if (this.disabled || this.empty) {
|
6185 | return;
|
6186 | }
|
6187 | this.select.emit(this.date);
|
6188 | };
|
6189 | NbCalendarRangeDayCellComponent.prototype.smallerThanMin = function () {
|
6190 | return this.date && this.min && this.dateService.compareDates(this.date, this.min) < 0;
|
6191 | };
|
6192 | NbCalendarRangeDayCellComponent.prototype.greaterThanMax = function () {
|
6193 | return this.date && this.max && this.dateService.compareDates(this.date, this.max) > 0;
|
6194 | };
|
6195 | NbCalendarRangeDayCellComponent.prototype.dontFitFilter = function () {
|
6196 | return this.date && this.filter && !this.filter(this.date);
|
6197 | };
|
6198 | NbCalendarRangeDayCellComponent.prototype.isInRange = function (date, _a) {
|
6199 | var start = _a.start, end = _a.end;
|
6200 | var isGreaterThanStart = this.dateService.compareDates(this.date, start) >= 0;
|
6201 | var isLessThanEnd = this.dateService.compareDates(this.date, end) <= 0;
|
6202 | return isGreaterThanStart && isLessThanEnd;
|
6203 | };
|
6204 | NbCalendarRangeDayCellComponent.decorators = [
|
6205 | { type: i0.Component, args: [{
|
6206 | selector: 'nb-calendar-range-day-cell',
|
6207 | template: "\n <div class=\"cell-content\">{{ day }}</div>\n ",
|
6208 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
6209 | },] }
|
6210 | ];
|
6211 | NbCalendarRangeDayCellComponent.ctorParameters = function () { return [
|
6212 | { type: NbDateService }
|
6213 | ]; };
|
6214 | NbCalendarRangeDayCellComponent.propDecorators = {
|
6215 | date: [{ type: i0.Input }],
|
6216 | selectedValue: [{ type: i0.Input }],
|
6217 | visibleDate: [{ type: i0.Input }],
|
6218 | min: [{ type: i0.Input }],
|
6219 | max: [{ type: i0.Input }],
|
6220 | filter: [{ type: i0.Input }],
|
6221 | size: [{ type: i0.Input }],
|
6222 | select: [{ type: i0.Output }],
|
6223 | inRange: [{ type: i0.HostBinding, args: ['class.in-range',] }],
|
6224 | start: [{ type: i0.HostBinding, args: ['class.start',] }],
|
6225 | end: [{ type: i0.HostBinding, args: ['class.end',] }],
|
6226 | rangeCellClass: [{ type: i0.HostBinding, args: ['class.range-cell',] }],
|
6227 | dayCellClass: [{ type: i0.HostBinding, args: ['class.day-cell',] }],
|
6228 | today: [{ type: i0.HostBinding, args: ['class.today',] }],
|
6229 | boundingMonth: [{ type: i0.HostBinding, args: ['class.bounding-month',] }],
|
6230 | selected: [{ type: i0.HostBinding, args: ['class.selected',] }],
|
6231 | empty: [{ type: i0.HostBinding, args: ['class.empty',] }],
|
6232 | disabled: [{ type: i0.HostBinding, args: ['class.disabled',] }],
|
6233 | isLarge: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
6234 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
6235 | };
|
6236 | return NbCalendarRangeDayCellComponent;
|
6237 | }(NbBaseCalendarRangeCell));
|
6238 |
|
6239 |
|
6240 |
|
6241 |
|
6242 |
|
6243 |
|
6244 | var NbCalendarRangeYearCellComponent = (function (_super) {
|
6245 | tslib.__extends(NbCalendarRangeYearCellComponent, _super);
|
6246 | function NbCalendarRangeYearCellComponent(dateService) {
|
6247 | var _this = _super.call(this) || this;
|
6248 | _this.dateService = dateService;
|
6249 | _this.size = exports.NbCalendarSize.MEDIUM;
|
6250 | _this.select = new i0.EventEmitter(true);
|
6251 | _this.yearCellClass = true;
|
6252 | _this.rangeCellClass = true;
|
6253 | return _this;
|
6254 | }
|
6255 | Object.defineProperty(NbCalendarRangeYearCellComponent.prototype, "inRange", {
|
6256 | get: function () {
|
6257 | return this.hasRange && this.isInRange(this.date, this.selectedValue);
|
6258 | },
|
6259 | enumerable: false,
|
6260 | configurable: true
|
6261 | });
|
6262 | Object.defineProperty(NbCalendarRangeYearCellComponent.prototype, "rangeStart", {
|
6263 | get: function () {
|
6264 | return this.hasRange && this.dateService.isSameYear(this.date, this.selectedValue.start);
|
6265 | },
|
6266 | enumerable: false,
|
6267 | configurable: true
|
6268 | });
|
6269 | Object.defineProperty(NbCalendarRangeYearCellComponent.prototype, "rangeEnd", {
|
6270 | get: function () {
|
6271 | return this.hasRange && this.dateService.isSameYear(this.date, this.selectedValue.end);
|
6272 | },
|
6273 | enumerable: false,
|
6274 | configurable: true
|
6275 | });
|
6276 | Object.defineProperty(NbCalendarRangeYearCellComponent.prototype, "selected", {
|
6277 | get: function () {
|
6278 | if (this.inRange) {
|
6279 | return true;
|
6280 | }
|
6281 | if (this.selectedValue) {
|
6282 | return this.dateService.isSameYearSafe(this.date, this.selectedValue.start);
|
6283 | }
|
6284 | },
|
6285 | enumerable: false,
|
6286 | configurable: true
|
6287 | });
|
6288 | Object.defineProperty(NbCalendarRangeYearCellComponent.prototype, "today", {
|
6289 | get: function () {
|
6290 | return this.dateService.isSameYear(this.date, this.dateService.today());
|
6291 | },
|
6292 | enumerable: false,
|
6293 | configurable: true
|
6294 | });
|
6295 | Object.defineProperty(NbCalendarRangeYearCellComponent.prototype, "disabled", {
|
6296 | get: function () {
|
6297 | return this.smallerThanMin() || this.greaterThanMax();
|
6298 | },
|
6299 | enumerable: false,
|
6300 | configurable: true
|
6301 | });
|
6302 | Object.defineProperty(NbCalendarRangeYearCellComponent.prototype, "isLarge", {
|
6303 | get: function () {
|
6304 | return this.size === exports.NbCalendarSize.LARGE;
|
6305 | },
|
6306 | enumerable: false,
|
6307 | configurable: true
|
6308 | });
|
6309 | Object.defineProperty(NbCalendarRangeYearCellComponent.prototype, "year", {
|
6310 | get: function () {
|
6311 | return this.dateService.getYear(this.date);
|
6312 | },
|
6313 | enumerable: false,
|
6314 | configurable: true
|
6315 | });
|
6316 | NbCalendarRangeYearCellComponent.prototype.onClick = function () {
|
6317 | if (this.disabled) {
|
6318 | return;
|
6319 | }
|
6320 | this.select.emit(this.date);
|
6321 | };
|
6322 | NbCalendarRangeYearCellComponent.prototype.smallerThanMin = function () {
|
6323 | return this.date && this.min && this.dateService.compareDates(this.yearEnd(), this.min) < 0;
|
6324 | };
|
6325 | NbCalendarRangeYearCellComponent.prototype.greaterThanMax = function () {
|
6326 | return this.date && this.max && this.dateService.compareDates(this.yearStart(), this.max) > 0;
|
6327 | };
|
6328 | NbCalendarRangeYearCellComponent.prototype.yearStart = function () {
|
6329 | return this.dateService.getYearStart(this.date);
|
6330 | };
|
6331 | NbCalendarRangeYearCellComponent.prototype.yearEnd = function () {
|
6332 | return this.dateService.getYearEnd(this.date);
|
6333 | };
|
6334 | NbCalendarRangeYearCellComponent.prototype.isInRange = function (date, _a) {
|
6335 | var start = _a.start, end = _a.end;
|
6336 | if (start && end) {
|
6337 | var cellYear = this.dateService.getYear(date);
|
6338 | var startYear = this.dateService.getYear(start);
|
6339 | var endYear = this.dateService.getYear(end);
|
6340 | return cellYear >= startYear && cellYear <= endYear;
|
6341 | }
|
6342 | return this.dateService.isSameYear(date, start);
|
6343 | };
|
6344 | NbCalendarRangeYearCellComponent.decorators = [
|
6345 | { type: i0.Component, args: [{
|
6346 | selector: 'nb-calendar-range-year-cell',
|
6347 | template: "\n <div class=\"cell-content\">\n {{ year }}\n </div>\n ",
|
6348 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
6349 | },] }
|
6350 | ];
|
6351 | NbCalendarRangeYearCellComponent.ctorParameters = function () { return [
|
6352 | { type: NbDateService }
|
6353 | ]; };
|
6354 | NbCalendarRangeYearCellComponent.propDecorators = {
|
6355 | date: [{ type: i0.Input }],
|
6356 | min: [{ type: i0.Input }],
|
6357 | max: [{ type: i0.Input }],
|
6358 | selectedValue: [{ type: i0.Input }],
|
6359 | size: [{ type: i0.Input }],
|
6360 | select: [{ type: i0.Output }],
|
6361 | inRange: [{ type: i0.HostBinding, args: ['class.in-range',] }],
|
6362 | rangeStart: [{ type: i0.HostBinding, args: ['class.start',] }],
|
6363 | rangeEnd: [{ type: i0.HostBinding, args: ['class.end',] }],
|
6364 | selected: [{ type: i0.HostBinding, args: ['class.selected',] }],
|
6365 | today: [{ type: i0.HostBinding, args: ['class.today',] }],
|
6366 | disabled: [{ type: i0.HostBinding, args: ['class.disabled',] }],
|
6367 | isLarge: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
6368 | yearCellClass: [{ type: i0.HostBinding, args: ['class.year-cell',] }],
|
6369 | rangeCellClass: [{ type: i0.HostBinding, args: ['class.range-cell',] }],
|
6370 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
6371 | };
|
6372 | return NbCalendarRangeYearCellComponent;
|
6373 | }(NbBaseCalendarRangeCell));
|
6374 |
|
6375 |
|
6376 |
|
6377 |
|
6378 |
|
6379 |
|
6380 | var NbCalendarRangeMonthCellComponent = (function (_super) {
|
6381 | tslib.__extends(NbCalendarRangeMonthCellComponent, _super);
|
6382 | function NbCalendarRangeMonthCellComponent(dateService) {
|
6383 | var _this = _super.call(this) || this;
|
6384 | _this.dateService = dateService;
|
6385 | _this.size = exports.NbCalendarSize.MEDIUM;
|
6386 | _this.select = new i0.EventEmitter(true);
|
6387 | _this.monthCellClass = true;
|
6388 | _this.rangeCellClass = true;
|
6389 | return _this;
|
6390 | }
|
6391 | Object.defineProperty(NbCalendarRangeMonthCellComponent.prototype, "month", {
|
6392 | get: function () {
|
6393 | return this.dateService.getMonthName(this.date);
|
6394 | },
|
6395 | enumerable: false,
|
6396 | configurable: true
|
6397 | });
|
6398 | Object.defineProperty(NbCalendarRangeMonthCellComponent.prototype, "selected", {
|
6399 | get: function () {
|
6400 | if (this.inRange) {
|
6401 | return true;
|
6402 | }
|
6403 | if (this.selectedValue) {
|
6404 | return this.dateService.isSameMonthSafe(this.date, this.selectedValue.start);
|
6405 | }
|
6406 | },
|
6407 | enumerable: false,
|
6408 | configurable: true
|
6409 | });
|
6410 | Object.defineProperty(NbCalendarRangeMonthCellComponent.prototype, "inRange", {
|
6411 | get: function () {
|
6412 | if (this.hasRange) {
|
6413 | return this.isInRage(this.date, this.selectedValue);
|
6414 | }
|
6415 | },
|
6416 | enumerable: false,
|
6417 | configurable: true
|
6418 | });
|
6419 | Object.defineProperty(NbCalendarRangeMonthCellComponent.prototype, "rangeStart", {
|
6420 | get: function () {
|
6421 | if (this.hasRange) {
|
6422 | return this.dateService.isSameMonth(this.date, this.selectedValue.start);
|
6423 | }
|
6424 | },
|
6425 | enumerable: false,
|
6426 | configurable: true
|
6427 | });
|
6428 | Object.defineProperty(NbCalendarRangeMonthCellComponent.prototype, "rangeEnd", {
|
6429 | get: function () {
|
6430 | if (this.hasRange) {
|
6431 | return this.dateService.isSameMonth(this.date, this.selectedValue.end);
|
6432 | }
|
6433 | },
|
6434 | enumerable: false,
|
6435 | configurable: true
|
6436 | });
|
6437 | Object.defineProperty(NbCalendarRangeMonthCellComponent.prototype, "today", {
|
6438 | get: function () {
|
6439 | return this.dateService.isSameMonthSafe(this.date, this.dateService.today());
|
6440 | },
|
6441 | enumerable: false,
|
6442 | configurable: true
|
6443 | });
|
6444 | Object.defineProperty(NbCalendarRangeMonthCellComponent.prototype, "disabled", {
|
6445 | get: function () {
|
6446 | return this.smallerThanMin() || this.greaterThanMax();
|
6447 | },
|
6448 | enumerable: false,
|
6449 | configurable: true
|
6450 | });
|
6451 | Object.defineProperty(NbCalendarRangeMonthCellComponent.prototype, "isLarge", {
|
6452 | get: function () {
|
6453 | return this.size === exports.NbCalendarSize.LARGE;
|
6454 | },
|
6455 | enumerable: false,
|
6456 | configurable: true
|
6457 | });
|
6458 | NbCalendarRangeMonthCellComponent.prototype.onClick = function () {
|
6459 | if (this.disabled) {
|
6460 | return;
|
6461 | }
|
6462 | this.select.emit(this.date);
|
6463 | };
|
6464 | NbCalendarRangeMonthCellComponent.prototype.smallerThanMin = function () {
|
6465 | return this.date && this.min && this.dateService.compareDates(this.monthEnd(), this.min) < 0;
|
6466 | };
|
6467 | NbCalendarRangeMonthCellComponent.prototype.greaterThanMax = function () {
|
6468 | return this.date && this.max && this.dateService.compareDates(this.monthStart(), this.max) > 0;
|
6469 | };
|
6470 | NbCalendarRangeMonthCellComponent.prototype.monthStart = function () {
|
6471 | return this.dateService.getMonthStart(this.date);
|
6472 | };
|
6473 | NbCalendarRangeMonthCellComponent.prototype.monthEnd = function () {
|
6474 | return this.dateService.getMonthEnd(this.date);
|
6475 | };
|
6476 | NbCalendarRangeMonthCellComponent.prototype.isInRage = function (date, range) {
|
6477 | if (range.start && range.end) {
|
6478 | var cellDate = this.dateService.getMonthStart(date);
|
6479 | var start = this.dateService.getMonthStart(range.start);
|
6480 | var end = this.dateService.getMonthStart(range.end);
|
6481 | var isGreaterThanStart = this.dateService.compareDates(cellDate, start) >= 0;
|
6482 | var isLessThanEnd = this.dateService.compareDates(cellDate, end) <= 0;
|
6483 | return isGreaterThanStart && isLessThanEnd;
|
6484 | }
|
6485 | return this.dateService.isSameMonth(date, range.start);
|
6486 | };
|
6487 | NbCalendarRangeMonthCellComponent.decorators = [
|
6488 | { type: i0.Component, args: [{
|
6489 | selector: 'nb-calendar-range-month-cell',
|
6490 | template: "\n <div class=\"cell-content\">\n {{ month }}\n </div>\n ",
|
6491 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
6492 | },] }
|
6493 | ];
|
6494 | NbCalendarRangeMonthCellComponent.ctorParameters = function () { return [
|
6495 | { type: NbDateService }
|
6496 | ]; };
|
6497 | NbCalendarRangeMonthCellComponent.propDecorators = {
|
6498 | date: [{ type: i0.Input }],
|
6499 | visibleDate: [{ type: i0.Input }],
|
6500 | selectedValue: [{ type: i0.Input }],
|
6501 | min: [{ type: i0.Input }],
|
6502 | max: [{ type: i0.Input }],
|
6503 | size: [{ type: i0.Input }],
|
6504 | select: [{ type: i0.Output }],
|
6505 | monthCellClass: [{ type: i0.HostBinding, args: ['class.month-cell',] }],
|
6506 | rangeCellClass: [{ type: i0.HostBinding, args: ['class.range-cell',] }],
|
6507 | selected: [{ type: i0.HostBinding, args: ['class.selected',] }],
|
6508 | inRange: [{ type: i0.HostBinding, args: ['class.in-range',] }],
|
6509 | rangeStart: [{ type: i0.HostBinding, args: ['class.start',] }],
|
6510 | rangeEnd: [{ type: i0.HostBinding, args: ['class.end',] }],
|
6511 | today: [{ type: i0.HostBinding, args: ['class.today',] }],
|
6512 | disabled: [{ type: i0.HostBinding, args: ['class.disabled',] }],
|
6513 | isLarge: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
6514 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
6515 | };
|
6516 | return NbCalendarRangeMonthCellComponent;
|
6517 | }(NbBaseCalendarRangeCell));
|
6518 |
|
6519 |
|
6520 |
|
6521 |
|
6522 |
|
6523 |
|
6524 |
|
6525 |
|
6526 |
|
6527 |
|
6528 |
|
6529 |
|
6530 |
|
6531 |
|
6532 |
|
6533 |
|
6534 |
|
6535 |
|
6536 |
|
6537 |
|
6538 |
|
6539 |
|
6540 |
|
6541 |
|
6542 |
|
6543 |
|
6544 |
|
6545 |
|
6546 |
|
6547 |
|
6548 |
|
6549 |
|
6550 |
|
6551 |
|
6552 |
|
6553 |
|
6554 |
|
6555 |
|
6556 |
|
6557 |
|
6558 |
|
6559 |
|
6560 |
|
6561 |
|
6562 |
|
6563 |
|
6564 |
|
6565 |
|
6566 |
|
6567 |
|
6568 |
|
6569 |
|
6570 |
|
6571 |
|
6572 |
|
6573 |
|
6574 |
|
6575 |
|
6576 |
|
6577 |
|
6578 |
|
6579 |
|
6580 |
|
6581 |
|
6582 |
|
6583 |
|
6584 |
|
6585 |
|
6586 |
|
6587 |
|
6588 |
|
6589 |
|
6590 |
|
6591 |
|
6592 |
|
6593 |
|
6594 |
|
6595 |
|
6596 |
|
6597 |
|
6598 |
|
6599 |
|
6600 |
|
6601 |
|
6602 |
|
6603 |
|
6604 |
|
6605 |
|
6606 |
|
6607 |
|
6608 |
|
6609 |
|
6610 |
|
6611 |
|
6612 |
|
6613 |
|
6614 |
|
6615 |
|
6616 |
|
6617 |
|
6618 |
|
6619 |
|
6620 |
|
6621 |
|
6622 |
|
6623 |
|
6624 |
|
6625 |
|
6626 |
|
6627 |
|
6628 |
|
6629 |
|
6630 |
|
6631 |
|
6632 |
|
6633 |
|
6634 |
|
6635 |
|
6636 |
|
6637 |
|
6638 |
|
6639 |
|
6640 |
|
6641 |
|
6642 |
|
6643 |
|
6644 |
|
6645 |
|
6646 |
|
6647 |
|
6648 |
|
6649 |
|
6650 |
|
6651 |
|
6652 |
|
6653 |
|
6654 |
|
6655 |
|
6656 |
|
6657 |
|
6658 |
|
6659 |
|
6660 |
|
6661 |
|
6662 | var NbCalendarRangeComponent = (function () {
|
6663 | function NbCalendarRangeComponent(dateService) {
|
6664 | this.dateService = dateService;
|
6665 | |
6666 |
|
6667 |
|
6668 |
|
6669 | this.boundingMonth = true;
|
6670 | |
6671 |
|
6672 |
|
6673 | this.startView = exports.NbCalendarViewMode.DATE;
|
6674 | this.dayCellComponent = NbCalendarRangeDayCellComponent;
|
6675 | this.monthCellComponent = NbCalendarRangeMonthCellComponent;
|
6676 | this.yearCellComponent = NbCalendarRangeYearCellComponent;
|
6677 | |
6678 |
|
6679 |
|
6680 |
|
6681 | this.size = exports.NbCalendarSize.MEDIUM;
|
6682 | |
6683 |
|
6684 |
|
6685 | this.showNavigation = true;
|
6686 | this._showWeekNumber = false;
|
6687 | |
6688 |
|
6689 |
|
6690 | this.weekNumberSymbol = '#';
|
6691 | |
6692 |
|
6693 |
|
6694 | this.rangeChange = new i0.EventEmitter();
|
6695 | }
|
6696 | Object.defineProperty(NbCalendarRangeComponent.prototype, "_cellComponent", {
|
6697 | |
6698 |
|
6699 |
|
6700 | set: function (cellComponent) {
|
6701 | if (cellComponent) {
|
6702 | this.dayCellComponent = cellComponent;
|
6703 | }
|
6704 | },
|
6705 | enumerable: false,
|
6706 | configurable: true
|
6707 | });
|
6708 | Object.defineProperty(NbCalendarRangeComponent.prototype, "_monthCellComponent", {
|
6709 | |
6710 |
|
6711 |
|
6712 | set: function (cellComponent) {
|
6713 | if (cellComponent) {
|
6714 | this.monthCellComponent = cellComponent;
|
6715 | }
|
6716 | },
|
6717 | enumerable: false,
|
6718 | configurable: true
|
6719 | });
|
6720 | Object.defineProperty(NbCalendarRangeComponent.prototype, "_yearCellComponent", {
|
6721 | |
6722 |
|
6723 |
|
6724 | set: function (cellComponent) {
|
6725 | if (cellComponent) {
|
6726 | this.yearCellComponent = cellComponent;
|
6727 | }
|
6728 | },
|
6729 | enumerable: false,
|
6730 | configurable: true
|
6731 | });
|
6732 | Object.defineProperty(NbCalendarRangeComponent.prototype, "showWeekNumber", {
|
6733 | |
6734 |
|
6735 |
|
6736 |
|
6737 | get: function () {
|
6738 | return this._showWeekNumber;
|
6739 | },
|
6740 | set: function (value) {
|
6741 | this._showWeekNumber = convertToBoolProperty(value);
|
6742 | },
|
6743 | enumerable: false,
|
6744 | configurable: true
|
6745 | });
|
6746 | NbCalendarRangeComponent.prototype.onChange = function (date) {
|
6747 | this.initDateIfNull();
|
6748 | this.handleSelected(date);
|
6749 | };
|
6750 | NbCalendarRangeComponent.prototype.initDateIfNull = function () {
|
6751 | if (!this.range) {
|
6752 | this.range = { start: null, end: null };
|
6753 | }
|
6754 | };
|
6755 | NbCalendarRangeComponent.prototype.handleSelected = function (date) {
|
6756 | if (this.selectionStarted()) {
|
6757 | this.selectEnd(date);
|
6758 | }
|
6759 | else {
|
6760 | this.selectStart(date);
|
6761 | }
|
6762 | };
|
6763 | NbCalendarRangeComponent.prototype.selectionStarted = function () {
|
6764 | var _a = this.range, start = _a.start, end = _a.end;
|
6765 | return start && !end;
|
6766 | };
|
6767 | NbCalendarRangeComponent.prototype.selectStart = function (start) {
|
6768 | this.selectRange({ start: start });
|
6769 | };
|
6770 | NbCalendarRangeComponent.prototype.selectEnd = function (date) {
|
6771 | var start = this.range.start;
|
6772 | if (this.dateService.compareDates(date, start) > 0) {
|
6773 | this.selectRange({ start: start, end: date });
|
6774 | }
|
6775 | else {
|
6776 | this.selectRange({ start: date, end: start });
|
6777 | }
|
6778 | };
|
6779 | NbCalendarRangeComponent.prototype.selectRange = function (range) {
|
6780 | this.range = range;
|
6781 | this.rangeChange.emit(range);
|
6782 | };
|
6783 | NbCalendarRangeComponent.decorators = [
|
6784 | { type: i0.Component, args: [{
|
6785 | selector: 'nb-calendar-range',
|
6786 | template: "\n <nb-base-calendar\n [date]=\"range\"\n (dateChange)=\"onChange($any($event))\"\n [min]=\"min\"\n [max]=\"max\"\n [filter]=\"filter\"\n [startView]=\"startView\"\n [boundingMonth]=\"boundingMonth\"\n [dayCellComponent]=\"dayCellComponent\"\n [monthCellComponent]=\"monthCellComponent\"\n [yearCellComponent]=\"yearCellComponent\"\n [visibleDate]=\"visibleDate\"\n [showNavigation]=\"showNavigation\"\n [size]=\"size\"\n [showWeekNumber]=\"showWeekNumber\"\n [weekNumberSymbol]=\"weekNumberSymbol\"\n ></nb-base-calendar>\n "
|
6787 | },] }
|
6788 | ];
|
6789 | NbCalendarRangeComponent.ctorParameters = function () { return [
|
6790 | { type: NbDateService }
|
6791 | ]; };
|
6792 | NbCalendarRangeComponent.propDecorators = {
|
6793 | boundingMonth: [{ type: i0.Input }],
|
6794 | startView: [{ type: i0.Input }],
|
6795 | min: [{ type: i0.Input }],
|
6796 | max: [{ type: i0.Input }],
|
6797 | filter: [{ type: i0.Input }],
|
6798 | _cellComponent: [{ type: i0.Input, args: ['dayCellComponent',] }],
|
6799 | _monthCellComponent: [{ type: i0.Input, args: ['monthCellComponent',] }],
|
6800 | monthCellComponent: [{ type: i0.Input }],
|
6801 | _yearCellComponent: [{ type: i0.Input, args: ['yearCellComponent',] }],
|
6802 | size: [{ type: i0.Input }],
|
6803 | visibleDate: [{ type: i0.Input }],
|
6804 | showNavigation: [{ type: i0.Input }],
|
6805 | range: [{ type: i0.Input }],
|
6806 | showWeekNumber: [{ type: i0.Input }],
|
6807 | weekNumberSymbol: [{ type: i0.Input }],
|
6808 | rangeChange: [{ type: i0.Output }]
|
6809 | };
|
6810 | return NbCalendarRangeComponent;
|
6811 | }());
|
6812 |
|
6813 |
|
6814 |
|
6815 |
|
6816 |
|
6817 |
|
6818 | var NbCalendarRangeModule = (function () {
|
6819 | function NbCalendarRangeModule() {
|
6820 | }
|
6821 | NbCalendarRangeModule.decorators = [
|
6822 | { type: i0.NgModule, args: [{
|
6823 | imports: [NbBaseCalendarModule],
|
6824 | exports: [NbCalendarRangeComponent],
|
6825 | declarations: [
|
6826 | NbCalendarRangeComponent,
|
6827 | NbCalendarRangeDayCellComponent,
|
6828 | NbCalendarRangeYearCellComponent,
|
6829 | NbCalendarRangeMonthCellComponent,
|
6830 | ],
|
6831 | entryComponents: [
|
6832 | NbCalendarRangeDayCellComponent,
|
6833 | NbCalendarRangeMonthCellComponent,
|
6834 | NbCalendarRangeYearCellComponent,
|
6835 | ],
|
6836 | },] }
|
6837 | ];
|
6838 | return NbCalendarRangeModule;
|
6839 | }());
|
6840 |
|
6841 |
|
6842 |
|
6843 |
|
6844 |
|
6845 |
|
6846 | var NB_TIME_PICKER_CONFIG = new i0.InjectionToken('NB_TIME_PICKER_CONFIG');
|
6847 | var NB_DEFAULT_TIMEPICKER_LOCALIZATION_CONFIG = {
|
6848 | hoursText: 'Hr',
|
6849 | minutesText: 'Min',
|
6850 | secondsText: 'Sec',
|
6851 | ampmText: 'Am/Pm',
|
6852 | };
|
6853 |
|
6854 |
|
6855 |
|
6856 |
|
6857 |
|
6858 | var NbTimePickerComponent = (function () {
|
6859 | function NbTimePickerComponent(config, platformService, locale, cd, calendarTimeModelService, dateService) {
|
6860 | this.config = config;
|
6861 | this.platformService = platformService;
|
6862 | this.cd = cd;
|
6863 | this.calendarTimeModelService = calendarTimeModelService;
|
6864 | this.dateService = dateService;
|
6865 | this.blur$ = new rxjs.Subject();
|
6866 | this.dayPeriodColumnOptions = ["AM" , "PM" ];
|
6867 | this.isAM = true;
|
6868 | |
6869 |
|
6870 |
|
6871 |
|
6872 |
|
6873 | this.showFooter = true;
|
6874 | |
6875 |
|
6876 |
|
6877 | this.onSelectTime = new i0.EventEmitter();
|
6878 | this.initFromConfig(this.config);
|
6879 | }
|
6880 | Object.defineProperty(NbTimePickerComponent.prototype, "blur", {
|
6881 | |
6882 |
|
6883 |
|
6884 | get: function () {
|
6885 | return this.blur$.asObservable();
|
6886 | },
|
6887 | enumerable: false,
|
6888 | configurable: true
|
6889 | });
|
6890 | Object.defineProperty(NbTimePickerComponent.prototype, "timeFormat", {
|
6891 | |
6892 |
|
6893 |
|
6894 | get: function () {
|
6895 | return this._timeFormat;
|
6896 | },
|
6897 | set: function (timeFormat) {
|
6898 | this._timeFormat = timeFormat;
|
6899 | },
|
6900 | enumerable: false,
|
6901 | configurable: true
|
6902 | });
|
6903 | Object.defineProperty(NbTimePickerComponent.prototype, "twelveHoursFormat", {
|
6904 | |
6905 |
|
6906 |
|
6907 | get: function () {
|
6908 | return this._twelveHoursFormat;
|
6909 | },
|
6910 | set: function (value) {
|
6911 | this._twelveHoursFormat = convertToBoolProperty(value);
|
6912 | },
|
6913 | enumerable: false,
|
6914 | configurable: true
|
6915 | });
|
6916 |
|
6917 | Object.defineProperty(NbTimePickerComponent.prototype, "withSeconds", {
|
6918 | |
6919 |
|
6920 |
|
6921 |
|
6922 | get: function () {
|
6923 | return this._withSeconds;
|
6924 | },
|
6925 | set: function (value) {
|
6926 | this._withSeconds = convertToBoolProperty(value);
|
6927 | },
|
6928 | enumerable: false,
|
6929 | configurable: true
|
6930 | });
|
6931 |
|
6932 | Object.defineProperty(NbTimePickerComponent.prototype, "singleColumn", {
|
6933 | |
6934 |
|
6935 |
|
6936 | get: function () {
|
6937 | return this._singleColumn;
|
6938 | },
|
6939 | set: function (value) {
|
6940 | this._singleColumn = convertToBoolProperty(value);
|
6941 | },
|
6942 | enumerable: false,
|
6943 | configurable: true
|
6944 | });
|
6945 | Object.defineProperty(NbTimePickerComponent.prototype, "step", {
|
6946 | get: function () {
|
6947 | return this._step;
|
6948 | },
|
6949 | |
6950 |
|
6951 |
|
6952 |
|
6953 | set: function (step) {
|
6954 | this._step = step;
|
6955 | },
|
6956 | enumerable: false,
|
6957 | configurable: true
|
6958 | });
|
6959 | Object.defineProperty(NbTimePickerComponent.prototype, "date", {
|
6960 | get: function () {
|
6961 | return this._date;
|
6962 | },
|
6963 | |
6964 |
|
6965 |
|
6966 | set: function (date) {
|
6967 | this._date = date;
|
6968 | this.isAM = this.dateService.getDayPeriod(this.date) === "AM" ;
|
6969 | this.buildColumnOptions();
|
6970 | this.cd.markForCheck();
|
6971 | },
|
6972 | enumerable: false,
|
6973 | configurable: true
|
6974 | });
|
6975 | NbTimePickerComponent.prototype.ngOnInit = function () {
|
6976 | this.timeFormat = this.setupTimeFormat();
|
6977 | };
|
6978 | NbTimePickerComponent.prototype.ngOnChanges = function (_a) {
|
6979 | var step = _a.step, twelveHoursFormat = _a.twelveHoursFormat, withSeconds = _a.withSeconds, singleColumn = _a.singleColumn;
|
6980 | this.timeFormat = this.setupTimeFormat();
|
6981 | var isConfigChanged = step || twelveHoursFormat || withSeconds || singleColumn;
|
6982 | if (isConfigChanged || !this.fullTimeOptions) {
|
6983 | this.buildColumnOptions();
|
6984 | }
|
6985 | };
|
6986 | NbTimePickerComponent.prototype.setHost = function (hostRef) {
|
6987 | this.hostRef = hostRef;
|
6988 | };
|
6989 | NbTimePickerComponent.prototype.attach = function (hostRef) {
|
6990 | this.hostRef = hostRef;
|
6991 | };
|
6992 | NbTimePickerComponent.prototype.setCurrentTime = function () {
|
6993 | this.date = this.dateService.today();
|
6994 | this.onSelectTime.emit({
|
6995 | time: this.date,
|
6996 | save: true,
|
6997 | });
|
6998 | };
|
6999 | NbTimePickerComponent.prototype.setHour = function (value) {
|
7000 | this.updateValue(this.dateService.setHours(this.date, value));
|
7001 | };
|
7002 | NbTimePickerComponent.prototype.setMinute = function (value) {
|
7003 | this.updateValue(this.dateService.setMinutes(this.date, value));
|
7004 | };
|
7005 | NbTimePickerComponent.prototype.setSecond = function (value) {
|
7006 | this.updateValue(this.dateService.setSeconds(this.date, value));
|
7007 | };
|
7008 | NbTimePickerComponent.prototype.selectFullTime = function (value) {
|
7009 | this.updateValue(value);
|
7010 | };
|
7011 | NbTimePickerComponent.prototype.changeDayPeriod = function (dayPeriodToSet) {
|
7012 | if (this.dateService.getDayPeriod(this.date) === dayPeriodToSet) {
|
7013 | return;
|
7014 | }
|
7015 |
|
7016 |
|
7017 | var direction = dayPeriodToSet === "AM" ? -1 : 1;
|
7018 | var increment = direction * this.dateService.HOURS_IN_DAY_PERIOD;
|
7019 | this.updateValue(this.dateService.addHours(this.date, increment));
|
7020 | };
|
7021 | NbTimePickerComponent.prototype.updateValue = function (date) {
|
7022 | this.onSelectTime.emit({ time: date });
|
7023 | };
|
7024 | NbTimePickerComponent.prototype.saveValue = function () {
|
7025 | this.onSelectTime.emit({
|
7026 | time: this.date,
|
7027 | save: true,
|
7028 | });
|
7029 | };
|
7030 | NbTimePickerComponent.prototype.trackByTimeValues = function (index, item) {
|
7031 | return item.value;
|
7032 | };
|
7033 | NbTimePickerComponent.prototype.trackBySingleColumnValue = function (index, item) {
|
7034 | return this.dateService.valueOf(item);
|
7035 | };
|
7036 | NbTimePickerComponent.prototype.trackByDayPeriod = function (index, item) {
|
7037 | return item;
|
7038 | };
|
7039 | NbTimePickerComponent.prototype.showSeconds = function () {
|
7040 | return this.withSeconds && !this.singleColumn;
|
7041 | };
|
7042 | NbTimePickerComponent.prototype.isSelectedHour = function (val) {
|
7043 | if (this.date) {
|
7044 | return this.dateService.getHours(this.date) === val;
|
7045 | }
|
7046 | return false;
|
7047 | };
|
7048 | NbTimePickerComponent.prototype.isSelectedMinute = function (val) {
|
7049 | if (this.date) {
|
7050 | return this.dateService.getMinutes(this.date) === val;
|
7051 | }
|
7052 | return false;
|
7053 | };
|
7054 | NbTimePickerComponent.prototype.isSelectedSecond = function (val) {
|
7055 | if (this.date) {
|
7056 | return this.dateService.getSeconds(this.date) === val;
|
7057 | }
|
7058 | return false;
|
7059 | };
|
7060 | NbTimePickerComponent.prototype.isSelectedDayPeriod = function (dayPeriod) {
|
7061 | if (this.date) {
|
7062 | return dayPeriod === this.dateService.getDayPeriod(this.date);
|
7063 | }
|
7064 | return false;
|
7065 | };
|
7066 | NbTimePickerComponent.prototype.getFullTimeString = function (item) {
|
7067 | return this.dateService.format(item, this.timeFormat).toUpperCase();
|
7068 | };
|
7069 | NbTimePickerComponent.prototype.isSelectedFullTimeValue = function (value) {
|
7070 | if (this.date) {
|
7071 | return this.dateService.isSameHourAndMinute(value, this.date);
|
7072 | }
|
7073 | return false;
|
7074 | };
|
7075 | NbTimePickerComponent.prototype.buildColumnOptions = function () {
|
7076 | this.timeFormat = this.setupTimeFormat();
|
7077 | this.fullTimeOptions = this.singleColumn
|
7078 | ? this.calendarTimeModelService.getHoursRange(this.step)
|
7079 | : [];
|
7080 | this.hoursColumnOptions = this.generateHours();
|
7081 | this.minutesColumnOptions = this.generateMinutesOrSeconds();
|
7082 | this.secondsColumnOptions = this.withSeconds ? this.generateMinutesOrSeconds() : [];
|
7083 | };
|
7084 | |
7085 |
|
7086 |
|
7087 | NbTimePickerComponent.prototype.isFirefox = function () {
|
7088 | return this.platformService.FIREFOX;
|
7089 | };
|
7090 | NbTimePickerComponent.prototype.generateHours = function () {
|
7091 | var _this = this;
|
7092 | if (!this.twelveHoursFormat) {
|
7093 | return range(24, function (v) {
|
7094 | return { value: v, text: _this.calendarTimeModelService.paddToTwoSymbols(v) };
|
7095 | });
|
7096 | }
|
7097 | if (this.isAM) {
|
7098 | return (range(12, function (v) {
|
7099 | var text = v === 0 ? 12 : v;
|
7100 | return { value: v, text: _this.calendarTimeModelService.paddToTwoSymbols(text) };
|
7101 | }));
|
7102 | }
|
7103 | return (rangeFromTo(12, 24, function (v) {
|
7104 | var text = v === 12 ? 12 : (v - 12);
|
7105 | return { value: v, text: _this.calendarTimeModelService.paddToTwoSymbols(text) };
|
7106 | }));
|
7107 | };
|
7108 | NbTimePickerComponent.prototype.generateMinutesOrSeconds = function () {
|
7109 | var _this = this;
|
7110 | return range(60, function (v) {
|
7111 | return { value: v, text: _this.calendarTimeModelService.paddToTwoSymbols(v) };
|
7112 | });
|
7113 | };
|
7114 | NbTimePickerComponent.prototype.setupTimeFormat = function () {
|
7115 | if (!this.timeFormat) {
|
7116 | return this.config.format || this.buildTimeFormat();
|
7117 | }
|
7118 | return this.timeFormat;
|
7119 | };
|
7120 | |
7121 |
|
7122 |
|
7123 | NbTimePickerComponent.prototype.buildTimeFormat = function () {
|
7124 | if (this.twelveHoursFormat) {
|
7125 | return "" + (this.withSeconds && !this.singleColumn ? this.dateService.getTwelveHoursFormatWithSeconds()
|
7126 | : this.dateService.getTwelveHoursFormat());
|
7127 | }
|
7128 | else {
|
7129 | return "" + (this.withSeconds && !this.singleColumn ? this.dateService.getTwentyFourHoursFormatWithSeconds()
|
7130 | : this.dateService.getTwentyFourHoursFormat());
|
7131 | }
|
7132 | };
|
7133 | NbTimePickerComponent.prototype.initFromConfig = function (config) {
|
7134 | var _a;
|
7135 | if (config) {
|
7136 | this.twelveHoursFormat = config.twelveHoursFormat;
|
7137 | }
|
7138 | else {
|
7139 | this.twelveHoursFormat = this.dateService.getLocaleTimeFormat().includes('h');
|
7140 | }
|
7141 | var localeConfig = tslib.__assign(tslib.__assign({}, NB_DEFAULT_TIMEPICKER_LOCALIZATION_CONFIG), (_a = config === null || config === void 0 ? void 0 : config.localization) !== null && _a !== void 0 ? _a : {});
|
7142 | this.hoursText = localeConfig.hoursText;
|
7143 | this.minutesText = localeConfig.minutesText;
|
7144 | this.secondsText = localeConfig.secondsText;
|
7145 | this.ampmText = localeConfig.ampmText;
|
7146 | };
|
7147 | NbTimePickerComponent.decorators = [
|
7148 | { type: i0.Component, args: [{
|
7149 | selector: 'nb-timepicker',
|
7150 | template: "<nb-card *nbPortal\n [class.supports-scrollbar-theming]=\"!isFirefox()\"\n class=\"nb-timepicker-container\">\n <nb-card-header class=\"column-header\">\n <ng-container *ngIf=\"singleColumn; else fullTimeHeadersBlock\">\n <div class=\"header-cell\">Time</div>\n </ng-container>\n <ng-template #fullTimeHeadersBlock>\n <div class=\"header-cell\">{{ hoursText }}</div>\n <div class=\"header-cell\">{{ minutesText }}</div>\n <div *ngIf=\"withSeconds\" class=\"header-cell\">{{ secondsText }}</div>\n <div *ngIf=\"twelveHoursFormat\" class=\"header-cell\">{{ ampmText }}</div>\n </ng-template>\n </nb-card-header>\n\n <div class=\"picker-body\">\n <ng-container *ngIf=\"singleColumn; else fullTimeColumnBlock\">\n <nb-list class=\"values-list\">\n <nb-list-item\n class=\"list-item\"\n [class.selected]=\"isSelectedFullTimeValue(item)\"\n *ngFor=\"let item of fullTimeOptions; trackBy: trackBySingleColumnValue.bind(this)\">\n <nb-timepicker-cell\n [value]=\"getFullTimeString(item)\"\n [selected]=\"isSelectedFullTimeValue(item)\"\n (select)=\"selectFullTime(item)\">\n </nb-timepicker-cell>\n </nb-list-item>\n </nb-list>\n </ng-container>\n\n <ng-template #fullTimeColumnBlock>\n <nb-list class=\"values-list\">\n <nb-list-item\n class=\"list-item\"\n [class.selected]=\"isSelectedHour(item.value)\"\n *ngFor=\"let item of hoursColumnOptions; trackBy: trackByTimeValues\">\n <nb-timepicker-cell\n [value]=\"item.text\"\n [selected]=\"isSelectedHour(item.value)\"\n (select)=\"setHour(item.value)\">\n </nb-timepicker-cell>\n </nb-list-item>\n </nb-list>\n <nb-list class=\"values-list\">\n <nb-list-item\n class=\"list-item\"\n [class.selected]=\"isSelectedMinute(item.value)\"\n *ngFor=\"let item of minutesColumnOptions; trackBy: trackByTimeValues\">\n <nb-timepicker-cell\n [value]=\"item.text\"\n [selected]=\"isSelectedMinute(item.value)\"\n (select)=\"setMinute(item.value)\">\n </nb-timepicker-cell>\n </nb-list-item>\n </nb-list>\n <nb-list *ngIf=\"showSeconds()\" class=\"values-list\">\n <nb-list-item\n class=\"list-item\"\n [class.selected]=\"isSelectedSecond(item.value)\"\n *ngFor=\"let item of secondsColumnOptions; trackBy: trackByTimeValues\">\n <nb-timepicker-cell\n [value]=\"item.text\"\n [selected]=\"isSelectedSecond(item.value)\"\n (select)=\"setSecond(item.value)\">\n </nb-timepicker-cell>\n </nb-list-item>\n </nb-list>\n <nb-list *ngIf=\"twelveHoursFormat\" class=\"values-list\">\n <nb-list-item\n class=\"list-item am-pm-item\"\n [class.selected]=\"isSelectedDayPeriod(dayPeriod)\"\n *ngFor=\"let dayPeriod of dayPeriodColumnOptions; trackBy: trackByDayPeriod\">\n <nb-timepicker-cell\n [value]=\"dayPeriod\"\n [selected]=\"isSelectedDayPeriod(dayPeriod)\"\n (select)=\"changeDayPeriod(dayPeriod)\">\n </nb-timepicker-cell>\n </nb-list-item>\n </nb-list>\n </ng-template>\n </div>\n\n <nb-card-footer *ngIf=\"showFooter\" class=\"actions-footer\">\n <nb-calendar-actions\n [applyButtonText]=\"applyButtonText\"\n [currentTimeButtonText]=\"currentTimeButtonText\"\n (setCurrentTime)=\"setCurrentTime()\"\n (saveValue)=\"saveValue()\"\n ></nb-calendar-actions>\n </nb-card-footer>\n</nb-card>\n",
|
7151 | exportAs: 'nbTimepicker',
|
7152 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
7153 | styles: [".nb-timepicker-container{overflow:hidden;margin-bottom:0}.values-list{width:100%;overflow:hidden;scroll-snap-type:y proximity}.values-list:hover{overflow-y:auto}.list-item{border:0;padding:0;cursor:pointer}.picker-body{display:flex;width:100%;flex:1 0 0;overflow:hidden}.column-header{width:100%;display:flex;justify-content:space-between;padding:0}.header-cell{width:100%;display:flex;align-items:center;justify-content:center}.actions-footer{width:100%}nb-card-header,nb-card-footer{flex:0 0 auto}\n"]
|
7154 | },] }
|
7155 | ];
|
7156 | NbTimePickerComponent.ctorParameters = function () { return [
|
7157 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_TIME_PICKER_CONFIG,] }] },
|
7158 | { type: NbPlatform },
|
7159 | { type: String, decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] },
|
7160 | { type: i0.ChangeDetectorRef },
|
7161 | { type: NbCalendarTimeModelService },
|
7162 | { type: NbDateService }
|
7163 | ]; };
|
7164 | NbTimePickerComponent.propDecorators = {
|
7165 | timeFormat: [{ type: i0.Input }],
|
7166 | twelveHoursFormat: [{ type: i0.Input }],
|
7167 | withSeconds: [{ type: i0.Input }],
|
7168 | singleColumn: [{ type: i0.Input }],
|
7169 | step: [{ type: i0.Input }],
|
7170 | date: [{ type: i0.Input }],
|
7171 | showFooter: [{ type: i0.Input }],
|
7172 | applyButtonText: [{ type: i0.Input }],
|
7173 | hoursText: [{ type: i0.Input }],
|
7174 | minutesText: [{ type: i0.Input }],
|
7175 | secondsText: [{ type: i0.Input }],
|
7176 | ampmText: [{ type: i0.Input }],
|
7177 | currentTimeButtonText: [{ type: i0.Input }],
|
7178 | onSelectTime: [{ type: i0.Output }],
|
7179 | portal: [{ type: i0.ViewChild, args: [NbPortalDirective, { static: true },] }]
|
7180 | };
|
7181 | return NbTimePickerComponent;
|
7182 | }());
|
7183 |
|
7184 | var NbCalendarWithTimeComponent = (function (_super) {
|
7185 | tslib.__extends(NbCalendarWithTimeComponent, _super);
|
7186 | function NbCalendarWithTimeComponent(dateService, cd, calendarTimeModelService) {
|
7187 | var _this = _super.call(this) || this;
|
7188 | _this.dateService = dateService;
|
7189 | _this.cd = cd;
|
7190 | _this.calendarTimeModelService = calendarTimeModelService;
|
7191 | return _this;
|
7192 | }
|
7193 | NbCalendarWithTimeComponent.prototype.ngOnInit = function () {
|
7194 | if (!this.date) {
|
7195 | this.date = this.calendarTimeModelService.getResetTime();
|
7196 | }
|
7197 | };
|
7198 | NbCalendarWithTimeComponent.prototype.ngAfterViewInit = function () {
|
7199 | this.portalOutlet.attachTemplatePortal(this.timepicker.portal);
|
7200 | };
|
7201 | NbCalendarWithTimeComponent.prototype.onDateValueChange = function (date) {
|
7202 | var hours = this.dateService.getHours(this.date);
|
7203 | var minutes = this.dateService.getMinutes(this.date);
|
7204 | var seconds = this.dateService.getSeconds(this.date);
|
7205 | var milliseconds = this.dateService.getMilliseconds(this.date);
|
7206 | var newDate = this.dateService.setHours(date, hours);
|
7207 | newDate = this.dateService.setMinutes(newDate, minutes);
|
7208 | newDate = this.dateService.setMinutes(newDate, minutes);
|
7209 | newDate = this.dateService.setSeconds(newDate, seconds);
|
7210 | newDate = this.dateService.setMilliseconds(newDate, milliseconds);
|
7211 | this.date = newDate;
|
7212 | };
|
7213 | NbCalendarWithTimeComponent.prototype.onTimeChange = function (selectedTime) {
|
7214 | var newDate = this.dateService.clone(this.date);
|
7215 | newDate = this.dateService.setHours(newDate, this.dateService.getHours(selectedTime.time));
|
7216 | newDate = this.dateService.setMinutes(newDate, this.dateService.getMinutes(selectedTime.time));
|
7217 | newDate = this.dateService.setSeconds(newDate, this.dateService.getSeconds(selectedTime.time));
|
7218 | newDate = this.dateService.setMilliseconds(newDate, this.dateService.getMilliseconds(selectedTime.time));
|
7219 | this.date = newDate;
|
7220 | };
|
7221 | NbCalendarWithTimeComponent.prototype.saveValue = function () {
|
7222 | this.dateChange.emit(this.date);
|
7223 | };
|
7224 | NbCalendarWithTimeComponent.prototype.saveCurrentTime = function () {
|
7225 | this.dateChange.emit(this.dateService.today());
|
7226 | };
|
7227 | |
7228 |
|
7229 |
|
7230 | NbCalendarWithTimeComponent.prototype.showSeconds = function () {
|
7231 | return this.withSeconds && !this.twelveHoursFormat;
|
7232 | };
|
7233 | NbCalendarWithTimeComponent.prototype.isLarge = function () {
|
7234 | return this.size === exports.NbCalendarSize.LARGE;
|
7235 | };
|
7236 | NbCalendarWithTimeComponent.decorators = [
|
7237 | { type: i0.Component, args: [{
|
7238 | selector: 'nb-calendar-with-time',
|
7239 | template: "\n <nb-card class=\"calendar-with-time\">\n <nb-card-body class=\"picker-body\">\n <nb-base-calendar\n [boundingMonth]=\"boundingMonth\"\n [startView]=\"startView\"\n [date]=\"date\"\n [min]=\"min\"\n [max]=\"max\"\n [filter]=\"filter\"\n [dayCellComponent]=\"dayCellComponent\"\n [monthCellComponent]=\"monthCellComponent\"\n [yearCellComponent]=\"yearCellComponent\"\n [size]=\"size\"\n [visibleDate]=\"visibleDate\"\n [showNavigation]=\"showNavigation\"\n [showWeekNumber]=\"showWeekNumber\"\n [weekNumberSymbol]=\"weekNumberSymbol\"\n (dateChange)=\"onDateValueChange($event)\">\n </nb-base-calendar>\n <div class=\"timepicker-section\"\n [class.size-large]=\"isLarge()\"\n [class.timepicker-single-column-width]=\"singleColumn\"\n [class.timepicker-multiple-column-width]=\"!singleColumn\">\n <div class=\"picker-title\">{{ title }}</div>\n <nb-timepicker\n (onSelectTime)=\"onTimeChange($event)\"\n [date]=\"date\"\n [twelveHoursFormat]=\"twelveHoursFormat\"\n [withSeconds]=\"showSeconds()\"\n [showFooter]=\"false\"\n [singleColumn]=\"singleColumn\"\n [step]=\"step\">\n </nb-timepicker>\n <ng-container nbPortalOutlet></ng-container>\n </div>\n </nb-card-body>\n <nb-card-footer class=\"picker-footer\">\n <nb-calendar-actions\n [applyButtonText]=\"applyButtonText\"\n [currentTimeButtonText]=\"currentTimeButtonText\"\n (setCurrentTime)=\"saveCurrentTime()\"\n (saveValue)=\"saveValue()\"\n ></nb-calendar-actions>\n </nb-card-footer>\n </nb-card>\n ",
|
7240 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
7241 | styles: [":host ::ng-deep nb-card.nb-timepicker-container{flex:1 0 0;border-radius:0;width:auto;border-right:0;border-bottom:0}[dir=ltr] :host .picker-footer{padding-left:.625rem}[dir=rtl] :host .picker-footer{padding-right:.625rem}.picker-body{align-items:stretch;display:flex;padding:0}.picker-body nb-base-calendar ::ng-deep nb-card{border-radius:0}.calendar-with-time{overflow:hidden}.timepicker-section{display:flex;flex-direction:column}\n"]
|
7242 | },] }
|
7243 | ];
|
7244 | NbCalendarWithTimeComponent.ctorParameters = function () { return [
|
7245 | { type: NbDateService },
|
7246 | { type: i0.ChangeDetectorRef },
|
7247 | { type: NbCalendarTimeModelService }
|
7248 | ]; };
|
7249 | NbCalendarWithTimeComponent.propDecorators = {
|
7250 | visibleDate: [{ type: i0.Input }],
|
7251 | twelveHoursFormat: [{ type: i0.Input }],
|
7252 | withSeconds: [{ type: i0.Input }],
|
7253 | singleColumn: [{ type: i0.Input }],
|
7254 | step: [{ type: i0.Input }],
|
7255 | timeFormat: [{ type: i0.Input }],
|
7256 | title: [{ type: i0.Input }],
|
7257 | applyButtonText: [{ type: i0.Input }],
|
7258 | currentTimeButtonText: [{ type: i0.Input }],
|
7259 | portalOutlet: [{ type: i0.ViewChild, args: [NbPortalOutletDirective,] }],
|
7260 | timepicker: [{ type: i0.ViewChild, args: [NbTimePickerComponent,] }]
|
7261 | };
|
7262 | return NbCalendarWithTimeComponent;
|
7263 | }(NbCalendarComponent));
|
7264 |
|
7265 |
|
7266 |
|
7267 |
|
7268 |
|
7269 |
|
7270 | var NbDatepickerContainerComponent = (function (_super) {
|
7271 | tslib.__extends(NbDatepickerContainerComponent, _super);
|
7272 | function NbDatepickerContainerComponent() {
|
7273 | return _super !== null && _super.apply(this, arguments) || this;
|
7274 | }
|
7275 | NbDatepickerContainerComponent.prototype.attach = function (portal) {
|
7276 | return this.overlayContainer.attachComponentPortal(portal);
|
7277 | };
|
7278 | NbDatepickerContainerComponent.decorators = [
|
7279 | { type: i0.Component, args: [{
|
7280 | selector: 'nb-datepicker-container',
|
7281 | template: "\n <nb-overlay-container></nb-overlay-container>\n "
|
7282 | },] }
|
7283 | ];
|
7284 | NbDatepickerContainerComponent.propDecorators = {
|
7285 | overlayContainer: [{ type: i0.ViewChild, args: [NbOverlayContainerComponent, { static: true },] }]
|
7286 | };
|
7287 | return NbDatepickerContainerComponent;
|
7288 | }(NbPositionedContainerComponent));
|
7289 |
|
7290 |
|
7291 |
|
7292 |
|
7293 |
|
7294 |
|
7295 |
|
7296 |
|
7297 |
|
7298 |
|
7299 | var NbDatepickerAdapter = (function () {
|
7300 | function NbDatepickerAdapter() {
|
7301 | }
|
7302 | return NbDatepickerAdapter;
|
7303 | }());
|
7304 |
|
7305 |
|
7306 |
|
7307 |
|
7308 | var NbDatepicker = (function () {
|
7309 | function NbDatepicker() {
|
7310 | }
|
7311 | return NbDatepicker;
|
7312 | }());
|
7313 | var NB_DATE_ADAPTER = new i0.InjectionToken('Datepicker Adapter');
|
7314 | var NB_DATE_SERVICE_OPTIONS = new i0.InjectionToken('Date service options');
|
7315 |
|
7316 |
|
7317 |
|
7318 |
|
7319 |
|
7320 |
|
7321 |
|
7322 |
|
7323 |
|
7324 |
|
7325 |
|
7326 |
|
7327 |
|
7328 |
|
7329 |
|
7330 |
|
7331 |
|
7332 |
|
7333 |
|
7334 |
|
7335 |
|
7336 |
|
7337 |
|
7338 |
|
7339 |
|
7340 |
|
7341 |
|
7342 |
|
7343 |
|
7344 |
|
7345 |
|
7346 |
|
7347 |
|
7348 |
|
7349 |
|
7350 |
|
7351 |
|
7352 |
|
7353 |
|
7354 |
|
7355 |
|
7356 |
|
7357 |
|
7358 |
|
7359 |
|
7360 |
|
7361 |
|
7362 |
|
7363 |
|
7364 |
|
7365 |
|
7366 |
|
7367 |
|
7368 |
|
7369 |
|
7370 |
|
7371 |
|
7372 |
|
7373 |
|
7374 |
|
7375 |
|
7376 |
|
7377 |
|
7378 |
|
7379 |
|
7380 |
|
7381 |
|
7382 |
|
7383 |
|
7384 |
|
7385 |
|
7386 |
|
7387 |
|
7388 |
|
7389 |
|
7390 |
|
7391 |
|
7392 |
|
7393 |
|
7394 |
|
7395 |
|
7396 |
|
7397 |
|
7398 |
|
7399 |
|
7400 |
|
7401 |
|
7402 |
|
7403 |
|
7404 |
|
7405 |
|
7406 |
|
7407 |
|
7408 |
|
7409 |
|
7410 |
|
7411 |
|
7412 |
|
7413 |
|
7414 |
|
7415 |
|
7416 |
|
7417 |
|
7418 |
|
7419 |
|
7420 |
|
7421 |
|
7422 |
|
7423 |
|
7424 |
|
7425 |
|
7426 |
|
7427 |
|
7428 |
|
7429 |
|
7430 |
|
7431 |
|
7432 |
|
7433 |
|
7434 |
|
7435 |
|
7436 |
|
7437 |
|
7438 |
|
7439 |
|
7440 |
|
7441 |
|
7442 |
|
7443 |
|
7444 |
|
7445 |
|
7446 |
|
7447 |
|
7448 |
|
7449 |
|
7450 |
|
7451 | var NbDatepickerDirective = (function () {
|
7452 | function NbDatepickerDirective(document, datepickerAdapters, hostRef, dateService, changeDetector) {
|
7453 | var _this = this;
|
7454 | this.document = document;
|
7455 | this.datepickerAdapters = datepickerAdapters;
|
7456 | this.hostRef = hostRef;
|
7457 | this.dateService = dateService;
|
7458 | this.changeDetector = changeDetector;
|
7459 | this.destroy$ = new rxjs.Subject();
|
7460 | this.isDatepickerReady = false;
|
7461 | this.onChange = function () { };
|
7462 | this.onTouched = function () { };
|
7463 | |
7464 |
|
7465 |
|
7466 | this.validator = _angular_forms.Validators.compose([
|
7467 | this.parseValidator,
|
7468 | this.minValidator,
|
7469 | this.maxValidator,
|
7470 | this.filterValidator,
|
7471 | ].map(function (fn) { return fn.bind(_this); }));
|
7472 | this.subscribeOnInputChange();
|
7473 | }
|
7474 | Object.defineProperty(NbDatepickerDirective.prototype, "setPicker", {
|
7475 | |
7476 |
|
7477 |
|
7478 | set: function (picker) {
|
7479 | this.picker = picker;
|
7480 | this.setupPicker();
|
7481 | },
|
7482 | enumerable: false,
|
7483 | configurable: true
|
7484 | });
|
7485 | Object.defineProperty(NbDatepickerDirective.prototype, "input", {
|
7486 | |
7487 |
|
7488 |
|
7489 | get: function () {
|
7490 | return this.hostRef.nativeElement;
|
7491 | },
|
7492 | enumerable: false,
|
7493 | configurable: true
|
7494 | });
|
7495 | Object.defineProperty(NbDatepickerDirective.prototype, "inputValue", {
|
7496 | |
7497 |
|
7498 |
|
7499 | get: function () {
|
7500 | return this.input.value;
|
7501 | },
|
7502 | enumerable: false,
|
7503 | configurable: true
|
7504 | });
|
7505 | NbDatepickerDirective.prototype.ngOnDestroy = function () {
|
7506 | this.destroy$.next();
|
7507 | this.destroy$.complete();
|
7508 | };
|
7509 | |
7510 |
|
7511 |
|
7512 | NbDatepickerDirective.prototype.writeValue = function (value) {
|
7513 | if (this.isDatepickerReady) {
|
7514 | this.writePicker(value);
|
7515 | this.writeInput(value);
|
7516 | }
|
7517 | else {
|
7518 | this.queue = value;
|
7519 | }
|
7520 | };
|
7521 | NbDatepickerDirective.prototype.registerOnChange = function (fn) {
|
7522 | this.onChange = fn;
|
7523 | };
|
7524 | NbDatepickerDirective.prototype.registerOnTouched = function (fn) {
|
7525 | this.onTouched = fn;
|
7526 | };
|
7527 | NbDatepickerDirective.prototype.setDisabledState = function (isDisabled) {
|
7528 | this.input.disabled = isDisabled;
|
7529 | };
|
7530 | |
7531 |
|
7532 |
|
7533 | NbDatepickerDirective.prototype.validate = function () {
|
7534 | return this.validator(null);
|
7535 | };
|
7536 | |
7537 |
|
7538 |
|
7539 | NbDatepickerDirective.prototype.hidePicker = function () {
|
7540 | this.input.focus();
|
7541 | this.picker.hide();
|
7542 | };
|
7543 | |
7544 |
|
7545 |
|
7546 | NbDatepickerDirective.prototype.parseValidator = function () {
|
7547 | |
7548 |
|
7549 |
|
7550 |
|
7551 | if (this.inputValue === '') {
|
7552 | return null;
|
7553 | }
|
7554 | var isValid = this.datepickerAdapter.isValid(this.inputValue, this.picker.format);
|
7555 | return isValid ? null : { nbDatepickerParse: { value: this.inputValue } };
|
7556 | };
|
7557 | |
7558 |
|
7559 |
|
7560 | NbDatepickerDirective.prototype.minValidator = function () {
|
7561 | var config = this.picker.getValidatorConfig();
|
7562 | var date = this.datepickerAdapter.parse(this.inputValue, this.picker.format);
|
7563 | return (!config.min || !date || this.dateService.compareDates(config.min, date) <= 0) ?
|
7564 | null : { nbDatepickerMin: { min: config.min, actual: date } };
|
7565 | };
|
7566 | |
7567 |
|
7568 |
|
7569 | NbDatepickerDirective.prototype.maxValidator = function () {
|
7570 | var config = this.picker.getValidatorConfig();
|
7571 | var date = this.datepickerAdapter.parse(this.inputValue, this.picker.format);
|
7572 | return (!config.max || !date || this.dateService.compareDates(config.max, date) >= 0) ?
|
7573 | null : { nbDatepickerMax: { max: config.max, actual: date } };
|
7574 | };
|
7575 | |
7576 |
|
7577 |
|
7578 | NbDatepickerDirective.prototype.filterValidator = function () {
|
7579 | var config = this.picker.getValidatorConfig();
|
7580 | var date = this.datepickerAdapter.parse(this.inputValue, this.picker.format);
|
7581 | return (!config.filter || !date || config.filter(date)) ?
|
7582 | null : { nbDatepickerFilter: true };
|
7583 | };
|
7584 | |
7585 |
|
7586 |
|
7587 | NbDatepickerDirective.prototype.chooseDatepickerAdapter = function () {
|
7588 | var _this = this;
|
7589 | this.datepickerAdapter = this.datepickerAdapters.find(function (_a) {
|
7590 | var picker = _a.picker;
|
7591 | return _this.picker instanceof picker;
|
7592 | });
|
7593 | if (this.noDatepickerAdapterProvided()) {
|
7594 | throw new Error('No datepickerAdapter provided for picker');
|
7595 | }
|
7596 | };
|
7597 | |
7598 |
|
7599 |
|
7600 | NbDatepickerDirective.prototype.setupPicker = function () {
|
7601 | var _this = this;
|
7602 | this.chooseDatepickerAdapter();
|
7603 | this.picker.attach(this.hostRef);
|
7604 | if (this.inputValue) {
|
7605 | this.picker.value = this.datepickerAdapter.parse(this.inputValue, this.picker.format);
|
7606 | }
|
7607 |
|
7608 |
|
7609 |
|
7610 | if (!this.isDatepickerReady) {
|
7611 | this.picker.init
|
7612 | .pipe(rxjs_operators.take(1), rxjs_operators.tap(function () { return _this.isDatepickerReady = true; }), rxjs_operators.filter(function () { return !!_this.queue; }), rxjs_operators.takeUntil(this.destroy$))
|
7613 | .subscribe(function () {
|
7614 | _this.writeValue(_this.queue);
|
7615 | _this.onChange(_this.queue);
|
7616 | _this.changeDetector.detectChanges();
|
7617 | _this.queue = undefined;
|
7618 | });
|
7619 | }
|
7620 | this.picker.valueChange
|
7621 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
7622 | .subscribe(function (value) {
|
7623 | _this.writePicker(value);
|
7624 | _this.writeInput(value);
|
7625 | _this.onChange(value);
|
7626 | if (_this.picker.shouldHide()) {
|
7627 | _this.hidePicker();
|
7628 | }
|
7629 | });
|
7630 | rxjs.merge(this.picker.blur, rxjs.fromEvent(this.input, 'blur').pipe(rxjs_operators.filter(function () { return !_this.picker.isShown && _this.document.activeElement !== _this.input; }))).pipe(rxjs_operators.takeUntil(this.destroy$))
|
7631 | .subscribe(function () { return _this.onTouched(); });
|
7632 | };
|
7633 | NbDatepickerDirective.prototype.writePicker = function (value) {
|
7634 | this.picker.value = value;
|
7635 | };
|
7636 | NbDatepickerDirective.prototype.writeInput = function (value) {
|
7637 | var stringRepresentation = this.datepickerAdapter.format(value, this.picker.format);
|
7638 | this.hostRef.nativeElement.value = stringRepresentation;
|
7639 | };
|
7640 | |
7641 |
|
7642 |
|
7643 | NbDatepickerDirective.prototype.noDatepickerAdapterProvided = function () {
|
7644 | return !this.datepickerAdapter || !(this.datepickerAdapter instanceof NbDatepickerAdapter);
|
7645 | };
|
7646 | NbDatepickerDirective.prototype.subscribeOnInputChange = function () {
|
7647 | var _this = this;
|
7648 | rxjs.fromEvent(this.input, 'input')
|
7649 | .pipe(rxjs_operators.map(function () { return _this.inputValue; }), rxjs_operators.takeUntil(this.destroy$))
|
7650 | .subscribe(function (value) { return _this.handleInputChange(value); });
|
7651 | };
|
7652 | |
7653 |
|
7654 |
|
7655 | NbDatepickerDirective.prototype.handleInputChange = function (value) {
|
7656 | var date = this.parseInputValue(value);
|
7657 | this.onChange(date);
|
7658 | this.writePicker(date);
|
7659 | };
|
7660 | NbDatepickerDirective.prototype.parseInputValue = function (value) {
|
7661 | if (this.datepickerAdapter.isValid(value, this.picker.format)) {
|
7662 | return this.datepickerAdapter.parse(value, this.picker.format);
|
7663 | }
|
7664 | return null;
|
7665 | };
|
7666 | NbDatepickerDirective.decorators = [
|
7667 | { type: i0.Directive, args: [{
|
7668 | selector: 'input[nbDatepicker]',
|
7669 | providers: [
|
7670 | {
|
7671 | provide: _angular_forms.NG_VALUE_ACCESSOR,
|
7672 | useExisting: i0.forwardRef(function () { return NbDatepickerDirective; }),
|
7673 | multi: true,
|
7674 | },
|
7675 | {
|
7676 | provide: _angular_forms.NG_VALIDATORS,
|
7677 | useExisting: i0.forwardRef(function () { return NbDatepickerDirective; }),
|
7678 | multi: true,
|
7679 | },
|
7680 | ],
|
7681 | },] }
|
7682 | ];
|
7683 | NbDatepickerDirective.ctorParameters = function () { return [
|
7684 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
7685 | { type: Array, decorators: [{ type: i0.Inject, args: [NB_DATE_ADAPTER,] }] },
|
7686 | { type: i0.ElementRef },
|
7687 | { type: NbDateService },
|
7688 | { type: i0.ChangeDetectorRef }
|
7689 | ]; };
|
7690 | NbDatepickerDirective.propDecorators = {
|
7691 | setPicker: [{ type: i0.Input, args: ['nbDatepicker',] }]
|
7692 | };
|
7693 | return NbDatepickerDirective;
|
7694 | }());
|
7695 |
|
7696 |
|
7697 |
|
7698 |
|
7699 |
|
7700 |
|
7701 |
|
7702 |
|
7703 |
|
7704 | var NbBasePicker = (function (_super) {
|
7705 | tslib.__extends(NbBasePicker, _super);
|
7706 | function NbBasePicker(overlay, positionBuilder, triggerStrategyBuilder, cfr, dateService, dateServiceOptions) {
|
7707 | var _this = _super.call(this) || this;
|
7708 | _this.overlay = overlay;
|
7709 | _this.positionBuilder = positionBuilder;
|
7710 | _this.triggerStrategyBuilder = triggerStrategyBuilder;
|
7711 | _this.cfr = cfr;
|
7712 | _this.dateService = dateService;
|
7713 | _this.dateServiceOptions = dateServiceOptions;
|
7714 | _this.init$ = new rxjs.ReplaySubject();
|
7715 | |
7716 |
|
7717 |
|
7718 |
|
7719 | _this.onChange$ = new rxjs.Subject();
|
7720 | _this.overlayOffset = 8;
|
7721 | _this.destroy$ = new rxjs.Subject();
|
7722 | _this.blur$ = new rxjs.Subject();
|
7723 | return _this;
|
7724 | }
|
7725 | Object.defineProperty(NbBasePicker.prototype, "picker", {
|
7726 | |
7727 |
|
7728 |
|
7729 | get: function () {
|
7730 | return this.pickerRef && this.pickerRef.instance;
|
7731 | },
|
7732 | enumerable: false,
|
7733 | configurable: true
|
7734 | });
|
7735 | Object.defineProperty(NbBasePicker.prototype, "valueChange", {
|
7736 | |
7737 |
|
7738 |
|
7739 | get: function () {
|
7740 | return this.onChange$.asObservable();
|
7741 | },
|
7742 | enumerable: false,
|
7743 | configurable: true
|
7744 | });
|
7745 | Object.defineProperty(NbBasePicker.prototype, "isShown", {
|
7746 | get: function () {
|
7747 | return this.ref && this.ref.hasAttached();
|
7748 | },
|
7749 | enumerable: false,
|
7750 | configurable: true
|
7751 | });
|
7752 | Object.defineProperty(NbBasePicker.prototype, "init", {
|
7753 | get: function () {
|
7754 | return this.init$.asObservable();
|
7755 | },
|
7756 | enumerable: false,
|
7757 | configurable: true
|
7758 | });
|
7759 | Object.defineProperty(NbBasePicker.prototype, "blur", {
|
7760 | |
7761 |
|
7762 |
|
7763 | get: function () {
|
7764 | return this.blur$.asObservable();
|
7765 | },
|
7766 | enumerable: false,
|
7767 | configurable: true
|
7768 | });
|
7769 | |
7770 |
|
7771 |
|
7772 |
|
7773 | NbBasePicker.prototype.attach = function (hostRef) {
|
7774 | this.hostRef = hostRef;
|
7775 | this.subscribeOnTriggers();
|
7776 | };
|
7777 | NbBasePicker.prototype.getValidatorConfig = function () {
|
7778 | return { min: this.min, max: this.max, filter: this.filter };
|
7779 | };
|
7780 | NbBasePicker.prototype.show = function () {
|
7781 | if (!this.ref) {
|
7782 | this.createOverlay();
|
7783 | }
|
7784 | this.openDatepicker();
|
7785 | };
|
7786 | NbBasePicker.prototype.shouldHide = function () {
|
7787 | return this.hideOnSelect && !!this.value;
|
7788 | };
|
7789 | NbBasePicker.prototype.hide = function () {
|
7790 | if (this.ref) {
|
7791 | this.ref.detach();
|
7792 | }
|
7793 |
|
7794 | if (this.picker) {
|
7795 | this.queue = this.value;
|
7796 | this.pickerRef.destroy();
|
7797 | this.pickerRef = null;
|
7798 | this.container = null;
|
7799 | }
|
7800 | };
|
7801 | NbBasePicker.prototype.createOverlay = function () {
|
7802 | this.positionStrategy = this.createPositionStrategy();
|
7803 | this.ref = this.overlay.create({
|
7804 | positionStrategy: this.positionStrategy,
|
7805 | scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
7806 | });
|
7807 | this.subscribeOnPositionChange();
|
7808 | };
|
7809 | NbBasePicker.prototype.openDatepicker = function () {
|
7810 | this.container = this.ref.attach(new NbComponentPortal(NbDatepickerContainerComponent, null, null, this.cfr));
|
7811 | this.instantiatePicker();
|
7812 | this.subscribeOnValueChange();
|
7813 | this.writeQueue();
|
7814 | this.patchWithInputs();
|
7815 | this.pickerRef.changeDetectorRef.markForCheck();
|
7816 | };
|
7817 | NbBasePicker.prototype.createPositionStrategy = function () {
|
7818 | return this.positionBuilder
|
7819 | .connectedTo(this.hostRef)
|
7820 | .position(exports.NbPosition.BOTTOM)
|
7821 | .offset(this.overlayOffset)
|
7822 | .adjustment(exports.NbAdjustment.COUNTERCLOCKWISE);
|
7823 | };
|
7824 | NbBasePicker.prototype.subscribeOnPositionChange = function () {
|
7825 | var _this = this;
|
7826 | this.positionStrategy.positionChange
|
7827 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
7828 | .subscribe(function (position) { return patch(_this.container, { position: position }); });
|
7829 | };
|
7830 | NbBasePicker.prototype.createTriggerStrategy = function () {
|
7831 | var _this = this;
|
7832 | return this.triggerStrategyBuilder
|
7833 | .trigger(exports.NbTrigger.FOCUS)
|
7834 | .host(this.hostRef.nativeElement)
|
7835 | .container(function () { return _this.container; })
|
7836 | .build();
|
7837 | };
|
7838 | NbBasePicker.prototype.subscribeOnTriggers = function () {
|
7839 | var _this = this;
|
7840 | this.triggerStrategy = this.createTriggerStrategy();
|
7841 | this.triggerStrategy.show$.subscribe(function () { return _this.show(); });
|
7842 | this.triggerStrategy.hide$.subscribe(function () {
|
7843 | _this.blur$.next();
|
7844 | _this.hide();
|
7845 | });
|
7846 | };
|
7847 | NbBasePicker.prototype.instantiatePicker = function () {
|
7848 | this.pickerRef = this.container.instance.attach(new NbComponentPortal(this.pickerClass, null, null, this.cfr));
|
7849 | };
|
7850 | |
7851 |
|
7852 |
|
7853 | NbBasePicker.prototype.subscribeOnValueChange = function () {
|
7854 | var _this = this;
|
7855 | this.pickerValueChange.subscribe(function (date) {
|
7856 | _this.onChange$.next(date);
|
7857 | });
|
7858 | };
|
7859 | NbBasePicker.prototype.patchWithInputs = function () {
|
7860 | this.picker.boundingMonth = this.boundingMonth;
|
7861 | this.picker.startView = this.startView;
|
7862 | this.picker.min = this.min;
|
7863 | this.picker.max = this.max;
|
7864 | this.picker.filter = this.filter;
|
7865 | this.picker._cellComponent = this.dayCellComponent;
|
7866 | this.picker._monthCellComponent = this.monthCellComponent;
|
7867 | this.picker._yearCellComponent = this.yearCellComponent;
|
7868 | this.picker.size = this.size;
|
7869 | this.picker.showNavigation = this.showNavigation;
|
7870 | this.picker.visibleDate = this.visibleDate;
|
7871 | this.picker.showWeekNumber = this.showWeekNumber;
|
7872 | this.picker.weekNumberSymbol = this.weekNumberSymbol;
|
7873 | };
|
7874 | NbBasePicker.prototype.checkFormat = function () {
|
7875 | if (this.dateService.getId() === 'native' && this.format) {
|
7876 | throw new Error('Can\'t format native date. To use custom formatting you have to install @nebular/moment or ' +
|
7877 | '@nebular/date-fns package and import NbMomentDateModule or NbDateFnsDateModule accordingly.' +
|
7878 | 'More information at "Formatting issue" ' +
|
7879 | 'https://akveo.github.io/nebular/docs/components/datepicker/overview#nbdatepickercomponent');
|
7880 | }
|
7881 | var isFormatSet = this.format || (this.dateServiceOptions && this.dateServiceOptions.format);
|
7882 | if (this.dateService.getId() === 'date-fns' && !isFormatSet) {
|
7883 | throw new Error('format is required when using NbDateFnsDateModule');
|
7884 | }
|
7885 | };
|
7886 | return NbBasePicker;
|
7887 | }(NbDatepicker));
|
7888 | var NbBasePickerComponent = (function (_super) {
|
7889 | tslib.__extends(NbBasePickerComponent, _super);
|
7890 | function NbBasePickerComponent(document, positionBuilder, triggerStrategyBuilder, overlay, cfr, dateService, dateServiceOptions) {
|
7891 | var _this = _super.call(this, overlay, positionBuilder, triggerStrategyBuilder, cfr, dateService, dateServiceOptions) || this;
|
7892 | |
7893 |
|
7894 |
|
7895 |
|
7896 | _this.boundingMonth = true;
|
7897 | |
7898 |
|
7899 |
|
7900 | _this.startView = exports.NbCalendarViewMode.DATE;
|
7901 | |
7902 |
|
7903 |
|
7904 |
|
7905 | _this.size = exports.NbCalendarSize.MEDIUM;
|
7906 | |
7907 |
|
7908 |
|
7909 |
|
7910 | _this.hideOnSelect = true;
|
7911 | |
7912 |
|
7913 |
|
7914 |
|
7915 | _this.showNavigation = true;
|
7916 | |
7917 |
|
7918 |
|
7919 | _this.weekNumberSymbol = '#';
|
7920 | _this._showWeekNumber = false;
|
7921 | |
7922 |
|
7923 |
|
7924 | _this.overlayOffset = 8;
|
7925 | return _this;
|
7926 | }
|
7927 | Object.defineProperty(NbBasePickerComponent.prototype, "showWeekNumber", {
|
7928 | |
7929 |
|
7930 |
|
7931 |
|
7932 | get: function () {
|
7933 | return this._showWeekNumber;
|
7934 | },
|
7935 | set: function (value) {
|
7936 | this._showWeekNumber = convertToBoolProperty(value);
|
7937 | },
|
7938 | enumerable: false,
|
7939 | configurable: true
|
7940 | });
|
7941 | NbBasePickerComponent.prototype.ngOnInit = function () {
|
7942 | this.checkFormat();
|
7943 | };
|
7944 | NbBasePickerComponent.prototype.ngOnChanges = function (changes) {
|
7945 | if (changes.format && !changes.format.isFirstChange()) {
|
7946 | this.checkFormat();
|
7947 | }
|
7948 | };
|
7949 | NbBasePickerComponent.prototype.ngAfterViewInit = function () {
|
7950 | this.init$.next();
|
7951 | };
|
7952 | NbBasePickerComponent.prototype.ngOnDestroy = function () {
|
7953 | this.destroy$.next();
|
7954 | this.destroy$.complete();
|
7955 | this.hide();
|
7956 | this.init$.complete();
|
7957 | if (this.ref) {
|
7958 | this.ref.dispose();
|
7959 | }
|
7960 | if (this.triggerStrategy) {
|
7961 | this.triggerStrategy.destroy();
|
7962 | }
|
7963 | };
|
7964 | Object.defineProperty(NbBasePickerComponent.prototype, "pickerValueChange", {
|
7965 | get: function () {
|
7966 | return;
|
7967 | },
|
7968 | enumerable: false,
|
7969 | configurable: true
|
7970 | });
|
7971 | Object.defineProperty(NbBasePickerComponent.prototype, "value", {
|
7972 | get: function () {
|
7973 | return undefined;
|
7974 | },
|
7975 | set: function (value) { },
|
7976 | enumerable: false,
|
7977 | configurable: true
|
7978 | });
|
7979 | NbBasePickerComponent.prototype.writeQueue = function () {
|
7980 | };
|
7981 | NbBasePickerComponent.decorators = [
|
7982 | { type: i0.Component, args: [{
|
7983 | template: ''
|
7984 | },] }
|
7985 | ];
|
7986 | NbBasePickerComponent.ctorParameters = function () { return [
|
7987 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
7988 | { type: NbPositionBuilderService },
|
7989 | { type: NbTriggerStrategyBuilderService },
|
7990 | { type: NbOverlayService },
|
7991 | { type: i0.ComponentFactoryResolver },
|
7992 | { type: NbDateService },
|
7993 | { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [NB_DATE_SERVICE_OPTIONS,] }] }
|
7994 | ]; };
|
7995 | NbBasePickerComponent.propDecorators = {
|
7996 | format: [{ type: i0.Input }],
|
7997 | boundingMonth: [{ type: i0.Input }],
|
7998 | startView: [{ type: i0.Input }],
|
7999 | min: [{ type: i0.Input }],
|
8000 | max: [{ type: i0.Input }],
|
8001 | filter: [{ type: i0.Input }],
|
8002 | dayCellComponent: [{ type: i0.Input }],
|
8003 | monthCellComponent: [{ type: i0.Input }],
|
8004 | yearCellComponent: [{ type: i0.Input }],
|
8005 | size: [{ type: i0.Input }],
|
8006 | visibleDate: [{ type: i0.Input }],
|
8007 | hideOnSelect: [{ type: i0.Input }],
|
8008 | showNavigation: [{ type: i0.Input }],
|
8009 | weekNumberSymbol: [{ type: i0.Input }],
|
8010 | showWeekNumber: [{ type: i0.Input }],
|
8011 | overlayOffset: [{ type: i0.Input }]
|
8012 | };
|
8013 | return NbBasePickerComponent;
|
8014 | }(NbBasePicker));
|
8015 |
|
8016 |
|
8017 |
|
8018 |
|
8019 | var NbDatepickerComponent = (function (_super) {
|
8020 | tslib.__extends(NbDatepickerComponent, _super);
|
8021 | function NbDatepickerComponent() {
|
8022 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
8023 | _this.pickerClass = NbCalendarComponent;
|
8024 | return _this;
|
8025 | }
|
8026 | Object.defineProperty(NbDatepickerComponent.prototype, "date", {
|
8027 | |
8028 |
|
8029 |
|
8030 | set: function (date) {
|
8031 | this.value = date;
|
8032 | },
|
8033 | enumerable: false,
|
8034 | configurable: true
|
8035 | });
|
8036 | Object.defineProperty(NbDatepickerComponent.prototype, "dateChange", {
|
8037 | |
8038 |
|
8039 |
|
8040 | get: function () {
|
8041 | return this.valueChange;
|
8042 | },
|
8043 | enumerable: false,
|
8044 | configurable: true
|
8045 | });
|
8046 | Object.defineProperty(NbDatepickerComponent.prototype, "value", {
|
8047 | get: function () {
|
8048 | return this.picker ? this.picker.date : undefined;
|
8049 | },
|
8050 | set: function (date) {
|
8051 | if (!this.picker) {
|
8052 | this.queue = date;
|
8053 | return;
|
8054 | }
|
8055 | if (date) {
|
8056 | this.visibleDate = date;
|
8057 | this.picker.visibleDate = date;
|
8058 | this.picker.date = date;
|
8059 | }
|
8060 | },
|
8061 | enumerable: false,
|
8062 | configurable: true
|
8063 | });
|
8064 | Object.defineProperty(NbDatepickerComponent.prototype, "pickerValueChange", {
|
8065 | get: function () {
|
8066 | return this.picker.dateChange;
|
8067 | },
|
8068 | enumerable: false,
|
8069 | configurable: true
|
8070 | });
|
8071 | NbDatepickerComponent.prototype.writeQueue = function () {
|
8072 | if (this.queue) {
|
8073 | var date = this.queue;
|
8074 | this.queue = null;
|
8075 | this.value = date;
|
8076 | }
|
8077 | };
|
8078 | NbDatepickerComponent.decorators = [
|
8079 | { type: i0.Component, args: [{
|
8080 | selector: 'nb-datepicker',
|
8081 | template: ''
|
8082 | },] }
|
8083 | ];
|
8084 | NbDatepickerComponent.propDecorators = {
|
8085 | date: [{ type: i0.Input }],
|
8086 | dateChange: [{ type: i0.Output }]
|
8087 | };
|
8088 | return NbDatepickerComponent;
|
8089 | }(NbBasePickerComponent));
|
8090 |
|
8091 |
|
8092 |
|
8093 |
|
8094 | var NbRangepickerComponent = (function (_super) {
|
8095 | tslib.__extends(NbRangepickerComponent, _super);
|
8096 | function NbRangepickerComponent() {
|
8097 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
8098 | _this.pickerClass = NbCalendarRangeComponent;
|
8099 | return _this;
|
8100 | }
|
8101 | Object.defineProperty(NbRangepickerComponent.prototype, "range", {
|
8102 | |
8103 |
|
8104 |
|
8105 | set: function (range) {
|
8106 | this.value = range;
|
8107 | },
|
8108 | enumerable: false,
|
8109 | configurable: true
|
8110 | });
|
8111 | Object.defineProperty(NbRangepickerComponent.prototype, "rangeChange", {
|
8112 | |
8113 |
|
8114 |
|
8115 | get: function () {
|
8116 | return this.valueChange;
|
8117 | },
|
8118 | enumerable: false,
|
8119 | configurable: true
|
8120 | });
|
8121 | Object.defineProperty(NbRangepickerComponent.prototype, "value", {
|
8122 | get: function () {
|
8123 | return this.picker ? this.picker.range : undefined;
|
8124 | },
|
8125 | set: function (range) {
|
8126 | if (!this.picker) {
|
8127 | this.queue = range;
|
8128 | return;
|
8129 | }
|
8130 | if (range) {
|
8131 | var visibleDate = range && range.start;
|
8132 | this.visibleDate = visibleDate;
|
8133 | this.picker.visibleDate = visibleDate;
|
8134 | this.picker.range = range;
|
8135 | }
|
8136 | },
|
8137 | enumerable: false,
|
8138 | configurable: true
|
8139 | });
|
8140 | Object.defineProperty(NbRangepickerComponent.prototype, "pickerValueChange", {
|
8141 | get: function () {
|
8142 | return this.picker.rangeChange;
|
8143 | },
|
8144 | enumerable: false,
|
8145 | configurable: true
|
8146 | });
|
8147 | NbRangepickerComponent.prototype.shouldHide = function () {
|
8148 | return _super.prototype.shouldHide.call(this) && !!(this.value && this.value.start && this.value.end);
|
8149 | };
|
8150 | NbRangepickerComponent.prototype.writeQueue = function () {
|
8151 | if (this.queue) {
|
8152 | var range = this.queue;
|
8153 | this.queue = null;
|
8154 | this.value = range;
|
8155 | }
|
8156 | };
|
8157 | NbRangepickerComponent.decorators = [
|
8158 | { type: i0.Component, args: [{
|
8159 | selector: 'nb-rangepicker',
|
8160 | template: ''
|
8161 | },] }
|
8162 | ];
|
8163 | NbRangepickerComponent.propDecorators = {
|
8164 | range: [{ type: i0.Input }],
|
8165 | rangeChange: [{ type: i0.Output }]
|
8166 | };
|
8167 | return NbRangepickerComponent;
|
8168 | }(NbBasePickerComponent));
|
8169 |
|
8170 | var NbDateTimePickerComponent = (function (_super) {
|
8171 | tslib.__extends(NbDateTimePickerComponent, _super);
|
8172 | function NbDateTimePickerComponent(document, positionBuilder, triggerStrategyBuilder, overlay, cfr, dateService, dateServiceOptions, calendarWithTimeModelService) {
|
8173 | var _this = _super.call(this, document, positionBuilder, triggerStrategyBuilder, overlay, cfr, dateService, dateServiceOptions) || this;
|
8174 | _this.calendarWithTimeModelService = calendarWithTimeModelService;
|
8175 | _this.pickerClass = NbCalendarWithTimeComponent;
|
8176 | return _this;
|
8177 | }
|
8178 | Object.defineProperty(NbDateTimePickerComponent.prototype, "value", {
|
8179 | get: function () {
|
8180 | return this.picker ? this.picker.date : undefined;
|
8181 | },
|
8182 | set: function (date) {
|
8183 | if (!this.picker) {
|
8184 | this.queue = date;
|
8185 | return;
|
8186 | }
|
8187 | if (date) {
|
8188 | this.visibleDate = date;
|
8189 | this.picker.visibleDate = date;
|
8190 | this.picker.date = date;
|
8191 | this.picker.cd.markForCheck();
|
8192 | }
|
8193 | },
|
8194 | enumerable: false,
|
8195 | configurable: true
|
8196 | });
|
8197 | Object.defineProperty(NbDateTimePickerComponent.prototype, "twelveHoursFormat", {
|
8198 | get: function () {
|
8199 | return this._twelveHoursFormat;
|
8200 | },
|
8201 | set: function (value) {
|
8202 | this._twelveHoursFormat = convertToBoolProperty(value);
|
8203 | },
|
8204 | enumerable: false,
|
8205 | configurable: true
|
8206 | });
|
8207 | Object.defineProperty(NbDateTimePickerComponent.prototype, "withSeconds", {
|
8208 | get: function () {
|
8209 | return this._withSeconds;
|
8210 | },
|
8211 | set: function (value) {
|
8212 | this._withSeconds = convertToBoolProperty(value);
|
8213 | },
|
8214 | enumerable: false,
|
8215 | configurable: true
|
8216 | });
|
8217 | Object.defineProperty(NbDateTimePickerComponent.prototype, "singleColumn", {
|
8218 | get: function () {
|
8219 | return this._singleColumn;
|
8220 | },
|
8221 | set: function (value) {
|
8222 | this._singleColumn = convertToBoolProperty(value);
|
8223 | },
|
8224 | enumerable: false,
|
8225 | configurable: true
|
8226 | });
|
8227 | NbDateTimePickerComponent.prototype.ngOnInit = function () {
|
8228 | this.format = this.format || this.buildTimeFormat();
|
8229 | };
|
8230 | NbDateTimePickerComponent.prototype.patchWithInputs = function () {
|
8231 | this.picker.singleColumn = this.singleColumn;
|
8232 | this.picker.twelveHoursFormat = this.twelveHoursFormat;
|
8233 | this.picker.withSeconds = this.withSeconds;
|
8234 | this.picker.step = this.step;
|
8235 | this.picker.title = this.title;
|
8236 | this.picker.applyButtonText = this.applyButtonText;
|
8237 | this.picker.currentTimeButtonText = this.currentTimeButtonText;
|
8238 | if (this.twelveHoursFormat) {
|
8239 | this.picker.timeFormat = this.dateService.getTwelveHoursFormat();
|
8240 | }
|
8241 | else {
|
8242 | this.picker.timeFormat = this.withSeconds ? this.dateService.getTwentyFourHoursFormatWithSeconds() :
|
8243 | this.dateService.getTwentyFourHoursFormat();
|
8244 | }
|
8245 | _super.prototype.patchWithInputs.call(this);
|
8246 | this.picker.cd.markForCheck();
|
8247 | };
|
8248 | Object.defineProperty(NbDateTimePickerComponent.prototype, "pickerValueChange", {
|
8249 | get: function () {
|
8250 | return this.picker.dateChange;
|
8251 | },
|
8252 | enumerable: false,
|
8253 | configurable: true
|
8254 | });
|
8255 | NbDateTimePickerComponent.prototype.writeQueue = function () {
|
8256 | if (this.queue) {
|
8257 | var date = this.queue;
|
8258 | this.queue = null;
|
8259 | this.value = date;
|
8260 | }
|
8261 | };
|
8262 | NbDateTimePickerComponent.prototype.buildTimeFormat = function () {
|
8263 | if (this.singleColumn) {
|
8264 | return this.calendarWithTimeModelService.buildDateFormat(this.twelveHoursFormat);
|
8265 | }
|
8266 | else {
|
8267 | return this.calendarWithTimeModelService.buildDateFormat(this.twelveHoursFormat, this.withSeconds);
|
8268 | }
|
8269 | };
|
8270 | NbDateTimePickerComponent.decorators = [
|
8271 | { type: i0.Component, args: [{
|
8272 | selector: 'nb-date-timepicker',
|
8273 | template: '',
|
8274 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
8275 | },] }
|
8276 | ];
|
8277 | NbDateTimePickerComponent.ctorParameters = function () { return [
|
8278 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
8279 | { type: NbPositionBuilderService },
|
8280 | { type: NbTriggerStrategyBuilderService },
|
8281 | { type: NbOverlayService },
|
8282 | { type: i0.ComponentFactoryResolver },
|
8283 | { type: NbDateService },
|
8284 | { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [NB_DATE_SERVICE_OPTIONS,] }] },
|
8285 | { type: NbCalendarTimeModelService }
|
8286 | ]; };
|
8287 | NbDateTimePickerComponent.propDecorators = {
|
8288 | step: [{ type: i0.Input }],
|
8289 | title: [{ type: i0.Input }],
|
8290 | applyButtonText: [{ type: i0.Input }],
|
8291 | currentTimeButtonText: [{ type: i0.Input }],
|
8292 | twelveHoursFormat: [{ type: i0.Input }],
|
8293 | withSeconds: [{ type: i0.Input }],
|
8294 | singleColumn: [{ type: i0.Input }]
|
8295 | };
|
8296 | return NbDateTimePickerComponent;
|
8297 | }(NbBasePickerComponent));
|
8298 |
|
8299 |
|
8300 |
|
8301 |
|
8302 |
|
8303 |
|
8304 | function isUrlPathEqual(path, link) {
|
8305 | var locationPath = getPathPartOfUrl(path);
|
8306 | return link === locationPath;
|
8307 | }
|
8308 | function isUrlPathContain(path, link) {
|
8309 | var locationPath = getPathPartOfUrl(path);
|
8310 | var endOfUrlSegmentRegExp = /\/|^$/;
|
8311 | return locationPath.startsWith(link) &&
|
8312 | locationPath.slice(link.length).charAt(0).search(endOfUrlSegmentRegExp) !== -1;
|
8313 | }
|
8314 | function getPathPartOfUrl(url) {
|
8315 | return url.match(/.*?(?=[?;#]|$)/)[0];
|
8316 | }
|
8317 | function getFragmentPartOfUrl(url) {
|
8318 | var matched = url.match(/#(.+)/);
|
8319 | return matched ? matched[1] : '';
|
8320 | }
|
8321 | function isFragmentEqual(path, fragment) {
|
8322 | return getFragmentPartOfUrl(path) === fragment;
|
8323 | }
|
8324 | function isFragmentContain(path, fragment) {
|
8325 | return getFragmentPartOfUrl(path).includes(fragment);
|
8326 | }
|
8327 |
|
8328 |
|
8329 |
|
8330 |
|
8331 |
|
8332 |
|
8333 |
|
8334 |
|
8335 | var NbRestoreScrollTopHelper = (function () {
|
8336 | function NbRestoreScrollTopHelper(router) {
|
8337 | this.router = router;
|
8338 | }
|
8339 | NbRestoreScrollTopHelper.prototype.shouldRestore = function () {
|
8340 | var _this = this;
|
8341 | return this.router.events
|
8342 | .pipe(rxjs_operators.startWith(null), rxjs_operators.filter(function (event) { return event === null || event instanceof _angular_router.NavigationEnd; }), rxjs_operators.pairwise(), rxjs_operators.map(function (_a) {
|
8343 | var prev = _a[0], current = _a[1];
|
8344 | return _this.pageChanged(prev, current);
|
8345 | }), rxjs_operators.filter(function (res) { return !!res; }));
|
8346 | };
|
8347 | NbRestoreScrollTopHelper.prototype.pageChanged = function (prev, current) {
|
8348 | return !prev || getPathPartOfUrl(prev.url) !== getPathPartOfUrl(current.url);
|
8349 | };
|
8350 | NbRestoreScrollTopHelper.decorators = [
|
8351 | { type: i0.Injectable }
|
8352 | ];
|
8353 | NbRestoreScrollTopHelper.ctorParameters = function () { return [
|
8354 | { type: _angular_router.Router }
|
8355 | ]; };
|
8356 | return NbRestoreScrollTopHelper;
|
8357 | }());
|
8358 |
|
8359 |
|
8360 |
|
8361 |
|
8362 |
|
8363 |
|
8364 |
|
8365 |
|
8366 |
|
8367 |
|
8368 |
|
8369 |
|
8370 |
|
8371 |
|
8372 |
|
8373 |
|
8374 |
|
8375 |
|
8376 |
|
8377 |
|
8378 |
|
8379 |
|
8380 |
|
8381 |
|
8382 |
|
8383 |
|
8384 |
|
8385 |
|
8386 |
|
8387 |
|
8388 |
|
8389 |
|
8390 |
|
8391 |
|
8392 |
|
8393 |
|
8394 |
|
8395 |
|
8396 |
|
8397 |
|
8398 |
|
8399 |
|
8400 |
|
8401 |
|
8402 |
|
8403 |
|
8404 |
|
8405 |
|
8406 |
|
8407 |
|
8408 |
|
8409 |
|
8410 |
|
8411 |
|
8412 |
|
8413 |
|
8414 |
|
8415 |
|
8416 |
|
8417 |
|
8418 |
|
8419 |
|
8420 |
|
8421 |
|
8422 |
|
8423 |
|
8424 |
|
8425 |
|
8426 |
|
8427 |
|
8428 |
|
8429 |
|
8430 |
|
8431 |
|
8432 |
|
8433 |
|
8434 |
|
8435 |
|
8436 |
|
8437 |
|
8438 |
|
8439 |
|
8440 |
|
8441 |
|
8442 |
|
8443 |
|
8444 |
|
8445 |
|
8446 |
|
8447 |
|
8448 |
|
8449 |
|
8450 |
|
8451 |
|
8452 |
|
8453 |
|
8454 |
|
8455 |
|
8456 | var NbLayoutComponent = (function () {
|
8457 | function NbLayoutComponent(themeService, spinnerService, elementRef, renderer, window, document, platformId, layoutDirectionService, scrollService, rulerService, scrollTop, overlayContainer) {
|
8458 | var _this = this;
|
8459 | this.themeService = themeService;
|
8460 | this.spinnerService = spinnerService;
|
8461 | this.elementRef = elementRef;
|
8462 | this.renderer = renderer;
|
8463 | this.window = window;
|
8464 | this.document = document;
|
8465 | this.platformId = platformId;
|
8466 | this.layoutDirectionService = layoutDirectionService;
|
8467 | this.scrollService = scrollService;
|
8468 | this.rulerService = rulerService;
|
8469 | this.scrollTop = scrollTop;
|
8470 | this.overlayContainer = overlayContainer;
|
8471 | this.scrollBlockClass = 'nb-global-scrollblock';
|
8472 | this.isScrollBlocked = false;
|
8473 | this.centerValue = false;
|
8474 | this.restoreScrollTopValue = true;
|
8475 | this.windowModeValue = false;
|
8476 | this.withScrollValue = false;
|
8477 | this.withSubheader = false;
|
8478 | this.afterViewInit$ = new rxjs.BehaviorSubject(null);
|
8479 | this.destroy$ = new rxjs.Subject();
|
8480 | this.registerAsOverlayContainer();
|
8481 | this.themeService.onThemeChange()
|
8482 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
8483 | .subscribe(function (theme) {
|
8484 | var body = _this.document.getElementsByTagName('body')[0];
|
8485 | if (theme.previous) {
|
8486 | _this.renderer.removeClass(body, "nb-theme-" + theme.previous);
|
8487 | }
|
8488 | _this.renderer.addClass(body, "nb-theme-" + theme.name);
|
8489 | });
|
8490 | this.themeService.onAppendLayoutClass()
|
8491 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
8492 | .subscribe(function (className) {
|
8493 | _this.renderer.addClass(_this.elementRef.nativeElement, className);
|
8494 | });
|
8495 | this.themeService.onRemoveLayoutClass()
|
8496 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
8497 | .subscribe(function (className) {
|
8498 | _this.renderer.removeClass(_this.elementRef.nativeElement, className);
|
8499 | });
|
8500 | this.spinnerService.registerLoader(new Promise(function (resolve) {
|
8501 | _this.afterViewInit$
|
8502 | .pipe(rxjs_operators.takeUntil(_this.destroy$))
|
8503 | .subscribe(function (_) { return resolve(); });
|
8504 | }));
|
8505 | this.spinnerService.load();
|
8506 | this.rulerService.onGetDimensions()
|
8507 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
8508 | .subscribe(function (_a) {
|
8509 | var listener = _a.listener;
|
8510 | listener.next(_this.getDimensions());
|
8511 | listener.complete();
|
8512 | });
|
8513 | this.scrollService
|
8514 | .onScrollableChange()
|
8515 | .pipe(rxjs_operators.filter(function () { return _this.withScrollValue; }))
|
8516 | .subscribe(function (scrollable) {
|
8517 | |
8518 |
|
8519 |
|
8520 |
|
8521 |
|
8522 | if (scrollable) {
|
8523 | _this.enableScroll();
|
8524 | }
|
8525 | else {
|
8526 | _this.blockScroll();
|
8527 | }
|
8528 | });
|
8529 | if (_angular_common.isPlatformBrowser(this.platformId)) {
|
8530 |
|
8531 | this.themeService.changeWindowWidth(this.window.innerWidth);
|
8532 | }
|
8533 | }
|
8534 | Object.defineProperty(NbLayoutComponent.prototype, "center", {
|
8535 | |
8536 |
|
8537 |
|
8538 |
|
8539 | set: function (val) {
|
8540 | this.centerValue = convertToBoolProperty(val);
|
8541 | },
|
8542 | enumerable: false,
|
8543 | configurable: true
|
8544 | });
|
8545 | Object.defineProperty(NbLayoutComponent.prototype, "windowMode", {
|
8546 | |
8547 |
|
8548 |
|
8549 |
|
8550 |
|
8551 |
|
8552 |
|
8553 | set: function (val) {
|
8554 | this.windowModeValue = convertToBoolProperty(val);
|
8555 | this.withScroll = this.windowModeValue;
|
8556 | },
|
8557 | enumerable: false,
|
8558 | configurable: true
|
8559 | });
|
8560 | Object.defineProperty(NbLayoutComponent.prototype, "withScroll", {
|
8561 | |
8562 |
|
8563 |
|
8564 |
|
8565 |
|
8566 | set: function (val) {
|
8567 | this.withScrollValue = convertToBoolProperty(val);
|
8568 |
|
8569 |
|
8570 | var body = this.document.getElementsByTagName('body')[0];
|
8571 | if (this.withScrollValue) {
|
8572 | this.renderer.setStyle(body, 'overflow', 'hidden');
|
8573 | }
|
8574 | else {
|
8575 | this.renderer.setStyle(body, 'overflow', 'initial');
|
8576 | }
|
8577 | },
|
8578 | enumerable: false,
|
8579 | configurable: true
|
8580 | });
|
8581 | Object.defineProperty(NbLayoutComponent.prototype, "restoreScrollTop", {
|
8582 | |
8583 |
|
8584 |
|
8585 |
|
8586 | set: function (val) {
|
8587 | this.restoreScrollTopValue = convertToBoolProperty(val);
|
8588 | },
|
8589 | enumerable: false,
|
8590 | configurable: true
|
8591 | });
|
8592 | NbLayoutComponent.prototype.ngAfterViewInit = function () {
|
8593 | var _this = this;
|
8594 | this.scrollService.onGetPosition()
|
8595 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
8596 | .subscribe(function (_a) {
|
8597 | var listener = _a.listener;
|
8598 | listener.next(_this.getScrollPosition());
|
8599 | listener.complete();
|
8600 | });
|
8601 | this.scrollTop.shouldRestore()
|
8602 | .pipe(rxjs_operators.filter(function () { return _this.restoreScrollTopValue; }), rxjs_operators.takeUntil(this.destroy$))
|
8603 | .subscribe(function () { return _this.scroll(0, 0); });
|
8604 | this.layoutDirectionService.onDirectionChange()
|
8605 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
8606 | .subscribe(function (direction) { return _this.document.dir = direction; });
|
8607 | this.scrollService.onManualScroll()
|
8608 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
8609 | .subscribe(function (_a) {
|
8610 | var x = _a.x, y = _a.y;
|
8611 | return _this.scroll(x, y);
|
8612 | });
|
8613 | this.afterViewInit$.next(true);
|
8614 | };
|
8615 | NbLayoutComponent.prototype.ngOnDestroy = function () {
|
8616 | this.destroy$.next();
|
8617 | this.destroy$.complete();
|
8618 | this.unregisterAsOverlayContainer();
|
8619 | };
|
8620 | NbLayoutComponent.prototype.onScroll = function ($event) {
|
8621 | this.scrollService.fireScrollChange($event);
|
8622 | };
|
8623 | NbLayoutComponent.prototype.onResize = function (event) {
|
8624 | this.themeService.changeWindowWidth(event.target.innerWidth);
|
8625 | };
|
8626 | |
8627 |
|
8628 |
|
8629 |
|
8630 |
|
8631 |
|
8632 |
|
8633 | NbLayoutComponent.prototype.getDimensions = function () {
|
8634 | var clientWidth, clientHeight, scrollWidth, scrollHeight = 0;
|
8635 | if (this.withScrollValue) {
|
8636 | var container = this.scrollableContainerRef.nativeElement;
|
8637 | clientWidth = container.clientWidth;
|
8638 | clientHeight = container.clientHeight;
|
8639 | scrollWidth = container.scrollWidth;
|
8640 | scrollHeight = container.scrollHeight;
|
8641 | }
|
8642 | else {
|
8643 | var _a = this.document, documentElement = _a.documentElement, body = _a.body;
|
8644 | clientWidth = documentElement.clientWidth || body.clientWidth;
|
8645 | clientHeight = documentElement.clientHeight || body.clientHeight;
|
8646 | scrollWidth = documentElement.scrollWidth || body.scrollWidth;
|
8647 | scrollHeight = documentElement.scrollHeight || body.scrollHeight;
|
8648 | }
|
8649 | return {
|
8650 | clientWidth: clientWidth,
|
8651 | clientHeight: clientHeight,
|
8652 | scrollWidth: scrollWidth,
|
8653 | scrollHeight: scrollHeight,
|
8654 | };
|
8655 | };
|
8656 | |
8657 |
|
8658 |
|
8659 |
|
8660 |
|
8661 |
|
8662 |
|
8663 |
|
8664 | NbLayoutComponent.prototype.getScrollPosition = function () {
|
8665 | if (!_angular_common.isPlatformBrowser(this.platformId)) {
|
8666 | return { x: 0, y: 0 };
|
8667 | }
|
8668 | if (this.withScrollValue) {
|
8669 | var container = this.scrollableContainerRef.nativeElement;
|
8670 | return { x: container.scrollLeft, y: container.scrollTop };
|
8671 | }
|
8672 | var documentRect = this.document.documentElement.getBoundingClientRect();
|
8673 | var x = -documentRect.left || this.document.body.scrollLeft || this.window.scrollX ||
|
8674 | this.document.documentElement.scrollLeft || 0;
|
8675 | var y = -documentRect.top || this.document.body.scrollTop || this.window.scrollY ||
|
8676 | this.document.documentElement.scrollTop || 0;
|
8677 | return { x: x, y: y };
|
8678 | };
|
8679 | NbLayoutComponent.prototype.registerAsOverlayContainer = function () {
|
8680 | if (this.overlayContainer.setContainer) {
|
8681 | this.overlayContainer.setContainer(this.elementRef.nativeElement);
|
8682 | }
|
8683 | };
|
8684 | NbLayoutComponent.prototype.unregisterAsOverlayContainer = function () {
|
8685 | if (this.overlayContainer.clearContainer) {
|
8686 | this.overlayContainer.clearContainer();
|
8687 | }
|
8688 | };
|
8689 | NbLayoutComponent.prototype.scroll = function (x, y) {
|
8690 | if (x === void 0) { x = null; }
|
8691 | if (y === void 0) { y = null; }
|
8692 | var _a = this.getScrollPosition(), currentX = _a.x, currentY = _a.y;
|
8693 | x = x == null ? currentX : x;
|
8694 | y = y == null ? currentY : y;
|
8695 | if (!_angular_common.isPlatformBrowser(this.platformId)) {
|
8696 | return;
|
8697 | }
|
8698 | if (this.withScrollValue) {
|
8699 | var scrollable = this.scrollableContainerRef.nativeElement;
|
8700 | if (scrollable.scrollTo) {
|
8701 | scrollable.scrollTo(x, y);
|
8702 | }
|
8703 | else {
|
8704 | scrollable.scrollLeft = x;
|
8705 | scrollable.scrollTop = y;
|
8706 | }
|
8707 | }
|
8708 | else {
|
8709 | this.window.scrollTo(x, y);
|
8710 | }
|
8711 | };
|
8712 |
|
8713 | NbLayoutComponent.prototype.blockScroll = function () {
|
8714 | if (this.isScrollBlocked) {
|
8715 | return;
|
8716 | }
|
8717 | this.isScrollBlocked = true;
|
8718 | this.renderer.addClass(this.document.documentElement, this.scrollBlockClass);
|
8719 | var scrollableContainerElement = this.scrollableContainerRef.nativeElement;
|
8720 | var layoutElement = this.layoutContainerRef.nativeElement;
|
8721 | var layoutWithScrollWidth = layoutElement.clientWidth;
|
8722 | this.scrollableContainerOverflowOldValue = scrollableContainerElement.style.overflow;
|
8723 | scrollableContainerElement.style.overflow = 'hidden';
|
8724 | var layoutWithoutScrollWidth = layoutElement.clientWidth;
|
8725 | var scrollWidth = layoutWithoutScrollWidth - layoutWithScrollWidth;
|
8726 | if (!scrollWidth) {
|
8727 | return;
|
8728 | }
|
8729 | this.layoutPaddingOldValue = {
|
8730 | left: layoutElement.style.paddingLeft,
|
8731 | right: layoutElement.style.paddingRight,
|
8732 | };
|
8733 | if (this.layoutDirectionService.isLtr()) {
|
8734 | layoutElement.style.paddingRight = scrollWidth + "px";
|
8735 | }
|
8736 | else {
|
8737 | layoutElement.style.paddingLeft = scrollWidth + "px";
|
8738 | }
|
8739 | };
|
8740 | NbLayoutComponent.prototype.enableScroll = function () {
|
8741 | if (this.isScrollBlocked) {
|
8742 | this.isScrollBlocked = false;
|
8743 | this.renderer.removeClass(this.document.documentElement, this.scrollBlockClass);
|
8744 | this.scrollableContainerRef.nativeElement.style.overflow = this.scrollableContainerOverflowOldValue;
|
8745 | if (this.layoutPaddingOldValue) {
|
8746 | var layoutElement = this.layoutContainerRef.nativeElement;
|
8747 | layoutElement.style.paddingLeft = this.layoutPaddingOldValue.left;
|
8748 | layoutElement.style.paddingRight = this.layoutPaddingOldValue.right;
|
8749 | this.layoutPaddingOldValue = null;
|
8750 | }
|
8751 | }
|
8752 | };
|
8753 | NbLayoutComponent.decorators = [
|
8754 | { type: i0.Component, args: [{
|
8755 | selector: 'nb-layout',
|
8756 | template: "\n <div class=\"scrollable-container\" #scrollableContainer (scroll)=\"onScroll($event)\">\n <div class=\"layout\" #layoutContainer>\n <ng-content select=\"nb-layout-header:not([subheader])\"></ng-content>\n <div class=\"layout-container\">\n <ng-content select=\"nb-sidebar\"></ng-content>\n <div class=\"content\" [class.center]=\"centerValue\">\n <ng-content select=\"nb-layout-header[subheader]\"></ng-content>\n <div class=\"columns\">\n <ng-content select=\"nb-layout-column\"></ng-content>\n </div>\n <ng-content select=\"nb-layout-footer\"></ng-content>\n </div>\n </div>\n </div>\n </div>\n ",
|
8757 | styles: [":host{-webkit-font-smoothing:antialiased}[dir=ltr] :host{text-align:left}[dir=rtl] :host{text-align:right}:host .layout{display:flex;flex-direction:column}:host ::ng-deep nb-layout-header{display:block}:host ::ng-deep nb-layout-header nav{align-items:center;justify-content:flex-start;display:flex}:host ::ng-deep nb-layout-header.fixed{position:fixed;top:0;left:0;right:0;z-index:1040}:host .layout-container{display:flex;flex:1;-ms-flex:1 1 auto;flex-direction:row}[dir=ltr] :host .layout-container ::ng-deep nb-sidebar.left{order:0}[dir=rtl] :host .layout-container ::ng-deep nb-sidebar.left{order:2}[dir=ltr] :host .layout-container ::ng-deep nb-sidebar.right{order:2}[dir=rtl] :host .layout-container ::ng-deep nb-sidebar.right{order:0}:host .layout-container ::ng-deep nb-sidebar.end{order:2}:host .layout-container ::ng-deep nb-sidebar .fixed{position:fixed;width:100%;overflow-y:auto;height:100%}:host .layout-container .content{display:flex;flex:1;-ms-flex:1 1 auto;flex-direction:column;min-width:0}:host .layout-container .content.center{max-width:100%;position:relative;margin-left:auto;margin-right:auto}:host .layout-container .content .columns{display:flex;flex:1;-ms-flex:1 1 auto;flex-direction:row;width:100%}:host .layout-container .content .columns ::ng-deep nb-layout-column{order:1;flex:1 0;min-width:0}[dir=ltr] :host .layout-container .content .columns ::ng-deep nb-layout-column.left{order:0}[dir=rtl] :host .layout-container .content .columns ::ng-deep nb-layout-column.left{order:2}:host .layout-container .content .columns ::ng-deep nb-layout-column.start{order:0}:host .layout-container .content ::ng-deep nb-layout-footer{display:block;margin-top:auto}:host .layout-container .content ::ng-deep nb-layout-footer nav{justify-content:center;display:flex}\n"]
|
8758 | },] }
|
8759 | ];
|
8760 | NbLayoutComponent.ctorParameters = function () { return [
|
8761 | { type: NbThemeService },
|
8762 | { type: NbSpinnerService },
|
8763 | { type: i0.ElementRef },
|
8764 | { type: i0.Renderer2 },
|
8765 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_WINDOW,] }] },
|
8766 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
8767 | { type: Object, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] },
|
8768 | { type: NbLayoutDirectionService },
|
8769 | { type: NbLayoutScrollService },
|
8770 | { type: NbLayoutRulerService },
|
8771 | { type: NbRestoreScrollTopHelper },
|
8772 | { type: NbOverlayContainerAdapter }
|
8773 | ]; };
|
8774 | NbLayoutComponent.propDecorators = {
|
8775 | windowModeValue: [{ type: i0.HostBinding, args: ['class.window-mode',] }],
|
8776 | withScrollValue: [{ type: i0.HostBinding, args: ['class.with-scroll',] }],
|
8777 | withSubheader: [{ type: i0.HostBinding, args: ['class.with-subheader',] }],
|
8778 | center: [{ type: i0.Input }],
|
8779 | windowMode: [{ type: i0.Input }],
|
8780 | withScroll: [{ type: i0.Input }],
|
8781 | restoreScrollTop: [{ type: i0.Input }],
|
8782 | veryTopRef: [{ type: i0.ViewChild, args: ['layoutTopDynamicArea', { read: i0.ViewContainerRef },] }],
|
8783 | scrollableContainerRef: [{ type: i0.ViewChild, args: ['scrollableContainer', { read: i0.ElementRef },] }],
|
8784 | layoutContainerRef: [{ type: i0.ViewChild, args: ['layoutContainer', { read: i0.ElementRef },] }],
|
8785 | onScroll: [{ type: i0.HostListener, args: ['window:scroll', ['$event'],] }],
|
8786 | onResize: [{ type: i0.HostListener, args: ['window:resize', ['$event'],] }]
|
8787 | };
|
8788 | return NbLayoutComponent;
|
8789 | }());
|
8790 |
|
8791 |
|
8792 |
|
8793 |
|
8794 |
|
8795 |
|
8796 |
|
8797 |
|
8798 |
|
8799 |
|
8800 | var NbLayoutColumnComponent = (function () {
|
8801 | function NbLayoutColumnComponent() {
|
8802 | }
|
8803 | Object.defineProperty(NbLayoutColumnComponent.prototype, "left", {
|
8804 | |
8805 |
|
8806 |
|
8807 |
|
8808 | set: function (val) {
|
8809 | this.leftValue = convertToBoolProperty(val);
|
8810 | this.startValue = false;
|
8811 | },
|
8812 | enumerable: false,
|
8813 | configurable: true
|
8814 | });
|
8815 | Object.defineProperty(NbLayoutColumnComponent.prototype, "start", {
|
8816 | |
8817 |
|
8818 |
|
8819 |
|
8820 | set: function (val) {
|
8821 | this.startValue = convertToBoolProperty(val);
|
8822 | this.leftValue = false;
|
8823 | },
|
8824 | enumerable: false,
|
8825 | configurable: true
|
8826 | });
|
8827 | NbLayoutColumnComponent.decorators = [
|
8828 | { type: i0.Component, args: [{
|
8829 | selector: 'nb-layout-column',
|
8830 | template: "\n <ng-content></ng-content>\n "
|
8831 | },] }
|
8832 | ];
|
8833 | NbLayoutColumnComponent.propDecorators = {
|
8834 | leftValue: [{ type: i0.HostBinding, args: ['class.left',] }],
|
8835 | startValue: [{ type: i0.HostBinding, args: ['class.start',] }],
|
8836 | left: [{ type: i0.Input }],
|
8837 | start: [{ type: i0.Input }]
|
8838 | };
|
8839 | return NbLayoutColumnComponent;
|
8840 | }());
|
8841 |
|
8842 |
|
8843 |
|
8844 |
|
8845 |
|
8846 |
|
8847 |
|
8848 |
|
8849 |
|
8850 |
|
8851 |
|
8852 |
|
8853 |
|
8854 |
|
8855 |
|
8856 |
|
8857 |
|
8858 |
|
8859 |
|
8860 |
|
8861 |
|
8862 |
|
8863 |
|
8864 |
|
8865 |
|
8866 |
|
8867 |
|
8868 |
|
8869 |
|
8870 |
|
8871 |
|
8872 |
|
8873 | var NbLayoutHeaderComponent = (function () {
|
8874 | function NbLayoutHeaderComponent(layout) {
|
8875 | this.layout = layout;
|
8876 | }
|
8877 | Object.defineProperty(NbLayoutHeaderComponent.prototype, "fixed", {
|
8878 | |
8879 |
|
8880 |
|
8881 |
|
8882 | set: function (val) {
|
8883 | this.fixedValue = convertToBoolProperty(val);
|
8884 | },
|
8885 | enumerable: false,
|
8886 | configurable: true
|
8887 | });
|
8888 | Object.defineProperty(NbLayoutHeaderComponent.prototype, "subheader", {
|
8889 | |
8890 |
|
8891 |
|
8892 |
|
8893 |
|
8894 | set: function (val) {
|
8895 | this.subheaderValue = convertToBoolProperty(val);
|
8896 | this.fixedValue = false;
|
8897 | this.layout.withSubheader = this.subheaderValue;
|
8898 | },
|
8899 | enumerable: false,
|
8900 | configurable: true
|
8901 | });
|
8902 | NbLayoutHeaderComponent.decorators = [
|
8903 | { type: i0.Component, args: [{
|
8904 | selector: 'nb-layout-header',
|
8905 | template: "\n <nav [class.fixed]=\"fixedValue\">\n <ng-content></ng-content>\n </nav>\n "
|
8906 | },] }
|
8907 | ];
|
8908 | NbLayoutHeaderComponent.ctorParameters = function () { return [
|
8909 | { type: NbLayoutComponent }
|
8910 | ]; };
|
8911 | NbLayoutHeaderComponent.propDecorators = {
|
8912 | fixedValue: [{ type: i0.HostBinding, args: ['class.fixed',] }],
|
8913 | subheaderValue: [{ type: i0.HostBinding, args: ['class.subheader',] }],
|
8914 | fixed: [{ type: i0.Input }],
|
8915 | subheader: [{ type: i0.Input }]
|
8916 | };
|
8917 | return NbLayoutHeaderComponent;
|
8918 | }());
|
8919 |
|
8920 |
|
8921 |
|
8922 |
|
8923 |
|
8924 |
|
8925 |
|
8926 |
|
8927 |
|
8928 |
|
8929 |
|
8930 |
|
8931 |
|
8932 |
|
8933 |
|
8934 |
|
8935 |
|
8936 |
|
8937 |
|
8938 |
|
8939 |
|
8940 | var NbLayoutFooterComponent = (function () {
|
8941 | function NbLayoutFooterComponent() {
|
8942 | }
|
8943 | Object.defineProperty(NbLayoutFooterComponent.prototype, "fixed", {
|
8944 | |
8945 |
|
8946 |
|
8947 |
|
8948 | set: function (val) {
|
8949 | this.fixedValue = convertToBoolProperty(val);
|
8950 | },
|
8951 | enumerable: false,
|
8952 | configurable: true
|
8953 | });
|
8954 | NbLayoutFooterComponent.decorators = [
|
8955 | { type: i0.Component, args: [{
|
8956 | selector: 'nb-layout-footer',
|
8957 | template: "\n <nav [class.fixed]=\"fixedValue\">\n <ng-content></ng-content>\n </nav>\n "
|
8958 | },] }
|
8959 | ];
|
8960 | NbLayoutFooterComponent.propDecorators = {
|
8961 | fixedValue: [{ type: i0.HostBinding, args: ['class.fixed',] }],
|
8962 | fixed: [{ type: i0.Input }]
|
8963 | };
|
8964 | return NbLayoutFooterComponent;
|
8965 | }());
|
8966 |
|
8967 |
|
8968 |
|
8969 |
|
8970 |
|
8971 |
|
8972 | var NB_LAYOUT_COMPONENTS = [
|
8973 | NbLayoutComponent,
|
8974 | NbLayoutColumnComponent,
|
8975 | NbLayoutFooterComponent,
|
8976 | NbLayoutHeaderComponent,
|
8977 | ];
|
8978 | var NbLayoutModule = (function () {
|
8979 | function NbLayoutModule() {
|
8980 | }
|
8981 | NbLayoutModule.decorators = [
|
8982 | { type: i0.NgModule, args: [{
|
8983 | imports: [
|
8984 | NbSharedModule,
|
8985 | ],
|
8986 | declarations: tslib.__spreadArray([], NB_LAYOUT_COMPONENTS),
|
8987 | providers: [
|
8988 | NbRestoreScrollTopHelper,
|
8989 | ],
|
8990 | exports: tslib.__spreadArray([], NB_LAYOUT_COMPONENTS),
|
8991 | },] }
|
8992 | ];
|
8993 | return NbLayoutModule;
|
8994 | }());
|
8995 |
|
8996 |
|
8997 |
|
8998 |
|
8999 |
|
9000 |
|
9001 | var itemClick$ = new rxjs.Subject();
|
9002 | var addItems$ = new rxjs.ReplaySubject(1);
|
9003 | var navigateHome$ = new rxjs.ReplaySubject(1);
|
9004 | var getSelectedItem$ = new rxjs.ReplaySubject(1);
|
9005 | var itemSelect$ = new rxjs.ReplaySubject(1);
|
9006 | var itemHover$ = new rxjs.ReplaySubject(1);
|
9007 | var submenuToggle$ = new rxjs.ReplaySubject(1);
|
9008 | var collapseAll$ = new rxjs.ReplaySubject(1);
|
9009 |
|
9010 |
|
9011 |
|
9012 |
|
9013 |
|
9014 |
|
9015 |
|
9016 |
|
9017 |
|
9018 | var NbMenuItem = (function () {
|
9019 | function NbMenuItem() {
|
9020 | |
9021 |
|
9022 |
|
9023 |
|
9024 | this.pathMatch = 'full';
|
9025 | }
|
9026 | |
9027 |
|
9028 |
|
9029 | NbMenuItem.getParents = function (item) {
|
9030 | var parents = [];
|
9031 | var parent = item.parent;
|
9032 | while (parent) {
|
9033 | parents.unshift(parent);
|
9034 | parent = parent.parent;
|
9035 | }
|
9036 | return parents;
|
9037 | };
|
9038 | NbMenuItem.isParent = function (item, possibleChild) {
|
9039 | return possibleChild.parent
|
9040 | ? possibleChild.parent === item || this.isParent(item, possibleChild.parent)
|
9041 | : false;
|
9042 | };
|
9043 | return NbMenuItem;
|
9044 | }());
|
9045 |
|
9046 |
|
9047 |
|
9048 |
|
9049 |
|
9050 |
|
9051 |
|
9052 |
|
9053 |
|
9054 |
|
9055 | var NbMenuService = (function () {
|
9056 | function NbMenuService() {
|
9057 | }
|
9058 | |
9059 |
|
9060 |
|
9061 |
|
9062 |
|
9063 | NbMenuService.prototype.addItems = function (items, tag) {
|
9064 | addItems$.next({ tag: tag, items: items });
|
9065 | };
|
9066 | |
9067 |
|
9068 |
|
9069 |
|
9070 | NbMenuService.prototype.collapseAll = function (tag) {
|
9071 | collapseAll$.next({ tag: tag });
|
9072 | };
|
9073 | |
9074 |
|
9075 |
|
9076 |
|
9077 | NbMenuService.prototype.navigateHome = function (tag) {
|
9078 | navigateHome$.next({ tag: tag });
|
9079 | };
|
9080 | |
9081 |
|
9082 |
|
9083 |
|
9084 |
|
9085 | NbMenuService.prototype.getSelectedItem = function (tag) {
|
9086 | var listener = new rxjs.BehaviorSubject(null);
|
9087 | getSelectedItem$.next({ tag: tag, listener: listener });
|
9088 | return listener.asObservable();
|
9089 | };
|
9090 | NbMenuService.prototype.onItemClick = function () {
|
9091 | return itemClick$.pipe(rxjs_operators.share());
|
9092 | };
|
9093 | NbMenuService.prototype.onItemSelect = function () {
|
9094 | return itemSelect$.pipe(rxjs_operators.share());
|
9095 | };
|
9096 | NbMenuService.prototype.onItemHover = function () {
|
9097 | return itemHover$.pipe(rxjs_operators.share());
|
9098 | };
|
9099 | NbMenuService.prototype.onSubmenuToggle = function () {
|
9100 | return submenuToggle$.pipe(rxjs_operators.share());
|
9101 | };
|
9102 | NbMenuService.decorators = [
|
9103 | { type: i0.Injectable }
|
9104 | ];
|
9105 | return NbMenuService;
|
9106 | }());
|
9107 | var NbMenuInternalService = (function () {
|
9108 | function NbMenuInternalService(location) {
|
9109 | this.location = location;
|
9110 | }
|
9111 | NbMenuInternalService.prototype.prepareItems = function (items) {
|
9112 | var _this = this;
|
9113 | var defaultItem = new NbMenuItem();
|
9114 | items.forEach(function (i) {
|
9115 | _this.applyDefaults(i, defaultItem);
|
9116 | _this.setParent(i);
|
9117 | });
|
9118 | };
|
9119 | NbMenuInternalService.prototype.selectFromUrl = function (items, tag, collapseOther) {
|
9120 | if (collapseOther === void 0) { collapseOther = false; }
|
9121 | var selectedItem = this.findItemByUrl(items);
|
9122 | if (selectedItem) {
|
9123 | this.selectItem(selectedItem, items, collapseOther, tag);
|
9124 | }
|
9125 | };
|
9126 | NbMenuInternalService.prototype.selectItem = function (item, items, collapseOther, tag) {
|
9127 | if (collapseOther === void 0) { collapseOther = false; }
|
9128 | var unselectedItems = this.resetSelection(items);
|
9129 | var collapsedItems = collapseOther ? this.collapseItems(items) : [];
|
9130 | for (var _i = 0, _a = NbMenuItem.getParents(item); _i < _a.length; _i++) {
|
9131 | var parent_1 = _a[_i];
|
9132 | parent_1.selected = true;
|
9133 |
|
9134 | if (!unselectedItems.includes(parent_1)) {
|
9135 | this.itemSelect(parent_1, tag);
|
9136 | }
|
9137 | var wasNotExpanded = !parent_1.expanded;
|
9138 | parent_1.expanded = true;
|
9139 | var i = collapsedItems.indexOf(parent_1);
|
9140 |
|
9141 |
|
9142 |
|
9143 |
|
9144 | if (i === -1 && wasNotExpanded) {
|
9145 | this.submenuToggle(parent_1, tag);
|
9146 | }
|
9147 | else {
|
9148 | collapsedItems.splice(i, 1);
|
9149 | }
|
9150 | }
|
9151 | item.selected = true;
|
9152 |
|
9153 | if (!unselectedItems.includes(item)) {
|
9154 | this.itemSelect(item, tag);
|
9155 | }
|
9156 |
|
9157 | for (var _b = 0, collapsedItems_1 = collapsedItems; _b < collapsedItems_1.length; _b++) {
|
9158 | var collapsedItem = collapsedItems_1[_b];
|
9159 | this.submenuToggle(collapsedItem, tag);
|
9160 | }
|
9161 | };
|
9162 | NbMenuInternalService.prototype.collapseAll = function (items, tag, except) {
|
9163 | var collapsedItems = this.collapseItems(items, except);
|
9164 | for (var _i = 0, collapsedItems_2 = collapsedItems; _i < collapsedItems_2.length; _i++) {
|
9165 | var item = collapsedItems_2[_i];
|
9166 | this.submenuToggle(item, tag);
|
9167 | }
|
9168 | };
|
9169 | NbMenuInternalService.prototype.onAddItem = function () {
|
9170 | return addItems$.pipe(rxjs_operators.share());
|
9171 | };
|
9172 | NbMenuInternalService.prototype.onNavigateHome = function () {
|
9173 | return navigateHome$.pipe(rxjs_operators.share());
|
9174 | };
|
9175 | NbMenuInternalService.prototype.onCollapseAll = function () {
|
9176 | return collapseAll$.pipe(rxjs_operators.share());
|
9177 | };
|
9178 | NbMenuInternalService.prototype.onGetSelectedItem = function () {
|
9179 | return getSelectedItem$.pipe(rxjs_operators.share());
|
9180 | };
|
9181 | NbMenuInternalService.prototype.itemHover = function (item, tag) {
|
9182 | itemHover$.next({ tag: tag, item: item });
|
9183 | };
|
9184 | NbMenuInternalService.prototype.submenuToggle = function (item, tag) {
|
9185 | submenuToggle$.next({ tag: tag, item: item });
|
9186 | };
|
9187 | NbMenuInternalService.prototype.itemSelect = function (item, tag) {
|
9188 | itemSelect$.next({ tag: tag, item: item });
|
9189 | };
|
9190 | NbMenuInternalService.prototype.itemClick = function (item, tag) {
|
9191 | itemClick$.next({ tag: tag, item: item });
|
9192 | };
|
9193 | |
9194 |
|
9195 |
|
9196 |
|
9197 |
|
9198 | NbMenuInternalService.prototype.resetSelection = function (items) {
|
9199 | var unselectedItems = [];
|
9200 | for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
|
9201 | var item = items_1[_i];
|
9202 | if (item.selected) {
|
9203 | unselectedItems.push(item);
|
9204 | }
|
9205 | item.selected = false;
|
9206 | if (item.children) {
|
9207 | unselectedItems.push.apply(unselectedItems, this.resetSelection(item.children));
|
9208 | }
|
9209 | }
|
9210 | return unselectedItems;
|
9211 | };
|
9212 | |
9213 |
|
9214 |
|
9215 |
|
9216 |
|
9217 |
|
9218 | NbMenuInternalService.prototype.collapseItems = function (items, except) {
|
9219 | var collapsedItems = [];
|
9220 | for (var _i = 0, items_2 = items; _i < items_2.length; _i++) {
|
9221 | var item = items_2[_i];
|
9222 | if (except && (item === except || NbMenuItem.isParent(item, except))) {
|
9223 | continue;
|
9224 | }
|
9225 | if (item.expanded) {
|
9226 | collapsedItems.push(item);
|
9227 | }
|
9228 | item.expanded = false;
|
9229 | if (item.children) {
|
9230 | collapsedItems.push.apply(collapsedItems, this.collapseItems(item.children));
|
9231 | }
|
9232 | }
|
9233 | return collapsedItems;
|
9234 | };
|
9235 | NbMenuInternalService.prototype.applyDefaults = function (item, defaultItem) {
|
9236 | var _this = this;
|
9237 | var menuItem = tslib.__assign({}, item);
|
9238 | Object.assign(item, defaultItem, menuItem);
|
9239 | item.children && item.children.forEach(function (child) {
|
9240 | _this.applyDefaults(child, defaultItem);
|
9241 | });
|
9242 | };
|
9243 | NbMenuInternalService.prototype.setParent = function (item) {
|
9244 | var _this = this;
|
9245 | item.children && item.children.forEach(function (child) {
|
9246 | child.parent = item;
|
9247 | _this.setParent(child);
|
9248 | });
|
9249 | };
|
9250 | |
9251 |
|
9252 |
|
9253 |
|
9254 |
|
9255 | NbMenuInternalService.prototype.findItemByUrl = function (items) {
|
9256 | var _this = this;
|
9257 | var selectedItem;
|
9258 | items.some(function (item) {
|
9259 | if (item.children) {
|
9260 | selectedItem = _this.findItemByUrl(item.children);
|
9261 | }
|
9262 | if (!selectedItem && _this.isSelectedInUrl(item)) {
|
9263 | selectedItem = item;
|
9264 | }
|
9265 | return selectedItem;
|
9266 | });
|
9267 | return selectedItem;
|
9268 | };
|
9269 | NbMenuInternalService.prototype.isSelectedInUrl = function (item) {
|
9270 | var exact = item.pathMatch === 'full';
|
9271 | var link = item.link;
|
9272 | var isSelectedInPath = exact
|
9273 | ? isUrlPathEqual(this.location.path(), link)
|
9274 | : isUrlPathContain(this.location.path(), link);
|
9275 | if (isSelectedInPath && item.fragment != null) {
|
9276 | return exact
|
9277 | ? isFragmentEqual(this.location.path(true), item.fragment)
|
9278 | : isFragmentContain(this.location.path(true), item.fragment);
|
9279 | }
|
9280 | return isSelectedInPath;
|
9281 | };
|
9282 | NbMenuInternalService.decorators = [
|
9283 | { type: i0.Injectable }
|
9284 | ];
|
9285 | NbMenuInternalService.ctorParameters = function () { return [
|
9286 | { type: _angular_common.Location }
|
9287 | ]; };
|
9288 | return NbMenuInternalService;
|
9289 | }());
|
9290 |
|
9291 |
|
9292 |
|
9293 |
|
9294 |
|
9295 |
|
9296 |
|
9297 | (function (NbToggleStates) {
|
9298 | NbToggleStates["Expanded"] = "expanded";
|
9299 | NbToggleStates["Collapsed"] = "collapsed";
|
9300 | })(exports.NbToggleStates || (exports.NbToggleStates = {}));
|
9301 | var NbMenuItemComponent = (function () {
|
9302 | function NbMenuItemComponent(menuService, directionService) {
|
9303 | this.menuService = menuService;
|
9304 | this.directionService = directionService;
|
9305 | this.menuItem = null;
|
9306 | this.hoverItem = new i0.EventEmitter();
|
9307 | this.toggleSubMenu = new i0.EventEmitter();
|
9308 | this.selectItem = new i0.EventEmitter();
|
9309 | this.itemClick = new i0.EventEmitter();
|
9310 | this.destroy$ = new rxjs.Subject();
|
9311 | }
|
9312 | NbMenuItemComponent.prototype.ngDoCheck = function () {
|
9313 | this.toggleState = this.menuItem.expanded ? exports.NbToggleStates.Expanded : exports.NbToggleStates.Collapsed;
|
9314 | };
|
9315 | NbMenuItemComponent.prototype.ngAfterViewInit = function () {
|
9316 | var _this = this;
|
9317 | this.menuService.onSubmenuToggle()
|
9318 | .pipe(rxjs_operators.filter(function (_a) {
|
9319 | var item = _a.item;
|
9320 | return item === _this.menuItem;
|
9321 | }), rxjs_operators.map(function (_a) {
|
9322 | var item = _a.item;
|
9323 | return item.expanded;
|
9324 | }), rxjs_operators.takeUntil(this.destroy$))
|
9325 | .subscribe(function (isExpanded) { return _this.toggleState = isExpanded ? exports.NbToggleStates.Expanded : exports.NbToggleStates.Collapsed; });
|
9326 | };
|
9327 | NbMenuItemComponent.prototype.ngOnDestroy = function () {
|
9328 | this.destroy$.next();
|
9329 | this.destroy$.complete();
|
9330 | };
|
9331 | NbMenuItemComponent.prototype.onToggleSubMenu = function (item) {
|
9332 | this.toggleSubMenu.emit(item);
|
9333 | };
|
9334 | NbMenuItemComponent.prototype.onHoverItem = function (item) {
|
9335 | this.hoverItem.emit(item);
|
9336 | };
|
9337 | NbMenuItemComponent.prototype.onSelectItem = function (item) {
|
9338 | this.selectItem.emit(item);
|
9339 | };
|
9340 | NbMenuItemComponent.prototype.onItemClick = function (item) {
|
9341 | this.itemClick.emit(item);
|
9342 | };
|
9343 | NbMenuItemComponent.prototype.getExpandStateIcon = function () {
|
9344 | if (this.menuItem.expanded) {
|
9345 | return 'chevron-down-outline';
|
9346 | }
|
9347 | return this.directionService.isLtr()
|
9348 | ? 'chevron-left-outline'
|
9349 | : 'chevron-right-outline';
|
9350 | };
|
9351 | NbMenuItemComponent.decorators = [
|
9352 | { type: i0.Component, args: [{
|
9353 | selector: '[nbMenuItem]',
|
9354 | template: "<span *ngIf=\"menuItem.group\">\n <nb-icon class=\"menu-icon\" [config]=\"menuItem.icon\" *ngIf=\"menuItem.icon\"></nb-icon>\n {{ menuItem.title }}\n</span>\n<a *ngIf=\"menuItem.link && !menuItem.url && !menuItem.children && !menuItem.group\"\n [routerLink]=\"menuItem.link\"\n [queryParams]=\"menuItem.queryParams\"\n [fragment]=\"menuItem.fragment\"\n [queryParamsHandling]=\"menuItem.queryParamsHandling\"\n [preserveFragment]=\"menuItem.preserveFragment\"\n [skipLocationChange]=\"menuItem.skipLocationChange\"\n [attr.target]=\"menuItem.target\"\n [attr.title]=\"menuItem.title\"\n [class.active]=\"menuItem.selected\"\n (mouseenter)=\"onHoverItem(menuItem)\"\n (click)=\"onItemClick(menuItem);\">\n <nb-icon class=\"menu-icon\" [config]=\"menuItem.icon\" *ngIf=\"menuItem.icon\"></nb-icon>\n <span class=\"menu-title\">{{ menuItem.title }}</span>\n <ng-container *ngIf=\"badge\" [ngTemplateOutlet]=\"badgeTemplate\"></ng-container>\n</a>\n<a *ngIf=\"menuItem.url && !menuItem.children && !menuItem.link && !menuItem.group\"\n [attr.href]=\"menuItem.url\"\n [attr.target]=\"menuItem.target\"\n [attr.title]=\"menuItem.title\"\n [class.active]=\"menuItem.selected\"\n (mouseenter)=\"onHoverItem(menuItem)\"\n (click)=\"onSelectItem(menuItem)\">\n <nb-icon class=\"menu-icon\" [config]=\"menuItem.icon\" *ngIf=\"menuItem.icon\"></nb-icon>\n <span class=\"menu-title\">{{ menuItem.title }}</span>\n <ng-container *ngIf=\"badge\" [ngTemplateOutlet]=\"badgeTemplate\"></ng-container>\n</a>\n<a *ngIf=\"!menuItem.children && !menuItem.link && !menuItem.url && !menuItem.group\"\n [attr.target]=\"menuItem.target\"\n [attr.title]=\"menuItem.title\"\n [class.active]=\"menuItem.selected\"\n (mouseenter)=\"onHoverItem(menuItem)\"\n (click)=\"$event.preventDefault(); onItemClick(menuItem);\">\n <nb-icon class=\"menu-icon\" [config]=\"menuItem.icon\" *ngIf=\"menuItem.icon\"></nb-icon>\n <span class=\"menu-title\">{{ menuItem.title }}</span>\n <ng-container *ngIf=\"badge\" [ngTemplateOutlet]=\"badgeTemplate\"></ng-container>\n</a>\n<a *ngIf=\"menuItem.children\"\n (click)=\"$event.preventDefault(); onToggleSubMenu(menuItem);\"\n [attr.target]=\"menuItem.target\"\n [attr.title]=\"menuItem.title\"\n [class.active]=\"menuItem.selected\"\n (mouseenter)=\"onHoverItem(menuItem)\"\n href=\"#\">\n <nb-icon class=\"menu-icon\" [config]=\"menuItem.icon\" *ngIf=\"menuItem.icon\"></nb-icon>\n <span class=\"menu-title\">{{ menuItem.title }}</span>\n <ng-container *ngIf=\"badge\" [ngTemplateOutlet]=\"badgeTemplate\"></ng-container>\n <nb-icon class=\"expand-state\" [icon]=\"getExpandStateIcon()\" pack=\"nebular-essentials\"></nb-icon>\n</a>\n<ul *ngIf=\"menuItem.children\"\n [class.collapsed]=\"!(menuItem.children && menuItem.expanded)\"\n [class.expanded]=\"menuItem.expanded\"\n [@toggle]=\"toggleState\"\n class=\"menu-items\">\n <ng-container *ngFor=\"let item of menuItem.children\">\n <li nbMenuItem *ngIf=\"!item.hidden\"\n [menuItem]=\"item\"\n [badge]=\"item.badge\"\n [class.menu-group]=\"item.group\"\n (hoverItem)=\"onHoverItem($event)\"\n (toggleSubMenu)=\"onToggleSubMenu($event)\"\n (selectItem)=\"onSelectItem($event)\"\n (itemClick)=\"onItemClick($event)\"\n class=\"menu-item\">\n </li>\n </ng-container>\n</ul>\n\n<ng-template #badgeTemplate>\n <nb-badge [text]=\"badge.text\" [dotMode]=\"badge.dotMode\" [status]=\"badge.status\">\n </nb-badge>\n</ng-template>\n",
|
9355 | animations: [
|
9356 | _angular_animations.trigger('toggle', [
|
9357 | _angular_animations.state(exports.NbToggleStates.Collapsed, _angular_animations.style({ height: '0', margin: '0' })),
|
9358 | _angular_animations.state(exports.NbToggleStates.Expanded, _angular_animations.style({ height: '*' })),
|
9359 | _angular_animations.transition(exports.NbToggleStates.Collapsed + " <=> " + exports.NbToggleStates.Expanded, _angular_animations.animate(300)),
|
9360 | ]),
|
9361 | ]
|
9362 | },] }
|
9363 | ];
|
9364 | NbMenuItemComponent.ctorParameters = function () { return [
|
9365 | { type: NbMenuService },
|
9366 | { type: NbLayoutDirectionService }
|
9367 | ]; };
|
9368 | NbMenuItemComponent.propDecorators = {
|
9369 | menuItem: [{ type: i0.Input }],
|
9370 | badge: [{ type: i0.Input }],
|
9371 | hoverItem: [{ type: i0.Output }],
|
9372 | toggleSubMenu: [{ type: i0.Output }],
|
9373 | selectItem: [{ type: i0.Output }],
|
9374 | itemClick: [{ type: i0.Output }]
|
9375 | };
|
9376 | return NbMenuItemComponent;
|
9377 | }());
|
9378 |
|
9379 |
|
9380 |
|
9381 |
|
9382 |
|
9383 |
|
9384 |
|
9385 |
|
9386 |
|
9387 |
|
9388 |
|
9389 |
|
9390 |
|
9391 |
|
9392 |
|
9393 |
|
9394 |
|
9395 |
|
9396 |
|
9397 |
|
9398 |
|
9399 |
|
9400 |
|
9401 |
|
9402 |
|
9403 |
|
9404 |
|
9405 |
|
9406 |
|
9407 |
|
9408 |
|
9409 |
|
9410 |
|
9411 |
|
9412 |
|
9413 |
|
9414 |
|
9415 |
|
9416 |
|
9417 |
|
9418 |
|
9419 |
|
9420 |
|
9421 |
|
9422 |
|
9423 |
|
9424 |
|
9425 |
|
9426 |
|
9427 |
|
9428 |
|
9429 |
|
9430 |
|
9431 |
|
9432 |
|
9433 |
|
9434 |
|
9435 |
|
9436 |
|
9437 |
|
9438 |
|
9439 |
|
9440 |
|
9441 |
|
9442 |
|
9443 |
|
9444 |
|
9445 |
|
9446 |
|
9447 |
|
9448 |
|
9449 |
|
9450 |
|
9451 |
|
9452 |
|
9453 |
|
9454 |
|
9455 |
|
9456 |
|
9457 |
|
9458 |
|
9459 |
|
9460 |
|
9461 |
|
9462 |
|
9463 |
|
9464 |
|
9465 |
|
9466 |
|
9467 |
|
9468 |
|
9469 |
|
9470 |
|
9471 |
|
9472 |
|
9473 |
|
9474 |
|
9475 |
|
9476 |
|
9477 |
|
9478 |
|
9479 |
|
9480 |
|
9481 | var NbMenuComponent = (function () {
|
9482 | function NbMenuComponent(window, platformId, menuInternalService, router) {
|
9483 | this.window = window;
|
9484 | this.platformId = platformId;
|
9485 | this.menuInternalService = menuInternalService;
|
9486 | this.router = router;
|
9487 | this._autoCollapse = false;
|
9488 | this.destroy$ = new rxjs.Subject();
|
9489 | }
|
9490 | Object.defineProperty(NbMenuComponent.prototype, "autoCollapse", {
|
9491 | |
9492 |
|
9493 |
|
9494 |
|
9495 |
|
9496 | get: function () {
|
9497 | return this._autoCollapse;
|
9498 | },
|
9499 | set: function (value) {
|
9500 | this._autoCollapse = convertToBoolProperty(value);
|
9501 | },
|
9502 | enumerable: false,
|
9503 | configurable: true
|
9504 | });
|
9505 | NbMenuComponent.prototype.ngOnInit = function () {
|
9506 | var _this = this;
|
9507 | this.menuInternalService.prepareItems(this.items);
|
9508 | this.menuInternalService
|
9509 | .onAddItem()
|
9510 | .pipe(rxjs_operators.filter(function (data) { return _this.compareTag(data.tag); }), rxjs_operators.takeUntil(this.destroy$))
|
9511 | .subscribe(function (data) { return _this.onAddItem(data); });
|
9512 | this.menuInternalService
|
9513 | .onNavigateHome()
|
9514 | .pipe(rxjs_operators.filter(function (data) { return _this.compareTag(data.tag); }), rxjs_operators.takeUntil(this.destroy$))
|
9515 | .subscribe(function () { return _this.navigateHome(); });
|
9516 | this.menuInternalService
|
9517 | .onGetSelectedItem()
|
9518 | .pipe(rxjs_operators.filter(function (data) { return _this.compareTag(data.tag); }), rxjs_operators.takeUntil(this.destroy$))
|
9519 | .subscribe(function (data) {
|
9520 | data.listener.next({ tag: _this.tag, item: _this.getSelectedItem(_this.items) });
|
9521 | });
|
9522 | this.menuInternalService
|
9523 | .onCollapseAll()
|
9524 | .pipe(rxjs_operators.filter(function (data) { return _this.compareTag(data.tag); }), rxjs_operators.takeUntil(this.destroy$))
|
9525 | .subscribe(function () { return _this.collapseAll(); });
|
9526 | this.router.events
|
9527 | .pipe(rxjs_operators.filter(function (event) { return event instanceof _angular_router.NavigationEnd; }), rxjs_operators.takeUntil(this.destroy$))
|
9528 | .subscribe(function () {
|
9529 | _this.menuInternalService.selectFromUrl(_this.items, _this.tag, _this.autoCollapse);
|
9530 | });
|
9531 | };
|
9532 | NbMenuComponent.prototype.ngAfterViewInit = function () {
|
9533 | var _this = this;
|
9534 | setTimeout(function () { return _this.menuInternalService.selectFromUrl(_this.items, _this.tag, _this.autoCollapse); });
|
9535 | };
|
9536 | NbMenuComponent.prototype.onAddItem = function (data) {
|
9537 | var _a;
|
9538 | (_a = this.items).push.apply(_a, data.items);
|
9539 | this.menuInternalService.prepareItems(this.items);
|
9540 | this.menuInternalService.selectFromUrl(this.items, this.tag, this.autoCollapse);
|
9541 | };
|
9542 | NbMenuComponent.prototype.onHoverItem = function (item) {
|
9543 | this.menuInternalService.itemHover(item, this.tag);
|
9544 | };
|
9545 | NbMenuComponent.prototype.onToggleSubMenu = function (item) {
|
9546 | if (this.autoCollapse) {
|
9547 | this.menuInternalService.collapseAll(this.items, this.tag, item);
|
9548 | }
|
9549 | item.expanded = !item.expanded;
|
9550 | this.menuInternalService.submenuToggle(item, this.tag);
|
9551 | };
|
9552 |
|
9553 | NbMenuComponent.prototype.onSelectItem = function (item) {
|
9554 | this.menuInternalService.selectItem(item, this.items, this.autoCollapse, this.tag);
|
9555 | };
|
9556 | NbMenuComponent.prototype.onItemClick = function (item) {
|
9557 | this.menuInternalService.itemClick(item, this.tag);
|
9558 | };
|
9559 | NbMenuComponent.prototype.ngOnDestroy = function () {
|
9560 | this.destroy$.next();
|
9561 | this.destroy$.complete();
|
9562 | };
|
9563 | NbMenuComponent.prototype.navigateHome = function () {
|
9564 | var homeItem = this.getHomeItem(this.items);
|
9565 | if (homeItem) {
|
9566 | if (homeItem.link) {
|
9567 | var extras = {
|
9568 | queryParams: homeItem.queryParams,
|
9569 | queryParamsHandling: homeItem.queryParamsHandling,
|
9570 | fragment: homeItem.fragment,
|
9571 | preserveFragment: homeItem.preserveFragment,
|
9572 | };
|
9573 | this.router.navigate([homeItem.link], extras);
|
9574 | }
|
9575 | if (homeItem.url && _angular_common.isPlatformBrowser(this.platformId)) {
|
9576 | this.window.location.href = homeItem.url;
|
9577 | }
|
9578 | }
|
9579 | };
|
9580 | NbMenuComponent.prototype.collapseAll = function () {
|
9581 | this.menuInternalService.collapseAll(this.items, this.tag);
|
9582 | };
|
9583 | NbMenuComponent.prototype.getHomeItem = function (items) {
|
9584 | for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
|
9585 | var item = items_1[_i];
|
9586 | if (item.home) {
|
9587 | return item;
|
9588 | }
|
9589 | var homeItem = item.children && this.getHomeItem(item.children);
|
9590 | if (homeItem) {
|
9591 | return homeItem;
|
9592 | }
|
9593 | }
|
9594 | };
|
9595 | NbMenuComponent.prototype.compareTag = function (tag) {
|
9596 | return !tag || tag === this.tag;
|
9597 | };
|
9598 | NbMenuComponent.prototype.getSelectedItem = function (items) {
|
9599 | var _this = this;
|
9600 | var selected = null;
|
9601 | items.forEach(function (item) {
|
9602 | if (item.selected) {
|
9603 | selected = item;
|
9604 | }
|
9605 | if (item.selected && item.children && item.children.length > 0) {
|
9606 | selected = _this.getSelectedItem(item.children);
|
9607 | }
|
9608 | });
|
9609 | return selected;
|
9610 | };
|
9611 | NbMenuComponent.decorators = [
|
9612 | { type: i0.Component, args: [{
|
9613 | selector: 'nb-menu',
|
9614 | template: "\n <ul class=\"menu-items\">\n <ng-container *ngFor=\"let item of items\">\n <li nbMenuItem *ngIf=\"!item.hidden\"\n [menuItem]=\"item\"\n [badge]=\"item.badge\"\n [class.menu-group]=\"item.group\"\n (hoverItem)=\"onHoverItem($event)\"\n (toggleSubMenu)=\"onToggleSubMenu($event)\"\n (selectItem)=\"onSelectItem($event)\"\n (itemClick)=\"onItemClick($event)\"\n class=\"menu-item\">\n </li>\n </ng-container>\n </ul>\n ",
|
9615 | styles: [":host ::ng-deep{display:block}:host ::ng-deep .menu-items,:host ::ng-deep .menu-item>.menu-items{list-style-type:none;overflow:hidden}:host ::ng-deep .menu-item a{display:flex;text-decoration:none;align-items:center}:host ::ng-deep .menu-item a .menu-title{flex:1 0 auto}[dir=rtl] :host ::ng-deep .menu-item a .menu-title{text-align:right}:host ::ng-deep .menu-item nb-badge{position:static}:host ::ng-deep .menu-group span{display:flex}\n"]
|
9616 | },] }
|
9617 | ];
|
9618 | NbMenuComponent.ctorParameters = function () { return [
|
9619 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_WINDOW,] }] },
|
9620 | { type: undefined, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] },
|
9621 | { type: NbMenuInternalService },
|
9622 | { type: _angular_router.Router }
|
9623 | ]; };
|
9624 | NbMenuComponent.propDecorators = {
|
9625 | tag: [{ type: i0.Input }],
|
9626 | items: [{ type: i0.Input }],
|
9627 | autoCollapse: [{ type: i0.Input }]
|
9628 | };
|
9629 | return NbMenuComponent;
|
9630 | }());
|
9631 |
|
9632 |
|
9633 |
|
9634 |
|
9635 |
|
9636 |
|
9637 |
|
9638 |
|
9639 |
|
9640 |
|
9641 |
|
9642 |
|
9643 |
|
9644 |
|
9645 |
|
9646 |
|
9647 |
|
9648 |
|
9649 |
|
9650 |
|
9651 |
|
9652 |
|
9653 |
|
9654 |
|
9655 |
|
9656 |
|
9657 |
|
9658 |
|
9659 |
|
9660 |
|
9661 |
|
9662 |
|
9663 |
|
9664 |
|
9665 |
|
9666 |
|
9667 |
|
9668 |
|
9669 |
|
9670 |
|
9671 |
|
9672 |
|
9673 |
|
9674 |
|
9675 |
|
9676 |
|
9677 |
|
9678 |
|
9679 |
|
9680 |
|
9681 |
|
9682 |
|
9683 |
|
9684 |
|
9685 |
|
9686 |
|
9687 |
|
9688 |
|
9689 |
|
9690 |
|
9691 |
|
9692 |
|
9693 |
|
9694 |
|
9695 |
|
9696 |
|
9697 |
|
9698 |
|
9699 | var NbBadgeComponent = (function () {
|
9700 | function NbBadgeComponent(statusService) {
|
9701 | this.statusService = statusService;
|
9702 | |
9703 |
|
9704 |
|
9705 |
|
9706 | this.text = '';
|
9707 | this._defaultPosition = 'top right';
|
9708 | this._position = this._defaultPosition;
|
9709 | |
9710 |
|
9711 |
|
9712 |
|
9713 | this.status = 'basic';
|
9714 | }
|
9715 | Object.defineProperty(NbBadgeComponent.prototype, "position", {
|
9716 | |
9717 |
|
9718 |
|
9719 |
|
9720 |
|
9721 |
|
9722 |
|
9723 |
|
9724 | get: function () {
|
9725 | return this._position;
|
9726 | },
|
9727 | set: function (value) {
|
9728 | this._position = value || this._defaultPosition;
|
9729 | },
|
9730 | enumerable: false,
|
9731 | configurable: true
|
9732 | });
|
9733 | Object.defineProperty(NbBadgeComponent.prototype, "dotMode", {
|
9734 | |
9735 |
|
9736 |
|
9737 |
|
9738 | get: function () {
|
9739 | return this._dotMode;
|
9740 | },
|
9741 | set: function (value) {
|
9742 | this._dotMode = convertToBoolProperty(value);
|
9743 | },
|
9744 | enumerable: false,
|
9745 | configurable: true
|
9746 | });
|
9747 | Object.defineProperty(NbBadgeComponent.prototype, "additionalClasses", {
|
9748 | get: function () {
|
9749 | if (this.statusService.isCustomStatus(this.status)) {
|
9750 | return [this.statusService.getStatusClass(this.status)];
|
9751 | }
|
9752 | return [];
|
9753 | },
|
9754 | enumerable: false,
|
9755 | configurable: true
|
9756 | });
|
9757 | Object.defineProperty(NbBadgeComponent.prototype, "primary", {
|
9758 | get: function () {
|
9759 | return this.status === 'primary';
|
9760 | },
|
9761 | enumerable: false,
|
9762 | configurable: true
|
9763 | });
|
9764 | Object.defineProperty(NbBadgeComponent.prototype, "success", {
|
9765 | get: function () {
|
9766 | return this.status === 'success';
|
9767 | },
|
9768 | enumerable: false,
|
9769 | configurable: true
|
9770 | });
|
9771 | Object.defineProperty(NbBadgeComponent.prototype, "info", {
|
9772 | get: function () {
|
9773 | return this.status === 'info';
|
9774 | },
|
9775 | enumerable: false,
|
9776 | configurable: true
|
9777 | });
|
9778 | Object.defineProperty(NbBadgeComponent.prototype, "warning", {
|
9779 | get: function () {
|
9780 | return this.status === 'warning';
|
9781 | },
|
9782 | enumerable: false,
|
9783 | configurable: true
|
9784 | });
|
9785 | Object.defineProperty(NbBadgeComponent.prototype, "danger", {
|
9786 | get: function () {
|
9787 | return this.status === 'danger';
|
9788 | },
|
9789 | enumerable: false,
|
9790 | configurable: true
|
9791 | });
|
9792 | Object.defineProperty(NbBadgeComponent.prototype, "basic", {
|
9793 | get: function () {
|
9794 | return this.status === 'basic';
|
9795 | },
|
9796 | enumerable: false,
|
9797 | configurable: true
|
9798 | });
|
9799 | Object.defineProperty(NbBadgeComponent.prototype, "control", {
|
9800 | get: function () {
|
9801 | return this.status === 'control';
|
9802 | },
|
9803 | enumerable: false,
|
9804 | configurable: true
|
9805 | });
|
9806 | Object.defineProperty(NbBadgeComponent.prototype, "top", {
|
9807 | get: function () {
|
9808 | return this.position.includes('top');
|
9809 | },
|
9810 | enumerable: false,
|
9811 | configurable: true
|
9812 | });
|
9813 | Object.defineProperty(NbBadgeComponent.prototype, "right", {
|
9814 | get: function () {
|
9815 | return this.position.includes('right');
|
9816 | },
|
9817 | enumerable: false,
|
9818 | configurable: true
|
9819 | });
|
9820 | Object.defineProperty(NbBadgeComponent.prototype, "bottom", {
|
9821 | get: function () {
|
9822 | return this.position.includes('bottom');
|
9823 | },
|
9824 | enumerable: false,
|
9825 | configurable: true
|
9826 | });
|
9827 | Object.defineProperty(NbBadgeComponent.prototype, "left", {
|
9828 | get: function () {
|
9829 | return this.position.includes('left');
|
9830 | },
|
9831 | enumerable: false,
|
9832 | configurable: true
|
9833 | });
|
9834 | Object.defineProperty(NbBadgeComponent.prototype, "start", {
|
9835 | get: function () {
|
9836 | return this.position.includes('start');
|
9837 | },
|
9838 | enumerable: false,
|
9839 | configurable: true
|
9840 | });
|
9841 | Object.defineProperty(NbBadgeComponent.prototype, "end", {
|
9842 | get: function () {
|
9843 | return this.position.includes('end');
|
9844 | },
|
9845 | enumerable: false,
|
9846 | configurable: true
|
9847 | });
|
9848 | Object.defineProperty(NbBadgeComponent.prototype, "center", {
|
9849 | get: function () {
|
9850 | return this.position.includes('center');
|
9851 | },
|
9852 | enumerable: false,
|
9853 | configurable: true
|
9854 | });
|
9855 | NbBadgeComponent.decorators = [
|
9856 | { type: i0.Component, args: [{
|
9857 | selector: 'nb-badge',
|
9858 | template: "{{dotMode ? '' : text}}",
|
9859 | styles: [":host{position:absolute;text-align:center;white-space:nowrap;vertical-align:baseline}:host(.position-top){top:0}:host(.position-right){right:0}:host(.position-bottom){bottom:0}:host(.position-left){left:0}:host(.position-center){top:50%;transform:translateY(-50%)}[dir=ltr] :host(.position-start){left:0}[dir=rtl] :host(.position-start){right:0}[dir=ltr] :host(.position-end){right:0}[dir=rtl] :host(.position-end){left:0}\n"]
|
9860 | },] }
|
9861 | ];
|
9862 | NbBadgeComponent.ctorParameters = function () { return [
|
9863 | { type: NbStatusService }
|
9864 | ]; };
|
9865 | NbBadgeComponent.propDecorators = {
|
9866 | text: [{ type: i0.Input }],
|
9867 | position: [{ type: i0.Input }],
|
9868 | dotMode: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.dot-mode',] }],
|
9869 | status: [{ type: i0.Input }],
|
9870 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }],
|
9871 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
9872 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
9873 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
9874 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
9875 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
9876 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
9877 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
9878 | top: [{ type: i0.HostBinding, args: ['class.position-top',] }],
|
9879 | right: [{ type: i0.HostBinding, args: ['class.position-right',] }],
|
9880 | bottom: [{ type: i0.HostBinding, args: ['class.position-bottom',] }],
|
9881 | left: [{ type: i0.HostBinding, args: ['class.position-left',] }],
|
9882 | start: [{ type: i0.HostBinding, args: ['class.position-start',] }],
|
9883 | end: [{ type: i0.HostBinding, args: ['class.position-end',] }],
|
9884 | center: [{ type: i0.HostBinding, args: ['class.position-center',] }]
|
9885 | };
|
9886 | return NbBadgeComponent;
|
9887 | }());
|
9888 |
|
9889 |
|
9890 |
|
9891 |
|
9892 |
|
9893 |
|
9894 | var NbBadgeModule = (function () {
|
9895 | function NbBadgeModule() {
|
9896 | }
|
9897 | NbBadgeModule.decorators = [
|
9898 | { type: i0.NgModule, args: [{
|
9899 | exports: [NbBadgeComponent],
|
9900 | declarations: [NbBadgeComponent],
|
9901 | },] }
|
9902 | ];
|
9903 | return NbBadgeModule;
|
9904 | }());
|
9905 |
|
9906 |
|
9907 |
|
9908 |
|
9909 |
|
9910 |
|
9911 | var nbMenuComponents = [NbMenuComponent, NbMenuItemComponent];
|
9912 | var NB_MENU_PROVIDERS = [NbMenuService, NbMenuInternalService];
|
9913 | var NbMenuModule = (function () {
|
9914 | function NbMenuModule() {
|
9915 | }
|
9916 | NbMenuModule.forRoot = function () {
|
9917 | return {
|
9918 | ngModule: NbMenuModule,
|
9919 | providers: tslib.__spreadArray([], NB_MENU_PROVIDERS),
|
9920 | };
|
9921 | };
|
9922 | NbMenuModule.decorators = [
|
9923 | { type: i0.NgModule, args: [{
|
9924 | imports: [
|
9925 | NbSharedModule,
|
9926 | NbIconModule,
|
9927 | NbBadgeModule,
|
9928 | ],
|
9929 | declarations: tslib.__spreadArray([], nbMenuComponents),
|
9930 | exports: tslib.__spreadArray([], nbMenuComponents),
|
9931 | },] }
|
9932 | ];
|
9933 | return NbMenuModule;
|
9934 | }());
|
9935 |
|
9936 |
|
9937 |
|
9938 |
|
9939 |
|
9940 |
|
9941 |
|
9942 |
|
9943 |
|
9944 |
|
9945 |
|
9946 |
|
9947 |
|
9948 |
|
9949 |
|
9950 |
|
9951 |
|
9952 |
|
9953 |
|
9954 |
|
9955 |
|
9956 |
|
9957 |
|
9958 |
|
9959 |
|
9960 |
|
9961 |
|
9962 |
|
9963 |
|
9964 |
|
9965 |
|
9966 |
|
9967 |
|
9968 |
|
9969 |
|
9970 |
|
9971 |
|
9972 |
|
9973 |
|
9974 |
|
9975 |
|
9976 |
|
9977 |
|
9978 |
|
9979 |
|
9980 |
|
9981 |
|
9982 |
|
9983 |
|
9984 |
|
9985 |
|
9986 |
|
9987 |
|
9988 |
|
9989 |
|
9990 |
|
9991 |
|
9992 |
|
9993 |
|
9994 |
|
9995 |
|
9996 |
|
9997 |
|
9998 |
|
9999 |
|
10000 |
|
10001 |
|
10002 |
|
10003 |
|
10004 |
|
10005 |
|
10006 |
|
10007 |
|
10008 |
|
10009 |
|
10010 |
|
10011 | var NbRouteTabsetComponent = (function () {
|
10012 | function NbRouteTabsetComponent() {
|
10013 | this.fullWidthValue = false;
|
10014 | |
10015 |
|
10016 |
|
10017 |
|
10018 | this.activeLinkOptions = { exact: true };
|
10019 | |
10020 |
|
10021 |
|
10022 |
|
10023 | this.changeTab = new i0.EventEmitter();
|
10024 | }
|
10025 | Object.defineProperty(NbRouteTabsetComponent.prototype, "fullWidth", {
|
10026 | |
10027 |
|
10028 |
|
10029 |
|
10030 | set: function (val) {
|
10031 | this.fullWidthValue = convertToBoolProperty(val);
|
10032 | },
|
10033 | enumerable: false,
|
10034 | configurable: true
|
10035 | });
|
10036 | NbRouteTabsetComponent.prototype.selectTab = function (tab) {
|
10037 | this.changeTab.emit(tab);
|
10038 | };
|
10039 | NbRouteTabsetComponent.decorators = [
|
10040 | { type: i0.Component, args: [{
|
10041 | selector: 'nb-route-tabset',
|
10042 | template: "\n <ul class=\"route-tabset\">\n <ng-container *ngFor=\"let tab of tabs\">\n <li *ngIf=\"tab.disabled; else enabled\"\n [class.responsive]=\"tab.responsive\"\n class=\"route-tab disabled\"\n tabindex=\"-1\">\n <a tabindex=\"-1\" class=\"tab-link\">\n <nb-icon *ngIf=\"tab.icon\" [config]=\"tab.icon\"></nb-icon>\n <span *ngIf=\"tab.title\" class=\"tab-text\">{{ tab.title }}</span>\n </a>\n </li>\n\n <ng-template #enabled>\n <li (click)=\"$event.preventDefault(); selectTab(tab)\"\n [routerLink]=\"tab.route\"\n routerLinkActive=\"active\"\n [routerLinkActiveOptions]=\"activeLinkOptions\"\n [class.responsive]=\"tab.responsive\"\n [queryParams]=\"tab.queryParams\"\n [queryParamsHandling]=\"tab.queryParamsHandling\"\n [fragment]=\"tab.fragment\"\n [preserveFragment]=\"tab.preserveFragment\"\n [skipLocationChange]=\"tab.skipLocationChange\"\n [replaceUrl]=\"tab.replaceUrl\"\n [state]=\"tab.state\"\n tabindex=\"0\"\n class=\"route-tab\">\n <a tabindex=\"-1\" class=\"tab-link\">\n <nb-icon *ngIf=\"tab.icon\" [icon]=\"tab.icon\"></nb-icon>\n <span *ngIf=\"tab.title\" class=\"tab-text\">{{ tab.title }}</span>\n </a>\n </li>\n </ng-template>\n </ng-container>\n </ul>\n <router-outlet></router-outlet>\n ",
|
10043 | styles: [".route-tabset{display:flex;flex-direction:row;list-style-type:none;margin:0;padding:0}.route-tabset .route-tab{margin-bottom:-1px;text-align:center;padding:0}.route-tabset .route-tab.active a::before{display:block}.route-tabset .route-tab a{position:relative;text-decoration:none;display:inline-block}.route-tabset .route-tab a::before{position:absolute;content:'';width:100%;border-radius:3px;bottom:-2px;left:0}.route-tabset .route-tab a nb-icon{vertical-align:middle}[dir=ltr] :host .tab-link nb-icon+span{margin-left:.5rem}[dir=rtl] :host .tab-link nb-icon+span{margin-right:.5rem}:host(.full-width) .route-tabset{justify-content:space-around}\n"]
|
10044 | },] }
|
10045 | ];
|
10046 | NbRouteTabsetComponent.propDecorators = {
|
10047 | fullWidthValue: [{ type: i0.HostBinding, args: ['class.full-width',] }],
|
10048 | tabs: [{ type: i0.Input }],
|
10049 | activeLinkOptions: [{ type: i0.Input }],
|
10050 | fullWidth: [{ type: i0.Input }],
|
10051 | changeTab: [{ type: i0.Output }]
|
10052 | };
|
10053 | return NbRouteTabsetComponent;
|
10054 | }());
|
10055 |
|
10056 |
|
10057 |
|
10058 |
|
10059 |
|
10060 |
|
10061 | var NbRouteTabsetModule = (function () {
|
10062 | function NbRouteTabsetModule() {
|
10063 | }
|
10064 | NbRouteTabsetModule.decorators = [
|
10065 | { type: i0.NgModule, args: [{
|
10066 | imports: [
|
10067 | NbSharedModule,
|
10068 | NbIconModule,
|
10069 | ],
|
10070 | declarations: [
|
10071 | NbRouteTabsetComponent,
|
10072 | ],
|
10073 | exports: [
|
10074 | NbRouteTabsetComponent,
|
10075 | ],
|
10076 | },] }
|
10077 | ];
|
10078 | return NbRouteTabsetModule;
|
10079 | }());
|
10080 |
|
10081 |
|
10082 |
|
10083 |
|
10084 |
|
10085 |
|
10086 | var getSidebarState$ = new rxjs.Subject();
|
10087 | var getSidebarResponsiveState$ = new rxjs.Subject();
|
10088 |
|
10089 |
|
10090 |
|
10091 |
|
10092 |
|
10093 |
|
10094 |
|
10095 |
|
10096 | var NbSidebarService = (function () {
|
10097 | function NbSidebarService() {
|
10098 | this.toggle$ = new rxjs.Subject();
|
10099 | this.expand$ = new rxjs.Subject();
|
10100 | this.collapse$ = new rxjs.Subject();
|
10101 | this.compact$ = new rxjs.Subject();
|
10102 | }
|
10103 | |
10104 |
|
10105 |
|
10106 |
|
10107 |
|
10108 | NbSidebarService.prototype.onToggle = function () {
|
10109 | return this.toggle$.pipe(rxjs_operators.share());
|
10110 | };
|
10111 | |
10112 |
|
10113 |
|
10114 |
|
10115 | NbSidebarService.prototype.onExpand = function () {
|
10116 | return this.expand$.pipe(rxjs_operators.share());
|
10117 | };
|
10118 | |
10119 |
|
10120 |
|
10121 |
|
10122 | NbSidebarService.prototype.onCollapse = function () {
|
10123 | return this.collapse$.pipe(rxjs_operators.share());
|
10124 | };
|
10125 | |
10126 |
|
10127 |
|
10128 |
|
10129 | NbSidebarService.prototype.onCompact = function () {
|
10130 | return this.compact$.pipe(rxjs_operators.share());
|
10131 | };
|
10132 | |
10133 |
|
10134 |
|
10135 |
|
10136 |
|
10137 |
|
10138 | NbSidebarService.prototype.toggle = function (compact, tag) {
|
10139 | if (compact === void 0) { compact = false; }
|
10140 | this.toggle$.next({ compact: compact, tag: tag });
|
10141 | };
|
10142 | |
10143 |
|
10144 |
|
10145 |
|
10146 |
|
10147 | NbSidebarService.prototype.expand = function (tag) {
|
10148 | this.expand$.next({ tag: tag });
|
10149 | };
|
10150 | |
10151 |
|
10152 |
|
10153 |
|
10154 |
|
10155 | NbSidebarService.prototype.collapse = function (tag) {
|
10156 | this.collapse$.next({ tag: tag });
|
10157 | };
|
10158 | |
10159 |
|
10160 |
|
10161 |
|
10162 |
|
10163 | NbSidebarService.prototype.compact = function (tag) {
|
10164 | this.compact$.next({ tag: tag });
|
10165 | };
|
10166 | |
10167 |
|
10168 |
|
10169 |
|
10170 |
|
10171 | NbSidebarService.prototype.getSidebarState = function (tag) {
|
10172 | var observer = new rxjs.ReplaySubject(1);
|
10173 | getSidebarState$.next({ observer: observer, tag: tag });
|
10174 | return observer.pipe(rxjs_operators.publish(), rxjs_operators.refCount());
|
10175 | };
|
10176 | |
10177 |
|
10178 |
|
10179 |
|
10180 |
|
10181 | NbSidebarService.prototype.getSidebarResponsiveState = function (tag) {
|
10182 | var observer = new rxjs.ReplaySubject();
|
10183 | getSidebarResponsiveState$.next({ observer: observer, tag: tag });
|
10184 | return observer.pipe(rxjs_operators.publish(), rxjs_operators.refCount());
|
10185 | };
|
10186 | NbSidebarService.decorators = [
|
10187 | { type: i0.Injectable }
|
10188 | ];
|
10189 | return NbSidebarService;
|
10190 | }());
|
10191 |
|
10192 |
|
10193 |
|
10194 |
|
10195 |
|
10196 |
|
10197 |
|
10198 |
|
10199 |
|
10200 |
|
10201 |
|
10202 |
|
10203 | var NbSidebarHeaderComponent = (function () {
|
10204 | function NbSidebarHeaderComponent() {
|
10205 | }
|
10206 | NbSidebarHeaderComponent.decorators = [
|
10207 | { type: i0.Component, args: [{
|
10208 | selector: 'nb-sidebar-header',
|
10209 | template: "\n <ng-content></ng-content>\n "
|
10210 | },] }
|
10211 | ];
|
10212 | return NbSidebarHeaderComponent;
|
10213 | }());
|
10214 |
|
10215 |
|
10216 |
|
10217 |
|
10218 |
|
10219 |
|
10220 | var NbSidebarFooterComponent = (function () {
|
10221 | function NbSidebarFooterComponent() {
|
10222 | }
|
10223 | NbSidebarFooterComponent.decorators = [
|
10224 | { type: i0.Component, args: [{
|
10225 | selector: 'nb-sidebar-footer',
|
10226 | template: "\n <ng-content></ng-content>\n "
|
10227 | },] }
|
10228 | ];
|
10229 | return NbSidebarFooterComponent;
|
10230 | }());
|
10231 |
|
10232 |
|
10233 |
|
10234 |
|
10235 |
|
10236 |
|
10237 |
|
10238 |
|
10239 |
|
10240 |
|
10241 |
|
10242 |
|
10243 |
|
10244 |
|
10245 |
|
10246 |
|
10247 |
|
10248 |
|
10249 |
|
10250 |
|
10251 |
|
10252 |
|
10253 |
|
10254 |
|
10255 |
|
10256 |
|
10257 |
|
10258 |
|
10259 |
|
10260 |
|
10261 |
|
10262 |
|
10263 |
|
10264 |
|
10265 |
|
10266 |
|
10267 |
|
10268 |
|
10269 |
|
10270 |
|
10271 |
|
10272 |
|
10273 |
|
10274 |
|
10275 |
|
10276 |
|
10277 |
|
10278 |
|
10279 |
|
10280 |
|
10281 |
|
10282 |
|
10283 |
|
10284 |
|
10285 |
|
10286 |
|
10287 |
|
10288 |
|
10289 |
|
10290 |
|
10291 |
|
10292 |
|
10293 |
|
10294 |
|
10295 |
|
10296 |
|
10297 |
|
10298 |
|
10299 |
|
10300 |
|
10301 |
|
10302 |
|
10303 | var NbSidebarComponent = (function () {
|
10304 | function NbSidebarComponent(sidebarService, themeService, element, cd) {
|
10305 | this.sidebarService = sidebarService;
|
10306 | this.themeService = themeService;
|
10307 | this.element = element;
|
10308 | this.cd = cd;
|
10309 | this.responsiveValueChange$ = new rxjs.Subject();
|
10310 | this.responsiveState = 'pc';
|
10311 | this.destroy$ = new rxjs.Subject();
|
10312 | this.containerFixedValue = true;
|
10313 | this.fixedValue = false;
|
10314 | this.rightValue = false;
|
10315 | this.leftValue = true;
|
10316 | this.startValue = false;
|
10317 | this.endValue = false;
|
10318 | this._state = 'expanded';
|
10319 | this._responsive = false;
|
10320 |
|
10321 | |
10322 |
|
10323 |
|
10324 |
|
10325 |
|
10326 |
|
10327 |
|
10328 | this.compactedBreakpoints = ['xs', 'is', 'sm', 'md', 'lg'];
|
10329 | |
10330 |
|
10331 |
|
10332 |
|
10333 |
|
10334 |
|
10335 |
|
10336 | this.collapsedBreakpoints = ['xs', 'is'];
|
10337 | |
10338 |
|
10339 |
|
10340 | this.stateChange = new i0.EventEmitter();
|
10341 | |
10342 |
|
10343 |
|
10344 | this.responsiveStateChange = new i0.EventEmitter();
|
10345 | }
|
10346 | Object.defineProperty(NbSidebarComponent.prototype, "expanded", {
|
10347 | get: function () {
|
10348 | return this.state === 'expanded';
|
10349 | },
|
10350 | enumerable: false,
|
10351 | configurable: true
|
10352 | });
|
10353 | Object.defineProperty(NbSidebarComponent.prototype, "collapsed", {
|
10354 | get: function () {
|
10355 | return this.state === 'collapsed';
|
10356 | },
|
10357 | enumerable: false,
|
10358 | configurable: true
|
10359 | });
|
10360 | Object.defineProperty(NbSidebarComponent.prototype, "compacted", {
|
10361 | get: function () {
|
10362 | return this.state === 'compacted';
|
10363 | },
|
10364 | enumerable: false,
|
10365 | configurable: true
|
10366 | });
|
10367 | Object.defineProperty(NbSidebarComponent.prototype, "right", {
|
10368 | |
10369 |
|
10370 |
|
10371 |
|
10372 | set: function (val) {
|
10373 | this.rightValue = convertToBoolProperty(val);
|
10374 | this.leftValue = !this.rightValue;
|
10375 | this.startValue = false;
|
10376 | this.endValue = false;
|
10377 | },
|
10378 | enumerable: false,
|
10379 | configurable: true
|
10380 | });
|
10381 | Object.defineProperty(NbSidebarComponent.prototype, "left", {
|
10382 | |
10383 |
|
10384 |
|
10385 |
|
10386 | set: function (val) {
|
10387 | this.leftValue = convertToBoolProperty(val);
|
10388 | this.rightValue = !this.leftValue;
|
10389 | this.startValue = false;
|
10390 | this.endValue = false;
|
10391 | },
|
10392 | enumerable: false,
|
10393 | configurable: true
|
10394 | });
|
10395 | Object.defineProperty(NbSidebarComponent.prototype, "start", {
|
10396 | |
10397 |
|
10398 |
|
10399 |
|
10400 | set: function (val) {
|
10401 | this.startValue = convertToBoolProperty(val);
|
10402 | this.endValue = !this.startValue;
|
10403 | this.leftValue = false;
|
10404 | this.rightValue = false;
|
10405 | },
|
10406 | enumerable: false,
|
10407 | configurable: true
|
10408 | });
|
10409 | Object.defineProperty(NbSidebarComponent.prototype, "end", {
|
10410 | |
10411 |
|
10412 |
|
10413 |
|
10414 | set: function (val) {
|
10415 | this.endValue = convertToBoolProperty(val);
|
10416 | this.startValue = !this.endValue;
|
10417 | this.leftValue = false;
|
10418 | this.rightValue = false;
|
10419 | },
|
10420 | enumerable: false,
|
10421 | configurable: true
|
10422 | });
|
10423 | Object.defineProperty(NbSidebarComponent.prototype, "fixed", {
|
10424 | |
10425 |
|
10426 |
|
10427 |
|
10428 | set: function (val) {
|
10429 | this.fixedValue = convertToBoolProperty(val);
|
10430 | },
|
10431 | enumerable: false,
|
10432 | configurable: true
|
10433 | });
|
10434 | Object.defineProperty(NbSidebarComponent.prototype, "containerFixed", {
|
10435 | |
10436 |
|
10437 |
|
10438 |
|
10439 | set: function (val) {
|
10440 | this.containerFixedValue = convertToBoolProperty(val);
|
10441 | },
|
10442 | enumerable: false,
|
10443 | configurable: true
|
10444 | });
|
10445 | Object.defineProperty(NbSidebarComponent.prototype, "state", {
|
10446 | |
10447 |
|
10448 |
|
10449 |
|
10450 | get: function () {
|
10451 | return this._state;
|
10452 | },
|
10453 | set: function (value) {
|
10454 | this._state = value;
|
10455 | },
|
10456 | enumerable: false,
|
10457 | configurable: true
|
10458 | });
|
10459 | Object.defineProperty(NbSidebarComponent.prototype, "responsive", {
|
10460 | |
10461 |
|
10462 |
|
10463 |
|
10464 | get: function () {
|
10465 | return this._responsive;
|
10466 | },
|
10467 | set: function (value) {
|
10468 | if (this.responsive !== convertToBoolProperty(value)) {
|
10469 | this._responsive = !this.responsive;
|
10470 | this.responsiveValueChange$.next(this.responsive);
|
10471 | }
|
10472 | },
|
10473 | enumerable: false,
|
10474 | configurable: true
|
10475 | });
|
10476 | NbSidebarComponent.prototype.ngOnInit = function () {
|
10477 | var _this = this;
|
10478 | this.sidebarService.onToggle()
|
10479 | .pipe(rxjs_operators.filter(function (_a) {
|
10480 | var tag = _a.tag;
|
10481 | return !_this.tag || _this.tag === tag;
|
10482 | }), rxjs_operators.takeUntil(this.destroy$))
|
10483 | .subscribe(function (_a) {
|
10484 | var compact = _a.compact;
|
10485 | return _this.toggle(compact);
|
10486 | });
|
10487 | this.sidebarService.onExpand()
|
10488 | .pipe(rxjs_operators.filter(function (_a) {
|
10489 | var tag = _a.tag;
|
10490 | return !_this.tag || _this.tag === tag;
|
10491 | }), rxjs_operators.takeUntil(this.destroy$))
|
10492 | .subscribe(function () { return _this.expand(); });
|
10493 | this.sidebarService.onCollapse()
|
10494 | .pipe(rxjs_operators.filter(function (_a) {
|
10495 | var tag = _a.tag;
|
10496 | return !_this.tag || _this.tag === tag;
|
10497 | }), rxjs_operators.takeUntil(this.destroy$))
|
10498 | .subscribe(function () { return _this.collapse(); });
|
10499 | this.sidebarService.onCompact()
|
10500 | .pipe(rxjs_operators.filter(function (_a) {
|
10501 | var tag = _a.tag;
|
10502 | return !_this.tag || _this.tag === tag;
|
10503 | }), rxjs_operators.takeUntil(this.destroy$))
|
10504 | .subscribe(function () { return _this.compact(); });
|
10505 | getSidebarState$
|
10506 | .pipe(rxjs_operators.filter(function (_a) {
|
10507 | var tag = _a.tag;
|
10508 | return !_this.tag || _this.tag === tag;
|
10509 | }), rxjs_operators.takeUntil(this.destroy$))
|
10510 | .subscribe(function (_a) {
|
10511 | var observer = _a.observer;
|
10512 | return observer.next(_this.state);
|
10513 | });
|
10514 | getSidebarResponsiveState$
|
10515 | .pipe(rxjs_operators.filter(function (_a) {
|
10516 | var tag = _a.tag;
|
10517 | return !_this.tag || _this.tag === tag;
|
10518 | }), rxjs_operators.takeUntil(this.destroy$))
|
10519 | .subscribe(function (_a) {
|
10520 | var observer = _a.observer;
|
10521 | return observer.next(_this.responsiveState);
|
10522 | });
|
10523 | this.responsiveValueChange$
|
10524 | .pipe(rxjs_operators.filter(function (responsive) { return !responsive; }), rxjs_operators.takeUntil(this.destroy$))
|
10525 | .subscribe(function () { return _this.expand(); });
|
10526 | this.subscribeToMediaQueryChange();
|
10527 | };
|
10528 | NbSidebarComponent.prototype.ngOnDestroy = function () {
|
10529 | this.destroy$.next();
|
10530 | this.destroy$.complete();
|
10531 | };
|
10532 |
|
10533 | NbSidebarComponent.prototype.onClick = function (event) {
|
10534 | var menu = this.element.nativeElement.querySelector('nb-menu');
|
10535 | if (menu && menu.contains(event.target)) {
|
10536 | var link = this.getMenuLink(event.target);
|
10537 | if (link && link.nextElementSibling && link.nextElementSibling.classList.contains('menu-items')) {
|
10538 | this.sidebarService.expand(this.tag);
|
10539 | }
|
10540 | }
|
10541 | };
|
10542 | |
10543 |
|
10544 |
|
10545 | NbSidebarComponent.prototype.collapse = function () {
|
10546 | this.updateState('collapsed');
|
10547 | };
|
10548 | |
10549 |
|
10550 |
|
10551 | NbSidebarComponent.prototype.expand = function () {
|
10552 | this.updateState('expanded');
|
10553 | };
|
10554 | |
10555 |
|
10556 |
|
10557 | NbSidebarComponent.prototype.compact = function () {
|
10558 | this.updateState('compacted');
|
10559 | };
|
10560 | |
10561 |
|
10562 |
|
10563 |
|
10564 |
|
10565 |
|
10566 |
|
10567 |
|
10568 |
|
10569 |
|
10570 |
|
10571 | NbSidebarComponent.prototype.toggle = function (compact) {
|
10572 | if (compact === void 0) { compact = false; }
|
10573 | if (this.responsive) {
|
10574 | if (this.responsiveState === 'mobile') {
|
10575 | compact = false;
|
10576 | }
|
10577 | }
|
10578 | if (this.state === 'compacted' || this.state === 'collapsed') {
|
10579 | this.updateState('expanded');
|
10580 | }
|
10581 | else {
|
10582 | this.updateState(compact ? 'compacted' : 'collapsed');
|
10583 | }
|
10584 | };
|
10585 | NbSidebarComponent.prototype.subscribeToMediaQueryChange = function () {
|
10586 | var _this = this;
|
10587 | rxjs.combineLatest([
|
10588 | this.responsiveValueChange$.pipe(rxjs_operators.startWith(this.responsive)),
|
10589 | this.themeService.onMediaQueryChange(),
|
10590 | ])
|
10591 | .pipe(rxjs_operators.filter(function (_a) {
|
10592 | var responsive = _a[0];
|
10593 | return responsive;
|
10594 | }), rxjs_operators.map(function (_a) {
|
10595 | var breakpoints = _a[1];
|
10596 | return breakpoints;
|
10597 | }), rxjs_operators.takeUntil(this.destroy$))
|
10598 | .subscribe(function (_a) {
|
10599 | var prev = _a[0], current = _a[1];
|
10600 | var isCollapsed = _this.collapsedBreakpoints.includes(current.name);
|
10601 | var isCompacted = _this.compactedBreakpoints.includes(current.name);
|
10602 | var newResponsiveState;
|
10603 | if (isCompacted) {
|
10604 | _this.fixed = _this.containerFixedValue;
|
10605 | _this.compact();
|
10606 | newResponsiveState = 'tablet';
|
10607 | }
|
10608 | if (isCollapsed) {
|
10609 | _this.fixed = true;
|
10610 | _this.collapse();
|
10611 | newResponsiveState = 'mobile';
|
10612 | }
|
10613 | if (!isCollapsed && !isCompacted && (!prev.width || prev.width < current.width)) {
|
10614 | _this.expand();
|
10615 | _this.fixed = false;
|
10616 | newResponsiveState = 'pc';
|
10617 | }
|
10618 | if (newResponsiveState && newResponsiveState !== _this.responsiveState) {
|
10619 | _this.responsiveState = newResponsiveState;
|
10620 | _this.responsiveStateChange.emit(_this.responsiveState);
|
10621 | _this.cd.markForCheck();
|
10622 | }
|
10623 | });
|
10624 | };
|
10625 | NbSidebarComponent.prototype.getMenuLink = function (element) {
|
10626 | if (!element || element.tagName.toLowerCase() === 'nb-menu') {
|
10627 | return;
|
10628 | }
|
10629 | if (element.tagName.toLowerCase() === 'a') {
|
10630 | return element;
|
10631 | }
|
10632 | return this.getMenuLink(element.parentElement);
|
10633 | };
|
10634 | NbSidebarComponent.prototype.updateState = function (state$$1) {
|
10635 | if (this.state !== state$$1) {
|
10636 | this.state = state$$1;
|
10637 | this.stateChange.emit(this.state);
|
10638 | this.cd.markForCheck();
|
10639 | }
|
10640 | };
|
10641 | |
10642 |
|
10643 |
|
10644 |
|
10645 | NbSidebarComponent.prototype.toggleResponsive = function (enabled) {
|
10646 | this.responsive = enabled;
|
10647 | };
|
10648 | |
10649 |
|
10650 |
|
10651 |
|
10652 | NbSidebarComponent.STATE_EXPANDED = 'expanded';
|
10653 | |
10654 |
|
10655 |
|
10656 |
|
10657 | NbSidebarComponent.STATE_COLLAPSED = 'collapsed';
|
10658 | |
10659 |
|
10660 |
|
10661 |
|
10662 | NbSidebarComponent.STATE_COMPACTED = 'compacted';
|
10663 | |
10664 |
|
10665 |
|
10666 |
|
10667 | NbSidebarComponent.RESPONSIVE_STATE_MOBILE = 'mobile';
|
10668 | |
10669 |
|
10670 |
|
10671 |
|
10672 | NbSidebarComponent.RESPONSIVE_STATE_TABLET = 'tablet';
|
10673 | |
10674 |
|
10675 |
|
10676 |
|
10677 | NbSidebarComponent.RESPONSIVE_STATE_PC = 'pc';
|
10678 | NbSidebarComponent.decorators = [
|
10679 | { type: i0.Component, args: [{
|
10680 | selector: 'nb-sidebar',
|
10681 | template: "\n <div class=\"main-container\"\n [class.main-container-fixed]=\"containerFixedValue\">\n <ng-content select=\"nb-sidebar-header\"></ng-content>\n <div class=\"scrollable\" (click)=\"onClick($event)\">\n <ng-content></ng-content>\n </div>\n <ng-content select=\"nb-sidebar-footer\"></ng-content>\n </div>\n ",
|
10682 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
10683 | styles: [":host{display:flex;flex-direction:column;overflow:hidden;z-index:auto;order:0}:host .scrollable{overflow-y:auto;overflow-x:hidden;flex:1}:host .main-container{transform:translate3d(0, 0, 0);display:flex;flex-direction:column}:host .main-container-fixed{position:fixed}:host.right{margin-right:0;margin-left:auto}[dir=ltr] :host.right{order:4}[dir=rtl] :host.right{order:0}:host.end{order:4}[dir=ltr] :host.end{margin-right:0;margin-left:auto}[dir=rtl] :host.end{margin-left:0;margin-right:auto}:host.fixed{position:fixed;height:100%;z-index:999;top:0;bottom:0;left:0}:host.fixed.right{right:0}[dir=ltr] :host.fixed.start{left:0}[dir=rtl] :host.fixed.start{right:0}[dir=ltr] :host.fixed.end{right:0}[dir=rtl] :host.fixed.end{left:0}:host ::ng-deep nb-sidebar-footer{margin-top:auto;display:block}:host ::ng-deep nb-sidebar-header{display:block}\n"]
|
10684 | },] }
|
10685 | ];
|
10686 | NbSidebarComponent.ctorParameters = function () { return [
|
10687 | { type: NbSidebarService },
|
10688 | { type: NbThemeService },
|
10689 | { type: i0.ElementRef },
|
10690 | { type: i0.ChangeDetectorRef }
|
10691 | ]; };
|
10692 | NbSidebarComponent.propDecorators = {
|
10693 | fixedValue: [{ type: i0.HostBinding, args: ['class.fixed',] }],
|
10694 | rightValue: [{ type: i0.HostBinding, args: ['class.right',] }],
|
10695 | leftValue: [{ type: i0.HostBinding, args: ['class.left',] }],
|
10696 | startValue: [{ type: i0.HostBinding, args: ['class.start',] }],
|
10697 | endValue: [{ type: i0.HostBinding, args: ['class.end',] }],
|
10698 | expanded: [{ type: i0.HostBinding, args: ['class.expanded',] }],
|
10699 | collapsed: [{ type: i0.HostBinding, args: ['class.collapsed',] }],
|
10700 | compacted: [{ type: i0.HostBinding, args: ['class.compacted',] }],
|
10701 | right: [{ type: i0.Input }],
|
10702 | left: [{ type: i0.Input }],
|
10703 | start: [{ type: i0.Input }],
|
10704 | end: [{ type: i0.Input }],
|
10705 | fixed: [{ type: i0.Input }],
|
10706 | containerFixed: [{ type: i0.Input }],
|
10707 | state: [{ type: i0.Input }],
|
10708 | responsive: [{ type: i0.Input }],
|
10709 | tag: [{ type: i0.Input }],
|
10710 | compactedBreakpoints: [{ type: i0.Input }],
|
10711 | collapsedBreakpoints: [{ type: i0.Input }],
|
10712 | stateChange: [{ type: i0.Output }],
|
10713 | responsiveStateChange: [{ type: i0.Output }]
|
10714 | };
|
10715 | return NbSidebarComponent;
|
10716 | }());
|
10717 |
|
10718 |
|
10719 |
|
10720 |
|
10721 |
|
10722 |
|
10723 | var NB_SIDEBAR_COMPONENTS = [
|
10724 | NbSidebarComponent,
|
10725 | NbSidebarFooterComponent,
|
10726 | NbSidebarHeaderComponent,
|
10727 | ];
|
10728 | var NB_SIDEBAR_PROVIDERS = [
|
10729 | NbSidebarService,
|
10730 | ];
|
10731 | var NbSidebarModule = (function () {
|
10732 | function NbSidebarModule() {
|
10733 | }
|
10734 | NbSidebarModule.forRoot = function () {
|
10735 | return {
|
10736 | ngModule: NbSidebarModule,
|
10737 | providers: tslib.__spreadArray([], NB_SIDEBAR_PROVIDERS),
|
10738 | };
|
10739 | };
|
10740 | NbSidebarModule.decorators = [
|
10741 | { type: i0.NgModule, args: [{
|
10742 | imports: [
|
10743 | NbSharedModule,
|
10744 | ],
|
10745 | declarations: tslib.__spreadArray([], NB_SIDEBAR_COMPONENTS),
|
10746 | exports: tslib.__spreadArray([], NB_SIDEBAR_COMPONENTS),
|
10747 | },] }
|
10748 | ];
|
10749 | return NbSidebarModule;
|
10750 | }());
|
10751 |
|
10752 |
|
10753 |
|
10754 |
|
10755 |
|
10756 |
|
10757 |
|
10758 |
|
10759 |
|
10760 |
|
10761 |
|
10762 |
|
10763 |
|
10764 |
|
10765 |
|
10766 |
|
10767 |
|
10768 | var NbTabComponent = (function () {
|
10769 | function NbTabComponent() {
|
10770 | this.activeValue = false;
|
10771 | this.responsiveValue = false;
|
10772 | this.disabledValue = false;
|
10773 | |
10774 |
|
10775 |
|
10776 |
|
10777 |
|
10778 | this.badgeStatus = 'basic';
|
10779 | this.init = false;
|
10780 | }
|
10781 | Object.defineProperty(NbTabComponent.prototype, "badgeDot", {
|
10782 | |
10783 |
|
10784 |
|
10785 |
|
10786 | get: function () {
|
10787 | return this._badgeDot;
|
10788 | },
|
10789 | set: function (val) {
|
10790 | this._badgeDot = convertToBoolProperty(val);
|
10791 | },
|
10792 | enumerable: false,
|
10793 | configurable: true
|
10794 | });
|
10795 | Object.defineProperty(NbTabComponent.prototype, "disabled", {
|
10796 | |
10797 |
|
10798 |
|
10799 |
|
10800 | get: function () {
|
10801 | return this.disabledValue;
|
10802 | },
|
10803 | set: function (val) {
|
10804 | this.disabledValue = convertToBoolProperty(val);
|
10805 | },
|
10806 | enumerable: false,
|
10807 | configurable: true
|
10808 | });
|
10809 | Object.defineProperty(NbTabComponent.prototype, "responsive", {
|
10810 | get: function () {
|
10811 | return this.responsiveValue;
|
10812 | },
|
10813 | |
10814 |
|
10815 |
|
10816 |
|
10817 | set: function (val) {
|
10818 | this.responsiveValue = convertToBoolProperty(val);
|
10819 | },
|
10820 | enumerable: false,
|
10821 | configurable: true
|
10822 | });
|
10823 | Object.defineProperty(NbTabComponent.prototype, "active", {
|
10824 | |
10825 |
|
10826 |
|
10827 |
|
10828 | get: function () {
|
10829 | return this.activeValue;
|
10830 | },
|
10831 | set: function (val) {
|
10832 | this.activeValue = convertToBoolProperty(val);
|
10833 | if (this.activeValue) {
|
10834 | this.init = true;
|
10835 | }
|
10836 | },
|
10837 | enumerable: false,
|
10838 | configurable: true
|
10839 | });
|
10840 | Object.defineProperty(NbTabComponent.prototype, "lazyLoad", {
|
10841 | |
10842 |
|
10843 |
|
10844 |
|
10845 |
|
10846 | set: function (val) {
|
10847 | this.init = convertToBoolProperty(val);
|
10848 | },
|
10849 | enumerable: false,
|
10850 | configurable: true
|
10851 | });
|
10852 | NbTabComponent.decorators = [
|
10853 | { type: i0.Component, args: [{
|
10854 | selector: 'nb-tab',
|
10855 | template: "\n <ng-container *ngIf=\"init\">\n <ng-content></ng-content>\n </ng-container>\n "
|
10856 | },] }
|
10857 | ];
|
10858 | NbTabComponent.propDecorators = {
|
10859 | tabTitle: [{ type: i0.Input }],
|
10860 | tabId: [{ type: i0.Input }],
|
10861 | badgeDot: [{ type: i0.Input }],
|
10862 | tabIcon: [{ type: i0.Input }],
|
10863 | disabled: [{ type: i0.Input, args: ['disabled',] }, { type: i0.HostBinding, args: ['class.disabled',] }],
|
10864 | responsive: [{ type: i0.Input }],
|
10865 | route: [{ type: i0.Input }],
|
10866 | activeValue: [{ type: i0.HostBinding, args: ['class.content-active',] }],
|
10867 | active: [{ type: i0.Input }],
|
10868 | lazyLoad: [{ type: i0.Input }],
|
10869 | badgeText: [{ type: i0.Input }],
|
10870 | badgeStatus: [{ type: i0.Input }],
|
10871 | badgePosition: [{ type: i0.Input }]
|
10872 | };
|
10873 | return NbTabComponent;
|
10874 | }());
|
10875 |
|
10876 |
|
10877 |
|
10878 |
|
10879 |
|
10880 |
|
10881 |
|
10882 |
|
10883 |
|
10884 |
|
10885 |
|
10886 |
|
10887 |
|
10888 |
|
10889 |
|
10890 |
|
10891 |
|
10892 |
|
10893 |
|
10894 |
|
10895 |
|
10896 |
|
10897 |
|
10898 |
|
10899 |
|
10900 |
|
10901 |
|
10902 |
|
10903 |
|
10904 |
|
10905 |
|
10906 |
|
10907 |
|
10908 |
|
10909 |
|
10910 |
|
10911 |
|
10912 |
|
10913 |
|
10914 |
|
10915 |
|
10916 |
|
10917 |
|
10918 |
|
10919 |
|
10920 |
|
10921 |
|
10922 |
|
10923 |
|
10924 |
|
10925 |
|
10926 |
|
10927 |
|
10928 |
|
10929 |
|
10930 |
|
10931 |
|
10932 |
|
10933 |
|
10934 |
|
10935 |
|
10936 |
|
10937 |
|
10938 |
|
10939 |
|
10940 |
|
10941 |
|
10942 |
|
10943 |
|
10944 |
|
10945 |
|
10946 |
|
10947 |
|
10948 |
|
10949 |
|
10950 |
|
10951 |
|
10952 |
|
10953 |
|
10954 |
|
10955 |
|
10956 |
|
10957 |
|
10958 |
|
10959 |
|
10960 |
|
10961 |
|
10962 |
|
10963 |
|
10964 |
|
10965 |
|
10966 |
|
10967 |
|
10968 |
|
10969 | var NbTabsetComponent = (function () {
|
10970 | function NbTabsetComponent(route, changeDetectorRef) {
|
10971 | this.route = route;
|
10972 | this.changeDetectorRef = changeDetectorRef;
|
10973 | this.fullWidthValue = false;
|
10974 | |
10975 |
|
10976 |
|
10977 |
|
10978 | this.changeTab = new i0.EventEmitter();
|
10979 | }
|
10980 | Object.defineProperty(NbTabsetComponent.prototype, "fullWidth", {
|
10981 | |
10982 |
|
10983 |
|
10984 |
|
10985 | set: function (val) {
|
10986 | this.fullWidthValue = convertToBoolProperty(val);
|
10987 | },
|
10988 | enumerable: false,
|
10989 | configurable: true
|
10990 | });
|
10991 |
|
10992 | NbTabsetComponent.prototype.ngAfterContentInit = function () {
|
10993 | var _this = this;
|
10994 | this.route.params
|
10995 | .pipe(rxjs_operators.map(function (params) {
|
10996 | return _this.tabs.find(function (tab) { return _this.routeParam ? tab.route === params[_this.routeParam] : tab.active; });
|
10997 | }), rxjs_operators.delay(0), rxjs_operators.map(function (tab) { return tab || _this.tabs.first; }), rxjs_operators.filter(function (tab) { return !!tab; }))
|
10998 | .subscribe(function (tabToSelect) {
|
10999 | _this.selectTab(tabToSelect);
|
11000 | _this.changeDetectorRef.markForCheck();
|
11001 | });
|
11002 | };
|
11003 |
|
11004 | NbTabsetComponent.prototype.selectTab = function (selectedTab) {
|
11005 | if (!selectedTab.disabled) {
|
11006 | this.tabs.forEach(function (tab) { return tab.active = tab === selectedTab; });
|
11007 | this.changeTab.emit(selectedTab);
|
11008 | }
|
11009 | };
|
11010 | NbTabsetComponent.decorators = [
|
11011 | { type: i0.Component, args: [{
|
11012 | selector: 'nb-tabset',
|
11013 | template: "\n <ul class=\"tabset\">\n <li *ngFor=\"let tab of tabs\"\n (click)=\"selectTab(tab)\"\n (keyup.space)=\"selectTab(tab)\"\n (keyup.enter)=\"selectTab(tab)\"\n [class.responsive]=\"tab.responsive\"\n [class.active]=\"tab.active\"\n [class.disabled]=\"tab.disabled\"\n [attr.tabindex]=\"tab.disabled ? -1 : 0\"\n [attr.data-tab-id]=\"tab.tabId\"\n class=\"tab\">\n <a href (click)=\"$event.preventDefault()\" tabindex=\"-1\" class=\"tab-link\">\n <nb-icon *ngIf=\"tab.tabIcon\" [config]=\"tab.tabIcon\"></nb-icon>\n <span *ngIf=\"tab.tabTitle\" class=\"tab-text\">{{ tab.tabTitle }}</span>\n </a>\n <nb-badge *ngIf=\"tab.badgeText || tab.badgeDot\"\n [text]=\"tab.badgeText\"\n [dotMode]=\"tab.badgeDot\"\n [status]=\"tab.badgeStatus\"\n [position]=\"tab.badgePosition\">\n </nb-badge>\n </li>\n </ul>\n <ng-content select=\"nb-tab\"></ng-content>\n ",
|
11014 | styles: [":host{display:block}:host.full-width .tabset{justify-content:space-around}:host ::ng-deep nb-tab{flex:1;-ms-flex:1 1 auto;overflow:auto;display:none}:host ::ng-deep nb-tab.content-active{display:block}:host .tabset{display:flex;flex-direction:row;list-style-type:none;margin:0;padding:0}:host .tabset .tab{margin-bottom:-1px;text-align:center;position:relative}:host .tabset .tab.active a::before{display:block}:host .tabset .tab a{display:flex;position:relative;text-decoration:none}:host .tabset .tab a::before{position:absolute;content:'';width:100%;border-radius:3px;bottom:-2px;left:0}:host .tabset .tab a nb-icon{vertical-align:middle}[dir=ltr] :host .tabset .tab a nb-icon+span{margin-left:.5rem}[dir=rtl] :host .tabset .tab a nb-icon+span{margin-right:.5rem}\n"]
|
11015 | },] }
|
11016 | ];
|
11017 | NbTabsetComponent.ctorParameters = function () { return [
|
11018 | { type: _angular_router.ActivatedRoute },
|
11019 | { type: i0.ChangeDetectorRef }
|
11020 | ]; };
|
11021 | NbTabsetComponent.propDecorators = {
|
11022 | tabs: [{ type: i0.ContentChildren, args: [NbTabComponent,] }],
|
11023 | fullWidthValue: [{ type: i0.HostBinding, args: ['class.full-width',] }],
|
11024 | fullWidth: [{ type: i0.Input }],
|
11025 | routeParam: [{ type: i0.Input }],
|
11026 | changeTab: [{ type: i0.Output }]
|
11027 | };
|
11028 | return NbTabsetComponent;
|
11029 | }());
|
11030 |
|
11031 |
|
11032 |
|
11033 |
|
11034 |
|
11035 |
|
11036 | var NB_TABSET_COMPONENTS = [
|
11037 | NbTabsetComponent,
|
11038 | NbTabComponent,
|
11039 | ];
|
11040 | var NbTabsetModule = (function () {
|
11041 | function NbTabsetModule() {
|
11042 | }
|
11043 | NbTabsetModule.decorators = [
|
11044 | { type: i0.NgModule, args: [{
|
11045 | imports: [
|
11046 | NbSharedModule,
|
11047 | NbBadgeModule,
|
11048 | NbIconModule,
|
11049 | ],
|
11050 | declarations: tslib.__spreadArray([], NB_TABSET_COMPONENTS),
|
11051 | exports: tslib.__spreadArray([], NB_TABSET_COMPONENTS),
|
11052 | },] }
|
11053 | ];
|
11054 | return NbTabsetModule;
|
11055 | }());
|
11056 |
|
11057 |
|
11058 |
|
11059 |
|
11060 |
|
11061 |
|
11062 |
|
11063 |
|
11064 |
|
11065 |
|
11066 |
|
11067 |
|
11068 |
|
11069 |
|
11070 |
|
11071 |
|
11072 |
|
11073 |
|
11074 |
|
11075 |
|
11076 |
|
11077 |
|
11078 |
|
11079 |
|
11080 |
|
11081 |
|
11082 |
|
11083 |
|
11084 |
|
11085 |
|
11086 |
|
11087 |
|
11088 |
|
11089 |
|
11090 |
|
11091 |
|
11092 |
|
11093 |
|
11094 |
|
11095 |
|
11096 |
|
11097 |
|
11098 |
|
11099 |
|
11100 |
|
11101 |
|
11102 |
|
11103 |
|
11104 |
|
11105 |
|
11106 |
|
11107 |
|
11108 |
|
11109 |
|
11110 |
|
11111 |
|
11112 |
|
11113 |
|
11114 |
|
11115 |
|
11116 |
|
11117 |
|
11118 |
|
11119 |
|
11120 |
|
11121 |
|
11122 |
|
11123 |
|
11124 |
|
11125 |
|
11126 |
|
11127 |
|
11128 |
|
11129 |
|
11130 |
|
11131 |
|
11132 |
|
11133 |
|
11134 |
|
11135 |
|
11136 |
|
11137 |
|
11138 |
|
11139 |
|
11140 |
|
11141 |
|
11142 |
|
11143 |
|
11144 |
|
11145 |
|
11146 |
|
11147 |
|
11148 |
|
11149 |
|
11150 |
|
11151 |
|
11152 |
|
11153 |
|
11154 |
|
11155 |
|
11156 | var NbUserComponent = (function () {
|
11157 | function NbUserComponent(domSanitizer) {
|
11158 | this.domSanitizer = domSanitizer;
|
11159 | |
11160 |
|
11161 |
|
11162 |
|
11163 | this.name = 'Anonymous';
|
11164 | |
11165 |
|
11166 |
|
11167 |
|
11168 | this.size = 'medium';
|
11169 | |
11170 |
|
11171 |
|
11172 |
|
11173 | this.shape = 'round';
|
11174 | this._showName = true;
|
11175 | this._showTitle = true;
|
11176 | this._showInitials = true;
|
11177 | |
11178 |
|
11179 |
|
11180 |
|
11181 |
|
11182 | this.badgeStatus = 'basic';
|
11183 | }
|
11184 | Object.defineProperty(NbUserComponent.prototype, "picture", {
|
11185 | |
11186 |
|
11187 |
|
11188 |
|
11189 |
|
11190 | set: function (value) {
|
11191 | this.imageBackgroundStyle = value ? this.domSanitizer.bypassSecurityTrustStyle("url(" + value + ")") : null;
|
11192 | },
|
11193 | enumerable: false,
|
11194 | configurable: true
|
11195 | });
|
11196 | Object.defineProperty(NbUserComponent.prototype, "showName", {
|
11197 | |
11198 |
|
11199 |
|
11200 | get: function () {
|
11201 | return this._showName;
|
11202 | },
|
11203 | set: function (val) {
|
11204 | this._showName = convertToBoolProperty(val);
|
11205 | },
|
11206 | enumerable: false,
|
11207 | configurable: true
|
11208 | });
|
11209 | Object.defineProperty(NbUserComponent.prototype, "showTitle", {
|
11210 | |
11211 |
|
11212 |
|
11213 |
|
11214 | get: function () {
|
11215 | return this._showTitle;
|
11216 | },
|
11217 | set: function (val) {
|
11218 | this._showTitle = convertToBoolProperty(val);
|
11219 | },
|
11220 | enumerable: false,
|
11221 | configurable: true
|
11222 | });
|
11223 | Object.defineProperty(NbUserComponent.prototype, "showInitials", {
|
11224 | |
11225 |
|
11226 |
|
11227 |
|
11228 | get: function () {
|
11229 | return this._showInitials;
|
11230 | },
|
11231 | set: function (val) {
|
11232 | this._showInitials = convertToBoolProperty(val);
|
11233 | },
|
11234 | enumerable: false,
|
11235 | configurable: true
|
11236 | });
|
11237 | Object.defineProperty(NbUserComponent.prototype, "onlyPicture", {
|
11238 | |
11239 |
|
11240 |
|
11241 |
|
11242 | get: function () {
|
11243 | return !this.showName && !this.showTitle;
|
11244 | },
|
11245 | set: function (val) {
|
11246 | this.showName = this.showTitle = !convertToBoolProperty(val);
|
11247 | },
|
11248 | enumerable: false,
|
11249 | configurable: true
|
11250 | });
|
11251 | Object.defineProperty(NbUserComponent.prototype, "tiny", {
|
11252 | get: function () {
|
11253 | return this.size === 'tiny';
|
11254 | },
|
11255 | enumerable: false,
|
11256 | configurable: true
|
11257 | });
|
11258 | Object.defineProperty(NbUserComponent.prototype, "small", {
|
11259 | get: function () {
|
11260 | return this.size === 'small';
|
11261 | },
|
11262 | enumerable: false,
|
11263 | configurable: true
|
11264 | });
|
11265 | Object.defineProperty(NbUserComponent.prototype, "medium", {
|
11266 | get: function () {
|
11267 | return this.size === 'medium';
|
11268 | },
|
11269 | enumerable: false,
|
11270 | configurable: true
|
11271 | });
|
11272 | Object.defineProperty(NbUserComponent.prototype, "large", {
|
11273 | get: function () {
|
11274 | return this.size === 'large';
|
11275 | },
|
11276 | enumerable: false,
|
11277 | configurable: true
|
11278 | });
|
11279 | Object.defineProperty(NbUserComponent.prototype, "giant", {
|
11280 | get: function () {
|
11281 | return this.size === 'giant';
|
11282 | },
|
11283 | enumerable: false,
|
11284 | configurable: true
|
11285 | });
|
11286 | Object.defineProperty(NbUserComponent.prototype, "rectangle", {
|
11287 | get: function () {
|
11288 | return this.shape === 'rectangle';
|
11289 | },
|
11290 | enumerable: false,
|
11291 | configurable: true
|
11292 | });
|
11293 | Object.defineProperty(NbUserComponent.prototype, "semiRound", {
|
11294 | get: function () {
|
11295 | return this.shape === 'semi-round';
|
11296 | },
|
11297 | enumerable: false,
|
11298 | configurable: true
|
11299 | });
|
11300 | Object.defineProperty(NbUserComponent.prototype, "round", {
|
11301 | get: function () {
|
11302 | return this.shape === 'round';
|
11303 | },
|
11304 | enumerable: false,
|
11305 | configurable: true
|
11306 | });
|
11307 | NbUserComponent.prototype.getInitials = function () {
|
11308 | if (this.name) {
|
11309 | var names = this.name.split(' ');
|
11310 | return names.map(function (n) { return n.charAt(0); }).splice(0, 2).join('').toUpperCase();
|
11311 | }
|
11312 | return '';
|
11313 | };
|
11314 | NbUserComponent.decorators = [
|
11315 | { type: i0.Component, args: [{
|
11316 | selector: 'nb-user',
|
11317 | template: "<div class=\"user-container\">\n <div *ngIf=\"imageBackgroundStyle\" class=\"user-picture image\" [style.background-image]=\"imageBackgroundStyle\">\n <nb-badge *ngIf=\"badgeText\" [text]=\"badgeText\" [status]=\"badgeStatus\" [position]=\"badgePosition\"></nb-badge>\n </div>\n <div *ngIf=\"!imageBackgroundStyle\" class=\"user-picture initials\" [style.background-color]=\"color\">\n <ng-container *ngIf=\"showInitials\">\n {{ getInitials() }}\n </ng-container>\n <nb-badge *ngIf=\"badgeText\" [text]=\"badgeText\" [status]=\"badgeStatus\" [position]=\"badgePosition\"></nb-badge>\n </div>\n\n <div class=\"info-container\">\n <div *ngIf=\"showName && name\" class=\"user-name\">{{ name }}</div>\n <div *ngIf=\"showTitle && title\" class=\"user-title\">{{ title }}</div>\n </div>\n</div>\n",
|
11318 | styles: [":host{display:flex}:host .user-container{position:relative;display:flex;align-items:center}:host .user-picture{position:relative;flex-shrink:0}:host .user-picture.image{background-size:cover;background-repeat:no-repeat}:host .user-picture.initials{display:flex;align-items:center;justify-content:center}[dir=rtl] :host .user-name,[dir=rtl] :host .user-title{text-align:right}[dir=ltr] :host .info-container{margin-left:.5rem}[dir=rtl] :host .info-container{margin-right:.5rem}\n"]
|
11319 | },] }
|
11320 | ];
|
11321 | NbUserComponent.ctorParameters = function () { return [
|
11322 | { type: _angular_platformBrowser.DomSanitizer }
|
11323 | ]; };
|
11324 | NbUserComponent.propDecorators = {
|
11325 | name: [{ type: i0.Input }],
|
11326 | title: [{ type: i0.Input }],
|
11327 | picture: [{ type: i0.Input }],
|
11328 | color: [{ type: i0.Input }],
|
11329 | size: [{ type: i0.Input }],
|
11330 | shape: [{ type: i0.Input }],
|
11331 | showName: [{ type: i0.Input }],
|
11332 | showTitle: [{ type: i0.Input }],
|
11333 | showInitials: [{ type: i0.Input }],
|
11334 | onlyPicture: [{ type: i0.Input }],
|
11335 | badgeText: [{ type: i0.Input }],
|
11336 | badgeStatus: [{ type: i0.Input }],
|
11337 | badgePosition: [{ type: i0.Input }],
|
11338 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
11339 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
11340 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
11341 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
11342 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }],
|
11343 | rectangle: [{ type: i0.HostBinding, args: ['class.shape-rectangle',] }],
|
11344 | semiRound: [{ type: i0.HostBinding, args: ['class.shape-semi-round',] }],
|
11345 | round: [{ type: i0.HostBinding, args: ['class.shape-round',] }]
|
11346 | };
|
11347 | return NbUserComponent;
|
11348 | }());
|
11349 |
|
11350 |
|
11351 |
|
11352 |
|
11353 |
|
11354 |
|
11355 | var NB_USER_COMPONENTS = [
|
11356 | NbUserComponent,
|
11357 | ];
|
11358 | var NbUserModule = (function () {
|
11359 | function NbUserModule() {
|
11360 | }
|
11361 | NbUserModule.decorators = [
|
11362 | { type: i0.NgModule, args: [{
|
11363 | imports: [
|
11364 | NbSharedModule,
|
11365 | NbBadgeModule,
|
11366 | ],
|
11367 | declarations: tslib.__spreadArray([], NB_USER_COMPONENTS),
|
11368 | exports: tslib.__spreadArray([], NB_USER_COMPONENTS),
|
11369 | },] }
|
11370 | ];
|
11371 | return NbUserModule;
|
11372 | }());
|
11373 |
|
11374 |
|
11375 |
|
11376 |
|
11377 |
|
11378 |
|
11379 |
|
11380 |
|
11381 |
|
11382 | var NbActionComponent = (function () {
|
11383 | function NbActionComponent() {
|
11384 | |
11385 |
|
11386 |
|
11387 |
|
11388 | this.title = '';
|
11389 | this._disabled = false;
|
11390 | |
11391 |
|
11392 |
|
11393 |
|
11394 |
|
11395 | this.badgeStatus = 'basic';
|
11396 | }
|
11397 | Object.defineProperty(NbActionComponent.prototype, "disabled", {
|
11398 | |
11399 |
|
11400 |
|
11401 |
|
11402 | get: function () {
|
11403 | return this._disabled;
|
11404 | },
|
11405 | set: function (value) {
|
11406 | this._disabled = convertToBoolProperty(value);
|
11407 | },
|
11408 | enumerable: false,
|
11409 | configurable: true
|
11410 | });
|
11411 | Object.defineProperty(NbActionComponent.prototype, "badgeDot", {
|
11412 | |
11413 |
|
11414 |
|
11415 |
|
11416 | get: function () {
|
11417 | return this._badgeDot;
|
11418 | },
|
11419 | set: function (value) {
|
11420 | this._badgeDot = convertToBoolProperty(value);
|
11421 | },
|
11422 | enumerable: false,
|
11423 | configurable: true
|
11424 | });
|
11425 | NbActionComponent.decorators = [
|
11426 | { type: i0.Component, args: [{
|
11427 | selector: 'nb-action',
|
11428 | template: "\n <ng-container *ngIf=\"icon; else projectedContent\">\n <a class=\"icon-container\"\n [routerLink]=\"link\"\n [title]=\"title\"\n *ngIf=\"link\">\n <nb-icon [config]=\"icon\"></nb-icon>\n <ng-container [ngTemplateOutlet]=\"badgeTemplate\"></ng-container>\n </a>\n <a class=\"icon-container\"\n [href]=\"href\"\n [title]=\"title\"\n *ngIf=\"href && !link\">\n <nb-icon [config]=\"icon\"></nb-icon>\n <ng-container [ngTemplateOutlet]=\"badgeTemplate\"></ng-container>\n </a>\n <a class=\"icon-container\"\n href=\"#\"\n [title]=\"title\"\n *ngIf=\"!href && !link\"\n (click)=\"$event.preventDefault()\">\n <nb-icon [config]=\"icon\"></nb-icon>\n <ng-container [ngTemplateOutlet]=\"badgeTemplate\"></ng-container>\n </a>\n </ng-container>\n\n <ng-template #projectedContent>\n <ng-content></ng-content>\n <ng-container [ngTemplateOutlet]=\"badgeTemplate\"></ng-container>\n </ng-template>\n <ng-template #badgeTemplate>\n <nb-badge *ngIf=\"badgeText || badgeDot\"\n [text]=\"badgeText\"\n [dotMode]=\"badgeDot\"\n [status]=\"badgeStatus\"\n [position]=\"badgePosition\">\n </nb-badge>\n </ng-template>\n ",
|
11429 | styles: [":host{background:transparent;display:flex;align-items:center;position:relative}:host(.disabled){cursor:not-allowed}:host(.disabled) a,:host(.disabled) nb-icon{cursor:not-allowed}:host-context(nb-actions.full-width){justify-content:center;width:100%}a.icon-container{position:relative}a.icon-container:hover,a.icon-container:focus{text-decoration:none}nb-icon:hover{cursor:pointer}\n"]
|
11430 | },] }
|
11431 | ];
|
11432 | NbActionComponent.propDecorators = {
|
11433 | link: [{ type: i0.Input }],
|
11434 | href: [{ type: i0.Input }],
|
11435 | title: [{ type: i0.Input }],
|
11436 | icon: [{ type: i0.Input }],
|
11437 | disabled: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.disabled',] }],
|
11438 | badgeDot: [{ type: i0.Input }],
|
11439 | badgeText: [{ type: i0.Input }],
|
11440 | badgeStatus: [{ type: i0.Input }],
|
11441 | badgePosition: [{ type: i0.Input }]
|
11442 | };
|
11443 | return NbActionComponent;
|
11444 | }());
|
11445 |
|
11446 |
|
11447 |
|
11448 |
|
11449 |
|
11450 |
|
11451 |
|
11452 |
|
11453 |
|
11454 |
|
11455 |
|
11456 |
|
11457 |
|
11458 |
|
11459 |
|
11460 |
|
11461 |
|
11462 |
|
11463 |
|
11464 |
|
11465 |
|
11466 |
|
11467 |
|
11468 |
|
11469 |
|
11470 |
|
11471 |
|
11472 |
|
11473 |
|
11474 |
|
11475 |
|
11476 |
|
11477 |
|
11478 |
|
11479 |
|
11480 |
|
11481 |
|
11482 |
|
11483 |
|
11484 |
|
11485 |
|
11486 |
|
11487 |
|
11488 |
|
11489 |
|
11490 |
|
11491 |
|
11492 |
|
11493 |
|
11494 |
|
11495 |
|
11496 |
|
11497 |
|
11498 |
|
11499 |
|
11500 |
|
11501 |
|
11502 |
|
11503 |
|
11504 |
|
11505 |
|
11506 |
|
11507 |
|
11508 |
|
11509 |
|
11510 |
|
11511 |
|
11512 |
|
11513 |
|
11514 |
|
11515 |
|
11516 |
|
11517 |
|
11518 |
|
11519 |
|
11520 | var NbActionsComponent = (function () {
|
11521 | function NbActionsComponent() {
|
11522 | this._size = 'small';
|
11523 | this._fullWidth = false;
|
11524 | }
|
11525 | Object.defineProperty(NbActionsComponent.prototype, "size", {
|
11526 | |
11527 |
|
11528 |
|
11529 | get: function () {
|
11530 | return this._size;
|
11531 | },
|
11532 | set: function (value) {
|
11533 | this._size = value;
|
11534 | },
|
11535 | enumerable: false,
|
11536 | configurable: true
|
11537 | });
|
11538 | Object.defineProperty(NbActionsComponent.prototype, "fullWidth", {
|
11539 | |
11540 |
|
11541 |
|
11542 | get: function () {
|
11543 | return this._fullWidth;
|
11544 | },
|
11545 | set: function (value) {
|
11546 | this._fullWidth = convertToBoolProperty(value);
|
11547 | },
|
11548 | enumerable: false,
|
11549 | configurable: true
|
11550 | });
|
11551 | Object.defineProperty(NbActionsComponent.prototype, "tiny", {
|
11552 | get: function () {
|
11553 | return this.size === 'tiny';
|
11554 | },
|
11555 | enumerable: false,
|
11556 | configurable: true
|
11557 | });
|
11558 | Object.defineProperty(NbActionsComponent.prototype, "small", {
|
11559 | get: function () {
|
11560 | return this.size === 'small';
|
11561 | },
|
11562 | enumerable: false,
|
11563 | configurable: true
|
11564 | });
|
11565 | Object.defineProperty(NbActionsComponent.prototype, "medium", {
|
11566 | get: function () {
|
11567 | return this.size === 'medium';
|
11568 | },
|
11569 | enumerable: false,
|
11570 | configurable: true
|
11571 | });
|
11572 | Object.defineProperty(NbActionsComponent.prototype, "large", {
|
11573 | get: function () {
|
11574 | return this.size === 'large';
|
11575 | },
|
11576 | enumerable: false,
|
11577 | configurable: true
|
11578 | });
|
11579 | Object.defineProperty(NbActionsComponent.prototype, "giant", {
|
11580 | get: function () {
|
11581 | return this.size === 'giant';
|
11582 | },
|
11583 | enumerable: false,
|
11584 | configurable: true
|
11585 | });
|
11586 | NbActionsComponent.decorators = [
|
11587 | { type: i0.Component, args: [{
|
11588 | selector: 'nb-actions',
|
11589 | template: "\n <ng-content select=\"nb-action\"></ng-content>\n ",
|
11590 | styles: [":host{display:flex;align-items:center}\n"]
|
11591 | },] }
|
11592 | ];
|
11593 | NbActionsComponent.propDecorators = {
|
11594 | size: [{ type: i0.Input }],
|
11595 | fullWidth: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.full-width',] }],
|
11596 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
11597 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
11598 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
11599 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
11600 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }]
|
11601 | };
|
11602 | return NbActionsComponent;
|
11603 | }());
|
11604 |
|
11605 |
|
11606 |
|
11607 |
|
11608 |
|
11609 |
|
11610 | var NB_ACTIONS_COMPONENTS = [
|
11611 | NbActionComponent,
|
11612 | NbActionsComponent,
|
11613 | ];
|
11614 | var NbActionsModule = (function () {
|
11615 | function NbActionsModule() {
|
11616 | }
|
11617 | NbActionsModule.decorators = [
|
11618 | { type: i0.NgModule, args: [{
|
11619 | imports: [
|
11620 | NbSharedModule,
|
11621 | NbBadgeModule,
|
11622 | NbIconModule,
|
11623 | ],
|
11624 | declarations: tslib.__spreadArray([], NB_ACTIONS_COMPONENTS),
|
11625 | exports: tslib.__spreadArray([], NB_ACTIONS_COMPONENTS),
|
11626 | },] }
|
11627 | ];
|
11628 | return NbActionsModule;
|
11629 | }());
|
11630 |
|
11631 |
|
11632 |
|
11633 |
|
11634 |
|
11635 |
|
11636 |
|
11637 |
|
11638 |
|
11639 | var NbSearchService = (function () {
|
11640 | function NbSearchService() {
|
11641 | this.searchSubmittings$ = new rxjs.Subject();
|
11642 | this.searchActivations$ = new rxjs.Subject();
|
11643 | this.searchDeactivations$ = new rxjs.Subject();
|
11644 | this.searchInput$ = new rxjs.Subject();
|
11645 | }
|
11646 | |
11647 |
|
11648 |
|
11649 |
|
11650 |
|
11651 | NbSearchService.prototype.activateSearch = function (searchType, tag) {
|
11652 | this.searchActivations$.next({ searchType: searchType, tag: tag });
|
11653 | };
|
11654 | |
11655 |
|
11656 |
|
11657 |
|
11658 |
|
11659 | NbSearchService.prototype.deactivateSearch = function (searchType, tag) {
|
11660 | this.searchDeactivations$.next({ searchType: searchType, tag: tag });
|
11661 | };
|
11662 | |
11663 |
|
11664 |
|
11665 |
|
11666 |
|
11667 | NbSearchService.prototype.submitSearch = function (term, tag) {
|
11668 | this.searchSubmittings$.next({ term: term, tag: tag });
|
11669 | };
|
11670 | |
11671 |
|
11672 |
|
11673 |
|
11674 |
|
11675 | NbSearchService.prototype.searchInput = function (term, tag) {
|
11676 | this.searchInput$.next({ term: term, tag: tag });
|
11677 | };
|
11678 | |
11679 |
|
11680 |
|
11681 |
|
11682 | NbSearchService.prototype.onSearchActivate = function () {
|
11683 | return this.searchActivations$.pipe(rxjs_operators.share());
|
11684 | };
|
11685 | |
11686 |
|
11687 |
|
11688 |
|
11689 | NbSearchService.prototype.onSearchDeactivate = function () {
|
11690 | return this.searchDeactivations$.pipe(rxjs_operators.share());
|
11691 | };
|
11692 | |
11693 |
|
11694 |
|
11695 |
|
11696 | NbSearchService.prototype.onSearchSubmit = function () {
|
11697 | return this.searchSubmittings$.pipe(rxjs_operators.share());
|
11698 | };
|
11699 | |
11700 |
|
11701 |
|
11702 |
|
11703 | NbSearchService.prototype.onSearchInput = function () {
|
11704 | return this.searchInput$.pipe(rxjs_operators.share());
|
11705 | };
|
11706 | NbSearchService.decorators = [
|
11707 | { type: i0.Injectable }
|
11708 | ];
|
11709 | return NbSearchService;
|
11710 | }());
|
11711 |
|
11712 |
|
11713 |
|
11714 |
|
11715 |
|
11716 |
|
11717 |
|
11718 |
|
11719 |
|
11720 |
|
11721 | var NbSearchFieldComponent = (function () {
|
11722 | function NbSearchFieldComponent() {
|
11723 | this.show = false;
|
11724 | this.close = new i0.EventEmitter();
|
11725 | this.search = new i0.EventEmitter();
|
11726 | this.searchInput = new i0.EventEmitter();
|
11727 | }
|
11728 | Object.defineProperty(NbSearchFieldComponent.prototype, "showClass", {
|
11729 | get: function () {
|
11730 | return this.show;
|
11731 | },
|
11732 | enumerable: false,
|
11733 | configurable: true
|
11734 | });
|
11735 | Object.defineProperty(NbSearchFieldComponent.prototype, "modalZoomin", {
|
11736 | get: function () {
|
11737 | return this.type === NbSearchFieldComponent.TYPE_MODAL_ZOOMIN;
|
11738 | },
|
11739 | enumerable: false,
|
11740 | configurable: true
|
11741 | });
|
11742 | Object.defineProperty(NbSearchFieldComponent.prototype, "rotateLayout", {
|
11743 | get: function () {
|
11744 | return this.type === NbSearchFieldComponent.TYPE_ROTATE_LAYOUT;
|
11745 | },
|
11746 | enumerable: false,
|
11747 | configurable: true
|
11748 | });
|
11749 | Object.defineProperty(NbSearchFieldComponent.prototype, "modalMove", {
|
11750 | get: function () {
|
11751 | return this.type === NbSearchFieldComponent.TYPE_MODAL_MOVE;
|
11752 | },
|
11753 | enumerable: false,
|
11754 | configurable: true
|
11755 | });
|
11756 | Object.defineProperty(NbSearchFieldComponent.prototype, "curtain", {
|
11757 | get: function () {
|
11758 | return this.type === NbSearchFieldComponent.TYPE_CURTAIN;
|
11759 | },
|
11760 | enumerable: false,
|
11761 | configurable: true
|
11762 | });
|
11763 | Object.defineProperty(NbSearchFieldComponent.prototype, "columnCurtain", {
|
11764 | get: function () {
|
11765 | return this.type === NbSearchFieldComponent.TYPE_COLUMN_CURTAIN;
|
11766 | },
|
11767 | enumerable: false,
|
11768 | configurable: true
|
11769 | });
|
11770 | Object.defineProperty(NbSearchFieldComponent.prototype, "modalDrop", {
|
11771 | get: function () {
|
11772 | return this.type === NbSearchFieldComponent.TYPE_MODAL_DROP;
|
11773 | },
|
11774 | enumerable: false,
|
11775 | configurable: true
|
11776 | });
|
11777 | Object.defineProperty(NbSearchFieldComponent.prototype, "modalHalf", {
|
11778 | get: function () {
|
11779 | return this.type === NbSearchFieldComponent.TYPE_MODAL_HALF;
|
11780 | },
|
11781 | enumerable: false,
|
11782 | configurable: true
|
11783 | });
|
11784 | NbSearchFieldComponent.prototype.ngOnChanges = function (_a) {
|
11785 | var show = _a.show;
|
11786 | var becameHidden = !show.isFirstChange() && show.currentValue === false;
|
11787 | if (becameHidden && this.inputElement) {
|
11788 | this.inputElement.nativeElement.value = '';
|
11789 | }
|
11790 | this.focusInput();
|
11791 | };
|
11792 | NbSearchFieldComponent.prototype.ngAfterViewInit = function () {
|
11793 | this.focusInput();
|
11794 | };
|
11795 | NbSearchFieldComponent.prototype.emitClose = function () {
|
11796 | this.close.emit();
|
11797 | };
|
11798 | NbSearchFieldComponent.prototype.submitSearch = function (term) {
|
11799 | if (term) {
|
11800 | this.search.emit(term);
|
11801 | }
|
11802 | };
|
11803 | NbSearchFieldComponent.prototype.emitSearchInput = function (term) {
|
11804 | this.searchInput.emit(term);
|
11805 | };
|
11806 | NbSearchFieldComponent.prototype.focusInput = function () {
|
11807 | if (this.show && this.inputElement) {
|
11808 | this.inputElement.nativeElement.focus();
|
11809 | }
|
11810 | };
|
11811 | NbSearchFieldComponent.TYPE_MODAL_ZOOMIN = 'modal-zoomin';
|
11812 | NbSearchFieldComponent.TYPE_ROTATE_LAYOUT = 'rotate-layout';
|
11813 | NbSearchFieldComponent.TYPE_MODAL_MOVE = 'modal-move';
|
11814 | NbSearchFieldComponent.TYPE_CURTAIN = 'curtain';
|
11815 | NbSearchFieldComponent.TYPE_COLUMN_CURTAIN = 'column-curtain';
|
11816 | NbSearchFieldComponent.TYPE_MODAL_DROP = 'modal-drop';
|
11817 | NbSearchFieldComponent.TYPE_MODAL_HALF = 'modal-half';
|
11818 | NbSearchFieldComponent.decorators = [
|
11819 | { type: i0.Component, args: [{
|
11820 | selector: 'nb-search-field',
|
11821 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
11822 | template: "\n <div class=\"search\" (keyup.esc)=\"emitClose()\">\n <button (click)=\"emitClose()\" nbButton ghost class=\"close-button\">\n <nb-icon icon=\"close-outline\" pack=\"nebular-essentials\"></nb-icon>\n </button>\n <div class=\"form-wrapper\">\n <form class=\"form\" (keyup.enter)=\"submitSearch(searchInput.value)\">\n <div class=\"form-content\">\n <input class=\"search-input\"\n #searchInput\n (input)=\"emitSearchInput(searchInput.value)\"\n autocomplete=\"off\"\n [attr.placeholder]=\"placeholder\"\n tabindex=\"-1\"\n (blur)=\"focusInput()\"/>\n </div>\n <span class=\"info\">{{ hint }}</span>\n </form>\n </div>\n </div>\n ",
|
11823 | styles: [":host button{margin:0;padding:0;cursor:pointer;border:none;background:none}:host button:focus{box-shadow:none;outline:none}:host input{border-top:0;border-right:0;border-left:0;background:transparent;border-radius:0;line-height:1;display:inline-block;box-sizing:border-box;padding:0.05rem 0;-webkit-appearance:none}:host input:focus{outline:none}:host input::placeholder{opacity:0.3}:host span{font-size:90%;font-weight:bold;display:block;width:75%;margin:0 auto;padding:0.85rem 0;text-align:right}:host.modal-zoomin{display:block}:host.modal-zoomin .search{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;position:fixed;z-index:1050;top:0;left:0;width:100%;height:100vh;pointer-events:none;opacity:0;transition:opacity 0.5s}:host.modal-zoomin .search::before,:host.modal-zoomin .search::after{content:'';position:absolute;width:calc(100% + 15px);height:calc(100% + 15px);pointer-events:none}:host.modal-zoomin .search::before{top:0;left:0;border-right-width:0;border-bottom-width:0;transform:translate3d(-15px, -15px, 0)}:host.modal-zoomin .search::after{right:0;bottom:0;border-top-width:0;border-left-width:0;transform:translate3d(15px, 15px, 0)}:host.modal-zoomin .search button{position:absolute;top:3rem;font-size:2.5rem}[dir=ltr] :host.modal-zoomin .search button{right:3rem}[dir=rtl] :host.modal-zoomin .search button{left:3rem}:host.modal-zoomin .search input{font-size:10vw;width:75%}:host.modal-zoomin .search button{opacity:0;transform:scale3d(0.8, 0.8, 1);transition:opacity 0.5s, transform 0.5s}:host.modal-zoomin .search form{opacity:0;transform:scale3d(0.8, 0.8, 1);transition:opacity 0.5s, transform 0.5s}:host.modal-zoomin.show .search{pointer-events:auto;opacity:1}:host.modal-zoomin.show .search::before,:host.modal-zoomin.show .search::after{transform:translate3d(0, 0, 0);transition:transform 0.5s}:host.modal-zoomin.show .search button{opacity:1;transform:scale3d(1, 1, 1)}:host.modal-zoomin.show .search form{opacity:1;transform:scale3d(1, 1, 1)}@media screen and (max-width: 40rem){:host.modal-zoomin form{margin:5rem 0 1rem}:host.modal-zoomin span{text-align:left}}\n", "::ng-deep nb-layout.rotate-layout{position:fixed;overflow:hidden;width:100%}::ng-deep nb-layout.rotate-layout .scrollable-container{position:relative;z-index:10001;transition:transform 0.5s cubic-bezier(0.2, 1, 0.3, 1)}::ng-deep nb-layout.rotate-layout.with-search .scrollable-container{transition:transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);transform-origin:50vw 50vh;transform:perspective(1000px) translate3d(0, 50vh, 0) rotate3d(1, 0, 0, 30deg);pointer-events:none}:host.rotate-layout{position:absolute;display:block;width:100vw;height:100vh;pointer-events:none;opacity:0;transition-property:opacity;transition-delay:0.4s}:host.rotate-layout .search{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;z-index:1050;position:fixed;top:0;left:0;width:100%;height:50vh;pointer-events:none;opacity:0;transition:opacity 0.5s;transition-timing-function:cubic-bezier(0.2, 1, 0.3, 1)}:host.rotate-layout .search button{position:absolute;top:3rem;font-size:2.5rem;opacity:0;transform:scale3d(0.8, 0.8, 1);transition:opacity 0.5s, transform 0.5s;transition-timing-function:cubic-bezier(0.2, 1, 0.3, 1)}[dir=ltr] :host.rotate-layout .search button{right:3rem}[dir=rtl] :host.rotate-layout .search button{left:3rem}:host.rotate-layout .search form{margin:5rem 0;opacity:0;transform:scale3d(0.7, 0.7, 1);transition:opacity 0.5s, transform 0.5s;transition-timing-function:cubic-bezier(0.2, 1, 0.3, 1)}:host.rotate-layout .search input{font-size:7vw;width:75%}:host.rotate-layout.show{opacity:1;transition-delay:0s}:host.rotate-layout.show .search{pointer-events:auto;opacity:1}:host.rotate-layout.show .search button{opacity:1;transform:scale3d(1, 1, 1)}:host.rotate-layout.show .search form{opacity:1;transform:scale3d(1, 1, 1)}\n", "::ng-deep nb-layout.modal-move .layout{transition:transform 0.5s}::ng-deep nb-layout.modal-move.with-search .layout{transform:scale3d(0.8, 0.8, 1);pointer-events:none}:host.modal-move .search{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;position:fixed;z-index:1050;top:0;left:0;width:100%;height:100vh;pointer-events:none;opacity:0;transition:opacity 0.5s}:host.modal-move .search button{position:absolute;top:3rem;font-size:2.5rem;opacity:0;transition:opacity 0.5s}[dir=ltr] :host.modal-move .search button{right:3rem}[dir=rtl] :host.modal-move .search button{left:3rem}:host.modal-move .search form{margin:5rem 0;opacity:0;transform:scale3d(0.8, 0.8, 1);transition:opacity 0.5s, transform 0.5s}:host.modal-move .search input{font-size:10vw;width:75%;transform:scale3d(0, 1, 1);transform-origin:0 50%;transition:transform 0.3s}:host.modal-move.show .search{pointer-events:auto;opacity:1}:host.modal-move.show .search button{opacity:1}:host.modal-move.show .search form{opacity:1;transform:scale3d(1, 1, 1)}:host.modal-move.show .search input{transform:scale3d(1, 1, 1);transition-duration:0.5s}@media screen and (max-width: 40rem){:host.modal-move span{text-align:left}}\n", ":host.curtain .search{position:fixed;z-index:1050;top:0;left:100%;overflow:hidden;height:100vh;width:100%;padding:3rem;pointer-events:none;transition:transform 0.3s;transition-delay:0.4s;transition-timing-function:ease-out}:host.curtain .search::after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;transition:transform 0.3s;transition-timing-function:ease-out}:host.curtain .search button{font-size:2.5rem;position:absolute;top:3rem;transition:opacity 0.1s;transition-delay:0.3s}[dir=ltr] :host.curtain .search button{right:3rem}[dir=rtl] :host.curtain .search button{left:3rem}:host.curtain .search form{width:50%;opacity:0;transform:scale3d(0.8, 0.8, 1);transition:opacity 0.5s, transform 0.5s}:host.curtain .search input{width:100%;font-size:6vw}:host.curtain.show .search{width:100%;pointer-events:auto;transform:translate3d(-100%, 0, 0);transition-delay:0s}:host.curtain.show .search::after{transform:translate3d(100%, 0, 0);transition-delay:0.4s}:host.curtain.show .search button{opacity:1;transform:scale3d(1, 1, 1)}:host.curtain.show .search form{opacity:1;transform:scale3d(1, 1, 1)}@media screen and (max-width: 40em){:host.curtain span{width:90%}:host.curtain input{font-size:2em;width:90%}}::ng-deep nb-layout.curtain .scrollable-container{position:relative;z-index:0}\n", "::ng-deep nb-layout.column-curtain.with-search .layout{pointer-events:none}:host.column-curtain{display:block;position:fixed;z-index:1050;top:0;left:50%;overflow:hidden;width:50%;height:100vh;pointer-events:none}:host.column-curtain::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;transform:scale3d(0, 1, 1);transform-origin:0 50%;transition:transform 0.3s;transition-timing-function:cubic-bezier(0.86, 0, 0.07, 1)}:host.column-curtain .search{position:relative;padding:2.5rem 1.5rem 0;background:transparent}:host.column-curtain .search button{position:absolute;top:2rem;font-size:2.5rem;opacity:0;transition:opacity 0.5s}[dir=ltr] :host.column-curtain .search button{right:2rem}[dir=rtl] :host.column-curtain .search button{left:2rem}:host.column-curtain .search form{width:85%;transform:translate3d(-150%, 0, 0);transition:transform 0.3s}:host.column-curtain .search input{font-size:2.5rem;width:100%}:host.column-curtain .search span{font-size:85%}:host.column-curtain.show{pointer-events:auto}:host.column-curtain.show::before{transform:scale3d(1, 1, 1)}:host.column-curtain.show .search form{transform:translate3d(0, 0, 0);transition-delay:0.15s;transition-timing-function:cubic-bezier(0.86, 0, 0.07, 1)}:host.column-curtain.show .search button{opacity:1;z-index:100}@media screen and (max-width: 40rem){:host.column-curtain span{width:90%}:host.column-curtain input{font-size:2rem;width:90%}}\n", "::ng-deep nb-layout.modal-drop .layout{position:relative;transition:transform 0.4s, opacity 0.4s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}::ng-deep nb-layout.modal-drop.with-search .layout{opacity:0;transform:scale3d(0.9, 0.9, 1);pointer-events:none}:host.modal-drop .search{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;z-index:1050;position:fixed;top:0;left:0;width:100%;height:100vh;background:none;pointer-events:none}:host.modal-drop .search::before{content:'';position:absolute;top:0;right:0;width:100%;height:100%;opacity:0;transition:opacity 0.4s}:host.modal-drop .search button{font-size:2.5rem;position:absolute;top:3rem;display:block;opacity:0;transition:opacity 0.4s}[dir=ltr] :host.modal-drop .search button{right:3rem}[dir=rtl] :host.modal-drop .search button{left:3rem}:host.modal-drop .search form{position:relative;margin:5rem 0 2rem}:host.modal-drop .search input{font-size:6vw;width:60%;padding:0.25rem;text-align:center;opacity:0;transition:opacity 0.4s}:host.modal-drop .search span{position:relative;z-index:9;display:block;width:60%;padding:0.85rem 0;opacity:0;transform:translate3d(0, -50px, 0);transition:opacity 0.4s, transform 0.4s}:host.modal-drop .search .form-content{position:relative;z-index:10;overflow:hidden;transform:translate3d(0, -50px, 0);transition:transform 0.4s}:host.modal-drop .search .form-content::after{content:'';position:absolute;top:0;left:20%;width:60%;height:105%;opacity:0;transform-origin:50% 0}:host.modal-drop.show .search{pointer-events:auto}:host.modal-drop.show .search::before{opacity:1}:host.modal-drop.show .search button{opacity:1}:host.modal-drop.show .search .form-content{transform:translate3d(0, 0, 0);transition:none}:host.modal-drop.show .search .form-content::after{animation:scaleUpDown 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards}:host.modal-drop.show .search input{opacity:1;transition:opacity 0s 0.4s}:host.modal-drop.show .search span{opacity:1;transform:translate3d(0, 0, 0);transition-delay:0.4s;transition-timing-function:ease-out}@keyframes scaleUpDown{0%{opacity:1;transform:scale3d(1, 0, 1)}50%{transform:scale3d(1, 1, 1);transform-origin:50% 0;transition-timing-function:ease-out}50.1%{transform-origin:50% 100%;transition-timing-function:ease-out}100%{opacity:1;transform:scale3d(1, 0, 1);transform-origin:50% 100%;transition-timing-function:ease-out}}@media screen and (max-width: 40rem){:host.modal-drop form{margin:2rem 0}:host.modal-drop input{width:100%;left:0}}\n", "::ng-deep nb-layout.modal-half .layout{transition:transform 0.6s, opacity 0.6s;transition-timing-function:cubic-bezier(0.2, 1, 0.3, 1)}::ng-deep nb-layout.modal-half.with-search .layout{transform:scale3d(0.8, 0.8, 1);pointer-events:none}:host.modal-half .search{text-align:center;position:fixed;z-index:1050;top:0;left:0;overflow:hidden;width:100%;height:100vh;background:none;pointer-events:none}:host.modal-half .search::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;opacity:0;transition:opacity 0.6s;transition-timing-function:cubic-bezier(0.2, 1, 0.3, 1)}:host.modal-half .search button{font-size:2.5rem;position:absolute;top:3rem;display:block;z-index:100;opacity:0;transform:scale3d(0.8, 0.8, 1);transition:opacity 0.6s, transform 0.6s;transition-timing-function:cubic-bezier(0.2, 1, 0.3, 1)}[dir=ltr] :host.modal-half .search button{right:3rem}[dir=rtl] :host.modal-half .search button{left:3rem}:host.modal-half .search .form-wrapper{position:absolute;display:flex;justify-content:center;align-items:center;width:100%;height:50%;transition:transform 0.6s;transition-timing-function:cubic-bezier(0.2, 1, 0.3, 1);transform:translate3d(0, -100%, 0)}:host.modal-half .search form{width:75%;margin:0 auto}:host.modal-half .search input{font-size:7vw;width:100%}:host.modal-half.show .search{pointer-events:auto}:host.modal-half.show .search::before{opacity:1}:host.modal-half.show .search button{opacity:1;transform:scale3d(1, 1, 1)}:host.modal-half.show .search .form-wrapper{transform:translate3d(0, 0, 0)}\n"]
|
11824 | },] }
|
11825 | ];
|
11826 | NbSearchFieldComponent.propDecorators = {
|
11827 | type: [{ type: i0.Input }],
|
11828 | placeholder: [{ type: i0.Input }],
|
11829 | hint: [{ type: i0.Input }],
|
11830 | show: [{ type: i0.Input }],
|
11831 | close: [{ type: i0.Output }],
|
11832 | search: [{ type: i0.Output }],
|
11833 | searchInput: [{ type: i0.Output }],
|
11834 | inputElement: [{ type: i0.ViewChild, args: ['searchInput',] }],
|
11835 | showClass: [{ type: i0.HostBinding, args: ['class.show',] }],
|
11836 | modalZoomin: [{ type: i0.HostBinding, args: ['class.modal-zoomin',] }],
|
11837 | rotateLayout: [{ type: i0.HostBinding, args: ['class.rotate-layout',] }],
|
11838 | modalMove: [{ type: i0.HostBinding, args: ['class.modal-move',] }],
|
11839 | curtain: [{ type: i0.HostBinding, args: ['class.curtain',] }],
|
11840 | columnCurtain: [{ type: i0.HostBinding, args: ['class.column-curtain',] }],
|
11841 | modalDrop: [{ type: i0.HostBinding, args: ['class.modal-drop',] }],
|
11842 | modalHalf: [{ type: i0.HostBinding, args: ['class.modal-half',] }]
|
11843 | };
|
11844 | return NbSearchFieldComponent;
|
11845 | }());
|
11846 |
|
11847 |
|
11848 |
|
11849 |
|
11850 |
|
11851 |
|
11852 |
|
11853 |
|
11854 |
|
11855 |
|
11856 |
|
11857 |
|
11858 |
|
11859 |
|
11860 |
|
11861 |
|
11862 |
|
11863 |
|
11864 |
|
11865 |
|
11866 |
|
11867 |
|
11868 |
|
11869 |
|
11870 |
|
11871 |
|
11872 |
|
11873 |
|
11874 |
|
11875 |
|
11876 |
|
11877 |
|
11878 |
|
11879 |
|
11880 |
|
11881 |
|
11882 |
|
11883 |
|
11884 |
|
11885 |
|
11886 |
|
11887 |
|
11888 |
|
11889 |
|
11890 |
|
11891 |
|
11892 |
|
11893 |
|
11894 |
|
11895 |
|
11896 | var NbSearchComponent = (function () {
|
11897 | function NbSearchComponent(searchService, themeService, router, overlayService, changeDetector) {
|
11898 | this.searchService = searchService;
|
11899 | this.themeService = themeService;
|
11900 | this.router = router;
|
11901 | this.overlayService = overlayService;
|
11902 | this.changeDetector = changeDetector;
|
11903 | this.destroy$ = new rxjs.Subject();
|
11904 | this.showSearchField = false;
|
11905 | |
11906 |
|
11907 |
|
11908 |
|
11909 | this.placeholder = 'Search...';
|
11910 | |
11911 |
|
11912 |
|
11913 |
|
11914 |
|
11915 | this.hint = 'Hit enter to search';
|
11916 | }
|
11917 | NbSearchComponent.prototype.ngOnInit = function () {
|
11918 | var _this = this;
|
11919 | this.router.events
|
11920 | .pipe(rxjs_operators.filter(function (event) { return event instanceof _angular_router.NavigationEnd; }), rxjs_operators.takeUntil(this.destroy$))
|
11921 | .subscribe(function () { return _this.hideSearch(); });
|
11922 | this.searchService.onSearchActivate()
|
11923 | .pipe(rxjs_operators.filter(function (data) { return !_this.tag || data.tag === _this.tag; }), rxjs_operators.takeUntil(this.destroy$))
|
11924 | .subscribe(function () { return _this.openSearch(); });
|
11925 | this.searchService.onSearchDeactivate()
|
11926 | .pipe(rxjs_operators.filter(function (data) { return !_this.tag || data.tag === _this.tag; }), rxjs_operators.takeUntil(this.destroy$))
|
11927 | .subscribe(function () { return _this.hideSearch(); });
|
11928 | };
|
11929 | NbSearchComponent.prototype.ngOnDestroy = function () {
|
11930 | if (this.overlayRef && this.overlayRef.hasAttached()) {
|
11931 | this.removeLayoutClasses();
|
11932 | this.overlayRef.detach();
|
11933 | }
|
11934 | this.destroy$.next();
|
11935 | this.destroy$.complete();
|
11936 | };
|
11937 | NbSearchComponent.prototype.openSearch = function () {
|
11938 | var _this = this;
|
11939 | if (!this.overlayRef) {
|
11940 | this.overlayRef = this.overlayService.create();
|
11941 | this.overlayRef.attach(this.searchFieldPortal);
|
11942 | }
|
11943 | this.themeService.appendLayoutClass(this.type);
|
11944 | rxjs.of(null).pipe(rxjs_operators.delay(0)).subscribe(function () {
|
11945 | _this.themeService.appendLayoutClass('with-search');
|
11946 | _this.showSearchField = true;
|
11947 | _this.changeDetector.detectChanges();
|
11948 | });
|
11949 | };
|
11950 | NbSearchComponent.prototype.hideSearch = function () {
|
11951 | this.removeLayoutClasses();
|
11952 | this.showSearchField = false;
|
11953 | this.changeDetector.detectChanges();
|
11954 | this.searchButton.nativeElement.focus();
|
11955 | };
|
11956 | NbSearchComponent.prototype.search = function (term) {
|
11957 | this.searchService.submitSearch(term, this.tag);
|
11958 | this.hideSearch();
|
11959 | };
|
11960 | NbSearchComponent.prototype.emitInput = function (term) {
|
11961 | this.searchService.searchInput(term, this.tag);
|
11962 | };
|
11963 | NbSearchComponent.prototype.emitActivate = function () {
|
11964 | this.searchService.activateSearch(this.type, this.tag);
|
11965 | };
|
11966 | NbSearchComponent.prototype.emitDeactivate = function () {
|
11967 | this.searchService.deactivateSearch(this.type, this.tag);
|
11968 | };
|
11969 | NbSearchComponent.prototype.removeLayoutClasses = function () {
|
11970 | var _this = this;
|
11971 | this.themeService.removeLayoutClass('with-search');
|
11972 | rxjs.of(null).pipe(rxjs_operators.delay(500)).subscribe(function () {
|
11973 | _this.themeService.removeLayoutClass(_this.type);
|
11974 | });
|
11975 | };
|
11976 | NbSearchComponent.decorators = [
|
11977 | { type: i0.Component, args: [{
|
11978 | selector: 'nb-search',
|
11979 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
11980 | template: "\n <button #searchButton class=\"start-search\" (click)=\"emitActivate()\" nbButton ghost>\n <nb-icon icon=\"search-outline\" pack=\"nebular-essentials\"></nb-icon>\n </button>\n <nb-search-field\n *nbPortal\n [show]=\"showSearchField\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [hint]=\"hint\"\n (search)=\"search($event)\"\n (searchInput)=\"emitInput($event)\"\n (close)=\"emitDeactivate()\">\n </nb-search-field>\n ",
|
11981 | styles: [":host button{font-size:2rem;margin:0 auto;padding:0;cursor:pointer;border:none;background:none}:host button:focus{box-shadow:none;outline:none}::ng-deep nb-layout.with-search .scrollable-container{position:relative;z-index:0}\n"]
|
11982 | },] }
|
11983 | ];
|
11984 | NbSearchComponent.ctorParameters = function () { return [
|
11985 | { type: NbSearchService },
|
11986 | { type: NbThemeService },
|
11987 | { type: _angular_router.Router },
|
11988 | { type: NbOverlayService },
|
11989 | { type: i0.ChangeDetectorRef }
|
11990 | ]; };
|
11991 | NbSearchComponent.propDecorators = {
|
11992 | tag: [{ type: i0.Input }],
|
11993 | placeholder: [{ type: i0.Input }],
|
11994 | hint: [{ type: i0.Input }],
|
11995 | type: [{ type: i0.Input }],
|
11996 | searchFieldPortal: [{ type: i0.ViewChild, args: [NbPortalDirective,] }],
|
11997 | searchButton: [{ type: i0.ViewChild, args: ['searchButton', { read: i0.ElementRef },] }]
|
11998 | };
|
11999 | return NbSearchComponent;
|
12000 | }());
|
12001 |
|
12002 |
|
12003 |
|
12004 |
|
12005 |
|
12006 |
|
12007 | var NbSearchModule = (function () {
|
12008 | function NbSearchModule() {
|
12009 | }
|
12010 | NbSearchModule.decorators = [
|
12011 | { type: i0.NgModule, args: [{
|
12012 | imports: [
|
12013 | NbSharedModule,
|
12014 | NbOverlayModule,
|
12015 | NbIconModule,
|
12016 | NbButtonModule,
|
12017 | ],
|
12018 | declarations: [
|
12019 | NbSearchComponent,
|
12020 | NbSearchFieldComponent,
|
12021 | ],
|
12022 | exports: [
|
12023 | NbSearchComponent,
|
12024 | NbSearchFieldComponent,
|
12025 | ],
|
12026 | providers: [
|
12027 | NbSearchService,
|
12028 | ],
|
12029 | entryComponents: [
|
12030 | NbSearchFieldComponent,
|
12031 | ],
|
12032 | },] }
|
12033 | ];
|
12034 | return NbSearchModule;
|
12035 | }());
|
12036 |
|
12037 |
|
12038 |
|
12039 |
|
12040 |
|
12041 |
|
12042 |
|
12043 |
|
12044 |
|
12045 |
|
12046 |
|
12047 |
|
12048 |
|
12049 |
|
12050 |
|
12051 |
|
12052 |
|
12053 |
|
12054 |
|
12055 |
|
12056 |
|
12057 |
|
12058 |
|
12059 |
|
12060 |
|
12061 |
|
12062 |
|
12063 |
|
12064 |
|
12065 |
|
12066 |
|
12067 |
|
12068 |
|
12069 |
|
12070 |
|
12071 |
|
12072 |
|
12073 |
|
12074 |
|
12075 |
|
12076 |
|
12077 |
|
12078 |
|
12079 |
|
12080 |
|
12081 |
|
12082 |
|
12083 |
|
12084 |
|
12085 |
|
12086 |
|
12087 |
|
12088 |
|
12089 |
|
12090 |
|
12091 |
|
12092 |
|
12093 |
|
12094 |
|
12095 |
|
12096 |
|
12097 |
|
12098 |
|
12099 |
|
12100 |
|
12101 |
|
12102 |
|
12103 |
|
12104 |
|
12105 |
|
12106 |
|
12107 |
|
12108 |
|
12109 |
|
12110 |
|
12111 |
|
12112 |
|
12113 |
|
12114 |
|
12115 |
|
12116 |
|
12117 |
|
12118 |
|
12119 |
|
12120 |
|
12121 |
|
12122 |
|
12123 |
|
12124 |
|
12125 |
|
12126 |
|
12127 |
|
12128 |
|
12129 |
|
12130 |
|
12131 |
|
12132 |
|
12133 |
|
12134 |
|
12135 |
|
12136 |
|
12137 |
|
12138 |
|
12139 |
|
12140 |
|
12141 |
|
12142 |
|
12143 |
|
12144 |
|
12145 |
|
12146 |
|
12147 |
|
12148 |
|
12149 |
|
12150 |
|
12151 |
|
12152 |
|
12153 |
|
12154 |
|
12155 |
|
12156 |
|
12157 |
|
12158 |
|
12159 |
|
12160 |
|
12161 |
|
12162 |
|
12163 |
|
12164 |
|
12165 |
|
12166 |
|
12167 |
|
12168 |
|
12169 |
|
12170 |
|
12171 |
|
12172 |
|
12173 |
|
12174 |
|
12175 |
|
12176 |
|
12177 |
|
12178 |
|
12179 |
|
12180 |
|
12181 |
|
12182 |
|
12183 |
|
12184 |
|
12185 |
|
12186 |
|
12187 |
|
12188 |
|
12189 |
|
12190 |
|
12191 |
|
12192 |
|
12193 |
|
12194 |
|
12195 |
|
12196 |
|
12197 |
|
12198 |
|
12199 |
|
12200 |
|
12201 |
|
12202 |
|
12203 |
|
12204 |
|
12205 |
|
12206 |
|
12207 |
|
12208 |
|
12209 |
|
12210 |
|
12211 |
|
12212 |
|
12213 |
|
12214 |
|
12215 |
|
12216 |
|
12217 |
|
12218 |
|
12219 |
|
12220 |
|
12221 |
|
12222 |
|
12223 |
|
12224 |
|
12225 |
|
12226 |
|
12227 |
|
12228 |
|
12229 |
|
12230 |
|
12231 |
|
12232 |
|
12233 |
|
12234 |
|
12235 |
|
12236 |
|
12237 |
|
12238 |
|
12239 |
|
12240 |
|
12241 |
|
12242 |
|
12243 |
|
12244 |
|
12245 |
|
12246 |
|
12247 |
|
12248 |
|
12249 |
|
12250 |
|
12251 |
|
12252 |
|
12253 |
|
12254 |
|
12255 |
|
12256 |
|
12257 |
|
12258 |
|
12259 |
|
12260 |
|
12261 |
|
12262 |
|
12263 |
|
12264 |
|
12265 |
|
12266 |
|
12267 |
|
12268 |
|
12269 | var NbCheckboxComponent = (function () {
|
12270 | function NbCheckboxComponent(changeDetector, renderer, hostElement, zone, statusService) {
|
12271 | this.changeDetector = changeDetector;
|
12272 | this.renderer = renderer;
|
12273 | this.hostElement = hostElement;
|
12274 | this.zone = zone;
|
12275 | this.statusService = statusService;
|
12276 | this.onChange = function () { };
|
12277 | this.onTouched = function () { };
|
12278 | this._checked = false;
|
12279 | this._disabled = false;
|
12280 | |
12281 |
|
12282 |
|
12283 |
|
12284 | this.status = 'basic';
|
12285 | this._indeterminate = false;
|
12286 | |
12287 |
|
12288 |
|
12289 |
|
12290 | this.checkedChange = new i0.EventEmitter();
|
12291 | }
|
12292 | Object.defineProperty(NbCheckboxComponent.prototype, "checked", {
|
12293 | get: function () {
|
12294 | return this._checked;
|
12295 | },
|
12296 | set: function (value) {
|
12297 | this._checked = convertToBoolProperty(value);
|
12298 | },
|
12299 | enumerable: false,
|
12300 | configurable: true
|
12301 | });
|
12302 | Object.defineProperty(NbCheckboxComponent.prototype, "disabled", {
|
12303 | |
12304 |
|
12305 |
|
12306 | get: function () {
|
12307 | return this._disabled;
|
12308 | },
|
12309 | set: function (value) {
|
12310 | this._disabled = convertToBoolProperty(value);
|
12311 | },
|
12312 | enumerable: false,
|
12313 | configurable: true
|
12314 | });
|
12315 | Object.defineProperty(NbCheckboxComponent.prototype, "indeterminate", {
|
12316 | |
12317 |
|
12318 |
|
12319 | get: function () {
|
12320 | return this._indeterminate;
|
12321 | },
|
12322 | set: function (value) {
|
12323 | this._indeterminate = convertToBoolProperty(value);
|
12324 | },
|
12325 | enumerable: false,
|
12326 | configurable: true
|
12327 | });
|
12328 | Object.defineProperty(NbCheckboxComponent.prototype, "primary", {
|
12329 | get: function () {
|
12330 | return this.status === 'primary';
|
12331 | },
|
12332 | enumerable: false,
|
12333 | configurable: true
|
12334 | });
|
12335 | Object.defineProperty(NbCheckboxComponent.prototype, "success", {
|
12336 | get: function () {
|
12337 | return this.status === 'success';
|
12338 | },
|
12339 | enumerable: false,
|
12340 | configurable: true
|
12341 | });
|
12342 | Object.defineProperty(NbCheckboxComponent.prototype, "warning", {
|
12343 | get: function () {
|
12344 | return this.status === 'warning';
|
12345 | },
|
12346 | enumerable: false,
|
12347 | configurable: true
|
12348 | });
|
12349 | Object.defineProperty(NbCheckboxComponent.prototype, "danger", {
|
12350 | get: function () {
|
12351 | return this.status === 'danger';
|
12352 | },
|
12353 | enumerable: false,
|
12354 | configurable: true
|
12355 | });
|
12356 | Object.defineProperty(NbCheckboxComponent.prototype, "info", {
|
12357 | get: function () {
|
12358 | return this.status === 'info';
|
12359 | },
|
12360 | enumerable: false,
|
12361 | configurable: true
|
12362 | });
|
12363 | Object.defineProperty(NbCheckboxComponent.prototype, "basic", {
|
12364 | get: function () {
|
12365 | return this.status === 'basic';
|
12366 | },
|
12367 | enumerable: false,
|
12368 | configurable: true
|
12369 | });
|
12370 | Object.defineProperty(NbCheckboxComponent.prototype, "control", {
|
12371 | get: function () {
|
12372 | return this.status === 'control';
|
12373 | },
|
12374 | enumerable: false,
|
12375 | configurable: true
|
12376 | });
|
12377 | Object.defineProperty(NbCheckboxComponent.prototype, "additionalClasses", {
|
12378 | get: function () {
|
12379 | if (this.statusService.isCustomStatus(this.status)) {
|
12380 | return [this.statusService.getStatusClass(this.status)];
|
12381 | }
|
12382 | return [];
|
12383 | },
|
12384 | enumerable: false,
|
12385 | configurable: true
|
12386 | });
|
12387 | NbCheckboxComponent.prototype.ngAfterViewInit = function () {
|
12388 | var _this = this;
|
12389 |
|
12390 | this.zone.runOutsideAngular(function () { return setTimeout(function () {
|
12391 | _this.renderer.addClass(_this.hostElement.nativeElement, 'nb-transition');
|
12392 | }); });
|
12393 | };
|
12394 | NbCheckboxComponent.prototype.registerOnChange = function (fn) {
|
12395 | this.onChange = fn;
|
12396 | };
|
12397 | NbCheckboxComponent.prototype.registerOnTouched = function (fn) {
|
12398 | this.onTouched = fn;
|
12399 | };
|
12400 | NbCheckboxComponent.prototype.writeValue = function (val) {
|
12401 | this._checked = val;
|
12402 | this.changeDetector.markForCheck();
|
12403 | };
|
12404 | NbCheckboxComponent.prototype.setDisabledState = function (val) {
|
12405 | this.disabled = convertToBoolProperty(val);
|
12406 | this.changeDetector.markForCheck();
|
12407 | };
|
12408 | NbCheckboxComponent.prototype.setTouched = function () {
|
12409 | this.onTouched();
|
12410 | };
|
12411 | NbCheckboxComponent.prototype.updateValueAndIndeterminate = function (event) {
|
12412 | var input = event.target;
|
12413 | this.checked = input.checked;
|
12414 | this.checkedChange.emit(this.checked);
|
12415 | this.onChange(this.checked);
|
12416 | this.indeterminate = input.indeterminate;
|
12417 | };
|
12418 | NbCheckboxComponent.decorators = [
|
12419 | { type: i0.Component, args: [{
|
12420 | selector: 'nb-checkbox',
|
12421 | template: "\n <label class=\"label\">\n <input type=\"checkbox\" class=\"native-input visually-hidden\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n (change)=\"updateValueAndIndeterminate($event)\"\n (blur)=\"setTouched()\"\n (click)=\"$event.stopPropagation()\"\n [indeterminate]=\"indeterminate\">\n <span [class.indeterminate]=\"indeterminate\" [class.checked]=\"checked\" class=\"custom-checkbox\">\n <nb-icon *ngIf=\"indeterminate\" icon=\"minus-bold-outline\" pack=\"nebular-essentials\"></nb-icon>\n <nb-icon *ngIf=\"checked && !indeterminate\" icon=\"checkmark-bold-outline\" pack=\"nebular-essentials\"></nb-icon>\n </span>\n <span class=\"text\">\n <ng-content></ng-content>\n </span>\n </label>\n ",
|
12422 | providers: [{
|
12423 | provide: _angular_forms.NG_VALUE_ACCESSOR,
|
12424 | useExisting: i0.forwardRef(function () { return NbCheckboxComponent; }),
|
12425 | multi: true,
|
12426 | }],
|
12427 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
12428 | styles: [":host .label{position:relative;display:inline-flex;align-items:center;margin:0;min-height:inherit}:host .custom-checkbox{flex-shrink:0}:host(.nb-transition) .custom-checkbox{transition-duration:0.15s;transition-property:background-color,border,box-shadow;transition-timing-function:ease-in}:host(.nb-transition) .text{transition-duration:0.15s;transition-property:color;transition-timing-function:ease-in}\n"]
|
12429 | },] }
|
12430 | ];
|
12431 | NbCheckboxComponent.ctorParameters = function () { return [
|
12432 | { type: i0.ChangeDetectorRef },
|
12433 | { type: i0.Renderer2 },
|
12434 | { type: i0.ElementRef },
|
12435 | { type: i0.NgZone },
|
12436 | { type: NbStatusService }
|
12437 | ]; };
|
12438 | NbCheckboxComponent.propDecorators = {
|
12439 | checked: [{ type: i0.Input }],
|
12440 | disabled: [{ type: i0.Input }],
|
12441 | status: [{ type: i0.Input }],
|
12442 | indeterminate: [{ type: i0.Input }],
|
12443 | checkedChange: [{ type: i0.Output }],
|
12444 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
12445 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
12446 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
12447 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
12448 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
12449 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
12450 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
12451 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }]
|
12452 | };
|
12453 | return NbCheckboxComponent;
|
12454 | }());
|
12455 |
|
12456 |
|
12457 |
|
12458 |
|
12459 |
|
12460 |
|
12461 | var NbCheckboxModule = (function () {
|
12462 | function NbCheckboxModule() {
|
12463 | }
|
12464 | NbCheckboxModule.decorators = [
|
12465 | { type: i0.NgModule, args: [{
|
12466 | imports: [
|
12467 | NbSharedModule,
|
12468 | NbIconModule,
|
12469 | ],
|
12470 | declarations: [NbCheckboxComponent],
|
12471 | exports: [NbCheckboxComponent],
|
12472 | },] }
|
12473 | ];
|
12474 | return NbCheckboxModule;
|
12475 | }());
|
12476 |
|
12477 | var NbDynamicOverlay = (function () {
|
12478 | function NbDynamicOverlay(overlay, componentFactoryResolver, zone, overlayContainer) {
|
12479 | this.overlay = overlay;
|
12480 | this.componentFactoryResolver = componentFactoryResolver;
|
12481 | this.zone = zone;
|
12482 | this.overlayContainer = overlayContainer;
|
12483 | this.context = {};
|
12484 | this.overlayConfig = {};
|
12485 | this.positionStrategyChange$ = new rxjs.Subject();
|
12486 | this.isShown$ = new rxjs.BehaviorSubject(false);
|
12487 | this.destroy$ = new rxjs.Subject();
|
12488 | this.overlayDestroy$ = new rxjs.Subject();
|
12489 | }
|
12490 | Object.defineProperty(NbDynamicOverlay.prototype, "isAttached", {
|
12491 | get: function () {
|
12492 | return this.ref && this.ref.hasAttached();
|
12493 | },
|
12494 | enumerable: false,
|
12495 | configurable: true
|
12496 | });
|
12497 | Object.defineProperty(NbDynamicOverlay.prototype, "isShown", {
|
12498 | get: function () {
|
12499 | return this.isShown$.pipe(rxjs_operators.distinctUntilChanged());
|
12500 | },
|
12501 | enumerable: false,
|
12502 | configurable: true
|
12503 | });
|
12504 | NbDynamicOverlay.prototype.create = function (componentType, content, context, positionStrategy, overlayConfig) {
|
12505 | if (overlayConfig === void 0) { overlayConfig = {}; }
|
12506 | this.setContentAndContext(content, context);
|
12507 | this.setComponent(componentType);
|
12508 | this.setPositionStrategy(positionStrategy);
|
12509 | this.setOverlayConfig(overlayConfig);
|
12510 | return this;
|
12511 | };
|
12512 | NbDynamicOverlay.prototype.setContent = function (content) {
|
12513 | this.content = content;
|
12514 | if (this.container) {
|
12515 | this.updateContext();
|
12516 | }
|
12517 | this.updatePosition();
|
12518 | };
|
12519 | NbDynamicOverlay.prototype.setContext = function (context) {
|
12520 | this.context = context;
|
12521 | if (this.container) {
|
12522 | this.updateContext();
|
12523 | }
|
12524 | this.updatePosition();
|
12525 | };
|
12526 | NbDynamicOverlay.prototype.setContentAndContext = function (content, context) {
|
12527 | this.content = content;
|
12528 | this.context = context;
|
12529 | if (this.container) {
|
12530 | this.updateContext();
|
12531 | }
|
12532 | this.updatePosition();
|
12533 | };
|
12534 | NbDynamicOverlay.prototype.setComponent = function (componentType) {
|
12535 | this.componentType = componentType;
|
12536 |
|
12537 | var wasAttached = this.isAttached;
|
12538 | this.disposeOverlayRef();
|
12539 | if (wasAttached) {
|
12540 | this.show();
|
12541 | }
|
12542 | };
|
12543 | NbDynamicOverlay.prototype.setPositionStrategy = function (positionStrategy) {
|
12544 | var _this = this;
|
12545 | this.positionStrategyChange$.next();
|
12546 | this.positionStrategy = positionStrategy;
|
12547 | this.positionStrategy.positionChange
|
12548 | .pipe(rxjs_operators.filter(function () { return !!_this.container; }), rxjs_operators.takeUntil(rxjs.merge(this.positionStrategyChange$, this.destroy$)))
|
12549 | .subscribe(function (position) {
|
12550 | _this.lastAppliedPosition = position;
|
12551 | patch(_this.container, { position: position });
|
12552 | });
|
12553 | if (this.ref) {
|
12554 | this.ref.updatePositionStrategy(this.positionStrategy);
|
12555 | }
|
12556 | };
|
12557 | NbDynamicOverlay.prototype.setOverlayConfig = function (overlayConfig) {
|
12558 | this.overlayConfig = overlayConfig;
|
12559 | var wasAttached = this.isAttached;
|
12560 | this.disposeOverlayRef();
|
12561 | if (wasAttached) {
|
12562 | this.show();
|
12563 | }
|
12564 | };
|
12565 | NbDynamicOverlay.prototype.show = function () {
|
12566 | if (!this.ref) {
|
12567 | this.createOverlay();
|
12568 | }
|
12569 | this.renderContainer();
|
12570 | if (!this.hasOverlayInContainer()) {
|
12571 |
|
12572 | this.disposeOverlayRef();
|
12573 | return this.show();
|
12574 | }
|
12575 | this.isShown$.next(true);
|
12576 | };
|
12577 | NbDynamicOverlay.prototype.hide = function () {
|
12578 | if (!this.ref) {
|
12579 | return;
|
12580 | }
|
12581 | this.ref.detach();
|
12582 | this.container = null;
|
12583 | this.isShown$.next(false);
|
12584 | };
|
12585 | NbDynamicOverlay.prototype.toggle = function () {
|
12586 | if (this.isAttached) {
|
12587 | this.hide();
|
12588 | }
|
12589 | else {
|
12590 | this.show();
|
12591 | }
|
12592 | };
|
12593 | NbDynamicOverlay.prototype.dispose = function () {
|
12594 | this.destroy$.next();
|
12595 | this.destroy$.complete();
|
12596 | this.hide();
|
12597 | this.disposeOverlayRef();
|
12598 | this.isShown$.complete();
|
12599 | this.positionStrategyChange$.complete();
|
12600 | this.overlayDestroy$.complete();
|
12601 | };
|
12602 | NbDynamicOverlay.prototype.getContainer = function () {
|
12603 | return this.container;
|
12604 | };
|
12605 | NbDynamicOverlay.prototype.createOverlay = function () {
|
12606 | this.ref = this.overlay.create(tslib.__assign({ positionStrategy: this.positionStrategy, scrollStrategy: this.overlay.scrollStrategies.reposition() }, this.overlayConfig));
|
12607 | this.updatePositionWhenStable(this.ref);
|
12608 | };
|
12609 | NbDynamicOverlay.prototype.renderContainer = function () {
|
12610 | var containerContext = this.createContainerContext();
|
12611 | if (!this.container) {
|
12612 | this.container = createContainer(this.ref, this.componentType, containerContext, this.componentFactoryResolver);
|
12613 | }
|
12614 | this.container.instance.renderContent();
|
12615 | };
|
12616 | NbDynamicOverlay.prototype.updateContext = function () {
|
12617 | var containerContext = this.createContainerContext();
|
12618 | Object.assign(this.container.instance, containerContext);
|
12619 | this.container.instance.renderContent();
|
12620 | this.container.changeDetectorRef.detectChanges();
|
12621 | };
|
12622 | NbDynamicOverlay.prototype.createContainerContext = function () {
|
12623 | return {
|
12624 | content: this.content,
|
12625 | context: this.context,
|
12626 | cfr: this.componentFactoryResolver,
|
12627 | position: this.lastAppliedPosition,
|
12628 | };
|
12629 | };
|
12630 | |
12631 |
|
12632 |
|
12633 |
|
12634 | NbDynamicOverlay.prototype.updatePositionWhenStable = function (overlay) {
|
12635 | var _this = this;
|
12636 | var overlayDestroy$ = this.overlayDestroy$.pipe(rxjs_operators.filter(function (destroyedOverlay) { return destroyedOverlay === overlay; }));
|
12637 | this.zone.onStable
|
12638 | .pipe(rxjs_operators.takeUntil(rxjs.merge(this.destroy$, overlayDestroy$)))
|
12639 | .subscribe(function () { return _this.updatePosition(); });
|
12640 | };
|
12641 | NbDynamicOverlay.prototype.updatePosition = function () {
|
12642 | if (this.ref) {
|
12643 | this.ref.updatePosition();
|
12644 | }
|
12645 | };
|
12646 | NbDynamicOverlay.prototype.hasOverlayInContainer = function () {
|
12647 | return this.overlayContainer.getContainerElement().contains(this.ref.hostElement);
|
12648 | };
|
12649 | NbDynamicOverlay.prototype.disposeOverlayRef = function () {
|
12650 | if (this.ref) {
|
12651 | this.ref.dispose();
|
12652 | this.overlayDestroy$.next(this.ref);
|
12653 | this.ref = null;
|
12654 | this.container = null;
|
12655 | }
|
12656 | };
|
12657 | NbDynamicOverlay.decorators = [
|
12658 | { type: i0.Injectable }
|
12659 | ];
|
12660 | NbDynamicOverlay.ctorParameters = function () { return [
|
12661 | { type: NbOverlayService },
|
12662 | { type: i0.ComponentFactoryResolver },
|
12663 | { type: i0.NgZone },
|
12664 | { type: NbOverlayContainer }
|
12665 | ]; };
|
12666 | return NbDynamicOverlay;
|
12667 | }());
|
12668 |
|
12669 | var NbDynamicOverlayChange = (function (_super) {
|
12670 | tslib.__extends(NbDynamicOverlayChange, _super);
|
12671 | function NbDynamicOverlayChange(previousValue, currentValue, firstChange) {
|
12672 | if (firstChange === void 0) { firstChange = false; }
|
12673 | return _super.call(this, previousValue, currentValue, firstChange) || this;
|
12674 | }
|
12675 | NbDynamicOverlayChange.prototype.isChanged = function () {
|
12676 | return this.currentValue !== this.previousValue;
|
12677 | };
|
12678 | return NbDynamicOverlayChange;
|
12679 | }(i0.SimpleChange));
|
12680 | var NbDynamicOverlayHandler = (function () {
|
12681 | function NbDynamicOverlayHandler(positionBuilder, triggerStrategyBuilder, dynamicOverlayService) {
|
12682 | this.positionBuilder = positionBuilder;
|
12683 | this.triggerStrategyBuilder = triggerStrategyBuilder;
|
12684 | this.dynamicOverlayService = dynamicOverlayService;
|
12685 | this._context = {};
|
12686 | this._trigger = exports.NbTrigger.NOOP;
|
12687 | this._position = exports.NbPosition.TOP;
|
12688 | this._adjustment = exports.NbAdjustment.NOOP;
|
12689 | this._offset = 15;
|
12690 | this._overlayConfig = {};
|
12691 | this.changes = {};
|
12692 | }
|
12693 | NbDynamicOverlayHandler.prototype.host = function (host) {
|
12694 | this.changes.host = new NbDynamicOverlayChange(this._host, host);
|
12695 | this._host = host;
|
12696 | return this;
|
12697 | };
|
12698 | NbDynamicOverlayHandler.prototype.trigger = function (trigger$$1) {
|
12699 | this.changes.trigger = new NbDynamicOverlayChange(this._trigger, trigger$$1);
|
12700 | this._trigger = trigger$$1;
|
12701 | return this;
|
12702 | };
|
12703 | NbDynamicOverlayHandler.prototype.position = function (position) {
|
12704 | this.changes.position = new NbDynamicOverlayChange(this._position, position);
|
12705 | this._position = position;
|
12706 | return this;
|
12707 | };
|
12708 | NbDynamicOverlayHandler.prototype.adjustment = function (adjustment) {
|
12709 | this.changes.adjustment = new NbDynamicOverlayChange(this._adjustment, adjustment);
|
12710 | this._adjustment = adjustment;
|
12711 | return this;
|
12712 | };
|
12713 | NbDynamicOverlayHandler.prototype.componentType = function (componentType) {
|
12714 | this.changes.componentType = new NbDynamicOverlayChange(this._componentType, componentType);
|
12715 | this._componentType = componentType;
|
12716 | return this;
|
12717 | };
|
12718 | NbDynamicOverlayHandler.prototype.content = function (content) {
|
12719 | this.changes.content = new NbDynamicOverlayChange(this._content, content);
|
12720 | this._content = content;
|
12721 | return this;
|
12722 | };
|
12723 | NbDynamicOverlayHandler.prototype.context = function (context) {
|
12724 | this.changes.context = new NbDynamicOverlayChange(this._context, context);
|
12725 | this._context = context;
|
12726 | return this;
|
12727 | };
|
12728 | NbDynamicOverlayHandler.prototype.offset = function (offset) {
|
12729 | this.changes.offset = new NbDynamicOverlayChange(this._offset, offset);
|
12730 | this._offset = offset;
|
12731 | return this;
|
12732 | };
|
12733 | NbDynamicOverlayHandler.prototype.overlayConfig = function (overlayConfig) {
|
12734 | this.changes.overlayConfig = new NbDynamicOverlayChange(this._overlayConfig, overlayConfig);
|
12735 | this._overlayConfig = overlayConfig;
|
12736 | return this;
|
12737 | };
|
12738 | NbDynamicOverlayHandler.prototype.build = function () {
|
12739 | if (!this._componentType || !this._host) {
|
12740 | throw Error("NbDynamicOverlayHandler: at least 'componentType' and 'host' should be\n passed before building a dynamic overlay.");
|
12741 | }
|
12742 | this.dynamicOverlay = this.dynamicOverlayService.create(this._componentType, this._content, this._context, this.createPositionStrategy(), this._overlayConfig);
|
12743 | this.connect();
|
12744 | this.clearChanges();
|
12745 | return this.dynamicOverlay;
|
12746 | };
|
12747 | NbDynamicOverlayHandler.prototype.rebuild = function () {
|
12748 | |
12749 |
|
12750 |
|
12751 |
|
12752 |
|
12753 |
|
12754 | if (!this.dynamicOverlay) {
|
12755 | return;
|
12756 | }
|
12757 | if (this.isPositionStrategyUpdateRequired()) {
|
12758 | this.dynamicOverlay.setPositionStrategy(this.createPositionStrategy());
|
12759 | }
|
12760 | if (this.isTriggerStrategyUpdateRequired()) {
|
12761 | this.connect();
|
12762 | }
|
12763 | if (this.isContainerRerenderRequired()) {
|
12764 | this.dynamicOverlay.setContentAndContext(this._content, this._context);
|
12765 | }
|
12766 | if (this.isComponentTypeUpdateRequired()) {
|
12767 | this.dynamicOverlay.setComponent(this._componentType);
|
12768 | }
|
12769 | if (this.isOverlayConfigUpdateRequired()) {
|
12770 | this.dynamicOverlay.setOverlayConfig(this._overlayConfig);
|
12771 | }
|
12772 | this.clearChanges();
|
12773 | return this.dynamicOverlay;
|
12774 | };
|
12775 | NbDynamicOverlayHandler.prototype.connect = function () {
|
12776 | if (!this.dynamicOverlay) {
|
12777 | throw new Error("NbDynamicOverlayHandler: cannot connect to DynamicOverlay\n as it is not created yet. Call build() first");
|
12778 | }
|
12779 | this.disconnect();
|
12780 | this.subscribeOnTriggers(this.dynamicOverlay);
|
12781 | };
|
12782 | NbDynamicOverlayHandler.prototype.disconnect = function () {
|
12783 | if (this.triggerStrategy) {
|
12784 | this.triggerStrategy.destroy();
|
12785 | }
|
12786 | };
|
12787 | NbDynamicOverlayHandler.prototype.destroy = function () {
|
12788 | this.disconnect();
|
12789 | this.clearChanges();
|
12790 | if (this.dynamicOverlay) {
|
12791 | this.dynamicOverlay.dispose();
|
12792 | }
|
12793 | };
|
12794 | NbDynamicOverlayHandler.prototype.createPositionStrategy = function () {
|
12795 | return this.positionBuilder
|
12796 | .connectedTo(this._host)
|
12797 | .position(this._position)
|
12798 | .adjustment(this._adjustment)
|
12799 | .offset(this._offset);
|
12800 | };
|
12801 | NbDynamicOverlayHandler.prototype.subscribeOnTriggers = function (dynamicOverlay) {
|
12802 | this.triggerStrategy = this.triggerStrategyBuilder
|
12803 | .trigger(this._trigger)
|
12804 | .host(this._host.nativeElement)
|
12805 | .container(function () { return dynamicOverlay.getContainer(); })
|
12806 | .build();
|
12807 | this.triggerStrategy.show$.subscribe(function () { return dynamicOverlay.show(); });
|
12808 | this.triggerStrategy.hide$.subscribe(function () { return dynamicOverlay.hide(); });
|
12809 | };
|
12810 | NbDynamicOverlayHandler.prototype.isContainerRerenderRequired = function () {
|
12811 | return this.isContentUpdated()
|
12812 | || this.isContextUpdated()
|
12813 | || this.isPositionStrategyUpdateRequired();
|
12814 | };
|
12815 | NbDynamicOverlayHandler.prototype.isPositionStrategyUpdateRequired = function () {
|
12816 | return this.isAdjustmentUpdated() || this.isPositionUpdated() || this.isOffsetUpdated() || this.isHostUpdated();
|
12817 | };
|
12818 | NbDynamicOverlayHandler.prototype.isTriggerStrategyUpdateRequired = function () {
|
12819 | return this.isTriggerUpdated() || this.isHostUpdated();
|
12820 | };
|
12821 | NbDynamicOverlayHandler.prototype.isComponentTypeUpdateRequired = function () {
|
12822 | return this.isComponentTypeUpdated();
|
12823 | };
|
12824 | NbDynamicOverlayHandler.prototype.isOverlayConfigUpdateRequired = function () {
|
12825 | return this.isOverlayConfigUpdated();
|
12826 | };
|
12827 | NbDynamicOverlayHandler.prototype.isComponentTypeUpdated = function () {
|
12828 | return this.changes.componentType && this.changes.componentType.isChanged();
|
12829 | };
|
12830 | NbDynamicOverlayHandler.prototype.isContentUpdated = function () {
|
12831 | return this.changes.content && this.changes.content.isChanged();
|
12832 | };
|
12833 | NbDynamicOverlayHandler.prototype.isContextUpdated = function () {
|
12834 | return this.changes.context && this.changes.context.isChanged();
|
12835 | };
|
12836 | NbDynamicOverlayHandler.prototype.isAdjustmentUpdated = function () {
|
12837 | return this.changes.adjustment && this.changes.adjustment.isChanged();
|
12838 | };
|
12839 | NbDynamicOverlayHandler.prototype.isPositionUpdated = function () {
|
12840 | return this.changes.position && this.changes.position.isChanged();
|
12841 | };
|
12842 | NbDynamicOverlayHandler.prototype.isHostUpdated = function () {
|
12843 | return this.changes.host && this.changes.host.isChanged();
|
12844 | };
|
12845 | NbDynamicOverlayHandler.prototype.isTriggerUpdated = function () {
|
12846 | return this.changes.trigger && this.changes.trigger.isChanged();
|
12847 | };
|
12848 | NbDynamicOverlayHandler.prototype.isOffsetUpdated = function () {
|
12849 | return this.changes.offset && this.changes.offset.isChanged();
|
12850 | };
|
12851 | NbDynamicOverlayHandler.prototype.isOverlayConfigUpdated = function () {
|
12852 | return this.changes.overlayConfig && this.changes.overlayConfig.isChanged();
|
12853 | };
|
12854 | NbDynamicOverlayHandler.prototype.clearChanges = function () {
|
12855 | this.changes = {};
|
12856 | };
|
12857 | NbDynamicOverlayHandler.decorators = [
|
12858 | { type: i0.Injectable }
|
12859 | ];
|
12860 | NbDynamicOverlayHandler.ctorParameters = function () { return [
|
12861 | { type: NbPositionBuilderService },
|
12862 | { type: NbTriggerStrategyBuilderService },
|
12863 | { type: NbDynamicOverlay }
|
12864 | ]; };
|
12865 | return NbDynamicOverlayHandler;
|
12866 | }());
|
12867 |
|
12868 |
|
12869 |
|
12870 |
|
12871 |
|
12872 |
|
12873 |
|
12874 |
|
12875 |
|
12876 |
|
12877 |
|
12878 |
|
12879 |
|
12880 |
|
12881 |
|
12882 |
|
12883 |
|
12884 |
|
12885 |
|
12886 |
|
12887 |
|
12888 |
|
12889 |
|
12890 |
|
12891 |
|
12892 | var NbPopoverComponent = (function (_super) {
|
12893 | tslib.__extends(NbPopoverComponent, _super);
|
12894 | function NbPopoverComponent() {
|
12895 | return _super !== null && _super.apply(this, arguments) || this;
|
12896 | }
|
12897 | NbPopoverComponent.prototype.renderContent = function () {
|
12898 | this.detachContent();
|
12899 | this.attachContent();
|
12900 | };
|
12901 | NbPopoverComponent.prototype.detachContent = function () {
|
12902 | this.overlayContainer.detach();
|
12903 | };
|
12904 | NbPopoverComponent.prototype.attachContent = function () {
|
12905 | if (this.content instanceof i0.TemplateRef) {
|
12906 | this.attachTemplate();
|
12907 | }
|
12908 | else if (this.content instanceof i0.Type) {
|
12909 | this.attachComponent();
|
12910 | }
|
12911 | else {
|
12912 | this.attachString();
|
12913 | }
|
12914 | };
|
12915 | NbPopoverComponent.prototype.attachTemplate = function () {
|
12916 | this.overlayContainer
|
12917 | .attachTemplatePortal(new NbTemplatePortal(this.content, null, { $implicit: this.context }));
|
12918 | };
|
12919 | NbPopoverComponent.prototype.attachComponent = function () {
|
12920 | var portal = new NbComponentPortal(this.content, null, null, this.cfr);
|
12921 | var ref = this.overlayContainer.attachComponentPortal(portal, this.context);
|
12922 | ref.changeDetectorRef.detectChanges();
|
12923 | };
|
12924 | NbPopoverComponent.prototype.attachString = function () {
|
12925 | this.overlayContainer.attachStringContent(this.content);
|
12926 | };
|
12927 | NbPopoverComponent.decorators = [
|
12928 | { type: i0.Component, args: [{
|
12929 | selector: 'nb-popover',
|
12930 | template: "\n <span class=\"arrow\"></span>\n <nb-overlay-container></nb-overlay-container>\n ",
|
12931 | styles: [":host .arrow{position:absolute;width:0;height:0}\n"]
|
12932 | },] }
|
12933 | ];
|
12934 | NbPopoverComponent.propDecorators = {
|
12935 | overlayContainer: [{ type: i0.ViewChild, args: [NbOverlayContainerComponent,] }],
|
12936 | content: [{ type: i0.Input }],
|
12937 | context: [{ type: i0.Input }],
|
12938 | cfr: [{ type: i0.Input }]
|
12939 | };
|
12940 | return NbPopoverComponent;
|
12941 | }(NbPositionedContainerComponent));
|
12942 |
|
12943 |
|
12944 |
|
12945 |
|
12946 |
|
12947 |
|
12948 |
|
12949 |
|
12950 |
|
12951 |
|
12952 |
|
12953 |
|
12954 |
|
12955 |
|
12956 |
|
12957 |
|
12958 |
|
12959 |
|
12960 |
|
12961 |
|
12962 |
|
12963 |
|
12964 |
|
12965 |
|
12966 |
|
12967 |
|
12968 |
|
12969 |
|
12970 |
|
12971 |
|
12972 |
|
12973 |
|
12974 |
|
12975 |
|
12976 |
|
12977 |
|
12978 |
|
12979 |
|
12980 |
|
12981 |
|
12982 |
|
12983 |
|
12984 |
|
12985 |
|
12986 |
|
12987 |
|
12988 |
|
12989 |
|
12990 |
|
12991 |
|
12992 |
|
12993 |
|
12994 |
|
12995 |
|
12996 |
|
12997 |
|
12998 |
|
12999 |
|
13000 |
|
13001 |
|
13002 |
|
13003 |
|
13004 |
|
13005 |
|
13006 |
|
13007 |
|
13008 |
|
13009 |
|
13010 |
|
13011 |
|
13012 |
|
13013 |
|
13014 |
|
13015 |
|
13016 |
|
13017 |
|
13018 |
|
13019 |
|
13020 |
|
13021 |
|
13022 |
|
13023 |
|
13024 |
|
13025 |
|
13026 |
|
13027 |
|
13028 |
|
13029 |
|
13030 |
|
13031 |
|
13032 | var NbPopoverDirective = (function () {
|
13033 | function NbPopoverDirective(hostRef, dynamicOverlayHandler) {
|
13034 | this.hostRef = hostRef;
|
13035 | this.dynamicOverlayHandler = dynamicOverlayHandler;
|
13036 | this.popoverComponent = NbPopoverComponent;
|
13037 | this.destroy$ = new rxjs.Subject();
|
13038 | |
13039 |
|
13040 |
|
13041 | this.context = {};
|
13042 | |
13043 |
|
13044 |
|
13045 |
|
13046 | this.position = exports.NbPosition.TOP;
|
13047 | this._adjustment = exports.NbAdjustment.CLOCKWISE;
|
13048 | |
13049 |
|
13050 |
|
13051 |
|
13052 | this.trigger = exports.NbTrigger.CLICK;
|
13053 | |
13054 |
|
13055 |
|
13056 | this.offset = 15;
|
13057 | this._popoverClass = '';
|
13058 | this.nbPopoverShowStateChange = new i0.EventEmitter();
|
13059 | this.overlayConfig = { panelClass: this.popoverClass };
|
13060 | }
|
13061 | Object.defineProperty(NbPopoverDirective.prototype, "adjustment", {
|
13062 | |
13063 |
|
13064 |
|
13065 |
|
13066 |
|
13067 | get: function () {
|
13068 | return this._adjustment;
|
13069 | },
|
13070 | set: function (value) {
|
13071 | this._adjustment = value;
|
13072 | },
|
13073 | enumerable: false,
|
13074 | configurable: true
|
13075 | });
|
13076 | Object.defineProperty(NbPopoverDirective.prototype, "popoverClass", {
|
13077 | get: function () {
|
13078 | return this._popoverClass;
|
13079 | },
|
13080 | set: function (value) {
|
13081 | if (value !== this.popoverClass) {
|
13082 | this._popoverClass = value;
|
13083 | this.overlayConfig = { panelClass: this.popoverClass };
|
13084 | }
|
13085 | },
|
13086 | enumerable: false,
|
13087 | configurable: true
|
13088 | });
|
13089 | Object.defineProperty(NbPopoverDirective.prototype, "isShown", {
|
13090 | get: function () {
|
13091 | return !!(this.dynamicOverlay && this.dynamicOverlay.isAttached);
|
13092 | },
|
13093 | enumerable: false,
|
13094 | configurable: true
|
13095 | });
|
13096 | NbPopoverDirective.prototype.ngOnInit = function () {
|
13097 | this.dynamicOverlayHandler
|
13098 | .host(this.hostRef)
|
13099 | .componentType(this.popoverComponent);
|
13100 | };
|
13101 | NbPopoverDirective.prototype.ngOnChanges = function () {
|
13102 | this.rebuild();
|
13103 | };
|
13104 | NbPopoverDirective.prototype.ngAfterViewInit = function () {
|
13105 | var _this = this;
|
13106 | this.dynamicOverlay = this.configureDynamicOverlay()
|
13107 | .build();
|
13108 | this.dynamicOverlay.isShown
|
13109 | .pipe(rxjs_operators.skip(1), rxjs_operators.takeUntil(this.destroy$))
|
13110 | .subscribe(function (isShown) { return _this.nbPopoverShowStateChange.emit({ isShown: isShown }); });
|
13111 | };
|
13112 | NbPopoverDirective.prototype.rebuild = function () {
|
13113 | this.dynamicOverlay = this.configureDynamicOverlay()
|
13114 | .rebuild();
|
13115 | };
|
13116 | NbPopoverDirective.prototype.show = function () {
|
13117 | this.dynamicOverlay.show();
|
13118 | };
|
13119 | NbPopoverDirective.prototype.hide = function () {
|
13120 | this.dynamicOverlay.hide();
|
13121 | };
|
13122 | NbPopoverDirective.prototype.toggle = function () {
|
13123 | this.dynamicOverlay.toggle();
|
13124 | };
|
13125 | NbPopoverDirective.prototype.ngOnDestroy = function () {
|
13126 | this.dynamicOverlayHandler.destroy();
|
13127 | this.destroy$.next();
|
13128 | this.destroy$.complete();
|
13129 | };
|
13130 | NbPopoverDirective.prototype.configureDynamicOverlay = function () {
|
13131 | return this.dynamicOverlayHandler
|
13132 | .position(this.position)
|
13133 | .trigger(this.trigger)
|
13134 | .offset(this.offset)
|
13135 | .adjustment(this.adjustment)
|
13136 | .content(this.content)
|
13137 | .context(this.context)
|
13138 | .overlayConfig(this.overlayConfig);
|
13139 | };
|
13140 | NbPopoverDirective.decorators = [
|
13141 | { type: i0.Directive, args: [{
|
13142 | selector: '[nbPopover]',
|
13143 | exportAs: 'nbPopover',
|
13144 | providers: [NbDynamicOverlayHandler, NbDynamicOverlay],
|
13145 | },] }
|
13146 | ];
|
13147 | NbPopoverDirective.ctorParameters = function () { return [
|
13148 | { type: i0.ElementRef },
|
13149 | { type: NbDynamicOverlayHandler }
|
13150 | ]; };
|
13151 | NbPopoverDirective.propDecorators = {
|
13152 | content: [{ type: i0.Input, args: ['nbPopover',] }],
|
13153 | context: [{ type: i0.Input, args: ['nbPopoverContext',] }],
|
13154 | position: [{ type: i0.Input, args: ['nbPopoverPlacement',] }],
|
13155 | adjustment: [{ type: i0.Input, args: ['nbPopoverAdjustment',] }],
|
13156 | trigger: [{ type: i0.Input, args: ['nbPopoverTrigger',] }],
|
13157 | offset: [{ type: i0.Input, args: ['nbPopoverOffset',] }],
|
13158 | popoverClass: [{ type: i0.Input, args: ['nbPopoverClass',] }],
|
13159 | nbPopoverShowStateChange: [{ type: i0.Output }]
|
13160 | };
|
13161 | return NbPopoverDirective;
|
13162 | }());
|
13163 |
|
13164 |
|
13165 |
|
13166 |
|
13167 |
|
13168 |
|
13169 | var NbPopoverModule = (function () {
|
13170 | function NbPopoverModule() {
|
13171 | }
|
13172 | NbPopoverModule.decorators = [
|
13173 | { type: i0.NgModule, args: [{
|
13174 | imports: [NbOverlayModule],
|
13175 | declarations: [NbPopoverDirective, NbPopoverComponent],
|
13176 | exports: [NbPopoverDirective],
|
13177 | entryComponents: [NbPopoverComponent],
|
13178 | },] }
|
13179 | ];
|
13180 | return NbPopoverModule;
|
13181 | }());
|
13182 |
|
13183 |
|
13184 |
|
13185 |
|
13186 |
|
13187 |
|
13188 |
|
13189 |
|
13190 |
|
13191 |
|
13192 |
|
13193 |
|
13194 |
|
13195 |
|
13196 |
|
13197 |
|
13198 |
|
13199 |
|
13200 |
|
13201 |
|
13202 |
|
13203 | var NbContextMenuComponent = (function (_super) {
|
13204 | tslib.__extends(NbContextMenuComponent, _super);
|
13205 | function NbContextMenuComponent() {
|
13206 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
13207 | _this.items = [];
|
13208 | _this.context = { items: [] };
|
13209 | return _this;
|
13210 | }
|
13211 | |
13212 |
|
13213 |
|
13214 |
|
13215 | NbContextMenuComponent.prototype.renderContent = function () { };
|
13216 | NbContextMenuComponent.decorators = [
|
13217 | { type: i0.Component, args: [{
|
13218 | selector: 'nb-context-menu',
|
13219 | template: "\n <nb-menu class=\"context-menu\" [items]=\"context.items\" [tag]=\"context.tag\"></nb-menu>\n "
|
13220 | },] }
|
13221 | ];
|
13222 | NbContextMenuComponent.propDecorators = {
|
13223 | items: [{ type: i0.Input }],
|
13224 | tag: [{ type: i0.Input }],
|
13225 | context: [{ type: i0.Input }]
|
13226 | };
|
13227 | return NbContextMenuComponent;
|
13228 | }(NbPositionedContainerComponent));
|
13229 |
|
13230 |
|
13231 |
|
13232 |
|
13233 |
|
13234 |
|
13235 |
|
13236 |
|
13237 |
|
13238 |
|
13239 |
|
13240 |
|
13241 |
|
13242 |
|
13243 |
|
13244 |
|
13245 |
|
13246 |
|
13247 |
|
13248 |
|
13249 |
|
13250 |
|
13251 |
|
13252 |
|
13253 |
|
13254 |
|
13255 |
|
13256 |
|
13257 |
|
13258 |
|
13259 |
|
13260 |
|
13261 |
|
13262 |
|
13263 |
|
13264 |
|
13265 |
|
13266 |
|
13267 |
|
13268 |
|
13269 |
|
13270 |
|
13271 |
|
13272 |
|
13273 |
|
13274 |
|
13275 |
|
13276 |
|
13277 |
|
13278 |
|
13279 |
|
13280 |
|
13281 |
|
13282 |
|
13283 |
|
13284 |
|
13285 |
|
13286 |
|
13287 |
|
13288 |
|
13289 |
|
13290 |
|
13291 |
|
13292 |
|
13293 |
|
13294 |
|
13295 |
|
13296 |
|
13297 |
|
13298 |
|
13299 |
|
13300 |
|
13301 |
|
13302 |
|
13303 |
|
13304 |
|
13305 |
|
13306 |
|
13307 |
|
13308 |
|
13309 |
|
13310 |
|
13311 |
|
13312 |
|
13313 |
|
13314 |
|
13315 |
|
13316 |
|
13317 |
|
13318 |
|
13319 |
|
13320 |
|
13321 | var NbContextMenuDirective = (function () {
|
13322 | function NbContextMenuDirective(hostRef, menuService, dynamicOverlayHandler) {
|
13323 | this.hostRef = hostRef;
|
13324 | this.menuService = menuService;
|
13325 | this.dynamicOverlayHandler = dynamicOverlayHandler;
|
13326 | this.contextMenuHost = true;
|
13327 | this._position = exports.NbPosition.BOTTOM;
|
13328 | |
13329 |
|
13330 |
|
13331 |
|
13332 |
|
13333 | this.adjustment = exports.NbAdjustment.CLOCKWISE;
|
13334 | |
13335 |
|
13336 |
|
13337 |
|
13338 | this.trigger = exports.NbTrigger.CLICK;
|
13339 | this._contextMenuClass = '';
|
13340 | this.overlayConfig = { panelClass: this.contextMenuClass };
|
13341 | this.overlayContext = { items: this.items, tag: this.tag, position: this.position };
|
13342 | this.destroy$ = new rxjs.Subject();
|
13343 | this._items = [];
|
13344 | }
|
13345 | Object.defineProperty(NbContextMenuDirective.prototype, "position", {
|
13346 | |
13347 |
|
13348 |
|
13349 |
|
13350 | get: function () {
|
13351 | return this._position;
|
13352 | },
|
13353 | set: function (value) {
|
13354 | if (value !== this.position) {
|
13355 | this._position = value;
|
13356 | this.updateOverlayContext();
|
13357 | }
|
13358 | },
|
13359 | enumerable: false,
|
13360 | configurable: true
|
13361 | });
|
13362 | Object.defineProperty(NbContextMenuDirective.prototype, "tag", {
|
13363 | |
13364 |
|
13365 |
|
13366 | get: function () {
|
13367 | return this._tag;
|
13368 | },
|
13369 | set: function (value) {
|
13370 | if (value !== this.tag) {
|
13371 | this._tag = value;
|
13372 | this.updateOverlayContext();
|
13373 | }
|
13374 | },
|
13375 | enumerable: false,
|
13376 | configurable: true
|
13377 | });
|
13378 | Object.defineProperty(NbContextMenuDirective.prototype, "items", {
|
13379 | |
13380 |
|
13381 |
|
13382 | get: function () {
|
13383 | return this._items;
|
13384 | },
|
13385 | set: function (items) {
|
13386 | this.validateItems(items);
|
13387 | this._items = items;
|
13388 | this.updateOverlayContext();
|
13389 | },
|
13390 | enumerable: false,
|
13391 | configurable: true
|
13392 | });
|
13393 |
|
13394 | Object.defineProperty(NbContextMenuDirective.prototype, "contextMenuClass", {
|
13395 | get: function () {
|
13396 | return this._contextMenuClass;
|
13397 | },
|
13398 | set: function (value) {
|
13399 | if (value !== this.contextMenuClass) {
|
13400 | this._contextMenuClass = value;
|
13401 | this.overlayConfig = { panelClass: this.contextMenuClass };
|
13402 | }
|
13403 | },
|
13404 | enumerable: false,
|
13405 | configurable: true
|
13406 | });
|
13407 | NbContextMenuDirective.prototype.ngOnInit = function () {
|
13408 | this.dynamicOverlayHandler
|
13409 | .host(this.hostRef)
|
13410 | .componentType(NbContextMenuComponent);
|
13411 | };
|
13412 | NbContextMenuDirective.prototype.ngOnChanges = function () {
|
13413 | this.rebuild();
|
13414 | };
|
13415 | NbContextMenuDirective.prototype.ngAfterViewInit = function () {
|
13416 | this.dynamicOverlay = this.configureDynamicOverlay()
|
13417 | .build();
|
13418 | this.subscribeOnItemClick();
|
13419 | };
|
13420 | NbContextMenuDirective.prototype.rebuild = function () {
|
13421 | this.dynamicOverlay = this.configureDynamicOverlay()
|
13422 | .rebuild();
|
13423 | };
|
13424 | NbContextMenuDirective.prototype.show = function () {
|
13425 | this.dynamicOverlay.show();
|
13426 | };
|
13427 | NbContextMenuDirective.prototype.hide = function () {
|
13428 | this.dynamicOverlay.hide();
|
13429 | };
|
13430 | NbContextMenuDirective.prototype.toggle = function () {
|
13431 | this.dynamicOverlay.toggle();
|
13432 | };
|
13433 | NbContextMenuDirective.prototype.ngOnDestroy = function () {
|
13434 | this.dynamicOverlayHandler.destroy();
|
13435 | this.destroy$.next();
|
13436 | this.destroy$.complete();
|
13437 | };
|
13438 | NbContextMenuDirective.prototype.configureDynamicOverlay = function () {
|
13439 | return this.dynamicOverlayHandler
|
13440 | .position(this.position)
|
13441 | .trigger(this.trigger)
|
13442 | .adjustment(this.adjustment)
|
13443 | .context(this.overlayContext)
|
13444 | .overlayConfig(this.overlayConfig);
|
13445 | };
|
13446 | |
13447 |
|
13448 |
|
13449 |
|
13450 | NbContextMenuDirective.prototype.validateItems = function (items) {
|
13451 | if (!items || !items.length) {
|
13452 | throw Error("List of menu items expected, but given: " + items);
|
13453 | }
|
13454 | };
|
13455 | NbContextMenuDirective.prototype.subscribeOnItemClick = function () {
|
13456 | var _this = this;
|
13457 | this.menuService.onItemClick()
|
13458 | .pipe(rxjs_operators.filter(function (_a) {
|
13459 | var tag = _a.tag;
|
13460 | return tag === _this.tag;
|
13461 | }), rxjs_operators.takeUntil(this.destroy$))
|
13462 | .subscribe(function () { return _this.hide(); });
|
13463 | };
|
13464 | NbContextMenuDirective.prototype.updateOverlayContext = function () {
|
13465 | this.overlayContext = { items: this.items, position: this.position, tag: this.tag };
|
13466 | };
|
13467 | NbContextMenuDirective.decorators = [
|
13468 | { type: i0.Directive, args: [{
|
13469 | selector: '[nbContextMenu]',
|
13470 | providers: [NbDynamicOverlayHandler, NbDynamicOverlay],
|
13471 | },] }
|
13472 | ];
|
13473 | NbContextMenuDirective.ctorParameters = function () { return [
|
13474 | { type: i0.ElementRef },
|
13475 | { type: NbMenuService },
|
13476 | { type: NbDynamicOverlayHandler }
|
13477 | ]; };
|
13478 | NbContextMenuDirective.propDecorators = {
|
13479 | contextMenuHost: [{ type: i0.HostBinding, args: ['class.context-menu-host',] }],
|
13480 | position: [{ type: i0.Input, args: ['nbContextMenuPlacement',] }],
|
13481 | adjustment: [{ type: i0.Input, args: ['nbContextMenuAdjustment',] }],
|
13482 | tag: [{ type: i0.Input, args: ['nbContextMenuTag',] }],
|
13483 | items: [{ type: i0.Input, args: ['nbContextMenu',] }],
|
13484 | trigger: [{ type: i0.Input, args: ['nbContextMenuTrigger',] }],
|
13485 | contextMenuClass: [{ type: i0.Input, args: ['nbContextMenuClass',] }]
|
13486 | };
|
13487 | return NbContextMenuDirective;
|
13488 | }());
|
13489 |
|
13490 |
|
13491 |
|
13492 |
|
13493 |
|
13494 |
|
13495 | var NbContextMenuModule = (function () {
|
13496 | function NbContextMenuModule() {
|
13497 | }
|
13498 | NbContextMenuModule.decorators = [
|
13499 | { type: i0.NgModule, args: [{
|
13500 | imports: [_angular_common.CommonModule, NbOverlayModule, NbMenuModule],
|
13501 | exports: [NbContextMenuDirective],
|
13502 | declarations: [NbContextMenuDirective, NbContextMenuComponent],
|
13503 | entryComponents: [NbContextMenuComponent],
|
13504 | },] }
|
13505 | ];
|
13506 | return NbContextMenuModule;
|
13507 | }());
|
13508 |
|
13509 |
|
13510 |
|
13511 |
|
13512 |
|
13513 |
|
13514 |
|
13515 |
|
13516 |
|
13517 |
|
13518 |
|
13519 |
|
13520 |
|
13521 |
|
13522 |
|
13523 |
|
13524 |
|
13525 |
|
13526 |
|
13527 |
|
13528 |
|
13529 |
|
13530 |
|
13531 |
|
13532 |
|
13533 |
|
13534 |
|
13535 |
|
13536 |
|
13537 |
|
13538 |
|
13539 |
|
13540 |
|
13541 |
|
13542 |
|
13543 |
|
13544 |
|
13545 |
|
13546 |
|
13547 |
|
13548 |
|
13549 |
|
13550 |
|
13551 |
|
13552 |
|
13553 |
|
13554 |
|
13555 |
|
13556 |
|
13557 |
|
13558 |
|
13559 |
|
13560 |
|
13561 |
|
13562 |
|
13563 |
|
13564 |
|
13565 |
|
13566 |
|
13567 |
|
13568 |
|
13569 |
|
13570 |
|
13571 |
|
13572 |
|
13573 |
|
13574 |
|
13575 |
|
13576 |
|
13577 |
|
13578 |
|
13579 |
|
13580 |
|
13581 |
|
13582 |
|
13583 |
|
13584 |
|
13585 |
|
13586 |
|
13587 |
|
13588 |
|
13589 |
|
13590 |
|
13591 |
|
13592 |
|
13593 |
|
13594 |
|
13595 |
|
13596 |
|
13597 |
|
13598 | var NbProgressBarComponent = (function () {
|
13599 | function NbProgressBarComponent(statusService) {
|
13600 | this.statusService = statusService;
|
13601 | |
13602 |
|
13603 |
|
13604 | this.value = 0;
|
13605 | |
13606 |
|
13607 |
|
13608 | this.status = 'basic';
|
13609 | |
13610 |
|
13611 |
|
13612 | this.size = 'medium';
|
13613 | |
13614 |
|
13615 |
|
13616 | this.displayValue = false;
|
13617 | }
|
13618 | Object.defineProperty(NbProgressBarComponent.prototype, "tiny", {
|
13619 | get: function () {
|
13620 | return this.size === 'tiny';
|
13621 | },
|
13622 | enumerable: false,
|
13623 | configurable: true
|
13624 | });
|
13625 | Object.defineProperty(NbProgressBarComponent.prototype, "small", {
|
13626 | get: function () {
|
13627 | return this.size === 'small';
|
13628 | },
|
13629 | enumerable: false,
|
13630 | configurable: true
|
13631 | });
|
13632 | Object.defineProperty(NbProgressBarComponent.prototype, "medium", {
|
13633 | get: function () {
|
13634 | return this.size === 'medium';
|
13635 | },
|
13636 | enumerable: false,
|
13637 | configurable: true
|
13638 | });
|
13639 | Object.defineProperty(NbProgressBarComponent.prototype, "large", {
|
13640 | get: function () {
|
13641 | return this.size === 'large';
|
13642 | },
|
13643 | enumerable: false,
|
13644 | configurable: true
|
13645 | });
|
13646 | Object.defineProperty(NbProgressBarComponent.prototype, "giant", {
|
13647 | get: function () {
|
13648 | return this.size === 'giant';
|
13649 | },
|
13650 | enumerable: false,
|
13651 | configurable: true
|
13652 | });
|
13653 | Object.defineProperty(NbProgressBarComponent.prototype, "primary", {
|
13654 | get: function () {
|
13655 | return this.status === 'primary';
|
13656 | },
|
13657 | enumerable: false,
|
13658 | configurable: true
|
13659 | });
|
13660 | Object.defineProperty(NbProgressBarComponent.prototype, "success", {
|
13661 | get: function () {
|
13662 | return this.status === 'success';
|
13663 | },
|
13664 | enumerable: false,
|
13665 | configurable: true
|
13666 | });
|
13667 | Object.defineProperty(NbProgressBarComponent.prototype, "info", {
|
13668 | get: function () {
|
13669 | return this.status === 'info';
|
13670 | },
|
13671 | enumerable: false,
|
13672 | configurable: true
|
13673 | });
|
13674 | Object.defineProperty(NbProgressBarComponent.prototype, "warning", {
|
13675 | get: function () {
|
13676 | return this.status === 'warning';
|
13677 | },
|
13678 | enumerable: false,
|
13679 | configurable: true
|
13680 | });
|
13681 | Object.defineProperty(NbProgressBarComponent.prototype, "danger", {
|
13682 | get: function () {
|
13683 | return this.status === 'danger';
|
13684 | },
|
13685 | enumerable: false,
|
13686 | configurable: true
|
13687 | });
|
13688 | Object.defineProperty(NbProgressBarComponent.prototype, "basic", {
|
13689 | get: function () {
|
13690 | return this.status === 'basic';
|
13691 | },
|
13692 | enumerable: false,
|
13693 | configurable: true
|
13694 | });
|
13695 | Object.defineProperty(NbProgressBarComponent.prototype, "control", {
|
13696 | get: function () {
|
13697 | return this.status === 'control';
|
13698 | },
|
13699 | enumerable: false,
|
13700 | configurable: true
|
13701 | });
|
13702 | Object.defineProperty(NbProgressBarComponent.prototype, "additionalClasses", {
|
13703 | get: function () {
|
13704 | if (this.statusService.isCustomStatus(this.status)) {
|
13705 | return [this.statusService.getStatusClass(this.status)];
|
13706 | }
|
13707 | return [];
|
13708 | },
|
13709 | enumerable: false,
|
13710 | configurable: true
|
13711 | });
|
13712 | NbProgressBarComponent.decorators = [
|
13713 | { type: i0.Component, args: [{
|
13714 | selector: 'nb-progress-bar',
|
13715 | template: "\n <div class=\"progress-container\">\n <div class=\"progress-value\" [style.width.%]=\"value\">\n <span *ngIf=\"displayValue\">{{ value }}%</span>\n <ng-content></ng-content>\n </div>\n </div>\n ",
|
13716 | styles: [":host{display:block}.progress-container{overflow:hidden}.progress-value{height:100%;text-align:center;overflow:hidden}\n"]
|
13717 | },] }
|
13718 | ];
|
13719 | NbProgressBarComponent.ctorParameters = function () { return [
|
13720 | { type: NbStatusService }
|
13721 | ]; };
|
13722 | NbProgressBarComponent.propDecorators = {
|
13723 | value: [{ type: i0.Input }],
|
13724 | status: [{ type: i0.Input }],
|
13725 | size: [{ type: i0.Input }],
|
13726 | displayValue: [{ type: i0.Input }],
|
13727 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
13728 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
13729 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
13730 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
13731 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }],
|
13732 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
13733 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
13734 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
13735 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
13736 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
13737 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
13738 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
13739 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }]
|
13740 | };
|
13741 | return NbProgressBarComponent;
|
13742 | }());
|
13743 |
|
13744 |
|
13745 |
|
13746 |
|
13747 |
|
13748 |
|
13749 | var NbProgressBarModule = (function () {
|
13750 | function NbProgressBarModule() {
|
13751 | }
|
13752 | NbProgressBarModule.decorators = [
|
13753 | { type: i0.NgModule, args: [{
|
13754 | imports: [
|
13755 | NbSharedModule,
|
13756 | ],
|
13757 | declarations: [NbProgressBarComponent],
|
13758 | exports: [NbProgressBarComponent],
|
13759 | },] }
|
13760 | ];
|
13761 | return NbProgressBarModule;
|
13762 | }());
|
13763 |
|
13764 |
|
13765 |
|
13766 |
|
13767 |
|
13768 |
|
13769 |
|
13770 |
|
13771 |
|
13772 |
|
13773 |
|
13774 |
|
13775 |
|
13776 |
|
13777 |
|
13778 |
|
13779 |
|
13780 |
|
13781 |
|
13782 |
|
13783 |
|
13784 |
|
13785 |
|
13786 |
|
13787 |
|
13788 |
|
13789 |
|
13790 |
|
13791 |
|
13792 |
|
13793 |
|
13794 |
|
13795 |
|
13796 |
|
13797 |
|
13798 |
|
13799 |
|
13800 |
|
13801 |
|
13802 |
|
13803 |
|
13804 |
|
13805 |
|
13806 |
|
13807 |
|
13808 |
|
13809 |
|
13810 |
|
13811 |
|
13812 |
|
13813 |
|
13814 |
|
13815 |
|
13816 |
|
13817 |
|
13818 |
|
13819 |
|
13820 |
|
13821 |
|
13822 |
|
13823 |
|
13824 |
|
13825 |
|
13826 |
|
13827 |
|
13828 |
|
13829 |
|
13830 |
|
13831 |
|
13832 |
|
13833 |
|
13834 |
|
13835 |
|
13836 |
|
13837 |
|
13838 |
|
13839 |
|
13840 |
|
13841 |
|
13842 |
|
13843 |
|
13844 |
|
13845 |
|
13846 |
|
13847 |
|
13848 |
|
13849 |
|
13850 |
|
13851 |
|
13852 |
|
13853 |
|
13854 |
|
13855 |
|
13856 |
|
13857 |
|
13858 |
|
13859 |
|
13860 |
|
13861 |
|
13862 |
|
13863 |
|
13864 |
|
13865 | var NbAlertComponent = (function () {
|
13866 | function NbAlertComponent(statusService) {
|
13867 | this.statusService = statusService;
|
13868 | |
13869 |
|
13870 |
|
13871 |
|
13872 |
|
13873 | this.size = '';
|
13874 | |
13875 |
|
13876 |
|
13877 |
|
13878 | this.status = 'basic';
|
13879 | |
13880 |
|
13881 |
|
13882 |
|
13883 |
|
13884 | this.accent = '';
|
13885 | |
13886 |
|
13887 |
|
13888 |
|
13889 |
|
13890 | this.outline = '';
|
13891 | this._closable = false;
|
13892 | |
13893 |
|
13894 |
|
13895 |
|
13896 | this.close = new i0.EventEmitter();
|
13897 | }
|
13898 | Object.defineProperty(NbAlertComponent.prototype, "closable", {
|
13899 | |
13900 |
|
13901 |
|
13902 | get: function () {
|
13903 | return this._closable;
|
13904 | },
|
13905 | set: function (value) {
|
13906 | this._closable = convertToBoolProperty(value);
|
13907 | },
|
13908 | enumerable: false,
|
13909 | configurable: true
|
13910 | });
|
13911 | |
13912 |
|
13913 |
|
13914 | NbAlertComponent.prototype.onClose = function () {
|
13915 | this.close.emit();
|
13916 | };
|
13917 | Object.defineProperty(NbAlertComponent.prototype, "tiny", {
|
13918 | get: function () {
|
13919 | return this.size === 'tiny';
|
13920 | },
|
13921 | enumerable: false,
|
13922 | configurable: true
|
13923 | });
|
13924 | Object.defineProperty(NbAlertComponent.prototype, "small", {
|
13925 | get: function () {
|
13926 | return this.size === 'small';
|
13927 | },
|
13928 | enumerable: false,
|
13929 | configurable: true
|
13930 | });
|
13931 | Object.defineProperty(NbAlertComponent.prototype, "medium", {
|
13932 | get: function () {
|
13933 | return this.size === 'medium';
|
13934 | },
|
13935 | enumerable: false,
|
13936 | configurable: true
|
13937 | });
|
13938 | Object.defineProperty(NbAlertComponent.prototype, "large", {
|
13939 | get: function () {
|
13940 | return this.size === 'large';
|
13941 | },
|
13942 | enumerable: false,
|
13943 | configurable: true
|
13944 | });
|
13945 | Object.defineProperty(NbAlertComponent.prototype, "giant", {
|
13946 | get: function () {
|
13947 | return this.size === 'giant';
|
13948 | },
|
13949 | enumerable: false,
|
13950 | configurable: true
|
13951 | });
|
13952 | Object.defineProperty(NbAlertComponent.prototype, "primary", {
|
13953 | get: function () {
|
13954 | return this.status === 'primary';
|
13955 | },
|
13956 | enumerable: false,
|
13957 | configurable: true
|
13958 | });
|
13959 | Object.defineProperty(NbAlertComponent.prototype, "success", {
|
13960 | get: function () {
|
13961 | return this.status === 'success';
|
13962 | },
|
13963 | enumerable: false,
|
13964 | configurable: true
|
13965 | });
|
13966 | Object.defineProperty(NbAlertComponent.prototype, "info", {
|
13967 | get: function () {
|
13968 | return this.status === 'info';
|
13969 | },
|
13970 | enumerable: false,
|
13971 | configurable: true
|
13972 | });
|
13973 | Object.defineProperty(NbAlertComponent.prototype, "warning", {
|
13974 | get: function () {
|
13975 | return this.status === 'warning';
|
13976 | },
|
13977 | enumerable: false,
|
13978 | configurable: true
|
13979 | });
|
13980 | Object.defineProperty(NbAlertComponent.prototype, "danger", {
|
13981 | get: function () {
|
13982 | return this.status === 'danger';
|
13983 | },
|
13984 | enumerable: false,
|
13985 | configurable: true
|
13986 | });
|
13987 | Object.defineProperty(NbAlertComponent.prototype, "basic", {
|
13988 | get: function () {
|
13989 | return this.status === 'basic';
|
13990 | },
|
13991 | enumerable: false,
|
13992 | configurable: true
|
13993 | });
|
13994 | Object.defineProperty(NbAlertComponent.prototype, "control", {
|
13995 | get: function () {
|
13996 | return this.status === 'control';
|
13997 | },
|
13998 | enumerable: false,
|
13999 | configurable: true
|
14000 | });
|
14001 | Object.defineProperty(NbAlertComponent.prototype, "primaryAccent", {
|
14002 | get: function () {
|
14003 | return this.accent === 'primary';
|
14004 | },
|
14005 | enumerable: false,
|
14006 | configurable: true
|
14007 | });
|
14008 | Object.defineProperty(NbAlertComponent.prototype, "successAccent", {
|
14009 | get: function () {
|
14010 | return this.accent === 'success';
|
14011 | },
|
14012 | enumerable: false,
|
14013 | configurable: true
|
14014 | });
|
14015 | Object.defineProperty(NbAlertComponent.prototype, "infoAccent", {
|
14016 | get: function () {
|
14017 | return this.accent === 'info';
|
14018 | },
|
14019 | enumerable: false,
|
14020 | configurable: true
|
14021 | });
|
14022 | Object.defineProperty(NbAlertComponent.prototype, "warningAccent", {
|
14023 | get: function () {
|
14024 | return this.accent === 'warning';
|
14025 | },
|
14026 | enumerable: false,
|
14027 | configurable: true
|
14028 | });
|
14029 | Object.defineProperty(NbAlertComponent.prototype, "dangerAccent", {
|
14030 | get: function () {
|
14031 | return this.accent === 'danger';
|
14032 | },
|
14033 | enumerable: false,
|
14034 | configurable: true
|
14035 | });
|
14036 | Object.defineProperty(NbAlertComponent.prototype, "basicAccent", {
|
14037 | get: function () {
|
14038 | return this.accent === 'basic';
|
14039 | },
|
14040 | enumerable: false,
|
14041 | configurable: true
|
14042 | });
|
14043 | Object.defineProperty(NbAlertComponent.prototype, "controlAccent", {
|
14044 | get: function () {
|
14045 | return this.accent === 'control';
|
14046 | },
|
14047 | enumerable: false,
|
14048 | configurable: true
|
14049 | });
|
14050 | Object.defineProperty(NbAlertComponent.prototype, "primaryOutline", {
|
14051 | get: function () {
|
14052 | return this.outline === 'primary';
|
14053 | },
|
14054 | enumerable: false,
|
14055 | configurable: true
|
14056 | });
|
14057 | Object.defineProperty(NbAlertComponent.prototype, "successOutline", {
|
14058 | get: function () {
|
14059 | return this.outline === 'success';
|
14060 | },
|
14061 | enumerable: false,
|
14062 | configurable: true
|
14063 | });
|
14064 | Object.defineProperty(NbAlertComponent.prototype, "infoOutline", {
|
14065 | get: function () {
|
14066 | return this.outline === 'info';
|
14067 | },
|
14068 | enumerable: false,
|
14069 | configurable: true
|
14070 | });
|
14071 | Object.defineProperty(NbAlertComponent.prototype, "warningOutline", {
|
14072 | get: function () {
|
14073 | return this.outline === 'warning';
|
14074 | },
|
14075 | enumerable: false,
|
14076 | configurable: true
|
14077 | });
|
14078 | Object.defineProperty(NbAlertComponent.prototype, "dangerOutline", {
|
14079 | get: function () {
|
14080 | return this.outline === 'danger';
|
14081 | },
|
14082 | enumerable: false,
|
14083 | configurable: true
|
14084 | });
|
14085 | Object.defineProperty(NbAlertComponent.prototype, "basicOutline", {
|
14086 | get: function () {
|
14087 | return this.outline === 'basic';
|
14088 | },
|
14089 | enumerable: false,
|
14090 | configurable: true
|
14091 | });
|
14092 | Object.defineProperty(NbAlertComponent.prototype, "controlOutline", {
|
14093 | get: function () {
|
14094 | return this.outline === 'control';
|
14095 | },
|
14096 | enumerable: false,
|
14097 | configurable: true
|
14098 | });
|
14099 | Object.defineProperty(NbAlertComponent.prototype, "additionalClasses", {
|
14100 | get: function () {
|
14101 | if (this.statusService.isCustomStatus(this.status)) {
|
14102 | return [this.statusService.getStatusClass(this.status)];
|
14103 | }
|
14104 | return [];
|
14105 | },
|
14106 | enumerable: false,
|
14107 | configurable: true
|
14108 | });
|
14109 | NbAlertComponent.decorators = [
|
14110 | { type: i0.Component, args: [{
|
14111 | selector: 'nb-alert',
|
14112 | template: "\n <button *ngIf=\"closable\" type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"onClose()\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <ng-content></ng-content>\n ",
|
14113 | styles: [":host{display:flex;flex-direction:column;position:relative}[dir=ltr] :host .close{right:0}[dir=rtl] :host .close{left:0}.close{position:absolute;top:0;color:inherit;background-color:transparent;border:0;appearance:none}\n"]
|
14114 | },] }
|
14115 | ];
|
14116 | NbAlertComponent.ctorParameters = function () { return [
|
14117 | { type: NbStatusService }
|
14118 | ]; };
|
14119 | NbAlertComponent.propDecorators = {
|
14120 | size: [{ type: i0.Input }],
|
14121 | status: [{ type: i0.Input }],
|
14122 | accent: [{ type: i0.Input }],
|
14123 | outline: [{ type: i0.Input }],
|
14124 | closable: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.closable',] }],
|
14125 | close: [{ type: i0.Output }],
|
14126 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
14127 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
14128 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
14129 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
14130 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }],
|
14131 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
14132 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
14133 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
14134 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
14135 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
14136 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
14137 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
14138 | primaryAccent: [{ type: i0.HostBinding, args: ['class.accent-primary',] }],
|
14139 | successAccent: [{ type: i0.HostBinding, args: ['class.accent-success',] }],
|
14140 | infoAccent: [{ type: i0.HostBinding, args: ['class.accent-info',] }],
|
14141 | warningAccent: [{ type: i0.HostBinding, args: ['class.accent-warning',] }],
|
14142 | dangerAccent: [{ type: i0.HostBinding, args: ['class.accent-danger',] }],
|
14143 | basicAccent: [{ type: i0.HostBinding, args: ['class.accent-basic',] }],
|
14144 | controlAccent: [{ type: i0.HostBinding, args: ['class.accent-control',] }],
|
14145 | primaryOutline: [{ type: i0.HostBinding, args: ['class.outline-primary',] }],
|
14146 | successOutline: [{ type: i0.HostBinding, args: ['class.outline-success',] }],
|
14147 | infoOutline: [{ type: i0.HostBinding, args: ['class.outline-info',] }],
|
14148 | warningOutline: [{ type: i0.HostBinding, args: ['class.outline-warning',] }],
|
14149 | dangerOutline: [{ type: i0.HostBinding, args: ['class.outline-danger',] }],
|
14150 | basicOutline: [{ type: i0.HostBinding, args: ['class.outline-basic',] }],
|
14151 | controlOutline: [{ type: i0.HostBinding, args: ['class.outline-control',] }],
|
14152 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }]
|
14153 | };
|
14154 | return NbAlertComponent;
|
14155 | }());
|
14156 |
|
14157 |
|
14158 |
|
14159 |
|
14160 |
|
14161 |
|
14162 | var NbAlertModule = (function () {
|
14163 | function NbAlertModule() {
|
14164 | }
|
14165 | NbAlertModule.decorators = [
|
14166 | { type: i0.NgModule, args: [{
|
14167 | imports: [
|
14168 | NbSharedModule,
|
14169 | ],
|
14170 | declarations: [
|
14171 | NbAlertComponent,
|
14172 | ],
|
14173 | exports: [
|
14174 | NbAlertComponent,
|
14175 | ],
|
14176 | },] }
|
14177 | ];
|
14178 | return NbAlertModule;
|
14179 | }());
|
14180 |
|
14181 |
|
14182 |
|
14183 |
|
14184 |
|
14185 |
|
14186 |
|
14187 |
|
14188 |
|
14189 |
|
14190 |
|
14191 |
|
14192 |
|
14193 |
|
14194 |
|
14195 |
|
14196 |
|
14197 |
|
14198 |
|
14199 |
|
14200 |
|
14201 |
|
14202 |
|
14203 |
|
14204 |
|
14205 |
|
14206 |
|
14207 |
|
14208 |
|
14209 |
|
14210 |
|
14211 |
|
14212 |
|
14213 |
|
14214 | var NbChatFormComponent = (function () {
|
14215 | function NbChatFormComponent(cd, domSanitizer) {
|
14216 | this.cd = cd;
|
14217 | this.domSanitizer = domSanitizer;
|
14218 | this.status = 'basic';
|
14219 | this.inputFocus = false;
|
14220 | this.inputHover = false;
|
14221 | this.droppedFiles = [];
|
14222 | this.imgDropTypes = ['image/png', 'image/jpeg', 'image/gif'];
|
14223 | |
14224 |
|
14225 |
|
14226 |
|
14227 | this.message = '';
|
14228 | |
14229 |
|
14230 |
|
14231 |
|
14232 | this.messagePlaceholder = 'Type a message';
|
14233 | |
14234 |
|
14235 |
|
14236 |
|
14237 | this.buttonTitle = '';
|
14238 | |
14239 |
|
14240 |
|
14241 |
|
14242 | this.buttonIcon = 'paper-plane-outline';
|
14243 | |
14244 |
|
14245 |
|
14246 |
|
14247 | this.showButton = true;
|
14248 | |
14249 |
|
14250 |
|
14251 |
|
14252 | this.dropFiles = false;
|
14253 | |
14254 |
|
14255 |
|
14256 |
|
14257 | this.dropFilePlaceholder = 'Drop file to send';
|
14258 | |
14259 |
|
14260 |
|
14261 |
|
14262 | this.send = new i0.EventEmitter();
|
14263 | |
14264 |
|
14265 |
|
14266 |
|
14267 | this.onInputChange = new i0.EventEmitter();
|
14268 | this.fileOver = false;
|
14269 | }
|
14270 | NbChatFormComponent.prototype.onDrop = function (event) {
|
14271 | var _this = this;
|
14272 | if (this.dropFiles) {
|
14273 | event.preventDefault();
|
14274 | event.stopPropagation();
|
14275 | this.fileOver = false;
|
14276 | if (event.dataTransfer && event.dataTransfer.files) {
|
14277 | var _loop_1 = function (file) {
|
14278 | var res = file;
|
14279 | if (this_1.imgDropTypes.includes(file.type)) {
|
14280 | var fr = new FileReader();
|
14281 | fr.onload = function (e) {
|
14282 | res.src = e.target.result;
|
14283 | res.urlStyle = _this.domSanitizer.bypassSecurityTrustStyle("url(" + res.src + ")");
|
14284 | _this.cd.detectChanges();
|
14285 | };
|
14286 | fr.readAsDataURL(file);
|
14287 | }
|
14288 | this_1.droppedFiles.push(res);
|
14289 | };
|
14290 | var this_1 = this;
|
14291 | for (var _i = 0, _a = event.dataTransfer.files; _i < _a.length; _i++) {
|
14292 | var file = _a[_i];
|
14293 | _loop_1(file);
|
14294 | }
|
14295 | }
|
14296 | }
|
14297 | };
|
14298 | NbChatFormComponent.prototype.removeFile = function (file) {
|
14299 | var index = this.droppedFiles.indexOf(file);
|
14300 | if (index >= 0) {
|
14301 | this.droppedFiles.splice(index, 1);
|
14302 | }
|
14303 | };
|
14304 | NbChatFormComponent.prototype.onDragOver = function () {
|
14305 | if (this.dropFiles) {
|
14306 | this.fileOver = true;
|
14307 | }
|
14308 | };
|
14309 | NbChatFormComponent.prototype.onDragLeave = function () {
|
14310 | if (this.dropFiles) {
|
14311 | this.fileOver = false;
|
14312 | }
|
14313 | };
|
14314 | NbChatFormComponent.prototype.sendMessage = function () {
|
14315 | if (this.droppedFiles.length || String(this.message).trim().length) {
|
14316 | this.send.emit({ message: this.message, files: this.droppedFiles });
|
14317 | this.message = '';
|
14318 | this.droppedFiles = [];
|
14319 | }
|
14320 | };
|
14321 | NbChatFormComponent.prototype.setStatus = function (status) {
|
14322 | if (this.status !== status) {
|
14323 | this.status = status;
|
14324 | this.cd.detectChanges();
|
14325 | }
|
14326 | };
|
14327 | NbChatFormComponent.prototype.getInputStatus = function () {
|
14328 | if (this.fileOver) {
|
14329 | return this.getHighlightStatus();
|
14330 | }
|
14331 | if (this.inputFocus || this.inputHover) {
|
14332 | return this.status;
|
14333 | }
|
14334 | return 'basic';
|
14335 | };
|
14336 | NbChatFormComponent.prototype.getButtonStatus = function () {
|
14337 | return this.getHighlightStatus();
|
14338 | };
|
14339 | NbChatFormComponent.prototype.getHighlightStatus = function () {
|
14340 | if (this.status === 'basic' || this.status === 'control') {
|
14341 | return 'primary';
|
14342 | }
|
14343 | return this.status;
|
14344 | };
|
14345 | NbChatFormComponent.prototype.onModelChange = function (value) {
|
14346 | this.onInputChange.emit(value);
|
14347 | };
|
14348 | NbChatFormComponent.decorators = [
|
14349 | { type: i0.Component, args: [{
|
14350 | selector: 'nb-chat-form',
|
14351 | template: "\n <div class=\"dropped-files\" *ngIf=\"droppedFiles?.length\">\n <ng-container *ngFor=\"let file of droppedFiles\">\n <div *ngIf=\"file.urlStyle\" [style.background-image]=\"file.urlStyle\">\n <span class=\"remove\" (click)=\"removeFile(file)\">×</span>\n </div>\n\n <div *ngIf=\"!file.urlStyle\">\n <nb-icon icon=\"file-text-outline\" pack=\"nebular-essentials\"></nb-icon>\n <span class=\"remove\" (click)=\"removeFile(file)\">×</span>\n </div>\n </ng-container>\n </div>\n <div class=\"message-row\">\n <input nbInput\n fullWidth\n [status]=\"getInputStatus()\"\n (focus)=\"inputFocus = true\"\n (blur)=\"inputFocus = false\"\n (mouseenter)=\"inputHover = true\"\n (mouseleave)=\"inputHover = false\"\n [(ngModel)]=\"message\"\n (ngModelChange)=\"onModelChange($event)\"\n [class.with-button]=\"showButton\"\n type=\"text\"\n placeholder=\"{{ fileOver ? dropFilePlaceholder : messagePlaceholder }}\"\n (keyup.enter)=\"sendMessage()\">\n <button nbButton\n [status]=\"getButtonStatus()\"\n *ngIf=\"showButton\"\n [class.with-icon]=\"!buttonTitle\"\n (click)=\"sendMessage()\"\n class=\"send-button\">\n <nb-icon *ngIf=\"!buttonTitle; else title\" [icon]=\"buttonIcon\" pack=\"nebular-essentials\"></nb-icon>\n <ng-template #title>{{ buttonTitle }}</ng-template>\n </button>\n </div>\n ",
|
14352 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
14353 | },] }
|
14354 | ];
|
14355 | NbChatFormComponent.ctorParameters = function () { return [
|
14356 | { type: i0.ChangeDetectorRef },
|
14357 | { type: _angular_platformBrowser.DomSanitizer }
|
14358 | ]; };
|
14359 | NbChatFormComponent.propDecorators = {
|
14360 | message: [{ type: i0.Input }],
|
14361 | messagePlaceholder: [{ type: i0.Input }],
|
14362 | buttonTitle: [{ type: i0.Input }],
|
14363 | buttonIcon: [{ type: i0.Input }],
|
14364 | showButton: [{ type: i0.Input }],
|
14365 | dropFiles: [{ type: i0.Input }],
|
14366 | dropFilePlaceholder: [{ type: i0.Input }],
|
14367 | send: [{ type: i0.Output }],
|
14368 | onInputChange: [{ type: i0.Output }],
|
14369 | fileOver: [{ type: i0.HostBinding, args: ['class.file-over',] }],
|
14370 | onDrop: [{ type: i0.HostListener, args: ['drop', ['$event'],] }],
|
14371 | onDragOver: [{ type: i0.HostListener, args: ['dragover',] }],
|
14372 | onDragLeave: [{ type: i0.HostListener, args: ['dragleave',] }]
|
14373 | };
|
14374 | return NbChatFormComponent;
|
14375 | }());
|
14376 |
|
14377 |
|
14378 |
|
14379 |
|
14380 |
|
14381 | var NbCustomMessageService = (function () {
|
14382 | function NbCustomMessageService() {
|
14383 | this.customMessages = new Map();
|
14384 | }
|
14385 | NbCustomMessageService.prototype.register = function (type, instance) {
|
14386 | this.customMessages.set(type, instance);
|
14387 | };
|
14388 | NbCustomMessageService.prototype.unregister = function (type) {
|
14389 | return this.customMessages.delete(type);
|
14390 | };
|
14391 | NbCustomMessageService.prototype.getInstance = function (type) {
|
14392 | return this.customMessages.get(type);
|
14393 | };
|
14394 | NbCustomMessageService.decorators = [
|
14395 | { type: i0.Injectable }
|
14396 | ];
|
14397 | return NbCustomMessageService;
|
14398 | }());
|
14399 |
|
14400 |
|
14401 |
|
14402 |
|
14403 |
|
14404 |
|
14405 |
|
14406 |
|
14407 |
|
14408 |
|
14409 |
|
14410 |
|
14411 |
|
14412 |
|
14413 |
|
14414 |
|
14415 |
|
14416 |
|
14417 |
|
14418 |
|
14419 |
|
14420 |
|
14421 |
|
14422 |
|
14423 |
|
14424 |
|
14425 |
|
14426 |
|
14427 |
|
14428 |
|
14429 |
|
14430 |
|
14431 |
|
14432 |
|
14433 |
|
14434 |
|
14435 |
|
14436 |
|
14437 |
|
14438 |
|
14439 |
|
14440 |
|
14441 |
|
14442 |
|
14443 |
|
14444 |
|
14445 |
|
14446 |
|
14447 |
|
14448 |
|
14449 | var NbChatMessageComponent = (function () {
|
14450 | function NbChatMessageComponent(domSanitizer, customMessageService) {
|
14451 | this.domSanitizer = domSanitizer;
|
14452 | this.customMessageService = customMessageService;
|
14453 | this.builtInMessageTypes = ['text', 'file', 'map', 'quote'];
|
14454 | this._reply = false;
|
14455 | }
|
14456 | Object.defineProperty(NbChatMessageComponent.prototype, "_addReplyClass", {
|
14457 | get: function () {
|
14458 | return this._areDefaultStylesEnabled() && this.reply;
|
14459 | },
|
14460 | enumerable: false,
|
14461 | configurable: true
|
14462 | });
|
14463 | Object.defineProperty(NbChatMessageComponent.prototype, "_addNotReplyClass", {
|
14464 | get: function () {
|
14465 | return this._areDefaultStylesEnabled() && this.notReply;
|
14466 | },
|
14467 | enumerable: false,
|
14468 | configurable: true
|
14469 | });
|
14470 | Object.defineProperty(NbChatMessageComponent.prototype, "_addNoSpaceClass", {
|
14471 | get: function () {
|
14472 | return this._areDefaultStylesEnabled() && !this.message;
|
14473 | },
|
14474 | enumerable: false,
|
14475 | configurable: true
|
14476 | });
|
14477 | Object.defineProperty(NbChatMessageComponent.prototype, "flyInOut", {
|
14478 | get: function () {
|
14479 | return true;
|
14480 | },
|
14481 | enumerable: false,
|
14482 | configurable: true
|
14483 | });
|
14484 | Object.defineProperty(NbChatMessageComponent.prototype, "notReply", {
|
14485 | get: function () {
|
14486 | return !this.reply;
|
14487 | },
|
14488 | enumerable: false,
|
14489 | configurable: true
|
14490 | });
|
14491 | Object.defineProperty(NbChatMessageComponent.prototype, "reply", {
|
14492 | |
14493 |
|
14494 |
|
14495 | get: function () {
|
14496 | return this._reply;
|
14497 | },
|
14498 | set: function (value) {
|
14499 | this._reply = convertToBoolProperty(value);
|
14500 | },
|
14501 | enumerable: false,
|
14502 | configurable: true
|
14503 | });
|
14504 | Object.defineProperty(NbChatMessageComponent.prototype, "avatar", {
|
14505 | |
14506 |
|
14507 |
|
14508 |
|
14509 | set: function (value) {
|
14510 | this.avatarStyle = value ? this.domSanitizer.bypassSecurityTrustStyle("url(" + value + ")") : null;
|
14511 | },
|
14512 | enumerable: false,
|
14513 | configurable: true
|
14514 | });
|
14515 | NbChatMessageComponent.prototype.getInitials = function () {
|
14516 | if (this.sender) {
|
14517 | var names = this.sender.split(' ');
|
14518 | return names.map(function (n) { return n.charAt(0); }).splice(0, 2).join('').toUpperCase();
|
14519 | }
|
14520 | return '';
|
14521 | };
|
14522 | NbChatMessageComponent.prototype._isBuiltInMessageType = function () {
|
14523 |
|
14524 | return this.type == null || this.builtInMessageTypes.includes(this.type);
|
14525 | };
|
14526 | NbChatMessageComponent.prototype._getTemplate = function () {
|
14527 | var customMessage = this.getCustomMessage(this.type);
|
14528 | return customMessage.templateRef;
|
14529 | };
|
14530 | NbChatMessageComponent.prototype._getTemplateContext = function () {
|
14531 | return { $implicit: this.customMessageData, isReply: this.reply };
|
14532 | };
|
14533 | NbChatMessageComponent.prototype._areDefaultStylesEnabled = function () {
|
14534 | var customMessageDirective = this.getCustomMessage(this.type);
|
14535 | return !customMessageDirective.noStyles;
|
14536 | };
|
14537 | NbChatMessageComponent.prototype.getCustomMessage = function (type) {
|
14538 | var customMessageDirective = this.customMessageService.getInstance(type);
|
14539 | if (!customMessageDirective) {
|
14540 | throw new Error("nb-chat: Can't find template for custom type '" + type + "'. " +
|
14541 | ("Make sure you provide it in the chat component with *nbCustomMessage='" + type + "'."));
|
14542 | }
|
14543 | return customMessageDirective;
|
14544 | };
|
14545 | NbChatMessageComponent.decorators = [
|
14546 | { type: i0.Component, args: [{
|
14547 | selector: 'nb-chat-message',
|
14548 | template: "\n <nb-chat-avatar *ngIf=\"notReply\"\n [initials]=\"getInitials()\"\n [avatarStyle]=\"avatarStyle\">\n </nb-chat-avatar>\n\n <div class=\"message\">\n <ng-container [ngSwitch]=\"type\" *ngIf=\"_isBuiltInMessageType(); else customTemplate\">\n <nb-chat-message-file *ngSwitchCase=\"'file'\"\n [sender]=\"sender\"\n [date]=\"date\"\n [dateFormat]=\"dateFormat\"\n [message]=\"message\"\n [files]=\"files\">\n </nb-chat-message-file>\n\n <nb-chat-message-quote *ngSwitchCase=\"'quote'\"\n [sender]=\"sender\"\n [date]=\"date\"\n [dateFormat]=\"dateFormat\"\n [message]=\"message\"\n [quote]=\"quote\">\n </nb-chat-message-quote>\n\n <nb-chat-message-map *ngSwitchCase=\"'map'\"\n [sender]=\"sender\"\n [date]=\"date\"\n [message]=\"message\"\n [latitude]=\"latitude\"\n [longitude]=\"longitude\">\n </nb-chat-message-map>\n\n <nb-chat-message-text *ngSwitchDefault\n [sender]=\"sender\"\n [date]=\"date\"\n [dateFormat]=\"dateFormat\"\n [message]=\"message\">\n </nb-chat-message-text>\n </ng-container>\n </div>\n\n <ng-template #customTemplate>\n <nb-chat-message-text [sender]=\"sender\"\n [date]=\"date\"\n [dateFormat]=\"dateFormat\"\n [message]=\"message\">\n </nb-chat-message-text>\n <div [class.nb-custom-message]=\"_areDefaultStylesEnabled()\"\n [class.nb-custom-message-no-space]=\"_addNoSpaceClass\"\n [class.nb-custom-message-reply]=\"_addReplyClass\"\n [class.nb-custom-message-not-reply]=\"_addNotReplyClass\"\n [class.nb-custom-message-full-width]=\"!_areDefaultStylesEnabled()\">\n <ng-container [ngTemplateOutlet]=\"_getTemplate()\"\n [ngTemplateOutletContext]=\"_getTemplateContext()\">\n </ng-container>\n </div>\n </ng-template>\n ",
|
14549 | animations: [
|
14550 | _angular_animations.trigger('flyInOut', [
|
14551 | _angular_animations.state('in', _angular_animations.style({ transform: 'translateX(0)' })),
|
14552 | _angular_animations.transition('void => *', [
|
14553 | _angular_animations.style({ transform: 'translateX(-100%)' }),
|
14554 | _angular_animations.animate(80),
|
14555 | ]),
|
14556 | _angular_animations.transition('* => void', [
|
14557 | _angular_animations.animate(80, _angular_animations.style({ transform: 'translateX(100%)' })),
|
14558 | ]),
|
14559 | ]),
|
14560 | ],
|
14561 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
14562 | },] }
|
14563 | ];
|
14564 | NbChatMessageComponent.ctorParameters = function () { return [
|
14565 | { type: _angular_platformBrowser.DomSanitizer },
|
14566 | { type: NbCustomMessageService }
|
14567 | ]; };
|
14568 | NbChatMessageComponent.propDecorators = {
|
14569 | flyInOut: [{ type: i0.HostBinding, args: ['@flyInOut',] }],
|
14570 | notReply: [{ type: i0.HostBinding, args: ['class.not-reply',] }],
|
14571 | reply: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.reply',] }],
|
14572 | message: [{ type: i0.Input }],
|
14573 | sender: [{ type: i0.Input }],
|
14574 | date: [{ type: i0.Input }],
|
14575 | dateFormat: [{ type: i0.Input }],
|
14576 | files: [{ type: i0.Input }],
|
14577 | quote: [{ type: i0.Input }],
|
14578 | latitude: [{ type: i0.Input }],
|
14579 | longitude: [{ type: i0.Input }],
|
14580 | avatar: [{ type: i0.Input }],
|
14581 | type: [{ type: i0.Input }],
|
14582 | customMessageData: [{ type: i0.Input }]
|
14583 | };
|
14584 | return NbChatMessageComponent;
|
14585 | }());
|
14586 |
|
14587 |
|
14588 |
|
14589 |
|
14590 |
|
14591 |
|
14592 |
|
14593 |
|
14594 |
|
14595 |
|
14596 |
|
14597 |
|
14598 |
|
14599 |
|
14600 |
|
14601 |
|
14602 |
|
14603 |
|
14604 |
|
14605 |
|
14606 |
|
14607 |
|
14608 |
|
14609 |
|
14610 |
|
14611 |
|
14612 |
|
14613 |
|
14614 |
|
14615 |
|
14616 |
|
14617 |
|
14618 |
|
14619 |
|
14620 |
|
14621 |
|
14622 |
|
14623 |
|
14624 |
|
14625 |
|
14626 |
|
14627 |
|
14628 |
|
14629 |
|
14630 |
|
14631 |
|
14632 |
|
14633 |
|
14634 |
|
14635 |
|
14636 |
|
14637 |
|
14638 |
|
14639 |
|
14640 |
|
14641 |
|
14642 |
|
14643 |
|
14644 |
|
14645 |
|
14646 |
|
14647 |
|
14648 |
|
14649 |
|
14650 |
|
14651 |
|
14652 |
|
14653 |
|
14654 |
|
14655 |
|
14656 |
|
14657 |
|
14658 |
|
14659 |
|
14660 |
|
14661 |
|
14662 |
|
14663 |
|
14664 |
|
14665 |
|
14666 |
|
14667 |
|
14668 |
|
14669 |
|
14670 |
|
14671 |
|
14672 |
|
14673 |
|
14674 |
|
14675 |
|
14676 |
|
14677 |
|
14678 |
|
14679 |
|
14680 |
|
14681 |
|
14682 |
|
14683 |
|
14684 |
|
14685 |
|
14686 |
|
14687 |
|
14688 |
|
14689 |
|
14690 |
|
14691 |
|
14692 |
|
14693 |
|
14694 |
|
14695 |
|
14696 |
|
14697 |
|
14698 |
|
14699 |
|
14700 |
|
14701 |
|
14702 |
|
14703 |
|
14704 |
|
14705 |
|
14706 |
|
14707 |
|
14708 |
|
14709 |
|
14710 |
|
14711 |
|
14712 |
|
14713 |
|
14714 |
|
14715 |
|
14716 |
|
14717 |
|
14718 |
|
14719 |
|
14720 |
|
14721 |
|
14722 |
|
14723 |
|
14724 |
|
14725 |
|
14726 |
|
14727 |
|
14728 |
|
14729 |
|
14730 |
|
14731 |
|
14732 |
|
14733 |
|
14734 |
|
14735 |
|
14736 |
|
14737 |
|
14738 |
|
14739 |
|
14740 |
|
14741 |
|
14742 |
|
14743 |
|
14744 |
|
14745 |
|
14746 |
|
14747 |
|
14748 |
|
14749 |
|
14750 |
|
14751 |
|
14752 |
|
14753 |
|
14754 |
|
14755 |
|
14756 |
|
14757 |
|
14758 |
|
14759 |
|
14760 |
|
14761 |
|
14762 |
|
14763 |
|
14764 |
|
14765 |
|
14766 |
|
14767 |
|
14768 |
|
14769 |
|
14770 |
|
14771 |
|
14772 |
|
14773 |
|
14774 |
|
14775 |
|
14776 |
|
14777 |
|
14778 |
|
14779 |
|
14780 |
|
14781 |
|
14782 |
|
14783 |
|
14784 |
|
14785 |
|
14786 |
|
14787 |
|
14788 |
|
14789 |
|
14790 |
|
14791 |
|
14792 |
|
14793 |
|
14794 |
|
14795 |
|
14796 |
|
14797 |
|
14798 | var NbChatComponent = (function () {
|
14799 | function NbChatComponent(statusService) {
|
14800 | this.statusService = statusService;
|
14801 | |
14802 |
|
14803 |
|
14804 |
|
14805 | this.status = 'basic';
|
14806 | this.noMessagesPlaceholder = 'No messages yet.';
|
14807 | this._scrollBottom = true;
|
14808 | }
|
14809 | Object.defineProperty(NbChatComponent.prototype, "scrollBottom", {
|
14810 | |
14811 |
|
14812 |
|
14813 | get: function () {
|
14814 | return this._scrollBottom;
|
14815 | },
|
14816 | set: function (value) {
|
14817 | this._scrollBottom = convertToBoolProperty(value);
|
14818 | },
|
14819 | enumerable: false,
|
14820 | configurable: true
|
14821 | });
|
14822 | NbChatComponent.prototype.ngOnChanges = function (changes) {
|
14823 | if ('status' in changes) {
|
14824 | this.updateFormStatus();
|
14825 | }
|
14826 | };
|
14827 | NbChatComponent.prototype.ngAfterContentInit = function () {
|
14828 | this.updateFormStatus();
|
14829 | };
|
14830 | NbChatComponent.prototype.ngAfterViewInit = function () {
|
14831 | var _this = this;
|
14832 | this.messages.changes
|
14833 | .subscribe(function (messages) {
|
14834 | _this.messages = messages;
|
14835 | _this.updateView();
|
14836 | });
|
14837 | this.updateView();
|
14838 | };
|
14839 | NbChatComponent.prototype.updateView = function () {
|
14840 | if (this.scrollBottom) {
|
14841 | this.scrollListBottom();
|
14842 | }
|
14843 | };
|
14844 | NbChatComponent.prototype.scrollListBottom = function () {
|
14845 | this.scrollable.nativeElement.scrollTop = this.scrollable.nativeElement.scrollHeight;
|
14846 | };
|
14847 | NbChatComponent.prototype.updateFormStatus = function () {
|
14848 | if (this.chatForm) {
|
14849 | this.chatForm.setStatus(this.status);
|
14850 | }
|
14851 | };
|
14852 | Object.defineProperty(NbChatComponent.prototype, "tiny", {
|
14853 | get: function () {
|
14854 | return this.size === 'tiny';
|
14855 | },
|
14856 | enumerable: false,
|
14857 | configurable: true
|
14858 | });
|
14859 | Object.defineProperty(NbChatComponent.prototype, "small", {
|
14860 | get: function () {
|
14861 | return this.size === 'small';
|
14862 | },
|
14863 | enumerable: false,
|
14864 | configurable: true
|
14865 | });
|
14866 | Object.defineProperty(NbChatComponent.prototype, "medium", {
|
14867 | get: function () {
|
14868 | return this.size === 'medium';
|
14869 | },
|
14870 | enumerable: false,
|
14871 | configurable: true
|
14872 | });
|
14873 | Object.defineProperty(NbChatComponent.prototype, "large", {
|
14874 | get: function () {
|
14875 | return this.size === 'large';
|
14876 | },
|
14877 | enumerable: false,
|
14878 | configurable: true
|
14879 | });
|
14880 | Object.defineProperty(NbChatComponent.prototype, "giant", {
|
14881 | get: function () {
|
14882 | return this.size === 'giant';
|
14883 | },
|
14884 | enumerable: false,
|
14885 | configurable: true
|
14886 | });
|
14887 | Object.defineProperty(NbChatComponent.prototype, "primary", {
|
14888 | get: function () {
|
14889 | return this.status === 'primary';
|
14890 | },
|
14891 | enumerable: false,
|
14892 | configurable: true
|
14893 | });
|
14894 | Object.defineProperty(NbChatComponent.prototype, "success", {
|
14895 | get: function () {
|
14896 | return this.status === 'success';
|
14897 | },
|
14898 | enumerable: false,
|
14899 | configurable: true
|
14900 | });
|
14901 | Object.defineProperty(NbChatComponent.prototype, "info", {
|
14902 | get: function () {
|
14903 | return this.status === 'info';
|
14904 | },
|
14905 | enumerable: false,
|
14906 | configurable: true
|
14907 | });
|
14908 | Object.defineProperty(NbChatComponent.prototype, "warning", {
|
14909 | get: function () {
|
14910 | return this.status === 'warning';
|
14911 | },
|
14912 | enumerable: false,
|
14913 | configurable: true
|
14914 | });
|
14915 | Object.defineProperty(NbChatComponent.prototype, "danger", {
|
14916 | get: function () {
|
14917 | return this.status === 'danger';
|
14918 | },
|
14919 | enumerable: false,
|
14920 | configurable: true
|
14921 | });
|
14922 | Object.defineProperty(NbChatComponent.prototype, "basic", {
|
14923 | get: function () {
|
14924 | return this.status === 'basic';
|
14925 | },
|
14926 | enumerable: false,
|
14927 | configurable: true
|
14928 | });
|
14929 | Object.defineProperty(NbChatComponent.prototype, "control", {
|
14930 | get: function () {
|
14931 | return this.status === 'control';
|
14932 | },
|
14933 | enumerable: false,
|
14934 | configurable: true
|
14935 | });
|
14936 | Object.defineProperty(NbChatComponent.prototype, "additionalClasses", {
|
14937 | get: function () {
|
14938 | if (this.statusService.isCustomStatus(this.status)) {
|
14939 | return [this.statusService.getStatusClass(this.status)];
|
14940 | }
|
14941 | return [];
|
14942 | },
|
14943 | enumerable: false,
|
14944 | configurable: true
|
14945 | });
|
14946 | NbChatComponent.decorators = [
|
14947 | { type: i0.Component, args: [{
|
14948 | selector: 'nb-chat',
|
14949 | template: "\n <div class=\"header\">{{ title }}</div>\n <div class=\"scrollable\" #scrollable>\n <div class=\"messages\">\n <ng-content select=\"nb-chat-message\"></ng-content>\n <p class=\"no-messages\" *ngIf=\"!messages?.length\">{{ noMessagesPlaceholder }}</p>\n </div>\n </div>\n <div class=\"form\">\n <ng-content select=\"nb-chat-form\"></ng-content>\n </div>\n ",
|
14950 | providers: [
|
14951 | NbCustomMessageService,
|
14952 | ],
|
14953 | styles: [":host{display:flex;flex-direction:column;position:relative;height:100%}\n"]
|
14954 | },] }
|
14955 | ];
|
14956 | NbChatComponent.ctorParameters = function () { return [
|
14957 | { type: NbStatusService }
|
14958 | ]; };
|
14959 | NbChatComponent.propDecorators = {
|
14960 | title: [{ type: i0.Input }],
|
14961 | size: [{ type: i0.Input }],
|
14962 | status: [{ type: i0.Input }],
|
14963 | noMessagesPlaceholder: [{ type: i0.Input }],
|
14964 | scrollBottom: [{ type: i0.Input }],
|
14965 | scrollable: [{ type: i0.ViewChild, args: ['scrollable',] }],
|
14966 | messages: [{ type: i0.ContentChildren, args: [NbChatMessageComponent,] }],
|
14967 | chatForm: [{ type: i0.ContentChild, args: [NbChatFormComponent,] }],
|
14968 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
14969 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
14970 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
14971 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
14972 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }],
|
14973 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
14974 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
14975 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
14976 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
14977 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
14978 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
14979 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
14980 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }]
|
14981 | };
|
14982 | return NbChatComponent;
|
14983 | }());
|
14984 |
|
14985 |
|
14986 |
|
14987 |
|
14988 |
|
14989 |
|
14990 | var NbChatOptions = (function () {
|
14991 | function NbChatOptions() {
|
14992 | }
|
14993 | return NbChatOptions;
|
14994 | }());
|
14995 |
|
14996 |
|
14997 |
|
14998 |
|
14999 |
|
15000 |
|
15001 |
|
15002 |
|
15003 |
|
15004 | var NbChatMessageMapComponent = (function () {
|
15005 | function NbChatMessageMapComponent(options) {
|
15006 | |
15007 |
|
15008 |
|
15009 |
|
15010 | this.dateFormat = 'shortTime';
|
15011 | this.mapKey = options.messageGoogleMapKey;
|
15012 | }
|
15013 | Object.defineProperty(NbChatMessageMapComponent.prototype, "file", {
|
15014 | get: function () {
|
15015 | return {
|
15016 |
|
15017 | url: "https://maps.googleapis.com/maps/api/staticmap?center=" + this.latitude + "," + this.longitude + "&zoom=12&size=400x400&key=" + this.mapKey,
|
15018 | type: 'image/png',
|
15019 | icon: 'location',
|
15020 | };
|
15021 | },
|
15022 | enumerable: false,
|
15023 | configurable: true
|
15024 | });
|
15025 | NbChatMessageMapComponent.decorators = [
|
15026 | { type: i0.Component, args: [{
|
15027 | selector: 'nb-chat-message-map',
|
15028 | template: "\n <nb-chat-message-file [files]=\"[file]\" [message]=\"message\" [sender]=\"sender\" [date]=\"date\"\n [dateFormat]=\"dateFormat\"></nb-chat-message-file>\n ",
|
15029 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
15030 | },] }
|
15031 | ];
|
15032 | NbChatMessageMapComponent.ctorParameters = function () { return [
|
15033 | { type: NbChatOptions }
|
15034 | ]; };
|
15035 | NbChatMessageMapComponent.propDecorators = {
|
15036 | message: [{ type: i0.Input }],
|
15037 | sender: [{ type: i0.Input }],
|
15038 | date: [{ type: i0.Input }],
|
15039 | dateFormat: [{ type: i0.Input }],
|
15040 | latitude: [{ type: i0.Input }],
|
15041 | longitude: [{ type: i0.Input }]
|
15042 | };
|
15043 | return NbChatMessageMapComponent;
|
15044 | }());
|
15045 |
|
15046 |
|
15047 |
|
15048 |
|
15049 |
|
15050 |
|
15051 |
|
15052 |
|
15053 |
|
15054 | var NbChatMessageFileComponent = (function () {
|
15055 | function NbChatMessageFileComponent(cd, domSanitizer) {
|
15056 | this.cd = cd;
|
15057 | this.domSanitizer = domSanitizer;
|
15058 | |
15059 |
|
15060 |
|
15061 |
|
15062 | this.dateFormat = 'shortTime';
|
15063 | }
|
15064 | Object.defineProperty(NbChatMessageFileComponent.prototype, "files", {
|
15065 | |
15066 |
|
15067 |
|
15068 |
|
15069 | set: function (files) {
|
15070 | var _this = this;
|
15071 | this.readyFiles = (files || []).map(function (file) {
|
15072 | var isImage = _this.isImage(file);
|
15073 | return tslib.__assign(tslib.__assign({}, file), { urlStyle: isImage && _this.domSanitizer.bypassSecurityTrustStyle("url(" + file.url + ")"), isImage: isImage });
|
15074 | });
|
15075 | this.cd.detectChanges();
|
15076 | },
|
15077 | enumerable: false,
|
15078 | configurable: true
|
15079 | });
|
15080 | NbChatMessageFileComponent.prototype.isImage = function (file) {
|
15081 | var type = file.type;
|
15082 | if (type) {
|
15083 | return ['image/png', 'image/jpeg', 'image/gif'].includes(type);
|
15084 | }
|
15085 | return false;
|
15086 | };
|
15087 | NbChatMessageFileComponent.decorators = [
|
15088 | { type: i0.Component, args: [{
|
15089 | selector: 'nb-chat-message-file',
|
15090 | template: "\n <nb-chat-message-text [sender]=\"sender\" [date]=\"date\" [dateFormat]=\"dateFormat\" [message]=\"message\">\n {{ message }}\n </nb-chat-message-text>\n\n <ng-container *ngIf=\"readyFiles?.length > 1\">\n <div class=\"message-content-group\">\n <a *ngFor=\"let file of readyFiles\" [href]=\"file.url\" target=\"_blank\">\n <nb-icon [icon]=\"file.icon\" *ngIf=\"!file.urlStyle && file.icon\"></nb-icon>\n <div *ngIf=\"file.urlStyle\" [style.background-image]=\"file.urlStyle\"></div>\n </a>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"readyFiles?.length === 1\">\n <a [href]=\"readyFiles[0].url\" target=\"_blank\">\n <nb-icon [icon]=\"readyFiles[0].icon\" *ngIf=\"!readyFiles[0].urlStyle && readyFiles[0].icon\"></nb-icon>\n <div *ngIf=\"readyFiles[0].urlStyle\" [style.background-image]=\"readyFiles[0].urlStyle\"></div>\n </a>\n </ng-container>\n ",
|
15091 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
15092 | },] }
|
15093 | ];
|
15094 | NbChatMessageFileComponent.ctorParameters = function () { return [
|
15095 | { type: i0.ChangeDetectorRef },
|
15096 | { type: _angular_platformBrowser.DomSanitizer }
|
15097 | ]; };
|
15098 | NbChatMessageFileComponent.propDecorators = {
|
15099 | message: [{ type: i0.Input }],
|
15100 | sender: [{ type: i0.Input }],
|
15101 | date: [{ type: i0.Input }],
|
15102 | dateFormat: [{ type: i0.Input }],
|
15103 | files: [{ type: i0.Input }]
|
15104 | };
|
15105 | return NbChatMessageFileComponent;
|
15106 | }());
|
15107 |
|
15108 |
|
15109 |
|
15110 |
|
15111 |
|
15112 |
|
15113 |
|
15114 |
|
15115 |
|
15116 | var NbChatMessageQuoteComponent = (function () {
|
15117 | function NbChatMessageQuoteComponent() {
|
15118 | |
15119 |
|
15120 |
|
15121 |
|
15122 | this.dateFormat = 'shortTime';
|
15123 | }
|
15124 | NbChatMessageQuoteComponent.decorators = [
|
15125 | { type: i0.Component, args: [{
|
15126 | selector: 'nb-chat-message-quote',
|
15127 | template: "\n <p class=\"sender\" *ngIf=\"sender || date\">{{ sender }} <time>{{ date | date: dateFormat }}</time></p>\n <p class=\"quote\">\n {{ quote }}\n </p>\n <nb-chat-message-text [message]=\"message\">\n {{ message }}\n </nb-chat-message-text>\n ",
|
15128 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
15129 | },] }
|
15130 | ];
|
15131 | NbChatMessageQuoteComponent.propDecorators = {
|
15132 | message: [{ type: i0.Input }],
|
15133 | sender: [{ type: i0.Input }],
|
15134 | date: [{ type: i0.Input }],
|
15135 | dateFormat: [{ type: i0.Input }],
|
15136 | quote: [{ type: i0.Input }]
|
15137 | };
|
15138 | return NbChatMessageQuoteComponent;
|
15139 | }());
|
15140 |
|
15141 |
|
15142 |
|
15143 |
|
15144 |
|
15145 |
|
15146 |
|
15147 |
|
15148 |
|
15149 | var NbChatMessageTextComponent = (function () {
|
15150 | function NbChatMessageTextComponent() {
|
15151 | |
15152 |
|
15153 |
|
15154 |
|
15155 | this.dateFormat = 'shortTime';
|
15156 | }
|
15157 | NbChatMessageTextComponent.decorators = [
|
15158 | { type: i0.Component, args: [{
|
15159 | selector: 'nb-chat-message-text',
|
15160 | template: "\n <p class=\"sender\" *ngIf=\"sender || date\">{{ sender }} <time>{{ date | date: dateFormat }}</time></p>\n <p class=\"text\" *ngIf=\"message\">{{ message }}</p>\n ",
|
15161 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
15162 | },] }
|
15163 | ];
|
15164 | NbChatMessageTextComponent.propDecorators = {
|
15165 | sender: [{ type: i0.Input }],
|
15166 | message: [{ type: i0.Input }],
|
15167 | date: [{ type: i0.Input }],
|
15168 | dateFormat: [{ type: i0.Input }]
|
15169 | };
|
15170 | return NbChatMessageTextComponent;
|
15171 | }());
|
15172 |
|
15173 |
|
15174 |
|
15175 |
|
15176 |
|
15177 |
|
15178 |
|
15179 |
|
15180 |
|
15181 | var NbFormFieldControl = (function () {
|
15182 | function NbFormFieldControl() {
|
15183 | }
|
15184 | NbFormFieldControl.decorators = [
|
15185 | { type: i0.Injectable }
|
15186 | ];
|
15187 | return NbFormFieldControl;
|
15188 | }());
|
15189 |
|
15190 |
|
15191 |
|
15192 | var NbFormFieldControlConfig = (function () {
|
15193 | function NbFormFieldControlConfig() {
|
15194 | this.supportsPrefix = true;
|
15195 | this.supportsSuffix = true;
|
15196 | }
|
15197 | NbFormFieldControlConfig.decorators = [
|
15198 | { type: i0.Injectable }
|
15199 | ];
|
15200 | return NbFormFieldControlConfig;
|
15201 | }());
|
15202 |
|
15203 |
|
15204 |
|
15205 |
|
15206 |
|
15207 |
|
15208 |
|
15209 |
|
15210 |
|
15211 |
|
15212 |
|
15213 |
|
15214 |
|
15215 |
|
15216 |
|
15217 |
|
15218 |
|
15219 |
|
15220 |
|
15221 |
|
15222 |
|
15223 |
|
15224 |
|
15225 |
|
15226 |
|
15227 |
|
15228 |
|
15229 |
|
15230 |
|
15231 |
|
15232 |
|
15233 |
|
15234 |
|
15235 |
|
15236 |
|
15237 |
|
15238 |
|
15239 |
|
15240 |
|
15241 |
|
15242 |
|
15243 |
|
15244 |
|
15245 |
|
15246 |
|
15247 |
|
15248 |
|
15249 |
|
15250 |
|
15251 |
|
15252 |
|
15253 |
|
15254 |
|
15255 |
|
15256 |
|
15257 |
|
15258 |
|
15259 |
|
15260 |
|
15261 |
|
15262 |
|
15263 |
|
15264 |
|
15265 |
|
15266 |
|
15267 |
|
15268 |
|
15269 |
|
15270 |
|
15271 |
|
15272 |
|
15273 |
|
15274 |
|
15275 |
|
15276 |
|
15277 |
|
15278 |
|
15279 |
|
15280 |
|
15281 |
|
15282 |
|
15283 |
|
15284 |
|
15285 |
|
15286 |
|
15287 |
|
15288 |
|
15289 |
|
15290 |
|
15291 |
|
15292 |
|
15293 |
|
15294 |
|
15295 |
|
15296 |
|
15297 |
|
15298 |
|
15299 |
|
15300 |
|
15301 |
|
15302 |
|
15303 |
|
15304 |
|
15305 |
|
15306 |
|
15307 |
|
15308 |
|
15309 |
|
15310 |
|
15311 |
|
15312 |
|
15313 |
|
15314 |
|
15315 |
|
15316 |
|
15317 |
|
15318 |
|
15319 |
|
15320 |
|
15321 |
|
15322 |
|
15323 |
|
15324 |
|
15325 |
|
15326 |
|
15327 |
|
15328 |
|
15329 |
|
15330 |
|
15331 |
|
15332 |
|
15333 |
|
15334 |
|
15335 |
|
15336 |
|
15337 |
|
15338 |
|
15339 |
|
15340 |
|
15341 |
|
15342 |
|
15343 |
|
15344 |
|
15345 |
|
15346 |
|
15347 |
|
15348 |
|
15349 |
|
15350 |
|
15351 |
|
15352 |
|
15353 |
|
15354 |
|
15355 |
|
15356 |
|
15357 |
|
15358 |
|
15359 |
|
15360 |
|
15361 |
|
15362 |
|
15363 |
|
15364 |
|
15365 |
|
15366 |
|
15367 |
|
15368 |
|
15369 |
|
15370 |
|
15371 |
|
15372 |
|
15373 |
|
15374 |
|
15375 |
|
15376 |
|
15377 |
|
15378 |
|
15379 |
|
15380 |
|
15381 |
|
15382 |
|
15383 |
|
15384 |
|
15385 |
|
15386 |
|
15387 |
|
15388 |
|
15389 |
|
15390 |
|
15391 |
|
15392 |
|
15393 |
|
15394 |
|
15395 | var NbInputDirective = (function () {
|
15396 | function NbInputDirective(elementRef, focusMonitor, renderer, zone, statusService) {
|
15397 | this.elementRef = elementRef;
|
15398 | this.focusMonitor = focusMonitor;
|
15399 | this.renderer = renderer;
|
15400 | this.zone = zone;
|
15401 | this.statusService = statusService;
|
15402 | this.destroy$ = new rxjs.Subject();
|
15403 | |
15404 |
|
15405 |
|
15406 | this.fieldSize = 'medium';
|
15407 | |
15408 |
|
15409 |
|
15410 |
|
15411 | this.status = 'basic';
|
15412 | |
15413 |
|
15414 |
|
15415 | this.shape = 'rectangle';
|
15416 | this._fullWidth = false;
|
15417 | |
15418 |
|
15419 |
|
15420 | this.status$ = new rxjs.BehaviorSubject(this.status);
|
15421 | |
15422 |
|
15423 |
|
15424 | this.size$ = new rxjs.BehaviorSubject(this.fieldSize);
|
15425 | |
15426 |
|
15427 |
|
15428 | this.focused$ = new rxjs.BehaviorSubject(false);
|
15429 | |
15430 |
|
15431 |
|
15432 | this.disabled$ = new rxjs.BehaviorSubject(false);
|
15433 | |
15434 |
|
15435 |
|
15436 | this.fullWidth$ = new rxjs.BehaviorSubject(this.fullWidth);
|
15437 | }
|
15438 | Object.defineProperty(NbInputDirective.prototype, "fullWidth", {
|
15439 | |
15440 |
|
15441 |
|
15442 | get: function () {
|
15443 | return this._fullWidth;
|
15444 | },
|
15445 | set: function (value) {
|
15446 | this._fullWidth = convertToBoolProperty(value);
|
15447 | },
|
15448 | enumerable: false,
|
15449 | configurable: true
|
15450 | });
|
15451 | Object.defineProperty(NbInputDirective.prototype, "additionalClasses", {
|
15452 | get: function () {
|
15453 | if (this.statusService.isCustomStatus(this.status)) {
|
15454 | return [this.statusService.getStatusClass(this.status)];
|
15455 | }
|
15456 | return [];
|
15457 | },
|
15458 | enumerable: false,
|
15459 | configurable: true
|
15460 | });
|
15461 | NbInputDirective.prototype.ngDoCheck = function () {
|
15462 | var isDisabled = this.elementRef.nativeElement.disabled;
|
15463 | if (isDisabled !== this.disabled$.value) {
|
15464 | this.disabled$.next(isDisabled);
|
15465 | }
|
15466 | };
|
15467 | NbInputDirective.prototype.ngOnChanges = function (_a) {
|
15468 | var status = _a.status, fieldSize = _a.fieldSize, fullWidth = _a.fullWidth;
|
15469 | if (status) {
|
15470 | this.status$.next(this.status);
|
15471 | }
|
15472 | if (fieldSize) {
|
15473 | this.size$.next(this.fieldSize);
|
15474 | }
|
15475 | if (fullWidth) {
|
15476 | this.fullWidth$.next(this.fullWidth);
|
15477 | }
|
15478 | };
|
15479 | NbInputDirective.prototype.ngOnInit = function () {
|
15480 | var _this = this;
|
15481 | this.focusMonitor.monitor(this.elementRef)
|
15482 | .pipe(rxjs_operators.map(function (origin) { return !!origin; }), rxjs_operators.finalize(function () { return _this.focusMonitor.stopMonitoring(_this.elementRef); }), rxjs_operators.takeUntil(this.destroy$))
|
15483 | .subscribe(this.focused$);
|
15484 | };
|
15485 | NbInputDirective.prototype.ngAfterViewInit = function () {
|
15486 | var _this = this;
|
15487 |
|
15488 | this.zone.runOutsideAngular(function () { return setTimeout(function () {
|
15489 | _this.renderer.addClass(_this.elementRef.nativeElement, 'nb-transition');
|
15490 | }); });
|
15491 | };
|
15492 | NbInputDirective.prototype.ngOnDestroy = function () {
|
15493 | this.destroy$.next();
|
15494 | };
|
15495 | Object.defineProperty(NbInputDirective.prototype, "tiny", {
|
15496 | get: function () {
|
15497 | return this.fieldSize === 'tiny';
|
15498 | },
|
15499 | enumerable: false,
|
15500 | configurable: true
|
15501 | });
|
15502 | Object.defineProperty(NbInputDirective.prototype, "small", {
|
15503 | get: function () {
|
15504 | return this.fieldSize === 'small';
|
15505 | },
|
15506 | enumerable: false,
|
15507 | configurable: true
|
15508 | });
|
15509 | Object.defineProperty(NbInputDirective.prototype, "medium", {
|
15510 | get: function () {
|
15511 | return this.fieldSize === 'medium';
|
15512 | },
|
15513 | enumerable: false,
|
15514 | configurable: true
|
15515 | });
|
15516 | Object.defineProperty(NbInputDirective.prototype, "large", {
|
15517 | get: function () {
|
15518 | return this.fieldSize === 'large';
|
15519 | },
|
15520 | enumerable: false,
|
15521 | configurable: true
|
15522 | });
|
15523 | Object.defineProperty(NbInputDirective.prototype, "giant", {
|
15524 | get: function () {
|
15525 | return this.fieldSize === 'giant';
|
15526 | },
|
15527 | enumerable: false,
|
15528 | configurable: true
|
15529 | });
|
15530 | Object.defineProperty(NbInputDirective.prototype, "primary", {
|
15531 | get: function () {
|
15532 | return this.status === 'primary';
|
15533 | },
|
15534 | enumerable: false,
|
15535 | configurable: true
|
15536 | });
|
15537 | Object.defineProperty(NbInputDirective.prototype, "info", {
|
15538 | get: function () {
|
15539 | return this.status === 'info';
|
15540 | },
|
15541 | enumerable: false,
|
15542 | configurable: true
|
15543 | });
|
15544 | Object.defineProperty(NbInputDirective.prototype, "success", {
|
15545 | get: function () {
|
15546 | return this.status === 'success';
|
15547 | },
|
15548 | enumerable: false,
|
15549 | configurable: true
|
15550 | });
|
15551 | Object.defineProperty(NbInputDirective.prototype, "warning", {
|
15552 | get: function () {
|
15553 | return this.status === 'warning';
|
15554 | },
|
15555 | enumerable: false,
|
15556 | configurable: true
|
15557 | });
|
15558 | Object.defineProperty(NbInputDirective.prototype, "danger", {
|
15559 | get: function () {
|
15560 | return this.status === 'danger';
|
15561 | },
|
15562 | enumerable: false,
|
15563 | configurable: true
|
15564 | });
|
15565 | Object.defineProperty(NbInputDirective.prototype, "basic", {
|
15566 | get: function () {
|
15567 | return this.status === 'basic';
|
15568 | },
|
15569 | enumerable: false,
|
15570 | configurable: true
|
15571 | });
|
15572 | Object.defineProperty(NbInputDirective.prototype, "control", {
|
15573 | get: function () {
|
15574 | return this.status === 'control';
|
15575 | },
|
15576 | enumerable: false,
|
15577 | configurable: true
|
15578 | });
|
15579 | Object.defineProperty(NbInputDirective.prototype, "rectangle", {
|
15580 | get: function () {
|
15581 | return this.shape === 'rectangle';
|
15582 | },
|
15583 | enumerable: false,
|
15584 | configurable: true
|
15585 | });
|
15586 | Object.defineProperty(NbInputDirective.prototype, "semiRound", {
|
15587 | get: function () {
|
15588 | return this.shape === 'semi-round';
|
15589 | },
|
15590 | enumerable: false,
|
15591 | configurable: true
|
15592 | });
|
15593 | Object.defineProperty(NbInputDirective.prototype, "round", {
|
15594 | get: function () {
|
15595 | return this.shape === 'round';
|
15596 | },
|
15597 | enumerable: false,
|
15598 | configurable: true
|
15599 | });
|
15600 | NbInputDirective.decorators = [
|
15601 | { type: i0.Directive, args: [{
|
15602 | selector: 'input[nbInput],textarea[nbInput]',
|
15603 | providers: [
|
15604 | { provide: NbFormFieldControl, useExisting: NbInputDirective },
|
15605 | ],
|
15606 | },] }
|
15607 | ];
|
15608 | NbInputDirective.ctorParameters = function () { return [
|
15609 | { type: i0.ElementRef },
|
15610 | { type: NbFocusMonitor },
|
15611 | { type: i0.Renderer2 },
|
15612 | { type: i0.NgZone },
|
15613 | { type: NbStatusService }
|
15614 | ]; };
|
15615 | NbInputDirective.propDecorators = {
|
15616 | fieldSize: [{ type: i0.Input }],
|
15617 | status: [{ type: i0.Input }],
|
15618 | shape: [{ type: i0.Input }],
|
15619 | fullWidth: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.input-full-width',] }],
|
15620 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }],
|
15621 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
15622 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
15623 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
15624 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
15625 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }],
|
15626 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
15627 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
15628 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
15629 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
15630 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
15631 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
15632 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
15633 | rectangle: [{ type: i0.HostBinding, args: ['class.shape-rectangle',] }],
|
15634 | semiRound: [{ type: i0.HostBinding, args: ['class.shape-semi-round',] }],
|
15635 | round: [{ type: i0.HostBinding, args: ['class.shape-round',] }]
|
15636 | };
|
15637 | return NbInputDirective;
|
15638 | }());
|
15639 |
|
15640 |
|
15641 |
|
15642 |
|
15643 |
|
15644 |
|
15645 | var NB_INPUT_COMPONENTS = [
|
15646 | NbInputDirective,
|
15647 | ];
|
15648 | var NbInputModule = (function () {
|
15649 | function NbInputModule() {
|
15650 | }
|
15651 | NbInputModule.decorators = [
|
15652 | { type: i0.NgModule, args: [{
|
15653 | imports: [NbSharedModule],
|
15654 | declarations: NB_INPUT_COMPONENTS,
|
15655 | exports: NB_INPUT_COMPONENTS,
|
15656 | },] }
|
15657 | ];
|
15658 | return NbInputModule;
|
15659 | }());
|
15660 |
|
15661 | var NbChatAvatarComponent = (function () {
|
15662 | function NbChatAvatarComponent() {
|
15663 | this.avatarClass = true;
|
15664 | }
|
15665 | NbChatAvatarComponent.decorators = [
|
15666 | { type: i0.Component, args: [{
|
15667 | selector: 'nb-chat-avatar',
|
15668 | template: "\n <ng-container *ngIf=\"!avatarStyle\">\n {{ initials }}\n </ng-container>\n ",
|
15669 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
15670 | },] }
|
15671 | ];
|
15672 | NbChatAvatarComponent.propDecorators = {
|
15673 | initials: [{ type: i0.Input }],
|
15674 | avatarStyle: [{ type: i0.Input }, { type: i0.HostBinding, args: ['style.background-image',] }],
|
15675 | avatarClass: [{ type: i0.HostBinding, args: ['class.avatar',] }]
|
15676 | };
|
15677 | return NbChatAvatarComponent;
|
15678 | }());
|
15679 |
|
15680 | function throwCustomMessageTypeIsRequired() {
|
15681 | throw new Error('[nbCustomMessage]: custom message type is required.');
|
15682 | }
|
15683 |
|
15684 |
|
15685 |
|
15686 |
|
15687 |
|
15688 |
|
15689 |
|
15690 |
|
15691 |
|
15692 |
|
15693 |
|
15694 |
|
15695 |
|
15696 |
|
15697 |
|
15698 | var NbChatCustomMessageDirective = (function () {
|
15699 | function NbChatCustomMessageDirective(templateRef, customMessageService) {
|
15700 | this.templateRef = templateRef;
|
15701 | this.customMessageService = customMessageService;
|
15702 | this._noStyles = false;
|
15703 | }
|
15704 | Object.defineProperty(NbChatCustomMessageDirective.prototype, "nbCustomMessage", {
|
15705 | |
15706 |
|
15707 |
|
15708 |
|
15709 | get: function () {
|
15710 | return this._type;
|
15711 | },
|
15712 | set: function (value) {
|
15713 | this._type = value;
|
15714 | },
|
15715 | enumerable: false,
|
15716 | configurable: true
|
15717 | });
|
15718 | Object.defineProperty(NbChatCustomMessageDirective.prototype, "type", {
|
15719 | get: function () {
|
15720 | return this._type;
|
15721 | },
|
15722 | enumerable: false,
|
15723 | configurable: true
|
15724 | });
|
15725 | Object.defineProperty(NbChatCustomMessageDirective.prototype, "nbCustomMessageNoStyles", {
|
15726 | get: function () {
|
15727 | return this._noStyles;
|
15728 | },
|
15729 | |
15730 |
|
15731 |
|
15732 |
|
15733 |
|
15734 |
|
15735 | set: function (value) {
|
15736 | this._noStyles = convertToBoolProperty(value);
|
15737 | },
|
15738 | enumerable: false,
|
15739 | configurable: true
|
15740 | });
|
15741 | Object.defineProperty(NbChatCustomMessageDirective.prototype, "noStyles", {
|
15742 | get: function () {
|
15743 | return this.nbCustomMessageNoStyles;
|
15744 | },
|
15745 | enumerable: false,
|
15746 | configurable: true
|
15747 | });
|
15748 | NbChatCustomMessageDirective.prototype.ngOnInit = function () {
|
15749 | if (!this._type) {
|
15750 | throwCustomMessageTypeIsRequired();
|
15751 | }
|
15752 | this.customMessageService.register(this.type, this);
|
15753 | };
|
15754 | NbChatCustomMessageDirective.prototype.ngOnDestroy = function () {
|
15755 | this.customMessageService.unregister(this.type);
|
15756 | };
|
15757 | NbChatCustomMessageDirective.decorators = [
|
15758 | { type: i0.Directive, args: [{
|
15759 | selector: "[nbCustomMessage]",
|
15760 | },] }
|
15761 | ];
|
15762 | NbChatCustomMessageDirective.ctorParameters = function () { return [
|
15763 | { type: i0.TemplateRef },
|
15764 | { type: NbCustomMessageService }
|
15765 | ]; };
|
15766 | NbChatCustomMessageDirective.propDecorators = {
|
15767 | nbCustomMessage: [{ type: i0.Input }],
|
15768 | nbCustomMessageNoStyles: [{ type: i0.Input }]
|
15769 | };
|
15770 | return NbChatCustomMessageDirective;
|
15771 | }());
|
15772 |
|
15773 |
|
15774 |
|
15775 |
|
15776 |
|
15777 |
|
15778 | var NB_CHAT_COMPONENTS = [
|
15779 | NbChatComponent,
|
15780 | NbChatMessageComponent,
|
15781 | NbChatFormComponent,
|
15782 | NbChatMessageTextComponent,
|
15783 | NbChatMessageFileComponent,
|
15784 | NbChatMessageQuoteComponent,
|
15785 | NbChatMessageMapComponent,
|
15786 | NbChatAvatarComponent,
|
15787 | ];
|
15788 | var NB_CHAT_DIRECTIVES = [
|
15789 | NbChatCustomMessageDirective,
|
15790 | ];
|
15791 | var NbChatModule = (function () {
|
15792 | function NbChatModule() {
|
15793 | }
|
15794 | NbChatModule.forRoot = function (options) {
|
15795 | return {
|
15796 | ngModule: NbChatModule,
|
15797 | providers: [
|
15798 | { provide: NbChatOptions, useValue: options || {} },
|
15799 | ],
|
15800 | };
|
15801 | };
|
15802 | NbChatModule.forChild = function (options) {
|
15803 | return {
|
15804 | ngModule: NbChatModule,
|
15805 | providers: [
|
15806 | { provide: NbChatOptions, useValue: options || {} },
|
15807 | ],
|
15808 | };
|
15809 | };
|
15810 | NbChatModule.decorators = [
|
15811 | { type: i0.NgModule, args: [{
|
15812 | imports: [
|
15813 | NbSharedModule,
|
15814 | NbIconModule,
|
15815 | NbInputModule,
|
15816 | NbButtonModule,
|
15817 | ],
|
15818 | declarations: tslib.__spreadArray(tslib.__spreadArray([], NB_CHAT_COMPONENTS), NB_CHAT_DIRECTIVES),
|
15819 | exports: tslib.__spreadArray(tslib.__spreadArray([], NB_CHAT_COMPONENTS), NB_CHAT_DIRECTIVES),
|
15820 | },] }
|
15821 | ];
|
15822 | return NbChatModule;
|
15823 | }());
|
15824 |
|
15825 |
|
15826 |
|
15827 |
|
15828 |
|
15829 |
|
15830 |
|
15831 |
|
15832 |
|
15833 |
|
15834 |
|
15835 |
|
15836 |
|
15837 |
|
15838 |
|
15839 |
|
15840 |
|
15841 |
|
15842 |
|
15843 |
|
15844 |
|
15845 |
|
15846 |
|
15847 |
|
15848 |
|
15849 |
|
15850 |
|
15851 |
|
15852 |
|
15853 |
|
15854 |
|
15855 |
|
15856 |
|
15857 |
|
15858 |
|
15859 |
|
15860 |
|
15861 |
|
15862 |
|
15863 |
|
15864 |
|
15865 |
|
15866 |
|
15867 | var NbSpinnerComponent = (function () {
|
15868 | function NbSpinnerComponent(statusService) {
|
15869 | this.statusService = statusService;
|
15870 | |
15871 |
|
15872 |
|
15873 |
|
15874 | this.message = 'Loading...';
|
15875 | |
15876 |
|
15877 |
|
15878 |
|
15879 |
|
15880 | this.size = 'medium';
|
15881 | |
15882 |
|
15883 |
|
15884 |
|
15885 | this.status = 'basic';
|
15886 | }
|
15887 | Object.defineProperty(NbSpinnerComponent.prototype, "tiny", {
|
15888 | get: function () {
|
15889 | return this.size === 'tiny';
|
15890 | },
|
15891 | enumerable: false,
|
15892 | configurable: true
|
15893 | });
|
15894 | Object.defineProperty(NbSpinnerComponent.prototype, "small", {
|
15895 | get: function () {
|
15896 | return this.size === 'small';
|
15897 | },
|
15898 | enumerable: false,
|
15899 | configurable: true
|
15900 | });
|
15901 | Object.defineProperty(NbSpinnerComponent.prototype, "medium", {
|
15902 | get: function () {
|
15903 | return this.size === 'medium';
|
15904 | },
|
15905 | enumerable: false,
|
15906 | configurable: true
|
15907 | });
|
15908 | Object.defineProperty(NbSpinnerComponent.prototype, "large", {
|
15909 | get: function () {
|
15910 | return this.size === 'large';
|
15911 | },
|
15912 | enumerable: false,
|
15913 | configurable: true
|
15914 | });
|
15915 | Object.defineProperty(NbSpinnerComponent.prototype, "giant", {
|
15916 | get: function () {
|
15917 | return this.size === 'giant';
|
15918 | },
|
15919 | enumerable: false,
|
15920 | configurable: true
|
15921 | });
|
15922 | Object.defineProperty(NbSpinnerComponent.prototype, "primary", {
|
15923 | get: function () {
|
15924 | return this.status === 'primary';
|
15925 | },
|
15926 | enumerable: false,
|
15927 | configurable: true
|
15928 | });
|
15929 | Object.defineProperty(NbSpinnerComponent.prototype, "info", {
|
15930 | get: function () {
|
15931 | return this.status === 'info';
|
15932 | },
|
15933 | enumerable: false,
|
15934 | configurable: true
|
15935 | });
|
15936 | Object.defineProperty(NbSpinnerComponent.prototype, "success", {
|
15937 | get: function () {
|
15938 | return this.status === 'success';
|
15939 | },
|
15940 | enumerable: false,
|
15941 | configurable: true
|
15942 | });
|
15943 | Object.defineProperty(NbSpinnerComponent.prototype, "warning", {
|
15944 | get: function () {
|
15945 | return this.status === 'warning';
|
15946 | },
|
15947 | enumerable: false,
|
15948 | configurable: true
|
15949 | });
|
15950 | Object.defineProperty(NbSpinnerComponent.prototype, "danger", {
|
15951 | get: function () {
|
15952 | return this.status === 'danger';
|
15953 | },
|
15954 | enumerable: false,
|
15955 | configurable: true
|
15956 | });
|
15957 | Object.defineProperty(NbSpinnerComponent.prototype, "basic", {
|
15958 | get: function () {
|
15959 | return this.status === 'basic';
|
15960 | },
|
15961 | enumerable: false,
|
15962 | configurable: true
|
15963 | });
|
15964 | Object.defineProperty(NbSpinnerComponent.prototype, "control", {
|
15965 | get: function () {
|
15966 | return this.status === 'control';
|
15967 | },
|
15968 | enumerable: false,
|
15969 | configurable: true
|
15970 | });
|
15971 | Object.defineProperty(NbSpinnerComponent.prototype, "additionalClasses", {
|
15972 | get: function () {
|
15973 | if (this.statusService.isCustomStatus(this.status)) {
|
15974 | return [this.statusService.getStatusClass(this.status)];
|
15975 | }
|
15976 | return [];
|
15977 | },
|
15978 | enumerable: false,
|
15979 | configurable: true
|
15980 | });
|
15981 | NbSpinnerComponent.decorators = [
|
15982 | { type: i0.Component, args: [{
|
15983 | selector: 'nb-spinner',
|
15984 | template: "\n <span class=\"spin-circle\"></span>\n <span class=\"message\" *ngIf=\"message\">{{ message }}</span>\n ",
|
15985 | styles: [":host{opacity:1;position:absolute;border-radius:inherit;top:0;right:0;left:0;bottom:0;overflow:hidden;z-index:9999;display:flex;justify-content:center;align-items:center;visibility:visible}:host .spin-circle{animation:spin 0.8s infinite linear;border-radius:50%;border-style:solid;border-width:0.125em;width:1em;height:1em}:host .message{margin-left:0.5rem}\n"]
|
15986 | },] }
|
15987 | ];
|
15988 | NbSpinnerComponent.ctorParameters = function () { return [
|
15989 | { type: NbStatusService }
|
15990 | ]; };
|
15991 | NbSpinnerComponent.propDecorators = {
|
15992 | message: [{ type: i0.Input }],
|
15993 | size: [{ type: i0.Input }],
|
15994 | status: [{ type: i0.Input }],
|
15995 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
15996 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
15997 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
15998 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
15999 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }],
|
16000 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
16001 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
16002 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
16003 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
16004 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
16005 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
16006 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
16007 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }]
|
16008 | };
|
16009 | return NbSpinnerComponent;
|
16010 | }());
|
16011 |
|
16012 |
|
16013 |
|
16014 |
|
16015 |
|
16016 |
|
16017 |
|
16018 |
|
16019 |
|
16020 |
|
16021 |
|
16022 |
|
16023 |
|
16024 |
|
16025 |
|
16026 |
|
16027 |
|
16028 |
|
16029 |
|
16030 |
|
16031 |
|
16032 |
|
16033 |
|
16034 |
|
16035 |
|
16036 |
|
16037 |
|
16038 |
|
16039 |
|
16040 |
|
16041 |
|
16042 |
|
16043 |
|
16044 |
|
16045 |
|
16046 |
|
16047 |
|
16048 |
|
16049 |
|
16050 |
|
16051 |
|
16052 |
|
16053 |
|
16054 |
|
16055 |
|
16056 |
|
16057 | var NbSpinnerDirective = (function () {
|
16058 | function NbSpinnerDirective(directiveView, componentFactoryResolver, renderer, directiveElement) {
|
16059 | this.directiveView = directiveView;
|
16060 | this.componentFactoryResolver = componentFactoryResolver;
|
16061 | this.renderer = renderer;
|
16062 | this.directiveElement = directiveElement;
|
16063 | this.shouldShow = false;
|
16064 | |
16065 |
|
16066 |
|
16067 |
|
16068 | this.spinnerStatus = 'basic';
|
16069 | |
16070 |
|
16071 |
|
16072 | this.spinnerSize = 'medium';
|
16073 | this.isSpinnerExist = false;
|
16074 | }
|
16075 | Object.defineProperty(NbSpinnerDirective.prototype, "nbSpinner", {
|
16076 | |
16077 |
|
16078 |
|
16079 |
|
16080 | set: function (val) {
|
16081 | if (this.componentFactory) {
|
16082 | if (val) {
|
16083 | this.show();
|
16084 | }
|
16085 | else {
|
16086 | this.hide();
|
16087 | }
|
16088 | }
|
16089 | else {
|
16090 | this.shouldShow = val;
|
16091 | }
|
16092 | },
|
16093 | enumerable: false,
|
16094 | configurable: true
|
16095 | });
|
16096 | NbSpinnerDirective.prototype.ngOnInit = function () {
|
16097 | this.componentFactory = this.componentFactoryResolver.resolveComponentFactory(NbSpinnerComponent);
|
16098 | if (this.shouldShow) {
|
16099 | this.show();
|
16100 | }
|
16101 | };
|
16102 | NbSpinnerDirective.prototype.hide = function () {
|
16103 | if (this.isSpinnerExist) {
|
16104 | this.directiveView.remove();
|
16105 | this.isSpinnerExist = false;
|
16106 | }
|
16107 | };
|
16108 | NbSpinnerDirective.prototype.show = function () {
|
16109 | if (!this.isSpinnerExist) {
|
16110 | this.spinner = this.directiveView.createComponent(this.componentFactory);
|
16111 | this.setInstanceInputs(this.spinner.instance);
|
16112 | this.spinner.changeDetectorRef.detectChanges();
|
16113 | this.renderer.appendChild(this.directiveElement.nativeElement, this.spinner.location.nativeElement);
|
16114 | this.isSpinnerExist = true;
|
16115 | }
|
16116 | };
|
16117 | NbSpinnerDirective.prototype.setInstanceInputs = function (instance) {
|
16118 | instance.message = this.spinnerMessage;
|
16119 | typeof this.spinnerStatus !== 'undefined' && (instance.status = this.spinnerStatus);
|
16120 | typeof this.spinnerSize !== 'undefined' && (instance.size = this.spinnerSize);
|
16121 | };
|
16122 | NbSpinnerDirective.decorators = [
|
16123 | { type: i0.Directive, args: [{ selector: '[nbSpinner]' },] }
|
16124 | ];
|
16125 | NbSpinnerDirective.ctorParameters = function () { return [
|
16126 | { type: i0.ViewContainerRef },
|
16127 | { type: i0.ComponentFactoryResolver },
|
16128 | { type: i0.Renderer2 },
|
16129 | { type: i0.ElementRef }
|
16130 | ]; };
|
16131 | NbSpinnerDirective.propDecorators = {
|
16132 | spinnerMessage: [{ type: i0.Input, args: ['nbSpinnerMessage',] }],
|
16133 | spinnerStatus: [{ type: i0.Input, args: ['nbSpinnerStatus',] }],
|
16134 | spinnerSize: [{ type: i0.Input, args: ['nbSpinnerSize',] }],
|
16135 | nbSpinner: [{ type: i0.Input, args: ['nbSpinner',] }],
|
16136 | isSpinnerExist: [{ type: i0.HostBinding, args: ['class.nb-spinner-container',] }]
|
16137 | };
|
16138 | return NbSpinnerDirective;
|
16139 | }());
|
16140 |
|
16141 |
|
16142 |
|
16143 |
|
16144 |
|
16145 |
|
16146 | var NbSpinnerModule = (function () {
|
16147 | function NbSpinnerModule() {
|
16148 | }
|
16149 | NbSpinnerModule.decorators = [
|
16150 | { type: i0.NgModule, args: [{
|
16151 | imports: [
|
16152 | NbSharedModule,
|
16153 | ],
|
16154 | exports: [NbSpinnerComponent, NbSpinnerDirective],
|
16155 | declarations: [NbSpinnerComponent, NbSpinnerDirective],
|
16156 | entryComponents: [NbSpinnerComponent],
|
16157 | },] }
|
16158 | ];
|
16159 | return NbSpinnerModule;
|
16160 | }());
|
16161 |
|
16162 | var NB_STEPPER = new i0.InjectionToken('Nebular Stepper Component');
|
16163 |
|
16164 |
|
16165 |
|
16166 |
|
16167 |
|
16168 | var NbStepComponent = (function () {
|
16169 | function NbStepComponent(stepper) {
|
16170 | this._hidden = false;
|
16171 | this._completed = false;
|
16172 | this.interacted = false;
|
16173 | this.stepper = stepper;
|
16174 | }
|
16175 | Object.defineProperty(NbStepComponent.prototype, "hidden", {
|
16176 | |
16177 |
|
16178 |
|
16179 |
|
16180 |
|
16181 | get: function () {
|
16182 | return this._hidden;
|
16183 | },
|
16184 | set: function (value) {
|
16185 | this._hidden = convertToBoolProperty(value);
|
16186 | },
|
16187 | enumerable: false,
|
16188 | configurable: true
|
16189 | });
|
16190 | Object.defineProperty(NbStepComponent.prototype, "isLabelTemplate", {
|
16191 | |
16192 |
|
16193 |
|
16194 |
|
16195 |
|
16196 | get: function () {
|
16197 | return this.label instanceof i0.TemplateRef;
|
16198 | },
|
16199 | enumerable: false,
|
16200 | configurable: true
|
16201 | });
|
16202 | Object.defineProperty(NbStepComponent.prototype, "completed", {
|
16203 | |
16204 |
|
16205 |
|
16206 |
|
16207 |
|
16208 | get: function () {
|
16209 | return this._completed || this.isCompleted;
|
16210 | },
|
16211 | set: function (value) {
|
16212 | this._completed = convertToBoolProperty(value);
|
16213 | },
|
16214 | enumerable: false,
|
16215 | configurable: true
|
16216 | });
|
16217 | Object.defineProperty(NbStepComponent.prototype, "isCompleted", {
|
16218 | get: function () {
|
16219 | return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;
|
16220 | },
|
16221 | enumerable: false,
|
16222 | configurable: true
|
16223 | });
|
16224 | |
16225 |
|
16226 |
|
16227 | NbStepComponent.prototype.select = function () {
|
16228 | this.stepper.selected = this;
|
16229 | };
|
16230 | |
16231 |
|
16232 |
|
16233 | NbStepComponent.prototype.reset = function () {
|
16234 | this.interacted = false;
|
16235 | if (this.stepControl) {
|
16236 | this.stepControl.reset();
|
16237 | }
|
16238 | };
|
16239 | NbStepComponent.decorators = [
|
16240 | { type: i0.Component, args: [{
|
16241 | selector: 'nb-step',
|
16242 | template: "\n <ng-template>\n <ng-content></ng-content>\n </ng-template>\n "
|
16243 | },] }
|
16244 | ];
|
16245 | NbStepComponent.ctorParameters = function () { return [
|
16246 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_STEPPER,] }] }
|
16247 | ]; };
|
16248 | NbStepComponent.propDecorators = {
|
16249 | content: [{ type: i0.ViewChild, args: [i0.TemplateRef, { static: true },] }],
|
16250 | stepControl: [{ type: i0.Input }],
|
16251 | label: [{ type: i0.Input }],
|
16252 | hidden: [{ type: i0.Input }],
|
16253 | completed: [{ type: i0.Input }]
|
16254 | };
|
16255 | return NbStepComponent;
|
16256 | }());
|
16257 |
|
16258 |
|
16259 |
|
16260 |
|
16261 |
|
16262 |
|
16263 |
|
16264 |
|
16265 |
|
16266 |
|
16267 |
|
16268 |
|
16269 |
|
16270 |
|
16271 |
|
16272 |
|
16273 |
|
16274 |
|
16275 |
|
16276 |
|
16277 |
|
16278 |
|
16279 |
|
16280 |
|
16281 |
|
16282 |
|
16283 |
|
16284 |
|
16285 |
|
16286 |
|
16287 |
|
16288 |
|
16289 |
|
16290 |
|
16291 |
|
16292 |
|
16293 |
|
16294 |
|
16295 |
|
16296 |
|
16297 |
|
16298 |
|
16299 |
|
16300 |
|
16301 |
|
16302 |
|
16303 |
|
16304 |
|
16305 |
|
16306 |
|
16307 |
|
16308 |
|
16309 |
|
16310 |
|
16311 |
|
16312 |
|
16313 |
|
16314 |
|
16315 |
|
16316 |
|
16317 |
|
16318 |
|
16319 |
|
16320 |
|
16321 |
|
16322 |
|
16323 |
|
16324 |
|
16325 |
|
16326 |
|
16327 |
|
16328 |
|
16329 |
|
16330 |
|
16331 |
|
16332 |
|
16333 |
|
16334 |
|
16335 |
|
16336 |
|
16337 |
|
16338 |
|
16339 |
|
16340 |
|
16341 |
|
16342 |
|
16343 |
|
16344 |
|
16345 |
|
16346 |
|
16347 |
|
16348 |
|
16349 |
|
16350 | var NbStepperComponent = (function () {
|
16351 | function NbStepperComponent() {
|
16352 | this._selectedIndex = 0;
|
16353 | this._disableStepNavigation = false;
|
16354 | |
16355 |
|
16356 |
|
16357 | this.orientation = 'horizontal';
|
16358 | this._linear = true;
|
16359 | }
|
16360 | Object.defineProperty(NbStepperComponent.prototype, "selectedIndex", {
|
16361 | |
16362 |
|
16363 |
|
16364 | get: function () {
|
16365 | return this._selectedIndex;
|
16366 | },
|
16367 | set: function (index) {
|
16368 | if (!this.steps) {
|
16369 | this._selectedIndex = index;
|
16370 | return;
|
16371 | }
|
16372 | this.markCurrentStepInteracted();
|
16373 | if (this.canBeSelected(index)) {
|
16374 | this._selectedIndex = index;
|
16375 | }
|
16376 | },
|
16377 | enumerable: false,
|
16378 | configurable: true
|
16379 | });
|
16380 | Object.defineProperty(NbStepperComponent.prototype, "disableStepNavigation", {
|
16381 | get: function () {
|
16382 | return this._disableStepNavigation;
|
16383 | },
|
16384 | |
16385 |
|
16386 |
|
16387 |
|
16388 | set: function (value) {
|
16389 | this._disableStepNavigation = convertToBoolProperty(value);
|
16390 | },
|
16391 | enumerable: false,
|
16392 | configurable: true
|
16393 | });
|
16394 | Object.defineProperty(NbStepperComponent.prototype, "selected", {
|
16395 | |
16396 |
|
16397 |
|
16398 | get: function () {
|
16399 | return this.steps ? this.steps.toArray()[this.selectedIndex] : undefined;
|
16400 | },
|
16401 | set: function (step) {
|
16402 | if (!this.steps) {
|
16403 | return;
|
16404 | }
|
16405 | this.selectedIndex = this.steps.toArray().indexOf(step);
|
16406 | },
|
16407 | enumerable: false,
|
16408 | configurable: true
|
16409 | });
|
16410 | Object.defineProperty(NbStepperComponent.prototype, "linear", {
|
16411 | get: function () {
|
16412 | return this._linear;
|
16413 | },
|
16414 | |
16415 |
|
16416 |
|
16417 |
|
16418 | set: function (value) {
|
16419 | this._linear = convertToBoolProperty(value);
|
16420 | },
|
16421 | enumerable: false,
|
16422 | configurable: true
|
16423 | });
|
16424 | Object.defineProperty(NbStepperComponent.prototype, "vertical", {
|
16425 | get: function () {
|
16426 | return this.orientation === 'vertical';
|
16427 | },
|
16428 | enumerable: false,
|
16429 | configurable: true
|
16430 | });
|
16431 | Object.defineProperty(NbStepperComponent.prototype, "horizontal", {
|
16432 | get: function () {
|
16433 | return this.orientation === 'horizontal';
|
16434 | },
|
16435 | enumerable: false,
|
16436 | configurable: true
|
16437 | });
|
16438 | |
16439 |
|
16440 |
|
16441 | NbStepperComponent.prototype.next = function () {
|
16442 | this.selectedIndex = Math.min(this.selectedIndex + 1, this.steps.length - 1);
|
16443 | };
|
16444 | |
16445 |
|
16446 |
|
16447 | NbStepperComponent.prototype.previous = function () {
|
16448 | this.selectedIndex = Math.max(this.selectedIndex - 1, 0);
|
16449 | };
|
16450 | |
16451 |
|
16452 |
|
16453 | NbStepperComponent.prototype.reset = function () {
|
16454 | this._selectedIndex = 0;
|
16455 | this.steps.forEach(function (step) { return step.reset(); });
|
16456 | };
|
16457 | NbStepperComponent.prototype.isStepSelected = function (step) {
|
16458 | return this.selected === step;
|
16459 | };
|
16460 | |
16461 |
|
16462 |
|
16463 | NbStepperComponent.prototype.getStepTemplate = function (step) {
|
16464 | if (step.isLabelTemplate) {
|
16465 | return step.label;
|
16466 | }
|
16467 | return null;
|
16468 | };
|
16469 | NbStepperComponent.prototype.isStepValid = function (index) {
|
16470 | return this.steps.toArray()[index].completed;
|
16471 | };
|
16472 | NbStepperComponent.prototype.canBeSelected = function (indexToCheck) {
|
16473 | var noSteps = !this.steps || this.steps.length === 0;
|
16474 | if (noSteps || indexToCheck < 0 || indexToCheck >= this.steps.length) {
|
16475 | return false;
|
16476 | }
|
16477 | if (indexToCheck <= this.selectedIndex || !this.linear) {
|
16478 | return true;
|
16479 | }
|
16480 | var isAllStepsValid = true;
|
16481 | for (var i = this.selectedIndex; i < indexToCheck; i++) {
|
16482 | if (!this.isStepValid(i)) {
|
16483 | isAllStepsValid = false;
|
16484 | break;
|
16485 | }
|
16486 | }
|
16487 | return isAllStepsValid;
|
16488 | };
|
16489 | NbStepperComponent.prototype.markCurrentStepInteracted = function () {
|
16490 | if (this.selected) {
|
16491 | this.selected.interacted = true;
|
16492 | }
|
16493 | };
|
16494 | NbStepperComponent.decorators = [
|
16495 | { type: i0.Component, args: [{
|
16496 | selector: 'nb-stepper',
|
16497 | template: "<ng-template><ng-content select=\"nb-step\"></ng-content></ng-template>\n<div class=\"header\">\n <ng-container *ngFor=\"let step of steps; let index = index; let first = first\">\n\n <div *ngIf=\"!first && !step.hidden\"\n [class.connector-past]=\"index <= selectedIndex\"\n class=\"connector\"></div>\n\n <div *ngIf=\"!step.hidden\" class=\"step\"\n [class.selected]=\"isStepSelected(step)\"\n [class.completed]=\"!isStepSelected(step) && step.completed\"\n [class.noninteractive]=\"disableStepNavigation\"\n (click)=\"!disableStepNavigation && step.select()\">\n <div class=\"label-index\">\n <span *ngIf=\"!step.completed || isStepSelected(step)\">{{ index + 1 }}</span>\n <nb-icon *ngIf=\"!isStepSelected(step) && step.completed\" icon=\"checkmark-outline\" pack=\"nebular-essentials\">\n </nb-icon>\n </div>\n <div class=\"label\">\n <ng-container *ngIf=\"step.isLabelTemplate\">\n <ng-container *ngTemplateOutlet=\"getStepTemplate(step)\"></ng-container>\n </ng-container>\n <span *ngIf=\"!step.isLabelTemplate\">{{ step.label }}</span>\n </div>\n </div>\n </ng-container>\n</div>\n<div class=\"step-content\">\n <ng-container [ngTemplateOutlet]=\"selected?.content\"></ng-container>\n</div>\n",
|
16498 | providers: [{ provide: NB_STEPPER, useExisting: NbStepperComponent }],
|
16499 | styles: [":host(.horizontal) .header .step{flex-direction:column}:host(.horizontal) .header .connector{height:2px}:host(.horizontal) .label-index{margin-bottom:10px}:host(.vertical){display:flex;height:100%}:host(.vertical) .header{flex-direction:column}:host(.vertical) .header .label{margin:0 10px}:host(.vertical) .header .connector{width:2px}.header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:10px}.header .connector{flex:auto}.header .step{display:flex;align-items:center;cursor:pointer}.header .step.noninteractive{cursor:default}.header .label-index{display:flex;justify-content:center;align-items:center}.header .label{width:max-content}\n"]
|
16500 | },] }
|
16501 | ];
|
16502 | NbStepperComponent.propDecorators = {
|
16503 | selectedIndex: [{ type: i0.Input }],
|
16504 | disableStepNavigation: [{ type: i0.Input }],
|
16505 | selected: [{ type: i0.Input }],
|
16506 | orientation: [{ type: i0.Input }],
|
16507 | linear: [{ type: i0.Input }],
|
16508 | vertical: [{ type: i0.HostBinding, args: ['class.vertical',] }],
|
16509 | horizontal: [{ type: i0.HostBinding, args: ['class.horizontal',] }],
|
16510 | steps: [{ type: i0.ContentChildren, args: [NbStepComponent,] }]
|
16511 | };
|
16512 | return NbStepperComponent;
|
16513 | }());
|
16514 |
|
16515 | var NbStepperNextDirective = (function () {
|
16516 | function NbStepperNextDirective(stepper) {
|
16517 | this.stepper = stepper;
|
16518 | this.type = 'submit';
|
16519 | }
|
16520 | NbStepperNextDirective.prototype.onClick = function () {
|
16521 | this.stepper.next();
|
16522 | };
|
16523 | NbStepperNextDirective.decorators = [
|
16524 | { type: i0.Directive, args: [{
|
16525 | selector: 'button[nbStepperNext]',
|
16526 | },] }
|
16527 | ];
|
16528 | NbStepperNextDirective.ctorParameters = function () { return [
|
16529 | { type: NbStepperComponent }
|
16530 | ]; };
|
16531 | NbStepperNextDirective.propDecorators = {
|
16532 | type: [{ type: i0.Input }, { type: i0.HostBinding, args: ['attr.type',] }],
|
16533 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
16534 | };
|
16535 | return NbStepperNextDirective;
|
16536 | }());
|
16537 | var NbStepperPreviousDirective = (function () {
|
16538 | function NbStepperPreviousDirective(stepper) {
|
16539 | this.stepper = stepper;
|
16540 | this.type = 'button';
|
16541 | }
|
16542 | NbStepperPreviousDirective.prototype.onClick = function () {
|
16543 | this.stepper.previous();
|
16544 | };
|
16545 | NbStepperPreviousDirective.decorators = [
|
16546 | { type: i0.Directive, args: [{
|
16547 | selector: 'button[nbStepperPrevious]',
|
16548 | },] }
|
16549 | ];
|
16550 | NbStepperPreviousDirective.ctorParameters = function () { return [
|
16551 | { type: NbStepperComponent }
|
16552 | ]; };
|
16553 | NbStepperPreviousDirective.propDecorators = {
|
16554 | type: [{ type: i0.Input }, { type: i0.HostBinding, args: ['attr.type',] }],
|
16555 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
16556 | };
|
16557 | return NbStepperPreviousDirective;
|
16558 | }());
|
16559 |
|
16560 |
|
16561 |
|
16562 |
|
16563 |
|
16564 |
|
16565 | var NbStepperModule = (function () {
|
16566 | function NbStepperModule() {
|
16567 | }
|
16568 | NbStepperModule.decorators = [
|
16569 | { type: i0.NgModule, args: [{
|
16570 | imports: [
|
16571 | NbSharedModule,
|
16572 | NbIconModule,
|
16573 | ],
|
16574 | declarations: [
|
16575 | NbStepperComponent,
|
16576 | NbStepComponent,
|
16577 | NbStepperNextDirective,
|
16578 | NbStepperPreviousDirective,
|
16579 | ],
|
16580 | exports: [
|
16581 | NbStepperComponent,
|
16582 | NbStepComponent,
|
16583 | NbStepperNextDirective,
|
16584 | NbStepperPreviousDirective,
|
16585 | ],
|
16586 | },] }
|
16587 | ];
|
16588 | return NbStepperModule;
|
16589 | }());
|
16590 |
|
16591 |
|
16592 |
|
16593 |
|
16594 |
|
16595 |
|
16596 |
|
16597 |
|
16598 |
|
16599 |
|
16600 |
|
16601 |
|
16602 |
|
16603 |
|
16604 |
|
16605 |
|
16606 |
|
16607 |
|
16608 |
|
16609 |
|
16610 |
|
16611 |
|
16612 |
|
16613 |
|
16614 |
|
16615 |
|
16616 |
|
16617 |
|
16618 |
|
16619 |
|
16620 |
|
16621 |
|
16622 |
|
16623 |
|
16624 |
|
16625 |
|
16626 |
|
16627 |
|
16628 |
|
16629 |
|
16630 |
|
16631 |
|
16632 |
|
16633 |
|
16634 |
|
16635 |
|
16636 |
|
16637 |
|
16638 |
|
16639 |
|
16640 |
|
16641 |
|
16642 |
|
16643 |
|
16644 |
|
16645 |
|
16646 |
|
16647 |
|
16648 |
|
16649 |
|
16650 |
|
16651 |
|
16652 |
|
16653 | var NbAccordionComponent = (function () {
|
16654 | function NbAccordionComponent() {
|
16655 | this.openCloseItems = new rxjs.Subject();
|
16656 | this.multiValue = false;
|
16657 | }
|
16658 | Object.defineProperty(NbAccordionComponent.prototype, "multi", {
|
16659 | |
16660 |
|
16661 |
|
16662 |
|
16663 | get: function () {
|
16664 | return this.multiValue;
|
16665 | },
|
16666 | set: function (val) {
|
16667 | this.multiValue = convertToBoolProperty(val);
|
16668 | },
|
16669 | enumerable: false,
|
16670 | configurable: true
|
16671 | });
|
16672 | |
16673 |
|
16674 |
|
16675 | NbAccordionComponent.prototype.openAll = function () {
|
16676 | if (this.multi) {
|
16677 | this.openCloseItems.next(false);
|
16678 | }
|
16679 | };
|
16680 | |
16681 |
|
16682 |
|
16683 | NbAccordionComponent.prototype.closeAll = function () {
|
16684 | this.openCloseItems.next(true);
|
16685 | };
|
16686 | NbAccordionComponent.decorators = [
|
16687 | { type: i0.Component, args: [{
|
16688 | selector: 'nb-accordion',
|
16689 | template: "\n <ng-content select=\"nb-accordion-item\"></ng-content>\n ",
|
16690 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
16691 | },] }
|
16692 | ];
|
16693 | NbAccordionComponent.propDecorators = {
|
16694 | multi: [{ type: i0.Input, args: ['multi',] }]
|
16695 | };
|
16696 | return NbAccordionComponent;
|
16697 | }());
|
16698 |
|
16699 |
|
16700 |
|
16701 |
|
16702 |
|
16703 |
|
16704 |
|
16705 |
|
16706 |
|
16707 | var NbAccordionItemComponent = (function () {
|
16708 | function NbAccordionItemComponent(accordion, cd) {
|
16709 | this.accordion = accordion;
|
16710 | this.cd = cd;
|
16711 | |
16712 |
|
16713 |
|
16714 |
|
16715 | this.collapsedChange = new i0.EventEmitter();
|
16716 | this.accordionItemInvalidate = new rxjs.Subject();
|
16717 | this.collapsedValue = true;
|
16718 | this.disabledValue = false;
|
16719 | this.destroy$ = new rxjs.Subject();
|
16720 | }
|
16721 | Object.defineProperty(NbAccordionItemComponent.prototype, "collapsed", {
|
16722 | |
16723 |
|
16724 |
|
16725 |
|
16726 | get: function () {
|
16727 | return this.collapsedValue;
|
16728 | },
|
16729 | set: function (val) {
|
16730 | this.collapsedValue = convertToBoolProperty(val);
|
16731 | this.collapsedChange.emit(this.collapsedValue);
|
16732 | this.invalidate();
|
16733 | },
|
16734 | enumerable: false,
|
16735 | configurable: true
|
16736 | });
|
16737 | Object.defineProperty(NbAccordionItemComponent.prototype, "expanded", {
|
16738 | |
16739 |
|
16740 |
|
16741 |
|
16742 | get: function () {
|
16743 | return !this.collapsed;
|
16744 | },
|
16745 | set: function (val) {
|
16746 | this.collapsedValue = !convertToBoolProperty(val);
|
16747 | },
|
16748 | enumerable: false,
|
16749 | configurable: true
|
16750 | });
|
16751 | Object.defineProperty(NbAccordionItemComponent.prototype, "disabled", {
|
16752 | |
16753 |
|
16754 |
|
16755 |
|
16756 | get: function () {
|
16757 | return this.disabledValue;
|
16758 | },
|
16759 | set: function (val) {
|
16760 | this.disabledValue = convertToBoolProperty(val);
|
16761 | this.invalidate();
|
16762 | },
|
16763 | enumerable: false,
|
16764 | configurable: true
|
16765 | });
|
16766 | |
16767 |
|
16768 |
|
16769 | NbAccordionItemComponent.prototype.toggle = function () {
|
16770 | if (!this.disabled) {
|
16771 |
|
16772 | var willSet = !this.collapsed;
|
16773 | if (!this.accordion.multi) {
|
16774 | this.accordion.openCloseItems.next(true);
|
16775 | }
|
16776 | this.collapsed = willSet;
|
16777 | }
|
16778 | };
|
16779 | |
16780 |
|
16781 |
|
16782 | NbAccordionItemComponent.prototype.open = function () {
|
16783 | !this.disabled && (this.collapsed = false);
|
16784 | };
|
16785 | |
16786 |
|
16787 |
|
16788 | NbAccordionItemComponent.prototype.close = function () {
|
16789 | !this.disabled && (this.collapsed = true);
|
16790 | };
|
16791 | NbAccordionItemComponent.prototype.ngOnInit = function () {
|
16792 | var _this = this;
|
16793 | this.accordion.openCloseItems
|
16794 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
16795 | .subscribe(function (collapsed) {
|
16796 | !_this.disabled && (_this.collapsed = collapsed);
|
16797 | });
|
16798 | };
|
16799 | NbAccordionItemComponent.prototype.ngOnChanges = function (changes) {
|
16800 | this.accordionItemInvalidate.next(true);
|
16801 | };
|
16802 | NbAccordionItemComponent.prototype.ngOnDestroy = function () {
|
16803 | this.destroy$.next();
|
16804 | this.destroy$.complete();
|
16805 | this.accordionItemInvalidate.complete();
|
16806 | };
|
16807 | NbAccordionItemComponent.prototype.invalidate = function () {
|
16808 | this.accordionItemInvalidate.next(true);
|
16809 | this.cd.markForCheck();
|
16810 | };
|
16811 | NbAccordionItemComponent.decorators = [
|
16812 | { type: i0.Component, args: [{
|
16813 | selector: 'nb-accordion-item',
|
16814 | template: "\n <ng-content select=\"nb-accordion-item-header\"></ng-content>\n <ng-content select=\"nb-accordion-item-body\"></ng-content>\n ",
|
16815 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
16816 | styles: [":host{display:flex;flex-direction:column}\n"]
|
16817 | },] }
|
16818 | ];
|
16819 | NbAccordionItemComponent.ctorParameters = function () { return [
|
16820 | { type: NbAccordionComponent, decorators: [{ type: i0.Host }] },
|
16821 | { type: i0.ChangeDetectorRef }
|
16822 | ]; };
|
16823 | NbAccordionItemComponent.propDecorators = {
|
16824 | collapsed: [{ type: i0.Input, args: ['collapsed',] }, { type: i0.HostBinding, args: ['class.collapsed',] }],
|
16825 | expanded: [{ type: i0.Input, args: ['expanded',] }, { type: i0.HostBinding, args: ['class.expanded',] }],
|
16826 | disabled: [{ type: i0.Input, args: ['disabled',] }, { type: i0.HostBinding, args: ['class.disabled',] }],
|
16827 | collapsedChange: [{ type: i0.Output }]
|
16828 | };
|
16829 | return NbAccordionItemComponent;
|
16830 | }());
|
16831 |
|
16832 |
|
16833 |
|
16834 |
|
16835 |
|
16836 |
|
16837 | var accordionItemBodyTrigger = _angular_animations.trigger('accordionItemBody', [
|
16838 | _angular_animations.state('collapsed', _angular_animations.style({
|
16839 | overflow: 'hidden',
|
16840 | visibility: 'hidden',
|
16841 | height: 0,
|
16842 | })),
|
16843 | _angular_animations.state('expanded', _angular_animations.style({
|
16844 | overflow: 'hidden',
|
16845 | visibility: 'visible',
|
16846 | })),
|
16847 | _angular_animations.transition('collapsed => expanded', _angular_animations.animate('100ms ease-in')),
|
16848 | _angular_animations.transition('expanded => collapsed', _angular_animations.animate('100ms ease-out')),
|
16849 | ]);
|
16850 |
|
16851 |
|
16852 |
|
16853 | var NbAccordionItemBodyComponent = (function () {
|
16854 | function NbAccordionItemBodyComponent(accordionItem, cd) {
|
16855 | this.accordionItem = accordionItem;
|
16856 | this.cd = cd;
|
16857 | this.destroy$ = new rxjs.Subject();
|
16858 | }
|
16859 | Object.defineProperty(NbAccordionItemBodyComponent.prototype, "state", {
|
16860 | get: function () {
|
16861 | return this.accordionItem.collapsed ? 'collapsed' : 'expanded';
|
16862 | },
|
16863 | enumerable: false,
|
16864 | configurable: true
|
16865 | });
|
16866 | NbAccordionItemBodyComponent.prototype.ngOnInit = function () {
|
16867 | var _this = this;
|
16868 | this.accordionItem.accordionItemInvalidate
|
16869 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
16870 | .subscribe(function () { return _this.cd.markForCheck(); });
|
16871 | };
|
16872 | NbAccordionItemBodyComponent.prototype.ngOnDestroy = function () {
|
16873 | this.destroy$.next();
|
16874 | this.destroy$.complete();
|
16875 | };
|
16876 | NbAccordionItemBodyComponent.decorators = [
|
16877 | { type: i0.Component, args: [{
|
16878 | selector: 'nb-accordion-item-body',
|
16879 | template: "\n <div [@accordionItemBody]=\"{ value: state }\">\n <div class=\"item-body\">\n <ng-content></ng-content>\n </div>\n </div>\n ",
|
16880 | animations: [accordionItemBodyTrigger],
|
16881 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
16882 | },] }
|
16883 | ];
|
16884 | NbAccordionItemBodyComponent.ctorParameters = function () { return [
|
16885 | { type: NbAccordionItemComponent, decorators: [{ type: i0.Host }] },
|
16886 | { type: i0.ChangeDetectorRef }
|
16887 | ]; };
|
16888 | return NbAccordionItemBodyComponent;
|
16889 | }());
|
16890 |
|
16891 |
|
16892 |
|
16893 |
|
16894 |
|
16895 |
|
16896 |
|
16897 |
|
16898 |
|
16899 | var NbAccordionItemHeaderComponent = (function () {
|
16900 | function NbAccordionItemHeaderComponent(accordionItem, cd) {
|
16901 | this.accordionItem = accordionItem;
|
16902 | this.cd = cd;
|
16903 | this.destroy$ = new rxjs.Subject();
|
16904 | }
|
16905 | Object.defineProperty(NbAccordionItemHeaderComponent.prototype, "isCollapsed", {
|
16906 | get: function () {
|
16907 | return this.accordionItem.collapsed;
|
16908 | },
|
16909 | enumerable: false,
|
16910 | configurable: true
|
16911 | });
|
16912 | Object.defineProperty(NbAccordionItemHeaderComponent.prototype, "expanded", {
|
16913 | get: function () {
|
16914 | return !this.accordionItem.collapsed;
|
16915 | },
|
16916 | enumerable: false,
|
16917 | configurable: true
|
16918 | });
|
16919 | Object.defineProperty(NbAccordionItemHeaderComponent.prototype, "tabbable", {
|
16920 |
|
16921 | get: function () {
|
16922 | return this.accordionItem.disabled ? '-1' : '0';
|
16923 | },
|
16924 | enumerable: false,
|
16925 | configurable: true
|
16926 | });
|
16927 | Object.defineProperty(NbAccordionItemHeaderComponent.prototype, "disabled", {
|
16928 | get: function () {
|
16929 | return this.accordionItem.disabled;
|
16930 | },
|
16931 | enumerable: false,
|
16932 | configurable: true
|
16933 | });
|
16934 | NbAccordionItemHeaderComponent.prototype.toggle = function () {
|
16935 | this.accordionItem.toggle();
|
16936 | };
|
16937 | Object.defineProperty(NbAccordionItemHeaderComponent.prototype, "state", {
|
16938 | get: function () {
|
16939 | if (this.isCollapsed) {
|
16940 | return 'collapsed';
|
16941 | }
|
16942 | if (this.expanded) {
|
16943 | return 'expanded';
|
16944 | }
|
16945 | },
|
16946 | enumerable: false,
|
16947 | configurable: true
|
16948 | });
|
16949 | NbAccordionItemHeaderComponent.prototype.ngOnInit = function () {
|
16950 | var _this = this;
|
16951 | this.accordionItem.accordionItemInvalidate
|
16952 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
16953 | .subscribe(function () { return _this.cd.markForCheck(); });
|
16954 | };
|
16955 | NbAccordionItemHeaderComponent.prototype.ngOnDestroy = function () {
|
16956 | this.destroy$.next();
|
16957 | this.destroy$.complete();
|
16958 | };
|
16959 | NbAccordionItemHeaderComponent.decorators = [
|
16960 | { type: i0.Component, args: [{
|
16961 | selector: 'nb-accordion-item-header',
|
16962 | template: "\n <ng-content select=\"nb-accordion-item-title\"></ng-content>\n <ng-content select=\"nb-accordion-item-description\"></ng-content>\n <ng-content></ng-content>\n <nb-icon icon=\"chevron-down-outline\"\n pack=\"nebular-essentials\"\n [@expansionIndicator]=\"state\"\n *ngIf=\"!disabled\"\n class=\"expansion-indicator\">\n </nb-icon>\n ",
|
16963 | animations: [
|
16964 | _angular_animations.trigger('expansionIndicator', [
|
16965 | _angular_animations.state('expanded', _angular_animations.style({
|
16966 | transform: 'rotate(180deg)',
|
16967 | })),
|
16968 | _angular_animations.transition('collapsed => expanded', _angular_animations.animate('100ms ease-in')),
|
16969 | _angular_animations.transition('expanded => collapsed', _angular_animations.animate('100ms ease-out')),
|
16970 | ]),
|
16971 | ],
|
16972 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
16973 | styles: [":host{display:flex;align-items:center;cursor:pointer}:host:focus{outline:0}\n"]
|
16974 | },] }
|
16975 | ];
|
16976 | NbAccordionItemHeaderComponent.ctorParameters = function () { return [
|
16977 | { type: NbAccordionItemComponent, decorators: [{ type: i0.Host }] },
|
16978 | { type: i0.ChangeDetectorRef }
|
16979 | ]; };
|
16980 | NbAccordionItemHeaderComponent.propDecorators = {
|
16981 | isCollapsed: [{ type: i0.HostBinding, args: ['class.accordion-item-header-collapsed',] }],
|
16982 | expanded: [{ type: i0.HostBinding, args: ['class.accordion-item-header-expanded',] }, { type: i0.HostBinding, args: ['attr.aria-expanded',] }],
|
16983 | tabbable: [{ type: i0.HostBinding, args: ['attr.tabindex',] }],
|
16984 | disabled: [{ type: i0.HostBinding, args: ['attr.aria-disabled',] }],
|
16985 | toggle: [{ type: i0.HostListener, args: ['click',] }, { type: i0.HostListener, args: ['keydown.space',] }, { type: i0.HostListener, args: ['keydown.enter',] }]
|
16986 | };
|
16987 | return NbAccordionItemHeaderComponent;
|
16988 | }());
|
16989 |
|
16990 |
|
16991 |
|
16992 |
|
16993 |
|
16994 |
|
16995 | var NB_ACCORDION_COMPONENTS = [
|
16996 | NbAccordionComponent,
|
16997 | NbAccordionItemComponent,
|
16998 | NbAccordionItemHeaderComponent,
|
16999 | NbAccordionItemBodyComponent,
|
17000 | ];
|
17001 | var NbAccordionModule = (function () {
|
17002 | function NbAccordionModule() {
|
17003 | }
|
17004 | NbAccordionModule.decorators = [
|
17005 | { type: i0.NgModule, args: [{
|
17006 | imports: [_angular_common.CommonModule, NbIconModule],
|
17007 | exports: tslib.__spreadArray([], NB_ACCORDION_COMPONENTS),
|
17008 | declarations: tslib.__spreadArray([], NB_ACCORDION_COMPONENTS),
|
17009 | providers: [],
|
17010 | },] }
|
17011 | ];
|
17012 | return NbAccordionModule;
|
17013 | }());
|
17014 |
|
17015 |
|
17016 |
|
17017 |
|
17018 |
|
17019 |
|
17020 |
|
17021 |
|
17022 |
|
17023 | var NbButtonToggleDirective = (function (_super) {
|
17024 | tslib.__extends(NbButtonToggleDirective, _super);
|
17025 | function NbButtonToggleDirective(renderer, hostElement, cd, zone, statusService) {
|
17026 | var _this = _super.call(this, renderer, hostElement, cd, zone, statusService) || this;
|
17027 | _this.renderer = renderer;
|
17028 | _this.hostElement = hostElement;
|
17029 | _this.cd = cd;
|
17030 | _this.zone = zone;
|
17031 | _this.statusService = statusService;
|
17032 | _this._pressedChange$ = new rxjs.Subject();
|
17033 | _this.appearance = 'filled';
|
17034 | _this._pressed = false;
|
17035 | |
17036 |
|
17037 |
|
17038 | _this.pressedChange = new i0.EventEmitter();
|
17039 | return _this;
|
17040 | }
|
17041 | Object.defineProperty(NbButtonToggleDirective.prototype, "pressedChange$", {
|
17042 | get: function () {
|
17043 | return this._pressedChange$.asObservable();
|
17044 | },
|
17045 | enumerable: false,
|
17046 | configurable: true
|
17047 | });
|
17048 | Object.defineProperty(NbButtonToggleDirective.prototype, "pressed", {
|
17049 | |
17050 |
|
17051 |
|
17052 | get: function () {
|
17053 | return this._pressed;
|
17054 | },
|
17055 | set: function (value) {
|
17056 | if (this.pressed !== convertToBoolProperty(value)) {
|
17057 | this._pressed = !this.pressed;
|
17058 | this.pressedChange.emit(this.pressed);
|
17059 | this._pressedChange$.next({ source: this, pressed: this.pressed });
|
17060 | }
|
17061 | },
|
17062 | enumerable: false,
|
17063 | configurable: true
|
17064 | });
|
17065 | Object.defineProperty(NbButtonToggleDirective.prototype, "basic", {
|
17066 | get: function () {
|
17067 |
|
17068 | return !this.pressed;
|
17069 | },
|
17070 | enumerable: false,
|
17071 | configurable: true
|
17072 | });
|
17073 | Object.defineProperty(NbButtonToggleDirective.prototype, "primary", {
|
17074 | get: function () {
|
17075 | return this.pressed && (this.status === 'basic' || this.status === 'primary');
|
17076 | },
|
17077 | enumerable: false,
|
17078 | configurable: true
|
17079 | });
|
17080 | Object.defineProperty(NbButtonToggleDirective.prototype, "success", {
|
17081 | get: function () {
|
17082 | return this.pressed && this.status === 'success';
|
17083 | },
|
17084 | enumerable: false,
|
17085 | configurable: true
|
17086 | });
|
17087 | Object.defineProperty(NbButtonToggleDirective.prototype, "info", {
|
17088 | get: function () {
|
17089 | return this.pressed && this.status === 'info';
|
17090 | },
|
17091 | enumerable: false,
|
17092 | configurable: true
|
17093 | });
|
17094 | Object.defineProperty(NbButtonToggleDirective.prototype, "warning", {
|
17095 | get: function () {
|
17096 | return this.pressed && this.status === 'warning';
|
17097 | },
|
17098 | enumerable: false,
|
17099 | configurable: true
|
17100 | });
|
17101 | Object.defineProperty(NbButtonToggleDirective.prototype, "danger", {
|
17102 | get: function () {
|
17103 | return this.pressed && this.status === 'danger';
|
17104 | },
|
17105 | enumerable: false,
|
17106 | configurable: true
|
17107 | });
|
17108 | Object.defineProperty(NbButtonToggleDirective.prototype, "control", {
|
17109 | get: function () {
|
17110 | return this.pressed && this.status === 'control';
|
17111 | },
|
17112 | enumerable: false,
|
17113 | configurable: true
|
17114 | });
|
17115 | Object.defineProperty(NbButtonToggleDirective.prototype, "additionalClasses", {
|
17116 | get: function () {
|
17117 | if (this.statusService.isCustomStatus(this.status)) {
|
17118 | return [this.statusService.getStatusClass(this.status)];
|
17119 | }
|
17120 | return [];
|
17121 | },
|
17122 | enumerable: false,
|
17123 | configurable: true
|
17124 | });
|
17125 | NbButtonToggleDirective.prototype.onClick = function () {
|
17126 | this.pressed = !this.pressed;
|
17127 | };
|
17128 | |
17129 |
|
17130 |
|
17131 | NbButtonToggleDirective.prototype._updatePressed = function (value) {
|
17132 | this.pressed = value;
|
17133 | this.cd.markForCheck();
|
17134 | };
|
17135 | NbButtonToggleDirective.decorators = [
|
17136 | { type: i0.Directive, args: [{
|
17137 | selector: 'button[nbButtonToggle]',
|
17138 | providers: [
|
17139 | { provide: NbButton, useExisting: NbButtonToggleDirective },
|
17140 | ],
|
17141 | exportAs: 'nbButtonToggle',
|
17142 | },] }
|
17143 | ];
|
17144 | NbButtonToggleDirective.ctorParameters = function () { return [
|
17145 | { type: i0.Renderer2 },
|
17146 | { type: i0.ElementRef },
|
17147 | { type: i0.ChangeDetectorRef },
|
17148 | { type: i0.NgZone },
|
17149 | { type: NbStatusService }
|
17150 | ]; };
|
17151 | NbButtonToggleDirective.propDecorators = {
|
17152 | appearance: [{ type: i0.Input }],
|
17153 | value: [{ type: i0.Input }],
|
17154 | pressed: [{ type: i0.Input }, { type: i0.HostBinding, args: ['attr.aria-pressed',] }],
|
17155 | pressedChange: [{ type: i0.Output }],
|
17156 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
17157 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
17158 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
17159 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
17160 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
17161 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
17162 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
17163 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }],
|
17164 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
17165 | };
|
17166 | return NbButtonToggleDirective;
|
17167 | }(NbButton));
|
17168 |
|
17169 |
|
17170 |
|
17171 |
|
17172 |
|
17173 |
|
17174 |
|
17175 |
|
17176 |
|
17177 |
|
17178 |
|
17179 |
|
17180 |
|
17181 |
|
17182 |
|
17183 |
|
17184 |
|
17185 |
|
17186 |
|
17187 |
|
17188 |
|
17189 |
|
17190 |
|
17191 |
|
17192 |
|
17193 |
|
17194 |
|
17195 |
|
17196 |
|
17197 |
|
17198 |
|
17199 |
|
17200 |
|
17201 |
|
17202 |
|
17203 |
|
17204 |
|
17205 |
|
17206 |
|
17207 |
|
17208 |
|
17209 |
|
17210 |
|
17211 |
|
17212 |
|
17213 |
|
17214 |
|
17215 |
|
17216 |
|
17217 |
|
17218 |
|
17219 |
|
17220 |
|
17221 |
|
17222 |
|
17223 |
|
17224 |
|
17225 |
|
17226 |
|
17227 |
|
17228 |
|
17229 |
|
17230 |
|
17231 |
|
17232 |
|
17233 |
|
17234 |
|
17235 |
|
17236 |
|
17237 |
|
17238 |
|
17239 |
|
17240 |
|
17241 |
|
17242 |
|
17243 | var NbButtonGroupComponent = (function () {
|
17244 | function NbButtonGroupComponent(cd, statusService) {
|
17245 | this.cd = cd;
|
17246 | this.statusService = statusService;
|
17247 | this.lastEmittedValue = [];
|
17248 | this.destroy$ = new rxjs.Subject();
|
17249 | this.buttonsChange$ = new rxjs.Subject();
|
17250 | |
17251 |
|
17252 |
|
17253 |
|
17254 | this.size = 'medium';
|
17255 | |
17256 |
|
17257 |
|
17258 |
|
17259 | this.status = 'basic';
|
17260 | |
17261 |
|
17262 |
|
17263 | this.shape = 'rectangle';
|
17264 | |
17265 |
|
17266 |
|
17267 | this.appearance = 'filled';
|
17268 | this._disabled = false;
|
17269 | this._multiple = false;
|
17270 | |
17271 |
|
17272 |
|
17273 |
|
17274 | this.valueChange = new i0.EventEmitter();
|
17275 | this.role = 'group';
|
17276 | }
|
17277 | Object.defineProperty(NbButtonGroupComponent.prototype, "disabled", {
|
17278 | get: function () {
|
17279 | return this._disabled;
|
17280 | },
|
17281 | set: function (value) {
|
17282 | if (this.disabled !== convertToBoolProperty(value)) {
|
17283 | this._disabled = !this.disabled;
|
17284 | }
|
17285 | },
|
17286 | enumerable: false,
|
17287 | configurable: true
|
17288 | });
|
17289 | Object.defineProperty(NbButtonGroupComponent.prototype, "multiple", {
|
17290 | |
17291 |
|
17292 |
|
17293 | get: function () {
|
17294 | return this._multiple;
|
17295 | },
|
17296 | set: function (value) {
|
17297 | this._multiple = convertToBoolProperty(value);
|
17298 | },
|
17299 | enumerable: false,
|
17300 | configurable: true
|
17301 | });
|
17302 | Object.defineProperty(NbButtonGroupComponent.prototype, "filled", {
|
17303 | |
17304 |
|
17305 |
|
17306 | get: function () {
|
17307 | return this.appearance === 'filled';
|
17308 | },
|
17309 | set: function (value) {
|
17310 | if (convertToBoolProperty(value)) {
|
17311 | this.appearance = 'filled';
|
17312 | }
|
17313 | },
|
17314 | enumerable: false,
|
17315 | configurable: true
|
17316 | });
|
17317 | Object.defineProperty(NbButtonGroupComponent.prototype, "outline", {
|
17318 | |
17319 |
|
17320 |
|
17321 | get: function () {
|
17322 | return this.appearance === 'outline';
|
17323 | },
|
17324 | set: function (value) {
|
17325 | if (convertToBoolProperty(value)) {
|
17326 | this.appearance = 'outline';
|
17327 | }
|
17328 | },
|
17329 | enumerable: false,
|
17330 | configurable: true
|
17331 | });
|
17332 | Object.defineProperty(NbButtonGroupComponent.prototype, "ghost", {
|
17333 | |
17334 |
|
17335 |
|
17336 | get: function () {
|
17337 | return this.appearance === 'ghost';
|
17338 | },
|
17339 | set: function (value) {
|
17340 | if (convertToBoolProperty(value)) {
|
17341 | this.appearance = 'ghost';
|
17342 | }
|
17343 | },
|
17344 | enumerable: false,
|
17345 | configurable: true
|
17346 | });
|
17347 | Object.defineProperty(NbButtonGroupComponent.prototype, "additionalClasses", {
|
17348 | get: function () {
|
17349 | if (this.statusService.isCustomStatus(this.status)) {
|
17350 | return [this.statusService.getStatusClass(this.status)];
|
17351 | }
|
17352 | return [];
|
17353 | },
|
17354 | enumerable: false,
|
17355 | configurable: true
|
17356 | });
|
17357 | NbButtonGroupComponent.prototype.ngOnChanges = function (_a) {
|
17358 | var _b;
|
17359 | var size = _a.size, status = _a.status, shape = _a.shape, multiple = _a.multiple, filled = _a.filled, outline = _a.outline, ghost = _a.ghost, disabled = _a.disabled;
|
17360 | if (size || status || shape || multiple || filled || outline || ghost || disabled) {
|
17361 | this.syncButtonsProperties(((_b = this.buttons) === null || _b === void 0 ? void 0 : _b.toArray()) || []);
|
17362 | }
|
17363 | };
|
17364 | NbButtonGroupComponent.prototype.ngAfterContentInit = function () {
|
17365 | var _this = this;
|
17366 | this.buttonsChange$
|
17367 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
17368 | .subscribe(function (buttons) {
|
17369 | _this.listenButtonPressedState(buttons);
|
17370 | _this.syncButtonsProperties(buttons);
|
17371 | });
|
17372 | this.buttons.changes
|
17373 | .pipe(
|
17374 |
|
17375 |
|
17376 |
|
17377 |
|
17378 |
|
17379 | rxjs_operators.switchMap(function (buttons) { return rxjs.from(Promise.resolve(buttons.toArray())); }), rxjs_operators.takeUntil(this.destroy$))
|
17380 | .subscribe(this.buttonsChange$);
|
17381 | this.buttonsChange$.next(this.buttons.toArray());
|
17382 | };
|
17383 | NbButtonGroupComponent.prototype.listenButtonPressedState = function (buttons) {
|
17384 | var _this = this;
|
17385 | var toggleButtons = buttons.filter(function (button) {
|
17386 | return button instanceof NbButtonToggleDirective;
|
17387 | });
|
17388 | if (!toggleButtons.length) {
|
17389 | return;
|
17390 | }
|
17391 | var buttonsPressedChange$ = toggleButtons
|
17392 | .map(function (button) { return button.pressedChange$; });
|
17393 | rxjs.merge.apply(void 0, buttonsPressedChange$).pipe(rxjs_operators.filter(function (_a) {
|
17394 | var pressed = _a.pressed;
|
17395 | return !_this.multiple && pressed;
|
17396 | }), rxjs_operators.takeUntil(rxjs.merge(this.buttonsChange$, this.destroy$)))
|
17397 | .subscribe(function (_a) {
|
17398 | var source = _a.source;
|
17399 | toggleButtons
|
17400 | .filter(function (button) { return button !== source; })
|
17401 | .forEach(function (button) { return button._updatePressed(false); });
|
17402 | });
|
17403 | rxjs.merge.apply(void 0, buttonsPressedChange$).pipe(
|
17404 |
|
17405 | rxjs_operators.startWith(''),
|
17406 |
|
17407 | rxjs_operators.debounceTime(0), rxjs_operators.takeUntil(rxjs.merge(this.buttonsChange$, this.destroy$)))
|
17408 | .subscribe(function () { return _this.emitCurrentValue(toggleButtons); });
|
17409 | };
|
17410 | NbButtonGroupComponent.prototype.syncButtonsProperties = function (buttons) {
|
17411 | var _this = this;
|
17412 | buttons.forEach(function (button) {
|
17413 | button.updateProperties({
|
17414 | appearance: _this.appearance,
|
17415 | size: _this.size,
|
17416 | status: _this.status,
|
17417 | shape: _this.shape,
|
17418 | disabled: _this.disabled,
|
17419 | });
|
17420 | });
|
17421 | };
|
17422 | NbButtonGroupComponent.prototype.emitCurrentValue = function (toggleButtons) {
|
17423 | var pressedToggleValues = toggleButtons
|
17424 | .filter(function (b) { return b.pressed && typeof b.value !== 'undefined'; })
|
17425 | .map(function (b) { return b.value; });
|
17426 |
|
17427 | if (pressedToggleValues.length === 0 && this.lastEmittedValue.length === 0) {
|
17428 | return;
|
17429 | }
|
17430 | this.valueChange.emit(pressedToggleValues);
|
17431 | this.lastEmittedValue = pressedToggleValues;
|
17432 | };
|
17433 | NbButtonGroupComponent.decorators = [
|
17434 | { type: i0.Component, args: [{
|
17435 | selector: 'nb-button-group',
|
17436 | template: "\n <ng-content></ng-content>\n ",
|
17437 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
17438 | },] }
|
17439 | ];
|
17440 | NbButtonGroupComponent.ctorParameters = function () { return [
|
17441 | { type: i0.ChangeDetectorRef },
|
17442 | { type: NbStatusService }
|
17443 | ]; };
|
17444 | NbButtonGroupComponent.propDecorators = {
|
17445 | buttons: [{ type: i0.ContentChildren, args: [NbButton,] }],
|
17446 | size: [{ type: i0.Input }],
|
17447 | status: [{ type: i0.Input }],
|
17448 | shape: [{ type: i0.Input }],
|
17449 | appearance: [{ type: i0.Input }],
|
17450 | disabled: [{ type: i0.Input }],
|
17451 | multiple: [{ type: i0.Input }],
|
17452 | filled: [{ type: i0.Input }],
|
17453 | outline: [{ type: i0.Input }],
|
17454 | ghost: [{ type: i0.Input }],
|
17455 | valueChange: [{ type: i0.Output }],
|
17456 | role: [{ type: i0.HostBinding, args: ['attr.role',] }],
|
17457 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }]
|
17458 | };
|
17459 | return NbButtonGroupComponent;
|
17460 | }());
|
17461 |
|
17462 |
|
17463 |
|
17464 |
|
17465 |
|
17466 |
|
17467 | var NbButtonGroupModule = (function () {
|
17468 | function NbButtonGroupModule() {
|
17469 | }
|
17470 | NbButtonGroupModule.decorators = [
|
17471 | { type: i0.NgModule, args: [{
|
17472 | declarations: [NbButtonGroupComponent, NbButtonToggleDirective],
|
17473 | exports: [NbButtonGroupComponent, NbButtonToggleDirective],
|
17474 | },] }
|
17475 | ];
|
17476 | return NbButtonGroupModule;
|
17477 | }());
|
17478 |
|
17479 |
|
17480 |
|
17481 |
|
17482 |
|
17483 |
|
17484 |
|
17485 |
|
17486 |
|
17487 |
|
17488 |
|
17489 |
|
17490 |
|
17491 |
|
17492 |
|
17493 |
|
17494 |
|
17495 |
|
17496 |
|
17497 |
|
17498 |
|
17499 |
|
17500 |
|
17501 |
|
17502 |
|
17503 |
|
17504 |
|
17505 |
|
17506 |
|
17507 |
|
17508 |
|
17509 |
|
17510 |
|
17511 |
|
17512 |
|
17513 |
|
17514 |
|
17515 |
|
17516 | var NbListComponent = (function () {
|
17517 | function NbListComponent() {
|
17518 | |
17519 |
|
17520 |
|
17521 |
|
17522 |
|
17523 | this.role = 'list';
|
17524 | }
|
17525 | NbListComponent.decorators = [
|
17526 | { type: i0.Component, args: [{
|
17527 | selector: 'nb-list',
|
17528 | template: "<ng-content select=\"nb-list-item\"></ng-content>",
|
17529 | styles: [":host{display:flex;flex-direction:column;flex:1 1 auto;overflow:auto}\n"]
|
17530 | },] }
|
17531 | ];
|
17532 | NbListComponent.propDecorators = {
|
17533 | role: [{ type: i0.Input }, { type: i0.HostBinding, args: ['attr.role',] }]
|
17534 | };
|
17535 | return NbListComponent;
|
17536 | }());
|
17537 |
|
17538 |
|
17539 |
|
17540 |
|
17541 | var NbListItemComponent = (function () {
|
17542 | function NbListItemComponent() {
|
17543 | |
17544 |
|
17545 |
|
17546 |
|
17547 |
|
17548 | this.role = 'listitem';
|
17549 | }
|
17550 | NbListItemComponent.decorators = [
|
17551 | { type: i0.Component, args: [{
|
17552 | selector: 'nb-list-item',
|
17553 | template: "<ng-content></ng-content>",
|
17554 | styles: [":host{display:flex;align-items:center;flex-shrink:0}\n"]
|
17555 | },] }
|
17556 | ];
|
17557 | NbListItemComponent.propDecorators = {
|
17558 | role: [{ type: i0.Input }, { type: i0.HostBinding, args: ['attr.role',] }]
|
17559 | };
|
17560 | return NbListItemComponent;
|
17561 | }());
|
17562 |
|
17563 |
|
17564 |
|
17565 |
|
17566 |
|
17567 |
|
17568 |
|
17569 | var NbListPageTrackerDirective = (function () {
|
17570 | function NbListPageTrackerDirective() {
|
17571 | var _this = this;
|
17572 | this.destroy$ = new rxjs.Subject();
|
17573 | |
17574 |
|
17575 |
|
17576 | this.startPage = 1;
|
17577 | |
17578 |
|
17579 |
|
17580 | this.pageChange = new i0.EventEmitter();
|
17581 | this.observer = new IntersectionObserver(function (entries) { return _this.checkForPageChange(entries); }, { threshold: 0.5 });
|
17582 | }
|
17583 | NbListPageTrackerDirective.prototype.ngAfterViewInit = function () {
|
17584 | var _this = this;
|
17585 | if (this.listItems && this.listItems.length) {
|
17586 | this.observeItems();
|
17587 | }
|
17588 | this.listItems.changes
|
17589 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
17590 | .subscribe(function () { return _this.observeItems(); });
|
17591 | };
|
17592 | NbListPageTrackerDirective.prototype.ngOnDestroy = function () {
|
17593 | this.observer.disconnect && this.observer.disconnect();
|
17594 | };
|
17595 | NbListPageTrackerDirective.prototype.observeItems = function () {
|
17596 | var _this = this;
|
17597 | this.listItems.forEach(function (i) { return _this.observer.observe(i.nativeElement); });
|
17598 | };
|
17599 | NbListPageTrackerDirective.prototype.checkForPageChange = function (entries) {
|
17600 | var mostVisiblePage = this.findMostVisiblePage(entries);
|
17601 | if (mostVisiblePage && this.currentPage !== mostVisiblePage) {
|
17602 | this.currentPage = mostVisiblePage;
|
17603 | this.pageChange.emit(this.currentPage);
|
17604 | }
|
17605 | };
|
17606 | NbListPageTrackerDirective.prototype.findMostVisiblePage = function (entries) {
|
17607 | var intersectionRatioByPage = new Map();
|
17608 | for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
17609 | var entry = entries_1[_i];
|
17610 | if (entry.intersectionRatio < 0.5) {
|
17611 | continue;
|
17612 | }
|
17613 | var elementIndex = this.elementIndex(entry.target);
|
17614 | if (elementIndex === -1) {
|
17615 | continue;
|
17616 | }
|
17617 | var page = this.startPage + Math.floor(elementIndex / this.pageSize);
|
17618 | var ratio = entry.intersectionRatio;
|
17619 | if (intersectionRatioByPage.has(page)) {
|
17620 | ratio += intersectionRatioByPage.get(page);
|
17621 | }
|
17622 | intersectionRatioByPage.set(page, ratio);
|
17623 | }
|
17624 | var maxRatio = 0;
|
17625 | var mostVisiblePage;
|
17626 | intersectionRatioByPage.forEach(function (ratio, page) {
|
17627 | if (ratio > maxRatio) {
|
17628 | maxRatio = ratio;
|
17629 | mostVisiblePage = page;
|
17630 | }
|
17631 | });
|
17632 | return mostVisiblePage;
|
17633 | };
|
17634 | NbListPageTrackerDirective.prototype.elementIndex = function (element) {
|
17635 | return element.parentElement && element.parentElement.children
|
17636 | ? Array.from(element.parentElement.children).indexOf(element)
|
17637 | : -1;
|
17638 | };
|
17639 | NbListPageTrackerDirective.decorators = [
|
17640 | { type: i0.Directive, args: [{
|
17641 | selector: '[nbListPageTracker]',
|
17642 | },] }
|
17643 | ];
|
17644 | NbListPageTrackerDirective.ctorParameters = function () { return []; };
|
17645 | NbListPageTrackerDirective.propDecorators = {
|
17646 | pageSize: [{ type: i0.Input }],
|
17647 | startPage: [{ type: i0.Input }],
|
17648 | pageChange: [{ type: i0.Output }],
|
17649 | listItems: [{ type: i0.ContentChildren, args: [NbListItemComponent, { read: i0.ElementRef },] }]
|
17650 | };
|
17651 | return NbListPageTrackerDirective;
|
17652 | }());
|
17653 |
|
17654 | var NbScrollableContainerDimentions = (function () {
|
17655 | function NbScrollableContainerDimentions() {
|
17656 | }
|
17657 | return NbScrollableContainerDimentions;
|
17658 | }());
|
17659 |
|
17660 |
|
17661 |
|
17662 |
|
17663 |
|
17664 |
|
17665 |
|
17666 |
|
17667 |
|
17668 |
|
17669 |
|
17670 |
|
17671 |
|
17672 |
|
17673 |
|
17674 |
|
17675 |
|
17676 |
|
17677 |
|
17678 |
|
17679 |
|
17680 |
|
17681 |
|
17682 |
|
17683 |
|
17684 |
|
17685 |
|
17686 |
|
17687 | var NbInfiniteListDirective = (function () {
|
17688 | function NbInfiniteListDirective(elementRef, scrollService, dimensionsService) {
|
17689 | this.elementRef = elementRef;
|
17690 | this.scrollService = scrollService;
|
17691 | this.dimensionsService = dimensionsService;
|
17692 | this.destroy$ = new rxjs.Subject();
|
17693 | this.windowScroll = false;
|
17694 | |
17695 |
|
17696 |
|
17697 | this.bottomThreshold = new i0.EventEmitter(true);
|
17698 | |
17699 |
|
17700 |
|
17701 | this.topThreshold = new i0.EventEmitter(true);
|
17702 | }
|
17703 | Object.defineProperty(NbInfiniteListDirective.prototype, "elementScroll", {
|
17704 | get: function () {
|
17705 | return !this.windowScroll;
|
17706 | },
|
17707 | enumerable: false,
|
17708 | configurable: true
|
17709 | });
|
17710 | Object.defineProperty(NbInfiniteListDirective.prototype, "listenWindowScroll", {
|
17711 | |
17712 |
|
17713 |
|
17714 |
|
17715 | set: function (value) {
|
17716 | this.windowScroll = convertToBoolProperty(value);
|
17717 | },
|
17718 | enumerable: false,
|
17719 | configurable: true
|
17720 | });
|
17721 | NbInfiniteListDirective.prototype.onElementScroll = function () {
|
17722 | if (this.elementScroll) {
|
17723 | this.checkPosition(this.elementRef.nativeElement);
|
17724 | }
|
17725 | };
|
17726 | NbInfiniteListDirective.prototype.ngAfterViewInit = function () {
|
17727 | var _this = this;
|
17728 | this.scrollService.onScroll()
|
17729 | .pipe(rxjs_operators.filter(function () { return _this.windowScroll; }), rxjs_operators.switchMap(function () { return _this.getContainerDimensions(); }), rxjs_operators.takeUntil(this.destroy$))
|
17730 | .subscribe(function (dimentions) { return _this.checkPosition(dimentions); });
|
17731 | this.listItems.changes
|
17732 | .pipe(
|
17733 |
|
17734 |
|
17735 |
|
17736 |
|
17737 | rxjs_operators.switchMap(function () { return rxjs.interval(50).pipe(rxjs_operators.filter(function () { return _this.inSyncWithDom(); }), rxjs_operators.take(1), rxjs_operators.takeUntil(rxjs.timer(1000))); }), rxjs_operators.switchMap(function () { return _this.getContainerDimensions(); }), rxjs_operators.takeUntil(this.destroy$))
|
17738 | .subscribe(function (dimentions) { return _this.checkPosition(dimentions); });
|
17739 | this.getContainerDimensions().subscribe(function (dimentions) { return _this.checkPosition(dimentions); });
|
17740 | };
|
17741 | NbInfiniteListDirective.prototype.ngOnDestroy = function () {
|
17742 | this.destroy$.next();
|
17743 | this.destroy$.complete();
|
17744 | };
|
17745 | NbInfiniteListDirective.prototype.checkPosition = function (_a) {
|
17746 | var scrollHeight = _a.scrollHeight, scrollTop = _a.scrollTop, clientHeight = _a.clientHeight;
|
17747 | var initialCheck = this.lastScrollPosition == null;
|
17748 | var manualCheck = this.lastScrollPosition === scrollTop;
|
17749 | var scrollUp = scrollTop < this.lastScrollPosition;
|
17750 | var scrollDown = scrollTop > this.lastScrollPosition;
|
17751 | var distanceToBottom = scrollHeight - scrollTop - clientHeight;
|
17752 | if ((initialCheck || manualCheck || scrollDown) && distanceToBottom <= this.threshold) {
|
17753 | this.bottomThreshold.emit();
|
17754 | }
|
17755 | if ((initialCheck || scrollUp) && scrollTop <= this.threshold) {
|
17756 | this.topThreshold.emit();
|
17757 | }
|
17758 | this.lastScrollPosition = scrollTop;
|
17759 | };
|
17760 | NbInfiniteListDirective.prototype.getContainerDimensions = function () {
|
17761 | if (this.elementScroll) {
|
17762 | var _a = this.elementRef.nativeElement, scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
17763 | return rxjs.of({ scrollTop: scrollTop, scrollHeight: scrollHeight, clientHeight: clientHeight });
|
17764 | }
|
17765 | return rxjs.forkJoin([this.scrollService.getPosition(), this.dimensionsService.getDimensions()])
|
17766 | .pipe(rxjs_operators.map(function (_a) {
|
17767 | var scrollPosition = _a[0], dimensions = _a[1];
|
17768 | return ({
|
17769 | scrollTop: scrollPosition.y,
|
17770 | scrollHeight: dimensions.scrollHeight,
|
17771 | clientHeight: dimensions.clientHeight,
|
17772 | });
|
17773 | }));
|
17774 | };
|
17775 | NbInfiniteListDirective.prototype.inSyncWithDom = function () {
|
17776 | return this.elementRef.nativeElement.children.length === this.listItems.length;
|
17777 | };
|
17778 | NbInfiniteListDirective.decorators = [
|
17779 | { type: i0.Directive, args: [{
|
17780 | selector: '[nbInfiniteList]',
|
17781 | },] }
|
17782 | ];
|
17783 | NbInfiniteListDirective.ctorParameters = function () { return [
|
17784 | { type: i0.ElementRef },
|
17785 | { type: NbLayoutScrollService },
|
17786 | { type: NbLayoutRulerService }
|
17787 | ]; };
|
17788 | NbInfiniteListDirective.propDecorators = {
|
17789 | threshold: [{ type: i0.Input }],
|
17790 | listenWindowScroll: [{ type: i0.Input }],
|
17791 | bottomThreshold: [{ type: i0.Output }],
|
17792 | topThreshold: [{ type: i0.Output }],
|
17793 | onElementScroll: [{ type: i0.HostListener, args: ['scroll',] }],
|
17794 | listItems: [{ type: i0.ContentChildren, args: [NbListItemComponent,] }]
|
17795 | };
|
17796 | return NbInfiniteListDirective;
|
17797 | }());
|
17798 |
|
17799 | var components = [
|
17800 | NbListComponent,
|
17801 | NbListItemComponent,
|
17802 | NbListPageTrackerDirective,
|
17803 | NbInfiniteListDirective,
|
17804 | ];
|
17805 | var NbListModule = (function () {
|
17806 | function NbListModule() {
|
17807 | }
|
17808 | NbListModule.decorators = [
|
17809 | { type: i0.NgModule, args: [{
|
17810 | declarations: components,
|
17811 | exports: components,
|
17812 | },] }
|
17813 | ];
|
17814 | return NbListModule;
|
17815 | }());
|
17816 |
|
17817 | var NbDirectionality = (function (_super) {
|
17818 | tslib.__extends(NbDirectionality, _super);
|
17819 | function NbDirectionality() {
|
17820 | return _super !== null && _super.apply(this, arguments) || this;
|
17821 | }
|
17822 | NbDirectionality.decorators = [
|
17823 | { type: i0.Injectable }
|
17824 | ];
|
17825 | return NbDirectionality;
|
17826 | }(_angular_cdk_bidi.Directionality));
|
17827 |
|
17828 | var NbBidiModule = (function (_super) {
|
17829 | tslib.__extends(NbBidiModule, _super);
|
17830 | function NbBidiModule() {
|
17831 | return _super !== null && _super.apply(this, arguments) || this;
|
17832 | }
|
17833 | NbBidiModule.decorators = [
|
17834 | { type: i0.NgModule, args: [{
|
17835 | providers: [
|
17836 | { provide: NbDirectionality, useExisting: _angular_cdk_bidi.Directionality },
|
17837 | ],
|
17838 | },] }
|
17839 | ];
|
17840 | return NbBidiModule;
|
17841 | }(_angular_cdk_bidi.BidiModule));
|
17842 |
|
17843 |
|
17844 |
|
17845 |
|
17846 |
|
17847 |
|
17848 |
|
17849 |
|
17850 |
|
17851 |
|
17852 | var NbCellDefDirective = (function (_super) {
|
17853 | tslib.__extends(NbCellDefDirective, _super);
|
17854 | function NbCellDefDirective() {
|
17855 | return _super !== null && _super.apply(this, arguments) || this;
|
17856 | }
|
17857 | NbCellDefDirective.decorators = [
|
17858 | { type: i0.Directive, args: [{
|
17859 | selector: '[nbCellDef]',
|
17860 | providers: [{ provide: _angular_cdk_table.CdkCellDef, useExisting: NbCellDefDirective }],
|
17861 | },] }
|
17862 | ];
|
17863 | return NbCellDefDirective;
|
17864 | }(_angular_cdk_table.CdkCellDef));
|
17865 |
|
17866 |
|
17867 |
|
17868 |
|
17869 | var NbHeaderCellDefDirective = (function (_super) {
|
17870 | tslib.__extends(NbHeaderCellDefDirective, _super);
|
17871 | function NbHeaderCellDefDirective() {
|
17872 | return _super !== null && _super.apply(this, arguments) || this;
|
17873 | }
|
17874 | NbHeaderCellDefDirective.decorators = [
|
17875 | { type: i0.Directive, args: [{
|
17876 | selector: '[nbHeaderCellDef]',
|
17877 | providers: [{ provide: _angular_cdk_table.CdkHeaderCellDef, useExisting: NbHeaderCellDefDirective }],
|
17878 | },] }
|
17879 | ];
|
17880 | return NbHeaderCellDefDirective;
|
17881 | }(_angular_cdk_table.CdkHeaderCellDef));
|
17882 |
|
17883 |
|
17884 |
|
17885 |
|
17886 | var NbFooterCellDefDirective = (function (_super) {
|
17887 | tslib.__extends(NbFooterCellDefDirective, _super);
|
17888 | function NbFooterCellDefDirective() {
|
17889 | return _super !== null && _super.apply(this, arguments) || this;
|
17890 | }
|
17891 | NbFooterCellDefDirective.decorators = [
|
17892 | { type: i0.Directive, args: [{
|
17893 | selector: '[nbFooterCellDef]',
|
17894 | providers: [{ provide: _angular_cdk_table.CdkFooterCellDef, useExisting: NbFooterCellDefDirective }],
|
17895 | },] }
|
17896 | ];
|
17897 | return NbFooterCellDefDirective;
|
17898 | }(_angular_cdk_table.CdkFooterCellDef));
|
17899 | var NB_SORT_HEADER_COLUMN_DEF = new i0.InjectionToken('NB_SORT_HEADER_COLUMN_DEF');
|
17900 |
|
17901 |
|
17902 |
|
17903 |
|
17904 | var NbColumnDefDirective = (function (_super) {
|
17905 | tslib.__extends(NbColumnDefDirective, _super);
|
17906 | function NbColumnDefDirective() {
|
17907 | return _super !== null && _super.apply(this, arguments) || this;
|
17908 | }
|
17909 | Object.defineProperty(NbColumnDefDirective.prototype, "name", {
|
17910 |
|
17911 | get: function () {
|
17912 | return this._name;
|
17913 | },
|
17914 | set: function (value) {
|
17915 | this._setNameInput(value);
|
17916 | },
|
17917 | enumerable: false,
|
17918 | configurable: true
|
17919 | });
|
17920 | Object.defineProperty(NbColumnDefDirective.prototype, "stickyEnd", {
|
17921 |
|
17922 | get: function () {
|
17923 | return this._stickyEnd;
|
17924 | },
|
17925 | set: function (value) {
|
17926 | var prevValue = this._stickyEnd;
|
17927 | this._stickyEnd = _angular_cdk_coercion.coerceBooleanProperty(value);
|
17928 | this._hasStickyChanged = prevValue !== this._stickyEnd;
|
17929 | },
|
17930 | enumerable: false,
|
17931 | configurable: true
|
17932 | });
|
17933 | NbColumnDefDirective.decorators = [
|
17934 | { type: i0.Directive, args: [{
|
17935 | selector: '[nbColumnDef]',
|
17936 | providers: [
|
17937 | { provide: _angular_cdk_table.CdkColumnDef, useExisting: NbColumnDefDirective },
|
17938 | { provide: NB_SORT_HEADER_COLUMN_DEF, useExisting: NbColumnDefDirective },
|
17939 | ],
|
17940 | },] }
|
17941 | ];
|
17942 | NbColumnDefDirective.propDecorators = {
|
17943 | name: [{ type: i0.Input, args: ['nbColumnDef',] }],
|
17944 | sticky: [{ type: i0.Input }],
|
17945 | stickyEnd: [{ type: i0.Input }]
|
17946 | };
|
17947 | return NbColumnDefDirective;
|
17948 | }(_angular_cdk_table.CdkColumnDef));
|
17949 |
|
17950 | var NbHeaderCellDirective = (function (_super) {
|
17951 | tslib.__extends(NbHeaderCellDirective, _super);
|
17952 | function NbHeaderCellDirective(columnDef, elementRef) {
|
17953 | var _this = _super.call(this, columnDef, elementRef) || this;
|
17954 | elementRef.nativeElement.classList.add("nb-column-" + columnDef.cssClassFriendlyName);
|
17955 | return _this;
|
17956 | }
|
17957 | NbHeaderCellDirective.decorators = [
|
17958 | { type: i0.Directive, args: [{
|
17959 | selector: 'nb-header-cell, th[nbHeaderCell]',
|
17960 | host: {
|
17961 | 'class': 'nb-header-cell',
|
17962 | 'role': 'columnheader',
|
17963 | },
|
17964 | },] }
|
17965 | ];
|
17966 | NbHeaderCellDirective.ctorParameters = function () { return [
|
17967 | { type: NbColumnDefDirective },
|
17968 | { type: i0.ElementRef }
|
17969 | ]; };
|
17970 | return NbHeaderCellDirective;
|
17971 | }(_angular_cdk_table.CdkHeaderCell));
|
17972 |
|
17973 | var NbFooterCellDirective = (function (_super) {
|
17974 | tslib.__extends(NbFooterCellDirective, _super);
|
17975 | function NbFooterCellDirective(columnDef, elementRef) {
|
17976 | var _this = _super.call(this, columnDef, elementRef) || this;
|
17977 | elementRef.nativeElement.classList.add("nb-column-" + columnDef.cssClassFriendlyName);
|
17978 | return _this;
|
17979 | }
|
17980 | NbFooterCellDirective.decorators = [
|
17981 | { type: i0.Directive, args: [{
|
17982 | selector: 'nb-footer-cell, td[nbFooterCell]',
|
17983 | host: {
|
17984 | 'class': 'nb-footer-cell',
|
17985 | 'role': 'gridcell',
|
17986 | },
|
17987 | },] }
|
17988 | ];
|
17989 | NbFooterCellDirective.ctorParameters = function () { return [
|
17990 | { type: NbColumnDefDirective },
|
17991 | { type: i0.ElementRef }
|
17992 | ]; };
|
17993 | return NbFooterCellDirective;
|
17994 | }(_angular_cdk_table.CdkFooterCell));
|
17995 |
|
17996 | var NbCellDirective = (function (_super) {
|
17997 | tslib.__extends(NbCellDirective, _super);
|
17998 | function NbCellDirective(columnDef, elementRef) {
|
17999 | var _this = _super.call(this, columnDef, elementRef) || this;
|
18000 | elementRef.nativeElement.classList.add("nb-column-" + columnDef.cssClassFriendlyName);
|
18001 | return _this;
|
18002 | }
|
18003 | NbCellDirective.decorators = [
|
18004 | { type: i0.Directive, args: [{
|
18005 | selector: 'nb-cell, td[nbCell]',
|
18006 | host: {
|
18007 | 'class': 'nb-cell',
|
18008 | 'role': 'gridcell',
|
18009 | },
|
18010 | },] }
|
18011 | ];
|
18012 | NbCellDirective.ctorParameters = function () { return [
|
18013 | { type: NbColumnDefDirective },
|
18014 | { type: i0.ElementRef }
|
18015 | ]; };
|
18016 | return NbCellDirective;
|
18017 | }(_angular_cdk_table.CdkCell));
|
18018 |
|
18019 | var NbDataSource = (function (_super) {
|
18020 | tslib.__extends(NbDataSource, _super);
|
18021 | function NbDataSource() {
|
18022 | return _super !== null && _super.apply(this, arguments) || this;
|
18023 | }
|
18024 | return NbDataSource;
|
18025 | }(_angular_cdk_table.DataSource));
|
18026 |
|
18027 | var NbDataRowOutletDirective = (function (_super) {
|
18028 | tslib.__extends(NbDataRowOutletDirective, _super);
|
18029 | function NbDataRowOutletDirective() {
|
18030 | return _super !== null && _super.apply(this, arguments) || this;
|
18031 | }
|
18032 | NbDataRowOutletDirective.decorators = [
|
18033 | { type: i0.Directive, args: [{
|
18034 | selector: '[nbRowOutlet]',
|
18035 | providers: [{ provide: _angular_cdk_table.DataRowOutlet, useExisting: NbDataRowOutletDirective }],
|
18036 | },] }
|
18037 | ];
|
18038 | return NbDataRowOutletDirective;
|
18039 | }(_angular_cdk_table.DataRowOutlet));
|
18040 | var NbHeaderRowOutletDirective = (function (_super) {
|
18041 | tslib.__extends(NbHeaderRowOutletDirective, _super);
|
18042 | function NbHeaderRowOutletDirective() {
|
18043 | return _super !== null && _super.apply(this, arguments) || this;
|
18044 | }
|
18045 | NbHeaderRowOutletDirective.decorators = [
|
18046 | { type: i0.Directive, args: [{
|
18047 | selector: '[nbHeaderRowOutlet]',
|
18048 | providers: [{ provide: _angular_cdk_table.HeaderRowOutlet, useExisting: NbHeaderRowOutletDirective }],
|
18049 | },] }
|
18050 | ];
|
18051 | return NbHeaderRowOutletDirective;
|
18052 | }(_angular_cdk_table.HeaderRowOutlet));
|
18053 | var NbFooterRowOutletDirective = (function (_super) {
|
18054 | tslib.__extends(NbFooterRowOutletDirective, _super);
|
18055 | function NbFooterRowOutletDirective() {
|
18056 | return _super !== null && _super.apply(this, arguments) || this;
|
18057 | }
|
18058 | NbFooterRowOutletDirective.decorators = [
|
18059 | { type: i0.Directive, args: [{
|
18060 | selector: '[nbFooterRowOutlet]',
|
18061 | providers: [{ provide: _angular_cdk_table.FooterRowOutlet, useExisting: NbFooterRowOutletDirective }],
|
18062 | },] }
|
18063 | ];
|
18064 | return NbFooterRowOutletDirective;
|
18065 | }(_angular_cdk_table.FooterRowOutlet));
|
18066 | var NbNoDataRowOutletDirective = (function (_super) {
|
18067 | tslib.__extends(NbNoDataRowOutletDirective, _super);
|
18068 | function NbNoDataRowOutletDirective() {
|
18069 | return _super !== null && _super.apply(this, arguments) || this;
|
18070 | }
|
18071 | NbNoDataRowOutletDirective.decorators = [
|
18072 | { type: i0.Directive, args: [{
|
18073 | selector: '[nbNoDataRowOutlet]',
|
18074 | providers: [{ provide: _angular_cdk_table.NoDataRowOutlet, useExisting: NbNoDataRowOutletDirective }],
|
18075 | },] }
|
18076 | ];
|
18077 | return NbNoDataRowOutletDirective;
|
18078 | }(_angular_cdk_table.NoDataRowOutlet));
|
18079 | var NbCellOutletDirective = (function (_super) {
|
18080 | tslib.__extends(NbCellOutletDirective, _super);
|
18081 | function NbCellOutletDirective() {
|
18082 | return _super !== null && _super.apply(this, arguments) || this;
|
18083 | }
|
18084 | NbCellOutletDirective.decorators = [
|
18085 | { type: i0.Directive, args: [{
|
18086 | selector: '[nbCellOutlet]',
|
18087 | providers: [{ provide: _angular_cdk_table.CdkCellOutlet, useExisting: NbCellOutletDirective }],
|
18088 | },] }
|
18089 | ];
|
18090 | return NbCellOutletDirective;
|
18091 | }(_angular_cdk_table.CdkCellOutlet));
|
18092 |
|
18093 |
|
18094 |
|
18095 |
|
18096 | var NbHeaderRowDefDirective = (function (_super) {
|
18097 | tslib.__extends(NbHeaderRowDefDirective, _super);
|
18098 | function NbHeaderRowDefDirective() {
|
18099 | return _super !== null && _super.apply(this, arguments) || this;
|
18100 | }
|
18101 | NbHeaderRowDefDirective.decorators = [
|
18102 | { type: i0.Directive, args: [{
|
18103 | selector: '[nbHeaderRowDef]',
|
18104 | providers: [{ provide: _angular_cdk_table.CdkHeaderRowDef, useExisting: NbHeaderRowDefDirective }],
|
18105 | },] }
|
18106 | ];
|
18107 | NbHeaderRowDefDirective.propDecorators = {
|
18108 | columns: [{ type: i0.Input, args: ['nbHeaderRowDef',] }],
|
18109 | sticky: [{ type: i0.Input, args: ['nbHeaderRowDefSticky',] }]
|
18110 | };
|
18111 | return NbHeaderRowDefDirective;
|
18112 | }(_angular_cdk_table.CdkHeaderRowDef));
|
18113 |
|
18114 |
|
18115 |
|
18116 |
|
18117 | var NbFooterRowDefDirective = (function (_super) {
|
18118 | tslib.__extends(NbFooterRowDefDirective, _super);
|
18119 | function NbFooterRowDefDirective() {
|
18120 | return _super !== null && _super.apply(this, arguments) || this;
|
18121 | }
|
18122 | NbFooterRowDefDirective.decorators = [
|
18123 | { type: i0.Directive, args: [{
|
18124 | selector: '[nbFooterRowDef]',
|
18125 | providers: [{ provide: _angular_cdk_table.CdkFooterRowDef, useExisting: NbFooterRowDefDirective }],
|
18126 | },] }
|
18127 | ];
|
18128 | NbFooterRowDefDirective.propDecorators = {
|
18129 | columns: [{ type: i0.Input, args: ['nbFooterRowDef',] }],
|
18130 | sticky: [{ type: i0.Input, args: ['nbFooterRowDefSticky',] }]
|
18131 | };
|
18132 | return NbFooterRowDefDirective;
|
18133 | }(_angular_cdk_table.CdkFooterRowDef));
|
18134 |
|
18135 |
|
18136 |
|
18137 |
|
18138 |
|
18139 | var NbRowDefDirective = (function (_super) {
|
18140 | tslib.__extends(NbRowDefDirective, _super);
|
18141 | function NbRowDefDirective() {
|
18142 | return _super !== null && _super.apply(this, arguments) || this;
|
18143 | }
|
18144 | NbRowDefDirective.decorators = [
|
18145 | { type: i0.Directive, args: [{
|
18146 | selector: '[nbRowDef]',
|
18147 | providers: [{ provide: _angular_cdk_table.CdkRowDef, useExisting: NbRowDefDirective }],
|
18148 | },] }
|
18149 | ];
|
18150 | NbRowDefDirective.propDecorators = {
|
18151 | columns: [{ type: i0.Input, args: ['nbRowDefColumns',] }],
|
18152 | when: [{ type: i0.Input, args: ['nbRowDefWhen',] }]
|
18153 | };
|
18154 | return NbRowDefDirective;
|
18155 | }(_angular_cdk_table.CdkRowDef));
|
18156 |
|
18157 | var NbHeaderRowComponent = (function (_super) {
|
18158 | tslib.__extends(NbHeaderRowComponent, _super);
|
18159 | function NbHeaderRowComponent() {
|
18160 | return _super !== null && _super.apply(this, arguments) || this;
|
18161 | }
|
18162 | NbHeaderRowComponent.decorators = [
|
18163 | { type: i0.Component, args: [{
|
18164 | selector: 'nb-header-row, tr[nbHeaderRow]',
|
18165 | template: "\n <ng-container nbCellOutlet></ng-container>",
|
18166 | host: {
|
18167 | 'class': 'nb-header-row',
|
18168 | 'role': 'row',
|
18169 | },
|
18170 | providers: [{ provide: _angular_cdk_table.CdkHeaderRow, useExisting: NbHeaderRowComponent }]
|
18171 | },] }
|
18172 | ];
|
18173 | return NbHeaderRowComponent;
|
18174 | }(_angular_cdk_table.CdkHeaderRow));
|
18175 |
|
18176 | var NbFooterRowComponent = (function (_super) {
|
18177 | tslib.__extends(NbFooterRowComponent, _super);
|
18178 | function NbFooterRowComponent() {
|
18179 | return _super !== null && _super.apply(this, arguments) || this;
|
18180 | }
|
18181 | NbFooterRowComponent.decorators = [
|
18182 | { type: i0.Component, args: [{
|
18183 | selector: 'nb-footer-row, tr[nbFooterRow]',
|
18184 | template: "\n <ng-container nbCellOutlet></ng-container>",
|
18185 | host: {
|
18186 | 'class': 'nb-footer-row',
|
18187 | 'role': 'row',
|
18188 | },
|
18189 | providers: [{ provide: _angular_cdk_table.CdkFooterRow, useExisting: NbFooterRowComponent }]
|
18190 | },] }
|
18191 | ];
|
18192 | return NbFooterRowComponent;
|
18193 | }(_angular_cdk_table.CdkFooterRow));
|
18194 |
|
18195 | var NbRowComponent = (function (_super) {
|
18196 | tslib.__extends(NbRowComponent, _super);
|
18197 | function NbRowComponent() {
|
18198 | return _super !== null && _super.apply(this, arguments) || this;
|
18199 | }
|
18200 | NbRowComponent.decorators = [
|
18201 | { type: i0.Component, args: [{
|
18202 | selector: 'nb-row, tr[nbRow]',
|
18203 | template: "\n <ng-container nbCellOutlet></ng-container>",
|
18204 | host: {
|
18205 | 'class': 'nb-row',
|
18206 | 'role': 'row',
|
18207 | },
|
18208 | providers: [{ provide: _angular_cdk_table.CdkRow, useExisting: NbRowComponent }]
|
18209 | },] }
|
18210 | ];
|
18211 | return NbRowComponent;
|
18212 | }(_angular_cdk_table.CdkRow));
|
18213 |
|
18214 | var NbCdkRowDef = _angular_cdk_table.CdkRowDef;
|
18215 | var NbCdkRow = _angular_cdk_table.CdkRow;
|
18216 | var NbCdkCellDef = _angular_cdk_table.CdkCellDef;
|
18217 | var NbCdkHeaderRowDef = _angular_cdk_table.CdkHeaderRowDef;
|
18218 | var NbCdkHeaderRow = _angular_cdk_table.CdkHeaderRow;
|
18219 | var NbCdkHeaderCellDef = _angular_cdk_table.CdkHeaderCellDef;
|
18220 | var NbCdkFooterRowDef = _angular_cdk_table.CdkFooterRowDef;
|
18221 | var NbCdkFooterRow = _angular_cdk_table.CdkFooterRow;
|
18222 | var NbCdkFooterCellDef = _angular_cdk_table.CdkFooterCellDef;
|
18223 | var NbCdkColumnDef = _angular_cdk_table.CdkColumnDef;
|
18224 | var NbCdkCell = _angular_cdk_table.CdkCell;
|
18225 | var NbCdkHeaderCell = _angular_cdk_table.CdkHeaderCell;
|
18226 | var NbCdkFooterCell = _angular_cdk_table.CdkFooterCell;
|
18227 | var NB_STICKY_POSITIONING_LISTENER = _angular_cdk_table.STICKY_POSITIONING_LISTENER;
|
18228 |
|
18229 | var NB_TABLE_TEMPLATE = "\n <ng-container nbHeaderRowOutlet></ng-container>\n <ng-container nbRowOutlet></ng-container>\n <ng-container nbNoDataRowOutlet></ng-container>\n <ng-container nbFooterRowOutlet></ng-container>\n";
|
18230 | var NB_VIEW_REPEATER_STRATEGY = _angular_cdk_collections._VIEW_REPEATER_STRATEGY;
|
18231 | var NB_COALESCED_STYLE_SCHEDULER = _angular_cdk_table._COALESCED_STYLE_SCHEDULER;
|
18232 | var NB_TABLE_PROVIDERS = [
|
18233 | { provide: NB_VIEW_REPEATER_STRATEGY, useClass: _angular_cdk_collections._DisposeViewRepeaterStrategy },
|
18234 | { provide: NB_COALESCED_STYLE_SCHEDULER, useClass: _angular_cdk_table._CoalescedStyleScheduler },
|
18235 | ];
|
18236 | var NbTable = (function (_super) {
|
18237 | tslib.__extends(NbTable, _super);
|
18238 | function NbTable(differs, changeDetectorRef, elementRef, role, dir, document, platform, _viewRepeater, _coalescedStyleScheduler, _viewportRuler, _stickyPositioningListener) {
|
18239 | var _this = _super.call(this, differs, changeDetectorRef, elementRef, role, dir, document, platform, _viewRepeater, _coalescedStyleScheduler, _viewportRuler, _stickyPositioningListener) || this;
|
18240 | _this._viewRepeater = _viewRepeater;
|
18241 | _this._coalescedStyleScheduler = _coalescedStyleScheduler;
|
18242 | _this._stickyPositioningListener = _stickyPositioningListener;
|
18243 | return _this;
|
18244 | }
|
18245 | NbTable.decorators = [
|
18246 | { type: i0.Component, args: [{
|
18247 | selector: 'nb-table-not-implemented',
|
18248 | template: "",
|
18249 | providers: NB_TABLE_PROVIDERS
|
18250 | },] }
|
18251 | ];
|
18252 | NbTable.ctorParameters = function () { return [
|
18253 | { type: i0.IterableDiffers },
|
18254 | { type: i0.ChangeDetectorRef },
|
18255 | { type: i0.ElementRef },
|
18256 | { type: String, decorators: [{ type: i0.Attribute, args: ['role',] }] },
|
18257 | { type: NbDirectionality },
|
18258 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
18259 | { type: NbPlatform },
|
18260 | { type: undefined, decorators: [{ type: i0.Inject, args: [_angular_cdk_collections._VIEW_REPEATER_STRATEGY,] }] },
|
18261 | { type: _angular_cdk_table._CoalescedStyleScheduler, decorators: [{ type: i0.Inject, args: [_angular_cdk_table._COALESCED_STYLE_SCHEDULER,] }] },
|
18262 | { type: NbViewportRulerAdapter },
|
18263 | { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }, { type: i0.Inject, args: [NB_STICKY_POSITIONING_LISTENER,] }] }
|
18264 | ]; };
|
18265 | return NbTable;
|
18266 | }(_angular_cdk_table.CdkTable));
|
18267 | var COMPONENTS$1 = [
|
18268 | NbTable,
|
18269 |
|
18270 | NbHeaderCellDefDirective,
|
18271 | NbHeaderRowDefDirective,
|
18272 | NbColumnDefDirective,
|
18273 | NbCellDefDirective,
|
18274 | NbRowDefDirective,
|
18275 | NbFooterCellDefDirective,
|
18276 | NbFooterRowDefDirective,
|
18277 |
|
18278 | NbDataRowOutletDirective,
|
18279 | NbHeaderRowOutletDirective,
|
18280 | NbFooterRowOutletDirective,
|
18281 | NbNoDataRowOutletDirective,
|
18282 | NbCellOutletDirective,
|
18283 |
|
18284 | NbHeaderCellDirective,
|
18285 | NbCellDirective,
|
18286 | NbFooterCellDirective,
|
18287 |
|
18288 | NbHeaderRowComponent,
|
18289 | NbRowComponent,
|
18290 | NbFooterRowComponent,
|
18291 | ];
|
18292 | var NbTableModule = (function (_super) {
|
18293 | tslib.__extends(NbTableModule, _super);
|
18294 | function NbTableModule() {
|
18295 | return _super !== null && _super.apply(this, arguments) || this;
|
18296 | }
|
18297 | NbTableModule.decorators = [
|
18298 | { type: i0.NgModule, args: [{
|
18299 | imports: [NbBidiModule],
|
18300 | declarations: tslib.__spreadArray([], COMPONENTS$1),
|
18301 | exports: tslib.__spreadArray([], COMPONENTS$1),
|
18302 | },] }
|
18303 | ];
|
18304 | return NbTableModule;
|
18305 | }(_angular_cdk_table.CdkTableModule));
|
18306 |
|
18307 |
|
18308 |
|
18309 |
|
18310 |
|
18311 |
|
18312 | var NB_DIALOG_CONFIG = new i0.InjectionToken('Default dialog options');
|
18313 |
|
18314 |
|
18315 |
|
18316 | var NbDialogConfig = (function () {
|
18317 | function NbDialogConfig(config) {
|
18318 | |
18319 |
|
18320 |
|
18321 | this.hasBackdrop = true;
|
18322 | |
18323 |
|
18324 |
|
18325 | this.backdropClass = 'overlay-backdrop';
|
18326 | |
18327 |
|
18328 |
|
18329 | this.dialogClass = '';
|
18330 | |
18331 |
|
18332 |
|
18333 | this.closeOnBackdropClick = true;
|
18334 | |
18335 |
|
18336 |
|
18337 | this.closeOnEsc = true;
|
18338 | |
18339 |
|
18340 |
|
18341 | this.hasScroll = false;
|
18342 | |
18343 |
|
18344 |
|
18345 | this.autoFocus = true;
|
18346 | Object.assign(this, config);
|
18347 | }
|
18348 | return NbDialogConfig;
|
18349 | }());
|
18350 |
|
18351 |
|
18352 |
|
18353 |
|
18354 |
|
18355 |
|
18356 |
|
18357 |
|
18358 |
|
18359 |
|
18360 |
|
18361 |
|
18362 | var NbDialogRef = (function () {
|
18363 | function NbDialogRef(overlayRef) {
|
18364 | this.overlayRef = overlayRef;
|
18365 | this.onClose$ = new rxjs.Subject();
|
18366 | this.onClose = this.onClose$.asObservable();
|
18367 | this.onBackdropClick = this.overlayRef.backdropClick();
|
18368 | }
|
18369 | |
18370 |
|
18371 |
|
18372 | NbDialogRef.prototype.close = function (res) {
|
18373 | this.overlayRef.detach();
|
18374 | this.overlayRef.dispose();
|
18375 | this.onClose$.next(res);
|
18376 | this.onClose$.complete();
|
18377 | };
|
18378 | return NbDialogRef;
|
18379 | }());
|
18380 |
|
18381 |
|
18382 |
|
18383 |
|
18384 |
|
18385 |
|
18386 |
|
18387 |
|
18388 |
|
18389 |
|
18390 |
|
18391 | var NbDialogContainerComponent = (function () {
|
18392 | function NbDialogContainerComponent(config, elementRef, focusTrapFactory) {
|
18393 | this.config = config;
|
18394 | this.elementRef = elementRef;
|
18395 | this.focusTrapFactory = focusTrapFactory;
|
18396 | }
|
18397 | NbDialogContainerComponent.prototype.ngOnInit = function () {
|
18398 | if (this.config.autoFocus) {
|
18399 | this.focusTrap = this.focusTrapFactory.create(this.elementRef.nativeElement);
|
18400 | this.focusTrap.blurPreviouslyFocusedElement();
|
18401 | this.focusTrap.focusInitialElement();
|
18402 | }
|
18403 | };
|
18404 | NbDialogContainerComponent.prototype.ngOnDestroy = function () {
|
18405 | if (this.config.autoFocus && this.focusTrap) {
|
18406 | this.focusTrap.restoreFocus();
|
18407 | }
|
18408 | };
|
18409 | NbDialogContainerComponent.prototype.attachComponentPortal = function (portal) {
|
18410 | return this.portalOutlet.attachComponentPortal(portal);
|
18411 | };
|
18412 | NbDialogContainerComponent.prototype.attachTemplatePortal = function (portal) {
|
18413 | return this.portalOutlet.attachTemplatePortal(portal);
|
18414 | };
|
18415 | NbDialogContainerComponent.decorators = [
|
18416 | { type: i0.Component, args: [{
|
18417 | selector: 'nb-dialog-container',
|
18418 | template: '<ng-template nbPortalOutlet></ng-template>'
|
18419 | },] }
|
18420 | ];
|
18421 | NbDialogContainerComponent.ctorParameters = function () { return [
|
18422 | { type: NbDialogConfig },
|
18423 | { type: i0.ElementRef },
|
18424 | { type: NbFocusTrapFactoryService }
|
18425 | ]; };
|
18426 | NbDialogContainerComponent.propDecorators = {
|
18427 | portalOutlet: [{ type: i0.ViewChild, args: [NbPortalOutletDirective, { static: true },] }]
|
18428 | };
|
18429 | return NbDialogContainerComponent;
|
18430 | }());
|
18431 |
|
18432 |
|
18433 |
|
18434 |
|
18435 |
|
18436 |
|
18437 |
|
18438 |
|
18439 |
|
18440 |
|
18441 |
|
18442 |
|
18443 |
|
18444 |
|
18445 |
|
18446 |
|
18447 |
|
18448 |
|
18449 |
|
18450 |
|
18451 |
|
18452 |
|
18453 |
|
18454 |
|
18455 |
|
18456 |
|
18457 |
|
18458 |
|
18459 |
|
18460 |
|
18461 |
|
18462 |
|
18463 |
|
18464 |
|
18465 |
|
18466 |
|
18467 |
|
18468 |
|
18469 |
|
18470 |
|
18471 |
|
18472 |
|
18473 |
|
18474 |
|
18475 |
|
18476 |
|
18477 |
|
18478 |
|
18479 |
|
18480 |
|
18481 |
|
18482 |
|
18483 |
|
18484 |
|
18485 |
|
18486 |
|
18487 |
|
18488 |
|
18489 |
|
18490 |
|
18491 |
|
18492 |
|
18493 |
|
18494 |
|
18495 |
|
18496 |
|
18497 |
|
18498 |
|
18499 |
|
18500 |
|
18501 |
|
18502 |
|
18503 |
|
18504 |
|
18505 |
|
18506 |
|
18507 |
|
18508 |
|
18509 |
|
18510 |
|
18511 |
|
18512 |
|
18513 |
|
18514 |
|
18515 |
|
18516 |
|
18517 |
|
18518 |
|
18519 |
|
18520 |
|
18521 |
|
18522 |
|
18523 |
|
18524 |
|
18525 |
|
18526 |
|
18527 |
|
18528 |
|
18529 |
|
18530 |
|
18531 |
|
18532 |
|
18533 |
|
18534 |
|
18535 |
|
18536 |
|
18537 |
|
18538 |
|
18539 |
|
18540 |
|
18541 |
|
18542 |
|
18543 |
|
18544 |
|
18545 |
|
18546 |
|
18547 |
|
18548 |
|
18549 |
|
18550 | var NbDialogService = (function () {
|
18551 | function NbDialogService(document, globalConfig, positionBuilder, overlay, injector, cfr) {
|
18552 | this.document = document;
|
18553 | this.globalConfig = globalConfig;
|
18554 | this.positionBuilder = positionBuilder;
|
18555 | this.overlay = overlay;
|
18556 | this.injector = injector;
|
18557 | this.cfr = cfr;
|
18558 | }
|
18559 | |
18560 |
|
18561 |
|
18562 | NbDialogService.prototype.open = function (content, userConfig) {
|
18563 | if (userConfig === void 0) { userConfig = {}; }
|
18564 | var config = new NbDialogConfig(tslib.__assign(tslib.__assign({}, this.globalConfig), userConfig));
|
18565 | var overlayRef = this.createOverlay(config);
|
18566 | var dialogRef = new NbDialogRef(overlayRef);
|
18567 | var container = this.createContainer(config, overlayRef);
|
18568 | this.createContent(config, content, container, dialogRef);
|
18569 | this.registerCloseListeners(config, overlayRef, dialogRef);
|
18570 | return dialogRef;
|
18571 | };
|
18572 | NbDialogService.prototype.createOverlay = function (config) {
|
18573 | var positionStrategy = this.createPositionStrategy();
|
18574 | var scrollStrategy = this.createScrollStrategy(config.hasScroll);
|
18575 | return this.overlay.create({
|
18576 | positionStrategy: positionStrategy,
|
18577 | scrollStrategy: scrollStrategy,
|
18578 | hasBackdrop: config.hasBackdrop,
|
18579 | backdropClass: config.backdropClass,
|
18580 | panelClass: config.dialogClass,
|
18581 | });
|
18582 | };
|
18583 | NbDialogService.prototype.createPositionStrategy = function () {
|
18584 | return this.positionBuilder
|
18585 | .global()
|
18586 | .centerVertically()
|
18587 | .centerHorizontally();
|
18588 | };
|
18589 | NbDialogService.prototype.createScrollStrategy = function (hasScroll) {
|
18590 | if (hasScroll) {
|
18591 | return this.overlay.scrollStrategies.noop();
|
18592 | }
|
18593 | else {
|
18594 | return this.overlay.scrollStrategies.block();
|
18595 | }
|
18596 | };
|
18597 | NbDialogService.prototype.createContainer = function (config, overlayRef) {
|
18598 | var injector = new NbPortalInjector(this.createInjector(config), new WeakMap([[NbDialogConfig, config]]));
|
18599 | var containerPortal = new NbComponentPortal(NbDialogContainerComponent, null, injector, this.cfr);
|
18600 | var containerRef = overlayRef.attach(containerPortal);
|
18601 | return containerRef.instance;
|
18602 | };
|
18603 | NbDialogService.prototype.createContent = function (config, content, container, dialogRef) {
|
18604 | if (content instanceof i0.TemplateRef) {
|
18605 | var portal = this.createTemplatePortal(config, content, dialogRef);
|
18606 | container.attachTemplatePortal(portal);
|
18607 | }
|
18608 | else {
|
18609 | var portal = this.createComponentPortal(config, content, dialogRef);
|
18610 | dialogRef.componentRef = container.attachComponentPortal(portal);
|
18611 | if (config.context) {
|
18612 | Object.assign(dialogRef.componentRef.instance, tslib.__assign({}, config.context));
|
18613 | }
|
18614 | }
|
18615 | };
|
18616 | NbDialogService.prototype.createTemplatePortal = function (config, content, dialogRef) {
|
18617 | return new NbTemplatePortal(content, null, { $implicit: config.context, dialogRef: dialogRef });
|
18618 | };
|
18619 | |
18620 |
|
18621 |
|
18622 |
|
18623 | NbDialogService.prototype.createComponentPortal = function (config, content, dialogRef) {
|
18624 | var injector = this.createInjector(config);
|
18625 | var portalInjector = new NbPortalInjector(injector, new WeakMap([[NbDialogRef, dialogRef]]));
|
18626 | return new NbComponentPortal(content, config.viewContainerRef, portalInjector);
|
18627 | };
|
18628 | NbDialogService.prototype.createInjector = function (config) {
|
18629 | return config.viewContainerRef && config.viewContainerRef.injector || this.injector;
|
18630 | };
|
18631 | NbDialogService.prototype.registerCloseListeners = function (config, overlayRef, dialogRef) {
|
18632 | if (config.closeOnBackdropClick) {
|
18633 | overlayRef.backdropClick().subscribe(function () { return dialogRef.close(); });
|
18634 | }
|
18635 | if (config.closeOnEsc) {
|
18636 | rxjs.fromEvent(this.document, 'keyup')
|
18637 | .pipe(rxjs_operators.filter(function (event) { return event.keyCode === 27; }), rxjs_operators.takeUntil(dialogRef.onClose))
|
18638 | .subscribe(function () { return dialogRef.close(); });
|
18639 | }
|
18640 | };
|
18641 | NbDialogService.decorators = [
|
18642 | { type: i0.Injectable }
|
18643 | ];
|
18644 | NbDialogService.ctorParameters = function () { return [
|
18645 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
18646 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DIALOG_CONFIG,] }] },
|
18647 | { type: NbPositionBuilderService },
|
18648 | { type: NbOverlayService },
|
18649 | { type: i0.Injector },
|
18650 | { type: i0.ComponentFactoryResolver }
|
18651 | ]; };
|
18652 | return NbDialogService;
|
18653 | }());
|
18654 |
|
18655 |
|
18656 |
|
18657 |
|
18658 |
|
18659 |
|
18660 | var NbDialogModule = (function () {
|
18661 | function NbDialogModule() {
|
18662 | }
|
18663 | NbDialogModule.forRoot = function (dialogConfig) {
|
18664 | if (dialogConfig === void 0) { dialogConfig = {}; }
|
18665 | return {
|
18666 | ngModule: NbDialogModule,
|
18667 | providers: [
|
18668 | NbDialogService,
|
18669 | { provide: NB_DIALOG_CONFIG, useValue: dialogConfig },
|
18670 | ],
|
18671 | };
|
18672 | };
|
18673 | NbDialogModule.forChild = function (dialogConfig) {
|
18674 | if (dialogConfig === void 0) { dialogConfig = {}; }
|
18675 | return {
|
18676 | ngModule: NbDialogModule,
|
18677 | providers: [
|
18678 | NbDialogService,
|
18679 | { provide: NB_DIALOG_CONFIG, useValue: dialogConfig },
|
18680 | ],
|
18681 | };
|
18682 | };
|
18683 | NbDialogModule.decorators = [
|
18684 | { type: i0.NgModule, args: [{
|
18685 | imports: [NbSharedModule, NbOverlayModule],
|
18686 | declarations: [NbDialogContainerComponent],
|
18687 | entryComponents: [NbDialogContainerComponent],
|
18688 | },] }
|
18689 | ];
|
18690 | return NbDialogModule;
|
18691 | }());
|
18692 |
|
18693 |
|
18694 |
|
18695 |
|
18696 |
|
18697 |
|
18698 |
|
18699 |
|
18700 |
|
18701 |
|
18702 |
|
18703 |
|
18704 |
|
18705 |
|
18706 |
|
18707 |
|
18708 |
|
18709 |
|
18710 |
|
18711 |
|
18712 |
|
18713 |
|
18714 |
|
18715 |
|
18716 |
|
18717 |
|
18718 |
|
18719 |
|
18720 |
|
18721 |
|
18722 |
|
18723 |
|
18724 |
|
18725 |
|
18726 |
|
18727 |
|
18728 |
|
18729 |
|
18730 |
|
18731 |
|
18732 |
|
18733 |
|
18734 |
|
18735 |
|
18736 |
|
18737 |
|
18738 |
|
18739 |
|
18740 |
|
18741 |
|
18742 |
|
18743 |
|
18744 |
|
18745 |
|
18746 |
|
18747 |
|
18748 |
|
18749 |
|
18750 |
|
18751 |
|
18752 |
|
18753 |
|
18754 |
|
18755 |
|
18756 |
|
18757 |
|
18758 |
|
18759 |
|
18760 |
|
18761 |
|
18762 |
|
18763 |
|
18764 |
|
18765 |
|
18766 | var NbToastComponent = (function () {
|
18767 | function NbToastComponent(renderer, elementRef, statusService) {
|
18768 | this.renderer = renderer;
|
18769 | this.elementRef = elementRef;
|
18770 | this.statusService = statusService;
|
18771 | this.destroy = new i0.EventEmitter();
|
18772 | }
|
18773 | Object.defineProperty(NbToastComponent.prototype, "success", {
|
18774 | get: function () {
|
18775 | return this.toast.config.status === 'success';
|
18776 | },
|
18777 | enumerable: false,
|
18778 | configurable: true
|
18779 | });
|
18780 | Object.defineProperty(NbToastComponent.prototype, "info", {
|
18781 | get: function () {
|
18782 | return this.toast.config.status === 'info';
|
18783 | },
|
18784 | enumerable: false,
|
18785 | configurable: true
|
18786 | });
|
18787 | Object.defineProperty(NbToastComponent.prototype, "warning", {
|
18788 | get: function () {
|
18789 | return this.toast.config.status === 'warning';
|
18790 | },
|
18791 | enumerable: false,
|
18792 | configurable: true
|
18793 | });
|
18794 | Object.defineProperty(NbToastComponent.prototype, "primary", {
|
18795 | get: function () {
|
18796 | return this.toast.config.status === 'primary';
|
18797 | },
|
18798 | enumerable: false,
|
18799 | configurable: true
|
18800 | });
|
18801 | Object.defineProperty(NbToastComponent.prototype, "danger", {
|
18802 | get: function () {
|
18803 | return this.toast.config.status === 'danger';
|
18804 | },
|
18805 | enumerable: false,
|
18806 | configurable: true
|
18807 | });
|
18808 | Object.defineProperty(NbToastComponent.prototype, "basic", {
|
18809 | get: function () {
|
18810 | return this.toast.config.status === 'basic';
|
18811 | },
|
18812 | enumerable: false,
|
18813 | configurable: true
|
18814 | });
|
18815 | Object.defineProperty(NbToastComponent.prototype, "control", {
|
18816 | get: function () {
|
18817 | return this.toast.config.status === 'control';
|
18818 | },
|
18819 | enumerable: false,
|
18820 | configurable: true
|
18821 | });
|
18822 | Object.defineProperty(NbToastComponent.prototype, "destroyByClick", {
|
18823 | get: function () {
|
18824 | return this.toast.config.destroyByClick;
|
18825 | },
|
18826 | enumerable: false,
|
18827 | configurable: true
|
18828 | });
|
18829 | Object.defineProperty(NbToastComponent.prototype, "hasIcon", {
|
18830 | get: function () {
|
18831 | var icon = this.toast.config.icon;
|
18832 | if (typeof icon === 'string') {
|
18833 | return true;
|
18834 | }
|
18835 | return !!(icon && icon.icon);
|
18836 | },
|
18837 | enumerable: false,
|
18838 | configurable: true
|
18839 | });
|
18840 | Object.defineProperty(NbToastComponent.prototype, "customIcon", {
|
18841 | get: function () {
|
18842 | return !!this.icon;
|
18843 | },
|
18844 | enumerable: false,
|
18845 | configurable: true
|
18846 | });
|
18847 | Object.defineProperty(NbToastComponent.prototype, "icon", {
|
18848 | get: function () {
|
18849 | return this.toast.config.icon;
|
18850 | },
|
18851 | enumerable: false,
|
18852 | configurable: true
|
18853 | });
|
18854 | Object.defineProperty(NbToastComponent.prototype, "additionalClasses", {
|
18855 | get: function () {
|
18856 | if (this.statusService.isCustomStatus(this.toast.config.status)) {
|
18857 | return [this.statusService.getStatusClass(this.toast.config.status)];
|
18858 | }
|
18859 | return [];
|
18860 | },
|
18861 | enumerable: false,
|
18862 | configurable: true
|
18863 | });
|
18864 | NbToastComponent.prototype.onClick = function () {
|
18865 | this.destroy.emit();
|
18866 | };
|
18867 | NbToastComponent.prototype.ngOnInit = function () {
|
18868 | if (this.toast.config.toastClass) {
|
18869 | this.renderer.addClass(this.elementRef.nativeElement, this.toast.config.toastClass);
|
18870 | }
|
18871 | };
|
18872 | NbToastComponent.decorators = [
|
18873 | { type: i0.Component, args: [{
|
18874 | selector: 'nb-toast',
|
18875 | template: "<div class=\"icon-container\" *ngIf=\"hasIcon && icon\">\n <nb-icon [config]=\"icon\"></nb-icon>\n</div>\n<div class=\"content-container\">\n <span class=\"title subtitle\">{{ toast.title }}</span>\n <div class=\"message\">{{ toast.message }}</div>\n</div>\n",
|
18876 | styles: [":host{display:flex;align-items:center;width:25rem;margin:0.5rem}:host .title{margin-right:0.25rem}:host.default .content-container,:host:not(.has-icon) .content-container{display:flex;flex-direction:row}:host.destroy-by-click{cursor:pointer}:host nb-icon{font-size:2.5rem}:host svg{width:2.5rem;height:2.5rem}\n"]
|
18877 | },] }
|
18878 | ];
|
18879 | NbToastComponent.ctorParameters = function () { return [
|
18880 | { type: i0.Renderer2 },
|
18881 | { type: i0.ElementRef },
|
18882 | { type: NbStatusService }
|
18883 | ]; };
|
18884 | NbToastComponent.propDecorators = {
|
18885 | toast: [{ type: i0.Input }],
|
18886 | destroy: [{ type: i0.Output }],
|
18887 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
18888 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
18889 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
18890 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
18891 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
18892 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
18893 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
18894 | destroyByClick: [{ type: i0.HostBinding, args: ['class.destroy-by-click',] }],
|
18895 | hasIcon: [{ type: i0.HostBinding, args: ['class.has-icon',] }],
|
18896 | customIcon: [{ type: i0.HostBinding, args: ['class.custom-icon',] }],
|
18897 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }],
|
18898 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
18899 | };
|
18900 | return NbToastComponent;
|
18901 | }());
|
18902 |
|
18903 |
|
18904 |
|
18905 |
|
18906 |
|
18907 |
|
18908 | var voidState = _angular_animations.style({
|
18909 | transform: 'translateX({{ direction }}110%)',
|
18910 | height: 0,
|
18911 | marginLeft: '0',
|
18912 | marginRight: '0',
|
18913 | marginTop: '0',
|
18914 | marginBottom: '0',
|
18915 | });
|
18916 | var defaultOptions = { params: { direction: '' } };
|
18917 | var NbToastrContainerComponent = (function () {
|
18918 | function NbToastrContainerComponent(layoutDirection, positionHelper) {
|
18919 | this.layoutDirection = layoutDirection;
|
18920 | this.positionHelper = positionHelper;
|
18921 | this.destroy$ = new rxjs.Subject();
|
18922 | this.content = [];
|
18923 | }
|
18924 | NbToastrContainerComponent.prototype.ngOnInit = function () {
|
18925 | var _this = this;
|
18926 | this.layoutDirection.onDirectionChange()
|
18927 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
18928 | .subscribe(function () { return _this.onDirectionChange(); });
|
18929 | };
|
18930 | NbToastrContainerComponent.prototype.ngOnDestroy = function () {
|
18931 | this.destroy$.next();
|
18932 | this.destroy$.complete();
|
18933 | };
|
18934 | NbToastrContainerComponent.prototype.onDirectionChange = function () {
|
18935 | var direction = this.positionHelper.isRightPosition(this.position) ? '' : '-';
|
18936 | this.fadeIn = { value: '', params: { direction: direction } };
|
18937 | };
|
18938 | NbToastrContainerComponent.decorators = [
|
18939 | { type: i0.Component, args: [{
|
18940 | selector: 'nb-toastr-container',
|
18941 | template: "\n <nb-toast [@fadeIn]=\"fadeIn\" *ngFor=\"let toast of content\" [toast]=\"toast\"></nb-toast>",
|
18942 | animations: [
|
18943 | _angular_animations.trigger('fadeIn', [
|
18944 | _angular_animations.transition(':enter', [voidState, _angular_animations.animate(100)], defaultOptions),
|
18945 | _angular_animations.transition(':leave', [_angular_animations.animate(100, voidState)], defaultOptions),
|
18946 | ]),
|
18947 | ]
|
18948 | },] }
|
18949 | ];
|
18950 | NbToastrContainerComponent.ctorParameters = function () { return [
|
18951 | { type: NbLayoutDirectionService },
|
18952 | { type: NbPositionHelper }
|
18953 | ]; };
|
18954 | NbToastrContainerComponent.propDecorators = {
|
18955 | content: [{ type: i0.Input }],
|
18956 | context: [{ type: i0.Input }],
|
18957 | position: [{ type: i0.Input }],
|
18958 | toasts: [{ type: i0.ViewChildren, args: [NbToastComponent,] }]
|
18959 | };
|
18960 | return NbToastrContainerComponent;
|
18961 | }());
|
18962 |
|
18963 |
|
18964 |
|
18965 |
|
18966 |
|
18967 |
|
18968 | var NB_TOASTR_CONFIG = new i0.InjectionToken('Default toastr options');
|
18969 |
|
18970 |
|
18971 |
|
18972 | var NbToastrConfig = (function () {
|
18973 | function NbToastrConfig(config) {
|
18974 | |
18975 |
|
18976 |
|
18977 | this.position = exports.NbGlobalLogicalPosition.TOP_END;
|
18978 | |
18979 |
|
18980 |
|
18981 | this.status = 'basic';
|
18982 | |
18983 |
|
18984 |
|
18985 | this.duration = 3000;
|
18986 | |
18987 |
|
18988 |
|
18989 | this.destroyByClick = true;
|
18990 | |
18991 |
|
18992 |
|
18993 |
|
18994 |
|
18995 | this.preventDuplicates = false;
|
18996 | |
18997 |
|
18998 |
|
18999 | this.duplicatesBehaviour = 'previous';
|
19000 | |
19001 |
|
19002 |
|
19003 | this.limit = null;
|
19004 | |
19005 |
|
19006 |
|
19007 | this.toastClass = '';
|
19008 | |
19009 |
|
19010 |
|
19011 | this.hasIcon = true;
|
19012 | |
19013 |
|
19014 |
|
19015 | this.icon = 'email';
|
19016 | |
19017 |
|
19018 |
|
19019 | this.icons = {
|
19020 | danger: 'flash-outline',
|
19021 | success: 'checkmark-outline',
|
19022 | info: 'question-mark-outline',
|
19023 | warning: 'alert-triangle-outline',
|
19024 | primary: 'email-outline',
|
19025 | control: 'email-outline',
|
19026 | basic: 'email-outline',
|
19027 | };
|
19028 | this.patchIcon(config);
|
19029 | Object.assign(this, config);
|
19030 | }
|
19031 | NbToastrConfig.prototype.patchIcon = function (config) {
|
19032 | if (!('icon' in config)) {
|
19033 | config.icon = {
|
19034 | icon: this.icons[config.status] || this.icons.basic,
|
19035 | pack: 'nebular-essentials',
|
19036 | };
|
19037 | }
|
19038 | };
|
19039 | return NbToastrConfig;
|
19040 | }());
|
19041 |
|
19042 |
|
19043 |
|
19044 |
|
19045 |
|
19046 |
|
19047 | var NbToastRef = (function () {
|
19048 | function NbToastRef(toastContainer, toast) {
|
19049 | this.toastContainer = toastContainer;
|
19050 | this.toast = toast;
|
19051 | }
|
19052 | NbToastRef.prototype.close = function () {
|
19053 | this.toastContainer.destroy(this.toast);
|
19054 | };
|
19055 | return NbToastRef;
|
19056 | }());
|
19057 | var NbToastContainer = (function () {
|
19058 | function NbToastContainer(position, containerRef, positionHelper) {
|
19059 | this.position = position;
|
19060 | this.containerRef = containerRef;
|
19061 | this.positionHelper = positionHelper;
|
19062 | this.toasts = [];
|
19063 | this.toastDuplicateCompareFunc = function (t1, t2) {
|
19064 | return t1.message === t2.message
|
19065 | && t1.title === t2.title
|
19066 | && t1.config.status === t2.config.status;
|
19067 | };
|
19068 | }
|
19069 | Object.defineProperty(NbToastContainer.prototype, "nativeElement", {
|
19070 | get: function () {
|
19071 | return this.containerRef.location.nativeElement;
|
19072 | },
|
19073 | enumerable: false,
|
19074 | configurable: true
|
19075 | });
|
19076 | NbToastContainer.prototype.attach = function (toast) {
|
19077 | if (toast.config.preventDuplicates && this.isDuplicate(toast)) {
|
19078 | return;
|
19079 | }
|
19080 | this.removeToastIfLimitReached(toast);
|
19081 | var toastComponent = this.attachToast(toast);
|
19082 | if (toast.config.destroyByClick) {
|
19083 | this.subscribeOnClick(toastComponent, toast);
|
19084 | }
|
19085 | if (toast.config.duration) {
|
19086 | this.setDestroyTimeout(toast);
|
19087 | }
|
19088 | this.prevToast = toast;
|
19089 | return new NbToastRef(this, toast);
|
19090 | };
|
19091 | NbToastContainer.prototype.destroy = function (toast) {
|
19092 | if (this.prevToast === toast) {
|
19093 | this.prevToast = null;
|
19094 | }
|
19095 | this.toasts = this.toasts.filter(function (t) { return t !== toast; });
|
19096 | this.updateContainer();
|
19097 | };
|
19098 | NbToastContainer.prototype.isDuplicate = function (toast) {
|
19099 | return toast.config.duplicatesBehaviour === 'previous'
|
19100 | ? this.isDuplicatePrevious(toast)
|
19101 | : this.isDuplicateAmongAll(toast);
|
19102 | };
|
19103 | NbToastContainer.prototype.isDuplicatePrevious = function (toast) {
|
19104 | return this.prevToast && this.toastDuplicateCompareFunc(this.prevToast, toast);
|
19105 | };
|
19106 | NbToastContainer.prototype.isDuplicateAmongAll = function (toast) {
|
19107 | var _this = this;
|
19108 | return this.toasts.some(function (t) { return _this.toastDuplicateCompareFunc(t, toast); });
|
19109 | };
|
19110 | NbToastContainer.prototype.removeToastIfLimitReached = function (toast) {
|
19111 | if (!toast.config.limit || this.toasts.length < toast.config.limit) {
|
19112 | return;
|
19113 | }
|
19114 | if (this.positionHelper.isTopPosition(toast.config.position)) {
|
19115 | this.toasts.pop();
|
19116 | }
|
19117 | else {
|
19118 | this.toasts.shift();
|
19119 | }
|
19120 | };
|
19121 | NbToastContainer.prototype.attachToast = function (toast) {
|
19122 | if (this.positionHelper.isTopPosition(toast.config.position)) {
|
19123 | return this.attachToTop(toast);
|
19124 | }
|
19125 | else {
|
19126 | return this.attachToBottom(toast);
|
19127 | }
|
19128 | };
|
19129 | NbToastContainer.prototype.attachToTop = function (toast) {
|
19130 | this.toasts.unshift(toast);
|
19131 | this.updateContainer();
|
19132 | return this.containerRef.instance.toasts.first;
|
19133 | };
|
19134 | NbToastContainer.prototype.attachToBottom = function (toast) {
|
19135 | this.toasts.push(toast);
|
19136 | this.updateContainer();
|
19137 | return this.containerRef.instance.toasts.last;
|
19138 | };
|
19139 | NbToastContainer.prototype.setDestroyTimeout = function (toast) {
|
19140 | var _this = this;
|
19141 | setTimeout(function () { return _this.destroy(toast); }, toast.config.duration);
|
19142 | };
|
19143 | NbToastContainer.prototype.subscribeOnClick = function (toastComponent, toast) {
|
19144 | var _this = this;
|
19145 | toastComponent.destroy.subscribe(function () { return _this.destroy(toast); });
|
19146 | };
|
19147 | NbToastContainer.prototype.updateContainer = function () {
|
19148 | patch(this.containerRef, { content: this.toasts, position: this.position });
|
19149 | };
|
19150 | return NbToastContainer;
|
19151 | }());
|
19152 | var NbToastrContainerRegistry = (function () {
|
19153 | function NbToastrContainerRegistry(overlay, positionBuilder, positionHelper, cfr, document) {
|
19154 | this.overlay = overlay;
|
19155 | this.positionBuilder = positionBuilder;
|
19156 | this.positionHelper = positionHelper;
|
19157 | this.cfr = cfr;
|
19158 | this.document = document;
|
19159 | this.overlays = new Map();
|
19160 | }
|
19161 | NbToastrContainerRegistry.prototype.get = function (position) {
|
19162 | var logicalPosition = this.positionHelper.toLogicalPosition(position);
|
19163 | var overlayWithContainer = this.overlays.get(logicalPosition);
|
19164 | if (!overlayWithContainer || !this.existsInDom(overlayWithContainer.toastrContainer)) {
|
19165 | if (overlayWithContainer) {
|
19166 | overlayWithContainer.overlayRef.dispose();
|
19167 | }
|
19168 | this.instantiateContainer(logicalPosition);
|
19169 | }
|
19170 | return this.overlays.get(logicalPosition).toastrContainer;
|
19171 | };
|
19172 | NbToastrContainerRegistry.prototype.instantiateContainer = function (position) {
|
19173 | var toastrOverlayWithContainer = this.createContainer(position);
|
19174 | this.overlays.set(position, toastrOverlayWithContainer);
|
19175 | };
|
19176 | NbToastrContainerRegistry.prototype.createContainer = function (position) {
|
19177 | var positionStrategy = this.positionBuilder.global().position(position);
|
19178 | var ref = this.overlay.create({ positionStrategy: positionStrategy });
|
19179 | this.addClassToOverlayHost(ref);
|
19180 | var containerRef = ref.attach(new NbComponentPortal(NbToastrContainerComponent, null, null, this.cfr));
|
19181 | return {
|
19182 | overlayRef: ref,
|
19183 | toastrContainer: new NbToastContainer(position, containerRef, this.positionHelper),
|
19184 | };
|
19185 | };
|
19186 | NbToastrContainerRegistry.prototype.addClassToOverlayHost = function (overlayRef) {
|
19187 | overlayRef.hostElement.classList.add('toastr-overlay-container');
|
19188 | };
|
19189 | NbToastrContainerRegistry.prototype.existsInDom = function (toastContainer) {
|
19190 | return this.document.body.contains(toastContainer.nativeElement);
|
19191 | };
|
19192 | NbToastrContainerRegistry.decorators = [
|
19193 | { type: i0.Injectable }
|
19194 | ];
|
19195 | NbToastrContainerRegistry.ctorParameters = function () { return [
|
19196 | { type: NbOverlayService },
|
19197 | { type: NbPositionBuilderService },
|
19198 | { type: NbPositionHelper },
|
19199 | { type: i0.ComponentFactoryResolver },
|
19200 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] }
|
19201 | ]; };
|
19202 | return NbToastrContainerRegistry;
|
19203 | }());
|
19204 |
|
19205 |
|
19206 |
|
19207 |
|
19208 |
|
19209 |
|
19210 |
|
19211 |
|
19212 |
|
19213 |
|
19214 |
|
19215 |
|
19216 |
|
19217 |
|
19218 |
|
19219 |
|
19220 |
|
19221 |
|
19222 |
|
19223 |
|
19224 |
|
19225 |
|
19226 |
|
19227 |
|
19228 |
|
19229 |
|
19230 |
|
19231 |
|
19232 |
|
19233 |
|
19234 |
|
19235 |
|
19236 |
|
19237 |
|
19238 |
|
19239 |
|
19240 |
|
19241 |
|
19242 |
|
19243 |
|
19244 |
|
19245 |
|
19246 |
|
19247 |
|
19248 |
|
19249 |
|
19250 |
|
19251 |
|
19252 |
|
19253 |
|
19254 |
|
19255 |
|
19256 |
|
19257 |
|
19258 |
|
19259 |
|
19260 |
|
19261 |
|
19262 |
|
19263 |
|
19264 |
|
19265 |
|
19266 |
|
19267 |
|
19268 |
|
19269 |
|
19270 |
|
19271 |
|
19272 |
|
19273 |
|
19274 |
|
19275 |
|
19276 |
|
19277 | var NbToastrService = (function () {
|
19278 | function NbToastrService(globalConfig, containerRegistry) {
|
19279 | this.globalConfig = globalConfig;
|
19280 | this.containerRegistry = containerRegistry;
|
19281 | }
|
19282 | |
19283 |
|
19284 |
|
19285 | NbToastrService.prototype.show = function (message, title, userConfig) {
|
19286 | var config = new NbToastrConfig(tslib.__assign(tslib.__assign({}, this.globalConfig), userConfig));
|
19287 | var container = this.containerRegistry.get(config.position);
|
19288 | var toast = { message: message, title: title, config: config };
|
19289 | return container.attach(toast);
|
19290 | };
|
19291 | |
19292 |
|
19293 |
|
19294 | NbToastrService.prototype.success = function (message, title, config) {
|
19295 | return this.show(message, title, tslib.__assign(tslib.__assign({}, config), { status: 'success' }));
|
19296 | };
|
19297 | |
19298 |
|
19299 |
|
19300 | NbToastrService.prototype.info = function (message, title, config) {
|
19301 | return this.show(message, title, tslib.__assign(tslib.__assign({}, config), { status: 'info' }));
|
19302 | };
|
19303 | |
19304 |
|
19305 |
|
19306 | NbToastrService.prototype.warning = function (message, title, config) {
|
19307 | return this.show(message, title, tslib.__assign(tslib.__assign({}, config), { status: 'warning' }));
|
19308 | };
|
19309 | |
19310 |
|
19311 |
|
19312 | NbToastrService.prototype.primary = function (message, title, config) {
|
19313 | return this.show(message, title, tslib.__assign(tslib.__assign({}, config), { status: 'primary' }));
|
19314 | };
|
19315 | |
19316 |
|
19317 |
|
19318 | NbToastrService.prototype.danger = function (message, title, config) {
|
19319 | return this.show(message, title, tslib.__assign(tslib.__assign({}, config), { status: 'danger' }));
|
19320 | };
|
19321 | |
19322 |
|
19323 |
|
19324 | NbToastrService.prototype.default = function (message, title, config) {
|
19325 | return this.show(message, title, tslib.__assign(tslib.__assign({}, config), { status: 'basic' }));
|
19326 | };
|
19327 | |
19328 |
|
19329 |
|
19330 | NbToastrService.prototype.control = function (message, title, config) {
|
19331 | return this.default(message, title, tslib.__assign(tslib.__assign({}, config), { status: 'control' }));
|
19332 | };
|
19333 | NbToastrService.decorators = [
|
19334 | { type: i0.Injectable }
|
19335 | ];
|
19336 | NbToastrService.ctorParameters = function () { return [
|
19337 | { type: NbToastrConfig, decorators: [{ type: i0.Inject, args: [NB_TOASTR_CONFIG,] }] },
|
19338 | { type: NbToastrContainerRegistry }
|
19339 | ]; };
|
19340 | return NbToastrService;
|
19341 | }());
|
19342 |
|
19343 |
|
19344 |
|
19345 |
|
19346 |
|
19347 |
|
19348 | var NbToastrModule = (function () {
|
19349 | function NbToastrModule() {
|
19350 | }
|
19351 | NbToastrModule.forRoot = function (toastrConfig) {
|
19352 | if (toastrConfig === void 0) { toastrConfig = {}; }
|
19353 | return {
|
19354 | ngModule: NbToastrModule,
|
19355 | providers: [
|
19356 | NbToastrService,
|
19357 | NbToastrContainerRegistry,
|
19358 | { provide: NB_TOASTR_CONFIG, useValue: toastrConfig },
|
19359 | ],
|
19360 | };
|
19361 | };
|
19362 | NbToastrModule.decorators = [
|
19363 | { type: i0.NgModule, args: [{
|
19364 | imports: [NbSharedModule, NbOverlayModule, NbIconModule],
|
19365 | declarations: [NbToastrContainerComponent, NbToastComponent],
|
19366 | entryComponents: [NbToastrContainerComponent, NbToastComponent],
|
19367 | },] }
|
19368 | ];
|
19369 | return NbToastrModule;
|
19370 | }());
|
19371 |
|
19372 |
|
19373 |
|
19374 |
|
19375 |
|
19376 |
|
19377 | var NbToast = (function () {
|
19378 | function NbToast() {
|
19379 | }
|
19380 | return NbToast;
|
19381 | }());
|
19382 |
|
19383 |
|
19384 |
|
19385 |
|
19386 |
|
19387 |
|
19388 |
|
19389 |
|
19390 |
|
19391 |
|
19392 |
|
19393 |
|
19394 |
|
19395 |
|
19396 |
|
19397 |
|
19398 |
|
19399 |
|
19400 |
|
19401 |
|
19402 |
|
19403 |
|
19404 |
|
19405 |
|
19406 |
|
19407 |
|
19408 |
|
19409 |
|
19410 |
|
19411 |
|
19412 |
|
19413 |
|
19414 |
|
19415 |
|
19416 |
|
19417 |
|
19418 |
|
19419 |
|
19420 |
|
19421 |
|
19422 |
|
19423 |
|
19424 |
|
19425 |
|
19426 |
|
19427 |
|
19428 |
|
19429 |
|
19430 |
|
19431 | var NbTooltipComponent = (function () {
|
19432 | function NbTooltipComponent(statusService) {
|
19433 | this.statusService = statusService;
|
19434 | |
19435 |
|
19436 |
|
19437 | this.position = exports.NbPosition.TOP;
|
19438 | this.context = {};
|
19439 | }
|
19440 | Object.defineProperty(NbTooltipComponent.prototype, "binding", {
|
19441 | get: function () {
|
19442 | return this.position + " " + this.statusClass;
|
19443 | },
|
19444 | enumerable: false,
|
19445 | configurable: true
|
19446 | });
|
19447 | Object.defineProperty(NbTooltipComponent.prototype, "show", {
|
19448 | get: function () {
|
19449 | return true;
|
19450 | },
|
19451 | enumerable: false,
|
19452 | configurable: true
|
19453 | });
|
19454 | Object.defineProperty(NbTooltipComponent.prototype, "statusClass", {
|
19455 | get: function () {
|
19456 | if (this.context.status) {
|
19457 | return this.statusService.getStatusClass(this.context.status);
|
19458 | }
|
19459 | return '';
|
19460 | },
|
19461 | enumerable: false,
|
19462 | configurable: true
|
19463 | });
|
19464 | |
19465 |
|
19466 |
|
19467 |
|
19468 | NbTooltipComponent.prototype.renderContent = function () { };
|
19469 | NbTooltipComponent.decorators = [
|
19470 | { type: i0.Component, args: [{
|
19471 | selector: 'nb-tooltip',
|
19472 | template: "\n <span class=\"arrow\"></span>\n <div class=\"content\">\n <nb-icon *ngIf=\"context?.icon\" [config]=\"context.icon\"></nb-icon>\n <span *ngIf=\"content\">{{ content }}</span>\n </div>\n ",
|
19473 | animations: [
|
19474 | _angular_animations.trigger('showTooltip', [
|
19475 | _angular_animations.state('in', _angular_animations.style({ opacity: 1 })),
|
19476 | _angular_animations.transition('void => *', [
|
19477 | _angular_animations.style({ opacity: 0 }),
|
19478 | _angular_animations.animate(100),
|
19479 | ]),
|
19480 | _angular_animations.transition('* => void', [
|
19481 | _angular_animations.animate(100, _angular_animations.style({ opacity: 0 })),
|
19482 | ]),
|
19483 | ]),
|
19484 | ],
|
19485 | styles: [":host{z-index:10000}:host .content{display:flex;align-items:center}:host.right .content{flex-direction:row-reverse}:host .arrow{position:absolute;width:0;height:0}:host nb-icon+span{margin-left:0.5rem}:host.right nb-icon+span{margin-right:0.5rem}:host .arrow{border-left:6px solid transparent;border-right:6px solid transparent}:host(.bottom) .arrow{top:-6px;left:calc(50% - 6px)}:host(.bottom-start) .arrow{top:-6px}[dir=ltr] :host(.bottom-start) .arrow{right:6px}[dir=rtl] :host(.bottom-start) .arrow{left:6px}:host(.bottom-end) .arrow{top:-6px}[dir=ltr] :host(.bottom-end) .arrow{left:6px}[dir=rtl] :host(.bottom-end) .arrow{right:6px}:host(.left) .arrow,:host(.start) .arrow{top:calc(50% - 2.4px)}[dir=ltr] :host(.left) .arrow,[dir=ltr] :host(.start) .arrow{right:-8px;transform:rotate(90deg)}[dir=rtl] :host(.left) .arrow,[dir=rtl] :host(.start) .arrow{left:-8px;transform:rotate(270deg)}:host(.start-top) .arrow{right:-8px;bottom:6px;transform:rotate(90deg)}:host(.start-bottom) .arrow{right:-8px;top:6px;transform:rotate(90deg)}:host(.top) .arrow{bottom:-6px;left:calc(50% - 6px);transform:rotate(180deg)}:host(.top-start) .arrow{bottom:calc(-1 * 6px + 1px);transform:rotate(180deg)}[dir=ltr] :host(.top-start) .arrow{right:6px}[dir=rtl] :host(.top-start) .arrow{left:6px}:host(.top-end) .arrow{bottom:calc(-6px + 1px);transform:rotate(180deg)}[dir=ltr] :host(.top-end) .arrow{left:6px}[dir=rtl] :host(.top-end) .arrow{right:6px}:host(.right) .arrow,:host(.end) .arrow{top:calc(50% - 2.4px)}[dir=ltr] :host(.right) .arrow,[dir=ltr] :host(.end) .arrow{left:-8px;transform:rotate(270deg)}[dir=rtl] :host(.right) .arrow,[dir=rtl] :host(.end) .arrow{right:-8px;transform:rotate(90deg)}:host(.end-top) .arrow{left:calc(-6px - 6px / 2.5);bottom:6px;transform:rotate(270deg)}:host(.end-bottom) .arrow{left:calc(-6px - 6px / 2.5);top:6px;transform:rotate(270deg)}\n"]
|
19486 | },] }
|
19487 | ];
|
19488 | NbTooltipComponent.ctorParameters = function () { return [
|
19489 | { type: NbStatusService }
|
19490 | ]; };
|
19491 | NbTooltipComponent.propDecorators = {
|
19492 | content: [{ type: i0.Input }],
|
19493 | position: [{ type: i0.Input }],
|
19494 | binding: [{ type: i0.HostBinding, args: ['class',] }],
|
19495 | show: [{ type: i0.HostBinding, args: ['@showTooltip',] }],
|
19496 | context: [{ type: i0.Input }]
|
19497 | };
|
19498 | return NbTooltipComponent;
|
19499 | }());
|
19500 |
|
19501 |
|
19502 |
|
19503 |
|
19504 |
|
19505 |
|
19506 |
|
19507 |
|
19508 |
|
19509 |
|
19510 |
|
19511 |
|
19512 |
|
19513 |
|
19514 |
|
19515 |
|
19516 |
|
19517 |
|
19518 |
|
19519 |
|
19520 |
|
19521 |
|
19522 |
|
19523 |
|
19524 |
|
19525 |
|
19526 |
|
19527 |
|
19528 |
|
19529 |
|
19530 |
|
19531 |
|
19532 |
|
19533 |
|
19534 |
|
19535 |
|
19536 |
|
19537 |
|
19538 |
|
19539 |
|
19540 |
|
19541 |
|
19542 |
|
19543 |
|
19544 |
|
19545 |
|
19546 | var NbTooltipDirective = (function () {
|
19547 | function NbTooltipDirective(hostRef, dynamicOverlayHandler) {
|
19548 | this.hostRef = hostRef;
|
19549 | this.dynamicOverlayHandler = dynamicOverlayHandler;
|
19550 | this.destroy$ = new rxjs.Subject();
|
19551 | this.tooltipComponent = NbTooltipComponent;
|
19552 | this.context = {};
|
19553 | |
19554 |
|
19555 |
|
19556 |
|
19557 | this.position = exports.NbPosition.TOP;
|
19558 | this._adjustment = exports.NbAdjustment.CLOCKWISE;
|
19559 | this._tooltipClass = '';
|
19560 | |
19561 |
|
19562 |
|
19563 |
|
19564 | this.trigger = exports.NbTrigger.HINT;
|
19565 | |
19566 |
|
19567 |
|
19568 | this.offset = 8;
|
19569 | this.nbTooltipShowStateChange = new i0.EventEmitter();
|
19570 | this.overlayConfig = { panelClass: this.tooltipClass };
|
19571 | }
|
19572 | Object.defineProperty(NbTooltipDirective.prototype, "adjustment", {
|
19573 | |
19574 |
|
19575 |
|
19576 |
|
19577 |
|
19578 | get: function () {
|
19579 | return this._adjustment;
|
19580 | },
|
19581 | set: function (value) {
|
19582 | this._adjustment = value;
|
19583 | },
|
19584 | enumerable: false,
|
19585 | configurable: true
|
19586 | });
|
19587 | Object.defineProperty(NbTooltipDirective.prototype, "tooltipClass", {
|
19588 | get: function () {
|
19589 | return this._tooltipClass;
|
19590 | },
|
19591 | set: function (value) {
|
19592 | if (value !== this.tooltipClass) {
|
19593 | this._tooltipClass = value;
|
19594 | this.overlayConfig = { panelClass: this.tooltipClass };
|
19595 | }
|
19596 | },
|
19597 | enumerable: false,
|
19598 | configurable: true
|
19599 | });
|
19600 | Object.defineProperty(NbTooltipDirective.prototype, "icon", {
|
19601 | |
19602 |
|
19603 |
|
19604 |
|
19605 | set: function (icon) {
|
19606 | this.context = Object.assign(this.context, { icon: icon });
|
19607 | },
|
19608 | enumerable: false,
|
19609 | configurable: true
|
19610 | });
|
19611 | Object.defineProperty(NbTooltipDirective.prototype, "status", {
|
19612 | |
19613 |
|
19614 |
|
19615 |
|
19616 | set: function (status) {
|
19617 | this.context = Object.assign(this.context, { status: status });
|
19618 | },
|
19619 | enumerable: false,
|
19620 | configurable: true
|
19621 | });
|
19622 | Object.defineProperty(NbTooltipDirective.prototype, "isShown", {
|
19623 | get: function () {
|
19624 | return !!(this.dynamicOverlay && this.dynamicOverlay.isAttached);
|
19625 | },
|
19626 | enumerable: false,
|
19627 | configurable: true
|
19628 | });
|
19629 | NbTooltipDirective.prototype.ngOnInit = function () {
|
19630 | this.dynamicOverlayHandler
|
19631 | .host(this.hostRef)
|
19632 | .componentType(this.tooltipComponent)
|
19633 | .offset(this.offset);
|
19634 | };
|
19635 | NbTooltipDirective.prototype.ngOnChanges = function () {
|
19636 | this.rebuild();
|
19637 | };
|
19638 | NbTooltipDirective.prototype.ngAfterViewInit = function () {
|
19639 | var _this = this;
|
19640 | this.dynamicOverlay = this.configureDynamicOverlay()
|
19641 | .build();
|
19642 | this.dynamicOverlay.isShown
|
19643 | .pipe(rxjs_operators.skip(1), rxjs_operators.takeUntil(this.destroy$))
|
19644 | .subscribe(function (isShown) { return _this.nbTooltipShowStateChange.emit({ isShown: isShown }); });
|
19645 | };
|
19646 | NbTooltipDirective.prototype.rebuild = function () {
|
19647 | this.dynamicOverlay = this.configureDynamicOverlay()
|
19648 | .rebuild();
|
19649 | };
|
19650 | NbTooltipDirective.prototype.show = function () {
|
19651 | this.dynamicOverlay.show();
|
19652 | };
|
19653 | NbTooltipDirective.prototype.hide = function () {
|
19654 | this.dynamicOverlay.hide();
|
19655 | };
|
19656 | NbTooltipDirective.prototype.toggle = function () {
|
19657 | this.dynamicOverlay.toggle();
|
19658 | };
|
19659 | NbTooltipDirective.prototype.ngOnDestroy = function () {
|
19660 | this.dynamicOverlayHandler.destroy();
|
19661 | this.destroy$.next();
|
19662 | this.destroy$.complete();
|
19663 | };
|
19664 | NbTooltipDirective.prototype.configureDynamicOverlay = function () {
|
19665 | return this.dynamicOverlayHandler
|
19666 | .position(this.position)
|
19667 | .trigger(this.trigger)
|
19668 | .adjustment(this.adjustment)
|
19669 | .content(this.content)
|
19670 | .context(this.context)
|
19671 | .overlayConfig(this.overlayConfig);
|
19672 | };
|
19673 | NbTooltipDirective.decorators = [
|
19674 | { type: i0.Directive, args: [{
|
19675 | selector: '[nbTooltip]',
|
19676 | exportAs: 'nbTooltip',
|
19677 | providers: [NbDynamicOverlayHandler, NbDynamicOverlay],
|
19678 | },] }
|
19679 | ];
|
19680 | NbTooltipDirective.ctorParameters = function () { return [
|
19681 | { type: i0.ElementRef },
|
19682 | { type: NbDynamicOverlayHandler }
|
19683 | ]; };
|
19684 | NbTooltipDirective.propDecorators = {
|
19685 | content: [{ type: i0.Input, args: ['nbTooltip',] }],
|
19686 | position: [{ type: i0.Input, args: ['nbTooltipPlacement',] }],
|
19687 | adjustment: [{ type: i0.Input, args: ['nbTooltipAdjustment',] }],
|
19688 | tooltipClass: [{ type: i0.Input, args: ['nbTooltipClass',] }],
|
19689 | icon: [{ type: i0.Input, args: ['nbTooltipIcon',] }],
|
19690 | status: [{ type: i0.Input, args: ['nbTooltipStatus',] }],
|
19691 | trigger: [{ type: i0.Input, args: ['nbTooltipTrigger',] }],
|
19692 | offset: [{ type: i0.Input, args: ['nbTooltipOffset',] }],
|
19693 | nbTooltipShowStateChange: [{ type: i0.Output }]
|
19694 | };
|
19695 | return NbTooltipDirective;
|
19696 | }());
|
19697 |
|
19698 |
|
19699 |
|
19700 |
|
19701 |
|
19702 |
|
19703 | var NbTooltipModule = (function () {
|
19704 | function NbTooltipModule() {
|
19705 | }
|
19706 | NbTooltipModule.decorators = [
|
19707 | { type: i0.NgModule, args: [{
|
19708 | imports: [NbSharedModule, NbOverlayModule, NbIconModule],
|
19709 | declarations: [NbTooltipComponent, NbTooltipDirective],
|
19710 | exports: [NbTooltipDirective],
|
19711 | entryComponents: [NbTooltipComponent],
|
19712 | },] }
|
19713 | ];
|
19714 | return NbTooltipModule;
|
19715 | }());
|
19716 |
|
19717 | var NB_SELECT_INJECTION_TOKEN = new i0.InjectionToken('NB_SELECT_INJECTION_TOKEN');
|
19718 |
|
19719 |
|
19720 |
|
19721 |
|
19722 |
|
19723 |
|
19724 |
|
19725 | var lastOptionId = 0;
|
19726 |
|
19727 |
|
19728 |
|
19729 |
|
19730 |
|
19731 |
|
19732 |
|
19733 |
|
19734 |
|
19735 |
|
19736 |
|
19737 |
|
19738 |
|
19739 |
|
19740 |
|
19741 |
|
19742 |
|
19743 |
|
19744 |
|
19745 |
|
19746 |
|
19747 |
|
19748 |
|
19749 |
|
19750 |
|
19751 |
|
19752 |
|
19753 |
|
19754 |
|
19755 |
|
19756 |
|
19757 |
|
19758 |
|
19759 |
|
19760 |
|
19761 |
|
19762 |
|
19763 |
|
19764 |
|
19765 |
|
19766 |
|
19767 |
|
19768 |
|
19769 |
|
19770 |
|
19771 | var NbOptionComponent = (function () {
|
19772 | function NbOptionComponent(parent, elementRef, cd, zone, renderer) {
|
19773 | this.elementRef = elementRef;
|
19774 | this.cd = cd;
|
19775 | this.zone = zone;
|
19776 | this.renderer = renderer;
|
19777 | this.disabledByGroup = false;
|
19778 | this._disabled = false;
|
19779 | |
19780 |
|
19781 |
|
19782 | this.selectionChange = new i0.EventEmitter();
|
19783 | |
19784 |
|
19785 |
|
19786 | this.click$ = new rxjs.Subject();
|
19787 | this.selected = false;
|
19788 | this.alive = true;
|
19789 | |
19790 |
|
19791 |
|
19792 | this.id = "nb-option-" + lastOptionId++;
|
19793 | this._active = false;
|
19794 | this.parent = parent;
|
19795 | }
|
19796 | Object.defineProperty(NbOptionComponent.prototype, "disabled", {
|
19797 | get: function () {
|
19798 | return this._disabled || this.disabledByGroup;
|
19799 | },
|
19800 | set: function (value) {
|
19801 | this._disabled = convertToBoolProperty(value);
|
19802 | },
|
19803 | enumerable: false,
|
19804 | configurable: true
|
19805 | });
|
19806 | Object.defineProperty(NbOptionComponent.prototype, "click", {
|
19807 | get: function () {
|
19808 | return this.click$.asObservable();
|
19809 | },
|
19810 | enumerable: false,
|
19811 | configurable: true
|
19812 | });
|
19813 | NbOptionComponent.prototype.ngOnDestroy = function () {
|
19814 | this.alive = false;
|
19815 | };
|
19816 | NbOptionComponent.prototype.ngAfterViewInit = function () {
|
19817 | var _this = this;
|
19818 |
|
19819 | this.zone.runOutsideAngular(function () { return setTimeout(function () {
|
19820 | _this.renderer.addClass(_this.elementRef.nativeElement, 'nb-transition');
|
19821 | }); });
|
19822 | };
|
19823 | Object.defineProperty(NbOptionComponent.prototype, "withCheckbox", {
|
19824 | |
19825 |
|
19826 |
|
19827 | get: function () {
|
19828 | return this.multiple && this.value != null;
|
19829 | },
|
19830 | enumerable: false,
|
19831 | configurable: true
|
19832 | });
|
19833 | Object.defineProperty(NbOptionComponent.prototype, "content", {
|
19834 | get: function () {
|
19835 | return this.elementRef.nativeElement.textContent;
|
19836 | },
|
19837 | enumerable: false,
|
19838 | configurable: true
|
19839 | });
|
19840 | Object.defineProperty(NbOptionComponent.prototype, "multiple", {
|
19841 |
|
19842 | get: function () {
|
19843 |
|
19844 |
|
19845 | return this.parent ? this.parent.multiple : false;
|
19846 | },
|
19847 | enumerable: false,
|
19848 | configurable: true
|
19849 | });
|
19850 | Object.defineProperty(NbOptionComponent.prototype, "selectedClass", {
|
19851 | get: function () {
|
19852 | return this.selected;
|
19853 | },
|
19854 | enumerable: false,
|
19855 | configurable: true
|
19856 | });
|
19857 | Object.defineProperty(NbOptionComponent.prototype, "disabledAttribute", {
|
19858 | get: function () {
|
19859 | return this.disabled ? '' : null;
|
19860 | },
|
19861 | enumerable: false,
|
19862 | configurable: true
|
19863 | });
|
19864 | Object.defineProperty(NbOptionComponent.prototype, "tabindex", {
|
19865 | get: function () {
|
19866 | return '-1';
|
19867 | },
|
19868 | enumerable: false,
|
19869 | configurable: true
|
19870 | });
|
19871 | Object.defineProperty(NbOptionComponent.prototype, "activeClass", {
|
19872 | get: function () {
|
19873 | return this._active;
|
19874 | },
|
19875 | enumerable: false,
|
19876 | configurable: true
|
19877 | });
|
19878 |
|
19879 | NbOptionComponent.prototype.onClick = function (event) {
|
19880 | this.click$.next(this);
|
19881 |
|
19882 | event.preventDefault();
|
19883 | };
|
19884 | NbOptionComponent.prototype.select = function () {
|
19885 | this.setSelection(true);
|
19886 | };
|
19887 | NbOptionComponent.prototype.deselect = function () {
|
19888 | this.setSelection(false);
|
19889 | };
|
19890 | |
19891 |
|
19892 |
|
19893 | NbOptionComponent.prototype.setDisabledByGroupState = function (disabled) {
|
19894 |
|
19895 | if (this.disabledByGroup !== disabled && this.alive) {
|
19896 | this.disabledByGroup = disabled;
|
19897 | this.cd.markForCheck();
|
19898 | }
|
19899 | };
|
19900 | NbOptionComponent.prototype.setSelection = function (selected) {
|
19901 | |
19902 |
|
19903 |
|
19904 |
|
19905 |
|
19906 |
|
19907 |
|
19908 | if (this.alive && this.selected !== selected) {
|
19909 | this.selected = selected;
|
19910 | this.selectionChange.emit(this);
|
19911 | this.cd.markForCheck();
|
19912 | }
|
19913 | };
|
19914 | NbOptionComponent.prototype.focus = function () {
|
19915 | this.elementRef.nativeElement.focus();
|
19916 | };
|
19917 | NbOptionComponent.prototype.getLabel = function () {
|
19918 | return this.content;
|
19919 | };
|
19920 | NbOptionComponent.prototype.setActiveStyles = function () {
|
19921 | this._active = true;
|
19922 | this.cd.markForCheck();
|
19923 | };
|
19924 | NbOptionComponent.prototype.setInactiveStyles = function () {
|
19925 | this._active = false;
|
19926 | this.cd.markForCheck();
|
19927 | };
|
19928 | NbOptionComponent.decorators = [
|
19929 | { type: i0.Component, args: [{
|
19930 | selector: 'nb-option',
|
19931 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
19932 | template: "\n <nb-checkbox *ngIf=\"withCheckbox\"\n [checked]=\"selected\"\n [disabled]=\"disabled\"\n aria-hidden=\"true\">\n </nb-checkbox>\n <ng-content></ng-content>\n ",
|
19933 | styles: ["/*!\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */:host{display:flex}:host:hover{cursor:pointer}:host nb-checkbox{display:flex;pointer-events:none}[dir=ltr] :host nb-checkbox{margin-right:.5rem}[dir=rtl] :host nb-checkbox{margin-left:.5rem}:host nb-checkbox ::ng-deep .label{padding:0}:host([disabled]){pointer-events:none}:host(.nb-transition){transition-duration:0.15s;transition-property:background-color,color;transition-timing-function:ease-in}\n"]
|
19934 | },] }
|
19935 | ];
|
19936 | NbOptionComponent.ctorParameters = function () { return [
|
19937 | { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [NB_SELECT_INJECTION_TOKEN,] }] },
|
19938 | { type: i0.ElementRef },
|
19939 | { type: i0.ChangeDetectorRef },
|
19940 | { type: i0.NgZone },
|
19941 | { type: i0.Renderer2 }
|
19942 | ]; };
|
19943 | NbOptionComponent.propDecorators = {
|
19944 | value: [{ type: i0.Input }],
|
19945 | disabled: [{ type: i0.Input }],
|
19946 | selectionChange: [{ type: i0.Output }],
|
19947 | id: [{ type: i0.HostBinding, args: ['attr.id',] }],
|
19948 | multiple: [{ type: i0.HostBinding, args: ['class.multiple',] }],
|
19949 | selectedClass: [{ type: i0.HostBinding, args: ['class.selected',] }],
|
19950 | disabledAttribute: [{ type: i0.HostBinding, args: ['attr.disabled',] }],
|
19951 | tabindex: [{ type: i0.HostBinding, args: ['tabIndex',] }],
|
19952 | activeClass: [{ type: i0.HostBinding, args: ['class.active',] }],
|
19953 | onClick: [{ type: i0.HostListener, args: ['click', ['$event'],] }, { type: i0.HostListener, args: ['keydown.space', ['$event'],] }, { type: i0.HostListener, args: ['keydown.enter', ['$event'],] }]
|
19954 | };
|
19955 | return NbOptionComponent;
|
19956 | }());
|
19957 |
|
19958 |
|
19959 |
|
19960 |
|
19961 |
|
19962 |
|
19963 | var NbSelectLabelComponent = (function () {
|
19964 | function NbSelectLabelComponent() {
|
19965 | }
|
19966 | NbSelectLabelComponent.decorators = [
|
19967 | { type: i0.Component, args: [{
|
19968 | selector: 'nb-select-label',
|
19969 | template: '<ng-content></ng-content>'
|
19970 | },] }
|
19971 | ];
|
19972 | return NbSelectLabelComponent;
|
19973 | }());
|
19974 | function nbSelectFormFieldControlConfigFactory() {
|
19975 | var config = new NbFormFieldControlConfig();
|
19976 | config.supportsSuffix = false;
|
19977 | return config;
|
19978 | }
|
19979 |
|
19980 |
|
19981 |
|
19982 |
|
19983 |
|
19984 |
|
19985 |
|
19986 |
|
19987 |
|
19988 |
|
19989 |
|
19990 |
|
19991 |
|
19992 |
|
19993 |
|
19994 |
|
19995 |
|
19996 |
|
19997 |
|
19998 |
|
19999 |
|
20000 |
|
20001 |
|
20002 |
|
20003 |
|
20004 |
|
20005 |
|
20006 |
|
20007 |
|
20008 |
|
20009 |
|
20010 |
|
20011 |
|
20012 |
|
20013 |
|
20014 |
|
20015 |
|
20016 |
|
20017 |
|
20018 |
|
20019 |
|
20020 |
|
20021 |
|
20022 |
|
20023 |
|
20024 |
|
20025 |
|
20026 |
|
20027 |
|
20028 |
|
20029 |
|
20030 |
|
20031 |
|
20032 |
|
20033 |
|
20034 |
|
20035 |
|
20036 |
|
20037 |
|
20038 |
|
20039 |
|
20040 |
|
20041 |
|
20042 |
|
20043 |
|
20044 |
|
20045 |
|
20046 |
|
20047 |
|
20048 |
|
20049 |
|
20050 |
|
20051 |
|
20052 |
|
20053 |
|
20054 |
|
20055 |
|
20056 |
|
20057 |
|
20058 |
|
20059 |
|
20060 |
|
20061 |
|
20062 |
|
20063 |
|
20064 |
|
20065 |
|
20066 |
|
20067 |
|
20068 |
|
20069 |
|
20070 |
|
20071 |
|
20072 |
|
20073 |
|
20074 |
|
20075 |
|
20076 |
|
20077 |
|
20078 |
|
20079 |
|
20080 |
|
20081 |
|
20082 |
|
20083 |
|
20084 |
|
20085 |
|
20086 |
|
20087 |
|
20088 |
|
20089 |
|
20090 |
|
20091 |
|
20092 |
|
20093 |
|
20094 |
|
20095 |
|
20096 |
|
20097 |
|
20098 |
|
20099 |
|
20100 |
|
20101 |
|
20102 |
|
20103 |
|
20104 |
|
20105 |
|
20106 |
|
20107 |
|
20108 |
|
20109 |
|
20110 |
|
20111 |
|
20112 |
|
20113 |
|
20114 |
|
20115 |
|
20116 |
|
20117 |
|
20118 |
|
20119 |
|
20120 |
|
20121 |
|
20122 |
|
20123 |
|
20124 |
|
20125 |
|
20126 |
|
20127 |
|
20128 |
|
20129 |
|
20130 |
|
20131 |
|
20132 |
|
20133 |
|
20134 |
|
20135 |
|
20136 |
|
20137 |
|
20138 |
|
20139 |
|
20140 |
|
20141 |
|
20142 |
|
20143 |
|
20144 |
|
20145 |
|
20146 |
|
20147 |
|
20148 |
|
20149 |
|
20150 |
|
20151 |
|
20152 |
|
20153 |
|
20154 |
|
20155 |
|
20156 |
|
20157 |
|
20158 |
|
20159 |
|
20160 |
|
20161 |
|
20162 |
|
20163 |
|
20164 |
|
20165 |
|
20166 |
|
20167 |
|
20168 |
|
20169 |
|
20170 |
|
20171 |
|
20172 |
|
20173 |
|
20174 |
|
20175 |
|
20176 |
|
20177 |
|
20178 |
|
20179 |
|
20180 |
|
20181 |
|
20182 |
|
20183 |
|
20184 |
|
20185 |
|
20186 |
|
20187 |
|
20188 |
|
20189 |
|
20190 |
|
20191 |
|
20192 |
|
20193 |
|
20194 |
|
20195 |
|
20196 |
|
20197 |
|
20198 |
|
20199 |
|
20200 |
|
20201 |
|
20202 |
|
20203 |
|
20204 |
|
20205 |
|
20206 |
|
20207 |
|
20208 |
|
20209 |
|
20210 |
|
20211 |
|
20212 |
|
20213 |
|
20214 |
|
20215 |
|
20216 |
|
20217 |
|
20218 |
|
20219 |
|
20220 |
|
20221 |
|
20222 |
|
20223 |
|
20224 |
|
20225 |
|
20226 |
|
20227 |
|
20228 |
|
20229 |
|
20230 |
|
20231 |
|
20232 |
|
20233 |
|
20234 |
|
20235 |
|
20236 |
|
20237 |
|
20238 |
|
20239 |
|
20240 |
|
20241 |
|
20242 |
|
20243 |
|
20244 |
|
20245 |
|
20246 |
|
20247 |
|
20248 |
|
20249 |
|
20250 |
|
20251 |
|
20252 |
|
20253 |
|
20254 |
|
20255 |
|
20256 |
|
20257 |
|
20258 |
|
20259 |
|
20260 |
|
20261 |
|
20262 |
|
20263 |
|
20264 |
|
20265 |
|
20266 |
|
20267 |
|
20268 |
|
20269 |
|
20270 |
|
20271 |
|
20272 |
|
20273 |
|
20274 |
|
20275 |
|
20276 |
|
20277 |
|
20278 |
|
20279 |
|
20280 |
|
20281 |
|
20282 |
|
20283 |
|
20284 |
|
20285 |
|
20286 |
|
20287 |
|
20288 |
|
20289 |
|
20290 |
|
20291 |
|
20292 |
|
20293 |
|
20294 |
|
20295 |
|
20296 |
|
20297 |
|
20298 |
|
20299 |
|
20300 |
|
20301 |
|
20302 |
|
20303 |
|
20304 |
|
20305 |
|
20306 |
|
20307 |
|
20308 |
|
20309 |
|
20310 |
|
20311 |
|
20312 |
|
20313 |
|
20314 |
|
20315 |
|
20316 |
|
20317 |
|
20318 |
|
20319 |
|
20320 |
|
20321 |
|
20322 |
|
20323 |
|
20324 |
|
20325 |
|
20326 |
|
20327 |
|
20328 |
|
20329 |
|
20330 |
|
20331 |
|
20332 |
|
20333 |
|
20334 |
|
20335 |
|
20336 |
|
20337 |
|
20338 |
|
20339 |
|
20340 |
|
20341 |
|
20342 |
|
20343 |
|
20344 |
|
20345 |
|
20346 |
|
20347 |
|
20348 |
|
20349 |
|
20350 |
|
20351 |
|
20352 |
|
20353 |
|
20354 |
|
20355 |
|
20356 |
|
20357 |
|
20358 |
|
20359 |
|
20360 |
|
20361 |
|
20362 |
|
20363 |
|
20364 |
|
20365 |
|
20366 |
|
20367 |
|
20368 |
|
20369 |
|
20370 |
|
20371 |
|
20372 |
|
20373 |
|
20374 |
|
20375 |
|
20376 |
|
20377 |
|
20378 |
|
20379 |
|
20380 |
|
20381 |
|
20382 |
|
20383 |
|
20384 |
|
20385 |
|
20386 |
|
20387 |
|
20388 |
|
20389 |
|
20390 |
|
20391 |
|
20392 |
|
20393 |
|
20394 |
|
20395 |
|
20396 |
|
20397 |
|
20398 |
|
20399 |
|
20400 |
|
20401 |
|
20402 |
|
20403 |
|
20404 |
|
20405 |
|
20406 |
|
20407 |
|
20408 |
|
20409 |
|
20410 | var NbSelectComponent = (function () {
|
20411 | function NbSelectComponent(document, overlay, hostRef, positionBuilder, triggerStrategyBuilder, cd, focusKeyManagerFactoryService, focusMonitor, renderer, zone, statusService) {
|
20412 | this.document = document;
|
20413 | this.overlay = overlay;
|
20414 | this.hostRef = hostRef;
|
20415 | this.positionBuilder = positionBuilder;
|
20416 | this.triggerStrategyBuilder = triggerStrategyBuilder;
|
20417 | this.cd = cd;
|
20418 | this.focusKeyManagerFactoryService = focusKeyManagerFactoryService;
|
20419 | this.focusMonitor = focusMonitor;
|
20420 | this.renderer = renderer;
|
20421 | this.zone = zone;
|
20422 | this.statusService = statusService;
|
20423 | |
20424 |
|
20425 |
|
20426 |
|
20427 | this.size = 'medium';
|
20428 | |
20429 |
|
20430 |
|
20431 |
|
20432 | this.status = 'basic';
|
20433 | |
20434 |
|
20435 |
|
20436 | this.shape = 'rectangle';
|
20437 | |
20438 |
|
20439 |
|
20440 | this.appearance = 'outline';
|
20441 | this._fullWidth = false;
|
20442 | |
20443 |
|
20444 |
|
20445 | this.placeholder = '';
|
20446 | this._compareWith = function (v1, v2) { return v1 === v2; };
|
20447 | this._multiple = false;
|
20448 | |
20449 |
|
20450 |
|
20451 | this.optionsOverlayOffset = 8;
|
20452 | |
20453 |
|
20454 |
|
20455 | this.scrollStrategy = 'block';
|
20456 | |
20457 |
|
20458 |
|
20459 | this.selectedChange = new i0.EventEmitter();
|
20460 | |
20461 |
|
20462 |
|
20463 | this.selectionModel = [];
|
20464 | |
20465 |
|
20466 |
|
20467 |
|
20468 | this.overlayPosition = '';
|
20469 | this.alive = true;
|
20470 | this.destroy$ = new rxjs.Subject();
|
20471 | |
20472 |
|
20473 |
|
20474 | this.onChange = function () { };
|
20475 | this.onTouched = function () { };
|
20476 | |
20477 |
|
20478 |
|
20479 | this.status$ = new rxjs.BehaviorSubject(this.status);
|
20480 | |
20481 |
|
20482 |
|
20483 | this.size$ = new rxjs.BehaviorSubject(this.size);
|
20484 | |
20485 |
|
20486 |
|
20487 | this.focused$ = new rxjs.BehaviorSubject(false);
|
20488 | |
20489 |
|
20490 |
|
20491 | this.disabled$ = new rxjs.BehaviorSubject(this.disabled);
|
20492 | |
20493 |
|
20494 |
|
20495 | this.fullWidth$ = new rxjs.BehaviorSubject(this.fullWidth);
|
20496 | }
|
20497 | Object.defineProperty(NbSelectComponent.prototype, "outline", {
|
20498 | |
20499 |
|
20500 |
|
20501 | get: function () {
|
20502 | return this.appearance === 'outline';
|
20503 | },
|
20504 | set: function (value) {
|
20505 | if (convertToBoolProperty(value)) {
|
20506 | this.appearance = 'outline';
|
20507 | }
|
20508 | },
|
20509 | enumerable: false,
|
20510 | configurable: true
|
20511 | });
|
20512 | Object.defineProperty(NbSelectComponent.prototype, "filled", {
|
20513 | |
20514 |
|
20515 |
|
20516 | get: function () {
|
20517 | return this.appearance === 'filled';
|
20518 | },
|
20519 | set: function (value) {
|
20520 | if (convertToBoolProperty(value)) {
|
20521 | this.appearance = 'filled';
|
20522 | }
|
20523 | },
|
20524 | enumerable: false,
|
20525 | configurable: true
|
20526 | });
|
20527 | Object.defineProperty(NbSelectComponent.prototype, "hero", {
|
20528 | |
20529 |
|
20530 |
|
20531 | get: function () {
|
20532 | return this.appearance === 'hero';
|
20533 | },
|
20534 | set: function (value) {
|
20535 | if (convertToBoolProperty(value)) {
|
20536 | this.appearance = 'hero';
|
20537 | }
|
20538 | },
|
20539 | enumerable: false,
|
20540 | configurable: true
|
20541 | });
|
20542 | Object.defineProperty(NbSelectComponent.prototype, "disabled", {
|
20543 | |
20544 |
|
20545 |
|
20546 | get: function () {
|
20547 | return !!this._disabled;
|
20548 | },
|
20549 | set: function (value) {
|
20550 | this._disabled = convertToBoolProperty(value);
|
20551 | },
|
20552 | enumerable: false,
|
20553 | configurable: true
|
20554 | });
|
20555 | Object.defineProperty(NbSelectComponent.prototype, "fullWidth", {
|
20556 | |
20557 |
|
20558 |
|
20559 | get: function () {
|
20560 | return this._fullWidth;
|
20561 | },
|
20562 | set: function (value) {
|
20563 | this._fullWidth = convertToBoolProperty(value);
|
20564 | },
|
20565 | enumerable: false,
|
20566 | configurable: true
|
20567 | });
|
20568 | Object.defineProperty(NbSelectComponent.prototype, "compareWith", {
|
20569 | |
20570 |
|
20571 |
|
20572 |
|
20573 | get: function () {
|
20574 | return this._compareWith;
|
20575 | },
|
20576 | set: function (fn) {
|
20577 | if (typeof fn !== 'function') {
|
20578 | return;
|
20579 | }
|
20580 | this._compareWith = fn;
|
20581 | if (this.selectionModel.length && this.canSelectValue()) {
|
20582 | this.setSelection(this.selected);
|
20583 | }
|
20584 | },
|
20585 | enumerable: false,
|
20586 | configurable: true
|
20587 | });
|
20588 | Object.defineProperty(NbSelectComponent.prototype, "selected", {
|
20589 | get: function () {
|
20590 | return this.multiple
|
20591 | ? this.selectionModel.map(function (o) { return o.value; })
|
20592 | : this.selectionModel[0].value;
|
20593 | },
|
20594 | |
20595 |
|
20596 |
|
20597 | set: function (value) {
|
20598 | this.writeValue(value);
|
20599 | },
|
20600 | enumerable: false,
|
20601 | configurable: true
|
20602 | });
|
20603 | Object.defineProperty(NbSelectComponent.prototype, "multiple", {
|
20604 | |
20605 |
|
20606 |
|
20607 | get: function () {
|
20608 | return this._multiple;
|
20609 | },
|
20610 | set: function (value) {
|
20611 | this._multiple = convertToBoolProperty(value);
|
20612 | },
|
20613 | enumerable: false,
|
20614 | configurable: true
|
20615 | });
|
20616 | Object.defineProperty(NbSelectComponent.prototype, "additionalClasses", {
|
20617 | get: function () {
|
20618 | if (this.statusService.isCustomStatus(this.status)) {
|
20619 | return [this.statusService.getStatusClass(this.status)];
|
20620 | }
|
20621 | return [];
|
20622 | },
|
20623 | enumerable: false,
|
20624 | configurable: true
|
20625 | });
|
20626 | Object.defineProperty(NbSelectComponent.prototype, "isOpen", {
|
20627 | |
20628 |
|
20629 |
|
20630 | get: function () {
|
20631 | return this.ref && this.ref.hasAttached();
|
20632 | },
|
20633 | enumerable: false,
|
20634 | configurable: true
|
20635 | });
|
20636 | Object.defineProperty(NbSelectComponent.prototype, "isHidden", {
|
20637 | |
20638 |
|
20639 |
|
20640 | get: function () {
|
20641 | return !this.isOpen;
|
20642 | },
|
20643 | enumerable: false,
|
20644 | configurable: true
|
20645 | });
|
20646 | Object.defineProperty(NbSelectComponent.prototype, "hostWidth", {
|
20647 | |
20648 |
|
20649 |
|
20650 | get: function () {
|
20651 | return this.button.nativeElement.getBoundingClientRect().width;
|
20652 | },
|
20653 | enumerable: false,
|
20654 | configurable: true
|
20655 | });
|
20656 | Object.defineProperty(NbSelectComponent.prototype, "selectButtonClasses", {
|
20657 | get: function () {
|
20658 | var classes = [];
|
20659 | if (!this.selectionModel.length) {
|
20660 | classes.push('placeholder');
|
20661 | }
|
20662 | if (!this.selectionModel.length && !this.placeholder) {
|
20663 | classes.push('empty');
|
20664 | }
|
20665 | if (this.isOpen) {
|
20666 | classes.push(this.overlayPosition);
|
20667 | }
|
20668 | return classes;
|
20669 | },
|
20670 | enumerable: false,
|
20671 | configurable: true
|
20672 | });
|
20673 | Object.defineProperty(NbSelectComponent.prototype, "selectionView", {
|
20674 | |
20675 |
|
20676 |
|
20677 | get: function () {
|
20678 | if (this.selectionModel.length > 1) {
|
20679 | return this.selectionModel.map(function (option) { return option.content; }).join(', ');
|
20680 | }
|
20681 | return this.selectionModel[0].content;
|
20682 | },
|
20683 | enumerable: false,
|
20684 | configurable: true
|
20685 | });
|
20686 | NbSelectComponent.prototype.ngOnChanges = function (_a) {
|
20687 | var disabled = _a.disabled, status = _a.status, size = _a.size, fullWidth = _a.fullWidth;
|
20688 | if (disabled) {
|
20689 | this.disabled$.next(disabled.currentValue);
|
20690 | }
|
20691 | if (status) {
|
20692 | this.status$.next(status.currentValue);
|
20693 | }
|
20694 | if (size) {
|
20695 | this.size$.next(size.currentValue);
|
20696 | }
|
20697 | if (fullWidth) {
|
20698 | this.fullWidth$.next(this.fullWidth);
|
20699 | }
|
20700 | };
|
20701 | NbSelectComponent.prototype.ngAfterContentInit = function () {
|
20702 | var _this = this;
|
20703 | this.options.changes
|
20704 | .pipe(rxjs_operators.startWith(this.options), rxjs_operators.filter(function () { return _this.queue != null && _this.canSelectValue(); }),
|
20705 |
|
20706 |
|
20707 |
|
20708 |
|
20709 | rxjs_operators.switchMap(function (options) { return rxjs.from(Promise.resolve(options)); }), rxjs_operators.takeUntil(this.destroy$))
|
20710 | .subscribe(function () { return _this.writeValue(_this.queue); });
|
20711 | };
|
20712 | NbSelectComponent.prototype.ngAfterViewInit = function () {
|
20713 | var _this = this;
|
20714 | this.triggerStrategy = this.createTriggerStrategy();
|
20715 | this.subscribeOnButtonFocus();
|
20716 | this.subscribeOnTriggers();
|
20717 | this.subscribeOnOptionClick();
|
20718 |
|
20719 | this.zone.runOutsideAngular(function () { return setTimeout(function () {
|
20720 | _this.renderer.addClass(_this.hostRef.nativeElement, 'nb-transition');
|
20721 | }); });
|
20722 | };
|
20723 | NbSelectComponent.prototype.ngOnDestroy = function () {
|
20724 | this.alive = false;
|
20725 | this.destroy$.next();
|
20726 | this.destroy$.complete();
|
20727 | if (this.ref) {
|
20728 | this.ref.dispose();
|
20729 | }
|
20730 | if (this.triggerStrategy) {
|
20731 | this.triggerStrategy.destroy();
|
20732 | }
|
20733 | };
|
20734 | NbSelectComponent.prototype.show = function () {
|
20735 | if (this.isHidden) {
|
20736 | this.attachToOverlay();
|
20737 | this.setActiveOption();
|
20738 | this.cd.markForCheck();
|
20739 | }
|
20740 | };
|
20741 | NbSelectComponent.prototype.hide = function () {
|
20742 | if (this.isOpen) {
|
20743 | this.ref.detach();
|
20744 | this.cd.markForCheck();
|
20745 | }
|
20746 | };
|
20747 | NbSelectComponent.prototype.registerOnChange = function (fn) {
|
20748 | this.onChange = fn;
|
20749 | };
|
20750 | NbSelectComponent.prototype.registerOnTouched = function (fn) {
|
20751 | this.onTouched = fn;
|
20752 | };
|
20753 | NbSelectComponent.prototype.setDisabledState = function (isDisabled) {
|
20754 | this.disabled = isDisabled;
|
20755 | this.cd.markForCheck();
|
20756 | };
|
20757 | NbSelectComponent.prototype.writeValue = function (value) {
|
20758 | if (!this.alive) {
|
20759 | return;
|
20760 | }
|
20761 | if (this.canSelectValue()) {
|
20762 | this.setSelection(value);
|
20763 | if (this.selectionModel.length) {
|
20764 | this.queue = null;
|
20765 | }
|
20766 | }
|
20767 | else {
|
20768 | this.queue = value;
|
20769 | }
|
20770 | };
|
20771 | |
20772 |
|
20773 |
|
20774 | NbSelectComponent.prototype.handleOptionClick = function (option) {
|
20775 | this.queue = null;
|
20776 | if (option.value == null) {
|
20777 | this.reset();
|
20778 | }
|
20779 | else {
|
20780 | this.selectOption(option);
|
20781 | }
|
20782 | this.cd.markForCheck();
|
20783 | };
|
20784 | |
20785 |
|
20786 |
|
20787 | NbSelectComponent.prototype.reset = function () {
|
20788 | this.selectionModel.forEach(function (option) { return option.deselect(); });
|
20789 | this.selectionModel = [];
|
20790 | this.hide();
|
20791 | this.button.nativeElement.focus();
|
20792 | this.emitSelected(this.multiple ? [] : null);
|
20793 | };
|
20794 | |
20795 |
|
20796 |
|
20797 | NbSelectComponent.prototype.selectOption = function (option) {
|
20798 | if (this.multiple) {
|
20799 | this.handleMultipleSelect(option);
|
20800 | }
|
20801 | else {
|
20802 | this.handleSingleSelect(option);
|
20803 | }
|
20804 | };
|
20805 | |
20806 |
|
20807 |
|
20808 | NbSelectComponent.prototype.handleSingleSelect = function (option) {
|
20809 | var selected = this.selectionModel.pop();
|
20810 | if (selected && !this._compareWith(selected.value, option.value)) {
|
20811 | selected.deselect();
|
20812 | }
|
20813 | this.selectionModel = [option];
|
20814 | option.select();
|
20815 | this.hide();
|
20816 | this.button.nativeElement.focus();
|
20817 | this.emitSelected(option.value);
|
20818 | };
|
20819 | |
20820 |
|
20821 |
|
20822 | NbSelectComponent.prototype.handleMultipleSelect = function (option) {
|
20823 | var _this = this;
|
20824 | if (option.selected) {
|
20825 | this.selectionModel = this.selectionModel.filter(function (s) { return !_this._compareWith(s.value, option.value); });
|
20826 | option.deselect();
|
20827 | }
|
20828 | else {
|
20829 | this.selectionModel.push(option);
|
20830 | option.select();
|
20831 | }
|
20832 | this.emitSelected(this.selectionModel.map(function (opt) { return opt.value; }));
|
20833 | };
|
20834 | NbSelectComponent.prototype.attachToOverlay = function () {
|
20835 | if (!this.ref) {
|
20836 | this.createOverlay();
|
20837 | this.subscribeOnPositionChange();
|
20838 | this.createKeyManager();
|
20839 | this.subscribeOnOverlayKeys();
|
20840 | }
|
20841 | this.ref.attach(this.portal);
|
20842 | };
|
20843 | NbSelectComponent.prototype.setActiveOption = function () {
|
20844 | if (this.selectionModel.length) {
|
20845 | this.keyManager.setActiveItem(this.selectionModel[0]);
|
20846 | }
|
20847 | else {
|
20848 | this.keyManager.setFirstItemActive();
|
20849 | }
|
20850 | };
|
20851 | NbSelectComponent.prototype.createOverlay = function () {
|
20852 | var scrollStrategy = this.createScrollStrategy();
|
20853 | this.positionStrategy = this.createPositionStrategy();
|
20854 | this.ref = this.overlay.create({
|
20855 | positionStrategy: this.positionStrategy,
|
20856 | scrollStrategy: scrollStrategy,
|
20857 | panelClass: this.optionsPanelClass,
|
20858 | });
|
20859 | };
|
20860 | NbSelectComponent.prototype.createKeyManager = function () {
|
20861 | this.keyManager = this.focusKeyManagerFactoryService.create(this.options).withTypeAhead(200);
|
20862 | };
|
20863 | NbSelectComponent.prototype.createPositionStrategy = function () {
|
20864 | return this.positionBuilder
|
20865 | .connectedTo(this.button)
|
20866 | .position(exports.NbPosition.BOTTOM)
|
20867 | .offset(this.optionsOverlayOffset)
|
20868 | .adjustment(exports.NbAdjustment.VERTICAL);
|
20869 | };
|
20870 | NbSelectComponent.prototype.createScrollStrategy = function () {
|
20871 | return this.overlay.scrollStrategies[this.scrollStrategy]();
|
20872 | };
|
20873 | NbSelectComponent.prototype.createTriggerStrategy = function () {
|
20874 | var _this = this;
|
20875 | return this.triggerStrategyBuilder
|
20876 | .trigger(exports.NbTrigger.CLICK)
|
20877 | .host(this.hostRef.nativeElement)
|
20878 | .container(function () { return _this.getContainer(); })
|
20879 | .build();
|
20880 | };
|
20881 | NbSelectComponent.prototype.subscribeOnTriggers = function () {
|
20882 | var _this = this;
|
20883 | this.triggerStrategy.show$.subscribe(function () { return _this.show(); });
|
20884 | this.triggerStrategy.hide$
|
20885 | .pipe(rxjs_operators.filter(function () { return _this.isOpen; }))
|
20886 | .subscribe(function ($event) {
|
20887 | _this.hide();
|
20888 | if (!_this.isClickedWithinComponent($event)) {
|
20889 | _this.onTouched();
|
20890 | }
|
20891 | });
|
20892 | };
|
20893 | NbSelectComponent.prototype.subscribeOnPositionChange = function () {
|
20894 | var _this = this;
|
20895 | this.positionStrategy.positionChange
|
20896 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
20897 | .subscribe(function (position) {
|
20898 | _this.overlayPosition = position;
|
20899 | _this.cd.detectChanges();
|
20900 | });
|
20901 | };
|
20902 | NbSelectComponent.prototype.subscribeOnOptionClick = function () {
|
20903 | var _this = this;
|
20904 | |
20905 |
|
20906 |
|
20907 |
|
20908 |
|
20909 | this.options.changes
|
20910 | .pipe(rxjs_operators.startWith(this.options), rxjs_operators.switchMap(function (options) {
|
20911 | return rxjs.merge.apply(void 0, options.map(function (option) { return option.click; }));
|
20912 | }), rxjs_operators.takeUntil(this.destroy$))
|
20913 | .subscribe(function (clickedOption) { return _this.handleOptionClick(clickedOption); });
|
20914 | };
|
20915 | NbSelectComponent.prototype.subscribeOnOverlayKeys = function () {
|
20916 | var _this = this;
|
20917 | this.ref.keydownEvents()
|
20918 | .pipe(rxjs_operators.filter(function () { return _this.isOpen; }), rxjs_operators.takeUntil(this.destroy$))
|
20919 | .subscribe(function (event) {
|
20920 | if (event.keyCode === _angular_cdk_keycodes.ESCAPE) {
|
20921 | _this.button.nativeElement.focus();
|
20922 | _this.hide();
|
20923 | }
|
20924 | else {
|
20925 | _this.keyManager.onKeydown(event);
|
20926 | }
|
20927 | });
|
20928 | this.keyManager.tabOut
|
20929 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
20930 | .subscribe(function () {
|
20931 | _this.hide();
|
20932 | _this.onTouched();
|
20933 | });
|
20934 | };
|
20935 | NbSelectComponent.prototype.subscribeOnButtonFocus = function () {
|
20936 | var _this = this;
|
20937 | this.focusMonitor.monitor(this.button)
|
20938 | .pipe(rxjs_operators.map(function (origin) { return !!origin; }), rxjs_operators.finalize(function () { return _this.focusMonitor.stopMonitoring(_this.button); }), rxjs_operators.takeUntil(this.destroy$))
|
20939 | .subscribe(this.focused$);
|
20940 | };
|
20941 | NbSelectComponent.prototype.getContainer = function () {
|
20942 | return this.ref && this.ref.hasAttached() && {
|
20943 | location: {
|
20944 | nativeElement: this.ref.overlayElement,
|
20945 | },
|
20946 | };
|
20947 | };
|
20948 | |
20949 |
|
20950 |
|
20951 | NbSelectComponent.prototype.emitSelected = function (selected) {
|
20952 | this.onChange(selected);
|
20953 | this.selectedChange.emit(selected);
|
20954 | };
|
20955 | |
20956 |
|
20957 |
|
20958 | NbSelectComponent.prototype.setSelection = function (value) {
|
20959 | var _this = this;
|
20960 | var isArray = Array.isArray(value);
|
20961 | if (this.multiple && !isArray) {
|
20962 | throw new Error('Can\'t assign single value if select is marked as multiple');
|
20963 | }
|
20964 | if (!this.multiple && isArray) {
|
20965 | throw new Error('Can\'t assign array if select is not marked as multiple');
|
20966 | }
|
20967 | var previouslySelectedOptions = this.selectionModel;
|
20968 | this.selectionModel = [];
|
20969 | if (isArray) {
|
20970 | value.forEach(function (option) { return _this.selectValue(option); });
|
20971 | }
|
20972 | else {
|
20973 | this.selectValue(value);
|
20974 | }
|
20975 |
|
20976 | previouslySelectedOptions
|
20977 | .filter(function (option) { return !_this.selectionModel.includes(option); })
|
20978 | .forEach(function (option) { return option.deselect(); });
|
20979 | this.cd.markForCheck();
|
20980 | };
|
20981 | |
20982 |
|
20983 |
|
20984 | NbSelectComponent.prototype.selectValue = function (value) {
|
20985 | var _this = this;
|
20986 | var corresponding = this.options.find(function (option) { return _this._compareWith(option.value, value); });
|
20987 | if (corresponding) {
|
20988 | corresponding.select();
|
20989 | this.selectionModel.push(corresponding);
|
20990 | }
|
20991 | };
|
20992 | |
20993 |
|
20994 |
|
20995 |
|
20996 | NbSelectComponent.prototype.trySetTouched = function () {
|
20997 | if (this.isHidden) {
|
20998 | this.onTouched();
|
20999 | }
|
21000 | };
|
21001 | NbSelectComponent.prototype.isClickedWithinComponent = function ($event) {
|
21002 | return this.hostRef.nativeElement === $event.target || this.hostRef.nativeElement.contains($event.target);
|
21003 | };
|
21004 | NbSelectComponent.prototype.canSelectValue = function () {
|
21005 | return !!(this.options && this.options.length);
|
21006 | };
|
21007 | Object.defineProperty(NbSelectComponent.prototype, "tiny", {
|
21008 | get: function () {
|
21009 | return this.size === 'tiny';
|
21010 | },
|
21011 | enumerable: false,
|
21012 | configurable: true
|
21013 | });
|
21014 | Object.defineProperty(NbSelectComponent.prototype, "small", {
|
21015 | get: function () {
|
21016 | return this.size === 'small';
|
21017 | },
|
21018 | enumerable: false,
|
21019 | configurable: true
|
21020 | });
|
21021 | Object.defineProperty(NbSelectComponent.prototype, "medium", {
|
21022 | get: function () {
|
21023 | return this.size === 'medium';
|
21024 | },
|
21025 | enumerable: false,
|
21026 | configurable: true
|
21027 | });
|
21028 | Object.defineProperty(NbSelectComponent.prototype, "large", {
|
21029 | get: function () {
|
21030 | return this.size === 'large';
|
21031 | },
|
21032 | enumerable: false,
|
21033 | configurable: true
|
21034 | });
|
21035 | Object.defineProperty(NbSelectComponent.prototype, "giant", {
|
21036 | get: function () {
|
21037 | return this.size === 'giant';
|
21038 | },
|
21039 | enumerable: false,
|
21040 | configurable: true
|
21041 | });
|
21042 | Object.defineProperty(NbSelectComponent.prototype, "primary", {
|
21043 | get: function () {
|
21044 | return this.status === 'primary';
|
21045 | },
|
21046 | enumerable: false,
|
21047 | configurable: true
|
21048 | });
|
21049 | Object.defineProperty(NbSelectComponent.prototype, "info", {
|
21050 | get: function () {
|
21051 | return this.status === 'info';
|
21052 | },
|
21053 | enumerable: false,
|
21054 | configurable: true
|
21055 | });
|
21056 | Object.defineProperty(NbSelectComponent.prototype, "success", {
|
21057 | get: function () {
|
21058 | return this.status === 'success';
|
21059 | },
|
21060 | enumerable: false,
|
21061 | configurable: true
|
21062 | });
|
21063 | Object.defineProperty(NbSelectComponent.prototype, "warning", {
|
21064 | get: function () {
|
21065 | return this.status === 'warning';
|
21066 | },
|
21067 | enumerable: false,
|
21068 | configurable: true
|
21069 | });
|
21070 | Object.defineProperty(NbSelectComponent.prototype, "danger", {
|
21071 | get: function () {
|
21072 | return this.status === 'danger';
|
21073 | },
|
21074 | enumerable: false,
|
21075 | configurable: true
|
21076 | });
|
21077 | Object.defineProperty(NbSelectComponent.prototype, "basic", {
|
21078 | get: function () {
|
21079 | return this.status === 'basic';
|
21080 | },
|
21081 | enumerable: false,
|
21082 | configurable: true
|
21083 | });
|
21084 | Object.defineProperty(NbSelectComponent.prototype, "control", {
|
21085 | get: function () {
|
21086 | return this.status === 'control';
|
21087 | },
|
21088 | enumerable: false,
|
21089 | configurable: true
|
21090 | });
|
21091 | Object.defineProperty(NbSelectComponent.prototype, "rectangle", {
|
21092 | get: function () {
|
21093 | return this.shape === 'rectangle';
|
21094 | },
|
21095 | enumerable: false,
|
21096 | configurable: true
|
21097 | });
|
21098 | Object.defineProperty(NbSelectComponent.prototype, "round", {
|
21099 | get: function () {
|
21100 | return this.shape === 'round';
|
21101 | },
|
21102 | enumerable: false,
|
21103 | configurable: true
|
21104 | });
|
21105 | Object.defineProperty(NbSelectComponent.prototype, "semiRound", {
|
21106 | get: function () {
|
21107 | return this.shape === 'semi-round';
|
21108 | },
|
21109 | enumerable: false,
|
21110 | configurable: true
|
21111 | });
|
21112 | NbSelectComponent.decorators = [
|
21113 | { type: i0.Component, args: [{
|
21114 | selector: 'nb-select',
|
21115 | template: "<button [disabled]=\"disabled\"\n [ngClass]=\"selectButtonClasses\"\n (blur)=\"trySetTouched()\"\n (keydown.arrowDown)=\"show()\"\n (keydown.arrowUp)=\"show()\"\n class=\"select-button\"\n type=\"button\"\n #selectButton>\n\n <ng-container *ngIf=\"selectionModel.length; else placeholderTemplate\">\n <ng-container *ngIf=\"customLabel; else defaultSelectionTemplate\">\n <ng-content select=\"nb-select-label\"></ng-content>\n </ng-container>\n\n <ng-template #defaultSelectionTemplate>{{ selectionView }}</ng-template>\n </ng-container>\n\n <ng-template #placeholderTemplate>{{ placeholder }}</ng-template>\n\n <nb-icon icon=\"chevron-down-outline\" pack=\"nebular-essentials\" (click)=\"disabled && $event.stopPropagation()\" aria-hidden=\"true\">\n </nb-icon>\n</button>\n\n<nb-option-list *nbPortal [size]=\"size\" [position]=\"overlayPosition\" [style.width.px]=\"hostWidth\" [ngClass]=\"optionsListClass\">\n <ng-content select=\"nb-option, nb-option-group\"></ng-content>\n</nb-option-list>\n",
|
21116 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
21117 | providers: [
|
21118 | {
|
21119 | provide: _angular_forms.NG_VALUE_ACCESSOR,
|
21120 | useExisting: i0.forwardRef(function () { return NbSelectComponent; }),
|
21121 | multi: true,
|
21122 | },
|
21123 | { provide: NB_SELECT_INJECTION_TOKEN, useExisting: NbSelectComponent },
|
21124 | { provide: NbFormFieldControl, useExisting: NbSelectComponent },
|
21125 | { provide: NbFormFieldControlConfig, useFactory: nbSelectFormFieldControlConfigFactory },
|
21126 | ],
|
21127 | styles: ["/*!\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */:host{display:inline-block;max-width:100%}[dir=ltr] :host .select-button{text-align:left}[dir=ltr] :host .select-button nb-icon{right:0.2em}[dir=rtl] :host .select-button{text-align:right}[dir=rtl] :host .select-button nb-icon{left:0.2em}:host(.full-width){width:100%}:host(.nb-transition) .select-button{transition-duration:0.15s;transition-property:background-color,border-color,border-radius,box-shadow,color;transition-timing-function:ease-in}.select-button{position:relative;width:100%;overflow:hidden;text-overflow:ellipsis;text-transform:none;white-space:nowrap}nb-icon{font-size:1.5em;position:absolute;top:50%;transform:translateY(-50%);transition-duration:0.15s;transition-property:transform;transition-timing-function:ease-in}[dir=ltr] nb-icon{right:.5rem}[dir=rtl] nb-icon{left:.5rem}:host(.open) nb-icon{transform:translateY(-50%) rotate(180deg)}\n"]
|
21128 | },] }
|
21129 | ];
|
21130 | NbSelectComponent.ctorParameters = function () { return [
|
21131 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
21132 | { type: NbOverlayService },
|
21133 | { type: i0.ElementRef },
|
21134 | { type: NbPositionBuilderService },
|
21135 | { type: NbTriggerStrategyBuilderService },
|
21136 | { type: i0.ChangeDetectorRef },
|
21137 | { type: NbFocusKeyManagerFactoryService },
|
21138 | { type: NbFocusMonitor },
|
21139 | { type: i0.Renderer2 },
|
21140 | { type: i0.NgZone },
|
21141 | { type: NbStatusService }
|
21142 | ]; };
|
21143 | NbSelectComponent.propDecorators = {
|
21144 | size: [{ type: i0.Input }],
|
21145 | status: [{ type: i0.Input }],
|
21146 | shape: [{ type: i0.Input }],
|
21147 | appearance: [{ type: i0.Input }],
|
21148 | optionsListClass: [{ type: i0.Input }],
|
21149 | optionsPanelClass: [{ type: i0.Input }],
|
21150 | outline: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.appearance-outline',] }],
|
21151 | filled: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.appearance-filled',] }],
|
21152 | hero: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.appearance-hero',] }],
|
21153 | disabled: [{ type: i0.Input }],
|
21154 | fullWidth: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.full-width',] }],
|
21155 | placeholder: [{ type: i0.Input }],
|
21156 | compareWith: [{ type: i0.Input }],
|
21157 | selected: [{ type: i0.Input }],
|
21158 | multiple: [{ type: i0.Input }],
|
21159 | optionsOverlayOffset: [{ type: i0.Input }],
|
21160 | scrollStrategy: [{ type: i0.Input }],
|
21161 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }],
|
21162 | selectedChange: [{ type: i0.Output }],
|
21163 | options: [{ type: i0.ContentChildren, args: [NbOptionComponent, { descendants: true },] }],
|
21164 | customLabel: [{ type: i0.ContentChild, args: [NbSelectLabelComponent,] }],
|
21165 | portal: [{ type: i0.ViewChild, args: [NbPortalDirective,] }],
|
21166 | button: [{ type: i0.ViewChild, args: ['selectButton', { read: i0.ElementRef },] }],
|
21167 | isOpen: [{ type: i0.HostBinding, args: ['class.open',] }],
|
21168 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
21169 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
21170 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
21171 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
21172 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }],
|
21173 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
21174 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
21175 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
21176 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
21177 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
21178 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
21179 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
21180 | rectangle: [{ type: i0.HostBinding, args: ['class.shape-rectangle',] }],
|
21181 | round: [{ type: i0.HostBinding, args: ['class.shape-round',] }],
|
21182 | semiRound: [{ type: i0.HostBinding, args: ['class.shape-semi-round',] }]
|
21183 | };
|
21184 | return NbSelectComponent;
|
21185 | }());
|
21186 |
|
21187 |
|
21188 |
|
21189 |
|
21190 |
|
21191 |
|
21192 |
|
21193 |
|
21194 |
|
21195 |
|
21196 |
|
21197 |
|
21198 |
|
21199 |
|
21200 |
|
21201 |
|
21202 |
|
21203 |
|
21204 | var NbOptionGroupComponent = (function () {
|
21205 | function NbOptionGroupComponent() {
|
21206 | this.destroy$ = new rxjs.Subject();
|
21207 | this._disabled = false;
|
21208 | }
|
21209 | Object.defineProperty(NbOptionGroupComponent.prototype, "disabled", {
|
21210 | get: function () {
|
21211 | return this._disabled;
|
21212 | },
|
21213 | set: function (value) {
|
21214 | this._disabled = convertToBoolProperty(value);
|
21215 | if (this.options) {
|
21216 | this.updateOptionsDisabledState();
|
21217 | }
|
21218 | },
|
21219 | enumerable: false,
|
21220 | configurable: true
|
21221 | });
|
21222 | Object.defineProperty(NbOptionGroupComponent.prototype, "disabledAttribute", {
|
21223 | get: function () {
|
21224 | return this.disabled ? '' : null;
|
21225 | },
|
21226 | enumerable: false,
|
21227 | configurable: true
|
21228 | });
|
21229 | NbOptionGroupComponent.prototype.ngAfterContentInit = function () {
|
21230 | var _this = this;
|
21231 | if (this.options.length) {
|
21232 | this.asyncUpdateOptionsDisabledState();
|
21233 | }
|
21234 | this.options.changes
|
21235 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
21236 | .subscribe(function () { return _this.asyncUpdateOptionsDisabledState(); });
|
21237 | };
|
21238 | NbOptionGroupComponent.prototype.ngOnDestroy = function () {
|
21239 | this.destroy$.next();
|
21240 | this.destroy$.complete();
|
21241 | };
|
21242 | |
21243 |
|
21244 |
|
21245 | NbOptionGroupComponent.prototype.updateOptionsDisabledState = function () {
|
21246 | var _this = this;
|
21247 | this.options.forEach(function (option) { return option.setDisabledByGroupState(_this.disabled); });
|
21248 | };
|
21249 | |
21250 |
|
21251 |
|
21252 |
|
21253 |
|
21254 | NbOptionGroupComponent.prototype.asyncUpdateOptionsDisabledState = function () {
|
21255 | var _this = this;
|
21256 |
|
21257 | rxjs.from(Promise.resolve())
|
21258 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
21259 | .subscribe(function () { return _this.updateOptionsDisabledState(); });
|
21260 | };
|
21261 | NbOptionGroupComponent.decorators = [
|
21262 | { type: i0.Component, args: [{
|
21263 | selector: 'nb-option-group',
|
21264 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
21265 | template: "\n <span class=\"option-group-title\">{{ title }}</span>\n <ng-content select=\"nb-option, ng-container\"></ng-content>\n ",
|
21266 | styles: [":host{display:block}.option-group-title{display:block}\n"]
|
21267 | },] }
|
21268 | ];
|
21269 | NbOptionGroupComponent.propDecorators = {
|
21270 | title: [{ type: i0.Input }],
|
21271 | disabled: [{ type: i0.Input }],
|
21272 | disabledAttribute: [{ type: i0.HostBinding, args: ['attr.disabled',] }],
|
21273 | options: [{ type: i0.ContentChildren, args: [NbOptionComponent, { descendants: true },] }]
|
21274 | };
|
21275 | return NbOptionGroupComponent;
|
21276 | }());
|
21277 |
|
21278 |
|
21279 |
|
21280 |
|
21281 |
|
21282 |
|
21283 |
|
21284 |
|
21285 |
|
21286 |
|
21287 |
|
21288 |
|
21289 |
|
21290 |
|
21291 |
|
21292 |
|
21293 |
|
21294 | var NbOptionListComponent = (function () {
|
21295 | function NbOptionListComponent() {
|
21296 | this.size = 'medium';
|
21297 | }
|
21298 | Object.defineProperty(NbOptionListComponent.prototype, "positionTop", {
|
21299 | get: function () {
|
21300 | return this.position === exports.NbPosition.TOP;
|
21301 | },
|
21302 | enumerable: false,
|
21303 | configurable: true
|
21304 | });
|
21305 | Object.defineProperty(NbOptionListComponent.prototype, "positionBottom", {
|
21306 | get: function () {
|
21307 | return this.position === exports.NbPosition.BOTTOM;
|
21308 | },
|
21309 | enumerable: false,
|
21310 | configurable: true
|
21311 | });
|
21312 | Object.defineProperty(NbOptionListComponent.prototype, "sizeTiny", {
|
21313 | get: function () {
|
21314 | return this.size === 'tiny';
|
21315 | },
|
21316 | enumerable: false,
|
21317 | configurable: true
|
21318 | });
|
21319 | Object.defineProperty(NbOptionListComponent.prototype, "sizeSmall", {
|
21320 | get: function () {
|
21321 | return this.size === 'small';
|
21322 | },
|
21323 | enumerable: false,
|
21324 | configurable: true
|
21325 | });
|
21326 | Object.defineProperty(NbOptionListComponent.prototype, "sizeMedium", {
|
21327 | get: function () {
|
21328 | return this.size === 'medium';
|
21329 | },
|
21330 | enumerable: false,
|
21331 | configurable: true
|
21332 | });
|
21333 | Object.defineProperty(NbOptionListComponent.prototype, "sizeLarge", {
|
21334 | get: function () {
|
21335 | return this.size === 'large';
|
21336 | },
|
21337 | enumerable: false,
|
21338 | configurable: true
|
21339 | });
|
21340 | Object.defineProperty(NbOptionListComponent.prototype, "sizeGiant", {
|
21341 | get: function () {
|
21342 | return this.size === 'giant';
|
21343 | },
|
21344 | enumerable: false,
|
21345 | configurable: true
|
21346 | });
|
21347 | NbOptionListComponent.decorators = [
|
21348 | { type: i0.Component, args: [{
|
21349 | selector: 'nb-option-list',
|
21350 | template: "\n <ul class=\"option-list\">\n <ng-content></ng-content>\n </ul>\n ",
|
21351 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
21352 | },] }
|
21353 | ];
|
21354 | NbOptionListComponent.propDecorators = {
|
21355 | size: [{ type: i0.Input }],
|
21356 | position: [{ type: i0.Input }],
|
21357 | positionTop: [{ type: i0.HostBinding, args: ['class.position-top',] }],
|
21358 | positionBottom: [{ type: i0.HostBinding, args: ['class.position-bottom',] }],
|
21359 | sizeTiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
21360 | sizeSmall: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
21361 | sizeMedium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
21362 | sizeLarge: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
21363 | sizeGiant: [{ type: i0.HostBinding, args: ['class.size-giant',] }]
|
21364 | };
|
21365 | return NbOptionListComponent;
|
21366 | }());
|
21367 |
|
21368 | var NB_OPTION_LIST_COMPONENTS = [
|
21369 | NbOptionListComponent,
|
21370 | NbOptionComponent,
|
21371 | NbOptionGroupComponent,
|
21372 | ];
|
21373 | var NbOptionModule = (function () {
|
21374 | function NbOptionModule() {
|
21375 | }
|
21376 | NbOptionModule.decorators = [
|
21377 | { type: i0.NgModule, args: [{
|
21378 | declarations: tslib.__spreadArray([], NB_OPTION_LIST_COMPONENTS),
|
21379 | imports: [
|
21380 | _angular_common.CommonModule,
|
21381 | NbCheckboxModule,
|
21382 | ],
|
21383 | exports: tslib.__spreadArray([], NB_OPTION_LIST_COMPONENTS),
|
21384 | },] }
|
21385 | ];
|
21386 | return NbOptionModule;
|
21387 | }());
|
21388 |
|
21389 | var NB_SELECT_COMPONENTS = [
|
21390 | NbSelectComponent,
|
21391 | NbSelectLabelComponent,
|
21392 | ];
|
21393 | var NbSelectModule = (function () {
|
21394 | function NbSelectModule() {
|
21395 | }
|
21396 | NbSelectModule.decorators = [
|
21397 | { type: i0.NgModule, args: [{
|
21398 | imports: [
|
21399 | NbSharedModule,
|
21400 | NbOverlayModule,
|
21401 | NbButtonModule,
|
21402 | NbInputModule,
|
21403 | NbCardModule,
|
21404 | NbIconModule,
|
21405 | NbOptionModule,
|
21406 | ],
|
21407 | exports: tslib.__spreadArray(tslib.__spreadArray([], NB_SELECT_COMPONENTS), [
|
21408 | NbOptionModule,
|
21409 | ]),
|
21410 | declarations: tslib.__spreadArray([], NB_SELECT_COMPONENTS),
|
21411 | },] }
|
21412 | ];
|
21413 | return NbSelectModule;
|
21414 | }());
|
21415 |
|
21416 |
|
21417 |
|
21418 |
|
21419 |
|
21420 |
|
21421 |
|
21422 | var lastAutocompleteId = 0;
|
21423 |
|
21424 |
|
21425 |
|
21426 |
|
21427 | var NbAutocompleteComponent = (function () {
|
21428 | function NbAutocompleteComponent(cd) {
|
21429 | this.cd = cd;
|
21430 | this.destroy$ = new rxjs.Subject();
|
21431 | |
21432 |
|
21433 |
|
21434 | this.id = "nb-autocomplete-" + lastAutocompleteId++;
|
21435 | |
21436 |
|
21437 |
|
21438 |
|
21439 |
|
21440 | this._overlayPosition = '';
|
21441 | |
21442 |
|
21443 |
|
21444 |
|
21445 | this.size = 'medium';
|
21446 | |
21447 |
|
21448 |
|
21449 | this.activeFirst = false;
|
21450 | |
21451 |
|
21452 |
|
21453 | this.selectedChange = new i0.EventEmitter();
|
21454 | }
|
21455 | Object.defineProperty(NbAutocompleteComponent.prototype, "overlayPosition", {
|
21456 | get: function () {
|
21457 | return this._overlayPosition;
|
21458 | },
|
21459 | set: function (value) {
|
21460 | this._overlayPosition = value;
|
21461 |
|
21462 | this.cd.detectChanges();
|
21463 | },
|
21464 | enumerable: false,
|
21465 | configurable: true
|
21466 | });
|
21467 | Object.defineProperty(NbAutocompleteComponent.prototype, "hostWidth", {
|
21468 | |
21469 |
|
21470 |
|
21471 | get: function () {
|
21472 | return this.hostRef.nativeElement.getBoundingClientRect().width;
|
21473 | },
|
21474 | enumerable: false,
|
21475 | configurable: true
|
21476 | });
|
21477 | NbAutocompleteComponent.prototype.ngAfterContentInit = function () {
|
21478 | var _this = this;
|
21479 | this.options.changes
|
21480 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
21481 | .subscribe(function () { return _this.cd.detectChanges(); });
|
21482 | };
|
21483 | NbAutocompleteComponent.prototype.ngOnDestroy = function () {
|
21484 | this.destroy$.next();
|
21485 | this.destroy$.complete();
|
21486 | };
|
21487 | |
21488 |
|
21489 |
|
21490 |
|
21491 | NbAutocompleteComponent.prototype.setHost = function (hostRef) {
|
21492 | this.hostRef = hostRef;
|
21493 | };
|
21494 | |
21495 |
|
21496 |
|
21497 | NbAutocompleteComponent.prototype.emitSelected = function (selected) {
|
21498 | this.selectedChange.emit(selected);
|
21499 | };
|
21500 | Object.defineProperty(NbAutocompleteComponent.prototype, "tiny", {
|
21501 | get: function () {
|
21502 | return this.size === 'tiny';
|
21503 | },
|
21504 | enumerable: false,
|
21505 | configurable: true
|
21506 | });
|
21507 | Object.defineProperty(NbAutocompleteComponent.prototype, "small", {
|
21508 | get: function () {
|
21509 | return this.size === 'small';
|
21510 | },
|
21511 | enumerable: false,
|
21512 | configurable: true
|
21513 | });
|
21514 | Object.defineProperty(NbAutocompleteComponent.prototype, "medium", {
|
21515 | get: function () {
|
21516 | return this.size === 'medium';
|
21517 | },
|
21518 | enumerable: false,
|
21519 | configurable: true
|
21520 | });
|
21521 | Object.defineProperty(NbAutocompleteComponent.prototype, "large", {
|
21522 | get: function () {
|
21523 | return this.size === 'large';
|
21524 | },
|
21525 | enumerable: false,
|
21526 | configurable: true
|
21527 | });
|
21528 | Object.defineProperty(NbAutocompleteComponent.prototype, "giant", {
|
21529 | get: function () {
|
21530 | return this.size === 'giant';
|
21531 | },
|
21532 | enumerable: false,
|
21533 | configurable: true
|
21534 | });
|
21535 | NbAutocompleteComponent.decorators = [
|
21536 | { type: i0.Component, args: [{
|
21537 | selector: 'nb-autocomplete',
|
21538 | template: "<nb-option-list *nbPortal\n [size]=\"size\"\n [position]=\"overlayPosition\"\n [style.width.px]=\"hostWidth\"\n role=\"listbox\"\n [id]=\"id\"\n [class.empty]=\"!options?.length\"\n [ngClass]=\"optionsListClass\">\n <ng-content select=\"nb-option, nb-option-group\"></ng-content>\n</nb-option-list>\n",
|
21539 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
21540 | styles: [":host(:hover){cursor:pointer}nb-option-list.empty{border:none}\n"]
|
21541 | },] }
|
21542 | ];
|
21543 | NbAutocompleteComponent.ctorParameters = function () { return [
|
21544 | { type: i0.ChangeDetectorRef }
|
21545 | ]; };
|
21546 | NbAutocompleteComponent.propDecorators = {
|
21547 | handleDisplayFn: [{ type: i0.Input }],
|
21548 | size: [{ type: i0.Input }],
|
21549 | activeFirst: [{ type: i0.Input }],
|
21550 | optionsListClass: [{ type: i0.Input }],
|
21551 | optionsPanelClass: [{ type: i0.Input }],
|
21552 | selectedChange: [{ type: i0.Output }],
|
21553 | options: [{ type: i0.ContentChildren, args: [NbOptionComponent, { descendants: true },] }],
|
21554 | portal: [{ type: i0.ViewChild, args: [NbPortalDirective,] }],
|
21555 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
21556 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
21557 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
21558 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
21559 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }]
|
21560 | };
|
21561 | return NbAutocompleteComponent;
|
21562 | }());
|
21563 |
|
21564 |
|
21565 |
|
21566 |
|
21567 |
|
21568 |
|
21569 |
|
21570 |
|
21571 |
|
21572 |
|
21573 |
|
21574 |
|
21575 |
|
21576 |
|
21577 |
|
21578 |
|
21579 |
|
21580 |
|
21581 |
|
21582 |
|
21583 |
|
21584 |
|
21585 |
|
21586 |
|
21587 |
|
21588 |
|
21589 |
|
21590 |
|
21591 |
|
21592 |
|
21593 |
|
21594 |
|
21595 |
|
21596 |
|
21597 |
|
21598 |
|
21599 |
|
21600 |
|
21601 |
|
21602 |
|
21603 |
|
21604 |
|
21605 |
|
21606 | var NbAutocompleteDirective = (function () {
|
21607 | function NbAutocompleteDirective(hostRef, overlay, cd, triggerStrategyBuilder, positionBuilder, activeDescendantKeyManagerFactory, renderer) {
|
21608 | this.hostRef = hostRef;
|
21609 | this.overlay = overlay;
|
21610 | this.cd = cd;
|
21611 | this.triggerStrategyBuilder = triggerStrategyBuilder;
|
21612 | this.positionBuilder = positionBuilder;
|
21613 | this.activeDescendantKeyManagerFactory = activeDescendantKeyManagerFactory;
|
21614 | this.renderer = renderer;
|
21615 | this.destroy$ = new rxjs.Subject();
|
21616 | this._onChange = function () { };
|
21617 | this._onTouched = function () { };
|
21618 | |
21619 |
|
21620 |
|
21621 | this.overlayOffset = 8;
|
21622 | this._focusInputOnValueChange = true;
|
21623 | |
21624 |
|
21625 |
|
21626 | this.scrollStrategy = 'block';
|
21627 | this.role = 'combobox';
|
21628 | this.ariaAutocomplete = 'list';
|
21629 | this.hasPopup = 'true';
|
21630 | }
|
21631 | Object.defineProperty(NbAutocompleteDirective.prototype, "isOpen", {
|
21632 | |
21633 |
|
21634 |
|
21635 | get: function () {
|
21636 | return this.overlayRef && this.overlayRef.hasAttached();
|
21637 | },
|
21638 | enumerable: false,
|
21639 | configurable: true
|
21640 | });
|
21641 | Object.defineProperty(NbAutocompleteDirective.prototype, "isClosed", {
|
21642 | |
21643 |
|
21644 |
|
21645 | get: function () {
|
21646 | return !this.isOpen;
|
21647 | },
|
21648 | enumerable: false,
|
21649 | configurable: true
|
21650 | });
|
21651 | Object.defineProperty(NbAutocompleteDirective.prototype, "autocomplete", {
|
21652 | |
21653 |
|
21654 |
|
21655 | get: function () {
|
21656 | return this._autocomplete;
|
21657 | },
|
21658 | set: function (autocomplete) {
|
21659 | this._autocomplete = autocomplete;
|
21660 | },
|
21661 | enumerable: false,
|
21662 | configurable: true
|
21663 | });
|
21664 | Object.defineProperty(NbAutocompleteDirective.prototype, "focusInputOnValueChange", {
|
21665 | |
21666 |
|
21667 |
|
21668 | get: function () {
|
21669 | return this._focusInputOnValueChange;
|
21670 | },
|
21671 | set: function (value) {
|
21672 | this._focusInputOnValueChange = convertToBoolProperty(value);
|
21673 | },
|
21674 | enumerable: false,
|
21675 | configurable: true
|
21676 | });
|
21677 | Object.defineProperty(NbAutocompleteDirective.prototype, "top", {
|
21678 | get: function () {
|
21679 | return this.isOpen && this.autocomplete.options.length && this.autocomplete.overlayPosition === exports.NbPosition.TOP;
|
21680 | },
|
21681 | enumerable: false,
|
21682 | configurable: true
|
21683 | });
|
21684 | Object.defineProperty(NbAutocompleteDirective.prototype, "bottom", {
|
21685 | get: function () {
|
21686 | return this.isOpen && this.autocomplete.options.length && this.autocomplete.overlayPosition === exports.NbPosition.BOTTOM;
|
21687 | },
|
21688 | enumerable: false,
|
21689 | configurable: true
|
21690 | });
|
21691 | Object.defineProperty(NbAutocompleteDirective.prototype, "ariaExpanded", {
|
21692 | get: function () {
|
21693 | return this.isOpen && this.isOpen.toString();
|
21694 | },
|
21695 | enumerable: false,
|
21696 | configurable: true
|
21697 | });
|
21698 | Object.defineProperty(NbAutocompleteDirective.prototype, "ariaOwns", {
|
21699 | get: function () {
|
21700 | return this.isOpen ? this.autocomplete.id : null;
|
21701 | },
|
21702 | enumerable: false,
|
21703 | configurable: true
|
21704 | });
|
21705 | Object.defineProperty(NbAutocompleteDirective.prototype, "ariaActiveDescendant", {
|
21706 | get: function () {
|
21707 | return (this.isOpen && this.keyManager.activeItem) ? this.keyManager.activeItem.id : null;
|
21708 | },
|
21709 | enumerable: false,
|
21710 | configurable: true
|
21711 | });
|
21712 | NbAutocompleteDirective.prototype.ngAfterViewInit = function () {
|
21713 | this.triggerStrategy = this.createTriggerStrategy();
|
21714 | this.subscribeOnTriggers();
|
21715 | };
|
21716 | NbAutocompleteDirective.prototype.ngOnDestroy = function () {
|
21717 | if (this.triggerStrategy) {
|
21718 | this.triggerStrategy.destroy();
|
21719 | }
|
21720 | if (this.positionStrategy) {
|
21721 | this.positionStrategy.dispose();
|
21722 | }
|
21723 | if (this.overlayRef) {
|
21724 | this.overlayRef.dispose();
|
21725 | }
|
21726 | this.destroy$.next();
|
21727 | this.destroy$.complete();
|
21728 | };
|
21729 | NbAutocompleteDirective.prototype.handleInput = function () {
|
21730 | var currentValue = this.hostRef.nativeElement.value;
|
21731 | this._onChange(currentValue);
|
21732 | this.setHostInputValue(this.getDisplayValue(currentValue));
|
21733 | this.show();
|
21734 | };
|
21735 | NbAutocompleteDirective.prototype.handleKeydown = function () {
|
21736 | this.show();
|
21737 | };
|
21738 | NbAutocompleteDirective.prototype.handleBlur = function () {
|
21739 | this._onTouched();
|
21740 | };
|
21741 | NbAutocompleteDirective.prototype.show = function () {
|
21742 | if (this.isClosed) {
|
21743 | this.attachToOverlay();
|
21744 | this.setActiveItem();
|
21745 | }
|
21746 | };
|
21747 | NbAutocompleteDirective.prototype.hide = function () {
|
21748 | if (this.isOpen) {
|
21749 | this.overlayRef.detach();
|
21750 |
|
21751 | this.cd.markForCheck();
|
21752 | }
|
21753 | };
|
21754 | NbAutocompleteDirective.prototype.writeValue = function (value) {
|
21755 | this.handleInputValueUpdate(value);
|
21756 | };
|
21757 | NbAutocompleteDirective.prototype.registerOnChange = function (fn) {
|
21758 | this._onChange = fn;
|
21759 | };
|
21760 | NbAutocompleteDirective.prototype.registerOnTouched = function (fn) {
|
21761 | this._onTouched = fn;
|
21762 | };
|
21763 | NbAutocompleteDirective.prototype.setDisabledState = function (disabled) {
|
21764 | this.renderer.setProperty(this.hostRef.nativeElement, 'disabled', disabled);
|
21765 | };
|
21766 | NbAutocompleteDirective.prototype.subscribeOnOptionClick = function () {
|
21767 | var _this = this;
|
21768 | |
21769 |
|
21770 |
|
21771 |
|
21772 |
|
21773 | this.autocomplete.options.changes
|
21774 | .pipe(rxjs_operators.tap(function () { return _this.setActiveItem(); }), rxjs_operators.startWith(this.autocomplete.options), rxjs_operators.switchMap(function (options) {
|
21775 | return rxjs.merge.apply(void 0, options.map(function (option) { return option.click; }));
|
21776 | }), rxjs_operators.takeUntil(this.destroy$))
|
21777 | .subscribe(function (clickedOption) { return _this.handleInputValueUpdate(clickedOption.value); });
|
21778 | };
|
21779 | NbAutocompleteDirective.prototype.subscribeOnPositionChange = function () {
|
21780 | var _this = this;
|
21781 | this.positionStrategy.positionChange
|
21782 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
21783 | .subscribe(function (position) {
|
21784 | _this.autocomplete.overlayPosition = position;
|
21785 | _this.cd.detectChanges();
|
21786 | });
|
21787 | };
|
21788 | NbAutocompleteDirective.prototype.getActiveItem = function () {
|
21789 | return this.keyManager.activeItem;
|
21790 | };
|
21791 | NbAutocompleteDirective.prototype.setupAutocomplete = function () {
|
21792 | this.autocomplete.setHost(this.customOverlayHost || this.hostRef);
|
21793 | };
|
21794 | NbAutocompleteDirective.prototype.getDisplayValue = function (value) {
|
21795 | var displayFn = this.autocomplete.handleDisplayFn;
|
21796 | return displayFn ? displayFn(value) : value;
|
21797 | };
|
21798 | NbAutocompleteDirective.prototype.getContainer = function () {
|
21799 | return this.overlayRef && this.isOpen && {
|
21800 | location: {
|
21801 | nativeElement: this.overlayRef.overlayElement,
|
21802 | },
|
21803 | };
|
21804 | };
|
21805 | NbAutocompleteDirective.prototype.handleInputValueUpdate = function (value) {
|
21806 | if (value === undefined || value === null) {
|
21807 | return;
|
21808 | }
|
21809 | this.setHostInputValue(value);
|
21810 | this._onChange(value);
|
21811 | if (this.focusInputOnValueChange) {
|
21812 | this.hostRef.nativeElement.focus();
|
21813 | }
|
21814 | this.autocomplete.emitSelected(value);
|
21815 | this.hide();
|
21816 | };
|
21817 | NbAutocompleteDirective.prototype.subscribeOnTriggers = function () {
|
21818 | var _this = this;
|
21819 | this.triggerStrategy.show$
|
21820 | .pipe(rxjs_operators.filter(function () { return _this.isClosed; }))
|
21821 | .subscribe(function () { return _this.show(); });
|
21822 | this.triggerStrategy.hide$
|
21823 | .pipe(rxjs_operators.filter(function () { return _this.isOpen; }))
|
21824 | .subscribe(function () { return _this.hide(); });
|
21825 | };
|
21826 | NbAutocompleteDirective.prototype.createTriggerStrategy = function () {
|
21827 | var _this = this;
|
21828 | return this.triggerStrategyBuilder
|
21829 | .trigger(exports.NbTrigger.FOCUS)
|
21830 | .host(this.hostRef.nativeElement)
|
21831 | .container(function () { return _this.getContainer(); })
|
21832 | .build();
|
21833 | };
|
21834 | NbAutocompleteDirective.prototype.createKeyManager = function () {
|
21835 | this.keyManager = this.activeDescendantKeyManagerFactory
|
21836 | .create(this.autocomplete.options);
|
21837 | };
|
21838 | NbAutocompleteDirective.prototype.setHostInputValue = function (value) {
|
21839 | this.hostRef.nativeElement.value = this.getDisplayValue(value);
|
21840 | };
|
21841 | NbAutocompleteDirective.prototype.createPositionStrategy = function () {
|
21842 | return this.positionBuilder
|
21843 | .connectedTo(this.customOverlayHost || this.hostRef)
|
21844 | .position(exports.NbPosition.BOTTOM)
|
21845 | .offset(this.overlayOffset)
|
21846 | .adjustment(exports.NbAdjustment.VERTICAL);
|
21847 | };
|
21848 | NbAutocompleteDirective.prototype.subscribeOnOverlayKeys = function () {
|
21849 | var _this = this;
|
21850 | this.overlayRef.keydownEvents()
|
21851 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
21852 | .subscribe(function (event) {
|
21853 | if (event.keyCode === _angular_cdk_keycodes.ESCAPE && _this.isOpen) {
|
21854 | event.preventDefault();
|
21855 | _this.hostRef.nativeElement.focus();
|
21856 | _this.hide();
|
21857 | }
|
21858 | else if (event.keyCode === _angular_cdk_keycodes.ENTER) {
|
21859 | event.preventDefault();
|
21860 | var activeItem = _this.getActiveItem();
|
21861 | if (!activeItem) {
|
21862 | return;
|
21863 | }
|
21864 | _this.handleInputValueUpdate(activeItem.value);
|
21865 | }
|
21866 | else {
|
21867 | _this.keyManager.onKeydown(event);
|
21868 | }
|
21869 | });
|
21870 | };
|
21871 | NbAutocompleteDirective.prototype.setActiveItem = function () {
|
21872 |
|
21873 |
|
21874 | var mode = this.autocomplete.activeFirst
|
21875 | ? NbKeyManagerActiveItemMode.FIRST_ACTIVE
|
21876 | : NbKeyManagerActiveItemMode.RESET_ACTIVE;
|
21877 | this.keyManager.setActiveItem(mode);
|
21878 | this.cd.detectChanges();
|
21879 | };
|
21880 | NbAutocompleteDirective.prototype.attachToOverlay = function () {
|
21881 | if (!this.overlayRef) {
|
21882 | this.setupAutocomplete();
|
21883 | this.initOverlay();
|
21884 | }
|
21885 | this.overlayRef.attach(this.autocomplete.portal);
|
21886 | };
|
21887 | NbAutocompleteDirective.prototype.createOverlay = function () {
|
21888 | var scrollStrategy = this.createScrollStrategy();
|
21889 | this.overlayRef = this.overlay.create({ positionStrategy: this.positionStrategy, scrollStrategy: scrollStrategy, panelClass: this.autocomplete.optionsPanelClass });
|
21890 | };
|
21891 | NbAutocompleteDirective.prototype.initOverlay = function () {
|
21892 | this.positionStrategy = this.createPositionStrategy();
|
21893 | this.createKeyManager();
|
21894 | this.subscribeOnPositionChange();
|
21895 | this.subscribeOnOptionClick();
|
21896 | this.checkOverlayVisibility();
|
21897 | this.createOverlay();
|
21898 | this.subscribeOnOverlayKeys();
|
21899 | };
|
21900 | NbAutocompleteDirective.prototype.checkOverlayVisibility = function () {
|
21901 | var _this = this;
|
21902 | this.autocomplete.options.changes
|
21903 | .pipe(rxjs_operators.takeUntil(this.destroy$)).subscribe(function () {
|
21904 | if (!_this.autocomplete.options.length) {
|
21905 | _this.hide();
|
21906 | }
|
21907 | });
|
21908 | };
|
21909 | NbAutocompleteDirective.prototype.createScrollStrategy = function () {
|
21910 | return this.overlay.scrollStrategies[this.scrollStrategy]();
|
21911 | };
|
21912 | NbAutocompleteDirective.decorators = [
|
21913 | { type: i0.Directive, args: [{
|
21914 | selector: 'input[nbAutocomplete]',
|
21915 | providers: [{
|
21916 | provide: _angular_forms.NG_VALUE_ACCESSOR,
|
21917 | useExisting: i0.forwardRef(function () { return NbAutocompleteDirective; }),
|
21918 | multi: true,
|
21919 | }],
|
21920 | },] }
|
21921 | ];
|
21922 | NbAutocompleteDirective.ctorParameters = function () { return [
|
21923 | { type: i0.ElementRef },
|
21924 | { type: NbOverlayService },
|
21925 | { type: i0.ChangeDetectorRef },
|
21926 | { type: NbTriggerStrategyBuilderService },
|
21927 | { type: NbPositionBuilderService },
|
21928 | { type: NbActiveDescendantKeyManagerFactoryService },
|
21929 | { type: i0.Renderer2 }
|
21930 | ]; };
|
21931 | NbAutocompleteDirective.propDecorators = {
|
21932 | autocomplete: [{ type: i0.Input, args: ['nbAutocomplete',] }],
|
21933 | overlayOffset: [{ type: i0.Input }],
|
21934 | focusInputOnValueChange: [{ type: i0.Input }],
|
21935 | scrollStrategy: [{ type: i0.Input }],
|
21936 | customOverlayHost: [{ type: i0.Input }],
|
21937 | top: [{ type: i0.HostBinding, args: ['class.nb-autocomplete-position-top',] }],
|
21938 | bottom: [{ type: i0.HostBinding, args: ['class.nb-autocomplete-position-bottom',] }],
|
21939 | role: [{ type: i0.HostBinding, args: ['attr.role',] }],
|
21940 | ariaAutocomplete: [{ type: i0.HostBinding, args: ['attr.aria-autocomplete',] }],
|
21941 | hasPopup: [{ type: i0.HostBinding, args: ['attr.haspopup',] }],
|
21942 | ariaExpanded: [{ type: i0.HostBinding, args: ['attr.aria-expanded',] }],
|
21943 | ariaOwns: [{ type: i0.HostBinding, args: ['attr.aria-owns',] }],
|
21944 | ariaActiveDescendant: [{ type: i0.HostBinding, args: ['attr.aria-activedescendant',] }],
|
21945 | handleInput: [{ type: i0.HostListener, args: ['input',] }],
|
21946 | handleKeydown: [{ type: i0.HostListener, args: ['keydown.arrowDown',] }, { type: i0.HostListener, args: ['keydown.arrowUp',] }],
|
21947 | handleBlur: [{ type: i0.HostListener, args: ['blur',] }]
|
21948 | };
|
21949 | return NbAutocompleteDirective;
|
21950 | }());
|
21951 |
|
21952 |
|
21953 |
|
21954 |
|
21955 |
|
21956 |
|
21957 | var NB_AUTOCOMPLETE_COMPONENTS = [
|
21958 | NbAutocompleteComponent,
|
21959 | NbAutocompleteDirective,
|
21960 | ];
|
21961 | var NbAutocompleteModule = (function () {
|
21962 | function NbAutocompleteModule() {
|
21963 | }
|
21964 | NbAutocompleteModule.decorators = [
|
21965 | { type: i0.NgModule, args: [{
|
21966 | imports: [
|
21967 | _angular_common.CommonModule,
|
21968 | _angular_forms.FormsModule,
|
21969 | NbOverlayModule,
|
21970 | NbCardModule,
|
21971 | NbOptionModule,
|
21972 | ],
|
21973 | exports: tslib.__spreadArray(tslib.__spreadArray([], NB_AUTOCOMPLETE_COMPONENTS), [
|
21974 | NbOptionModule,
|
21975 | ]),
|
21976 | declarations: tslib.__spreadArray([], NB_AUTOCOMPLETE_COMPONENTS),
|
21977 | },] }
|
21978 | ];
|
21979 | return NbAutocompleteModule;
|
21980 | }());
|
21981 |
|
21982 | (function (NbWindowState) {
|
21983 | NbWindowState["MINIMIZED"] = "minimized";
|
21984 | NbWindowState["MAXIMIZED"] = "maximized";
|
21985 | NbWindowState["FULL_SCREEN"] = "full-screen";
|
21986 | })(exports.NbWindowState || (exports.NbWindowState = {}));
|
21987 | var NB_WINDOW_DEFAULT_BUTTONS_CONFIG = {
|
21988 | minimize: true,
|
21989 | maximize: true,
|
21990 | fullScreen: true,
|
21991 | };
|
21992 |
|
21993 |
|
21994 |
|
21995 | var NbWindowConfig = (function () {
|
21996 | function NbWindowConfig() {
|
21997 | var configs = [];
|
21998 | for (var _i = 0; _i < arguments.length; _i++) {
|
21999 | configs[_i] = arguments[_i];
|
22000 | }
|
22001 | |
22002 |
|
22003 |
|
22004 | this.title = '';
|
22005 | |
22006 |
|
22007 |
|
22008 | this.initialState = exports.NbWindowState.FULL_SCREEN;
|
22009 | |
22010 |
|
22011 |
|
22012 |
|
22013 | this.hasBackdrop = true;
|
22014 | |
22015 |
|
22016 |
|
22017 |
|
22018 | this.closeOnBackdropClick = true;
|
22019 | |
22020 |
|
22021 |
|
22022 |
|
22023 | this.closeOnEsc = true;
|
22024 | |
22025 |
|
22026 |
|
22027 | this.windowClass = '';
|
22028 | |
22029 |
|
22030 |
|
22031 |
|
22032 |
|
22033 | this.context = {};
|
22034 | |
22035 |
|
22036 |
|
22037 |
|
22038 |
|
22039 |
|
22040 | this.viewContainerRef = null;
|
22041 | |
22042 |
|
22043 |
|
22044 | this.buttons = {};
|
22045 | Object.assign.apply(Object, tslib.__spreadArray([this], configs));
|
22046 | this.applyDefaultButtonConfig();
|
22047 | }
|
22048 | NbWindowConfig.prototype.applyDefaultButtonConfig = function () {
|
22049 | Object.assign(this, { buttons: tslib.__assign(tslib.__assign({}, NB_WINDOW_DEFAULT_BUTTONS_CONFIG), this.buttons) });
|
22050 | };
|
22051 | return NbWindowConfig;
|
22052 | }());
|
22053 | var NB_WINDOW_CONTENT = new i0.InjectionToken('Nebular Window Content');
|
22054 | var NB_WINDOW_CONFIG = new i0.InjectionToken('Nebular Window Config');
|
22055 | var NB_WINDOW_CONTEXT = new i0.InjectionToken('Nebular Window Context');
|
22056 |
|
22057 |
|
22058 |
|
22059 |
|
22060 |
|
22061 |
|
22062 | var NbWindowRef = (function () {
|
22063 | function NbWindowRef(config) {
|
22064 | this.config = config;
|
22065 | this.stateChange$ = new rxjs.ReplaySubject(1);
|
22066 | this._closed = false;
|
22067 | this.closed$ = new rxjs.Subject();
|
22068 | this.state = config.initialState;
|
22069 | }
|
22070 | Object.defineProperty(NbWindowRef.prototype, "state", {
|
22071 | |
22072 |
|
22073 |
|
22074 | get: function () {
|
22075 | return this.stateValue;
|
22076 | },
|
22077 | set: function (newState) {
|
22078 | if (newState && this.stateValue !== newState) {
|
22079 | this.prevStateValue = this.state;
|
22080 | this.stateValue = newState;
|
22081 | this.stateChange$.next({ oldState: this.prevStateValue, newState: newState });
|
22082 | }
|
22083 | },
|
22084 | enumerable: false,
|
22085 | configurable: true
|
22086 | });
|
22087 | Object.defineProperty(NbWindowRef.prototype, "stateChange", {
|
22088 | |
22089 |
|
22090 |
|
22091 | get: function () {
|
22092 | return this.stateChange$.asObservable();
|
22093 | },
|
22094 | enumerable: false,
|
22095 | configurable: true
|
22096 | });
|
22097 | Object.defineProperty(NbWindowRef.prototype, "onClose", {
|
22098 | |
22099 |
|
22100 |
|
22101 | get: function () {
|
22102 | return this.closed$.asObservable();
|
22103 | },
|
22104 | enumerable: false,
|
22105 | configurable: true
|
22106 | });
|
22107 | |
22108 |
|
22109 |
|
22110 | NbWindowRef.prototype.minimize = function () {
|
22111 | this.state = exports.NbWindowState.MINIMIZED;
|
22112 | };
|
22113 | |
22114 |
|
22115 |
|
22116 | NbWindowRef.prototype.maximize = function () {
|
22117 | this.state = exports.NbWindowState.MAXIMIZED;
|
22118 | };
|
22119 | |
22120 |
|
22121 |
|
22122 | NbWindowRef.prototype.fullScreen = function () {
|
22123 | this.state = exports.NbWindowState.FULL_SCREEN;
|
22124 | };
|
22125 | NbWindowRef.prototype.toPreviousState = function () {
|
22126 | this.state = this.prevStateValue;
|
22127 | };
|
22128 | |
22129 |
|
22130 |
|
22131 | NbWindowRef.prototype.close = function () {
|
22132 | if (this._closed) {
|
22133 | return;
|
22134 | }
|
22135 | this._closed = true;
|
22136 | this.componentRef.destroy();
|
22137 | this.stateChange$.complete();
|
22138 | this.closed$.next();
|
22139 | this.closed$.complete();
|
22140 | };
|
22141 | return NbWindowRef;
|
22142 | }());
|
22143 |
|
22144 | var NbWindowsContainerComponent = (function () {
|
22145 | function NbWindowsContainerComponent() {
|
22146 | }
|
22147 | NbWindowsContainerComponent.decorators = [
|
22148 | { type: i0.Component, args: [{
|
22149 | selector: 'nb-windows-container',
|
22150 | template: "<ng-container #viewContainerRef></ng-container>",
|
22151 | styles: [":host{display:flex;align-items:flex-end;overflow-x:auto}:host ::ng-deep nb-window:not(.full-screen){margin:0 2rem}\n"]
|
22152 | },] }
|
22153 | ];
|
22154 | NbWindowsContainerComponent.propDecorators = {
|
22155 | viewContainerRef: [{ type: i0.ViewChild, args: ['viewContainerRef', { read: i0.ViewContainerRef, static: true },] }]
|
22156 | };
|
22157 | return NbWindowsContainerComponent;
|
22158 | }());
|
22159 |
|
22160 | var NbWindowComponent = (function () {
|
22161 | function NbWindowComponent(content, context, windowRef, config, focusTrapFactory, elementRef, renderer) {
|
22162 | this.content = content;
|
22163 | this.context = context;
|
22164 | this.windowRef = windowRef;
|
22165 | this.config = config;
|
22166 | this.focusTrapFactory = focusTrapFactory;
|
22167 | this.elementRef = elementRef;
|
22168 | this.renderer = renderer;
|
22169 | }
|
22170 | Object.defineProperty(NbWindowComponent.prototype, "isFullScreen", {
|
22171 | get: function () {
|
22172 | return this.windowRef.state === exports.NbWindowState.FULL_SCREEN;
|
22173 | },
|
22174 | enumerable: false,
|
22175 | configurable: true
|
22176 | });
|
22177 | Object.defineProperty(NbWindowComponent.prototype, "maximized", {
|
22178 | get: function () {
|
22179 | return this.windowRef.state === exports.NbWindowState.MAXIMIZED;
|
22180 | },
|
22181 | enumerable: false,
|
22182 | configurable: true
|
22183 | });
|
22184 | Object.defineProperty(NbWindowComponent.prototype, "minimized", {
|
22185 | get: function () {
|
22186 | return this.windowRef.state === exports.NbWindowState.MINIMIZED;
|
22187 | },
|
22188 | enumerable: false,
|
22189 | configurable: true
|
22190 | });
|
22191 | Object.defineProperty(NbWindowComponent.prototype, "showMinimize", {
|
22192 | get: function () {
|
22193 | return this.config.buttons.minimize;
|
22194 | },
|
22195 | enumerable: false,
|
22196 | configurable: true
|
22197 | });
|
22198 | Object.defineProperty(NbWindowComponent.prototype, "showMaximize", {
|
22199 | get: function () {
|
22200 | return this.config.buttons.maximize;
|
22201 | },
|
22202 | enumerable: false,
|
22203 | configurable: true
|
22204 | });
|
22205 | Object.defineProperty(NbWindowComponent.prototype, "showFullScreen", {
|
22206 | get: function () {
|
22207 | return this.config.buttons.fullScreen;
|
22208 | },
|
22209 | enumerable: false,
|
22210 | configurable: true
|
22211 | });
|
22212 | NbWindowComponent.prototype.ngOnInit = function () {
|
22213 | this.focusTrap = this.focusTrapFactory.create(this.elementRef.nativeElement);
|
22214 | this.focusTrap.blurPreviouslyFocusedElement();
|
22215 | this.focusTrap.focusInitialElement();
|
22216 | if (this.config.windowClass) {
|
22217 | this.renderer.addClass(this.elementRef.nativeElement, this.config.windowClass);
|
22218 | }
|
22219 | };
|
22220 | NbWindowComponent.prototype.ngAfterViewChecked = function () {
|
22221 | if (!this.overlayContainer || this.overlayContainer.isAttached) {
|
22222 | return;
|
22223 | }
|
22224 | if (this.content instanceof i0.TemplateRef) {
|
22225 | this.attachTemplate();
|
22226 | }
|
22227 | else {
|
22228 | this.attachComponent();
|
22229 | }
|
22230 | };
|
22231 | NbWindowComponent.prototype.ngOnDestroy = function () {
|
22232 | if (this.focusTrap) {
|
22233 | this.focusTrap.restoreFocus();
|
22234 | }
|
22235 | this.close();
|
22236 | };
|
22237 | NbWindowComponent.prototype.minimize = function () {
|
22238 | if (this.windowRef.state === exports.NbWindowState.MINIMIZED) {
|
22239 | this.windowRef.toPreviousState();
|
22240 | }
|
22241 | else {
|
22242 | this.windowRef.minimize();
|
22243 | }
|
22244 | };
|
22245 | NbWindowComponent.prototype.maximize = function () {
|
22246 | this.windowRef.maximize();
|
22247 | };
|
22248 | NbWindowComponent.prototype.fullScreen = function () {
|
22249 | this.windowRef.fullScreen();
|
22250 | };
|
22251 | NbWindowComponent.prototype.maximizeOrFullScreen = function () {
|
22252 | if (this.windowRef.state === exports.NbWindowState.MINIMIZED && this.showMaximize) {
|
22253 | this.maximize();
|
22254 | }
|
22255 | else {
|
22256 | this.fullScreen();
|
22257 | }
|
22258 | };
|
22259 | NbWindowComponent.prototype.close = function () {
|
22260 | this.windowRef.close();
|
22261 | };
|
22262 | NbWindowComponent.prototype.attachTemplate = function () {
|
22263 | this.overlayContainer
|
22264 | .attachTemplatePortal(new NbTemplatePortal(this.content, null, this.context));
|
22265 | };
|
22266 | NbWindowComponent.prototype.attachComponent = function () {
|
22267 | var portal = new NbComponentPortal(this.content, null, null, this.cfr);
|
22268 | var ref = this.overlayContainer.attachComponentPortal(portal, this.context);
|
22269 | ref.changeDetectorRef.detectChanges();
|
22270 | };
|
22271 | NbWindowComponent.decorators = [
|
22272 | { type: i0.Component, args: [{
|
22273 | selector: 'nb-window',
|
22274 | template: "\n <nb-card>\n <nb-card-header>\n <div cdkFocusInitial class=\"title\" tabindex=\"-1\">{{ config.title }}</div>\n\n <div class=\"buttons\">\n <ng-container *ngIf=\"showMinimize\">\n <button nbButton ghost (click)=\"minimize()\">\n <nb-icon icon=\"minus-outline\" pack=\"nebular-essentials\"></nb-icon>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"showMaximize\">\n <button nbButton ghost *ngIf=\"isFullScreen\" (click)=\"maximize()\">\n <nb-icon icon=\"collapse-outline\" pack=\"nebular-essentials\"></nb-icon>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"showFullScreen\">\n <button nbButton ghost *ngIf=\"minimized || maximized\" (click)=\"maximizeOrFullScreen()\">\n <nb-icon icon=\"expand-outline\" pack=\"nebular-essentials\"></nb-icon>\n </button>\n </ng-container>\n\n <button nbButton ghost (click)=\"close()\">\n <nb-icon icon=\"close-outline\" pack=\"nebular-essentials\"></nb-icon>\n </button>\n </div>\n </nb-card-header>\n <nb-card-body *ngIf=\"maximized || isFullScreen\">\n <nb-overlay-container></nb-overlay-container>\n </nb-card-body>\n </nb-card>\n ",
|
22275 | styles: [":host{flex:1 0 auto;min-width:20rem}:host nb-card{margin:0}:host nb-card-header{display:flex;justify-content:space-between;align-items:center;overflow:hidden}:host .title{flex:1 0 auto;margin-right:3rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host .buttons{width:9.5rem;display:flex;justify-content:flex-end}:host .buttons [nbButton]{flex:0 0 3rem}:host(.full-screen){position:fixed;top:50%;left:50%;transform:translate(-50%, -50%)}:host(.maximized) nb-card{border-bottom-left-radius:0;border-bottom-right-radius:0}:host(.minimized) nb-card{border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto}:host(.minimized) nb-card nb-card-header{border-bottom:none}\n"]
|
22276 | },] }
|
22277 | ];
|
22278 | NbWindowComponent.ctorParameters = function () { return [
|
22279 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_WINDOW_CONTENT,] }] },
|
22280 | { type: Object, decorators: [{ type: i0.Inject, args: [NB_WINDOW_CONTEXT,] }] },
|
22281 | { type: NbWindowRef },
|
22282 | { type: NbWindowConfig },
|
22283 | { type: NbFocusTrapFactoryService },
|
22284 | { type: i0.ElementRef },
|
22285 | { type: i0.Renderer2 }
|
22286 | ]; };
|
22287 | NbWindowComponent.propDecorators = {
|
22288 | cfr: [{ type: i0.Input }],
|
22289 | isFullScreen: [{ type: i0.HostBinding, args: ['class.full-screen',] }],
|
22290 | maximized: [{ type: i0.HostBinding, args: ['class.maximized',] }],
|
22291 | minimized: [{ type: i0.HostBinding, args: ['class.minimized',] }],
|
22292 | overlayContainer: [{ type: i0.ViewChild, args: [NbOverlayContainerComponent,] }]
|
22293 | };
|
22294 | return NbWindowComponent;
|
22295 | }());
|
22296 |
|
22297 |
|
22298 |
|
22299 |
|
22300 |
|
22301 |
|
22302 |
|
22303 |
|
22304 |
|
22305 |
|
22306 |
|
22307 |
|
22308 |
|
22309 |
|
22310 |
|
22311 |
|
22312 |
|
22313 |
|
22314 |
|
22315 |
|
22316 |
|
22317 |
|
22318 |
|
22319 |
|
22320 |
|
22321 |
|
22322 |
|
22323 |
|
22324 |
|
22325 |
|
22326 |
|
22327 |
|
22328 |
|
22329 |
|
22330 |
|
22331 |
|
22332 |
|
22333 |
|
22334 |
|
22335 |
|
22336 |
|
22337 |
|
22338 |
|
22339 |
|
22340 |
|
22341 |
|
22342 |
|
22343 |
|
22344 |
|
22345 |
|
22346 |
|
22347 |
|
22348 |
|
22349 |
|
22350 |
|
22351 |
|
22352 |
|
22353 |
|
22354 |
|
22355 |
|
22356 |
|
22357 |
|
22358 |
|
22359 |
|
22360 |
|
22361 |
|
22362 |
|
22363 |
|
22364 |
|
22365 |
|
22366 |
|
22367 |
|
22368 |
|
22369 |
|
22370 |
|
22371 |
|
22372 | var NbWindowService = (function () {
|
22373 | function NbWindowService(componentFactoryResolver, overlayService, overlayPositionBuilder, blockScrollStrategy, defaultWindowsConfig, cfr, document) {
|
22374 | this.componentFactoryResolver = componentFactoryResolver;
|
22375 | this.overlayService = overlayService;
|
22376 | this.overlayPositionBuilder = overlayPositionBuilder;
|
22377 | this.blockScrollStrategy = blockScrollStrategy;
|
22378 | this.defaultWindowsConfig = defaultWindowsConfig;
|
22379 | this.cfr = cfr;
|
22380 | this.openWindows = [];
|
22381 | this.document = document;
|
22382 | }
|
22383 | |
22384 |
|
22385 |
|
22386 |
|
22387 |
|
22388 | NbWindowService.prototype.open = function (windowContent, windowConfig) {
|
22389 | if (windowConfig === void 0) { windowConfig = {}; }
|
22390 | if (this.shouldCreateWindowsContainer()) {
|
22391 | this.createWindowsContainer();
|
22392 | }
|
22393 | var config = new NbWindowConfig(this.defaultWindowsConfig, windowConfig);
|
22394 | var windowRef = new NbWindowRef(config);
|
22395 | windowRef.componentRef = this.appendWindow(windowContent, config, windowRef);
|
22396 | this.openWindows.push(windowRef);
|
22397 | this.subscribeToEvents(windowRef);
|
22398 | return windowRef;
|
22399 | };
|
22400 | NbWindowService.prototype.shouldCreateWindowsContainer = function () {
|
22401 | if (this.windowsContainerViewRef) {
|
22402 | var containerEl = this.windowsContainerViewRef.element.nativeElement;
|
22403 | return !this.document.body.contains(containerEl);
|
22404 | }
|
22405 | return true;
|
22406 | };
|
22407 | NbWindowService.prototype.createWindowsContainer = function () {
|
22408 | if (this.overlayRef) {
|
22409 | this.overlayRef.dispose();
|
22410 | }
|
22411 | this.overlayRef = this.overlayService.create({
|
22412 | scrollStrategy: this.overlayService.scrollStrategies.noop(),
|
22413 | positionStrategy: this.overlayPositionBuilder.global().bottom().right(),
|
22414 | hasBackdrop: true,
|
22415 | });
|
22416 | var windowsContainerPortal = new NbComponentPortal(NbWindowsContainerComponent, null, null, this.cfr);
|
22417 | var overlayRef = this.overlayRef.attach(windowsContainerPortal);
|
22418 | this.windowsContainerViewRef = overlayRef.instance.viewContainerRef;
|
22419 | };
|
22420 | NbWindowService.prototype.appendWindow = function (content, config, windowRef) {
|
22421 | var context = content instanceof i0.TemplateRef
|
22422 | ? { $implicit: config.context, windowRef: windowRef }
|
22423 | : config.context;
|
22424 | var providers = [
|
22425 | { provide: NB_WINDOW_CONTENT, useValue: content },
|
22426 | { provide: NB_WINDOW_CONTEXT, useValue: context },
|
22427 | { provide: NbWindowConfig, useValue: config },
|
22428 | { provide: NbWindowRef, useValue: windowRef },
|
22429 | ];
|
22430 | var parentInjector = config.viewContainerRef
|
22431 | ? config.viewContainerRef.injector
|
22432 | : this.windowsContainerViewRef.injector;
|
22433 | var injector = i0.Injector.create({ parent: parentInjector, providers: providers });
|
22434 | var windowFactory = this.componentFactoryResolver.resolveComponentFactory(NbWindowComponent);
|
22435 | var ref = this.windowsContainerViewRef.createComponent(windowFactory, null, injector);
|
22436 | ref.instance.cfr = this.cfr;
|
22437 | ref.changeDetectorRef.detectChanges();
|
22438 | return ref;
|
22439 | };
|
22440 | NbWindowService.prototype.subscribeToEvents = function (windowRef) {
|
22441 | var _this = this;
|
22442 | if (windowRef.config.closeOnBackdropClick) {
|
22443 | this.overlayRef.backdropClick().subscribe(function () { return windowRef.close(); });
|
22444 | }
|
22445 | if (windowRef.config.closeOnEsc) {
|
22446 | this.overlayRef.keydownEvents()
|
22447 | .pipe(rxjs_operators.filter(function (event) { return event.keyCode === 27; }))
|
22448 | .subscribe(function () { return windowRef.close(); });
|
22449 | }
|
22450 | windowRef.stateChange.subscribe(function () { return _this.checkAndUpdateOverlay(); });
|
22451 | windowRef.onClose.subscribe(function () {
|
22452 | _this.openWindows.splice(_this.openWindows.indexOf(windowRef), 1);
|
22453 | _this.checkAndUpdateOverlay();
|
22454 | });
|
22455 | };
|
22456 | NbWindowService.prototype.checkAndUpdateOverlay = function () {
|
22457 | var fullScreenWindows = this.openWindows.filter(function (w) { return w.state === exports.NbWindowState.FULL_SCREEN; });
|
22458 | if (fullScreenWindows.length > 0) {
|
22459 | this.blockScrollStrategy.enable();
|
22460 | }
|
22461 | else {
|
22462 | this.blockScrollStrategy.disable();
|
22463 | }
|
22464 | if (fullScreenWindows.some(function (w) { return w.config.hasBackdrop; })) {
|
22465 | this.overlayRef.backdropElement.removeAttribute('hidden');
|
22466 | }
|
22467 | else {
|
22468 | this.overlayRef.backdropElement.setAttribute('hidden', '');
|
22469 | }
|
22470 | };
|
22471 | NbWindowService.decorators = [
|
22472 | { type: i0.Injectable }
|
22473 | ];
|
22474 | NbWindowService.ctorParameters = function () { return [
|
22475 | { type: i0.ComponentFactoryResolver },
|
22476 | { type: NbOverlayService },
|
22477 | { type: NbOverlayPositionBuilder },
|
22478 | { type: NbBlockScrollStrategyAdapter },
|
22479 | { type: NbWindowConfig, decorators: [{ type: i0.Inject, args: [NB_WINDOW_CONFIG,] }] },
|
22480 | { type: i0.ComponentFactoryResolver },
|
22481 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] }
|
22482 | ]; };
|
22483 | return NbWindowService;
|
22484 | }());
|
22485 |
|
22486 | var NbWindowModule = (function () {
|
22487 | function NbWindowModule() {
|
22488 | }
|
22489 | NbWindowModule.forRoot = function (defaultConfig) {
|
22490 | return {
|
22491 | ngModule: NbWindowModule,
|
22492 | providers: [
|
22493 | NbWindowService,
|
22494 | { provide: NB_WINDOW_CONFIG, useValue: defaultConfig },
|
22495 | ],
|
22496 | };
|
22497 | };
|
22498 | NbWindowModule.forChild = function (defaultConfig) {
|
22499 | return {
|
22500 | ngModule: NbWindowModule,
|
22501 | providers: [
|
22502 | NbWindowService,
|
22503 | { provide: NB_WINDOW_CONFIG, useValue: defaultConfig },
|
22504 | ],
|
22505 | };
|
22506 | };
|
22507 | NbWindowModule.decorators = [
|
22508 | { type: i0.NgModule, args: [{
|
22509 | imports: [_angular_common.CommonModule, NbOverlayModule, NbCardModule, NbIconModule, NbButtonModule],
|
22510 | declarations: [
|
22511 | NbWindowsContainerComponent,
|
22512 | NbWindowComponent,
|
22513 | ],
|
22514 | entryComponents: [NbWindowsContainerComponent, NbWindowComponent],
|
22515 | },] }
|
22516 | ];
|
22517 | return NbWindowModule;
|
22518 | }());
|
22519 |
|
22520 |
|
22521 |
|
22522 |
|
22523 |
|
22524 |
|
22525 |
|
22526 |
|
22527 |
|
22528 |
|
22529 |
|
22530 |
|
22531 |
|
22532 |
|
22533 |
|
22534 |
|
22535 |
|
22536 |
|
22537 |
|
22538 |
|
22539 |
|
22540 |
|
22541 |
|
22542 |
|
22543 |
|
22544 |
|
22545 |
|
22546 |
|
22547 |
|
22548 |
|
22549 |
|
22550 |
|
22551 |
|
22552 |
|
22553 |
|
22554 |
|
22555 |
|
22556 |
|
22557 |
|
22558 |
|
22559 |
|
22560 |
|
22561 |
|
22562 |
|
22563 |
|
22564 |
|
22565 |
|
22566 |
|
22567 |
|
22568 |
|
22569 |
|
22570 |
|
22571 |
|
22572 |
|
22573 |
|
22574 |
|
22575 |
|
22576 |
|
22577 |
|
22578 |
|
22579 |
|
22580 |
|
22581 |
|
22582 |
|
22583 |
|
22584 |
|
22585 |
|
22586 |
|
22587 |
|
22588 |
|
22589 |
|
22590 |
|
22591 |
|
22592 |
|
22593 |
|
22594 |
|
22595 |
|
22596 |
|
22597 |
|
22598 |
|
22599 |
|
22600 |
|
22601 |
|
22602 |
|
22603 |
|
22604 |
|
22605 |
|
22606 |
|
22607 |
|
22608 |
|
22609 |
|
22610 |
|
22611 |
|
22612 |
|
22613 |
|
22614 |
|
22615 |
|
22616 |
|
22617 |
|
22618 |
|
22619 |
|
22620 |
|
22621 |
|
22622 |
|
22623 |
|
22624 |
|
22625 |
|
22626 |
|
22627 |
|
22628 |
|
22629 |
|
22630 |
|
22631 |
|
22632 |
|
22633 |
|
22634 |
|
22635 |
|
22636 |
|
22637 |
|
22638 |
|
22639 |
|
22640 |
|
22641 |
|
22642 |
|
22643 |
|
22644 |
|
22645 |
|
22646 |
|
22647 |
|
22648 |
|
22649 |
|
22650 |
|
22651 |
|
22652 |
|
22653 |
|
22654 |
|
22655 |
|
22656 |
|
22657 |
|
22658 |
|
22659 | var NbTimePickerDirective = (function () {
|
22660 | function NbTimePickerDirective(document, positionBuilder, hostRef, triggerStrategyBuilder, overlay, cd, calendarTimeModelService, dateService, renderer, placeholder) {
|
22661 | this.document = document;
|
22662 | this.positionBuilder = positionBuilder;
|
22663 | this.hostRef = hostRef;
|
22664 | this.triggerStrategyBuilder = triggerStrategyBuilder;
|
22665 | this.overlay = overlay;
|
22666 | this.cd = cd;
|
22667 | this.calendarTimeModelService = calendarTimeModelService;
|
22668 | this.dateService = dateService;
|
22669 | this.renderer = renderer;
|
22670 | this.placeholder = placeholder;
|
22671 | |
22672 |
|
22673 |
|
22674 | this.overlayOffset = 8;
|
22675 | this.destroy$ = new rxjs.Subject();
|
22676 | this.onChange = function () {
|
22677 | };
|
22678 | this.onTouched = function () {
|
22679 | };
|
22680 | }
|
22681 | Object.defineProperty(NbTimePickerDirective.prototype, "timepicker", {
|
22682 | |
22683 |
|
22684 |
|
22685 | get: function () {
|
22686 | return this._timePickerComponent;
|
22687 | },
|
22688 | set: function (timePicker) {
|
22689 | this._timePickerComponent = timePicker;
|
22690 | },
|
22691 | enumerable: false,
|
22692 | configurable: true
|
22693 | });
|
22694 | Object.defineProperty(NbTimePickerDirective.prototype, "input", {
|
22695 | |
22696 |
|
22697 |
|
22698 |
|
22699 | get: function () {
|
22700 | return this.hostRef.nativeElement;
|
22701 | },
|
22702 | enumerable: false,
|
22703 | configurable: true
|
22704 | });
|
22705 | Object.defineProperty(NbTimePickerDirective.prototype, "isOpen", {
|
22706 | |
22707 |
|
22708 |
|
22709 |
|
22710 | get: function () {
|
22711 | return this.overlayRef && this.overlayRef.hasAttached();
|
22712 | },
|
22713 | enumerable: false,
|
22714 | configurable: true
|
22715 | });
|
22716 | Object.defineProperty(NbTimePickerDirective.prototype, "isClosed", {
|
22717 | |
22718 |
|
22719 |
|
22720 |
|
22721 | get: function () {
|
22722 | return !this.isOpen;
|
22723 | },
|
22724 | enumerable: false,
|
22725 | configurable: true
|
22726 | });
|
22727 | Object.defineProperty(NbTimePickerDirective.prototype, "inputValue", {
|
22728 | |
22729 |
|
22730 |
|
22731 |
|
22732 | get: function () {
|
22733 | return this.input.value;
|
22734 | },
|
22735 | set: function (value) {
|
22736 | this.input.value = value;
|
22737 | },
|
22738 | enumerable: false,
|
22739 | configurable: true
|
22740 | });
|
22741 | NbTimePickerDirective.prototype.ngAfterViewInit = function () {
|
22742 | this.subscribeOnInputChange();
|
22743 | if (!this.placeholder) {
|
22744 | this.renderer.setProperty(this.input, 'placeholder', this.timepicker.timeFormat);
|
22745 | }
|
22746 | this.triggerStrategy = this.createTriggerStrategy();
|
22747 | this.subscribeOnTriggers();
|
22748 | this.subscribeToBlur();
|
22749 | };
|
22750 | NbTimePickerDirective.prototype.show = function () {
|
22751 | if (this.isClosed) {
|
22752 | this.attachToOverlay();
|
22753 | }
|
22754 | };
|
22755 | NbTimePickerDirective.prototype.hide = function () {
|
22756 | if (this.isOpen) {
|
22757 | this.overlayRef.detach();
|
22758 | this.cd.markForCheck();
|
22759 | }
|
22760 | };
|
22761 | |
22762 |
|
22763 |
|
22764 |
|
22765 | NbTimePickerDirective.prototype.attachToOverlay = function () {
|
22766 | if (!this.overlayRef) {
|
22767 | this.setupTimepicker();
|
22768 | this.initOverlay();
|
22769 | }
|
22770 | this.overlayRef.attach(this.timepicker.portal);
|
22771 | };
|
22772 | NbTimePickerDirective.prototype.setupTimepicker = function () {
|
22773 | if (this.dateService.getId() === 'native' && i0.isDevMode()) {
|
22774 | console.warn('Date.parse does not support parsing time with custom format.' +
|
22775 | ' See details here https://akveo.github.io/nebular/docs/components/datepicker/overview#native-parse-issue');
|
22776 | }
|
22777 | this.timepicker.setHost(this.hostRef);
|
22778 | if (this.inputValue) {
|
22779 | var val = this.dateService.getId() === 'native' ? this.parseNativeDateString(this.inputValue) : this.inputValue;
|
22780 | this.timepicker.date = this.dateService.parse(val, this.timepicker.timeFormat);
|
22781 | }
|
22782 | else {
|
22783 | this.timepicker.date = this.calendarTimeModelService.getResetTime();
|
22784 | }
|
22785 | };
|
22786 | NbTimePickerDirective.prototype.initOverlay = function () {
|
22787 | this.positionStrategy = this.createPositionStrategy();
|
22788 | this.subscribeOnApplyClick();
|
22789 | this.createOverlay();
|
22790 | };
|
22791 | NbTimePickerDirective.prototype.subscribeOnApplyClick = function () {
|
22792 | var _this = this;
|
22793 | this.timepicker.onSelectTime.pipe(rxjs_operators.takeUntil(this.destroy$)).subscribe(function (value) {
|
22794 | var time = _this.dateService.format(value.time, _this.timepicker.timeFormat).toUpperCase();
|
22795 | _this.inputValue = time;
|
22796 | _this.timepicker.date = value.time;
|
22797 | _this.onChange(value.time);
|
22798 | if (value.save) {
|
22799 | _this.lastInputValue = time;
|
22800 | _this.hide();
|
22801 | }
|
22802 | });
|
22803 | };
|
22804 | NbTimePickerDirective.prototype.createOverlay = function () {
|
22805 | var scrollStrategy = this.createScrollStrategy();
|
22806 | this.overlayRef = this.overlay.create({ positionStrategy: this.positionStrategy, scrollStrategy: scrollStrategy });
|
22807 | };
|
22808 | NbTimePickerDirective.prototype.subscribeOnTriggers = function () {
|
22809 | var _this = this;
|
22810 | this.triggerStrategy.show$
|
22811 | .pipe(rxjs_operators.filter(function () { return _this.isClosed; }))
|
22812 | .subscribe(function () { return _this.show(); });
|
22813 | this.triggerStrategy.hide$
|
22814 | .pipe(rxjs_operators.filter(function () { return _this.isOpen; }))
|
22815 | .subscribe(function () {
|
22816 | _this.inputValue = _this.lastInputValue || '';
|
22817 | _this.hide();
|
22818 | });
|
22819 | };
|
22820 | NbTimePickerDirective.prototype.createTriggerStrategy = function () {
|
22821 | var _this = this;
|
22822 | return this.triggerStrategyBuilder
|
22823 | .trigger(exports.NbTrigger.FOCUS)
|
22824 | .host(this.hostRef.nativeElement)
|
22825 | .container(function () { return _this.getContainer(); })
|
22826 | .build();
|
22827 | };
|
22828 | NbTimePickerDirective.prototype.createPositionStrategy = function () {
|
22829 | return this.positionBuilder
|
22830 | .connectedTo(this.hostRef)
|
22831 | .position(exports.NbPosition.BOTTOM)
|
22832 | .offset(this.overlayOffset)
|
22833 | .adjustment(exports.NbAdjustment.VERTICAL);
|
22834 | };
|
22835 | NbTimePickerDirective.prototype.getContainer = function () {
|
22836 | return this.overlayRef && this.isOpen && {
|
22837 | location: {
|
22838 | nativeElement: this.overlayRef.overlayElement,
|
22839 | },
|
22840 | };
|
22841 | };
|
22842 | NbTimePickerDirective.prototype.createScrollStrategy = function () {
|
22843 | return this.overlay.scrollStrategies.block();
|
22844 | };
|
22845 | NbTimePickerDirective.prototype.subscribeOnInputChange = function () {
|
22846 | var _this = this;
|
22847 | rxjs.fromEvent(this.input, 'input')
|
22848 | .pipe(rxjs_operators.map(function () { return _this.inputValue; }), rxjs_operators.takeUntil(this.destroy$))
|
22849 | .subscribe(function (value) { return _this.handleInputChange(value); });
|
22850 | };
|
22851 | NbTimePickerDirective.prototype.subscribeToBlur = function () {
|
22852 | var _this = this;
|
22853 | rxjs.merge(this.timepicker.blur, rxjs.fromEvent(this.input, 'blur').pipe(rxjs_operators.filter(function () { return !_this.isOpen && _this.document.activeElement !== _this.input; }))).pipe(rxjs_operators.takeUntil(this.destroy$))
|
22854 | .subscribe(function () { return _this.onTouched(); });
|
22855 | };
|
22856 | |
22857 |
|
22858 |
|
22859 |
|
22860 | NbTimePickerDirective.prototype.handleInputChange = function (value) {
|
22861 | if (this.dateService.getId() === 'native') {
|
22862 | |
22863 |
|
22864 |
|
22865 |
|
22866 | value = this.parseNativeDateString(value);
|
22867 | }
|
22868 | var isValidDate = this.dateService.isValidDateString(value, this.timepicker.timeFormat);
|
22869 | if (isValidDate) {
|
22870 | this.lastInputValue = value;
|
22871 | var date = this.dateService.parse(value, this.timepicker.timeFormat);
|
22872 | this.onChange(date);
|
22873 | this.timepicker.date = date;
|
22874 | }
|
22875 | };
|
22876 | NbTimePickerDirective.prototype.updateValue = function (value) {
|
22877 | if (value) {
|
22878 | this.timepicker.date = value;
|
22879 | var timeString = this.dateService.format(value, this.timepicker.timeFormat).toUpperCase();
|
22880 | this.inputValue = timeString;
|
22881 | this.lastInputValue = timeString;
|
22882 | }
|
22883 | };
|
22884 | NbTimePickerDirective.prototype.writeValue = function (value) {
|
22885 | this.updateValue(value);
|
22886 | };
|
22887 | NbTimePickerDirective.prototype.registerOnChange = function (fn) {
|
22888 | this.onChange = fn;
|
22889 | };
|
22890 | NbTimePickerDirective.prototype.registerOnTouched = function (fn) {
|
22891 | this.onTouched = fn;
|
22892 | };
|
22893 | NbTimePickerDirective.prototype.parseNativeDateString = function (value) {
|
22894 | var date = this.dateService.today();
|
22895 | var year = this.dateService.getYear(date);
|
22896 | var month = this.calendarTimeModelService.paddToTwoSymbols(this.dateService.getMonth(date));
|
22897 | var day = this.calendarTimeModelService.paddToTwoSymbols(this.dateService.getDate(date));
|
22898 | return year + "-" + month + "-" + day + " " + value;
|
22899 | };
|
22900 | NbTimePickerDirective.decorators = [
|
22901 | { type: i0.Directive, args: [{
|
22902 | selector: 'input[nbTimepicker]',
|
22903 | providers: [{
|
22904 | provide: _angular_forms.NG_VALUE_ACCESSOR,
|
22905 | useExisting: i0.forwardRef(function () { return NbTimePickerDirective; }),
|
22906 | multi: true,
|
22907 | }],
|
22908 | },] }
|
22909 | ];
|
22910 | NbTimePickerDirective.ctorParameters = function () { return [
|
22911 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
22912 | { type: NbPositionBuilderService },
|
22913 | { type: i0.ElementRef },
|
22914 | { type: NbTriggerStrategyBuilderService },
|
22915 | { type: NbOverlayService },
|
22916 | { type: i0.ChangeDetectorRef },
|
22917 | { type: NbCalendarTimeModelService },
|
22918 | { type: NbDateService },
|
22919 | { type: i0.Renderer2 },
|
22920 | { type: String, decorators: [{ type: i0.Attribute, args: ['placeholder',] }] }
|
22921 | ]; };
|
22922 | NbTimePickerDirective.propDecorators = {
|
22923 | timepicker: [{ type: i0.Input, args: ['nbTimepicker',] }],
|
22924 | overlayOffset: [{ type: i0.Input }]
|
22925 | };
|
22926 | return NbTimePickerDirective;
|
22927 | }());
|
22928 |
|
22929 | var NbTimePickerCellComponent = (function () {
|
22930 | function NbTimePickerCellComponent(ngZone, platformService) {
|
22931 | this.ngZone = ngZone;
|
22932 | this.platformService = platformService;
|
22933 | this.selectedChange$ = new rxjs.Subject();
|
22934 | this.unselected$ = this.selectedChange$.pipe(rxjs_operators.filter(function (selected) { return !selected; }));
|
22935 | this.destroy$ = new rxjs.Subject();
|
22936 | this.select = new i0.EventEmitter();
|
22937 | }
|
22938 | Object.defineProperty(NbTimePickerCellComponent.prototype, "selected", {
|
22939 | get: function () {
|
22940 | return this._selected;
|
22941 | },
|
22942 | set: function (selected) {
|
22943 | if (selected) {
|
22944 | this._selected = selected;
|
22945 | this.scrollToElement();
|
22946 | }
|
22947 | this.selectedChange$.next(selected);
|
22948 | },
|
22949 | enumerable: false,
|
22950 | configurable: true
|
22951 | });
|
22952 |
|
22953 | NbTimePickerCellComponent.prototype.onClick = function () {
|
22954 | this.select.emit({ value: this.value });
|
22955 | };
|
22956 | NbTimePickerCellComponent.prototype.ngAfterViewInit = function () {
|
22957 | var _this = this;
|
22958 | if (this.selected) {
|
22959 |
|
22960 |
|
22961 |
|
22962 | this.ngZone.onStable
|
22963 | .pipe(rxjs_operators.take(1), rxjs_operators.takeUntil(rxjs.merge(this.unselected$, this.destroy$)))
|
22964 | .subscribe(function () { return _this.scrollToElement(); });
|
22965 | }
|
22966 | };
|
22967 | NbTimePickerCellComponent.prototype.scrollToElement = function () {
|
22968 | var _this = this;
|
22969 | if (this.valueContainerElement && this.platformService.isBrowser) {
|
22970 | this.ngZone.runOutsideAngular(function () {
|
22971 | return _this.valueContainerElement.nativeElement.scrollIntoView({ block: 'center' });
|
22972 | });
|
22973 | }
|
22974 | };
|
22975 | NbTimePickerCellComponent.prototype.ngOnDestroy = function () {
|
22976 | this.destroy$.next();
|
22977 | this.destroy$.complete();
|
22978 | };
|
22979 | NbTimePickerCellComponent.decorators = [
|
22980 | { type: i0.Component, args: [{
|
22981 | selector: 'nb-timepicker-cell',
|
22982 | template: "\n <div #valueContainer>{{ value }}</div>\n ",
|
22983 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
22984 | styles: [":host{width:100%;height:100%;display:flex;align-items:center;justify-content:center;user-select:none}\n"]
|
22985 | },] }
|
22986 | ];
|
22987 | NbTimePickerCellComponent.ctorParameters = function () { return [
|
22988 | { type: i0.NgZone },
|
22989 | { type: NbPlatform }
|
22990 | ]; };
|
22991 | NbTimePickerCellComponent.propDecorators = {
|
22992 | selected: [{ type: i0.Input }],
|
22993 | value: [{ type: i0.Input }],
|
22994 | select: [{ type: i0.Output }],
|
22995 | valueContainerElement: [{ type: i0.ViewChild, args: ['valueContainer',] }],
|
22996 | onClick: [{ type: i0.HostListener, args: ['click',] }]
|
22997 | };
|
22998 | return NbTimePickerCellComponent;
|
22999 | }());
|
23000 |
|
23001 |
|
23002 |
|
23003 |
|
23004 |
|
23005 |
|
23006 | var NbTimepickerModule = (function () {
|
23007 | function NbTimepickerModule() {
|
23008 | }
|
23009 | NbTimepickerModule.forRoot = function (config) {
|
23010 | if (config === void 0) { config = {}; }
|
23011 | return {
|
23012 | ngModule: NbTimepickerModule,
|
23013 | providers: [{ provide: NB_TIME_PICKER_CONFIG, useValue: config }],
|
23014 | };
|
23015 | };
|
23016 | NbTimepickerModule.forChild = function (config) {
|
23017 | if (config === void 0) { config = {}; }
|
23018 | return {
|
23019 | ngModule: NbTimepickerModule,
|
23020 | providers: [{ provide: NB_TIME_PICKER_CONFIG, useValue: config }],
|
23021 | };
|
23022 | };
|
23023 | NbTimepickerModule.decorators = [
|
23024 | { type: i0.NgModule, args: [{
|
23025 | imports: [
|
23026 | _angular_common.CommonModule,
|
23027 | NbOverlayModule,
|
23028 | NbListModule,
|
23029 | NbCardModule,
|
23030 | NbCalendarKitModule,
|
23031 | ],
|
23032 | providers: [NbCalendarTimeModelService],
|
23033 | exports: [NbTimePickerComponent, NbTimePickerCellComponent, NbTimePickerDirective],
|
23034 | declarations: [NbTimePickerComponent, NbTimePickerCellComponent, NbTimePickerDirective],
|
23035 | },] }
|
23036 | ];
|
23037 | return NbTimepickerModule;
|
23038 | }());
|
23039 |
|
23040 |
|
23041 |
|
23042 |
|
23043 |
|
23044 |
|
23045 | var NbDateAdapterService = (function (_super) {
|
23046 | tslib.__extends(NbDateAdapterService, _super);
|
23047 | function NbDateAdapterService(dateService) {
|
23048 | var _this = _super.call(this) || this;
|
23049 | _this.dateService = dateService;
|
23050 | _this.picker = NbDatepickerComponent;
|
23051 | return _this;
|
23052 | }
|
23053 | NbDateAdapterService.prototype.parse = function (date, format) {
|
23054 | return this.dateService.parse(date, format);
|
23055 | };
|
23056 | NbDateAdapterService.prototype.format = function (date, format) {
|
23057 | return this.dateService.format(date, format);
|
23058 | };
|
23059 | NbDateAdapterService.prototype.isValid = function (date, format) {
|
23060 | return this.dateService.isValidDateString(date, format);
|
23061 | };
|
23062 | NbDateAdapterService.decorators = [
|
23063 | { type: i0.Injectable }
|
23064 | ];
|
23065 | NbDateAdapterService.ctorParameters = function () { return [
|
23066 | { type: NbDateService }
|
23067 | ]; };
|
23068 | return NbDateAdapterService;
|
23069 | }(NbDatepickerAdapter));
|
23070 | var NbRangeAdapterService = (function (_super) {
|
23071 | tslib.__extends(NbRangeAdapterService, _super);
|
23072 | function NbRangeAdapterService(dateService) {
|
23073 | var _this = _super.call(this) || this;
|
23074 | _this.dateService = dateService;
|
23075 | _this.picker = NbRangepickerComponent;
|
23076 | return _this;
|
23077 | }
|
23078 | NbRangeAdapterService.prototype.parse = function (range, format) {
|
23079 | var _a = range.split('-').map(function (subDate) { return subDate.trim(); }), start = _a[0], end = _a[1];
|
23080 | return {
|
23081 | start: this.dateService.parse(start, format),
|
23082 | end: this.dateService.parse(end, format),
|
23083 | };
|
23084 | };
|
23085 | NbRangeAdapterService.prototype.format = function (range, format) {
|
23086 | if (!range) {
|
23087 | return '';
|
23088 | }
|
23089 | var start = this.dateService.format(range.start, format);
|
23090 | var isStartValid = this.dateService.isValidDateString(start, format);
|
23091 | if (!isStartValid) {
|
23092 | return '';
|
23093 | }
|
23094 | var end = this.dateService.format(range.end, format);
|
23095 | var isEndValid = this.dateService.isValidDateString(end, format);
|
23096 | if (isEndValid) {
|
23097 | return start + " - " + end;
|
23098 | }
|
23099 | else {
|
23100 | return start;
|
23101 | }
|
23102 | };
|
23103 | NbRangeAdapterService.prototype.isValid = function (range, format) {
|
23104 | var _a = range.split('-').map(function (subDate) { return subDate.trim(); }), start = _a[0], end = _a[1];
|
23105 | return this.dateService.isValidDateString(start, format) && this.dateService.isValidDateString(end, format);
|
23106 | };
|
23107 | NbRangeAdapterService.decorators = [
|
23108 | { type: i0.Injectable }
|
23109 | ];
|
23110 | NbRangeAdapterService.ctorParameters = function () { return [
|
23111 | { type: NbDateService }
|
23112 | ]; };
|
23113 | return NbRangeAdapterService;
|
23114 | }(NbDatepickerAdapter));
|
23115 | var NbDateTimeAdapterService = (function (_super) {
|
23116 | tslib.__extends(NbDateTimeAdapterService, _super);
|
23117 | function NbDateTimeAdapterService(dateService) {
|
23118 | var _this = _super.call(this) || this;
|
23119 | _this.dateService = dateService;
|
23120 | _this.picker = NbDateTimePickerComponent;
|
23121 | return _this;
|
23122 | }
|
23123 | NbDateTimeAdapterService.prototype.parse = function (date, format) {
|
23124 | return this.dateService.parse(date, format);
|
23125 | };
|
23126 | NbDateTimeAdapterService.prototype.format = function (date, format) {
|
23127 | return this.dateService.format(date, format);
|
23128 | };
|
23129 | NbDateTimeAdapterService.prototype.isValid = function (date, format) {
|
23130 | return this.dateService.isValidDateString(date, format);
|
23131 | };
|
23132 | NbDateTimeAdapterService.decorators = [
|
23133 | { type: i0.Injectable }
|
23134 | ];
|
23135 | NbDateTimeAdapterService.ctorParameters = function () { return [
|
23136 | { type: NbDateService }
|
23137 | ]; };
|
23138 | return NbDateTimeAdapterService;
|
23139 | }(NbDatepickerAdapter));
|
23140 |
|
23141 |
|
23142 |
|
23143 |
|
23144 |
|
23145 |
|
23146 | var NbDatepickerModule = (function () {
|
23147 | function NbDatepickerModule() {
|
23148 | }
|
23149 | NbDatepickerModule.forRoot = function () {
|
23150 | return {
|
23151 | ngModule: NbDatepickerModule,
|
23152 | providers: [
|
23153 | _angular_common.DatePipe,
|
23154 | {
|
23155 | provide: NB_DATE_ADAPTER,
|
23156 | multi: true,
|
23157 | useClass: NbDateAdapterService,
|
23158 | },
|
23159 | {
|
23160 | provide: NB_DATE_ADAPTER,
|
23161 | multi: true,
|
23162 | useClass: NbRangeAdapterService,
|
23163 | },
|
23164 | {
|
23165 | provide: NB_DATE_ADAPTER,
|
23166 | multi: true,
|
23167 | useClass: NbDateTimeAdapterService,
|
23168 | },
|
23169 | ],
|
23170 | };
|
23171 | };
|
23172 | NbDatepickerModule.decorators = [
|
23173 | { type: i0.NgModule, args: [{
|
23174 | imports: [
|
23175 | NbOverlayModule,
|
23176 | NbCalendarModule,
|
23177 | NbCalendarRangeModule,
|
23178 | NbCardModule,
|
23179 | NbBaseCalendarModule,
|
23180 | NbTimepickerModule,
|
23181 | NbCalendarKitModule,
|
23182 | ],
|
23183 | exports: [
|
23184 | NbDatepickerDirective,
|
23185 | NbDatepickerComponent,
|
23186 | NbRangepickerComponent,
|
23187 | NbDateTimePickerComponent,
|
23188 | NbCalendarWithTimeComponent,
|
23189 | ],
|
23190 | declarations: [
|
23191 | NbDatepickerDirective,
|
23192 | NbDatepickerContainerComponent,
|
23193 | NbCalendarWithTimeComponent,
|
23194 | NbDateTimePickerComponent,
|
23195 | NbDatepickerComponent,
|
23196 | NbRangepickerComponent,
|
23197 | NbBasePickerComponent,
|
23198 | ],
|
23199 | entryComponents: [
|
23200 | NbCalendarComponent,
|
23201 | NbCalendarRangeComponent,
|
23202 | NbDatepickerContainerComponent,
|
23203 | NbCalendarWithTimeComponent,
|
23204 | ],
|
23205 | },] }
|
23206 | ];
|
23207 | return NbDatepickerModule;
|
23208 | }());
|
23209 |
|
23210 |
|
23211 |
|
23212 |
|
23213 |
|
23214 |
|
23215 |
|
23216 |
|
23217 |
|
23218 |
|
23219 |
|
23220 |
|
23221 |
|
23222 |
|
23223 |
|
23224 |
|
23225 |
|
23226 |
|
23227 |
|
23228 |
|
23229 |
|
23230 |
|
23231 |
|
23232 |
|
23233 |
|
23234 |
|
23235 |
|
23236 |
|
23237 |
|
23238 |
|
23239 |
|
23240 |
|
23241 |
|
23242 |
|
23243 |
|
23244 |
|
23245 |
|
23246 |
|
23247 |
|
23248 |
|
23249 |
|
23250 |
|
23251 |
|
23252 |
|
23253 |
|
23254 |
|
23255 |
|
23256 |
|
23257 |
|
23258 |
|
23259 |
|
23260 |
|
23261 |
|
23262 |
|
23263 |
|
23264 |
|
23265 |
|
23266 |
|
23267 |
|
23268 |
|
23269 |
|
23270 |
|
23271 |
|
23272 |
|
23273 |
|
23274 |
|
23275 |
|
23276 |
|
23277 |
|
23278 |
|
23279 |
|
23280 |
|
23281 |
|
23282 |
|
23283 |
|
23284 |
|
23285 |
|
23286 |
|
23287 |
|
23288 |
|
23289 |
|
23290 |
|
23291 |
|
23292 |
|
23293 |
|
23294 |
|
23295 |
|
23296 |
|
23297 |
|
23298 |
|
23299 |
|
23300 |
|
23301 |
|
23302 |
|
23303 |
|
23304 |
|
23305 |
|
23306 |
|
23307 |
|
23308 |
|
23309 |
|
23310 |
|
23311 |
|
23312 |
|
23313 |
|
23314 |
|
23315 |
|
23316 |
|
23317 |
|
23318 |
|
23319 |
|
23320 |
|
23321 |
|
23322 |
|
23323 |
|
23324 |
|
23325 |
|
23326 |
|
23327 |
|
23328 |
|
23329 |
|
23330 |
|
23331 |
|
23332 |
|
23333 |
|
23334 |
|
23335 |
|
23336 |
|
23337 |
|
23338 |
|
23339 |
|
23340 |
|
23341 |
|
23342 |
|
23343 |
|
23344 |
|
23345 |
|
23346 |
|
23347 |
|
23348 |
|
23349 |
|
23350 |
|
23351 |
|
23352 |
|
23353 |
|
23354 |
|
23355 |
|
23356 |
|
23357 |
|
23358 |
|
23359 |
|
23360 |
|
23361 |
|
23362 |
|
23363 |
|
23364 |
|
23365 |
|
23366 |
|
23367 |
|
23368 |
|
23369 |
|
23370 |
|
23371 |
|
23372 |
|
23373 |
|
23374 |
|
23375 |
|
23376 |
|
23377 |
|
23378 |
|
23379 |
|
23380 |
|
23381 |
|
23382 |
|
23383 |
|
23384 |
|
23385 |
|
23386 |
|
23387 |
|
23388 |
|
23389 |
|
23390 |
|
23391 |
|
23392 |
|
23393 |
|
23394 |
|
23395 |
|
23396 |
|
23397 |
|
23398 |
|
23399 |
|
23400 |
|
23401 |
|
23402 |
|
23403 |
|
23404 |
|
23405 | var NbRadioComponent = (function () {
|
23406 | function NbRadioComponent(cd, renderer, statusService) {
|
23407 | this.cd = cd;
|
23408 | this.renderer = renderer;
|
23409 | this.statusService = statusService;
|
23410 | this._checked = false;
|
23411 | this._disabled = false;
|
23412 | this.status = 'basic';
|
23413 | this.valueChange = new i0.EventEmitter();
|
23414 | this.blur = new i0.EventEmitter();
|
23415 | }
|
23416 | Object.defineProperty(NbRadioComponent.prototype, "name", {
|
23417 | get: function () {
|
23418 | return this._name;
|
23419 | },
|
23420 | set: function (value) {
|
23421 | if (this._name !== value) {
|
23422 | this._name = value;
|
23423 | }
|
23424 | },
|
23425 | enumerable: false,
|
23426 | configurable: true
|
23427 | });
|
23428 | Object.defineProperty(NbRadioComponent.prototype, "checked", {
|
23429 | get: function () {
|
23430 | return this._checked;
|
23431 | },
|
23432 | set: function (value) {
|
23433 | var boolValue = convertToBoolProperty(value);
|
23434 | if (this._checked !== boolValue) {
|
23435 | this._checked = boolValue;
|
23436 | }
|
23437 | },
|
23438 | enumerable: false,
|
23439 | configurable: true
|
23440 | });
|
23441 | Object.defineProperty(NbRadioComponent.prototype, "value", {
|
23442 | get: function () {
|
23443 | return this._value;
|
23444 | },
|
23445 | set: function (value) {
|
23446 | if (this._value !== value) {
|
23447 | this._value = value;
|
23448 | }
|
23449 | },
|
23450 | enumerable: false,
|
23451 | configurable: true
|
23452 | });
|
23453 | Object.defineProperty(NbRadioComponent.prototype, "disabled", {
|
23454 | get: function () {
|
23455 | return this._disabled;
|
23456 | },
|
23457 | set: function (disabled) {
|
23458 | var boolValue = convertToBoolProperty(disabled);
|
23459 | if (this._disabled !== boolValue) {
|
23460 | this._disabled = boolValue;
|
23461 | }
|
23462 | },
|
23463 | enumerable: false,
|
23464 | configurable: true
|
23465 | });
|
23466 | Object.defineProperty(NbRadioComponent.prototype, "isPrimary", {
|
23467 | get: function () {
|
23468 | return this.status === 'primary';
|
23469 | },
|
23470 | enumerable: false,
|
23471 | configurable: true
|
23472 | });
|
23473 | Object.defineProperty(NbRadioComponent.prototype, "isSuccess", {
|
23474 | get: function () {
|
23475 | return this.status === 'success';
|
23476 | },
|
23477 | enumerable: false,
|
23478 | configurable: true
|
23479 | });
|
23480 | Object.defineProperty(NbRadioComponent.prototype, "isWarning", {
|
23481 | get: function () {
|
23482 | return this.status === 'warning';
|
23483 | },
|
23484 | enumerable: false,
|
23485 | configurable: true
|
23486 | });
|
23487 | Object.defineProperty(NbRadioComponent.prototype, "isDanger", {
|
23488 | get: function () {
|
23489 | return this.status === 'danger';
|
23490 | },
|
23491 | enumerable: false,
|
23492 | configurable: true
|
23493 | });
|
23494 | Object.defineProperty(NbRadioComponent.prototype, "isInfo", {
|
23495 | get: function () {
|
23496 | return this.status === 'info';
|
23497 | },
|
23498 | enumerable: false,
|
23499 | configurable: true
|
23500 | });
|
23501 | Object.defineProperty(NbRadioComponent.prototype, "isBasic", {
|
23502 | get: function () {
|
23503 | return this.status === 'basic';
|
23504 | },
|
23505 | enumerable: false,
|
23506 | configurable: true
|
23507 | });
|
23508 | Object.defineProperty(NbRadioComponent.prototype, "isControl", {
|
23509 | get: function () {
|
23510 | return this.status === 'control';
|
23511 | },
|
23512 | enumerable: false,
|
23513 | configurable: true
|
23514 | });
|
23515 | Object.defineProperty(NbRadioComponent.prototype, "additionalClasses", {
|
23516 | get: function () {
|
23517 | if (this.statusService.isCustomStatus(this.status)) {
|
23518 | return [this.statusService.getStatusClass(this.status)];
|
23519 | }
|
23520 | return [];
|
23521 | },
|
23522 | enumerable: false,
|
23523 | configurable: true
|
23524 | });
|
23525 | NbRadioComponent.prototype.onChange = function (event) {
|
23526 | event.stopPropagation();
|
23527 | this.checked = true;
|
23528 | this.valueChange.emit(this.value);
|
23529 | };
|
23530 | NbRadioComponent.prototype.onClick = function (event) {
|
23531 | event.stopPropagation();
|
23532 | };
|
23533 | |
23534 |
|
23535 |
|
23536 |
|
23537 |
|
23538 |
|
23539 | NbRadioComponent.prototype._markForCheck = function () {
|
23540 | this.cd.markForCheck();
|
23541 | };
|
23542 | |
23543 |
|
23544 |
|
23545 |
|
23546 |
|
23547 |
|
23548 |
|
23549 |
|
23550 | NbRadioComponent.prototype._setName = function (name) {
|
23551 | this.name = name;
|
23552 | if (this.input) {
|
23553 | this.renderer.setProperty(this.input.nativeElement, 'name', name);
|
23554 | }
|
23555 | };
|
23556 | NbRadioComponent.decorators = [
|
23557 | { type: i0.Component, args: [{
|
23558 | selector: 'nb-radio',
|
23559 | template: "\n <label>\n <input\n #input\n type=\"radio\"\n class=\"native-input visually-hidden\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n (change)=\"onChange($event)\"\n (click)=\"onClick($event)\">\n <span class=\"outer-circle\"></span>\n <span class=\"inner-circle\"></span>\n <span class=\"text\">\n <ng-content></ng-content>\n </span>\n </label>\n ",
|
23560 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
23561 | styles: [":host{display:block;position:relative}:host label{display:inline-flex;margin:0;min-height:inherit;padding:0.375rem 0;align-items:center}[dir=ltr] :host label{padding-right:1.5rem}[dir=rtl] :host label{padding-left:1.5rem}:host .outer-circle,:host .inner-circle{border-radius:50%;position:absolute;top:50%;transform:translateY(-50%)}[dir=ltr] :host .outer-circle,[dir=ltr] :host .inner-circle{left:0}[dir=rtl] :host .outer-circle,[dir=rtl] :host .inner-circle{right:0}:host .inner-circle{transform:translateY(-50%) scale(0.6)}[dir=ltr] :host .text{padding-left:.5rem}[dir=rtl] :host .text{padding-right:.5rem}\n"]
|
23562 | },] }
|
23563 | ];
|
23564 | NbRadioComponent.ctorParameters = function () { return [
|
23565 | { type: i0.ChangeDetectorRef },
|
23566 | { type: i0.Renderer2 },
|
23567 | { type: NbStatusService }
|
23568 | ]; };
|
23569 | NbRadioComponent.propDecorators = {
|
23570 | name: [{ type: i0.Input }],
|
23571 | checked: [{ type: i0.Input }],
|
23572 | value: [{ type: i0.Input }],
|
23573 | disabled: [{ type: i0.Input }],
|
23574 | status: [{ type: i0.Input }],
|
23575 | valueChange: [{ type: i0.Output }],
|
23576 | blur: [{ type: i0.Output }],
|
23577 | input: [{ type: i0.ViewChild, args: ['input', { read: i0.ElementRef },] }],
|
23578 | isPrimary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
23579 | isSuccess: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
23580 | isWarning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
23581 | isDanger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
23582 | isInfo: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
23583 | isBasic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
23584 | isControl: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
23585 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }]
|
23586 | };
|
23587 | return NbRadioComponent;
|
23588 | }());
|
23589 |
|
23590 |
|
23591 |
|
23592 |
|
23593 |
|
23594 |
|
23595 |
|
23596 |
|
23597 |
|
23598 |
|
23599 |
|
23600 |
|
23601 |
|
23602 |
|
23603 |
|
23604 |
|
23605 |
|
23606 |
|
23607 |
|
23608 |
|
23609 |
|
23610 |
|
23611 |
|
23612 |
|
23613 |
|
23614 |
|
23615 |
|
23616 |
|
23617 |
|
23618 |
|
23619 |
|
23620 |
|
23621 |
|
23622 |
|
23623 |
|
23624 |
|
23625 |
|
23626 |
|
23627 |
|
23628 |
|
23629 |
|
23630 |
|
23631 |
|
23632 |
|
23633 |
|
23634 |
|
23635 | var NbRadioGroupComponent = (function () {
|
23636 | function NbRadioGroupComponent(hostElement, platformId, document) {
|
23637 | this.hostElement = hostElement;
|
23638 | this.platformId = platformId;
|
23639 | this.document = document;
|
23640 | this.destroy$ = new rxjs.Subject();
|
23641 | this.onChange = function (value) { };
|
23642 | this.onTouched = function () { };
|
23643 | this._status = 'basic';
|
23644 | this.valueChange = new i0.EventEmitter();
|
23645 | }
|
23646 | Object.defineProperty(NbRadioGroupComponent.prototype, "value", {
|
23647 | get: function () {
|
23648 | return this._value;
|
23649 | },
|
23650 | set: function (value) {
|
23651 | this._value = value;
|
23652 | this.updateValues();
|
23653 | },
|
23654 | enumerable: false,
|
23655 | configurable: true
|
23656 | });
|
23657 | Object.defineProperty(NbRadioGroupComponent.prototype, "name", {
|
23658 | get: function () {
|
23659 | return this._name;
|
23660 | },
|
23661 | set: function (name) {
|
23662 | this._name = name;
|
23663 | this.updateNames();
|
23664 | },
|
23665 | enumerable: false,
|
23666 | configurable: true
|
23667 | });
|
23668 | Object.defineProperty(NbRadioGroupComponent.prototype, "disabled", {
|
23669 | get: function () {
|
23670 | return this._disabled;
|
23671 | },
|
23672 | set: function (disabled) {
|
23673 | this._disabled = convertToBoolProperty(disabled);
|
23674 | this.updateDisabled();
|
23675 | },
|
23676 | enumerable: false,
|
23677 | configurable: true
|
23678 | });
|
23679 | Object.defineProperty(NbRadioGroupComponent.prototype, "status", {
|
23680 | |
23681 |
|
23682 |
|
23683 |
|
23684 | get: function () {
|
23685 | return this._status;
|
23686 | },
|
23687 | set: function (value) {
|
23688 | if (this._status !== value) {
|
23689 | this._status = value;
|
23690 | this.updateStatus();
|
23691 | }
|
23692 | },
|
23693 | enumerable: false,
|
23694 | configurable: true
|
23695 | });
|
23696 | NbRadioGroupComponent.prototype.ngAfterContentInit = function () {
|
23697 | var _this = this;
|
23698 |
|
23699 |
|
23700 |
|
23701 |
|
23702 |
|
23703 | this.updateNames();
|
23704 | this.radios.changes
|
23705 | .pipe(rxjs_operators.startWith(this.radios),
|
23706 |
|
23707 |
|
23708 |
|
23709 |
|
23710 | rxjs_operators.switchMap(function (radios) { return rxjs.from(Promise.resolve(radios)); }), rxjs_operators.takeUntil(this.destroy$))
|
23711 | .subscribe(function () { return _this.updateAndSubscribeToRadios(); });
|
23712 | };
|
23713 | NbRadioGroupComponent.prototype.ngOnDestroy = function () {
|
23714 | this.destroy$.next();
|
23715 | this.destroy$.complete();
|
23716 | };
|
23717 | NbRadioGroupComponent.prototype.registerOnChange = function (fn) {
|
23718 | this.onChange = fn;
|
23719 | };
|
23720 | NbRadioGroupComponent.prototype.registerOnTouched = function (fn) {
|
23721 | this.onTouched = fn;
|
23722 | };
|
23723 | NbRadioGroupComponent.prototype.writeValue = function (value) {
|
23724 | this.value = value;
|
23725 | };
|
23726 | NbRadioGroupComponent.prototype.setDisabledState = function (isDisabled) {
|
23727 | this.disabled = isDisabled;
|
23728 | };
|
23729 | NbRadioGroupComponent.prototype.updateAndSubscribeToRadios = function () {
|
23730 | this.updateValueFromCheckedOption();
|
23731 | this.updateNames();
|
23732 | this.updateValues();
|
23733 | this.updateDisabled();
|
23734 | this.updateStatus();
|
23735 | this.subscribeOnRadiosValueChange();
|
23736 | this.subscribeOnRadiosBlur();
|
23737 | };
|
23738 | NbRadioGroupComponent.prototype.updateNames = function () {
|
23739 | var _this = this;
|
23740 | if (this.radios) {
|
23741 | this.radios.forEach(function (radio) { return radio._setName(_this.name); });
|
23742 | }
|
23743 | };
|
23744 | NbRadioGroupComponent.prototype.updateValues = function () {
|
23745 | var _this = this;
|
23746 | this.updateAndMarkForCheckRadios(function (radio) { return radio.checked = radio.value === _this.value; });
|
23747 | };
|
23748 | NbRadioGroupComponent.prototype.updateDisabled = function () {
|
23749 | var _this = this;
|
23750 | if (typeof this.disabled !== 'undefined') {
|
23751 | this.updateAndMarkForCheckRadios(function (radio) { return radio.disabled = _this.disabled; });
|
23752 | }
|
23753 | };
|
23754 | NbRadioGroupComponent.prototype.subscribeOnRadiosValueChange = function () {
|
23755 | var _this = this;
|
23756 | if (!this.radios || !this.radios.length) {
|
23757 | return;
|
23758 | }
|
23759 | rxjs.merge.apply(void 0, this.radios.map(function (radio) { return radio.valueChange; })).pipe(rxjs_operators.takeUntil(rxjs.merge(this.radios.changes, this.destroy$)))
|
23760 | .subscribe(function (value) {
|
23761 | _this.writeValue(value);
|
23762 | _this.propagateValue(value);
|
23763 | });
|
23764 | };
|
23765 | NbRadioGroupComponent.prototype.propagateValue = function (value) {
|
23766 | this.valueChange.emit(value);
|
23767 | this.onChange(value);
|
23768 | };
|
23769 | NbRadioGroupComponent.prototype.subscribeOnRadiosBlur = function () {
|
23770 | var _this = this;
|
23771 | var hasNoRadios = !this.radios || !this.radios.length;
|
23772 | if (!_angular_common.isPlatformBrowser(this.platformId) || hasNoRadios) {
|
23773 | return;
|
23774 | }
|
23775 | var hostElement = this.hostElement.nativeElement;
|
23776 | rxjs.fromEvent(hostElement, 'focusin')
|
23777 | .pipe(rxjs_operators.filter(function (event) { return hostElement.contains(event.target); }), rxjs_operators.switchMap(function () { return rxjs.merge(rxjs.fromEvent(_this.document, 'focusin'), rxjs.fromEvent(_this.document, 'click')); }), rxjs_operators.filter(function (event) { return !hostElement.contains(event.target); }), rxjs_operators.takeUntil(rxjs.merge(this.radios.changes, this.destroy$)))
|
23778 | .subscribe(function () { return _this.onTouched(); });
|
23779 | };
|
23780 | NbRadioGroupComponent.prototype.updateStatus = function () {
|
23781 | var _this = this;
|
23782 | this.updateAndMarkForCheckRadios(function (radio) { return radio.status = _this.status; });
|
23783 | };
|
23784 | NbRadioGroupComponent.prototype.updateAndMarkForCheckRadios = function (updateFn) {
|
23785 | if (this.radios) {
|
23786 | this.radios.forEach(function (radio) {
|
23787 | updateFn(radio);
|
23788 | radio._markForCheck();
|
23789 | });
|
23790 | }
|
23791 | };
|
23792 | NbRadioGroupComponent.prototype.updateValueFromCheckedOption = function () {
|
23793 | var checkedRadio = this.radios.find(function (radio) { return radio.checked; });
|
23794 | var isValueMissing = this.value === undefined || this.value === null;
|
23795 | if (checkedRadio && isValueMissing && checkedRadio.value !== this.value) {
|
23796 | this.value = checkedRadio.value;
|
23797 | }
|
23798 | };
|
23799 | NbRadioGroupComponent.decorators = [
|
23800 | { type: i0.Component, args: [{
|
23801 | selector: 'nb-radio-group',
|
23802 | template: "\n <ng-content select=\"nb-radio\"></ng-content>",
|
23803 | providers: [
|
23804 | {
|
23805 | provide: _angular_forms.NG_VALUE_ACCESSOR,
|
23806 | useExisting: i0.forwardRef(function () { return NbRadioGroupComponent; }),
|
23807 | multi: true,
|
23808 | },
|
23809 | ],
|
23810 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
23811 | },] }
|
23812 | ];
|
23813 | NbRadioGroupComponent.ctorParameters = function () { return [
|
23814 | { type: i0.ElementRef },
|
23815 | { type: undefined, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] },
|
23816 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] }
|
23817 | ]; };
|
23818 | NbRadioGroupComponent.propDecorators = {
|
23819 | value: [{ type: i0.Input }],
|
23820 | name: [{ type: i0.Input }],
|
23821 | disabled: [{ type: i0.Input }],
|
23822 | status: [{ type: i0.Input }],
|
23823 | radios: [{ type: i0.ContentChildren, args: [NbRadioComponent, { descendants: true },] }],
|
23824 | valueChange: [{ type: i0.Output }]
|
23825 | };
|
23826 | return NbRadioGroupComponent;
|
23827 | }());
|
23828 |
|
23829 |
|
23830 |
|
23831 |
|
23832 |
|
23833 |
|
23834 | var NbRadioModule = (function () {
|
23835 | function NbRadioModule() {
|
23836 | }
|
23837 | NbRadioModule.decorators = [
|
23838 | { type: i0.NgModule, args: [{
|
23839 | imports: [],
|
23840 | exports: [NbRadioComponent, NbRadioGroupComponent],
|
23841 | declarations: [NbRadioComponent, NbRadioGroupComponent],
|
23842 | },] }
|
23843 | ];
|
23844 | return NbRadioModule;
|
23845 | }());
|
23846 |
|
23847 |
|
23848 |
|
23849 |
|
23850 |
|
23851 |
|
23852 | var tagUniqueId = 0;
|
23853 |
|
23854 |
|
23855 |
|
23856 |
|
23857 |
|
23858 |
|
23859 |
|
23860 |
|
23861 |
|
23862 |
|
23863 |
|
23864 |
|
23865 |
|
23866 |
|
23867 |
|
23868 |
|
23869 |
|
23870 |
|
23871 |
|
23872 |
|
23873 |
|
23874 |
|
23875 |
|
23876 |
|
23877 |
|
23878 |
|
23879 |
|
23880 |
|
23881 |
|
23882 |
|
23883 |
|
23884 |
|
23885 |
|
23886 |
|
23887 |
|
23888 |
|
23889 |
|
23890 |
|
23891 |
|
23892 |
|
23893 |
|
23894 |
|
23895 |
|
23896 |
|
23897 |
|
23898 |
|
23899 |
|
23900 |
|
23901 |
|
23902 |
|
23903 |
|
23904 |
|
23905 |
|
23906 |
|
23907 |
|
23908 |
|
23909 |
|
23910 |
|
23911 |
|
23912 |
|
23913 |
|
23914 |
|
23915 |
|
23916 |
|
23917 |
|
23918 |
|
23919 |
|
23920 |
|
23921 |
|
23922 |
|
23923 |
|
23924 |
|
23925 |
|
23926 |
|
23927 |
|
23928 |
|
23929 |
|
23930 |
|
23931 |
|
23932 |
|
23933 |
|
23934 |
|
23935 |
|
23936 |
|
23937 |
|
23938 |
|
23939 |
|
23940 |
|
23941 |
|
23942 |
|
23943 |
|
23944 |
|
23945 |
|
23946 |
|
23947 |
|
23948 |
|
23949 |
|
23950 |
|
23951 |
|
23952 |
|
23953 |
|
23954 |
|
23955 |
|
23956 |
|
23957 |
|
23958 |
|
23959 |
|
23960 |
|
23961 |
|
23962 |
|
23963 |
|
23964 |
|
23965 |
|
23966 |
|
23967 |
|
23968 |
|
23969 |
|
23970 |
|
23971 |
|
23972 |
|
23973 |
|
23974 |
|
23975 |
|
23976 |
|
23977 |
|
23978 |
|
23979 |
|
23980 |
|
23981 |
|
23982 |
|
23983 |
|
23984 |
|
23985 |
|
23986 |
|
23987 |
|
23988 |
|
23989 |
|
23990 |
|
23991 |
|
23992 |
|
23993 |
|
23994 |
|
23995 |
|
23996 |
|
23997 |
|
23998 |
|
23999 |
|
24000 |
|
24001 |
|
24002 |
|
24003 |
|
24004 |
|
24005 |
|
24006 |
|
24007 |
|
24008 |
|
24009 |
|
24010 |
|
24011 |
|
24012 |
|
24013 |
|
24014 |
|
24015 |
|
24016 |
|
24017 |
|
24018 |
|
24019 |
|
24020 |
|
24021 |
|
24022 |
|
24023 |
|
24024 |
|
24025 |
|
24026 |
|
24027 |
|
24028 |
|
24029 |
|
24030 |
|
24031 |
|
24032 |
|
24033 |
|
24034 |
|
24035 |
|
24036 |
|
24037 |
|
24038 |
|
24039 |
|
24040 |
|
24041 |
|
24042 |
|
24043 |
|
24044 | var NbTagComponent = (function () {
|
24045 | function NbTagComponent(_hostElement, cd, renderer, zone, statusService) {
|
24046 | this._hostElement = _hostElement;
|
24047 | this.cd = cd;
|
24048 | this.renderer = renderer;
|
24049 | this.zone = zone;
|
24050 | this.statusService = statusService;
|
24051 | this._destroy$ = new rxjs.Subject();
|
24052 | this._selected = false;
|
24053 | this._removable = false;
|
24054 | |
24055 |
|
24056 |
|
24057 | this.appearance = 'filled';
|
24058 | |
24059 |
|
24060 |
|
24061 | this.status = 'basic';
|
24062 | |
24063 |
|
24064 |
|
24065 | this.size = 'medium';
|
24066 | this.role = 'option';
|
24067 | |
24068 |
|
24069 |
|
24070 |
|
24071 | this.remove = new i0.EventEmitter();
|
24072 | this.selectedChange = new i0.EventEmitter();
|
24073 | this._isActive = false;
|
24074 | this._id = "nb-tag-" + tagUniqueId++;
|
24075 | }
|
24076 | Object.defineProperty(NbTagComponent.prototype, "destroy$", {
|
24077 | get: function () {
|
24078 | return this._destroy$.asObservable();
|
24079 | },
|
24080 | enumerable: false,
|
24081 | configurable: true
|
24082 | });
|
24083 | Object.defineProperty(NbTagComponent.prototype, "selected", {
|
24084 | get: function () {
|
24085 | return this._selected;
|
24086 | },
|
24087 | set: function (value) {
|
24088 | if (this.selected !== convertToBoolProperty(value)) {
|
24089 | this._selected = !this.selected;
|
24090 | this.selectedChange.emit({ tag: this, selected: this.selected });
|
24091 | }
|
24092 | },
|
24093 | enumerable: false,
|
24094 | configurable: true
|
24095 | });
|
24096 | Object.defineProperty(NbTagComponent.prototype, "removable", {
|
24097 | |
24098 |
|
24099 |
|
24100 | get: function () {
|
24101 | return this._removable;
|
24102 | },
|
24103 | set: function (value) {
|
24104 | this._removable = convertToBoolProperty(value);
|
24105 | },
|
24106 | enumerable: false,
|
24107 | configurable: true
|
24108 | });
|
24109 | Object.defineProperty(NbTagComponent.prototype, "filled", {
|
24110 | get: function () {
|
24111 | return this.appearance === 'filled';
|
24112 | },
|
24113 | set: function (value) {
|
24114 | if (convertToBoolProperty(value)) {
|
24115 | this.appearance = 'filled';
|
24116 | }
|
24117 | },
|
24118 | enumerable: false,
|
24119 | configurable: true
|
24120 | });
|
24121 | Object.defineProperty(NbTagComponent.prototype, "outline", {
|
24122 | get: function () {
|
24123 | return this.appearance === 'outline';
|
24124 | },
|
24125 | set: function (value) {
|
24126 | if (convertToBoolProperty(value)) {
|
24127 | this.appearance = 'outline';
|
24128 | }
|
24129 | },
|
24130 | enumerable: false,
|
24131 | configurable: true
|
24132 | });
|
24133 | Object.defineProperty(NbTagComponent.prototype, "basic", {
|
24134 | get: function () {
|
24135 | return this.status === 'basic';
|
24136 | },
|
24137 | enumerable: false,
|
24138 | configurable: true
|
24139 | });
|
24140 | Object.defineProperty(NbTagComponent.prototype, "primary", {
|
24141 | get: function () {
|
24142 | return this.status === 'primary';
|
24143 | },
|
24144 | enumerable: false,
|
24145 | configurable: true
|
24146 | });
|
24147 | Object.defineProperty(NbTagComponent.prototype, "success", {
|
24148 | get: function () {
|
24149 | return this.status === 'success';
|
24150 | },
|
24151 | enumerable: false,
|
24152 | configurable: true
|
24153 | });
|
24154 | Object.defineProperty(NbTagComponent.prototype, "info", {
|
24155 | get: function () {
|
24156 | return this.status === 'info';
|
24157 | },
|
24158 | enumerable: false,
|
24159 | configurable: true
|
24160 | });
|
24161 | Object.defineProperty(NbTagComponent.prototype, "warning", {
|
24162 | get: function () {
|
24163 | return this.status === 'warning';
|
24164 | },
|
24165 | enumerable: false,
|
24166 | configurable: true
|
24167 | });
|
24168 | Object.defineProperty(NbTagComponent.prototype, "danger", {
|
24169 | get: function () {
|
24170 | return this.status === 'danger';
|
24171 | },
|
24172 | enumerable: false,
|
24173 | configurable: true
|
24174 | });
|
24175 | Object.defineProperty(NbTagComponent.prototype, "control", {
|
24176 | get: function () {
|
24177 | return this.status === 'control';
|
24178 | },
|
24179 | enumerable: false,
|
24180 | configurable: true
|
24181 | });
|
24182 | Object.defineProperty(NbTagComponent.prototype, "tiny", {
|
24183 | get: function () {
|
24184 | return this.size === 'tiny';
|
24185 | },
|
24186 | enumerable: false,
|
24187 | configurable: true
|
24188 | });
|
24189 | Object.defineProperty(NbTagComponent.prototype, "small", {
|
24190 | get: function () {
|
24191 | return this.size === 'small';
|
24192 | },
|
24193 | enumerable: false,
|
24194 | configurable: true
|
24195 | });
|
24196 | Object.defineProperty(NbTagComponent.prototype, "medium", {
|
24197 | get: function () {
|
24198 | return this.size === 'medium';
|
24199 | },
|
24200 | enumerable: false,
|
24201 | configurable: true
|
24202 | });
|
24203 | Object.defineProperty(NbTagComponent.prototype, "large", {
|
24204 | get: function () {
|
24205 | return this.size === 'large';
|
24206 | },
|
24207 | enumerable: false,
|
24208 | configurable: true
|
24209 | });
|
24210 | Object.defineProperty(NbTagComponent.prototype, "giant", {
|
24211 | get: function () {
|
24212 | return this.size === 'giant';
|
24213 | },
|
24214 | enumerable: false,
|
24215 | configurable: true
|
24216 | });
|
24217 | Object.defineProperty(NbTagComponent.prototype, "additionalClasses", {
|
24218 | get: function () {
|
24219 | if (this.statusService.isCustomStatus(this.status)) {
|
24220 | return [this.statusService.getStatusClass(this.status)];
|
24221 | }
|
24222 | return [];
|
24223 | },
|
24224 | enumerable: false,
|
24225 | configurable: true
|
24226 | });
|
24227 | NbTagComponent.prototype._remove = function () {
|
24228 | if (this.removable) {
|
24229 | this.remove.emit(this);
|
24230 | }
|
24231 | };
|
24232 | NbTagComponent.prototype.ngAfterViewInit = function () {
|
24233 | var _this = this;
|
24234 |
|
24235 | this.zone.runOutsideAngular(function () { return setTimeout(function () {
|
24236 | _this.renderer.addClass(_this._hostElement.nativeElement, 'nb-transition');
|
24237 | }); });
|
24238 | };
|
24239 | NbTagComponent.prototype.ngOnDestroy = function () {
|
24240 | this._destroy$.next(this);
|
24241 | };
|
24242 | NbTagComponent.prototype._toggleSelection = function () {
|
24243 | this.selected = !this.selected;
|
24244 | this.cd.markForCheck();
|
24245 | };
|
24246 | NbTagComponent.prototype.setActiveStyles = function () {
|
24247 | if (!this._isActive) {
|
24248 | this._isActive = true;
|
24249 | this.cd.markForCheck();
|
24250 | }
|
24251 | };
|
24252 | NbTagComponent.prototype.setInactiveStyles = function () {
|
24253 | if (this._isActive) {
|
24254 | this._isActive = false;
|
24255 | this.cd.markForCheck();
|
24256 | }
|
24257 | };
|
24258 | NbTagComponent.decorators = [
|
24259 | { type: i0.Component, args: [{
|
24260 | selector: 'nb-tag',
|
24261 | template: "{{ text }}\n<nb-icon *ngIf=\"removable\"\n (click)=\"_remove()\"\n class=\"nb-tag-remove size-{{size}}\"\n icon=\"close-outline\"\n pack=\"nebular-essentials\"\n aria-hidden=\"true\">\n</nb-icon>\n",
|
24262 | exportAs: 'nbTag',
|
24263 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
24264 | },] }
|
24265 | ];
|
24266 | NbTagComponent.ctorParameters = function () { return [
|
24267 | { type: i0.ElementRef },
|
24268 | { type: i0.ChangeDetectorRef },
|
24269 | { type: i0.Renderer2 },
|
24270 | { type: i0.NgZone },
|
24271 | { type: NbStatusService }
|
24272 | ]; };
|
24273 | NbTagComponent.propDecorators = {
|
24274 | text: [{ type: i0.Input }],
|
24275 | selected: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.selected',] }, { type: i0.HostBinding, args: ['attr.aria-selected',] }],
|
24276 | removable: [{ type: i0.Input }],
|
24277 | appearance: [{ type: i0.Input }],
|
24278 | status: [{ type: i0.Input }],
|
24279 | size: [{ type: i0.Input }],
|
24280 | role: [{ type: i0.Input }, { type: i0.HostBinding, args: ['attr.role',] }],
|
24281 | remove: [{ type: i0.Output }],
|
24282 | selectedChange: [{ type: i0.Output }],
|
24283 | _isActive: [{ type: i0.HostBinding, args: ['class.active',] }],
|
24284 | _id: [{ type: i0.HostBinding, args: ['attr.id',] }],
|
24285 | filled: [{ type: i0.HostBinding, args: ['class.appearance-filled',] }],
|
24286 | outline: [{ type: i0.HostBinding, args: ['class.appearance-outline',] }],
|
24287 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
24288 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
24289 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
24290 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
24291 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
24292 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
24293 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
24294 | tiny: [{ type: i0.HostBinding, args: ['class.size-tiny',] }],
|
24295 | small: [{ type: i0.HostBinding, args: ['class.size-small',] }],
|
24296 | medium: [{ type: i0.HostBinding, args: ['class.size-medium',] }],
|
24297 | large: [{ type: i0.HostBinding, args: ['class.size-large',] }],
|
24298 | giant: [{ type: i0.HostBinding, args: ['class.size-giant',] }],
|
24299 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }],
|
24300 | _remove: [{ type: i0.HostListener, args: ['keydown.delete',] }, { type: i0.HostListener, args: ['keydown.backspace',] }]
|
24301 | };
|
24302 | return NbTagComponent;
|
24303 | }());
|
24304 |
|
24305 |
|
24306 |
|
24307 |
|
24308 |
|
24309 |
|
24310 |
|
24311 |
|
24312 |
|
24313 |
|
24314 |
|
24315 |
|
24316 |
|
24317 |
|
24318 |
|
24319 |
|
24320 |
|
24321 |
|
24322 |
|
24323 |
|
24324 |
|
24325 |
|
24326 |
|
24327 |
|
24328 |
|
24329 |
|
24330 |
|
24331 | var NbTagInputDirective = (function (_super) {
|
24332 | tslib.__extends(NbTagInputDirective, _super);
|
24333 | function NbTagInputDirective(_hostElement, focusMonitor, renderer, zone, statusService) {
|
24334 | var _this = _super.call(this, _hostElement, focusMonitor, renderer, zone, statusService) || this;
|
24335 | _this._hostElement = _hostElement;
|
24336 | _this.focusMonitor = focusMonitor;
|
24337 | _this.renderer = renderer;
|
24338 | _this.zone = zone;
|
24339 | _this.statusService = statusService;
|
24340 | _this.keyDown$ = new rxjs.Subject();
|
24341 | |
24342 |
|
24343 |
|
24344 | _this.separatorKeys = [_angular_cdk_keycodes.ENTER];
|
24345 | |
24346 |
|
24347 |
|
24348 | _this.tagAdd = new i0.EventEmitter();
|
24349 | _this.nbTagInputClass = true;
|
24350 | return _this;
|
24351 | }
|
24352 | Object.defineProperty(NbTagInputDirective.prototype, "_value", {
|
24353 | get: function () {
|
24354 | return this._hostElement.nativeElement.value;
|
24355 | },
|
24356 | enumerable: false,
|
24357 | configurable: true
|
24358 | });
|
24359 | NbTagInputDirective.prototype._onKeydown = function (event) {
|
24360 | this.keyDown$.next(event);
|
24361 | };
|
24362 | NbTagInputDirective.prototype.ngAfterViewInit = function () {
|
24363 | var _this = this;
|
24364 | _super.prototype.ngAfterViewInit.call(this);
|
24365 | this.keyDown$
|
24366 | .pipe(rxjs_operators.filter(function (_a) {
|
24367 | var keyCode = _a.keyCode;
|
24368 | return _this.isSeparatorKey(keyCode);
|
24369 | }), rxjs_operators.map(function () { return _this._value; }), rxjs_operators.takeUntil(this.destroy$))
|
24370 | .subscribe(function (value) { return _this.tagAdd.emit({ value: value, input: _this._hostElement }); });
|
24371 | };
|
24372 | NbTagInputDirective.prototype.isSeparatorKey = function (keyCode) {
|
24373 | return this.separatorKeys.includes(keyCode);
|
24374 | };
|
24375 | NbTagInputDirective.decorators = [
|
24376 | { type: i0.Directive, args: [{
|
24377 | selector: 'input[nbTagInput]',
|
24378 | exportAs: 'nbTagInput',
|
24379 | providers: [
|
24380 | { provide: NbFormFieldControl, useExisting: NbTagInputDirective },
|
24381 | ],
|
24382 | },] }
|
24383 | ];
|
24384 | NbTagInputDirective.ctorParameters = function () { return [
|
24385 | { type: i0.ElementRef },
|
24386 | { type: NbFocusMonitor },
|
24387 | { type: i0.Renderer2 },
|
24388 | { type: i0.NgZone },
|
24389 | { type: NbStatusService }
|
24390 | ]; };
|
24391 | NbTagInputDirective.propDecorators = {
|
24392 | separatorKeys: [{ type: i0.Input }],
|
24393 | tagAdd: [{ type: i0.Output }],
|
24394 | nbTagInputClass: [{ type: i0.HostBinding, args: ['class.nb-tag-input',] }],
|
24395 | _onKeydown: [{ type: i0.HostListener, args: ['keydown', ['$event'],] }]
|
24396 | };
|
24397 | return NbTagInputDirective;
|
24398 | }(NbInputDirective));
|
24399 |
|
24400 |
|
24401 |
|
24402 |
|
24403 |
|
24404 |
|
24405 |
|
24406 |
|
24407 |
|
24408 |
|
24409 |
|
24410 |
|
24411 |
|
24412 |
|
24413 |
|
24414 |
|
24415 |
|
24416 |
|
24417 |
|
24418 |
|
24419 |
|
24420 |
|
24421 |
|
24422 |
|
24423 |
|
24424 |
|
24425 |
|
24426 |
|
24427 | var NbTagListComponent = (function () {
|
24428 | function NbTagListComponent(hostElement, cd, renderer, zone, focusMonitor, activeDescendantKeyManagerFactory, directionService, statusService) {
|
24429 | this.hostElement = hostElement;
|
24430 | this.cd = cd;
|
24431 | this.renderer = renderer;
|
24432 | this.zone = zone;
|
24433 | this.focusMonitor = focusMonitor;
|
24434 | this.activeDescendantKeyManagerFactory = activeDescendantKeyManagerFactory;
|
24435 | this.directionService = directionService;
|
24436 | this.statusService = statusService;
|
24437 | this.destroy$ = new rxjs.Subject();
|
24438 | this.keyDown$ = new rxjs.Subject();
|
24439 | this.tagClick$ = new rxjs.Subject();
|
24440 | this.focused = false;
|
24441 | |
24442 |
|
24443 |
|
24444 | this.size = 'medium';
|
24445 | this.tabIndex = 0;
|
24446 | this.role = 'listbox';
|
24447 | this._multiple = false;
|
24448 | this.activeTagId = null;
|
24449 | |
24450 |
|
24451 |
|
24452 |
|
24453 | this.tagRemove = new i0.EventEmitter();
|
24454 | }
|
24455 | Object.defineProperty(NbTagListComponent.prototype, "multiple", {
|
24456 | get: function () {
|
24457 | return this._multiple;
|
24458 | },
|
24459 | set: function (value) {
|
24460 | this._multiple = convertToBoolProperty(value);
|
24461 | },
|
24462 | enumerable: false,
|
24463 | configurable: true
|
24464 | });
|
24465 | Object.defineProperty(NbTagListComponent.prototype, "_hasInput", {
|
24466 | get: function () {
|
24467 | return !!this.tagInput;
|
24468 | },
|
24469 | enumerable: false,
|
24470 | configurable: true
|
24471 | });
|
24472 | Object.defineProperty(NbTagListComponent.prototype, "_isFocused", {
|
24473 | get: function () {
|
24474 | return this.focused;
|
24475 | },
|
24476 | enumerable: false,
|
24477 | configurable: true
|
24478 | });
|
24479 | Object.defineProperty(NbTagListComponent.prototype, "_isFullWidth", {
|
24480 | get: function () {
|
24481 | var _a;
|
24482 | return !!((_a = this.tagInput) === null || _a === void 0 ? void 0 : _a.fullWidth);
|
24483 | },
|
24484 | enumerable: false,
|
24485 | configurable: true
|
24486 | });
|
24487 | Object.defineProperty(NbTagListComponent.prototype, "_inputClasses", {
|
24488 | get: function () {
|
24489 | if (this._hasInput) {
|
24490 | return [
|
24491 | "shape-" + this.tagInput.shape,
|
24492 | "size-" + this.tagInput.fieldSize,
|
24493 | this.statusService.getStatusClass(this.tagInput.status),
|
24494 | ];
|
24495 | }
|
24496 | return ["size-" + this.size];
|
24497 | },
|
24498 | enumerable: false,
|
24499 | configurable: true
|
24500 | });
|
24501 | NbTagListComponent.prototype._onKeydown = function (event) {
|
24502 | this.keyDown$.next(event);
|
24503 | };
|
24504 | NbTagListComponent.prototype._onClick = function (_a) {
|
24505 | var target = _a.target;
|
24506 | var clickedTag = this.tags.find(function (tag) { return tag._hostElement.nativeElement === target; });
|
24507 | if (clickedTag) {
|
24508 | this.tagClick$.next(clickedTag);
|
24509 | }
|
24510 | };
|
24511 | NbTagListComponent.prototype.ngOnInit = function () {
|
24512 | var _this = this;
|
24513 | this.focusMonitor.monitor(this.hostElement, true)
|
24514 | .pipe(rxjs_operators.map(function (origin) { return !!origin; }), rxjs_operators.finalize(function () { return _this.focusMonitor.stopMonitoring(_this.hostElement); }), rxjs_operators.takeUntil(this.destroy$))
|
24515 | .subscribe(function (isFocused) { return _this.onFocusChange(isFocused); });
|
24516 | };
|
24517 | NbTagListComponent.prototype.ngAfterContentInit = function () {
|
24518 | this.initKeyManager();
|
24519 | this.setAutocompleteCustomHost();
|
24520 | };
|
24521 | NbTagListComponent.prototype.ngAfterViewInit = function () {
|
24522 | var _this = this;
|
24523 | this.listenToLayoutDirectionChange();
|
24524 | this.listenListKeyDown();
|
24525 | this.listenInputKeyDown();
|
24526 | this.listenTagClick();
|
24527 | this.listenTagRemove();
|
24528 | this.listenTagDestroy();
|
24529 | this.listenActiveTagChange();
|
24530 | this.listenNoTags();
|
24531 |
|
24532 | this.zone.runOutsideAngular(function () { return setTimeout(function () {
|
24533 | _this.renderer.addClass(_this.hostElement.nativeElement, 'nb-transition');
|
24534 | }); });
|
24535 | };
|
24536 | NbTagListComponent.prototype.ngOnDestroy = function () {
|
24537 | this.destroy$.next();
|
24538 | };
|
24539 | NbTagListComponent.prototype.initKeyManager = function () {
|
24540 | this.keyManager = this.activeDescendantKeyManagerFactory
|
24541 | .create(this.tags)
|
24542 | .withHorizontalOrientation(this.directionService.getDirection())
|
24543 | .withWrap();
|
24544 | };
|
24545 | NbTagListComponent.prototype.listenToLayoutDirectionChange = function () {
|
24546 | var _this = this;
|
24547 | this.directionService.onDirectionChange()
|
24548 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
24549 | .subscribe(function (direction) { return _this.keyManager.withHorizontalOrientation(direction); });
|
24550 | };
|
24551 | NbTagListComponent.prototype.listenListKeyDown = function () {
|
24552 | var _this = this;
|
24553 | var tagListKeyDown$ = this.keyDown$
|
24554 | .pipe(rxjs_operators.filter(function (_a) {
|
24555 | var target = _a.target;
|
24556 | return target === _this.hostElement.nativeElement;
|
24557 | }));
|
24558 | var activeTagKeyDown$ = tagListKeyDown$
|
24559 | .pipe(rxjs_operators.filter(function () { return !!_this.keyManager.activeItem; }));
|
24560 | tagListKeyDown$
|
24561 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
24562 | .subscribe(function (event) { return _this.keyManager.onKeydown(event); });
|
24563 | activeTagKeyDown$
|
24564 | .pipe(rxjs_operators.filter(function (_a) {
|
24565 | var keyCode = _a.keyCode;
|
24566 | return keyCode === _angular_cdk_keycodes.SPACE;
|
24567 | }), rxjs_operators.takeUntil(this.destroy$))
|
24568 | .subscribe(function (event) {
|
24569 | _this.toggleTag(_this.keyManager.activeItem);
|
24570 |
|
24571 | event.preventDefault();
|
24572 | });
|
24573 | activeTagKeyDown$
|
24574 | .pipe(rxjs_operators.filter(function (_a) {
|
24575 | var keyCode = _a.keyCode;
|
24576 | return _this.isBackspaceOrDelete(keyCode);
|
24577 | }), rxjs_operators.map(function () { return _this.keyManager.activeItem; }), rxjs_operators.takeUntil(this.destroy$))
|
24578 | .subscribe(function (tagToRemove) { return tagToRemove._remove(); });
|
24579 | };
|
24580 | NbTagListComponent.prototype.listenInputKeyDown = function () {
|
24581 | var _this = this;
|
24582 | var inputKeyDown$ = this.keyDown$
|
24583 | .pipe(rxjs_operators.filter(function (_a) {
|
24584 | var _b;
|
24585 | var target = _a.target;
|
24586 | return target === ((_b = _this.tagInput) === null || _b === void 0 ? void 0 : _b._hostElement.nativeElement);
|
24587 | }));
|
24588 | inputKeyDown$
|
24589 | .pipe(rxjs_operators.filter(function (_a) {
|
24590 | var keyCode = _a.keyCode;
|
24591 | return _this.tagInput._value === '' && _this.isBackspaceOrDelete(keyCode) && _this.tags.length > 0;
|
24592 | }), rxjs_operators.takeUntil(this.destroy$))
|
24593 | .subscribe(function () {
|
24594 | _this.hostElement.nativeElement.focus();
|
24595 | _this.keyManager.setLastItemActive();
|
24596 | _this.cd.markForCheck();
|
24597 | });
|
24598 | };
|
24599 | NbTagListComponent.prototype.listenTagClick = function () {
|
24600 | var _this = this;
|
24601 | this.tagClick$
|
24602 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
24603 | .subscribe(function (clickedTag) {
|
24604 | _this.toggleTag(clickedTag);
|
24605 | _this.keyManager.setActiveItem(clickedTag);
|
24606 | });
|
24607 | };
|
24608 | NbTagListComponent.prototype.listenTagRemove = function () {
|
24609 | var _this = this;
|
24610 | this.tags.changes
|
24611 | .pipe(rxjs_operators.startWith(this.tags), rxjs_operators.switchMap(function (tags) { return rxjs.merge.apply(void 0, tags.map(function (tag) { return tag.remove; })); }), rxjs_operators.takeUntil(this.destroy$))
|
24612 | .subscribe(function (tagToRemove) { return _this.tagRemove.emit(tagToRemove); });
|
24613 | };
|
24614 | NbTagListComponent.prototype.listenTagDestroy = function () {
|
24615 | var _this = this;
|
24616 | this.tags.changes
|
24617 | .pipe(rxjs_operators.startWith(this.tags), rxjs_operators.switchMap(function (tags) { return rxjs.merge.apply(void 0, tags.map(function (tag) { return tag.destroy$; })); }), rxjs_operators.filter(function (destroyedTag) { return destroyedTag === _this.keyManager.activeItem; }), rxjs_operators.map(function (destroyedTag) { return destroyedTag === _this.tags.last; }), rxjs_operators.takeUntil(this.destroy$))
|
24618 | .subscribe(function (isLastTagDestroyed) {
|
24619 | if (isLastTagDestroyed) {
|
24620 | _this.keyManager.setPreviousItemActive();
|
24621 | }
|
24622 | else {
|
24623 | _this.keyManager.setNextItemActive();
|
24624 | }
|
24625 | });
|
24626 | };
|
24627 | NbTagListComponent.prototype.listenNoTags = function () {
|
24628 | var _this = this;
|
24629 | this.tags.changes
|
24630 | .pipe(rxjs_operators.startWith(this.tags), rxjs_operators.filter(function (tags) { return tags.length === 0; }), rxjs_operators.takeUntil(this.destroy$))
|
24631 | .subscribe(function () { return _this.focusInputIfActive(); });
|
24632 | };
|
24633 | NbTagListComponent.prototype.listenActiveTagChange = function () {
|
24634 | var _this = this;
|
24635 | this.keyManager.change
|
24636 | .pipe(rxjs_operators.map(function () { var _a; return (_a = _this.keyManager.activeItem) === null || _a === void 0 ? void 0 : _a._id; }), rxjs_operators.takeUntil(this.destroy$))
|
24637 | .subscribe(function (activeTagId) {
|
24638 | _this.activeTagId = activeTagId;
|
24639 | _this.cd.markForCheck();
|
24640 | });
|
24641 | };
|
24642 | NbTagListComponent.prototype.onFocusChange = function (isFocused) {
|
24643 | var _a;
|
24644 | this.focused = isFocused;
|
24645 | this.cd.markForCheck();
|
24646 | if (!isFocused || ((_a = this.tagInput) === null || _a === void 0 ? void 0 : _a.focused$.value)) {
|
24647 | this.keyManager.setActiveItem(-1);
|
24648 | return;
|
24649 | }
|
24650 |
|
24651 | if (this.tags.length === 0 && this._hasInput) {
|
24652 | this.focusInput();
|
24653 | }
|
24654 | else {
|
24655 | this.keyManager.setFirstItemActive();
|
24656 | }
|
24657 | };
|
24658 | NbTagListComponent.prototype.isBackspaceOrDelete = function (keyCode) {
|
24659 | return keyCode === _angular_cdk_keycodes.BACKSPACE || keyCode === _angular_cdk_keycodes.DELETE;
|
24660 | };
|
24661 | NbTagListComponent.prototype.setAutocompleteCustomHost = function () {
|
24662 | if (this.autocompleteDirective) {
|
24663 | this.autocompleteDirective.customOverlayHost = this.hostElement;
|
24664 | }
|
24665 | };
|
24666 | NbTagListComponent.prototype.toggleTag = function (tagToToggle) {
|
24667 | tagToToggle._toggleSelection();
|
24668 | if (tagToToggle.selected && !this.multiple) {
|
24669 | this.tags.forEach(function (tag) {
|
24670 | if (tag !== tagToToggle) {
|
24671 | tag.selected = false;
|
24672 | }
|
24673 | });
|
24674 | }
|
24675 | };
|
24676 | NbTagListComponent.prototype.focusInput = function () {
|
24677 | if (this._hasInput) {
|
24678 | this.tagInput._hostElement.nativeElement.focus();
|
24679 | }
|
24680 | };
|
24681 | NbTagListComponent.prototype.focusInputIfActive = function () {
|
24682 | if (this._isFocused) {
|
24683 | this.focusInput();
|
24684 | }
|
24685 | };
|
24686 | NbTagListComponent.decorators = [
|
24687 | { type: i0.Component, args: [{
|
24688 | selector: 'nb-tag-list',
|
24689 | template: "\n <div class=\"nb-tag-list-tags-wrapper\">\n <ng-content select=\"nb-tag, input[nbTagInput]\"></ng-content>\n </div>\n ",
|
24690 | exportAs: 'nbTagList',
|
24691 | changeDetection: i0.ChangeDetectionStrategy.OnPush
|
24692 | },] }
|
24693 | ];
|
24694 | NbTagListComponent.ctorParameters = function () { return [
|
24695 | { type: i0.ElementRef },
|
24696 | { type: i0.ChangeDetectorRef },
|
24697 | { type: i0.Renderer2 },
|
24698 | { type: i0.NgZone },
|
24699 | { type: NbFocusMonitor },
|
24700 | { type: NbActiveDescendantKeyManagerFactoryService },
|
24701 | { type: NbLayoutDirectionService },
|
24702 | { type: NbStatusService }
|
24703 | ]; };
|
24704 | NbTagListComponent.propDecorators = {
|
24705 | tags: [{ type: i0.ContentChildren, args: [NbTagComponent,] }],
|
24706 | tagInput: [{ type: i0.ContentChild, args: [NbTagInputDirective,] }],
|
24707 | autocompleteDirective: [{ type: i0.ContentChild, args: [NbAutocompleteDirective,] }],
|
24708 | size: [{ type: i0.Input }],
|
24709 | tabIndex: [{ type: i0.Input }, { type: i0.HostBinding, args: ['attr.tabindex',] }],
|
24710 | role: [{ type: i0.Input }, { type: i0.HostBinding, args: ['attr.role',] }],
|
24711 | multiple: [{ type: i0.Input }, { type: i0.HostBinding, args: ['attr.aria-multiselectable',] }],
|
24712 | activeTagId: [{ type: i0.HostBinding, args: ['attr.aria-activedescendant',] }],
|
24713 | tagRemove: [{ type: i0.Output }],
|
24714 | _hasInput: [{ type: i0.HostBinding, args: ['class.nb-tag-list-with-input',] }],
|
24715 | _isFocused: [{ type: i0.HostBinding, args: ['class.focus',] }],
|
24716 | _isFullWidth: [{ type: i0.HostBinding, args: ['class.input-full-width',] }],
|
24717 | _inputClasses: [{ type: i0.HostBinding, args: ['class',] }],
|
24718 | _onKeydown: [{ type: i0.HostListener, args: ['keydown', ['$event'],] }],
|
24719 | _onClick: [{ type: i0.HostListener, args: ['click', ['$event'],] }]
|
24720 | };
|
24721 | return NbTagListComponent;
|
24722 | }());
|
24723 |
|
24724 |
|
24725 |
|
24726 |
|
24727 |
|
24728 |
|
24729 | var NbTagModule = (function () {
|
24730 | function NbTagModule() {
|
24731 | }
|
24732 | NbTagModule.decorators = [
|
24733 | { type: i0.NgModule, args: [{
|
24734 | imports: [
|
24735 | _angular_common.CommonModule,
|
24736 | NbIconModule,
|
24737 | ],
|
24738 | declarations: [
|
24739 | NbTagComponent,
|
24740 | NbTagListComponent,
|
24741 | NbTagInputDirective,
|
24742 | ],
|
24743 | exports: [
|
24744 | NbTagComponent,
|
24745 | NbTagListComponent,
|
24746 | NbTagInputDirective,
|
24747 | ],
|
24748 | },] }
|
24749 | ];
|
24750 | return NbTagModule;
|
24751 | }());
|
24752 |
|
24753 |
|
24754 |
|
24755 |
|
24756 |
|
24757 |
|
24758 | var NB_DEFAULT_ROW_LEVEL = 0;
|
24759 |
|
24760 |
|
24761 |
|
24762 | var NbTreeGridPresentationNode = (function () {
|
24763 | function NbTreeGridPresentationNode(
|
24764 | /**
|
24765 | * Data object associated with row
|
24766 | */
|
24767 | data, children,
|
24768 | |
24769 |
|
24770 |
|
24771 | expanded, level) {
|
24772 | this.data = data;
|
24773 | this.children = children;
|
24774 | this.expanded = expanded;
|
24775 | this.level = level;
|
24776 | }
|
24777 | |
24778 |
|
24779 |
|
24780 | NbTreeGridPresentationNode.prototype.hasChildren = function () {
|
24781 | return !!this.children && !!this.children.length;
|
24782 | };
|
24783 | return NbTreeGridPresentationNode;
|
24784 | }());
|
24785 |
|
24786 |
|
24787 |
|
24788 |
|
24789 |
|
24790 |
|
24791 | var NbTreeGridDataService = (function () {
|
24792 | function NbTreeGridDataService() {
|
24793 | this.defaultGetters = {
|
24794 | dataGetter: function (node) { return node.data; },
|
24795 | childrenGetter: function (d) { return d.children || undefined; },
|
24796 | expandedGetter: function (d) { return !!d.expanded; },
|
24797 | };
|
24798 | }
|
24799 | NbTreeGridDataService.prototype.toPresentationNodes = function (nodes, customGetters, level) {
|
24800 | if (level === void 0) { level = NB_DEFAULT_ROW_LEVEL; }
|
24801 | var getters = tslib.__assign(tslib.__assign({}, this.defaultGetters), customGetters);
|
24802 | return this.mapNodes(nodes, getters, level);
|
24803 | };
|
24804 | NbTreeGridDataService.prototype.mapNodes = function (nodes, getters, level) {
|
24805 | var _this = this;
|
24806 | var dataGetter = getters.dataGetter, childrenGetter = getters.childrenGetter, expandedGetter = getters.expandedGetter;
|
24807 | return nodes.map(function (node) {
|
24808 | var childrenNodes = childrenGetter(node);
|
24809 | var children;
|
24810 | if (childrenNodes) {
|
24811 | children = _this.toPresentationNodes(childrenNodes, getters, level + 1);
|
24812 | }
|
24813 | return new NbTreeGridPresentationNode(dataGetter(node), children, expandedGetter(node), level);
|
24814 | });
|
24815 | };
|
24816 | NbTreeGridDataService.prototype.flattenExpanded = function (nodes) {
|
24817 | var _this = this;
|
24818 | return nodes.reduce(function (res, node) {
|
24819 | res.push(node);
|
24820 | if (node.expanded && node.hasChildren()) {
|
24821 | res.push.apply(res, _this.flattenExpanded(node.children));
|
24822 | }
|
24823 | return res;
|
24824 | }, []);
|
24825 | };
|
24826 | NbTreeGridDataService.prototype.copy = function (nodes) {
|
24827 | var _this = this;
|
24828 | return nodes.map(function (node) {
|
24829 | var children;
|
24830 | if (node.hasChildren()) {
|
24831 | children = _this.copy(node.children);
|
24832 | }
|
24833 | return new NbTreeGridPresentationNode(node.data, children, node.expanded, node.level);
|
24834 | });
|
24835 | };
|
24836 | NbTreeGridDataService.decorators = [
|
24837 | { type: i0.Injectable }
|
24838 | ];
|
24839 | return NbTreeGridDataService;
|
24840 | }());
|
24841 |
|
24842 |
|
24843 |
|
24844 |
|
24845 |
|
24846 |
|
24847 |
|
24848 |
|
24849 |
|
24850 |
|
24851 | var NbTreeGridFilterService = (function () {
|
24852 | function NbTreeGridFilterService() {
|
24853 | }
|
24854 | NbTreeGridFilterService.prototype.filter = function (query, data) {
|
24855 | var _this = this;
|
24856 | if (!query) {
|
24857 | return data;
|
24858 | }
|
24859 | return data.reduce(function (filtered, node) {
|
24860 | var filteredChildren;
|
24861 | if (node.children) {
|
24862 | filteredChildren = _this.filter(query, node.children);
|
24863 | node.children = filteredChildren;
|
24864 | }
|
24865 | node.expanded = false;
|
24866 | if (filteredChildren && filteredChildren.length) {
|
24867 | node.expanded = true;
|
24868 | filtered.push(node);
|
24869 | }
|
24870 | else if (_this.filterPredicate(node.data, query)) {
|
24871 | filtered.push(node);
|
24872 | }
|
24873 | return filtered;
|
24874 | }, []);
|
24875 | };
|
24876 | NbTreeGridFilterService.prototype.filterPredicate = function (data, searchQuery) {
|
24877 | var preparedQuery = searchQuery.trim().toLocaleLowerCase();
|
24878 | for (var _i = 0, _a = Object.values(data); _i < _a.length; _i++) {
|
24879 | var val = _a[_i];
|
24880 | var preparedVal = ("" + val).trim().toLocaleLowerCase();
|
24881 | if (preparedVal.includes(preparedQuery)) {
|
24882 | return true;
|
24883 | }
|
24884 | }
|
24885 | return false;
|
24886 | };
|
24887 | NbTreeGridFilterService.decorators = [
|
24888 | { type: i0.Injectable }
|
24889 | ];
|
24890 | return NbTreeGridFilterService;
|
24891 | }());
|
24892 |
|
24893 |
|
24894 |
|
24895 |
|
24896 |
|
24897 |
|
24898 |
|
24899 | (function (NbSortDirection) {
|
24900 | NbSortDirection["ASCENDING"] = "asc";
|
24901 | NbSortDirection["DESCENDING"] = "desc";
|
24902 | NbSortDirection["NONE"] = "";
|
24903 | })(exports.NbSortDirection || (exports.NbSortDirection = {}));
|
24904 | var sortDirections = [
|
24905 | exports.NbSortDirection.ASCENDING,
|
24906 | exports.NbSortDirection.DESCENDING,
|
24907 | exports.NbSortDirection.NONE,
|
24908 | ];
|
24909 |
|
24910 |
|
24911 |
|
24912 | var NbSortDirective = (function () {
|
24913 | function NbSortDirective() {
|
24914 | this.sort = new i0.EventEmitter();
|
24915 | }
|
24916 | NbSortDirective.prototype.emitSort = function (sortRequest) {
|
24917 | if (this.sortable && this.sortable.sort) {
|
24918 | this.sortable.sort(sortRequest);
|
24919 | }
|
24920 | this.sort.emit(sortRequest);
|
24921 | };
|
24922 | NbSortDirective.decorators = [
|
24923 | { type: i0.Directive, args: [{ selector: '[nbSort]' },] }
|
24924 | ];
|
24925 | NbSortDirective.propDecorators = {
|
24926 | sortable: [{ type: i0.Input, args: ['nbSort',] }],
|
24927 | sort: [{ type: i0.Output }]
|
24928 | };
|
24929 | return NbSortDirective;
|
24930 | }());
|
24931 |
|
24932 |
|
24933 |
|
24934 |
|
24935 |
|
24936 | var NbSortHeaderIconDirective = (function () {
|
24937 | function NbSortHeaderIconDirective() {
|
24938 | }
|
24939 | NbSortHeaderIconDirective.decorators = [
|
24940 | { type: i0.Directive, args: [{ selector: '[nbSortHeaderIcon]' },] }
|
24941 | ];
|
24942 | return NbSortHeaderIconDirective;
|
24943 | }());
|
24944 | var NbSortIconComponent = (function () {
|
24945 | function NbSortIconComponent() {
|
24946 | this.direction = exports.NbSortDirection.NONE;
|
24947 | }
|
24948 | NbSortIconComponent.prototype.isAscending = function () {
|
24949 | return this.direction === exports.NbSortDirection.ASCENDING;
|
24950 | };
|
24951 | NbSortIconComponent.prototype.isDescending = function () {
|
24952 | return this.direction === exports.NbSortDirection.DESCENDING;
|
24953 | };
|
24954 | NbSortIconComponent.prototype.isDirectionSet = function () {
|
24955 | return this.isAscending() || this.isDescending();
|
24956 | };
|
24957 | NbSortIconComponent.decorators = [
|
24958 | { type: i0.Component, args: [{
|
24959 | selector: 'nb-sort-icon',
|
24960 | template: "\n <ng-container *ngIf=\"isDirectionSet()\">\n <nb-icon *ngIf=\"isAscending()\" icon=\"chevron-down-outline\" pack=\"nebular-essentials\" aria-hidden=\"true\"></nb-icon>\n <nb-icon *ngIf=\"isDescending()\" icon=\"chevron-up-outline\" pack=\"nebular-essentials\" aria-hidden=\"true\"></nb-icon>\n </ng-container>\n "
|
24961 | },] }
|
24962 | ];
|
24963 | NbSortIconComponent.propDecorators = {
|
24964 | direction: [{ type: i0.Input }]
|
24965 | };
|
24966 | return NbSortIconComponent;
|
24967 | }());
|
24968 |
|
24969 |
|
24970 |
|
24971 | var NbSortHeaderComponent = (function () {
|
24972 | function NbSortHeaderComponent(sort, columnDef) {
|
24973 | this.sort = sort;
|
24974 | this.columnDef = columnDef;
|
24975 | this.disabledValue = false;
|
24976 | }
|
24977 | Object.defineProperty(NbSortHeaderComponent.prototype, "disabled", {
|
24978 | get: function () {
|
24979 | return this.disabledValue;
|
24980 | },
|
24981 | |
24982 |
|
24983 |
|
24984 | set: function (value) {
|
24985 | this.disabledValue = convertToBoolProperty(value);
|
24986 | },
|
24987 | enumerable: false,
|
24988 | configurable: true
|
24989 | });
|
24990 | NbSortHeaderComponent.prototype.sortIfEnabled = function () {
|
24991 | if (!this.disabled) {
|
24992 | this.sortData();
|
24993 | }
|
24994 | };
|
24995 | NbSortHeaderComponent.prototype.isAscending = function () {
|
24996 | return this.direction === exports.NbSortDirection.ASCENDING;
|
24997 | };
|
24998 | NbSortHeaderComponent.prototype.isDescending = function () {
|
24999 | return this.direction === exports.NbSortDirection.DESCENDING;
|
25000 | };
|
25001 | NbSortHeaderComponent.prototype.sortData = function () {
|
25002 | var sortRequest = this.createSortRequest();
|
25003 | this.sort.emitSort(sortRequest);
|
25004 | };
|
25005 | NbSortHeaderComponent.prototype.getIconContext = function () {
|
25006 | return {
|
25007 | $implicit: this.direction,
|
25008 | isAscending: this.isAscending(),
|
25009 | isDescending: this.isDescending(),
|
25010 | isNone: !this.isAscending() && !this.isDescending(),
|
25011 | };
|
25012 | };
|
25013 | NbSortHeaderComponent.prototype.getDisabledAttributeValue = function () {
|
25014 | return this.disabled ? '' : null;
|
25015 | };
|
25016 | NbSortHeaderComponent.prototype.createSortRequest = function () {
|
25017 | this.direction = this.getNextDirection();
|
25018 | return { direction: this.direction, column: this.columnDef.name };
|
25019 | };
|
25020 | NbSortHeaderComponent.prototype.getNextDirection = function () {
|
25021 | var sortDirectionCycle = sortDirections;
|
25022 | var nextDirectionIndex = sortDirectionCycle.indexOf(this.direction) + 1;
|
25023 | if (nextDirectionIndex >= sortDirectionCycle.length) {
|
25024 | nextDirectionIndex = 0;
|
25025 | }
|
25026 | return sortDirectionCycle[nextDirectionIndex];
|
25027 | };
|
25028 | NbSortHeaderComponent.decorators = [
|
25029 | { type: i0.Component, args: [{
|
25030 | selector: '[nbSortHeader]',
|
25031 | template: "\n <button\n class=\"nb-tree-grid-header-change-sort-button\"\n type=\"button\"\n [attr.disabled]=\"getDisabledAttributeValue()\"\n (click)=\"sortData()\">\n <ng-content></ng-content>\n </button>\n <nb-sort-icon *ngIf=\"!sortIcon; else customIcon\" [direction]=\"direction\"></nb-sort-icon>\n <ng-template #customIcon [ngTemplateOutlet]=\"sortIcon\" [ngTemplateOutletContext]=\"getIconContext()\"></ng-template>\n "
|
25032 | },] }
|
25033 | ];
|
25034 | NbSortHeaderComponent.ctorParameters = function () { return [
|
25035 | { type: NbSortDirective },
|
25036 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_SORT_HEADER_COLUMN_DEF,] }] }
|
25037 | ]; };
|
25038 | NbSortHeaderComponent.propDecorators = {
|
25039 | sortIcon: [{ type: i0.ContentChild, args: [NbSortHeaderIconDirective, { read: i0.TemplateRef },] }],
|
25040 | direction: [{ type: i0.Input, args: ['nbSortHeader',] }],
|
25041 | disabled: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.disabled',] }],
|
25042 | sortIfEnabled: [{ type: i0.HostListener, args: ['click',] }]
|
25043 | };
|
25044 | return NbSortHeaderComponent;
|
25045 | }());
|
25046 |
|
25047 |
|
25048 |
|
25049 |
|
25050 |
|
25051 |
|
25052 |
|
25053 |
|
25054 |
|
25055 |
|
25056 | var NbTreeGridSortService = (function () {
|
25057 | function NbTreeGridSortService() {
|
25058 | }
|
25059 | NbTreeGridSortService.prototype.sort = function (request, data) {
|
25060 | var _this = this;
|
25061 | if (!request) {
|
25062 | return data;
|
25063 | }
|
25064 | var sorted = data.sort(function (na, nb) { return _this.comparator(request, na, nb); });
|
25065 | for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {
|
25066 | var node = data_1[_i];
|
25067 | if (node.children) {
|
25068 | node.children = this.sort(request, node.children);
|
25069 | }
|
25070 | }
|
25071 | return sorted;
|
25072 | };
|
25073 | NbTreeGridSortService.prototype.comparator = function (request, na, nb) {
|
25074 | var key = request.column;
|
25075 | var dir = request.direction;
|
25076 | var a = na.data[key];
|
25077 | var b = nb.data[key];
|
25078 | var res = 0;
|
25079 | if (a > b) {
|
25080 | res = 1;
|
25081 | }
|
25082 | if (a < b) {
|
25083 | res = -1;
|
25084 | }
|
25085 | return dir === exports.NbSortDirection.ASCENDING ? res : res * -1;
|
25086 | };
|
25087 | NbTreeGridSortService.decorators = [
|
25088 | { type: i0.Injectable }
|
25089 | ];
|
25090 | return NbTreeGridSortService;
|
25091 | }());
|
25092 |
|
25093 |
|
25094 |
|
25095 |
|
25096 |
|
25097 |
|
25098 | var NbTreeGridService = (function () {
|
25099 | function NbTreeGridService() {
|
25100 | }
|
25101 | NbTreeGridService.prototype.expand = function (data, row, options) {
|
25102 | var _this = this;
|
25103 | if (options === void 0) { options = {}; }
|
25104 | var node = this.find(data, row);
|
25105 | node.expanded = true;
|
25106 | if (options.deep && node.hasChildren()) {
|
25107 | node.children.forEach(function (n) { return _this.expand(data, n.data, options); });
|
25108 | }
|
25109 | };
|
25110 | NbTreeGridService.prototype.collapse = function (data, row, options) {
|
25111 | var _this = this;
|
25112 | if (options === void 0) { options = {}; }
|
25113 | var node = this.find(data, row);
|
25114 | node.expanded = false;
|
25115 | if (options.deep && node.hasChildren()) {
|
25116 | node.children.forEach(function (n) { return _this.collapse(data, n.data, options); });
|
25117 | }
|
25118 | };
|
25119 | NbTreeGridService.prototype.toggle = function (data, row, options) {
|
25120 | if (options === void 0) { options = {}; }
|
25121 | var node = this.find(data, row);
|
25122 | if (node.expanded) {
|
25123 | this.collapse(data, row, options);
|
25124 | }
|
25125 | else {
|
25126 | this.expand(data, row, options);
|
25127 | }
|
25128 | };
|
25129 | NbTreeGridService.prototype.find = function (data, row) {
|
25130 | var toCheck = tslib.__spreadArray([], data);
|
25131 | for (var _i = 0, toCheck_1 = toCheck; _i < toCheck_1.length; _i++) {
|
25132 | var node = toCheck_1[_i];
|
25133 | if (node.data === row) {
|
25134 | return node;
|
25135 | }
|
25136 | if (node.hasChildren()) {
|
25137 | toCheck.push.apply(toCheck, node.children);
|
25138 | }
|
25139 | }
|
25140 | };
|
25141 | NbTreeGridService.decorators = [
|
25142 | { type: i0.Injectable }
|
25143 | ];
|
25144 | return NbTreeGridService;
|
25145 | }());
|
25146 |
|
25147 |
|
25148 |
|
25149 |
|
25150 |
|
25151 |
|
25152 | var NbTreeGridDataSource = (function (_super) {
|
25153 | tslib.__extends(NbTreeGridDataSource, _super);
|
25154 | function NbTreeGridDataSource(sortService, filterService, treeGridService, treeGridDataService) {
|
25155 | var _this = _super.call(this) || this;
|
25156 | _this.sortService = sortService;
|
25157 | _this.filterService = filterService;
|
25158 | _this.treeGridService = treeGridService;
|
25159 | _this.treeGridDataService = treeGridDataService;
|
25160 |
|
25161 | _this.renderData = new rxjs.BehaviorSubject([]);
|
25162 | _this.filterRequest = new rxjs.BehaviorSubject('');
|
25163 | _this.sortRequest = new rxjs.BehaviorSubject(null);
|
25164 | return _this;
|
25165 | }
|
25166 | NbTreeGridDataSource.prototype.setData = function (data, customGetters) {
|
25167 | var presentationData = [];
|
25168 | if (data) {
|
25169 | presentationData = this.treeGridDataService.toPresentationNodes(data, customGetters);
|
25170 | }
|
25171 | this.data = new rxjs.BehaviorSubject(presentationData);
|
25172 | this.updateChangeSubscription();
|
25173 | };
|
25174 | NbTreeGridDataSource.prototype.connect = function (collectionViewer) {
|
25175 | return this.renderData;
|
25176 | };
|
25177 | NbTreeGridDataSource.prototype.disconnect = function (collectionViewer) {
|
25178 | };
|
25179 | NbTreeGridDataSource.prototype.expand = function (row) {
|
25180 | this.treeGridService.expand(this.data.value, row);
|
25181 | this.data.next(this.data.value);
|
25182 | };
|
25183 | NbTreeGridDataSource.prototype.collapse = function (row) {
|
25184 | this.treeGridService.collapse(this.data.value, row);
|
25185 | this.data.next(this.data.value);
|
25186 | };
|
25187 | NbTreeGridDataSource.prototype.toggle = function (row, options) {
|
25188 | this.treeGridService.toggle(this.data.value, row, options);
|
25189 | this.data.next(this.data.value);
|
25190 | };
|
25191 | NbTreeGridDataSource.prototype.toggleByIndex = function (dataIndex, options) {
|
25192 | var node = this.renderData.value && this.renderData.value[dataIndex];
|
25193 | if (node) {
|
25194 | this.toggle(node.data, options);
|
25195 | }
|
25196 | };
|
25197 | NbTreeGridDataSource.prototype.getLevel = function (rowIndex) {
|
25198 | var row = this.renderData.value[rowIndex];
|
25199 | return row ? row.level : NB_DEFAULT_ROW_LEVEL;
|
25200 | };
|
25201 | NbTreeGridDataSource.prototype.sort = function (sortRequest) {
|
25202 | this.sortRequest.next(sortRequest);
|
25203 | };
|
25204 | NbTreeGridDataSource.prototype.filter = function (searchQuery) {
|
25205 | this.filterRequest.next(searchQuery);
|
25206 | };
|
25207 | NbTreeGridDataSource.prototype.updateChangeSubscription = function () {
|
25208 | var _this = this;
|
25209 | var dataStream = this.data;
|
25210 | var filteredData = rxjs.combineLatest([dataStream, this.filterRequest])
|
25211 | .pipe(rxjs_operators.map(function (_a) {
|
25212 | var data = _a[0];
|
25213 | return _this.treeGridDataService.copy(data);
|
25214 | }), rxjs_operators.map(function (data) { return _this.filterData(data); }));
|
25215 | var sortedData = rxjs.combineLatest([filteredData, this.sortRequest])
|
25216 | .pipe(rxjs_operators.map(function (_a) {
|
25217 | var data = _a[0];
|
25218 | return _this.sortData(data);
|
25219 | }));
|
25220 | sortedData
|
25221 | .pipe(rxjs_operators.map(function (data) { return _this.treeGridDataService.flattenExpanded(data); }))
|
25222 | .subscribe(function (data) { return _this.renderData.next(data); });
|
25223 | };
|
25224 | NbTreeGridDataSource.prototype.filterData = function (data) {
|
25225 | return this.filterService.filter(this.filterRequest.value, data);
|
25226 | };
|
25227 | NbTreeGridDataSource.prototype.sortData = function (data) {
|
25228 | return this.sortService.sort(this.sortRequest.value, data);
|
25229 | };
|
25230 | return NbTreeGridDataSource;
|
25231 | }(NbDataSource));
|
25232 | var NbTreeGridDataSourceBuilder = (function () {
|
25233 | function NbTreeGridDataSourceBuilder(filterService, sortService, treeGridService, treeGridDataService) {
|
25234 | this.filterService = filterService;
|
25235 | this.sortService = sortService;
|
25236 | this.treeGridService = treeGridService;
|
25237 | this.treeGridDataService = treeGridDataService;
|
25238 | }
|
25239 | NbTreeGridDataSourceBuilder.prototype.create = function (data, customGetters) {
|
25240 | var dataSource = new NbTreeGridDataSource(this.sortService, this.filterService, this.treeGridService, this.treeGridDataService);
|
25241 | dataSource.setData(data, customGetters);
|
25242 | return dataSource;
|
25243 | };
|
25244 | NbTreeGridDataSourceBuilder.decorators = [
|
25245 | { type: i0.Injectable }
|
25246 | ];
|
25247 | NbTreeGridDataSourceBuilder.ctorParameters = function () { return [
|
25248 | { type: NbTreeGridFilterService },
|
25249 | { type: NbTreeGridSortService },
|
25250 | { type: NbTreeGridService },
|
25251 | { type: NbTreeGridDataService }
|
25252 | ]; };
|
25253 | return NbTreeGridDataSourceBuilder;
|
25254 | }());
|
25255 |
|
25256 |
|
25257 |
|
25258 |
|
25259 |
|
25260 |
|
25261 | var NB_TREE_GRID = new i0.InjectionToken('NB_TREE_GRID');
|
25262 |
|
25263 | var NbColumnsService = (function () {
|
25264 | function NbColumnsService(differs) {
|
25265 | this.differs = differs;
|
25266 | this.columnHide$ = new rxjs.Subject();
|
25267 | this.columnShow$ = new rxjs.Subject();
|
25268 | }
|
25269 | NbColumnsService.prototype.setColumns = function (columns) {
|
25270 | if (!this.changesDiffer) {
|
25271 | this.changesDiffer = this.differs.find(columns || []).create();
|
25272 | }
|
25273 | if (this.changesDiffer.diff(columns)) {
|
25274 | this.allColumns = Array.from(columns);
|
25275 | this.visibleColumns = Array.from(columns);
|
25276 | }
|
25277 | };
|
25278 | NbColumnsService.prototype.getVisibleColumns = function () {
|
25279 | return this.visibleColumns;
|
25280 | };
|
25281 | NbColumnsService.prototype.hideColumn = function (column) {
|
25282 | var toRemove = this.visibleColumns.indexOf(column);
|
25283 | if (toRemove > -1) {
|
25284 | this.visibleColumns.splice(toRemove, 1);
|
25285 | this.columnHide$.next();
|
25286 | }
|
25287 | };
|
25288 | NbColumnsService.prototype.showColumn = function (column) {
|
25289 | if (this.visibleColumns.includes(column)) {
|
25290 | return;
|
25291 | }
|
25292 | this.visibleColumns.splice(this.findInsertIndex(column), 0, column);
|
25293 | this.columnShow$.next();
|
25294 | };
|
25295 | NbColumnsService.prototype.onColumnsChange = function () {
|
25296 | return rxjs.merge(this.columnShow$, this.columnHide$);
|
25297 | };
|
25298 | NbColumnsService.prototype.findInsertIndex = function (column) {
|
25299 | var initialIndex = this.allColumns.indexOf(column);
|
25300 | if (initialIndex === 0 || !this.visibleColumns.length) {
|
25301 | return 0;
|
25302 | }
|
25303 | if (initialIndex === this.allColumns.length - 1) {
|
25304 | return this.visibleColumns.length;
|
25305 | }
|
25306 | var leftSiblingIndex = initialIndex - 1;
|
25307 | for (var i = leftSiblingIndex; i >= 0; i--) {
|
25308 | var leftSibling = this.allColumns[i];
|
25309 | var index = this.visibleColumns.indexOf(leftSibling);
|
25310 | if (index !== -1) {
|
25311 | return index + 1;
|
25312 | }
|
25313 | }
|
25314 | var rightSiblingIndex = initialIndex + 1;
|
25315 | for (var i = rightSiblingIndex; i < this.allColumns.length; i++) {
|
25316 | var rightSibling = this.allColumns[i];
|
25317 | var index = this.visibleColumns.indexOf(rightSibling);
|
25318 | if (index !== -1) {
|
25319 | return index;
|
25320 | }
|
25321 | }
|
25322 | throw new Error("Can't restore column position.");
|
25323 | };
|
25324 | NbColumnsService.decorators = [
|
25325 | { type: i0.Injectable }
|
25326 | ];
|
25327 | NbColumnsService.ctorParameters = function () { return [
|
25328 | { type: i0.IterableDiffers }
|
25329 | ]; };
|
25330 | return NbColumnsService;
|
25331 | }());
|
25332 |
|
25333 |
|
25334 |
|
25335 |
|
25336 |
|
25337 |
|
25338 |
|
25339 |
|
25340 |
|
25341 |
|
25342 |
|
25343 |
|
25344 |
|
25345 |
|
25346 |
|
25347 |
|
25348 |
|
25349 |
|
25350 |
|
25351 |
|
25352 |
|
25353 |
|
25354 |
|
25355 |
|
25356 |
|
25357 |
|
25358 |
|
25359 |
|
25360 |
|
25361 |
|
25362 |
|
25363 |
|
25364 |
|
25365 |
|
25366 |
|
25367 |
|
25368 |
|
25369 |
|
25370 |
|
25371 |
|
25372 |
|
25373 |
|
25374 |
|
25375 |
|
25376 |
|
25377 |
|
25378 |
|
25379 |
|
25380 |
|
25381 |
|
25382 |
|
25383 |
|
25384 |
|
25385 |
|
25386 |
|
25387 |
|
25388 |
|
25389 |
|
25390 |
|
25391 |
|
25392 |
|
25393 |
|
25394 |
|
25395 |
|
25396 |
|
25397 |
|
25398 |
|
25399 |
|
25400 |
|
25401 |
|
25402 |
|
25403 |
|
25404 |
|
25405 |
|
25406 |
|
25407 |
|
25408 |
|
25409 |
|
25410 |
|
25411 |
|
25412 |
|
25413 |
|
25414 |
|
25415 |
|
25416 |
|
25417 |
|
25418 |
|
25419 |
|
25420 |
|
25421 |
|
25422 |
|
25423 |
|
25424 | var NbTreeGridComponent = (function (_super) {
|
25425 | tslib.__extends(NbTreeGridComponent, _super);
|
25426 | function NbTreeGridComponent(dataSourceBuilder, differs, changeDetectorRef, elementRef, role, dir, document, platform, window, _viewRepeater, _coalescedStyleScheduler, _viewportRuler, _stickyPositioningListener) {
|
25427 | var _this = _super.call(this, differs, changeDetectorRef, elementRef, role, dir, document, platform, _viewRepeater, _coalescedStyleScheduler, _viewportRuler, _stickyPositioningListener) || this;
|
25428 | _this.dataSourceBuilder = dataSourceBuilder;
|
25429 | _this.window = window;
|
25430 | _this._viewRepeater = _viewRepeater;
|
25431 | _this._coalescedStyleScheduler = _coalescedStyleScheduler;
|
25432 | _this._stickyPositioningListener = _stickyPositioningListener;
|
25433 | _this.destroy$ = new rxjs.Subject();
|
25434 | _this.levelPadding = '';
|
25435 | _this.equalColumnsWidthValue = false;
|
25436 | _this.treeClass = true;
|
25437 | _this.platform = platform;
|
25438 | return _this;
|
25439 | }
|
25440 | Object.defineProperty(NbTreeGridComponent.prototype, "source", {
|
25441 | |
25442 |
|
25443 |
|
25444 |
|
25445 |
|
25446 | set: function (data) {
|
25447 | if (!data) {
|
25448 | return;
|
25449 | }
|
25450 | if (data instanceof NbTreeGridDataSource) {
|
25451 | this._source = data;
|
25452 | }
|
25453 | else {
|
25454 | this._source = this.dataSourceBuilder.create(data);
|
25455 | }
|
25456 | this.dataSource = this._source;
|
25457 | },
|
25458 | enumerable: false,
|
25459 | configurable: true
|
25460 | });
|
25461 | Object.defineProperty(NbTreeGridComponent.prototype, "equalColumnsWidth", {
|
25462 | get: function () {
|
25463 | return this.equalColumnsWidthValue;
|
25464 | },
|
25465 | |
25466 |
|
25467 |
|
25468 | set: function (value) {
|
25469 | this.equalColumnsWidthValue = convertToBoolProperty(value);
|
25470 | },
|
25471 | enumerable: false,
|
25472 | configurable: true
|
25473 | });
|
25474 | NbTreeGridComponent.prototype.ngAfterViewInit = function () {
|
25475 | var _this = this;
|
25476 | this.checkDefsCount();
|
25477 | var rowsChange$ = rxjs.merge(this._contentRowDefs.changes, this._contentHeaderRowDefs.changes, this._contentFooterRowDefs.changes);
|
25478 | rowsChange$.pipe(rxjs_operators.takeUntil(this.destroy$))
|
25479 | .subscribe(function () { return _this.checkDefsCount(); });
|
25480 | if (this.platform.isBrowser) {
|
25481 | this.updateVisibleColumns();
|
25482 | var windowResize$ = rxjs.fromEvent(this.window, 'resize').pipe(rxjs_operators.debounceTime(50));
|
25483 | rxjs.merge(rowsChange$, this._contentColumnDefs.changes, windowResize$)
|
25484 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
25485 | .subscribe(function () { return _this.updateVisibleColumns(); });
|
25486 | }
|
25487 | };
|
25488 | NbTreeGridComponent.prototype.ngOnDestroy = function () {
|
25489 | _super.prototype.ngOnDestroy.call(this);
|
25490 | this.destroy$.next();
|
25491 | this.destroy$.complete();
|
25492 | };
|
25493 | NbTreeGridComponent.prototype.toggleRow = function (row, options) {
|
25494 | var context = this.getRowContext(row);
|
25495 | this._source.toggle(context.$implicit.data, options);
|
25496 | };
|
25497 | NbTreeGridComponent.prototype.toggleCellRow = function (cell) {
|
25498 | var context = this.getCellContext(cell);
|
25499 | this._source.toggle(context.$implicit.data);
|
25500 | };
|
25501 | NbTreeGridComponent.prototype.getColumnWidth = function () {
|
25502 | if (this.equalColumnsWidth) {
|
25503 | return 100 / this.getColumnsCount() + "%";
|
25504 | }
|
25505 | return '';
|
25506 | };
|
25507 | NbTreeGridComponent.prototype.getCellLevel = function (cell, columnName) {
|
25508 | if (this.isFirstColumn(columnName)) {
|
25509 | return this.getCellContext(cell).$implicit.level;
|
25510 | }
|
25511 | return NB_DEFAULT_ROW_LEVEL;
|
25512 | };
|
25513 | NbTreeGridComponent.prototype.getRowContext = function (row) {
|
25514 | return this.getContextByRowEl(row.elementRef.nativeElement);
|
25515 | };
|
25516 | NbTreeGridComponent.prototype.getCellContext = function (cell) {
|
25517 | return this.getContextByCellEl(cell.elementRef.nativeElement);
|
25518 | };
|
25519 | NbTreeGridComponent.prototype.getContextByCellEl = function (cellEl) {
|
25520 | return this.getContextByRowEl(cellEl.parentElement);
|
25521 | };
|
25522 | NbTreeGridComponent.prototype.getContextByRowEl = function (rowEl) {
|
25523 | var rowsContainer = this._rowOutlet.viewContainer;
|
25524 | for (var i = 0; i < rowsContainer.length; i++) {
|
25525 | var rowViewRef = rowsContainer.get(i);
|
25526 | if (rowViewRef.rootNodes.includes(rowEl)) {
|
25527 | return rowViewRef.context;
|
25528 | }
|
25529 | }
|
25530 | };
|
25531 | NbTreeGridComponent.prototype.getColumns = function () {
|
25532 | var rowDef;
|
25533 | if (this._contentHeaderRowDefs.length) {
|
25534 | rowDef = this._contentHeaderRowDefs.first;
|
25535 | }
|
25536 | else {
|
25537 | rowDef = this._contentRowDefs.first;
|
25538 | }
|
25539 | return Array.from(rowDef.getVisibleColumns() || []);
|
25540 | };
|
25541 | NbTreeGridComponent.prototype.getColumnsCount = function () {
|
25542 | return this.getColumns().length;
|
25543 | };
|
25544 | NbTreeGridComponent.prototype.isFirstColumn = function (columnName) {
|
25545 | return this.getColumns()[0] === columnName;
|
25546 | };
|
25547 | NbTreeGridComponent.prototype.checkDefsCount = function () {
|
25548 | if (this._contentRowDefs.length > 1) {
|
25549 | throw new Error("Found multiple row definitions");
|
25550 | }
|
25551 | if (this._contentHeaderRowDefs.length > 1) {
|
25552 | throw new Error("Found multiple header row definitions");
|
25553 | }
|
25554 | if (this._contentFooterRowDefs.length > 1) {
|
25555 | throw new Error("Found multiple footer row definitions");
|
25556 | }
|
25557 | };
|
25558 | NbTreeGridComponent.prototype.updateVisibleColumns = function () {
|
25559 | var width = this.window.innerWidth;
|
25560 | var columnDefs = this._contentColumnDefs;
|
25561 | var columnsToHide = columnDefs
|
25562 | .filter(function (col) { return col.shouldHide(width); })
|
25563 | .map(function (col) { return col.name; });
|
25564 | var columnsToShow = columnDefs
|
25565 | .filter(function (col) { return col.shouldShow(width); })
|
25566 | .map(function (col) { return col.name; });
|
25567 | if (!columnsToHide.length && !columnsToShow.length) {
|
25568 | return;
|
25569 | }
|
25570 | var rowDefs = [
|
25571 | this._contentHeaderRowDefs.first,
|
25572 | this._contentRowDefs.first,
|
25573 | this._contentFooterRowDefs.first,
|
25574 | ].filter(function (d) { return !!d; });
|
25575 | for (var _i = 0, rowDefs_1 = rowDefs; _i < rowDefs_1.length; _i++) {
|
25576 | var rowDef = rowDefs_1[_i];
|
25577 | for (var _a = 0, columnsToHide_1 = columnsToHide; _a < columnsToHide_1.length; _a++) {
|
25578 | var column = columnsToHide_1[_a];
|
25579 | rowDef.hideColumn(column);
|
25580 | }
|
25581 | for (var _b = 0, columnsToShow_1 = columnsToShow; _b < columnsToShow_1.length; _b++) {
|
25582 | var column = columnsToShow_1[_b];
|
25583 | rowDef.showColumn(column);
|
25584 | }
|
25585 | }
|
25586 | };
|
25587 | NbTreeGridComponent.decorators = [
|
25588 | { type: i0.Component, args: [{
|
25589 | selector: 'table[nbTreeGrid]',
|
25590 | template: NB_TABLE_TEMPLATE,
|
25591 | providers: tslib.__spreadArray([
|
25592 | { provide: NB_TREE_GRID, useExisting: NbTreeGridComponent },
|
25593 | NbColumnsService
|
25594 | ], NB_TABLE_PROVIDERS),
|
25595 | styles: [":host{table-layout:fixed;border-spacing:0;border-collapse:collapse;width:100%;max-width:100%;overflow:auto}::ng-deep .nb-tree-grid-cell,::ng-deep .nb-tree-grid-header-cell,::ng-deep .nb-tree-grid-footer-cell{overflow:hidden}\n"]
|
25596 | },] }
|
25597 | ];
|
25598 | NbTreeGridComponent.ctorParameters = function () { return [
|
25599 | { type: NbTreeGridDataSourceBuilder },
|
25600 | { type: i0.IterableDiffers },
|
25601 | { type: i0.ChangeDetectorRef },
|
25602 | { type: i0.ElementRef },
|
25603 | { type: String, decorators: [{ type: i0.Attribute, args: ['role',] }] },
|
25604 | { type: NbDirectionality },
|
25605 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_DOCUMENT,] }] },
|
25606 | { type: NbPlatform },
|
25607 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_WINDOW,] }] },
|
25608 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_VIEW_REPEATER_STRATEGY,] }] },
|
25609 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_COALESCED_STYLE_SCHEDULER,] }] },
|
25610 | { type: NbViewportRulerAdapter },
|
25611 | { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }, { type: i0.Inject, args: [NB_STICKY_POSITIONING_LISTENER,] }] }
|
25612 | ]; };
|
25613 | NbTreeGridComponent.propDecorators = {
|
25614 | source: [{ type: i0.Input, args: ['nbTreeGrid',] }],
|
25615 | levelPadding: [{ type: i0.Input }],
|
25616 | equalColumnsWidth: [{ type: i0.Input }],
|
25617 | treeClass: [{ type: i0.HostBinding, args: ['class.nb-tree-grid',] }]
|
25618 | };
|
25619 | return NbTreeGridComponent;
|
25620 | }(NbTable));
|
25621 |
|
25622 |
|
25623 |
|
25624 |
|
25625 |
|
25626 | var NbTreeGridRowDefDirective = (function (_super) {
|
25627 | tslib.__extends(NbTreeGridRowDefDirective, _super);
|
25628 | function NbTreeGridRowDefDirective(template, differs, columnsService) {
|
25629 | var _this = _super.call(this, template, differs) || this;
|
25630 | _this.columnsService = columnsService;
|
25631 | return _this;
|
25632 | }
|
25633 | NbTreeGridRowDefDirective.prototype.ngOnChanges = function (changes) {
|
25634 | _super.prototype.ngOnChanges.call(this, changes);
|
25635 | if (changes['columns']) {
|
25636 | this.updateColumns(this.columns);
|
25637 | }
|
25638 | };
|
25639 | NbTreeGridRowDefDirective.prototype.updateColumns = function (columns) {
|
25640 | this.columnsService.setColumns(columns);
|
25641 | };
|
25642 | NbTreeGridRowDefDirective.prototype.getVisibleColumns = function () {
|
25643 | return this.columnsService.getVisibleColumns();
|
25644 | };
|
25645 |
|
25646 | NbTreeGridRowDefDirective.prototype.hideColumn = function (column) {
|
25647 | this.columnsService.hideColumn(column);
|
25648 | };
|
25649 |
|
25650 | NbTreeGridRowDefDirective.prototype.showColumn = function (column) {
|
25651 | this.columnsService.showColumn(column);
|
25652 | };
|
25653 | NbTreeGridRowDefDirective.decorators = [
|
25654 | { type: i0.Directive, args: [{
|
25655 | selector: '[nbTreeGridRowDef]',
|
25656 | providers: [{ provide: NbCdkRowDef, useExisting: NbTreeGridRowDefDirective }],
|
25657 | },] }
|
25658 | ];
|
25659 | NbTreeGridRowDefDirective.ctorParameters = function () { return [
|
25660 | { type: i0.TemplateRef },
|
25661 | { type: i0.IterableDiffers },
|
25662 | { type: NbColumnsService }
|
25663 | ]; };
|
25664 | NbTreeGridRowDefDirective.propDecorators = {
|
25665 | columns: [{ type: i0.Input, args: ['nbTreeGridRowDefColumns',] }]
|
25666 | };
|
25667 | return NbTreeGridRowDefDirective;
|
25668 | }(NbRowDefDirective));
|
25669 | var NbTreeGridHeaderRowDefDirective = (function (_super) {
|
25670 | tslib.__extends(NbTreeGridHeaderRowDefDirective, _super);
|
25671 | function NbTreeGridHeaderRowDefDirective(template, differs, columnsService) {
|
25672 | var _this = _super.call(this, template, differs) || this;
|
25673 | _this.columnsService = columnsService;
|
25674 | return _this;
|
25675 | }
|
25676 | NbTreeGridHeaderRowDefDirective.prototype.ngOnChanges = function (changes) {
|
25677 | _super.prototype.ngOnChanges.call(this, changes);
|
25678 | if (changes['columns']) {
|
25679 | this.updateColumns(this.columns);
|
25680 | }
|
25681 | };
|
25682 | NbTreeGridHeaderRowDefDirective.prototype.updateColumns = function (columns) {
|
25683 | this.columnsService.setColumns(columns);
|
25684 | };
|
25685 | NbTreeGridHeaderRowDefDirective.prototype.getVisibleColumns = function () {
|
25686 | return this.columnsService.getVisibleColumns();
|
25687 | };
|
25688 |
|
25689 | NbTreeGridHeaderRowDefDirective.prototype.hideColumn = function (column) {
|
25690 | this.columnsService.hideColumn(column);
|
25691 | };
|
25692 |
|
25693 | NbTreeGridHeaderRowDefDirective.prototype.showColumn = function (column) {
|
25694 | this.columnsService.showColumn(column);
|
25695 | };
|
25696 | NbTreeGridHeaderRowDefDirective.decorators = [
|
25697 | { type: i0.Directive, args: [{
|
25698 | selector: '[nbTreeGridHeaderRowDef]',
|
25699 | providers: [{ provide: NbCdkHeaderRowDef, useExisting: NbTreeGridHeaderRowDefDirective }],
|
25700 | },] }
|
25701 | ];
|
25702 | NbTreeGridHeaderRowDefDirective.ctorParameters = function () { return [
|
25703 | { type: i0.TemplateRef },
|
25704 | { type: i0.IterableDiffers },
|
25705 | { type: NbColumnsService }
|
25706 | ]; };
|
25707 | NbTreeGridHeaderRowDefDirective.propDecorators = {
|
25708 | columns: [{ type: i0.Input, args: ['nbTreeGridHeaderRowDef',] }]
|
25709 | };
|
25710 | return NbTreeGridHeaderRowDefDirective;
|
25711 | }(NbHeaderRowDefDirective));
|
25712 | var NbTreeGridFooterRowDefDirective = (function (_super) {
|
25713 | tslib.__extends(NbTreeGridFooterRowDefDirective, _super);
|
25714 | function NbTreeGridFooterRowDefDirective(template, differs, columnsService) {
|
25715 | var _this = _super.call(this, template, differs) || this;
|
25716 | _this.columnsService = columnsService;
|
25717 | return _this;
|
25718 | }
|
25719 | NbTreeGridFooterRowDefDirective.prototype.ngOnChanges = function (changes) {
|
25720 | _super.prototype.ngOnChanges.call(this, changes);
|
25721 | if (changes['columns']) {
|
25722 | this.updateColumns(this.columns);
|
25723 | }
|
25724 | };
|
25725 | NbTreeGridFooterRowDefDirective.prototype.updateColumns = function (columns) {
|
25726 | this.columnsService.setColumns(columns);
|
25727 | };
|
25728 | NbTreeGridFooterRowDefDirective.prototype.getVisibleColumns = function () {
|
25729 | return this.columnsService.getVisibleColumns();
|
25730 | };
|
25731 |
|
25732 | NbTreeGridFooterRowDefDirective.prototype.hideColumn = function (column) {
|
25733 | this.columnsService.hideColumn(column);
|
25734 | };
|
25735 |
|
25736 | NbTreeGridFooterRowDefDirective.prototype.showColumn = function (column) {
|
25737 | this.columnsService.showColumn(column);
|
25738 | };
|
25739 | NbTreeGridFooterRowDefDirective.decorators = [
|
25740 | { type: i0.Directive, args: [{
|
25741 | selector: '[nbTreeGridFooterRowDef]',
|
25742 | providers: [{ provide: NbCdkFooterRowDef, useExisting: NbTreeGridFooterRowDefDirective }],
|
25743 | },] }
|
25744 | ];
|
25745 | NbTreeGridFooterRowDefDirective.ctorParameters = function () { return [
|
25746 | { type: i0.TemplateRef },
|
25747 | { type: i0.IterableDiffers },
|
25748 | { type: NbColumnsService }
|
25749 | ]; };
|
25750 | NbTreeGridFooterRowDefDirective.propDecorators = {
|
25751 | columns: [{ type: i0.Input, args: ['nbTreeGridFooterRowDef',] }]
|
25752 | };
|
25753 | return NbTreeGridFooterRowDefDirective;
|
25754 | }(NbFooterRowDefDirective));
|
25755 |
|
25756 |
|
25757 |
|
25758 |
|
25759 | var NbTreeGridCellDefDirective = (function (_super) {
|
25760 | tslib.__extends(NbTreeGridCellDefDirective, _super);
|
25761 | function NbTreeGridCellDefDirective() {
|
25762 | return _super !== null && _super.apply(this, arguments) || this;
|
25763 | }
|
25764 | NbTreeGridCellDefDirective.decorators = [
|
25765 | { type: i0.Directive, args: [{
|
25766 | selector: '[nbTreeGridCellDef]',
|
25767 | providers: [{ provide: NbCdkCellDef, useExisting: NbTreeGridCellDefDirective }],
|
25768 | },] }
|
25769 | ];
|
25770 | return NbTreeGridCellDefDirective;
|
25771 | }(NbCellDefDirective));
|
25772 |
|
25773 |
|
25774 |
|
25775 |
|
25776 | var NbTreeGridHeaderCellDefDirective = (function (_super) {
|
25777 | tslib.__extends(NbTreeGridHeaderCellDefDirective, _super);
|
25778 | function NbTreeGridHeaderCellDefDirective() {
|
25779 | return _super !== null && _super.apply(this, arguments) || this;
|
25780 | }
|
25781 | NbTreeGridHeaderCellDefDirective.decorators = [
|
25782 | { type: i0.Directive, args: [{
|
25783 | selector: '[nbTreeGridHeaderCellDef]',
|
25784 | providers: [{ provide: NbCdkHeaderCellDef, useExisting: NbTreeGridHeaderCellDefDirective }],
|
25785 | },] }
|
25786 | ];
|
25787 | return NbTreeGridHeaderCellDefDirective;
|
25788 | }(NbHeaderCellDefDirective));
|
25789 |
|
25790 |
|
25791 |
|
25792 |
|
25793 | var NbTreeGridFooterCellDefDirective = (function (_super) {
|
25794 | tslib.__extends(NbTreeGridFooterCellDefDirective, _super);
|
25795 | function NbTreeGridFooterCellDefDirective() {
|
25796 | return _super !== null && _super.apply(this, arguments) || this;
|
25797 | }
|
25798 | NbTreeGridFooterCellDefDirective.decorators = [
|
25799 | { type: i0.Directive, args: [{
|
25800 | selector: '[nbTreeGridFooterCellDef]',
|
25801 | providers: [{ provide: NbCdkFooterCellDef, useExisting: NbTreeGridFooterCellDefDirective }],
|
25802 | },] }
|
25803 | ];
|
25804 | return NbTreeGridFooterCellDefDirective;
|
25805 | }(NbFooterCellDefDirective));
|
25806 |
|
25807 | var NB_ROW_DOUBLE_CLICK_DELAY = 200;
|
25808 |
|
25809 |
|
25810 |
|
25811 | var NbTreeGridRowComponent = (function (_super) {
|
25812 | tslib.__extends(NbTreeGridRowComponent, _super);
|
25813 | function NbTreeGridRowComponent(tree, elementRef) {
|
25814 | var _this = _super.call(this) || this;
|
25815 | _this.elementRef = elementRef;
|
25816 | _this.doubleClick$ = new rxjs.Subject();
|
25817 | |
25818 |
|
25819 |
|
25820 |
|
25821 | _this.doubleClickDelay = NB_ROW_DOUBLE_CLICK_DELAY;
|
25822 | |
25823 |
|
25824 |
|
25825 | _this.clickToToggle = true;
|
25826 | _this.tree = tree;
|
25827 | return _this;
|
25828 | }
|
25829 | NbTreeGridRowComponent.prototype.toggleIfEnabledNode = function () {
|
25830 | var _this = this;
|
25831 | if (!this.clickToToggle) {
|
25832 | return;
|
25833 | }
|
25834 | rxjs.timer(NB_ROW_DOUBLE_CLICK_DELAY)
|
25835 | .pipe(rxjs_operators.take(1), rxjs_operators.takeUntil(this.doubleClick$))
|
25836 | .subscribe(function () { return _this.tree.toggleRow(_this); });
|
25837 | };
|
25838 | NbTreeGridRowComponent.prototype.toggleIfEnabledNodeDeep = function () {
|
25839 | if (!this.clickToToggle) {
|
25840 | return;
|
25841 | }
|
25842 | this.doubleClick$.next();
|
25843 | this.tree.toggleRow(this, { deep: true });
|
25844 | };
|
25845 | NbTreeGridRowComponent.prototype.ngOnDestroy = function () {
|
25846 | this.doubleClick$.complete();
|
25847 | };
|
25848 | NbTreeGridRowComponent.decorators = [
|
25849 | { type: i0.Component, args: [{
|
25850 | selector: 'tr[nbTreeGridRow]',
|
25851 | template: "<ng-container nbCellOutlet></ng-container>",
|
25852 | host: {
|
25853 | 'class': 'nb-tree-grid-row',
|
25854 | 'role': 'row',
|
25855 | },
|
25856 | providers: [{ provide: NbCdkRow, useExisting: NbTreeGridRowComponent }]
|
25857 | },] }
|
25858 | ];
|
25859 | NbTreeGridRowComponent.ctorParameters = function () { return [
|
25860 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_TREE_GRID,] }] },
|
25861 | { type: i0.ElementRef }
|
25862 | ]; };
|
25863 | NbTreeGridRowComponent.propDecorators = {
|
25864 | doubleClickDelay: [{ type: i0.Input }],
|
25865 | clickToToggle: [{ type: i0.Input }],
|
25866 | toggleIfEnabledNode: [{ type: i0.HostListener, args: ['click',] }],
|
25867 | toggleIfEnabledNodeDeep: [{ type: i0.HostListener, args: ['dblclick',] }]
|
25868 | };
|
25869 | return NbTreeGridRowComponent;
|
25870 | }(NbRowComponent));
|
25871 | var NbTreeGridHeaderRowComponent = (function (_super) {
|
25872 | tslib.__extends(NbTreeGridHeaderRowComponent, _super);
|
25873 | function NbTreeGridHeaderRowComponent() {
|
25874 | return _super !== null && _super.apply(this, arguments) || this;
|
25875 | }
|
25876 | NbTreeGridHeaderRowComponent.decorators = [
|
25877 | { type: i0.Component, args: [{
|
25878 | selector: 'tr[nbTreeGridHeaderRow]',
|
25879 | template: "\n <ng-container nbCellOutlet></ng-container>",
|
25880 | host: {
|
25881 | 'class': 'nb-tree-grid-header-row',
|
25882 | 'role': 'row',
|
25883 | },
|
25884 | providers: [{ provide: NbCdkHeaderRow, useExisting: NbTreeGridHeaderRowComponent }]
|
25885 | },] }
|
25886 | ];
|
25887 | return NbTreeGridHeaderRowComponent;
|
25888 | }(NbHeaderRowComponent));
|
25889 | var NbTreeGridFooterRowComponent = (function (_super) {
|
25890 | tslib.__extends(NbTreeGridFooterRowComponent, _super);
|
25891 | function NbTreeGridFooterRowComponent() {
|
25892 | return _super !== null && _super.apply(this, arguments) || this;
|
25893 | }
|
25894 | NbTreeGridFooterRowComponent.decorators = [
|
25895 | { type: i0.Component, args: [{
|
25896 | selector: 'tr[nbTreeGridFooterRow]',
|
25897 | template: "\n <ng-container nbCellOutlet></ng-container>",
|
25898 | host: {
|
25899 | 'class': 'nb-tree-grid-footer-row',
|
25900 | 'role': 'row',
|
25901 | },
|
25902 | providers: [{ provide: NbCdkFooterRow, useExisting: NbTreeGridFooterRowComponent }]
|
25903 | },] }
|
25904 | ];
|
25905 | return NbTreeGridFooterRowComponent;
|
25906 | }(NbFooterRowComponent));
|
25907 |
|
25908 |
|
25909 |
|
25910 |
|
25911 |
|
25912 | var NbTreeGridColumnDefDirective = (function (_super) {
|
25913 | tslib.__extends(NbTreeGridColumnDefDirective, _super);
|
25914 | function NbTreeGridColumnDefDirective() {
|
25915 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
25916 | _this.hideOnValue = null;
|
25917 | _this.showOnValue = null;
|
25918 | return _this;
|
25919 | }
|
25920 | Object.defineProperty(NbTreeGridColumnDefDirective.prototype, "name", {
|
25921 | |
25922 |
|
25923 |
|
25924 | get: function () {
|
25925 | return this._name;
|
25926 | },
|
25927 | set: function (value) {
|
25928 | this._setNameInput(value);
|
25929 | },
|
25930 | enumerable: false,
|
25931 | configurable: true
|
25932 | });
|
25933 | Object.defineProperty(NbTreeGridColumnDefDirective.prototype, "hideOn", {
|
25934 | |
25935 |
|
25936 |
|
25937 |
|
25938 | get: function () {
|
25939 | return this.hideOnValue;
|
25940 | },
|
25941 | set: function (value) {
|
25942 | this.hideOnValue = !value && value !== 0
|
25943 | ? null
|
25944 | : parseInt(value, 10);
|
25945 | },
|
25946 | enumerable: false,
|
25947 | configurable: true
|
25948 | });
|
25949 | Object.defineProperty(NbTreeGridColumnDefDirective.prototype, "showOn", {
|
25950 | |
25951 |
|
25952 |
|
25953 |
|
25954 | get: function () {
|
25955 | return this.showOnValue;
|
25956 | },
|
25957 | set: function (value) {
|
25958 | this.showOnValue = !value && value !== 0
|
25959 | ? null
|
25960 | : parseInt(value, 10);
|
25961 | },
|
25962 | enumerable: false,
|
25963 | configurable: true
|
25964 | });
|
25965 | NbTreeGridColumnDefDirective.prototype.ngOnChanges = function () {
|
25966 | if (this.hideOn != null && this.showOn != null) {
|
25967 | throw new Error("hideOn and showOn are mutually exclusive and can't be used simultaneously.");
|
25968 | }
|
25969 | };
|
25970 | NbTreeGridColumnDefDirective.prototype.shouldHide = function (width) {
|
25971 | return !this.shouldShow(width);
|
25972 | };
|
25973 | NbTreeGridColumnDefDirective.prototype.shouldShow = function (width) {
|
25974 | if (this.hideOn == null && this.showOn == null) {
|
25975 | return true;
|
25976 | }
|
25977 | if (this.hideOn != null) {
|
25978 | return width > this.hideOn;
|
25979 | }
|
25980 | return width >= this.showOn;
|
25981 | };
|
25982 | NbTreeGridColumnDefDirective.decorators = [
|
25983 | { type: i0.Directive, args: [{
|
25984 | selector: '[nbTreeGridColumnDef]',
|
25985 | providers: [
|
25986 | { provide: NbCdkColumnDef, useExisting: NbTreeGridColumnDefDirective },
|
25987 | { provide: NB_SORT_HEADER_COLUMN_DEF, useExisting: NbTreeGridColumnDefDirective },
|
25988 | ],
|
25989 | },] }
|
25990 | ];
|
25991 | NbTreeGridColumnDefDirective.propDecorators = {
|
25992 | name: [{ type: i0.Input, args: ['nbTreeGridColumnDef',] }],
|
25993 | hideOn: [{ type: i0.Input }],
|
25994 | showOn: [{ type: i0.Input }]
|
25995 | };
|
25996 | return NbTreeGridColumnDefDirective;
|
25997 | }(NbColumnDefDirective));
|
25998 |
|
25999 |
|
26000 |
|
26001 |
|
26002 |
|
26003 |
|
26004 | var NbTreeGridCellDirective = (function (_super) {
|
26005 | tslib.__extends(NbTreeGridCellDirective, _super);
|
26006 | function NbTreeGridCellDirective(columnDef, elementRef, tree, platformId, window, sanitizer, directionService, columnService, cd) {
|
26007 | var _this = _super.call(this, columnDef, elementRef) || this;
|
26008 | _this.platformId = platformId;
|
26009 | _this.window = window;
|
26010 | _this.sanitizer = sanitizer;
|
26011 | _this.directionService = directionService;
|
26012 | _this.columnService = columnService;
|
26013 | _this.cd = cd;
|
26014 | _this.destroy$ = new rxjs.Subject();
|
26015 | _this.initialLeftPadding = '';
|
26016 | _this.initialRightPadding = '';
|
26017 | _this.tree = tree;
|
26018 | _this.columnDef = columnDef;
|
26019 | _this.elementRef = elementRef;
|
26020 | return _this;
|
26021 | }
|
26022 | Object.defineProperty(NbTreeGridCellDirective.prototype, "columnWidth", {
|
26023 | get: function () {
|
26024 | this.latestWidth = this.tree.getColumnWidth();
|
26025 | if (this.latestWidth) {
|
26026 | return this.latestWidth;
|
26027 | }
|
26028 | return null;
|
26029 | },
|
26030 | enumerable: false,
|
26031 | configurable: true
|
26032 | });
|
26033 | Object.defineProperty(NbTreeGridCellDirective.prototype, "leftPadding", {
|
26034 | get: function () {
|
26035 | if (this.directionService.isLtr()) {
|
26036 | return this.getStartPadding();
|
26037 | }
|
26038 | return null;
|
26039 | },
|
26040 | enumerable: false,
|
26041 | configurable: true
|
26042 | });
|
26043 | Object.defineProperty(NbTreeGridCellDirective.prototype, "rightPadding", {
|
26044 | get: function () {
|
26045 | if (this.directionService.isRtl()) {
|
26046 | return this.getStartPadding();
|
26047 | }
|
26048 | return null;
|
26049 | },
|
26050 | enumerable: false,
|
26051 | configurable: true
|
26052 | });
|
26053 | NbTreeGridCellDirective.prototype.ngOnInit = function () {
|
26054 | var _this = this;
|
26055 | if (_angular_common.isPlatformBrowser(this.platformId)) {
|
26056 | var style$$1 = this.window.getComputedStyle(this.elementRef.nativeElement);
|
26057 | this.initialLeftPadding = style$$1.paddingLeft;
|
26058 | this.initialRightPadding = style$$1.paddingRight;
|
26059 | }
|
26060 | this.columnService.onColumnsChange()
|
26061 | .pipe(rxjs_operators.filter(function () { return _this.latestWidth !== _this.tree.getColumnWidth(); }), rxjs_operators.takeUntil(this.destroy$))
|
26062 | .subscribe(function () { return _this.cd.detectChanges(); });
|
26063 | };
|
26064 | NbTreeGridCellDirective.prototype.ngOnDestroy = function () {
|
26065 | this.destroy$.next();
|
26066 | this.destroy$.complete();
|
26067 | };
|
26068 | NbTreeGridCellDirective.prototype.toggleRow = function () {
|
26069 | this.tree.toggleCellRow(this);
|
26070 | };
|
26071 | Object.defineProperty(NbTreeGridCellDirective.prototype, "initialStartPadding", {
|
26072 | get: function () {
|
26073 | return this.directionService.isLtr()
|
26074 | ? this.initialLeftPadding
|
26075 | : this.initialRightPadding;
|
26076 | },
|
26077 | enumerable: false,
|
26078 | configurable: true
|
26079 | });
|
26080 | NbTreeGridCellDirective.prototype.getStartPadding = function () {
|
26081 | var rowLevel = this.tree.getCellLevel(this, this.columnDef.name);
|
26082 | if (rowLevel === NB_DEFAULT_ROW_LEVEL) {
|
26083 | return null;
|
26084 | }
|
26085 | var nestingLevel = rowLevel + 1;
|
26086 | var padding = '';
|
26087 | if (this.tree.levelPadding) {
|
26088 | padding = "calc(" + this.tree.levelPadding + " * " + nestingLevel + ")";
|
26089 | }
|
26090 | else if (this.initialStartPadding) {
|
26091 | padding = "calc(" + this.initialStartPadding + " * " + nestingLevel + ")";
|
26092 | }
|
26093 | if (!padding) {
|
26094 | return null;
|
26095 | }
|
26096 | return this.sanitizer.bypassSecurityTrustStyle(padding);
|
26097 | };
|
26098 | NbTreeGridCellDirective.decorators = [
|
26099 | { type: i0.Directive, args: [{
|
26100 | selector: 'td[nbTreeGridCell]',
|
26101 | host: {
|
26102 | 'class': 'nb-tree-grid-cell',
|
26103 | 'role': 'gridcell',
|
26104 | },
|
26105 | providers: [{ provide: NbCdkCell, useExisting: NbTreeGridCellDirective }],
|
26106 | },] }
|
26107 | ];
|
26108 | NbTreeGridCellDirective.ctorParameters = function () { return [
|
26109 | { type: NbTreeGridColumnDefDirective },
|
26110 | { type: i0.ElementRef },
|
26111 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_TREE_GRID,] }] },
|
26112 | { type: undefined, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] },
|
26113 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_WINDOW,] }] },
|
26114 | { type: _angular_platformBrowser.DomSanitizer },
|
26115 | { type: NbLayoutDirectionService },
|
26116 | { type: NbColumnsService },
|
26117 | { type: i0.ChangeDetectorRef }
|
26118 | ]; };
|
26119 | NbTreeGridCellDirective.propDecorators = {
|
26120 | columnWidth: [{ type: i0.HostBinding, args: ['style.width',] }],
|
26121 | leftPadding: [{ type: i0.HostBinding, args: ['style.padding-left',] }],
|
26122 | rightPadding: [{ type: i0.HostBinding, args: ['style.padding-right',] }]
|
26123 | };
|
26124 | return NbTreeGridCellDirective;
|
26125 | }(NbCellDirective));
|
26126 | var NbTreeGridHeaderCellDirective = (function (_super) {
|
26127 | tslib.__extends(NbTreeGridHeaderCellDirective, _super);
|
26128 | function NbTreeGridHeaderCellDirective(columnDef, elementRef, tree, columnService, cd) {
|
26129 | var _this = _super.call(this, columnDef, elementRef) || this;
|
26130 | _this.columnService = columnService;
|
26131 | _this.cd = cd;
|
26132 | _this.destroy$ = new rxjs.Subject();
|
26133 | _this.tree = tree;
|
26134 | return _this;
|
26135 | }
|
26136 | Object.defineProperty(NbTreeGridHeaderCellDirective.prototype, "columnWidth", {
|
26137 | get: function () {
|
26138 | this.latestWidth = this.tree.getColumnWidth();
|
26139 | return this.latestWidth || null;
|
26140 | },
|
26141 | enumerable: false,
|
26142 | configurable: true
|
26143 | });
|
26144 | NbTreeGridHeaderCellDirective.prototype.ngOnInit = function () {
|
26145 | var _this = this;
|
26146 | this.columnService.onColumnsChange()
|
26147 | .pipe(rxjs_operators.filter(function () { return _this.latestWidth !== _this.tree.getColumnWidth(); }), rxjs_operators.takeUntil(this.destroy$))
|
26148 | .subscribe(function () { return _this.cd.detectChanges(); });
|
26149 | };
|
26150 | NbTreeGridHeaderCellDirective.prototype.ngOnDestroy = function () {
|
26151 | this.destroy$.next();
|
26152 | this.destroy$.complete();
|
26153 | };
|
26154 | NbTreeGridHeaderCellDirective.decorators = [
|
26155 | { type: i0.Directive, args: [{
|
26156 | selector: 'th[nbTreeGridHeaderCell]',
|
26157 | host: {
|
26158 | 'class': 'nb-tree-grid-header-cell',
|
26159 | 'role': 'columnheader',
|
26160 | },
|
26161 | providers: [{ provide: NbCdkHeaderCell, useExisting: NbTreeGridHeaderCellDirective }],
|
26162 | },] }
|
26163 | ];
|
26164 | NbTreeGridHeaderCellDirective.ctorParameters = function () { return [
|
26165 | { type: NbTreeGridColumnDefDirective },
|
26166 | { type: i0.ElementRef },
|
26167 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_TREE_GRID,] }] },
|
26168 | { type: NbColumnsService },
|
26169 | { type: i0.ChangeDetectorRef }
|
26170 | ]; };
|
26171 | NbTreeGridHeaderCellDirective.propDecorators = {
|
26172 | columnWidth: [{ type: i0.HostBinding, args: ['style.width',] }]
|
26173 | };
|
26174 | return NbTreeGridHeaderCellDirective;
|
26175 | }(NbHeaderCellDirective));
|
26176 | var NbTreeGridFooterCellDirective = (function (_super) {
|
26177 | tslib.__extends(NbTreeGridFooterCellDirective, _super);
|
26178 | function NbTreeGridFooterCellDirective(columnDef, elementRef, tree, columnService, cd) {
|
26179 | var _this = _super.call(this, columnDef, elementRef) || this;
|
26180 | _this.columnService = columnService;
|
26181 | _this.cd = cd;
|
26182 | _this.destroy$ = new rxjs.Subject();
|
26183 | _this.tree = tree;
|
26184 | return _this;
|
26185 | }
|
26186 | Object.defineProperty(NbTreeGridFooterCellDirective.prototype, "columnWidth", {
|
26187 | get: function () {
|
26188 | this.latestWidth = this.tree.getColumnWidth();
|
26189 | return this.latestWidth || null;
|
26190 | },
|
26191 | enumerable: false,
|
26192 | configurable: true
|
26193 | });
|
26194 | NbTreeGridFooterCellDirective.prototype.ngOnInit = function () {
|
26195 | var _this = this;
|
26196 | this.columnService.onColumnsChange()
|
26197 | .pipe(rxjs_operators.filter(function () { return _this.latestWidth !== _this.tree.getColumnWidth(); }), rxjs_operators.takeUntil(this.destroy$))
|
26198 | .subscribe(function () { return _this.cd.detectChanges(); });
|
26199 | };
|
26200 | NbTreeGridFooterCellDirective.prototype.ngOnDestroy = function () {
|
26201 | this.destroy$.next();
|
26202 | this.destroy$.complete();
|
26203 | };
|
26204 | NbTreeGridFooterCellDirective.decorators = [
|
26205 | { type: i0.Directive, args: [{
|
26206 | selector: 'td[nbTreeGridFooterCell]',
|
26207 | host: {
|
26208 | 'class': 'nb-tree-grid-footer-cell',
|
26209 | 'role': 'gridcell',
|
26210 | },
|
26211 | providers: [{ provide: NbCdkFooterCell, useExisting: NbTreeGridFooterCellDirective }],
|
26212 | },] }
|
26213 | ];
|
26214 | NbTreeGridFooterCellDirective.ctorParameters = function () { return [
|
26215 | { type: NbTreeGridColumnDefDirective },
|
26216 | { type: i0.ElementRef },
|
26217 | { type: undefined, decorators: [{ type: i0.Inject, args: [NB_TREE_GRID,] }] },
|
26218 | { type: NbColumnsService },
|
26219 | { type: i0.ChangeDetectorRef }
|
26220 | ]; };
|
26221 | NbTreeGridFooterCellDirective.propDecorators = {
|
26222 | columnWidth: [{ type: i0.HostBinding, args: ['style.width',] }]
|
26223 | };
|
26224 | return NbTreeGridFooterCellDirective;
|
26225 | }(NbFooterCellDirective));
|
26226 |
|
26227 |
|
26228 |
|
26229 |
|
26230 |
|
26231 |
|
26232 | var NbFilterDirective = (function () {
|
26233 | function NbFilterDirective() {
|
26234 | }
|
26235 | NbFilterDirective.prototype.filter = function (filterRequest) {
|
26236 | this.filterable.filter(filterRequest);
|
26237 | };
|
26238 | NbFilterDirective.decorators = [
|
26239 | { type: i0.Directive, args: [{ selector: '[nbFilter]' },] }
|
26240 | ];
|
26241 | NbFilterDirective.propDecorators = {
|
26242 | filterable: [{ type: i0.Input, args: ['nbFilter',] }]
|
26243 | };
|
26244 | return NbFilterDirective;
|
26245 | }());
|
26246 |
|
26247 |
|
26248 |
|
26249 | var NbFilterInputDirective = (function (_super) {
|
26250 | tslib.__extends(NbFilterInputDirective, _super);
|
26251 | function NbFilterInputDirective() {
|
26252 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
26253 | _this.search$ = new rxjs.Subject();
|
26254 | _this.destroy$ = new rxjs.Subject();
|
26255 | |
26256 |
|
26257 |
|
26258 |
|
26259 | _this.debounceTime = 200;
|
26260 | return _this;
|
26261 | }
|
26262 | NbFilterInputDirective.prototype.ngOnInit = function () {
|
26263 | var _this = this;
|
26264 | this.search$
|
26265 | .pipe(rxjs_operators.debounceTime(this.debounceTime), rxjs_operators.takeUntil(this.destroy$))
|
26266 | .subscribe(function (query) {
|
26267 | _super.prototype.filter.call(_this, query);
|
26268 | });
|
26269 | };
|
26270 | NbFilterInputDirective.prototype.ngOnDestroy = function () {
|
26271 | this.destroy$.next();
|
26272 | this.destroy$.complete();
|
26273 | this.search$.complete();
|
26274 | };
|
26275 | NbFilterInputDirective.prototype.filter = function (event) {
|
26276 | this.search$.next(event.target.value);
|
26277 | };
|
26278 | NbFilterInputDirective.decorators = [
|
26279 | { type: i0.Directive, args: [{
|
26280 | selector: '[nbFilterInput]',
|
26281 | providers: [{ provide: NbFilterDirective, useExisting: NbFilterInputDirective }],
|
26282 | },] }
|
26283 | ];
|
26284 | NbFilterInputDirective.propDecorators = {
|
26285 | filterable: [{ type: i0.Input, args: ['nbFilterInput',] }],
|
26286 | debounceTime: [{ type: i0.Input }],
|
26287 | filter: [{ type: i0.HostListener, args: ['input', ['$event'],] }]
|
26288 | };
|
26289 | return NbFilterInputDirective;
|
26290 | }(NbFilterDirective));
|
26291 |
|
26292 |
|
26293 |
|
26294 |
|
26295 |
|
26296 |
|
26297 |
|
26298 |
|
26299 |
|
26300 | var NbTreeGridRowToggleDirective = (function () {
|
26301 | function NbTreeGridRowToggleDirective(cell) {
|
26302 | this.cell = cell;
|
26303 | }
|
26304 | NbTreeGridRowToggleDirective.prototype.toggleRow = function ($event) {
|
26305 | this.cell.toggleRow();
|
26306 | $event.stopPropagation();
|
26307 | };
|
26308 | NbTreeGridRowToggleDirective.decorators = [
|
26309 | { type: i0.Directive, args: [{
|
26310 | selector: '[nbTreeGridRowToggle]',
|
26311 | },] }
|
26312 | ];
|
26313 | NbTreeGridRowToggleDirective.ctorParameters = function () { return [
|
26314 | { type: NbTreeGridCellDirective }
|
26315 | ]; };
|
26316 | NbTreeGridRowToggleDirective.propDecorators = {
|
26317 | toggleRow: [{ type: i0.HostListener, args: ['click', ['$event'],] }]
|
26318 | };
|
26319 | return NbTreeGridRowToggleDirective;
|
26320 | }());
|
26321 |
|
26322 |
|
26323 |
|
26324 |
|
26325 |
|
26326 |
|
26327 |
|
26328 |
|
26329 |
|
26330 | var NbTreeGridRowToggleComponent = (function () {
|
26331 | function NbTreeGridRowToggleComponent(cell) {
|
26332 | this.cell = cell;
|
26333 | }
|
26334 | Object.defineProperty(NbTreeGridRowToggleComponent.prototype, "expanded", {
|
26335 | get: function () {
|
26336 | return this.expandedValue;
|
26337 | },
|
26338 | set: function (value) {
|
26339 | this.expandedValue = value;
|
26340 | },
|
26341 | enumerable: false,
|
26342 | configurable: true
|
26343 | });
|
26344 | NbTreeGridRowToggleComponent.prototype.toggleRow = function ($event) {
|
26345 | this.cell.toggleRow();
|
26346 | $event.stopPropagation();
|
26347 | };
|
26348 | NbTreeGridRowToggleComponent.decorators = [
|
26349 | { type: i0.Component, args: [{
|
26350 | selector: 'nb-tree-grid-row-toggle',
|
26351 | template: "\n <button class=\"row-toggle-button\" [attr.aria-label]=\"expanded ? 'collapse' : 'expand'\">\n <nb-icon [icon]=\"expanded ? 'chevron-down-outline' : 'chevron-right-outline'\"\n pack=\"nebular-essentials\"\n aria-hidden=\"true\">\n </nb-icon>\n </button>\n ",
|
26352 | styles: ["\n button {\n background: transparent;\n border: none;\n padding: 0;\n }\n "]
|
26353 | },] }
|
26354 | ];
|
26355 | NbTreeGridRowToggleComponent.ctorParameters = function () { return [
|
26356 | { type: NbTreeGridCellDirective }
|
26357 | ]; };
|
26358 | NbTreeGridRowToggleComponent.propDecorators = {
|
26359 | expanded: [{ type: i0.Input }],
|
26360 | toggleRow: [{ type: i0.HostListener, args: ['click', ['$event'],] }]
|
26361 | };
|
26362 | return NbTreeGridRowToggleComponent;
|
26363 | }());
|
26364 |
|
26365 |
|
26366 |
|
26367 |
|
26368 |
|
26369 |
|
26370 | var COMPONENTS$2 = [
|
26371 |
|
26372 | NbTreeGridComponent,
|
26373 | NbTreeGridRowDefDirective,
|
26374 | NbTreeGridRowComponent,
|
26375 | NbTreeGridCellDefDirective,
|
26376 | NbTreeGridCellDirective,
|
26377 | NbTreeGridHeaderRowDefDirective,
|
26378 | NbTreeGridHeaderRowComponent,
|
26379 | NbTreeGridHeaderCellDefDirective,
|
26380 | NbTreeGridHeaderCellDirective,
|
26381 | NbTreeGridFooterRowDefDirective,
|
26382 | NbTreeGridFooterRowComponent,
|
26383 | NbTreeGridFooterCellDefDirective,
|
26384 | NbTreeGridFooterCellDirective,
|
26385 | NbTreeGridColumnDefDirective,
|
26386 |
|
26387 | NbSortDirective,
|
26388 | NbSortHeaderComponent,
|
26389 | NbSortIconComponent,
|
26390 |
|
26391 | NbFilterDirective,
|
26392 | NbFilterInputDirective,
|
26393 | NbTreeGridRowToggleDirective,
|
26394 | NbTreeGridRowToggleComponent,
|
26395 | NbSortHeaderIconDirective,
|
26396 | ];
|
26397 | var NbTreeGridModule = (function () {
|
26398 | function NbTreeGridModule() {
|
26399 | }
|
26400 | NbTreeGridModule.decorators = [
|
26401 | { type: i0.NgModule, args: [{
|
26402 | imports: [_angular_common.CommonModule, NbTableModule, NbIconModule],
|
26403 | declarations: tslib.__spreadArray([], COMPONENTS$2),
|
26404 | exports: tslib.__spreadArray([NbTableModule], COMPONENTS$2),
|
26405 | providers: [
|
26406 | NbTreeGridSortService,
|
26407 | NbTreeGridFilterService,
|
26408 | NbTreeGridService,
|
26409 | NbTreeGridDataService,
|
26410 | NbTreeGridDataSourceBuilder,
|
26411 | ],
|
26412 | },] }
|
26413 | ];
|
26414 | return NbTreeGridModule;
|
26415 | }());
|
26416 |
|
26417 |
|
26418 |
|
26419 |
|
26420 |
|
26421 |
|
26422 |
|
26423 |
|
26424 |
|
26425 |
|
26426 |
|
26427 |
|
26428 |
|
26429 |
|
26430 |
|
26431 |
|
26432 |
|
26433 |
|
26434 |
|
26435 |
|
26436 |
|
26437 |
|
26438 |
|
26439 |
|
26440 |
|
26441 |
|
26442 |
|
26443 |
|
26444 |
|
26445 |
|
26446 |
|
26447 |
|
26448 |
|
26449 |
|
26450 |
|
26451 |
|
26452 |
|
26453 |
|
26454 |
|
26455 |
|
26456 |
|
26457 |
|
26458 |
|
26459 |
|
26460 |
|
26461 |
|
26462 |
|
26463 |
|
26464 |
|
26465 |
|
26466 |
|
26467 |
|
26468 |
|
26469 |
|
26470 |
|
26471 |
|
26472 |
|
26473 |
|
26474 |
|
26475 |
|
26476 |
|
26477 |
|
26478 |
|
26479 |
|
26480 |
|
26481 |
|
26482 |
|
26483 |
|
26484 |
|
26485 |
|
26486 |
|
26487 |
|
26488 |
|
26489 |
|
26490 |
|
26491 |
|
26492 |
|
26493 |
|
26494 |
|
26495 |
|
26496 |
|
26497 |
|
26498 |
|
26499 |
|
26500 |
|
26501 |
|
26502 |
|
26503 |
|
26504 |
|
26505 |
|
26506 |
|
26507 |
|
26508 |
|
26509 |
|
26510 |
|
26511 |
|
26512 |
|
26513 |
|
26514 |
|
26515 |
|
26516 |
|
26517 |
|
26518 |
|
26519 |
|
26520 |
|
26521 |
|
26522 |
|
26523 |
|
26524 |
|
26525 |
|
26526 |
|
26527 |
|
26528 |
|
26529 |
|
26530 |
|
26531 |
|
26532 |
|
26533 |
|
26534 |
|
26535 |
|
26536 |
|
26537 |
|
26538 |
|
26539 |
|
26540 |
|
26541 |
|
26542 |
|
26543 |
|
26544 |
|
26545 |
|
26546 |
|
26547 |
|
26548 |
|
26549 |
|
26550 |
|
26551 |
|
26552 |
|
26553 |
|
26554 |
|
26555 |
|
26556 |
|
26557 |
|
26558 |
|
26559 |
|
26560 |
|
26561 |
|
26562 |
|
26563 |
|
26564 |
|
26565 |
|
26566 |
|
26567 |
|
26568 |
|
26569 |
|
26570 |
|
26571 |
|
26572 |
|
26573 |
|
26574 |
|
26575 |
|
26576 |
|
26577 |
|
26578 |
|
26579 |
|
26580 |
|
26581 |
|
26582 |
|
26583 |
|
26584 |
|
26585 |
|
26586 |
|
26587 |
|
26588 |
|
26589 |
|
26590 |
|
26591 |
|
26592 |
|
26593 |
|
26594 |
|
26595 |
|
26596 |
|
26597 |
|
26598 |
|
26599 |
|
26600 |
|
26601 |
|
26602 |
|
26603 |
|
26604 |
|
26605 |
|
26606 |
|
26607 |
|
26608 |
|
26609 |
|
26610 |
|
26611 |
|
26612 |
|
26613 |
|
26614 |
|
26615 |
|
26616 |
|
26617 |
|
26618 |
|
26619 |
|
26620 |
|
26621 |
|
26622 |
|
26623 |
|
26624 |
|
26625 |
|
26626 |
|
26627 |
|
26628 |
|
26629 |
|
26630 |
|
26631 |
|
26632 |
|
26633 |
|
26634 |
|
26635 |
|
26636 |
|
26637 |
|
26638 |
|
26639 |
|
26640 |
|
26641 |
|
26642 |
|
26643 |
|
26644 |
|
26645 |
|
26646 |
|
26647 |
|
26648 | var NbToggleComponent = (function () {
|
26649 | function NbToggleComponent(changeDetector, layoutDirection, renderer, hostElement, zone, statusService) {
|
26650 | this.changeDetector = changeDetector;
|
26651 | this.layoutDirection = layoutDirection;
|
26652 | this.renderer = renderer;
|
26653 | this.hostElement = hostElement;
|
26654 | this.zone = zone;
|
26655 | this.statusService = statusService;
|
26656 | this.onChange = function () { };
|
26657 | this.onTouched = function () { };
|
26658 | this.destroy$ = new rxjs.Subject();
|
26659 | this._checked = false;
|
26660 | this._disabled = false;
|
26661 | |
26662 |
|
26663 |
|
26664 |
|
26665 | this.status = 'basic';
|
26666 | |
26667 |
|
26668 |
|
26669 |
|
26670 | this.labelPosition = 'end';
|
26671 | |
26672 |
|
26673 |
|
26674 |
|
26675 | this.checkedChange = new i0.EventEmitter();
|
26676 | }
|
26677 | Object.defineProperty(NbToggleComponent.prototype, "checked", {
|
26678 | |
26679 |
|
26680 |
|
26681 |
|
26682 | get: function () {
|
26683 | return this._checked;
|
26684 | },
|
26685 | set: function (value) {
|
26686 | this._checked = convertToBoolProperty(value);
|
26687 | },
|
26688 | enumerable: false,
|
26689 | configurable: true
|
26690 | });
|
26691 | Object.defineProperty(NbToggleComponent.prototype, "disabled", {
|
26692 | |
26693 |
|
26694 |
|
26695 | get: function () {
|
26696 | return this._disabled;
|
26697 | },
|
26698 | set: function (value) {
|
26699 | this._disabled = convertToBoolProperty(value);
|
26700 | },
|
26701 | enumerable: false,
|
26702 | configurable: true
|
26703 | });
|
26704 | Object.defineProperty(NbToggleComponent.prototype, "primary", {
|
26705 | get: function () {
|
26706 | return this.status === 'primary';
|
26707 | },
|
26708 | enumerable: false,
|
26709 | configurable: true
|
26710 | });
|
26711 | Object.defineProperty(NbToggleComponent.prototype, "success", {
|
26712 | get: function () {
|
26713 | return this.status === 'success';
|
26714 | },
|
26715 | enumerable: false,
|
26716 | configurable: true
|
26717 | });
|
26718 | Object.defineProperty(NbToggleComponent.prototype, "warning", {
|
26719 | get: function () {
|
26720 | return this.status === 'warning';
|
26721 | },
|
26722 | enumerable: false,
|
26723 | configurable: true
|
26724 | });
|
26725 | Object.defineProperty(NbToggleComponent.prototype, "danger", {
|
26726 | get: function () {
|
26727 | return this.status === 'danger';
|
26728 | },
|
26729 | enumerable: false,
|
26730 | configurable: true
|
26731 | });
|
26732 | Object.defineProperty(NbToggleComponent.prototype, "info", {
|
26733 | get: function () {
|
26734 | return this.status === 'info';
|
26735 | },
|
26736 | enumerable: false,
|
26737 | configurable: true
|
26738 | });
|
26739 | Object.defineProperty(NbToggleComponent.prototype, "basic", {
|
26740 | get: function () {
|
26741 | return this.status === 'basic';
|
26742 | },
|
26743 | enumerable: false,
|
26744 | configurable: true
|
26745 | });
|
26746 | Object.defineProperty(NbToggleComponent.prototype, "control", {
|
26747 | get: function () {
|
26748 | return this.status === 'control';
|
26749 | },
|
26750 | enumerable: false,
|
26751 | configurable: true
|
26752 | });
|
26753 | Object.defineProperty(NbToggleComponent.prototype, "additionalClasses", {
|
26754 | get: function () {
|
26755 | if (this.statusService.isCustomStatus(this.status)) {
|
26756 | return [this.statusService.getStatusClass(this.status)];
|
26757 | }
|
26758 | return [];
|
26759 | },
|
26760 | enumerable: false,
|
26761 | configurable: true
|
26762 | });
|
26763 | Object.defineProperty(NbToggleComponent.prototype, "labelLeft", {
|
26764 | get: function () {
|
26765 | return this.labelPosition === 'left';
|
26766 | },
|
26767 | enumerable: false,
|
26768 | configurable: true
|
26769 | });
|
26770 | Object.defineProperty(NbToggleComponent.prototype, "labelRight", {
|
26771 | get: function () {
|
26772 | return this.labelPosition === 'right';
|
26773 | },
|
26774 | enumerable: false,
|
26775 | configurable: true
|
26776 | });
|
26777 | Object.defineProperty(NbToggleComponent.prototype, "labelStart", {
|
26778 | get: function () {
|
26779 | return this.labelPosition === 'start';
|
26780 | },
|
26781 | enumerable: false,
|
26782 | configurable: true
|
26783 | });
|
26784 | Object.defineProperty(NbToggleComponent.prototype, "labelEnd", {
|
26785 | get: function () {
|
26786 | return this.labelPosition === 'end';
|
26787 | },
|
26788 | enumerable: false,
|
26789 | configurable: true
|
26790 | });
|
26791 | NbToggleComponent.prototype.ngOnInit = function () {
|
26792 | var _this = this;
|
26793 | this.layoutDirection.onDirectionChange()
|
26794 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
26795 | .subscribe(function () { return _this.changeDetector.detectChanges(); });
|
26796 | };
|
26797 | NbToggleComponent.prototype.ngAfterViewInit = function () {
|
26798 | var _this = this;
|
26799 |
|
26800 | this.zone.runOutsideAngular(function () { return setTimeout(function () {
|
26801 | _this.renderer.addClass(_this.hostElement.nativeElement, 'nb-transition');
|
26802 | }); });
|
26803 | };
|
26804 | NbToggleComponent.prototype.ngOnDestroy = function () {
|
26805 | this.destroy$.next();
|
26806 | this.destroy$.complete();
|
26807 | };
|
26808 | NbToggleComponent.prototype.checkState = function () {
|
26809 | if (this.checked) {
|
26810 | return this.layoutDirection.isLtr() ? 'right' : 'left';
|
26811 | }
|
26812 | return this.layoutDirection.isLtr() ? 'left' : 'right';
|
26813 | };
|
26814 | NbToggleComponent.prototype.registerOnChange = function (fn) {
|
26815 | this.onChange = fn;
|
26816 | };
|
26817 | NbToggleComponent.prototype.registerOnTouched = function (fn) {
|
26818 | this.onTouched = fn;
|
26819 | };
|
26820 | NbToggleComponent.prototype.writeValue = function (val) {
|
26821 | this.checked = val;
|
26822 | this.changeDetector.markForCheck();
|
26823 | };
|
26824 | NbToggleComponent.prototype.setDisabledState = function (val) {
|
26825 | this.disabled = convertToBoolProperty(val);
|
26826 | this.changeDetector.markForCheck();
|
26827 | };
|
26828 | NbToggleComponent.prototype.updateValue = function (event) {
|
26829 | var input = event.target;
|
26830 | this.checked = input.checked;
|
26831 | this.checkedChange.emit(this.checked);
|
26832 | this.onChange(this.checked);
|
26833 | };
|
26834 | NbToggleComponent.prototype.onInputClick = function (event) {
|
26835 | event.stopPropagation();
|
26836 | };
|
26837 | NbToggleComponent.decorators = [
|
26838 | { type: i0.Component, args: [{
|
26839 | selector: 'nb-toggle',
|
26840 | animations: [
|
26841 | _angular_animations.trigger('position', [
|
26842 | _angular_animations.state('right', _angular_animations.style({ right: 0, left: '*' })),
|
26843 | _angular_animations.state('left', _angular_animations.style({ left: 0, right: '*' })),
|
26844 | _angular_animations.transition(':enter', [_angular_animations.animate(0)]),
|
26845 | _angular_animations.transition('right <=> left', [_angular_animations.animate('0.15s')]),
|
26846 | ]),
|
26847 | ],
|
26848 | template: "\n <label class=\"toggle-label\">\n <input type=\"checkbox\"\n class=\"native-input visually-hidden\"\n role=\"switch\"\n [attr.aria-checked]=\"checked\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n (change)=\"updateValue($event)\"\n (blur)=\"onTouched()\"\n (click)=\"onInputClick($event)\">\n <div class=\"toggle\" [class.checked]=\"checked\">\n <span [@position]=\"checkState()\" class=\"toggle-switcher\">\n <nb-icon *ngIf=\"checked\" icon=\"checkmark-bold-outline\" pack=\"nebular-essentials\"></nb-icon>\n </span>\n </div>\n <span class=\"text\">\n <ng-content></ng-content>\n </span>\n </label>\n ",
|
26849 | providers: [{
|
26850 | provide: _angular_forms.NG_VALUE_ACCESSOR,
|
26851 | useExisting: i0.forwardRef(function () { return NbToggleComponent; }),
|
26852 | multi: true,
|
26853 | }],
|
26854 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
26855 | styles: [":host{display:inline-flex;outline:none}:host(.toggle-label-left) .text:not(:empty){padding-right:0.6875rem}[dir=ltr] :host(.toggle-label-left) .text:not(:empty){order:-1}[dir=rtl] :host(.toggle-label-left) .text:not(:empty){order:1}:host(.toggle-label-right) .text:not(:empty){padding-left:0.6875rem}[dir=ltr] :host(.toggle-label-right) .text:not(:empty){order:1}[dir=rtl] :host(.toggle-label-right) .text:not(:empty){order:-1}:host(.toggle-label-start) .toggle-label{flex-direction:row-reverse}[dir=ltr] :host(.toggle-label-start) .toggle-label .text:not(:empty){padding-right:.6875rem}[dir=rtl] :host(.toggle-label-start) .toggle-label .text:not(:empty){padding-left:.6875rem}[dir=ltr] :host(.toggle-label-end) .text:not(:empty){padding-left:.6875rem}[dir=rtl] :host(.toggle-label-end) .text:not(:empty){padding-right:.6875rem}:host(.nb-transition) .toggle{transition-duration:0.15s;transition-property:background-color,border,box-shadow;transition-timing-function:ease-in}.toggle-label{position:relative;display:inline-flex;align-items:center}.toggle{position:relative;display:inline-flex;box-sizing:content-box}.toggle-switcher{position:absolute;border-radius:50%;margin:1px}.toggle-switcher nb-icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}\n"]
|
26856 | },] }
|
26857 | ];
|
26858 | NbToggleComponent.ctorParameters = function () { return [
|
26859 | { type: i0.ChangeDetectorRef },
|
26860 | { type: NbLayoutDirectionService },
|
26861 | { type: i0.Renderer2 },
|
26862 | { type: i0.ElementRef },
|
26863 | { type: i0.NgZone },
|
26864 | { type: NbStatusService }
|
26865 | ]; };
|
26866 | NbToggleComponent.propDecorators = {
|
26867 | checked: [{ type: i0.Input }],
|
26868 | disabled: [{ type: i0.Input }],
|
26869 | status: [{ type: i0.Input }],
|
26870 | labelPosition: [{ type: i0.Input }],
|
26871 | checkedChange: [{ type: i0.Output }],
|
26872 | primary: [{ type: i0.HostBinding, args: ['class.status-primary',] }],
|
26873 | success: [{ type: i0.HostBinding, args: ['class.status-success',] }],
|
26874 | warning: [{ type: i0.HostBinding, args: ['class.status-warning',] }],
|
26875 | danger: [{ type: i0.HostBinding, args: ['class.status-danger',] }],
|
26876 | info: [{ type: i0.HostBinding, args: ['class.status-info',] }],
|
26877 | basic: [{ type: i0.HostBinding, args: ['class.status-basic',] }],
|
26878 | control: [{ type: i0.HostBinding, args: ['class.status-control',] }],
|
26879 | additionalClasses: [{ type: i0.HostBinding, args: ['class',] }],
|
26880 | labelLeft: [{ type: i0.HostBinding, args: ['class.toggle-label-left',] }],
|
26881 | labelRight: [{ type: i0.HostBinding, args: ['class.toggle-label-right',] }],
|
26882 | labelStart: [{ type: i0.HostBinding, args: ['class.toggle-label-start',] }],
|
26883 | labelEnd: [{ type: i0.HostBinding, args: ['class.toggle-label-end',] }]
|
26884 | };
|
26885 | return NbToggleComponent;
|
26886 | }());
|
26887 |
|
26888 |
|
26889 |
|
26890 |
|
26891 |
|
26892 |
|
26893 | var NbToggleModule = (function () {
|
26894 | function NbToggleModule() {
|
26895 | }
|
26896 | NbToggleModule.decorators = [
|
26897 | { type: i0.NgModule, args: [{
|
26898 | imports: [
|
26899 | _angular_common.CommonModule,
|
26900 | NbIconModule,
|
26901 | ],
|
26902 | declarations: [NbToggleComponent],
|
26903 | exports: [NbToggleComponent],
|
26904 | },] }
|
26905 | ];
|
26906 | return NbToggleModule;
|
26907 | }());
|
26908 |
|
26909 | var NbPrefixDirective = (function () {
|
26910 | function NbPrefixDirective() {
|
26911 | }
|
26912 | NbPrefixDirective.decorators = [
|
26913 | { type: i0.Directive, args: [{
|
26914 | selector: '[nbPrefix]',
|
26915 | },] }
|
26916 | ];
|
26917 | return NbPrefixDirective;
|
26918 | }());
|
26919 |
|
26920 | var NbSuffixDirective = (function () {
|
26921 | function NbSuffixDirective() {
|
26922 | }
|
26923 | NbSuffixDirective.decorators = [
|
26924 | { type: i0.Directive, args: [{
|
26925 | selector: '[nbSuffix]',
|
26926 | },] }
|
26927 | ];
|
26928 | return NbSuffixDirective;
|
26929 | }());
|
26930 |
|
26931 |
|
26932 |
|
26933 |
|
26934 |
|
26935 |
|
26936 | function throwFormControlElementNotFound() {
|
26937 | throw new Error("NbFormFieldComponent must contain [nbInput]");
|
26938 | }
|
26939 |
|
26940 |
|
26941 |
|
26942 |
|
26943 |
|
26944 |
|
26945 |
|
26946 |
|
26947 |
|
26948 |
|
26949 |
|
26950 |
|
26951 |
|
26952 |
|
26953 |
|
26954 |
|
26955 |
|
26956 |
|
26957 |
|
26958 |
|
26959 |
|
26960 |
|
26961 |
|
26962 |
|
26963 |
|
26964 |
|
26965 |
|
26966 |
|
26967 |
|
26968 |
|
26969 |
|
26970 |
|
26971 |
|
26972 |
|
26973 |
|
26974 |
|
26975 |
|
26976 |
|
26977 |
|
26978 |
|
26979 |
|
26980 |
|
26981 |
|
26982 |
|
26983 |
|
26984 |
|
26985 |
|
26986 |
|
26987 |
|
26988 |
|
26989 |
|
26990 | var NbFormFieldComponent = (function () {
|
26991 | function NbFormFieldComponent(cd, zone, elementRef, renderer) {
|
26992 | var _this = this;
|
26993 | this.cd = cd;
|
26994 | this.zone = zone;
|
26995 | this.elementRef = elementRef;
|
26996 | this.renderer = renderer;
|
26997 | this.destroy$ = new rxjs.Subject();
|
26998 | this.formControlState$ = new rxjs.ReplaySubject(1);
|
26999 | this.prefixClasses$ = this.formControlState$.pipe(rxjs_operators.map(function (s) { return _this.getAddonClasses('prefix', s); }));
|
27000 | this.suffixClasses$ = this.formControlState$.pipe(rxjs_operators.map(function (s) { return _this.getAddonClasses('suffix', s); }));
|
27001 | }
|
27002 | NbFormFieldComponent.prototype.ngAfterContentChecked = function () {
|
27003 | if (!this.formControl) {
|
27004 | throwFormControlElementNotFound();
|
27005 | }
|
27006 | };
|
27007 | NbFormFieldComponent.prototype.ngAfterContentInit = function () {
|
27008 | this.subscribeToFormControlStateChange();
|
27009 | this.subscribeToAddonChange();
|
27010 | };
|
27011 | NbFormFieldComponent.prototype.ngAfterViewInit = function () {
|
27012 | var _this = this;
|
27013 |
|
27014 | this.zone.runOutsideAngular(function () { return setTimeout(function () {
|
27015 | _this.renderer.addClass(_this.elementRef.nativeElement, 'nb-transition');
|
27016 | }); });
|
27017 | };
|
27018 | NbFormFieldComponent.prototype.ngOnDestroy = function () {
|
27019 | this.destroy$.next();
|
27020 | };
|
27021 | NbFormFieldComponent.prototype.shouldShowPrefix = function () {
|
27022 | return this.getFormControlConfig().supportsPrefix && !!this.prefix.length;
|
27023 | };
|
27024 | NbFormFieldComponent.prototype.shouldShowSuffix = function () {
|
27025 | return this.getFormControlConfig().supportsSuffix && !!this.suffix.length;
|
27026 | };
|
27027 | NbFormFieldComponent.prototype.subscribeToFormControlStateChange = function () {
|
27028 | var _this = this;
|
27029 | var _a = this.formControl, disabled$ = _a.disabled$, focused$ = _a.focused$, size$ = _a.size$, status$ = _a.status$, fullWidth$ = _a.fullWidth$;
|
27030 | rxjs.combineLatest([disabled$, focused$, size$, status$, fullWidth$])
|
27031 | .pipe(rxjs_operators.map(function (_a) {
|
27032 | var disabled = _a[0], focused = _a[1], size = _a[2], status = _a[3], fullWidth = _a[4];
|
27033 | return ({ disabled: disabled, focused: focused, size: size, status: status, fullWidth: fullWidth });
|
27034 | }), rxjs_operators.distinctUntilChanged(function (oldState, state$$1) { return _this.isStatesEqual(oldState, state$$1); }), rxjs_operators.tap(function (_a) {
|
27035 | var size = _a.size, fullWidth = _a.fullWidth;
|
27036 | var formFieldClasses = ["nb-form-field-size-" + size];
|
27037 | if (!fullWidth) {
|
27038 | formFieldClasses.push('nb-form-field-limited-width');
|
27039 | }
|
27040 | _this.formFieldClasses = formFieldClasses.join(' ');
|
27041 | }), rxjs_operators.takeUntil(this.destroy$))
|
27042 | .subscribe(this.formControlState$);
|
27043 | };
|
27044 | NbFormFieldComponent.prototype.subscribeToAddonChange = function () {
|
27045 | var _this = this;
|
27046 | rxjs.merge(this.prefix.changes, this.suffix.changes)
|
27047 | .pipe(rxjs_operators.takeUntil(this.destroy$))
|
27048 | .subscribe(function () { return _this.cd.markForCheck(); });
|
27049 | };
|
27050 | NbFormFieldComponent.prototype.getAddonClasses = function (addon, state$$1) {
|
27051 | var classes = [
|
27052 | 'nb-form-field-addon',
|
27053 | "nb-form-field-" + addon + "-" + state$$1.size,
|
27054 | ];
|
27055 | if (state$$1.disabled) {
|
27056 | classes.push("nb-form-field-addon-disabled");
|
27057 | }
|
27058 | else if (state$$1.focused) {
|
27059 | classes.push("nb-form-field-addon-" + state$$1.status + "-highlight");
|
27060 | }
|
27061 | else {
|
27062 | classes.push("nb-form-field-addon-" + state$$1.status);
|
27063 | }
|
27064 | return classes;
|
27065 | };
|
27066 | NbFormFieldComponent.prototype.getFormControlConfig = function () {
|
27067 | return this.formControlConfig || new NbFormFieldControlConfig();
|
27068 | };
|
27069 | NbFormFieldComponent.prototype.isStatesEqual = function (oldState, state$$1) {
|
27070 | return oldState.status === state$$1.status &&
|
27071 | oldState.disabled === state$$1.disabled &&
|
27072 | oldState.focused === state$$1.focused &&
|
27073 | oldState.fullWidth === state$$1.fullWidth &&
|
27074 | oldState.size === state$$1.size;
|
27075 | };
|
27076 | NbFormFieldComponent.decorators = [
|
27077 | { type: i0.Component, args: [{
|
27078 | selector: 'nb-form-field',
|
27079 | template: "<div *ngIf=\"shouldShowPrefix()\" [ngClass]=\"prefixClasses$ | async\">\n <ng-content select=\"[nbPrefix]\"></ng-content>\n</div>\n\n<div class=\"nb-form-control-container\"\n [class.nb-form-field-control-with-prefix]=\"shouldShowPrefix()\"\n [class.nb-form-field-control-with-suffix]=\"shouldShowSuffix()\">\n <ng-content></ng-content>\n</div>\n\n<div *ngIf=\"shouldShowSuffix()\" [ngClass]=\"suffixClasses$ | async\">\n <ng-content select=\"[nbSuffix]\"></ng-content>\n</div>\n",
|
27080 | changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
27081 | styles: [":host{display:flex;align-items:center}.nb-form-control-container{width:100%}\n"]
|
27082 | },] }
|
27083 | ];
|
27084 | NbFormFieldComponent.ctorParameters = function () { return [
|
27085 | { type: i0.ChangeDetectorRef },
|
27086 | { type: i0.NgZone },
|
27087 | { type: i0.ElementRef },
|
27088 | { type: i0.Renderer2 }
|
27089 | ]; };
|
27090 | NbFormFieldComponent.propDecorators = {
|
27091 | prefix: [{ type: i0.ContentChildren, args: [NbPrefixDirective, { descendants: true },] }],
|
27092 | suffix: [{ type: i0.ContentChildren, args: [NbSuffixDirective, { descendants: true },] }],
|
27093 | formControl: [{ type: i0.ContentChild, args: [NbFormFieldControl, { static: false },] }],
|
27094 | formControlConfig: [{ type: i0.ContentChild, args: [NbFormFieldControlConfig, { static: false },] }],
|
27095 | formFieldClasses: [{ type: i0.HostBinding, args: ['class',] }]
|
27096 | };
|
27097 | return NbFormFieldComponent;
|
27098 | }());
|
27099 |
|
27100 |
|
27101 |
|
27102 |
|
27103 |
|
27104 |
|
27105 | var COMPONENTS$3 = [
|
27106 | NbFormFieldComponent,
|
27107 | NbPrefixDirective,
|
27108 | NbSuffixDirective,
|
27109 | ];
|
27110 | var NbFormFieldModule = (function () {
|
27111 | function NbFormFieldModule() {
|
27112 | }
|
27113 | NbFormFieldModule.decorators = [
|
27114 | { type: i0.NgModule, args: [{
|
27115 | imports: [_angular_common.CommonModule],
|
27116 | declarations: tslib.__spreadArray([], COMPONENTS$3),
|
27117 | exports: tslib.__spreadArray([], COMPONENTS$3),
|
27118 | },] }
|
27119 | ];
|
27120 | return NbFormFieldModule;
|
27121 | }());
|
27122 |
|
27123 |
|
27124 |
|
27125 |
|
27126 |
|
27127 |
|
27128 |
|
27129 |
|
27130 |
|
27131 |
|
27132 |
|
27133 |
|
27134 | exports.ɵe = NbCalendarActionsComponent;
|
27135 | exports.ɵd = NbActiveDescendantKeyManagerFactoryService;
|
27136 | exports.ɵc = NbFocusKeyManagerFactoryService;
|
27137 | exports.ɵf = NbCustomMessageService;
|
27138 | exports.ɵh = NbCalendarWithTimeComponent;
|
27139 | exports.ɵa = NbMenuInternalService;
|
27140 | exports.ɵb = NbSharedModule;
|
27141 | exports.ɵg = NbTimePickerCellComponent;
|
27142 | exports.NbCalendarDayCellComponent = NbCalendarDayCellComponent;
|
27143 | exports.NbDateTimePickerComponent = NbDateTimePickerComponent;
|
27144 | exports.NbCalendarYearPickerComponent = NbCalendarYearPickerComponent;
|
27145 | exports.NbCalendarMonthPickerComponent = NbCalendarMonthPickerComponent;
|
27146 | exports.MONTHS_IN_VIEW = MONTHS_IN_VIEW;
|
27147 | exports.MONTHS_IN_COLUMN = MONTHS_IN_COLUMN;
|
27148 | exports.NbCalendarDayPickerComponent = NbCalendarDayPickerComponent;
|
27149 | exports.NbCalendarViewModeComponent = NbCalendarViewModeComponent;
|
27150 | exports.NbCalendarPageableNavigationComponent = NbCalendarPageableNavigationComponent;
|
27151 | exports.NbCalendarDaysNamesComponent = NbCalendarDaysNamesComponent;
|
27152 | exports.NbCalendarWeekNumberComponent = NbCalendarWeekNumberComponent;
|
27153 | exports.NbCalendarMonthCellComponent = NbCalendarMonthCellComponent;
|
27154 | exports.NbCalendarYearCellComponent = NbCalendarYearCellComponent;
|
27155 | exports.NbCalendarPickerRowComponent = NbCalendarPickerRowComponent;
|
27156 | exports.NbCalendarPickerComponent = NbCalendarPickerComponent;
|
27157 | exports.NbCalendarMonthModelService = NbCalendarMonthModelService;
|
27158 | exports.NbNativeDateService = NbNativeDateService;
|
27159 | exports.NbDateService = NbDateService;
|
27160 | exports.NbMenuService = NbMenuService;
|
27161 | exports.NbMenuItem = NbMenuItem;
|
27162 | exports.NbSidebarService = NbSidebarService;
|
27163 | exports.NB_THEME_OPTIONS = NB_THEME_OPTIONS;
|
27164 | exports.NB_MEDIA_BREAKPOINTS = NB_MEDIA_BREAKPOINTS;
|
27165 | exports.NB_BUILT_IN_JS_THEMES = NB_BUILT_IN_JS_THEMES;
|
27166 | exports.NB_JS_THEMES = NB_JS_THEMES;
|
27167 | exports.NB_WINDOW = NB_WINDOW;
|
27168 | exports.NB_DOCUMENT = NB_DOCUMENT;
|
27169 | exports.windowFactory = windowFactory;
|
27170 | exports.NbThemeModule = NbThemeModule;
|
27171 | exports.NbThemeService = NbThemeService;
|
27172 | exports.NbSpinnerService = NbSpinnerService;
|
27173 | exports.DEFAULT_MEDIA_BREAKPOINTS = DEFAULT_MEDIA_BREAKPOINTS;
|
27174 | exports.NbMediaBreakpointsService = NbMediaBreakpointsService;
|
27175 | exports.NbColorHelper = NbColorHelper;
|
27176 | exports.NB_LAYOUT_DIRECTION = NB_LAYOUT_DIRECTION;
|
27177 | exports.NbLayoutDirectionService = NbLayoutDirectionService;
|
27178 | exports.NbLayoutScrollService = NbLayoutScrollService;
|
27179 | exports.NbLayoutRulerService = NbLayoutRulerService;
|
27180 | exports.NbStatusService = NbStatusService;
|
27181 | exports.BUILT_IN_THEMES = BUILT_IN_THEMES;
|
27182 | exports.NbJSThemesRegistry = NbJSThemesRegistry;
|
27183 | exports.CORPORATE_THEME = CORPORATE_THEME;
|
27184 | exports.COSMIC_THEME = COSMIC_THEME;
|
27185 | exports.DEFAULT_THEME = DEFAULT_THEME;
|
27186 | exports.DARK_THEME = DARK_THEME;
|
27187 | exports.NbCardModule = NbCardModule;
|
27188 | exports.NbCardHeaderComponent = NbCardHeaderComponent;
|
27189 | exports.NbCardBodyComponent = NbCardBodyComponent;
|
27190 | exports.NbCardFooterComponent = NbCardFooterComponent;
|
27191 | exports.NbCardComponent = NbCardComponent;
|
27192 | exports.NbFlipCardComponent = NbFlipCardComponent;
|
27193 | exports.NbRevealCardComponent = NbRevealCardComponent;
|
27194 | exports.NbCardFrontComponent = NbCardFrontComponent;
|
27195 | exports.NbCardBackComponent = NbCardBackComponent;
|
27196 | exports.NbCalendarModule = NbCalendarModule;
|
27197 | exports.NbCalendarComponent = NbCalendarComponent;
|
27198 | exports.NbCalendarRangeModule = NbCalendarRangeModule;
|
27199 | exports.NbCalendarRangeComponent = NbCalendarRangeComponent;
|
27200 | exports.NbBaseCalendarComponent = NbBaseCalendarComponent;
|
27201 | exports.NbBaseCalendarModule = NbBaseCalendarModule;
|
27202 | exports.NbBaseCalendarRangeCell = NbBaseCalendarRangeCell;
|
27203 | exports.NbCalendarRangeDayCellComponent = NbCalendarRangeDayCellComponent;
|
27204 | exports.NbCalendarRangeMonthCellComponent = NbCalendarRangeMonthCellComponent;
|
27205 | exports.NbCalendarRangeYearCellComponent = NbCalendarRangeYearCellComponent;
|
27206 | exports.NbCalendarYearModelService = NbCalendarYearModelService;
|
27207 | exports.NbCalendarTimeModelService = NbCalendarTimeModelService;
|
27208 | exports.NbCalendarKitModule = NbCalendarKitModule;
|
27209 | exports.NbLayoutModule = NbLayoutModule;
|
27210 | exports.NbLayoutComponent = NbLayoutComponent;
|
27211 | exports.NbLayoutColumnComponent = NbLayoutColumnComponent;
|
27212 | exports.NbLayoutHeaderComponent = NbLayoutHeaderComponent;
|
27213 | exports.NbLayoutFooterComponent = NbLayoutFooterComponent;
|
27214 | exports.NbRestoreScrollTopHelper = NbRestoreScrollTopHelper;
|
27215 | exports.NbMenuModule = NbMenuModule;
|
27216 | exports.NbMenuItemComponent = NbMenuItemComponent;
|
27217 | exports.NbMenuComponent = NbMenuComponent;
|
27218 | exports.NbRouteTabsetModule = NbRouteTabsetModule;
|
27219 | exports.NbRouteTabsetComponent = NbRouteTabsetComponent;
|
27220 | exports.NbSidebarModule = NbSidebarModule;
|
27221 | exports.NbSidebarHeaderComponent = NbSidebarHeaderComponent;
|
27222 | exports.NbSidebarFooterComponent = NbSidebarFooterComponent;
|
27223 | exports.NbSidebarComponent = NbSidebarComponent;
|
27224 | exports.NbTabsetModule = NbTabsetModule;
|
27225 | exports.NbTabComponent = NbTabComponent;
|
27226 | exports.NbTabsetComponent = NbTabsetComponent;
|
27227 | exports.NbUserModule = NbUserModule;
|
27228 | exports.NbUserComponent = NbUserComponent;
|
27229 | exports.NbActionsModule = NbActionsModule;
|
27230 | exports.NbActionComponent = NbActionComponent;
|
27231 | exports.NbActionsComponent = NbActionsComponent;
|
27232 | exports.NbSearchModule = NbSearchModule;
|
27233 | exports.NbSearchService = NbSearchService;
|
27234 | exports.NbSearchFieldComponent = NbSearchFieldComponent;
|
27235 | exports.NbSearchComponent = NbSearchComponent;
|
27236 | exports.NbCheckboxComponent = NbCheckboxComponent;
|
27237 | exports.NbCheckboxModule = NbCheckboxModule;
|
27238 | exports.NbBadgeComponent = NbBadgeComponent;
|
27239 | exports.NbBadgeModule = NbBadgeModule;
|
27240 | exports.NbPopoverDirective = NbPopoverDirective;
|
27241 | exports.NbPopoverModule = NbPopoverModule;
|
27242 | exports.NbPopoverComponent = NbPopoverComponent;
|
27243 | exports.NbContextMenuDirective = NbContextMenuDirective;
|
27244 | exports.NbContextMenuComponent = NbContextMenuComponent;
|
27245 | exports.NbContextMenuModule = NbContextMenuModule;
|
27246 | exports.NbProgressBarComponent = NbProgressBarComponent;
|
27247 | exports.NbProgressBarModule = NbProgressBarModule;
|
27248 | exports.NbAlertComponent = NbAlertComponent;
|
27249 | exports.NbAlertModule = NbAlertModule;
|
27250 | exports.NbChatComponent = NbChatComponent;
|
27251 | exports.NbChatMessageComponent = NbChatMessageComponent;
|
27252 | exports.NbChatMessageMapComponent = NbChatMessageMapComponent;
|
27253 | exports.NbChatMessageFileComponent = NbChatMessageFileComponent;
|
27254 | exports.NbChatMessageQuoteComponent = NbChatMessageQuoteComponent;
|
27255 | exports.NbChatMessageTextComponent = NbChatMessageTextComponent;
|
27256 | exports.NbChatFormComponent = NbChatFormComponent;
|
27257 | exports.NbChatModule = NbChatModule;
|
27258 | exports.NbChatOptions = NbChatOptions;
|
27259 | exports.NbChatAvatarComponent = NbChatAvatarComponent;
|
27260 | exports.NbChatCustomMessageDirective = NbChatCustomMessageDirective;
|
27261 | exports.NbSpinnerComponent = NbSpinnerComponent;
|
27262 | exports.NbSpinnerDirective = NbSpinnerDirective;
|
27263 | exports.NbSpinnerModule = NbSpinnerModule;
|
27264 | exports.NB_STEPPER = NB_STEPPER;
|
27265 | exports.NbStepperComponent = NbStepperComponent;
|
27266 | exports.NbStepComponent = NbStepComponent;
|
27267 | exports.NbStepperNextDirective = NbStepperNextDirective;
|
27268 | exports.NbStepperPreviousDirective = NbStepperPreviousDirective;
|
27269 | exports.NbStepperModule = NbStepperModule;
|
27270 | exports.NbAccordionComponent = NbAccordionComponent;
|
27271 | exports.NbAccordionItemComponent = NbAccordionItemComponent;
|
27272 | exports.NbAccordionItemBodyComponent = NbAccordionItemBodyComponent;
|
27273 | exports.NbAccordionItemHeaderComponent = NbAccordionItemHeaderComponent;
|
27274 | exports.NbAccordionModule = NbAccordionModule;
|
27275 | exports.NbButton = NbButton;
|
27276 | exports.NbButtonComponent = NbButtonComponent;
|
27277 | exports.NbButtonModule = NbButtonModule;
|
27278 | exports.NbButtonGroupComponent = NbButtonGroupComponent;
|
27279 | exports.NbButtonGroupModule = NbButtonGroupModule;
|
27280 | exports.NbButtonToggleDirective = NbButtonToggleDirective;
|
27281 | exports.NbListComponent = NbListComponent;
|
27282 | exports.NbListItemComponent = NbListItemComponent;
|
27283 | exports.NbListModule = NbListModule;
|
27284 | exports.NbListPageTrackerDirective = NbListPageTrackerDirective;
|
27285 | exports.NbScrollableContainerDimentions = NbScrollableContainerDimentions;
|
27286 | exports.NbInfiniteListDirective = NbInfiniteListDirective;
|
27287 | exports.NbInputDirective = NbInputDirective;
|
27288 | exports.NbInputModule = NbInputModule;
|
27289 | exports.NbOverlayModule = NbOverlayModule;
|
27290 | exports.patch = patch;
|
27291 | exports.createContainer = createContainer;
|
27292 | exports.NbOverlayService = NbOverlayService;
|
27293 | exports.NbAdjustableConnectedPositionStrategy = NbAdjustableConnectedPositionStrategy;
|
27294 | exports.NbGlobalPositionStrategy = NbGlobalPositionStrategy;
|
27295 | exports.NbPositionBuilderService = NbPositionBuilderService;
|
27296 | exports.NbPositionedContainerComponent = NbPositionedContainerComponent;
|
27297 | exports.NbOverlayContainerComponent = NbOverlayContainerComponent;
|
27298 | exports.NbTriggerStrategyBase = NbTriggerStrategyBase;
|
27299 | exports.NbClickTriggerStrategy = NbClickTriggerStrategy;
|
27300 | exports.NbHoverTriggerStrategy = NbHoverTriggerStrategy;
|
27301 | exports.NbHintTriggerStrategy = NbHintTriggerStrategy;
|
27302 | exports.NbFocusTriggerStrategy = NbFocusTriggerStrategy;
|
27303 | exports.NbNoopTriggerStrategy = NbNoopTriggerStrategy;
|
27304 | exports.NbTriggerStrategyBuilderService = NbTriggerStrategyBuilderService;
|
27305 | exports.NbPortalDirective = NbPortalDirective;
|
27306 | exports.NbPortalOutletDirective = NbPortalOutletDirective;
|
27307 | exports.NbComponentPortal = NbComponentPortal;
|
27308 | exports.NbOverlay = NbOverlay;
|
27309 | exports.NbOverlayPositionBuilder = NbOverlayPositionBuilder;
|
27310 | exports.NbTemplatePortal = NbTemplatePortal;
|
27311 | exports.NbOverlayContainer = NbOverlayContainer;
|
27312 | exports.NbFlexibleConnectedPositionStrategy = NbFlexibleConnectedPositionStrategy;
|
27313 | exports.NbPortalInjector = NbPortalInjector;
|
27314 | exports.NbCdkMappingModule = NbCdkMappingModule;
|
27315 | exports.NbPositionHelper = NbPositionHelper;
|
27316 | exports.NbDynamicOverlay = NbDynamicOverlay;
|
27317 | exports.NbDynamicOverlayChange = NbDynamicOverlayChange;
|
27318 | exports.NbDynamicOverlayHandler = NbDynamicOverlayHandler;
|
27319 | exports.NbPlatform = NbPlatform;
|
27320 | exports.NbFocusMonitor = NbFocusMonitor;
|
27321 | exports.NbA11yModule = NbA11yModule;
|
27322 | exports.NbFocusTrap = NbFocusTrap;
|
27323 | exports.NbFocusTrapFactoryService = NbFocusTrapFactoryService;
|
27324 | exports.NbCdkAdapterModule = NbCdkAdapterModule;
|
27325 | exports.NbBlockScrollStrategyAdapter = NbBlockScrollStrategyAdapter;
|
27326 | exports.NbScrollStrategyOptions = NbScrollStrategyOptions;
|
27327 | exports.NbOverlayContainerAdapter = NbOverlayContainerAdapter;
|
27328 | exports.NbScrollDispatcherAdapter = NbScrollDispatcherAdapter;
|
27329 | exports.NbViewportRulerAdapter = NbViewportRulerAdapter;
|
27330 | exports.NbDirectionality = NbDirectionality;
|
27331 | exports.NbBidiModule = NbBidiModule;
|
27332 | exports.NbCellDefDirective = NbCellDefDirective;
|
27333 | exports.NbHeaderCellDefDirective = NbHeaderCellDefDirective;
|
27334 | exports.NbFooterCellDefDirective = NbFooterCellDefDirective;
|
27335 | exports.NB_SORT_HEADER_COLUMN_DEF = NB_SORT_HEADER_COLUMN_DEF;
|
27336 | exports.NbColumnDefDirective = NbColumnDefDirective;
|
27337 | exports.NbHeaderCellDirective = NbHeaderCellDirective;
|
27338 | exports.NbFooterCellDirective = NbFooterCellDirective;
|
27339 | exports.NbCellDirective = NbCellDirective;
|
27340 | exports.NbDataSource = NbDataSource;
|
27341 | exports.NbDataRowOutletDirective = NbDataRowOutletDirective;
|
27342 | exports.NbHeaderRowOutletDirective = NbHeaderRowOutletDirective;
|
27343 | exports.NbFooterRowOutletDirective = NbFooterRowOutletDirective;
|
27344 | exports.NbNoDataRowOutletDirective = NbNoDataRowOutletDirective;
|
27345 | exports.NbCellOutletDirective = NbCellOutletDirective;
|
27346 | exports.NbHeaderRowDefDirective = NbHeaderRowDefDirective;
|
27347 | exports.NbFooterRowDefDirective = NbFooterRowDefDirective;
|
27348 | exports.NbRowDefDirective = NbRowDefDirective;
|
27349 | exports.NbHeaderRowComponent = NbHeaderRowComponent;
|
27350 | exports.NbFooterRowComponent = NbFooterRowComponent;
|
27351 | exports.NbRowComponent = NbRowComponent;
|
27352 | exports.NB_TABLE_TEMPLATE = NB_TABLE_TEMPLATE;
|
27353 | exports.NB_VIEW_REPEATER_STRATEGY = NB_VIEW_REPEATER_STRATEGY;
|
27354 | exports.NB_COALESCED_STYLE_SCHEDULER = NB_COALESCED_STYLE_SCHEDULER;
|
27355 | exports.NB_TABLE_PROVIDERS = NB_TABLE_PROVIDERS;
|
27356 | exports.NbTable = NbTable;
|
27357 | exports.NbTableModule = NbTableModule;
|
27358 | exports.NB_DIALOG_CONFIG = NB_DIALOG_CONFIG;
|
27359 | exports.NbDialogConfig = NbDialogConfig;
|
27360 | exports.NbDialogRef = NbDialogRef;
|
27361 | exports.NbDialogService = NbDialogService;
|
27362 | exports.NbDialogModule = NbDialogModule;
|
27363 | exports.NbToastrModule = NbToastrModule;
|
27364 | exports.NbToastRef = NbToastRef;
|
27365 | exports.NbToastContainer = NbToastContainer;
|
27366 | exports.NbToastrContainerRegistry = NbToastrContainerRegistry;
|
27367 | exports.NbToastrService = NbToastrService;
|
27368 | exports.NbToast = NbToast;
|
27369 | exports.NbToastComponent = NbToastComponent;
|
27370 | exports.NB_TOASTR_CONFIG = NB_TOASTR_CONFIG;
|
27371 | exports.NbToastrConfig = NbToastrConfig;
|
27372 | exports.NbToastrContainerComponent = NbToastrContainerComponent;
|
27373 | exports.NbTooltipModule = NbTooltipModule;
|
27374 | exports.NbTooltipDirective = NbTooltipDirective;
|
27375 | exports.NbTooltipComponent = NbTooltipComponent;
|
27376 | exports.NbSelectModule = NbSelectModule;
|
27377 | exports.NbSelectLabelComponent = NbSelectLabelComponent;
|
27378 | exports.nbSelectFormFieldControlConfigFactory = nbSelectFormFieldControlConfigFactory;
|
27379 | exports.NbSelectComponent = NbSelectComponent;
|
27380 | exports.NbOptionModule = NbOptionModule;
|
27381 | exports.NbOptionComponent = NbOptionComponent;
|
27382 | exports.NbOptionGroupComponent = NbOptionGroupComponent;
|
27383 | exports.NbOptionListComponent = NbOptionListComponent;
|
27384 | exports.NB_SELECT_INJECTION_TOKEN = NB_SELECT_INJECTION_TOKEN;
|
27385 | exports.NbAutocompleteModule = NbAutocompleteModule;
|
27386 | exports.NbAutocompleteComponent = NbAutocompleteComponent;
|
27387 | exports.NbAutocompleteDirective = NbAutocompleteDirective;
|
27388 | exports.NbWindowModule = NbWindowModule;
|
27389 | exports.NbWindowService = NbWindowService;
|
27390 | exports.NbWindowRef = NbWindowRef;
|
27391 | exports.NB_WINDOW_DEFAULT_BUTTONS_CONFIG = NB_WINDOW_DEFAULT_BUTTONS_CONFIG;
|
27392 | exports.NbWindowConfig = NbWindowConfig;
|
27393 | exports.NB_WINDOW_CONTENT = NB_WINDOW_CONTENT;
|
27394 | exports.NB_WINDOW_CONFIG = NB_WINDOW_CONFIG;
|
27395 | exports.NB_WINDOW_CONTEXT = NB_WINDOW_CONTEXT;
|
27396 | exports.NbWindowComponent = NbWindowComponent;
|
27397 | exports.NbWindowsContainerComponent = NbWindowsContainerComponent;
|
27398 | exports.NbTimepickerModule = NbTimepickerModule;
|
27399 | exports.NB_TIME_PICKER_CONFIG = NB_TIME_PICKER_CONFIG;
|
27400 | exports.NB_DEFAULT_TIMEPICKER_LOCALIZATION_CONFIG = NB_DEFAULT_TIMEPICKER_LOCALIZATION_CONFIG;
|
27401 | exports.NbTimePickerComponent = NbTimePickerComponent;
|
27402 | exports.NbTimePickerDirective = NbTimePickerDirective;
|
27403 | exports.NbDatepickerModule = NbDatepickerModule;
|
27404 | exports.NbDatepickerAdapter = NbDatepickerAdapter;
|
27405 | exports.NbDatepicker = NbDatepicker;
|
27406 | exports.NB_DATE_ADAPTER = NB_DATE_ADAPTER;
|
27407 | exports.NB_DATE_SERVICE_OPTIONS = NB_DATE_SERVICE_OPTIONS;
|
27408 | exports.NbDatepickerDirective = NbDatepickerDirective;
|
27409 | exports.NbDateAdapterService = NbDateAdapterService;
|
27410 | exports.NbRangeAdapterService = NbRangeAdapterService;
|
27411 | exports.NbDateTimeAdapterService = NbDateTimeAdapterService;
|
27412 | exports.NbDatepickerContainerComponent = NbDatepickerContainerComponent;
|
27413 | exports.NbBasePicker = NbBasePicker;
|
27414 | exports.NbBasePickerComponent = NbBasePickerComponent;
|
27415 | exports.NbDatepickerComponent = NbDatepickerComponent;
|
27416 | exports.NbRangepickerComponent = NbRangepickerComponent;
|
27417 | exports.NbDialogContainerComponent = NbDialogContainerComponent;
|
27418 | exports.NbRadioModule = NbRadioModule;
|
27419 | exports.NbRadioGroupComponent = NbRadioGroupComponent;
|
27420 | exports.NbRadioComponent = NbRadioComponent;
|
27421 | exports.NbTagModule = NbTagModule;
|
27422 | exports.NbTagComponent = NbTagComponent;
|
27423 | exports.NbTagListComponent = NbTagListComponent;
|
27424 | exports.NbTagInputDirective = NbTagInputDirective;
|
27425 | exports.NbTreeGridModule = NbTreeGridModule;
|
27426 | exports.NbTreeGridComponent = NbTreeGridComponent;
|
27427 | exports.NB_ROW_DOUBLE_CLICK_DELAY = NB_ROW_DOUBLE_CLICK_DELAY;
|
27428 | exports.NbTreeGridRowComponent = NbTreeGridRowComponent;
|
27429 | exports.NbTreeGridHeaderRowComponent = NbTreeGridHeaderRowComponent;
|
27430 | exports.NbTreeGridFooterRowComponent = NbTreeGridFooterRowComponent;
|
27431 | exports.NB_TREE_GRID = NB_TREE_GRID;
|
27432 | exports.NbSortDirective = NbSortDirective;
|
27433 | exports.NbSortHeaderIconDirective = NbSortHeaderIconDirective;
|
27434 | exports.NbSortIconComponent = NbSortIconComponent;
|
27435 | exports.NbSortHeaderComponent = NbSortHeaderComponent;
|
27436 | exports.NbTreeGridRowToggleComponent = NbTreeGridRowToggleComponent;
|
27437 | exports.NbTreeGridColumnDefDirective = NbTreeGridColumnDefDirective;
|
27438 | exports.NbTreeGridCellDirective = NbTreeGridCellDirective;
|
27439 | exports.NbTreeGridHeaderCellDirective = NbTreeGridHeaderCellDirective;
|
27440 | exports.NbTreeGridFooterCellDirective = NbTreeGridFooterCellDirective;
|
27441 | exports.NbTreeGridRowDefDirective = NbTreeGridRowDefDirective;
|
27442 | exports.NbTreeGridHeaderRowDefDirective = NbTreeGridHeaderRowDefDirective;
|
27443 | exports.NbTreeGridFooterRowDefDirective = NbTreeGridFooterRowDefDirective;
|
27444 | exports.NbTreeGridCellDefDirective = NbTreeGridCellDefDirective;
|
27445 | exports.NbTreeGridHeaderCellDefDirective = NbTreeGridHeaderCellDefDirective;
|
27446 | exports.NbTreeGridFooterCellDefDirective = NbTreeGridFooterCellDefDirective;
|
27447 | exports.NbFilterDirective = NbFilterDirective;
|
27448 | exports.NbFilterInputDirective = NbFilterInputDirective;
|
27449 | exports.NbTreeGridRowToggleDirective = NbTreeGridRowToggleDirective;
|
27450 | exports.NB_DEFAULT_ROW_LEVEL = NB_DEFAULT_ROW_LEVEL;
|
27451 | exports.NbTreeGridPresentationNode = NbTreeGridPresentationNode;
|
27452 | exports.NbTreeGridDataSource = NbTreeGridDataSource;
|
27453 | exports.NbTreeGridDataSourceBuilder = NbTreeGridDataSourceBuilder;
|
27454 | exports.NbTreeGridDataService = NbTreeGridDataService;
|
27455 | exports.NbTreeGridFilterService = NbTreeGridFilterService;
|
27456 | exports.NbTreeGridService = NbTreeGridService;
|
27457 | exports.NbTreeGridSortService = NbTreeGridSortService;
|
27458 | exports.NbColumnsService = NbColumnsService;
|
27459 | exports.NbIconModule = NbIconModule;
|
27460 | exports.NbIconComponent = NbIconComponent;
|
27461 | exports.NbFontIcon = NbFontIcon;
|
27462 | exports.NbSvgIcon = NbSvgIcon;
|
27463 | exports.NbIconDefinition = NbIconDefinition;
|
27464 | exports.NbIconLibraries = NbIconLibraries;
|
27465 | exports.NbToggleModule = NbToggleModule;
|
27466 | exports.NbToggleComponent = NbToggleComponent;
|
27467 | exports.NbFormFieldModule = NbFormFieldModule;
|
27468 | exports.NbFormFieldComponent = NbFormFieldComponent;
|
27469 | exports.NbPrefixDirective = NbPrefixDirective;
|
27470 | exports.NbSuffixDirective = NbSuffixDirective;
|
27471 | exports.NbFormFieldControl = NbFormFieldControl;
|
27472 | exports.NbFormFieldControlConfig = NbFormFieldControlConfig;
|
27473 |
|
27474 | Object.defineProperty(exports, '__esModule', { value: true });
|
27475 |
|
27476 | })));
|