UNPKG

669 kBSource Map (JSON)View Raw
1{"version":3,"file":"ng-bootstrap.js","sources":["../../src/util/util.ts","../../../src/environment.ts","../../../src/ngb-config.ts","../../src/accordion/accordion-config.ts","../src/util/transition/util.ts","../src/util/transition/ngbTransition.ts","../src/util/transition/ngbCollapseTransition.ts","../../src/accordion/accordion.ts","../../src/accordion/accordion.module.ts","../../src/alert/alert-config.ts","../../src/alert/alert-transition.ts","../../src/alert/alert.ts","../../src/alert/alert.module.ts","../../src/buttons/label.ts","../../src/buttons/checkbox.ts","../../src/buttons/radio.ts","../../src/buttons/buttons.module.ts","../../src/carousel/carousel-config.ts","../../src/carousel/carousel-transition.ts","../../src/carousel/carousel.ts","../../src/carousel/carousel.module.ts","../../src/collapse/collapse-config.ts","../../src/collapse/collapse.ts","../../src/collapse/collapse.module.ts","../../src/datepicker/ngb-date.ts","../../src/datepicker/ngb-calendar.ts","../../src/datepicker/datepicker-tools.ts","../../src/datepicker/datepicker-i18n.ts","../../src/datepicker/datepicker-service.ts","../../src/datepicker/datepicker-view-model.ts","../../src/datepicker/datepicker-config.ts","../src/datepicker/adapters/ngb-date-adapter.ts","../../src/datepicker/datepicker.ts","../../src/util/key.ts","../../src/datepicker/datepicker-keyboard-service.ts","../../src/datepicker/datepicker-month.ts","../../src/datepicker/datepicker-navigation.ts","../../src/util/autoclose.ts","../../src/util/focus-trap.ts","../../src/util/positioning.ts","../../src/datepicker/ngb-date-parser-formatter.ts","../../src/datepicker/datepicker-input-config.ts","../../src/datepicker/datepicker-input.ts","../../src/datepicker/datepicker-day-view.ts","../../src/datepicker/datepicker-navigation-select.ts","../src/datepicker/hijri/ngb-calendar-hijri.ts","../src/datepicker/hijri/ngb-calendar-islamic-civil.ts","../src/datepicker/hijri/ngb-calendar-islamic-umalqura.ts","../src/datepicker/jalali/jalali.ts","../src/datepicker/jalali/ngb-calendar-persian.ts","../src/datepicker/hebrew/hebrew.ts","../src/datepicker/hebrew/ngb-calendar-hebrew.ts","../src/datepicker/hebrew/datepicker-i18n-hebrew.ts","../src/datepicker/buddhist/buddhist.ts","../src/datepicker/buddhist/ngb-calendar-buddhist.ts","../src/datepicker/adapters/ngb-date-native-adapter.ts","../src/datepicker/adapters/ngb-date-native-utc-adapter.ts","../../src/datepicker/datepicker.module.ts","../../src/dropdown/dropdown-config.ts","../../src/dropdown/dropdown.ts","../../src/dropdown/dropdown.module.ts","../../src/modal/modal-config.ts","../../src/util/popup.ts","../../src/util/scrollbar.ts","../../src/modal/modal-backdrop.ts","../../src/modal/modal-ref.ts","../../src/modal/modal-dismiss-reasons.ts","../../src/modal/modal-window.ts","../../src/modal/modal-stack.ts","../../src/modal/modal.ts","../../src/modal/modal.module.ts","../../src/nav/nav-config.ts","../../src/nav/nav.ts","../../src/nav/nav-transition.ts","../../src/nav/nav-outlet.ts","../../src/nav/nav.module.ts","../../src/pagination/pagination-config.ts","../../src/pagination/pagination.ts","../../src/pagination/pagination.module.ts","../../src/util/triggers.ts","../../src/popover/popover-config.ts","../../src/popover/popover.ts","../../src/popover/popover.module.ts","../../src/progressbar/progressbar-config.ts","../../src/progressbar/progressbar.ts","../../src/progressbar/progressbar.module.ts","../../src/rating/rating-config.ts","../../src/rating/rating.ts","../../src/rating/rating.module.ts","../../src/timepicker/ngb-time.ts","../../src/timepicker/timepicker-config.ts","../../src/timepicker/ngb-time-adapter.ts","../../src/timepicker/timepicker-i18n.ts","../../src/timepicker/timepicker.ts","../../src/timepicker/timepicker.module.ts","../../src/toast/toast-config.ts","../../src/toast/toast-transition.ts","../../src/toast/toast.ts","../../src/toast/toast.module.ts","../../src/tooltip/tooltip-config.ts","../../src/tooltip/tooltip.ts","../../src/tooltip/tooltip.module.ts","../../src/typeahead/highlight.ts","../../src/typeahead/typeahead-window.ts","../src/util/accessibility/live.ts","../../src/typeahead/typeahead-config.ts","../../src/typeahead/typeahead.ts","../../src/typeahead/typeahead.module.ts","../../../src/index.ts","../../../src/ng-bootstrap.ts"],"sourcesContent":["import {NgZone} from '@angular/core';\r\nimport {Observable, OperatorFunction} from 'rxjs';\r\n\r\nexport function toInteger(value: any): number {\r\n return parseInt(`${value}`, 10);\r\n}\r\n\r\nexport function toString(value: any): string {\r\n return (value !== undefined && value !== null) ? `${value}` : '';\r\n}\r\n\r\nexport function getValueInRange(value: number, max: number, min = 0): number {\r\n return Math.max(Math.min(value, max), min);\r\n}\r\n\r\nexport function isString(value: any): value is string {\r\n return typeof value === 'string';\r\n}\r\n\r\nexport function isNumber(value: any): value is number {\r\n return !isNaN(toInteger(value));\r\n}\r\n\r\nexport function isInteger(value: any): value is number {\r\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n}\r\n\r\nexport function isDefined(value: any): boolean {\r\n return value !== undefined && value !== null;\r\n}\r\n\r\nexport function padNumber(value: number) {\r\n if (isNumber(value)) {\r\n return `0${value}`.slice(-2);\r\n } else {\r\n return '';\r\n }\r\n}\r\n\r\nexport function regExpEscape(text) {\r\n return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\r\n}\r\n\r\nexport function hasClassName(element: any, className: string): boolean {\r\n return element && element.className && element.className.split &&\r\n element.className.split(/\\s+/).indexOf(className) >= 0;\r\n}\r\n\r\nif (typeof Element !== 'undefined' && !Element.prototype.closest) {\r\n // Polyfill for ie10+\r\n\r\n if (!Element.prototype.matches) {\r\n // IE uses the non-standard name: msMatchesSelector\r\n Element.prototype.matches = (Element.prototype as any).msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n }\r\n\r\n Element.prototype.closest = function(s: string) {\r\n let el = this;\r\n if (!document.documentElement.contains(el)) {\r\n return null;\r\n }\r\n do {\r\n if (el.matches(s)) {\r\n return el;\r\n }\r\n el = el.parentElement || el.parentNode;\r\n } while (el !== null && el.nodeType === 1);\r\n return null;\r\n };\r\n}\r\n\r\nexport function closest(element: HTMLElement, selector?: string): HTMLElement | null {\r\n if (!selector) {\r\n return null;\r\n }\r\n\r\n /*\r\n * In certain browsers (e.g. Edge 44.18362.449.0) HTMLDocument does\r\n * not support `Element.prototype.closest`. To emulate the correct behaviour\r\n * we return null when the method is missing.\r\n *\r\n * Note that in evergreen browsers `closest(document.documentElement, 'html')`\r\n * will return the document element whilst in Edge null will be returned. This\r\n * compromise was deemed good enough.\r\n */\r\n if (typeof element.closest === 'undefined') {\r\n return null;\r\n }\r\n\r\n return element.closest(selector);\r\n}\r\n\r\n/**\r\n * Force a browser reflow\r\n * @param element element where to apply the reflow\r\n */\r\nexport function reflow(element: HTMLElement) {\r\n return (element || document.body).getBoundingClientRect();\r\n}\r\n\r\n/**\r\n * Creates an observable where all callbacks are executed inside a given zone\r\n *\r\n * @param zone\r\n */\r\nexport function runInZone<T>(zone: NgZone): OperatorFunction<T, T> {\r\n return (source) => {\r\n return new Observable(observer => {\r\n const onNext = (value: T) => zone.run(() => observer.next(value));\r\n const onError = (e: any) => zone.run(() => observer.error(e));\r\n const onComplete = () => zone.run(() => observer.complete());\r\n return source.subscribe(onNext, onError, onComplete);\r\n });\r\n };\r\n}\r\n\r\nexport function removeAccents(str: string): string {\r\n return str.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\r\n}\r\n","export const environment = {\r\n animation: true,\r\n transitionTimerDelayMs: 5,\r\n};\r\n","import {Injectable} from '@angular/core';\r\nimport {environment} from './environment';\r\n\r\n/**\r\n * Global ng-bootstrap config\r\n *\r\n * @since 8.0.0\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbConfig {\r\n animation = environment.animation;\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbConfig} from '../ngb-config';\r\n\r\n/**\r\n * A configuration service for the [NgbAccordion](#/components/accordion/api#NgbAccordion) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize its properties\r\n * to provide default values for all accordions used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbAccordionConfig {\r\n closeOthers = false;\r\n type: string;\r\n\r\n private _animation: boolean;\r\n\r\n constructor(private _ngbConfig: NgbConfig) {}\r\n\r\n get animation(): boolean { return (this._animation === undefined) ? this._ngbConfig.animation : this._animation; }\r\n set animation(animation: boolean) { this._animation = animation; }\r\n}\r\n","export function getTransitionDurationMs(element: HTMLElement) {\r\n const {transitionDelay, transitionDuration} = window.getComputedStyle(element);\r\n const transitionDelaySec = parseFloat(transitionDelay);\r\n const transitionDurationSec = parseFloat(transitionDuration);\r\n\r\n return (transitionDelaySec + transitionDurationSec) * 1000;\r\n}\r\n","import {NgZone} from '@angular/core';\r\nimport {EMPTY, fromEvent, Observable, of, race, Subject, timer} from 'rxjs';\r\nimport {endWith, filter, takeUntil} from 'rxjs/operators';\r\nimport {getTransitionDurationMs} from './util';\r\nimport {environment} from '../../environment';\r\nimport {runInZone} from '../util';\r\n\r\nexport type NgbTransitionStartFn<T = any> = (element: HTMLElement, animation: boolean, context: T) =>\r\n NgbTransitionEndFn | void;\r\nexport type NgbTransitionEndFn = () => void;\r\n\r\nexport interface NgbTransitionOptions<T> {\r\n animation: boolean;\r\n runningTransition: 'continue' | 'stop';\r\n context?: T;\r\n}\r\n\r\nexport interface NgbTransitionCtx<T> {\r\n transition$: Subject<any>;\r\n complete: () => void;\r\n context: T;\r\n}\r\n\r\nconst noopFn: NgbTransitionEndFn = () => {};\r\n\r\nconst {transitionTimerDelayMs} = environment;\r\nconst runningTransitions = new Map<HTMLElement, NgbTransitionCtx<any>>();\r\n\r\nexport const ngbRunTransition =\r\n <T>(zone: NgZone, element: HTMLElement, startFn: NgbTransitionStartFn<T>, options: NgbTransitionOptions<T>):\r\n Observable<undefined> => {\r\n\r\n // Getting initial context from options\r\n let context = options.context || <T>{};\r\n\r\n // Checking if there are already running transitions on the given element.\r\n const running = runningTransitions.get(element);\r\n if (running) {\r\n switch (options.runningTransition) {\r\n // If there is one running and we want for it to 'continue' to run, we have to cancel the new one.\r\n // We're not emitting any values, but simply completing the observable (EMPTY).\r\n case 'continue':\r\n return EMPTY;\r\n // If there is one running and we want for it to 'stop', we have to complete the running one.\r\n // We're simply completing the running one and not emitting any values and merging newly provided context\r\n // with the one coming from currently running transition.\r\n case 'stop':\r\n zone.run(() => running.transition$.complete());\r\n context = Object.assign(running.context, context);\r\n runningTransitions.delete(element);\r\n }\r\n }\r\n\r\n // Running the start function\r\n const endFn = startFn(element, options.animation, context) || noopFn;\r\n\r\n // If 'prefer-reduced-motion' is enabled, the 'transition' will be set to 'none'.\r\n // If animations are disabled, we have to emit a value and complete the observable\r\n // In this case we have to call the end function, but can finish immediately by emitting a value,\r\n // completing the observable and executing end functions synchronously.\r\n if (!options.animation || window.getComputedStyle(element).transitionProperty === 'none') {\r\n zone.run(() => endFn());\r\n return of(undefined).pipe(runInZone(zone));\r\n }\r\n\r\n // Starting a new transition\r\n const transition$ = new Subject<any>();\r\n const finishTransition$ = new Subject<any>();\r\n const stop$ = transition$.pipe(endWith(true));\r\n runningTransitions.set(element, {\r\n transition$,\r\n complete: () => {\r\n finishTransition$.next();\r\n finishTransition$.complete();\r\n },\r\n context\r\n });\r\n\r\n const transitionDurationMs = getTransitionDurationMs(element);\r\n\r\n // 1. We have to both listen for the 'transitionend' event and have a 'just-in-case' timer,\r\n // because 'transitionend' event might not be fired in some browsers, if the transitioning\r\n // element becomes invisible (ex. when scrolling, making browser tab inactive, etc.). The timer\r\n // guarantees, that we'll release the DOM element and complete 'ngbRunTransition'.\r\n // 2. We need to filter transition end events, because they might bubble from shorter transitions\r\n // on inner DOM elements. We're only interested in the transition on the 'element' itself.\r\n zone.runOutsideAngular(() => {\r\n const transitionEnd$ =\r\n fromEvent(element, 'transitionend').pipe(takeUntil(stop$), filter(({target}) => target === element));\r\n const timer$ = timer(transitionDurationMs + transitionTimerDelayMs).pipe(takeUntil(stop$));\r\n\r\n race(timer$, transitionEnd$, finishTransition$).pipe(takeUntil(stop$)).subscribe(() => {\r\n runningTransitions.delete(element);\r\n zone.run(() => {\r\n endFn();\r\n transition$.next();\r\n transition$.complete();\r\n });\r\n });\r\n });\r\n\r\n return transition$.asObservable();\r\n };\r\n\r\nexport const ngbCompleteTransition = (element: HTMLElement) => {\r\n runningTransitions.get(element) ?.complete();\r\n};\r\n","import {NgbTransitionStartFn} from './ngbTransition';\r\nimport {reflow} from '../util';\r\n\r\nexport interface NgbCollapseCtx {\r\n direction: 'show' | 'hide';\r\n maxHeight?: string;\r\n}\r\n\r\nfunction measureCollapsingElementHeightPx(element: HTMLElement): string {\r\n // SSR fix for without injecting the PlatformId\r\n if (typeof navigator === 'undefined') {\r\n return '0px';\r\n }\r\n\r\n const {classList} = element;\r\n const hasShownClass = classList.contains('show');\r\n if (!hasShownClass) {\r\n classList.add('show');\r\n }\r\n\r\n element.style.height = '';\r\n const height = element.getBoundingClientRect().height + 'px';\r\n\r\n if (!hasShownClass) {\r\n classList.remove('show');\r\n }\r\n\r\n return height;\r\n}\r\n\r\nexport const ngbCollapsingTransition: NgbTransitionStartFn<NgbCollapseCtx> =\r\n (element: HTMLElement, animation: boolean, context: NgbCollapseCtx) => {\r\n let {direction, maxHeight} = context;\r\n const {classList} = element;\r\n\r\n function setInitialClasses() {\r\n classList.add('collapse');\r\n if (direction === 'show') {\r\n classList.add('show');\r\n } else {\r\n classList.remove('show');\r\n }\r\n }\r\n\r\n // without animations we just need to set initial classes\r\n if (!animation) {\r\n setInitialClasses();\r\n return;\r\n }\r\n\r\n // No maxHeight -> running the transition for the first time\r\n if (!maxHeight) {\r\n maxHeight = measureCollapsingElementHeightPx(element);\r\n context.maxHeight = maxHeight;\r\n\r\n // Fix the height before starting the animation\r\n element.style.height = direction !== 'show' ? maxHeight : '0px';\r\n\r\n classList.remove('collapse');\r\n classList.remove('collapsing');\r\n classList.remove('show');\r\n\r\n reflow(element);\r\n\r\n // Start the animation\r\n classList.add('collapsing');\r\n }\r\n\r\n // Start or revert the animation\r\n element.style.height = direction === 'show' ? maxHeight : '0px';\r\n\r\n return () => {\r\n setInitialClasses();\r\n classList.remove('collapsing');\r\n element.style.height = '';\r\n };\r\n };\r\n","import {\r\n AfterContentChecked,\r\n ChangeDetectorRef,\r\n Component,\r\n ContentChildren,\r\n Directive,\r\n ElementRef,\r\n EventEmitter,\r\n Host,\r\n Input,\r\n Optional,\r\n Output,\r\n QueryList,\r\n TemplateRef,\r\n ViewEncapsulation,\r\n NgZone,\r\n} from '@angular/core';\r\n\r\nimport {isString} from '../util/util';\r\n\r\nimport {NgbAccordionConfig} from './accordion-config';\r\nimport {ngbRunTransition} from '../util/transition/ngbTransition';\r\nimport {ngbCollapsingTransition} from '../util/transition/ngbCollapseTransition';\r\nimport {take} from 'rxjs/operators';\r\n\r\nlet nextId = 0;\r\n\r\n/**\r\n * The context for the [NgbPanelHeader](#/components/accordion/api#NgbPanelHeader) template\r\n *\r\n * @since 4.1.0\r\n */\r\nexport interface NgbPanelHeaderContext {\r\n /**\r\n * `True` if current panel is opened\r\n */\r\n opened: boolean;\r\n}\r\n\r\n/**\r\n * A directive that wraps an accordion panel header with any HTML markup and a toggling button\r\n * marked with [`NgbPanelToggle`](#/components/accordion/api#NgbPanelToggle).\r\n * See the [header customization demo](#/components/accordion/examples#header) for more details.\r\n *\r\n * You can also use [`NgbPanelTitle`](#/components/accordion/api#NgbPanelTitle) to customize only the panel title.\r\n *\r\n * @since 4.1.0\r\n */\r\n@Directive({selector: 'ng-template[ngbPanelHeader]'})\r\nexport class NgbPanelHeader {\r\n constructor(public templateRef: TemplateRef<any>) {}\r\n}\r\n\r\n/**\r\n * A directive that wraps only the panel title with HTML markup inside.\r\n *\r\n * You can also use [`NgbPanelHeader`](#/components/accordion/api#NgbPanelHeader) to customize the full panel header.\r\n */\r\n@Directive({selector: 'ng-template[ngbPanelTitle]'})\r\nexport class NgbPanelTitle {\r\n constructor(public templateRef: TemplateRef<any>) {}\r\n}\r\n\r\n/**\r\n * A directive that wraps the accordion panel content.\r\n */\r\n@Directive({selector: 'ng-template[ngbPanelContent]'})\r\nexport class NgbPanelContent {\r\n constructor(public templateRef: TemplateRef<any>) {}\r\n}\r\n\r\n/**\r\n * A directive that wraps an individual accordion panel with title and collapsible content.\r\n */\r\n@Directive({selector: 'ngb-panel'})\r\nexport class NgbPanel implements AfterContentChecked {\r\n /**\r\n * If `true`, the panel is disabled an can't be toggled.\r\n */\r\n @Input() disabled = false;\r\n\r\n /**\r\n * An optional id for the panel that must be unique on the page.\r\n *\r\n * If not provided, it will be auto-generated in the `ngb-panel-xxx` format.\r\n */\r\n @Input() id = `ngb-panel-${nextId++}`;\r\n\r\n isOpen = false;\r\n\r\n /* A flag to specified that the transition panel classes have been initialized */\r\n initClassDone = false;\r\n\r\n /* A flag to specified if the panel is currently being animated, to ensure its presence in the dom */\r\n transitionRunning = false;\r\n\r\n /**\r\n * The panel title.\r\n *\r\n * You can alternatively use [`NgbPanelTitle`](#/components/accordion/api#NgbPanelTitle) to set panel title.\r\n */\r\n @Input() title: string;\r\n\r\n /**\r\n * Type of the current panel.\r\n *\r\n * Bootstrap provides styles for the following types: `'success'`, `'info'`, `'warning'`, `'danger'`, `'primary'`,\r\n * `'secondary'`, `'light'` and `'dark'`.\r\n */\r\n @Input() type: string;\r\n\r\n /**\r\n * An optional class applied to the accordion card element that wraps both panel title and content.\r\n *\r\n * @since 5.3.0\r\n */\r\n @Input() cardClass: string;\r\n\r\n /**\r\n * An event emitted when the panel is shown, after the transition. It has no payload.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() shown = new EventEmitter<void>();\r\n\r\n /**\r\n * An event emitted when the panel is hidden, after the transition. It has no payload.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() hidden = new EventEmitter<void>();\r\n\r\n\r\n titleTpl: NgbPanelTitle;\r\n headerTpl: NgbPanelHeader;\r\n contentTpl: NgbPanelContent;\r\n\r\n @ContentChildren(NgbPanelTitle, {descendants: false}) titleTpls: QueryList<NgbPanelTitle>;\r\n @ContentChildren(NgbPanelHeader, {descendants: false}) headerTpls: QueryList<NgbPanelHeader>;\r\n @ContentChildren(NgbPanelContent, {descendants: false}) contentTpls: QueryList<NgbPanelContent>;\r\n\r\n ngAfterContentChecked() {\r\n // We are using @ContentChildren instead of @ContentChild as in the Angular version being used\r\n // only @ContentChildren allows us to specify the {descendants: false} option.\r\n // Without {descendants: false} we are hitting bugs described in:\r\n // https://github.com/ng-bootstrap/ng-bootstrap/issues/2240\r\n this.titleTpl = this.titleTpls.first;\r\n this.headerTpl = this.headerTpls.first;\r\n this.contentTpl = this.contentTpls.first;\r\n }\r\n}\r\n\r\n/**\r\n * An event emitted right before toggling an accordion panel.\r\n */\r\nexport interface NgbPanelChangeEvent {\r\n /**\r\n * The id of the accordion panel being toggled.\r\n */\r\n panelId: string;\r\n\r\n /**\r\n * The next state of the panel.\r\n *\r\n * `true` if it will be opened, `false` if closed.\r\n */\r\n nextState: boolean;\r\n\r\n /**\r\n * Calling this function will prevent panel toggling.\r\n */\r\n preventDefault: () => void;\r\n}\r\n\r\n/**\r\n * Accordion is a collection of collapsible panels (bootstrap cards).\r\n *\r\n * It can ensure only one panel is opened at a time and allows to customize panel\r\n * headers.\r\n */\r\n@Component({\r\n selector: 'ngb-accordion',\r\n exportAs: 'ngbAccordion',\r\n encapsulation: ViewEncapsulation.None,\r\n host: {'class': 'accordion', 'role': 'tablist', '[attr.aria-multiselectable]': '!closeOtherPanels'},\r\n template: `\r\n <ng-template #t ngbPanelHeader let-panel>\r\n <button class=\"btn btn-link\" [ngbPanelToggle]=\"panel\">\r\n {{panel.title}}<ng-template [ngTemplateOutlet]=\"panel.titleTpl?.templateRef\"></ng-template>\r\n </button>\r\n </ng-template>\r\n <ng-template ngFor let-panel [ngForOf]=\"panels\">\r\n <div [class]=\"'card ' + (panel.cardClass || '')\">\r\n <div role=\"tab\" id=\"{{panel.id}}-header\" [class]=\"'card-header ' + (panel.type ? 'bg-'+panel.type: type ? 'bg-'+type : '')\">\r\n <ng-template [ngTemplateOutlet]=\"panel.headerTpl?.templateRef || t\"\r\n [ngTemplateOutletContext]=\"{$implicit: panel, opened: panel.isOpen}\"></ng-template>\r\n </div>\r\n <div id=\"{{panel.id}}\" role=\"tabpanel\" [attr.aria-labelledby]=\"panel.id + '-header'\"\r\n *ngIf=\"!destroyOnHide || panel.isOpen || panel.transitionRunning\">\r\n <div class=\"card-body\">\r\n <ng-template [ngTemplateOutlet]=\"panel.contentTpl?.templateRef || null\"></ng-template>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n `\r\n})\r\nexport class NgbAccordion implements AfterContentChecked {\r\n @ContentChildren(NgbPanel) panels: QueryList<NgbPanel>;\r\n\r\n /**\r\n * If `true`, accordion will be animated.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Input() animation;\r\n\r\n /**\r\n * An array or comma separated strings of panel ids that should be opened **initially**.\r\n *\r\n * For subsequent changes use methods like `expand()`, `collapse()`, etc. and\r\n * the `(panelChange)` event.\r\n */\r\n @Input() activeIds: string | readonly string[] = [];\r\n\r\n /**\r\n * If `true`, only one panel could be opened at a time.\r\n *\r\n * Opening a new panel will close others.\r\n */\r\n @Input('closeOthers') closeOtherPanels: boolean;\r\n\r\n /**\r\n * If `true`, panel content will be detached from DOM and not simply hidden when the panel is collapsed.\r\n */\r\n @Input() destroyOnHide = true;\r\n\r\n /**\r\n * Type of panels.\r\n *\r\n * Bootstrap provides styles for the following types: `'success'`, `'info'`, `'warning'`, `'danger'`, `'primary'`,\r\n * `'secondary'`, `'light'` and `'dark'`.\r\n */\r\n @Input() type: string;\r\n\r\n /**\r\n * Event emitted right before the panel toggle happens.\r\n *\r\n * See [NgbPanelChangeEvent](#/components/accordion/api#NgbPanelChangeEvent) for payload details.\r\n */\r\n @Output() panelChange = new EventEmitter<NgbPanelChangeEvent>();\r\n\r\n /**\r\n * An event emitted when the expanding animation is finished on the panel. The payload is the panel id.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() shown = new EventEmitter<string>();\r\n\r\n /**\r\n * An event emitted when the collapsing animation is finished on the panel, and before the panel element is removed.\r\n * The payload is the panel id.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() hidden = new EventEmitter<string>();\r\n\r\n constructor(\r\n config: NgbAccordionConfig, private _element: ElementRef, private _ngZone: NgZone,\r\n private _changeDetector: ChangeDetectorRef) {\r\n this.animation = config.animation;\r\n this.type = config.type;\r\n this.closeOtherPanels = config.closeOthers;\r\n }\r\n\r\n /**\r\n * Checks if a panel with a given id is expanded.\r\n */\r\n isExpanded(panelId: string): boolean { return this.activeIds.indexOf(panelId) > -1; }\r\n\r\n /**\r\n * Expands a panel with a given id.\r\n *\r\n * Has no effect if the panel is already expanded or disabled.\r\n */\r\n expand(panelId: string): void { this._changeOpenState(this._findPanelById(panelId), true); }\r\n\r\n /**\r\n * Expands all panels, if `[closeOthers]` is `false`.\r\n *\r\n * If `[closeOthers]` is `true`, it will expand the first panel, unless there is already a panel opened.\r\n */\r\n expandAll(): void {\r\n if (this.closeOtherPanels) {\r\n if (this.activeIds.length === 0 && this.panels.length) {\r\n this._changeOpenState(this.panels.first, true);\r\n }\r\n } else {\r\n this.panels.forEach(panel => this._changeOpenState(panel, true));\r\n }\r\n }\r\n\r\n /**\r\n * Collapses a panel with the given id.\r\n *\r\n * Has no effect if the panel is already collapsed or disabled.\r\n */\r\n collapse(panelId: string) { this._changeOpenState(this._findPanelById(panelId), false); }\r\n\r\n /**\r\n * Collapses all opened panels.\r\n */\r\n collapseAll() {\r\n this.panels.forEach((panel) => { this._changeOpenState(panel, false); });\r\n }\r\n\r\n /**\r\n * Toggles a panel with the given id.\r\n *\r\n * Has no effect if the panel is disabled.\r\n */\r\n toggle(panelId: string) {\r\n const panel = this._findPanelById(panelId);\r\n if (panel) {\r\n this._changeOpenState(panel, !panel.isOpen);\r\n }\r\n }\r\n\r\n ngAfterContentChecked() {\r\n // active id updates\r\n if (isString(this.activeIds)) {\r\n this.activeIds = this.activeIds.split(/\\s*,\\s*/);\r\n }\r\n\r\n // update panels open states\r\n this.panels.forEach(panel => { panel.isOpen = !panel.disabled && this.activeIds.indexOf(panel.id) > -1; });\r\n\r\n // closeOthers updates\r\n if (this.activeIds.length > 1 && this.closeOtherPanels) {\r\n this._closeOthers(this.activeIds[0], false);\r\n this._updateActiveIds();\r\n }\r\n\r\n // Setup the initial classes here\r\n this._ngZone.onStable.pipe(take(1)).subscribe(() => {\r\n this.panels.forEach(panel => {\r\n const panelElement = this._getPanelElement(panel.id);\r\n if (panelElement) {\r\n if (!panel.initClassDone) {\r\n panel.initClassDone = true;\r\n ngbRunTransition(this._ngZone, panelElement, ngbCollapsingTransition, {\r\n animation: false,\r\n runningTransition: 'continue',\r\n context: {direction: panel.isOpen ? 'show' : 'hide'}\r\n });\r\n }\r\n } else {\r\n // Classes must be initialized next time it will be in the dom\r\n panel.initClassDone = false;\r\n }\r\n });\r\n });\r\n }\r\n\r\n private _changeOpenState(panel: NgbPanel | null, nextState: boolean) {\r\n if (panel != null && !panel.disabled && panel.isOpen !== nextState) {\r\n let defaultPrevented = false;\r\n\r\n this.panelChange.emit(\r\n {panelId: panel.id, nextState: nextState, preventDefault: () => { defaultPrevented = true; }});\r\n\r\n if (!defaultPrevented) {\r\n panel.isOpen = nextState;\r\n panel.transitionRunning = true;\r\n\r\n if (nextState && this.closeOtherPanels) {\r\n this._closeOthers(panel.id);\r\n }\r\n this._updateActiveIds();\r\n this._runTransitions(this.animation);\r\n }\r\n }\r\n }\r\n\r\n private _closeOthers(panelId: string, enableTransition = true) {\r\n this.panels.forEach(panel => {\r\n if (panel.id !== panelId && panel.isOpen) {\r\n panel.isOpen = false;\r\n panel.transitionRunning = enableTransition;\r\n }\r\n });\r\n }\r\n\r\n private _findPanelById(panelId: string): NgbPanel | null { return this.panels.find(p => p.id === panelId) || null; }\r\n\r\n private _updateActiveIds() {\r\n this.activeIds = this.panels.filter(panel => panel.isOpen && !panel.disabled).map(panel => panel.id);\r\n }\r\n\r\n private _runTransitions(animation: boolean) {\r\n // detectChanges is performed to ensure that all panels are in the dom (via transitionRunning = true)\r\n // before starting the animation\r\n this._changeDetector.detectChanges();\r\n\r\n this.panels.forEach(panel => {\r\n // When panel.transitionRunning is true, the transition needs to be started OR reversed,\r\n // The direction (show or hide) is choosen by each panel.isOpen state\r\n if (panel.transitionRunning) {\r\n const panelElement = this._getPanelElement(panel.id);\r\n ngbRunTransition(this._ngZone, panelElement !, ngbCollapsingTransition, {\r\n animation,\r\n runningTransition: 'stop',\r\n context: {direction: panel.isOpen ? 'show' : 'hide'}\r\n }).subscribe(() => {\r\n panel.transitionRunning = false;\r\n const {id} = panel;\r\n if (panel.isOpen) {\r\n panel.shown.emit();\r\n this.shown.emit(id);\r\n } else {\r\n panel.hidden.emit();\r\n this.hidden.emit(id);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n private _getPanelElement(panelId: string): HTMLElement | null {\r\n return this._element.nativeElement.querySelector('#' + panelId);\r\n }\r\n}\r\n\r\n/**\r\n * A directive to put on a button that toggles panel opening and closing.\r\n *\r\n * To be used inside the [`NgbPanelHeader`](#/components/accordion/api#NgbPanelHeader)\r\n *\r\n * @since 4.1.0\r\n */\r\n@Directive({\r\n selector: 'button[ngbPanelToggle]',\r\n host: {\r\n 'type': 'button',\r\n '[disabled]': 'panel.disabled',\r\n '[class.collapsed]': '!panel.isOpen',\r\n '[attr.aria-expanded]': 'panel.isOpen',\r\n '[attr.aria-controls]': 'panel.id',\r\n '(click)': 'accordion.toggle(panel.id)'\r\n }\r\n})\r\nexport class NgbPanelToggle {\r\n static ngAcceptInputType_ngbPanelToggle: NgbPanel | '';\r\n\r\n @Input()\r\n set ngbPanelToggle(panel: NgbPanel) {\r\n if (panel) {\r\n this.panel = panel;\r\n }\r\n }\r\n\r\n constructor(public accordion: NgbAccordion, @Optional() @Host() public panel: NgbPanel) {}\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport {NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent, NgbPanelHeader, NgbPanelToggle} from './accordion';\r\n\r\nexport {\r\n NgbAccordion,\r\n NgbPanel,\r\n NgbPanelTitle,\r\n NgbPanelContent,\r\n NgbPanelChangeEvent,\r\n NgbPanelHeader,\r\n NgbPanelHeaderContext,\r\n NgbPanelToggle\r\n} from './accordion';\r\nexport {NgbAccordionConfig} from './accordion-config';\r\n\r\nconst NGB_ACCORDION_DIRECTIVES =\r\n [NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent, NgbPanelHeader, NgbPanelToggle];\r\n\r\n@NgModule({declarations: NGB_ACCORDION_DIRECTIVES, exports: NGB_ACCORDION_DIRECTIVES, imports: [CommonModule]})\r\nexport class NgbAccordionModule {\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbConfig} from '../ngb-config';\r\n\r\n/**\r\n * A configuration service for the [NgbAlert](#/components/alert/api#NgbAlert) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize its properties\r\n * to provide default values for all alerts used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbAlertConfig {\r\n dismissible = true;\r\n type = 'warning';\r\n\r\n private _animation: boolean;\r\n\r\n constructor(private _ngbConfig: NgbConfig) {}\r\n\r\n get animation(): boolean { return (this._animation === undefined) ? this._ngbConfig.animation : this._animation; }\r\n set animation(animation: boolean) { this._animation = animation; }\r\n}\r\n","import {NgbTransitionStartFn} from '../util/transition/ngbTransition';\r\n\r\nexport const ngbAlertFadingTransition: NgbTransitionStartFn = ({classList}: HTMLElement) => {\r\n classList.remove('show');\r\n};\r\n","import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n ChangeDetectionStrategy,\r\n Renderer2,\r\n ElementRef,\r\n OnChanges,\r\n OnInit,\r\n SimpleChanges,\r\n ViewEncapsulation,\r\n NgZone\r\n} from '@angular/core';\r\n\r\nimport {Observable} from 'rxjs';\r\n\r\nimport {NgbAlertConfig} from './alert-config';\r\nimport {ngbRunTransition} from '../util/transition/ngbTransition';\r\nimport {ngbAlertFadingTransition} from './alert-transition';\r\n\r\n/**\r\n * Alert is a component to provide contextual feedback messages for user.\r\n *\r\n * It supports several alert types and can be dismissed.\r\n */\r\n@Component({\r\n selector: 'ngb-alert',\r\n exportAs: 'ngbAlert',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n host:\r\n {'role': 'alert', 'class': 'alert show', '[class.fade]': 'animation', '[class.alert-dismissible]': 'dismissible'},\r\n template: `\r\n <ng-content></ng-content>\r\n <button *ngIf=\"dismissible\" type=\"button\" class=\"close\" aria-label=\"Close\" i18n-aria-label=\"@@ngb.alert.close\"\r\n (click)=\"close()\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n `,\r\n styleUrls: ['./alert.scss']\r\n})\r\nexport class NgbAlert implements OnInit,\r\n OnChanges {\r\n /**\r\n * If `true`, alert closing will be animated.\r\n *\r\n * Animation is triggered only when clicked on the close button (×)\r\n * or via the `.close()` function\r\n *\r\n * @since 8.0.0\r\n */\r\n @Input() animation: boolean;\r\n\r\n /**\r\n * If `true`, alert can be dismissed by the user.\r\n *\r\n * The close button (×) will be displayed and you can be notified\r\n * of the event with the `(close)` output.\r\n */\r\n @Input() dismissible: boolean;\r\n\r\n /**\r\n * Type of the alert.\r\n *\r\n * Bootstrap provides styles for the following types: `'success'`, `'info'`, `'warning'`, `'danger'`, `'primary'`,\r\n * `'secondary'`, `'light'` and `'dark'`.\r\n */\r\n @Input() type: string;\r\n\r\n /**\r\n * An event emitted when the close button is clicked. It has no payload and only relevant for dismissible alerts.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() closed = new EventEmitter<void>();\r\n\r\n\r\n constructor(\r\n config: NgbAlertConfig, private _renderer: Renderer2, private _element: ElementRef, private _zone: NgZone) {\r\n this.dismissible = config.dismissible;\r\n this.type = config.type;\r\n this.animation = config.animation;\r\n }\r\n\r\n /**\r\n * Triggers alert closing programmatically (same as clicking on the close button (×)).\r\n *\r\n * The returned observable will emit and be completed once the closing transition has finished.\r\n * If the animations are turned off this happens synchronously.\r\n *\r\n * Alternatively you could listen or subscribe to the `(closed)` output\r\n *\r\n * @since 8.0.0\r\n */\r\n close(): Observable<void> {\r\n const transition = ngbRunTransition(\r\n this._zone, this._element.nativeElement, ngbAlertFadingTransition,\r\n {animation: this.animation, runningTransition: 'continue'});\r\n transition.subscribe(() => this.closed.emit());\r\n return transition;\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n const typeChange = changes['type'];\r\n if (typeChange && !typeChange.firstChange) {\r\n this._renderer.removeClass(this._element.nativeElement, `alert-${typeChange.previousValue}`);\r\n this._renderer.addClass(this._element.nativeElement, `alert-${typeChange.currentValue}`);\r\n }\r\n }\r\n\r\n ngOnInit() { this._renderer.addClass(this._element.nativeElement, `alert-${this.type}`); }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport {NgbAlert} from './alert';\r\n\r\nexport {NgbAlert} from './alert';\r\nexport {NgbAlertConfig} from './alert-config';\r\n\r\n@NgModule({declarations: [NgbAlert], exports: [NgbAlert], imports: [CommonModule], entryComponents: [NgbAlert]})\r\nexport class NgbAlertModule {\r\n}\r\n","import {Directive} from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ngbButtonLabel]',\r\n host:\r\n {'[class.btn]': 'true', '[class.active]': 'active', '[class.disabled]': 'disabled', '[class.focus]': 'focused'}\r\n})\r\nexport class NgbButtonLabel {\r\n active: boolean;\r\n disabled: boolean;\r\n focused: boolean;\r\n}\r\n","import {ChangeDetectorRef, Directive, forwardRef, Input} from '@angular/core';\r\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\r\n\r\nimport {NgbButtonLabel} from './label';\r\n\r\n/**\r\n * Allows to easily create Bootstrap-style checkbox buttons.\r\n *\r\n * Integrates with forms, so the value of a checked button is bound to the underlying form control\r\n * either in a reactive or template-driven way.\r\n */\r\n@Directive({\r\n selector: '[ngbButton][type=checkbox]',\r\n host: {\r\n '[checked]': 'checked',\r\n '[disabled]': 'disabled',\r\n '(change)': 'onInputChange($event)',\r\n '(focus)': 'focused = true',\r\n '(blur)': 'focused = false'\r\n },\r\n providers: [{provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgbCheckBox), multi: true}]\r\n})\r\nexport class NgbCheckBox implements ControlValueAccessor {\r\n static ngAcceptInputType_disabled: boolean | '';\r\n\r\n checked;\r\n\r\n /**\r\n * If `true`, the checkbox button will be disabled\r\n */\r\n @Input() disabled = false;\r\n\r\n /**\r\n * The form control value when the checkbox is checked.\r\n */\r\n @Input() valueChecked = true;\r\n\r\n /**\r\n * The form control value when the checkbox is unchecked.\r\n */\r\n @Input() valueUnChecked = false;\r\n\r\n onChange = (_: any) => {};\r\n onTouched = () => {};\r\n\r\n set focused(isFocused: boolean) {\r\n this._label.focused = isFocused;\r\n if (!isFocused) {\r\n this.onTouched();\r\n }\r\n }\r\n\r\n constructor(private _label: NgbButtonLabel, private _cd: ChangeDetectorRef) {}\r\n\r\n onInputChange($event) {\r\n const modelToPropagate = $event.target.checked ? this.valueChecked : this.valueUnChecked;\r\n this.onChange(modelToPropagate);\r\n this.onTouched();\r\n this.writeValue(modelToPropagate);\r\n }\r\n\r\n registerOnChange(fn: (value: any) => any): void { this.onChange = fn; }\r\n\r\n registerOnTouched(fn: () => any): void { this.onTouched = fn; }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this.disabled = isDisabled;\r\n this._label.disabled = isDisabled;\r\n }\r\n\r\n writeValue(value) {\r\n this.checked = value === this.valueChecked;\r\n this._label.active = this.checked;\r\n\r\n // label won't be updated, if it is inside the OnPush component when [ngModel] changes\r\n this._cd.markForCheck();\r\n }\r\n}\r\n","import {ChangeDetectorRef, Directive, ElementRef, forwardRef, Input, OnDestroy, Renderer2} from '@angular/core';\r\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\r\n\r\nimport {NgbButtonLabel} from './label';\r\n\r\nlet nextId = 0;\r\n\r\n/**\r\n * Allows to easily create Bootstrap-style radio buttons.\r\n *\r\n * Integrates with forms, so the value of a checked button is bound to the underlying form control\r\n * either in a reactive or template-driven way.\r\n */\r\n@Directive({\r\n selector: '[ngbRadioGroup]',\r\n host: {'role': 'radiogroup'},\r\n providers: [{provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgbRadioGroup), multi: true}]\r\n})\r\nexport class NgbRadioGroup implements ControlValueAccessor {\r\n private _radios: Set<NgbRadio> = new Set<NgbRadio>();\r\n private _value = null;\r\n private _disabled: boolean;\r\n\r\n get disabled() { return this._disabled; }\r\n set disabled(isDisabled: boolean) { this.setDisabledState(isDisabled); }\r\n\r\n /**\r\n * Name of the radio group applied to radio input elements.\r\n *\r\n * Will be applied to all radio input elements inside the group,\r\n * unless [`NgbRadio`](#/components/buttons/api#NgbRadio)'s specify names themselves.\r\n *\r\n * If not provided, will be generated in the `ngb-radio-xx` format.\r\n */\r\n @Input() name = `ngb-radio-${nextId++}`;\r\n\r\n onChange = (_: any) => {};\r\n onTouched = () => {};\r\n\r\n onRadioChange(radio: NgbRadio) {\r\n this.writeValue(radio.value);\r\n this.onChange(radio.value);\r\n }\r\n\r\n onRadioValueUpdate() { this._updateRadiosValue(); }\r\n\r\n register(radio: NgbRadio) { this._radios.add(radio); }\r\n\r\n registerOnChange(fn: (value: any) => any): void { this.onChange = fn; }\r\n\r\n registerOnTouched(fn: () => any): void { this.onTouched = fn; }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this._disabled = isDisabled;\r\n this._updateRadiosDisabled();\r\n }\r\n\r\n unregister(radio: NgbRadio) { this._radios.delete(radio); }\r\n\r\n writeValue(value) {\r\n this._value = value;\r\n this._updateRadiosValue();\r\n }\r\n\r\n private _updateRadiosValue() { this._radios.forEach((radio) => radio.updateValue(this._value)); }\r\n private _updateRadiosDisabled() { this._radios.forEach((radio) => radio.updateDisabled()); }\r\n}\r\n\r\n\r\n/**\r\n * A directive that marks an input of type \"radio\" as a part of the\r\n * [`NgbRadioGroup`](#/components/buttons/api#NgbRadioGroup).\r\n */\r\n@Directive({\r\n selector: '[ngbButton][type=radio]',\r\n host: {\r\n '[checked]': 'checked',\r\n '[disabled]': 'disabled',\r\n '[name]': 'nameAttr',\r\n '(change)': 'onChange()',\r\n '(focus)': 'focused = true',\r\n '(blur)': 'focused = false'\r\n }\r\n})\r\nexport class NgbRadio implements OnDestroy {\r\n static ngAcceptInputType_disabled: boolean | '';\r\n\r\n private _checked: boolean;\r\n private _disabled: boolean;\r\n private _value: any = null;\r\n\r\n /**\r\n * The value for the 'name' property of the input element.\r\n *\r\n * All inputs of the radio group should have the same name. If not specified,\r\n * the name of the enclosing group is used.\r\n */\r\n @Input() name: string;\r\n\r\n /**\r\n * The form control value when current radio button is checked.\r\n */\r\n @Input('value')\r\n set value(value: any) {\r\n this._value = value;\r\n const stringValue = value ? value.toString() : '';\r\n this._renderer.setProperty(this._element.nativeElement, 'value', stringValue);\r\n this._group.onRadioValueUpdate();\r\n }\r\n\r\n /**\r\n * If `true`, current radio button will be disabled.\r\n */\r\n @Input('disabled')\r\n set disabled(isDisabled: boolean) {\r\n this._disabled = isDisabled !== false;\r\n this.updateDisabled();\r\n }\r\n\r\n set focused(isFocused: boolean) {\r\n if (this._label) {\r\n this._label.focused = isFocused;\r\n }\r\n if (!isFocused) {\r\n this._group.onTouched();\r\n }\r\n }\r\n\r\n get checked() { return this._checked; }\r\n\r\n get disabled() { return this._group.disabled || this._disabled; }\r\n\r\n get value() { return this._value; }\r\n\r\n get nameAttr() { return this.name || this._group.name; }\r\n\r\n constructor(\r\n private _group: NgbRadioGroup, private _label: NgbButtonLabel, private _renderer: Renderer2,\r\n private _element: ElementRef<HTMLInputElement>, private _cd: ChangeDetectorRef) {\r\n this._group.register(this);\r\n this.updateDisabled();\r\n }\r\n\r\n ngOnDestroy() { this._group.unregister(this); }\r\n\r\n onChange() { this._group.onRadioChange(this); }\r\n\r\n updateValue(value) {\r\n // label won't be updated, if it is inside the OnPush component when [ngModel] changes\r\n if (this.value !== value) {\r\n this._cd.markForCheck();\r\n }\r\n\r\n this._checked = this.value === value;\r\n this._label.active = this._checked;\r\n }\r\n\r\n updateDisabled() { this._label.disabled = this.disabled; }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {NgbButtonLabel} from './label';\r\nimport {NgbCheckBox} from './checkbox';\r\nimport {NgbRadio, NgbRadioGroup} from './radio';\r\n\r\nexport {NgbButtonLabel} from './label';\r\nexport {NgbCheckBox} from './checkbox';\r\nexport {NgbRadio, NgbRadioGroup} from './radio';\r\n\r\n\r\nconst NGB_BUTTON_DIRECTIVES = [NgbButtonLabel, NgbCheckBox, NgbRadioGroup, NgbRadio];\r\n\r\n@NgModule({declarations: NGB_BUTTON_DIRECTIVES, exports: NGB_BUTTON_DIRECTIVES})\r\nexport class NgbButtonsModule {\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbConfig} from '../ngb-config';\r\n\r\n/**\r\n * A configuration service for the [NgbCarousel](#/components/carousel/api#NgbCarousel) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize its properties\r\n * to provide default values for all carousels used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbCarouselConfig {\r\n interval = 5000;\r\n wrap = true;\r\n keyboard = true;\r\n pauseOnHover = true;\r\n pauseOnFocus = true;\r\n showNavigationArrows = true;\r\n showNavigationIndicators = true;\r\n\r\n private _animation: boolean;\r\n\r\n constructor(private _ngbConfig: NgbConfig) {}\r\n\r\n get animation(): boolean { return (this._animation === undefined) ? this._ngbConfig.animation : this._animation; }\r\n set animation(animation: boolean) { this._animation = animation; }\r\n}\r\n","import {NgbTransitionStartFn} from '../util/transition/ngbTransition';\r\nimport {reflow} from '../util/util';\r\n\r\n/**\r\n * Defines the carousel slide transition direction.\r\n */\r\nexport enum NgbSlideEventDirection {\r\n LEFT = 'left',\r\n RIGHT = 'right'\r\n}\r\n\r\nexport interface NgbCarouselCtx { direction: 'left' | 'right'; }\r\n\r\nconst isBeingAnimated = ({classList}: HTMLElement) => {\r\n return classList.contains('carousel-item-left') || classList.contains('carousel-item-right');\r\n};\r\n\r\nconst removeDirectionClasses = (classList: DOMTokenList) => {\r\n classList.remove('carousel-item-left');\r\n classList.remove('carousel-item-right');\r\n};\r\n\r\nconst removeClasses = (classList: DOMTokenList) => {\r\n removeDirectionClasses(classList);\r\n classList.remove('carousel-item-prev');\r\n classList.remove('carousel-item-next');\r\n};\r\n\r\nexport const ngbCarouselTransitionIn: NgbTransitionStartFn<NgbCarouselCtx> =\r\n (element: HTMLElement, animation: boolean, {direction}: NgbCarouselCtx) => {\r\n const {classList} = element;\r\n\r\n if (!animation) {\r\n removeDirectionClasses(classList);\r\n removeClasses(classList);\r\n classList.add('active');\r\n return;\r\n }\r\n\r\n if (isBeingAnimated(element)) {\r\n // Revert the transition\r\n removeDirectionClasses(classList);\r\n } else {\r\n // For the 'in' transition, a 'pre-class' is applied to the element to ensure its visibility\r\n classList.add('carousel-item-' + (direction === NgbSlideEventDirection.LEFT ? 'next' : 'prev'));\r\n reflow(element);\r\n classList.add('carousel-item-' + direction);\r\n }\r\n\r\n return () => {\r\n removeClasses(classList);\r\n classList.add('active');\r\n };\r\n };\r\n\r\nexport const ngbCarouselTransitionOut: NgbTransitionStartFn<NgbCarouselCtx> =\r\n (element: HTMLElement, animation: boolean, {direction}: NgbCarouselCtx) => {\r\n const {classList} = element;\r\n\r\n if (!animation) {\r\n removeDirectionClasses(classList);\r\n removeClasses(classList);\r\n classList.remove('active');\r\n return;\r\n }\r\n\r\n // direction is left or right, depending on the way the slide goes out.\r\n if (isBeingAnimated(element)) {\r\n // Revert the transition\r\n removeDirectionClasses(classList);\r\n } else {\r\n classList.add('carousel-item-' + direction);\r\n }\r\n\r\n return () => {\r\n removeClasses(classList);\r\n classList.remove('active');\r\n };\r\n };\r\n","import {\r\n AfterContentChecked,\r\n AfterContentInit,\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ContentChildren,\r\n Directive,\r\n ElementRef,\r\n EventEmitter,\r\n Inject,\r\n Input,\r\n NgZone,\r\n OnDestroy,\r\n Output,\r\n PLATFORM_ID,\r\n QueryList,\r\n TemplateRef,\r\n ViewEncapsulation,\r\n AfterViewInit\r\n} from '@angular/core';\r\nimport {isPlatformBrowser} from '@angular/common';\r\n\r\nimport {NgbCarouselConfig} from './carousel-config';\r\n\r\nimport {BehaviorSubject, combineLatest, NEVER, Observable, Subject, timer, zip} from 'rxjs';\r\nimport {distinctUntilChanged, map, startWith, switchMap, take, takeUntil} from 'rxjs/operators';\r\nimport {ngbCompleteTransition, ngbRunTransition, NgbTransitionOptions} from '../util/transition/ngbTransition';\r\nimport {\r\n ngbCarouselTransitionIn,\r\n ngbCarouselTransitionOut,\r\n NgbSlideEventDirection,\r\n NgbCarouselCtx\r\n} from './carousel-transition';\r\n\r\nlet nextId = 0;\r\n\r\n/**\r\n * A directive that wraps the individual carousel slide.\r\n */\r\n@Directive({selector: 'ng-template[ngbSlide]'})\r\nexport class NgbSlide {\r\n /**\r\n * Slide id that must be unique for the entire document.\r\n *\r\n * If not provided, will be generated in the `ngb-slide-xx` format.\r\n */\r\n @Input() id = `ngb-slide-${nextId++}`;\r\n\r\n /**\r\n * An event emitted when the slide transition is finished\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() slid = new EventEmitter<NgbSingleSlideEvent>();\r\n\r\n constructor(public tplRef: TemplateRef<any>) {}\r\n}\r\n\r\n/**\r\n * Carousel is a component to easily create and control slideshows.\r\n *\r\n * Allows to set intervals, change the way user interacts with the slides and provides a programmatic API.\r\n */\r\n@Component({\r\n selector: 'ngb-carousel',\r\n exportAs: 'ngbCarousel',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n host: {\r\n 'class': 'carousel slide',\r\n '[style.display]': '\"block\"',\r\n 'tabIndex': '0',\r\n '(keydown.arrowLeft)': 'keyboard && arrowLeft()',\r\n '(keydown.arrowRight)': 'keyboard && arrowRight()',\r\n '(mouseenter)': 'mouseHover = true',\r\n '(mouseleave)': 'mouseHover = false',\r\n '(focusin)': 'focused = true',\r\n '(focusout)': 'focused = false',\r\n '[attr.aria-activedescendant]': `'slide-' + activeId`\r\n },\r\n template: `\r\n <ol class=\"carousel-indicators\" [class.sr-only]=\"!showNavigationIndicators\" role=\"tablist\">\r\n <li *ngFor=\"let slide of slides\" [class.active]=\"slide.id === activeId\"\r\n role=\"tab\" [attr.aria-labelledby]=\"'slide-' + slide.id\" [attr.aria-controls]=\"'slide-' + slide.id\"\r\n [attr.aria-selected]=\"slide.id === activeId\"\r\n (click)=\"focus();select(slide.id, NgbSlideEventSource.INDICATOR);\"></li>\r\n </ol>\r\n <div class=\"carousel-inner\">\r\n <div *ngFor=\"let slide of slides; index as i; count as c\" class=\"carousel-item\" [id]=\"'slide-' + slide.id\" role=\"tabpanel\">\r\n <span class=\"sr-only\" i18n=\"Currently selected slide number read by screen reader@@ngb.carousel.slide-number\">\r\n Slide {{i + 1}} of {{c}}\r\n </span>\r\n <ng-template [ngTemplateOutlet]=\"slide.tplRef\"></ng-template>\r\n </div>\r\n </div>\r\n <a class=\"carousel-control-prev\" role=\"button\" (click)=\"arrowLeft()\" *ngIf=\"showNavigationArrows\">\r\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\r\n <span class=\"sr-only\" i18n=\"@@ngb.carousel.previous\">Previous</span>\r\n </a>\r\n <a class=\"carousel-control-next\" role=\"button\" (click)=\"arrowRight()\" *ngIf=\"showNavigationArrows\">\r\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\r\n <span class=\"sr-only\" i18n=\"@@ngb.carousel.next\">Next</span>\r\n </a>\r\n `\r\n})\r\nexport class NgbCarousel implements AfterContentChecked,\r\n AfterContentInit, AfterViewInit, OnDestroy {\r\n @ContentChildren(NgbSlide) slides: QueryList<NgbSlide>;\r\n\r\n public NgbSlideEventSource = NgbSlideEventSource;\r\n\r\n private _destroy$ = new Subject<void>();\r\n private _interval$ = new BehaviorSubject(0);\r\n private _mouseHover$ = new BehaviorSubject(false);\r\n private _focused$ = new BehaviorSubject(false);\r\n private _pauseOnHover$ = new BehaviorSubject(false);\r\n private _pauseOnFocus$ = new BehaviorSubject(false);\r\n private _pause$ = new BehaviorSubject(false);\r\n private _wrap$ = new BehaviorSubject(false);\r\n\r\n /**\r\n * A flag to enable/disable the animations.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Input() animation: boolean;\r\n\r\n /**\r\n * The slide id that should be displayed **initially**.\r\n *\r\n * For subsequent interactions use methods `select()`, `next()`, etc. and the `(slide)` output.\r\n */\r\n @Input() activeId: string;\r\n\r\n /**\r\n * Time in milliseconds before the next slide is shown.\r\n */\r\n @Input()\r\n set interval(value: number) {\r\n this._interval$.next(value);\r\n }\r\n\r\n get interval() { return this._interval$.value; }\r\n\r\n /**\r\n * If `true`, will 'wrap' the carousel by switching from the last slide back to the first.\r\n */\r\n @Input()\r\n set wrap(value: boolean) {\r\n this._wrap$.next(value);\r\n }\r\n\r\n get wrap() { return this._wrap$.value; }\r\n\r\n /**\r\n * If `true`, allows to interact with carousel using keyboard 'arrow left' and 'arrow right'.\r\n */\r\n @Input() keyboard: boolean;\r\n\r\n /**\r\n * If `true`, will pause slide switching when mouse cursor hovers the slide.\r\n *\r\n * @since 2.2.0\r\n */\r\n @Input()\r\n set pauseOnHover(value: boolean) {\r\n this._pauseOnHover$.next(value);\r\n }\r\n\r\n get pauseOnHover() { return this._pauseOnHover$.value; }\r\n\r\n /**\r\n * If `true`, will pause slide switching when the focus is inside the carousel.\r\n */\r\n @Input()\r\n set pauseOnFocus(value: boolean) {\r\n this._pauseOnFocus$.next(value);\r\n }\r\n\r\n get pauseOnFocus() { return this._pauseOnFocus$.value; }\r\n\r\n /**\r\n * If `true`, 'previous' and 'next' navigation arrows will be visible on the slide.\r\n *\r\n * @since 2.2.0\r\n */\r\n @Input() showNavigationArrows: boolean;\r\n\r\n /**\r\n * If `true`, navigation indicators at the bottom of the slide will be visible.\r\n *\r\n * @since 2.2.0\r\n */\r\n @Input() showNavigationIndicators: boolean;\r\n\r\n /**\r\n * An event emitted just before the slide transition starts.\r\n *\r\n * See [`NgbSlideEvent`](#/components/carousel/api#NgbSlideEvent) for payload details.\r\n */\r\n @Output() slide = new EventEmitter<NgbSlideEvent>();\r\n\r\n /**\r\n * An event emitted right after the slide transition is completed.\r\n *\r\n * See [`NgbSlideEvent`](#/components/carousel/api#NgbSlideEvent) for payload details.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() slid = new EventEmitter<NgbSlideEvent>();\r\n\r\n /*\r\n * Keep the ids of the panels currently transitionning\r\n * in order to allow only the transition revertion\r\n */\r\n private _transitionIds: [string, string] | null = null;\r\n\r\n set mouseHover(value: boolean) { this._mouseHover$.next(value); }\r\n\r\n get mouseHover() { return this._mouseHover$.value; }\r\n\r\n set focused(value: boolean) { this._focused$.next(value); }\r\n\r\n get focused() { return this._focused$.value; }\r\n\r\n constructor(\r\n config: NgbCarouselConfig, @Inject(PLATFORM_ID) private _platformId, private _ngZone: NgZone,\r\n private _cd: ChangeDetectorRef, private _container: ElementRef) {\r\n this.animation = config.animation;\r\n this.interval = config.interval;\r\n this.wrap = config.wrap;\r\n this.keyboard = config.keyboard;\r\n this.pauseOnHover = config.pauseOnHover;\r\n this.pauseOnFocus = config.pauseOnFocus;\r\n this.showNavigationArrows = config.showNavigationArrows;\r\n this.showNavigationIndicators = config.showNavigationIndicators;\r\n }\r\n\r\n arrowLeft() {\r\n this.focus();\r\n this.prev(NgbSlideEventSource.ARROW_LEFT);\r\n }\r\n\r\n arrowRight() {\r\n this.focus();\r\n this.next(NgbSlideEventSource.ARROW_RIGHT);\r\n }\r\n\r\n ngAfterContentInit() {\r\n // setInterval() doesn't play well with SSR and protractor,\r\n // so we should run it in the browser and outside Angular\r\n if (isPlatformBrowser(this._platformId)) {\r\n this._ngZone.runOutsideAngular(() => {\r\n const hasNextSlide$ = combineLatest([\r\n this.slide.pipe(map(slideEvent => slideEvent.current), startWith(this.activeId)),\r\n this._wrap$, this.slides.changes.pipe(startWith(null))\r\n ])\r\n .pipe(\r\n map(([currentSlideId, wrap]) => {\r\n const slideArr = this.slides.toArray();\r\n const currentSlideIdx = this._getSlideIdxById(currentSlideId);\r\n return wrap ? slideArr.length > 1 : currentSlideIdx < slideArr.length - 1;\r\n }),\r\n distinctUntilChanged());\r\n combineLatest([\r\n this._pause$, this._pauseOnHover$, this._mouseHover$, this._pauseOnFocus$, this._focused$, this._interval$,\r\n hasNextSlide$\r\n ])\r\n .pipe(\r\n map(([pause, pauseOnHover, mouseHover, pauseOnFocus, focused, interval,\r\n hasNextSlide]: [boolean, boolean, boolean, boolean, boolean, number, boolean]) =>\r\n ((pause || (pauseOnHover && mouseHover) || (pauseOnFocus && focused) || !hasNextSlide) ?\r\n 0 :\r\n interval)),\r\n\r\n distinctUntilChanged(), switchMap(interval => interval > 0 ? timer(interval, interval) : NEVER),\r\n takeUntil(this._destroy$))\r\n .subscribe(() => this._ngZone.run(() => this.next(NgbSlideEventSource.TIMER)));\r\n });\r\n }\r\n\r\n this.slides.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {\r\n this._transitionIds ?.forEach(id => ngbCompleteTransition(this._getSlideElement(id)));\r\n this._transitionIds = null;\r\n\r\n this._cd.markForCheck();\r\n\r\n // The following code need to be done asynchronously, after the dom becomes stable,\r\n // otherwise all changes will be undone.\r\n this._ngZone.onStable.pipe(take(1)).subscribe(() => {\r\n for (const { id } of this.slides) {\r\n const element = this._getSlideElement(id);\r\n if (id === this.activeId) {\r\n element.classList.add('active');\r\n } else {\r\n element.classList.remove('active');\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n ngAfterContentChecked() {\r\n let activeSlide = this._getSlideById(this.activeId);\r\n this.activeId = activeSlide ? activeSlide.id : (this.slides.length ? this.slides.first.id : '');\r\n }\r\n\r\n ngAfterViewInit() {\r\n // Initialize the 'active' class (not managed by the template)\r\n if (this.activeId) {\r\n const element = this._getSlideElement(this.activeId);\r\n if (element) {\r\n element.classList.add('active');\r\n }\r\n }\r\n }\r\n\r\n ngOnDestroy() { this._destroy$.next(); }\r\n\r\n /**\r\n * Navigates to a slide with the specified identifier.\r\n */\r\n select(slideId: string, source?: NgbSlideEventSource) {\r\n this._cycleToSelected(slideId, this._getSlideEventDirection(this.activeId, slideId), source);\r\n }\r\n\r\n /**\r\n * Navigates to the previous slide.\r\n */\r\n prev(source?: NgbSlideEventSource) {\r\n this._cycleToSelected(this._getPrevSlide(this.activeId), NgbSlideEventDirection.RIGHT, source);\r\n }\r\n\r\n /**\r\n * Navigates to the next slide.\r\n */\r\n next(source?: NgbSlideEventSource) {\r\n this._cycleToSelected(this._getNextSlide(this.activeId), NgbSlideEventDirection.LEFT, source);\r\n }\r\n\r\n /**\r\n * Pauses cycling through the slides.\r\n */\r\n pause() { this._pause$.next(true); }\r\n\r\n /**\r\n * Restarts cycling through the slides from left to right.\r\n */\r\n cycle() { this._pause$.next(false); }\r\n\r\n /**\r\n * Set the focus on the carousel.\r\n */\r\n focus() { this._container.nativeElement.focus(); }\r\n\r\n private _cycleToSelected(slideIdx: string, direction: NgbSlideEventDirection, source?: NgbSlideEventSource) {\r\n const transitionIds = this._transitionIds;\r\n if (transitionIds && (transitionIds[0] !== slideIdx || transitionIds[1] !== this.activeId)) {\r\n // Revert prevented\r\n return;\r\n }\r\n\r\n let selectedSlide = this._getSlideById(slideIdx);\r\n if (selectedSlide && selectedSlide.id !== this.activeId) {\r\n this._transitionIds = [this.activeId, slideIdx];\r\n this.slide.emit(\r\n {prev: this.activeId, current: selectedSlide.id, direction: direction, paused: this._pause$.value, source});\r\n\r\n const options: NgbTransitionOptions<NgbCarouselCtx> = {\r\n animation: this.animation,\r\n runningTransition: 'stop',\r\n context: {direction},\r\n };\r\n\r\n const transitions: Array<Observable<any>> = [];\r\n const activeSlide = this._getSlideById(this.activeId);\r\n if (activeSlide) {\r\n const activeSlideTransition =\r\n ngbRunTransition(this._ngZone, this._getSlideElement(activeSlide.id), ngbCarouselTransitionOut, options);\r\n activeSlideTransition.subscribe(() => { activeSlide.slid.emit({isShown: false, direction, source}); });\r\n transitions.push(activeSlideTransition);\r\n }\r\n\r\n const previousId = this.activeId;\r\n this.activeId = selectedSlide.id;\r\n const nextSlide = this._getSlideById(this.activeId);\r\n const transition =\r\n ngbRunTransition(this._ngZone, this._getSlideElement(selectedSlide.id), ngbCarouselTransitionIn, options);\r\n transition.subscribe(() => { nextSlide ?.slid.emit({isShown: true, direction, source}); });\r\n transitions.push(transition);\r\n\r\n zip(...transitions).pipe(take(1)).subscribe(() => {\r\n this._transitionIds = null;\r\n this.slid.emit(\r\n {prev: previousId, current: selectedSlide !.id, direction: direction, paused: this._pause$.value, source});\r\n });\r\n }\r\n\r\n // we get here after the interval fires or any external API call like next(), prev() or select()\r\n this._cd.markForCheck();\r\n }\r\n\r\n private _getSlideEventDirection(currentActiveSlideId: string, nextActiveSlideId: string): NgbSlideEventDirection {\r\n const currentActiveSlideIdx = this._getSlideIdxById(currentActiveSlideId);\r\n const nextActiveSlideIdx = this._getSlideIdxById(nextActiveSlideId);\r\n\r\n return currentActiveSlideIdx > nextActiveSlideIdx ? NgbSlideEventDirection.RIGHT : NgbSlideEventDirection.LEFT;\r\n }\r\n\r\n private _getSlideById(slideId: string): NgbSlide | null {\r\n return this.slides.find(slide => slide.id === slideId) || null;\r\n }\r\n\r\n private _getSlideIdxById(slideId: string): number {\r\n const slide = this._getSlideById(slideId);\r\n return slide != null ? this.slides.toArray().indexOf(slide) : -1;\r\n }\r\n\r\n private _getNextSlide(currentSlideId: string): string {\r\n const slideArr = this.slides.toArray();\r\n const currentSlideIdx = this._getSlideIdxById(currentSlideId);\r\n const isLastSlide = currentSlideIdx === slideArr.length - 1;\r\n\r\n return isLastSlide ? (this.wrap ? slideArr[0].id : slideArr[slideArr.length - 1].id) :\r\n slideArr[currentSlideIdx + 1].id;\r\n }\r\n\r\n private _getPrevSlide(currentSlideId: string): string {\r\n const slideArr = this.slides.toArray();\r\n const currentSlideIdx = this._getSlideIdxById(currentSlideId);\r\n const isFirstSlide = currentSlideIdx === 0;\r\n\r\n return isFirstSlide ? (this.wrap ? slideArr[slideArr.length - 1].id : slideArr[0].id) :\r\n slideArr[currentSlideIdx - 1].id;\r\n }\r\n\r\n private _getSlideElement(slideId: string): HTMLElement {\r\n return this._container.nativeElement.querySelector(`#slide-${slideId}`);\r\n }\r\n}\r\n\r\n/**\r\n * A slide change event emitted right after the slide transition is completed.\r\n */\r\nexport interface NgbSlideEvent {\r\n /**\r\n * The previous slide id.\r\n */\r\n prev: string;\r\n\r\n /**\r\n * The current slide id.\r\n */\r\n current: string;\r\n\r\n /**\r\n * The slide event direction.\r\n *\r\n * Possible values are `'left' | 'right'`.\r\n */\r\n direction: NgbSlideEventDirection;\r\n\r\n /**\r\n * Whether the pause() method was called (and no cycle() call was done afterwards).\r\n *\r\n * @since 5.1.0\r\n */\r\n paused: boolean;\r\n\r\n /**\r\n * Source triggering the slide change event.\r\n *\r\n * Possible values are `'timer' | 'arrowLeft' | 'arrowRight' | 'indicator'`\r\n *\r\n * @since 5.1.0\r\n */\r\n source?: NgbSlideEventSource;\r\n}\r\n\r\n/**\r\n * A slide change event emitted right after the slide transition is completed.\r\n *\r\n * @since 8.0.0\r\n */\r\nexport interface NgbSingleSlideEvent {\r\n /**\r\n * true if the slide is shown, false otherwise\r\n */\r\n isShown: boolean;\r\n\r\n /**\r\n * The slide event direction.\r\n *\r\n * Possible values are `'left' | 'right'`.\r\n */\r\n direction: NgbSlideEventDirection;\r\n\r\n /**\r\n * Source triggering the slide change event.\r\n *\r\n * Possible values are `'timer' | 'arrowLeft' | 'arrowRight' | 'indicator'`\r\n *\r\n */\r\n source?: NgbSlideEventSource;\r\n}\r\n\r\nexport enum NgbSlideEventSource {\r\n TIMER = 'timer',\r\n ARROW_LEFT = 'arrowLeft',\r\n ARROW_RIGHT = 'arrowRight',\r\n INDICATOR = 'indicator'\r\n}\r\n\r\nexport const NGB_CAROUSEL_DIRECTIVES = [NgbCarousel, NgbSlide];\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport {NGB_CAROUSEL_DIRECTIVES} from './carousel';\r\n\r\nexport {NgbCarousel, NgbSlide, NgbSlideEvent, NgbSlideEventSource} from './carousel';\r\nexport {NgbSlideEventDirection} from './carousel-transition';\r\nexport {NgbCarouselConfig} from './carousel-config';\r\n\r\n@NgModule({declarations: NGB_CAROUSEL_DIRECTIVES, exports: NGB_CAROUSEL_DIRECTIVES, imports: [CommonModule]})\r\nexport class NgbCarouselModule {\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbConfig} from '../ngb-config';\r\n\r\n/**\r\n * A configuration service for the [NgbCollapse](#/components/collapse/api#NgbCollapse) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize its properties\r\n * to provide default values for all collapses used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbCollapseConfig {\r\n private _animation: boolean;\r\n\r\n constructor(private _ngbConfig: NgbConfig) {}\r\n\r\n get animation(): boolean { return (this._animation === undefined) ? this._ngbConfig.animation : this._animation; }\r\n set animation(animation: boolean) { this._animation = animation; }\r\n}\r\n","import {\r\n Directive,\r\n ElementRef,\r\n EventEmitter,\r\n Input,\r\n NgZone,\r\n OnChanges,\r\n OnInit,\r\n Output,\r\n SimpleChanges,\r\n} from '@angular/core';\r\nimport {ngbRunTransition} from '../util/transition/ngbTransition';\r\nimport {ngbCollapsingTransition} from '../util/transition/ngbCollapseTransition';\r\nimport {NgbCollapseConfig} from './collapse-config';\r\n\r\n/**\r\n * A directive to provide a simple way of hiding and showing elements on the page.\r\n */\r\n@Directive({selector: '[ngbCollapse]', exportAs: 'ngbCollapse'})\r\nexport class NgbCollapse implements OnInit, OnChanges {\r\n /**\r\n * If `true`, collapse will be animated.\r\n *\r\n * Animation is triggered only when clicked on triggering element\r\n * or via the `.toggle()` function\r\n *\r\n * @since 8.0.0\r\n */\r\n @Input() animation;\r\n\r\n /**\r\n * If `true`, will collapse the element or show it otherwise.\r\n */\r\n @Input('ngbCollapse') collapsed = false;\r\n\r\n @Output() ngbCollapseChange = new EventEmitter<boolean>();\r\n\r\n /**\r\n * An event emitted when the collapse element is shown, after the transition. It has no payload.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() shown = new EventEmitter<void>();\r\n\r\n /**\r\n * An event emitted when the collapse element is hidden, after the transition. It has no payload.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() hidden = new EventEmitter<void>();\r\n\r\n\r\n constructor(private _element: ElementRef, config: NgbCollapseConfig, private _zone: NgZone) {\r\n this.animation = config.animation;\r\n }\r\n\r\n ngOnInit() { this._runTransition(this.collapsed, false); }\r\n\r\n ngOnChanges({collapsed}: SimpleChanges) {\r\n if (!collapsed.firstChange) {\r\n this._runTransitionWithEvents(this.collapsed, this.animation);\r\n }\r\n }\r\n\r\n /**\r\n * Triggers collapsing programmatically.\r\n *\r\n * If there is a collapsing transition running already, it will be reversed.\r\n * If the animations are turned off this happens synchronously.\r\n *\r\n * @since 8.0.0\r\n */\r\n toggle(open: boolean = this.collapsed) {\r\n this.collapsed = !open;\r\n this.ngbCollapseChange.next(this.collapsed);\r\n this._runTransitionWithEvents(this.collapsed, this.animation);\r\n }\r\n\r\n private _runTransition(collapsed: boolean, animation: boolean) {\r\n return ngbRunTransition(\r\n this._zone, this._element.nativeElement, ngbCollapsingTransition,\r\n {animation, runningTransition: 'stop', context: {direction: collapsed ? 'hide' : 'show'}});\r\n }\r\n\r\n private _runTransitionWithEvents(collapsed: boolean, animation: boolean) {\r\n this._runTransition(collapsed, animation).subscribe(() => {\r\n if (collapsed) {\r\n this.hidden.emit();\r\n } else {\r\n this.shown.emit();\r\n }\r\n });\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {NgbCollapse} from './collapse';\r\n\r\nexport {NgbCollapse} from './collapse';\r\nexport {NgbCollapseConfig} from './collapse-config';\r\n\r\n@NgModule({declarations: [NgbCollapse], exports: [NgbCollapse]})\r\nexport class NgbCollapseModule {\r\n}\r\n","import {NgbDateStruct} from './ngb-date-struct';\r\nimport {isInteger} from '../util/util';\r\n\r\n/**\r\n * A simple class that represents a date that datepicker also uses internally.\r\n *\r\n * It is the implementation of the `NgbDateStruct` interface that adds some convenience methods,\r\n * like `.equals()`, `.before()`, etc.\r\n *\r\n * All datepicker APIs consume `NgbDateStruct`, but return `NgbDate`.\r\n *\r\n * In many cases it is simpler to manipulate these objects together with\r\n * [`NgbCalendar`](#/components/datepicker/api#NgbCalendar) than native JS Dates.\r\n *\r\n * See the [date format overview](#/components/datepicker/overview#date-model) for more details.\r\n *\r\n * @since 3.0.0\r\n */\r\nexport class NgbDate implements NgbDateStruct {\r\n /**\r\n * The year, for example 2016\r\n */\r\n year: number;\r\n\r\n /**\r\n * The month, for example 1=Jan ... 12=Dec as in ISO 8601\r\n */\r\n month: number;\r\n\r\n /**\r\n * The day of month, starting with 1\r\n */\r\n day: number;\r\n\r\n /**\r\n * A **static method** that creates a new date object from the `NgbDateStruct`,\r\n *\r\n * ex. `NgbDate.from({year: 2000, month: 5, day: 1})`.\r\n *\r\n * If the `date` is already of `NgbDate` type, the method will return the same object.\r\n */\r\n static from(date?: NgbDateStruct | null): NgbDate | null {\r\n if (date instanceof NgbDate) {\r\n return date;\r\n }\r\n return date ? new NgbDate(date.year, date.month, date.day) : null;\r\n }\r\n\r\n constructor(year: number, month: number, day: number) {\r\n this.year = isInteger(year) ? year : <any>null;\r\n this.month = isInteger(month) ? month : <any>null;\r\n this.day = isInteger(day) ? day : <any>null;\r\n }\r\n\r\n /**\r\n * Checks if the current date is equal to another date.\r\n */\r\n equals(other?: NgbDateStruct | null): boolean {\r\n return other != null && this.year === other.year && this.month === other.month && this.day === other.day;\r\n }\r\n\r\n /**\r\n * Checks if the current date is before another date.\r\n */\r\n before(other?: NgbDateStruct | null): boolean {\r\n if (!other) {\r\n return false;\r\n }\r\n\r\n if (this.year === other.year) {\r\n if (this.month === other.month) {\r\n return this.day === other.day ? false : this.day < other.day;\r\n } else {\r\n return this.month < other.month;\r\n }\r\n } else {\r\n return this.year < other.year;\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the current date is after another date.\r\n */\r\n after(other?: NgbDateStruct | null): boolean {\r\n if (!other) {\r\n return false;\r\n }\r\n if (this.year === other.year) {\r\n if (this.month === other.month) {\r\n return this.day === other.day ? false : this.day > other.day;\r\n } else {\r\n return this.month > other.month;\r\n }\r\n } else {\r\n return this.year > other.year;\r\n }\r\n }\r\n}\r\n","import {NgbDate} from './ngb-date';\r\nimport {Injectable} from '@angular/core';\r\nimport {isInteger} from '../util/util';\r\n\r\nexport function fromJSDate(jsDate: Date) {\r\n return new NgbDate(jsDate.getFullYear(), jsDate.getMonth() + 1, jsDate.getDate());\r\n}\r\nexport function toJSDate(date: NgbDate) {\r\n const jsDate = new Date(date.year, date.month - 1, date.day, 12);\r\n // this is done avoid 30 -> 1930 conversion\r\n if (!isNaN(jsDate.getTime())) {\r\n jsDate.setFullYear(date.year);\r\n }\r\n return jsDate;\r\n}\r\n\r\nexport type NgbPeriod = 'y' | 'm' | 'd';\r\n\r\nexport function NGB_DATEPICKER_CALENDAR_FACTORY() {\r\n return new NgbCalendarGregorian();\r\n}\r\n\r\n/**\r\n * A service that represents the calendar used by the datepicker.\r\n *\r\n * The default implementation uses the Gregorian calendar. You can inject it in your own\r\n * implementations if necessary to simplify `NgbDate` calculations.\r\n */\r\n@Injectable({providedIn: 'root', useFactory: NGB_DATEPICKER_CALENDAR_FACTORY})\r\nexport abstract class NgbCalendar {\r\n /**\r\n * Returns the number of days per week.\r\n */\r\n abstract getDaysPerWeek(): number;\r\n\r\n /**\r\n * Returns an array of months per year.\r\n *\r\n * With default calendar we use ISO 8601 and return [1, 2, ..., 12];\r\n */\r\n abstract getMonths(year?: number): number[];\r\n\r\n /**\r\n * Returns the number of weeks per month.\r\n */\r\n abstract getWeeksPerMonth(): number;\r\n\r\n /**\r\n * Returns the weekday number for a given day.\r\n *\r\n * With the default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun\r\n */\r\n abstract getWeekday(date: NgbDate): number;\r\n\r\n /**\r\n * Adds a number of years, months or days to a given date.\r\n *\r\n * * `period` can be `y`, `m` or `d` and defaults to day.\r\n * * `number` defaults to 1.\r\n *\r\n * Always returns a new date.\r\n */\r\n abstract getNext(date: NgbDate, period?: NgbPeriod, number?: number): NgbDate;\r\n\r\n /**\r\n * Subtracts a number of years, months or days from a given date.\r\n *\r\n * * `period` can be `y`, `m` or `d` and defaults to day.\r\n * * `number` defaults to 1.\r\n *\r\n * Always returns a new date.\r\n */\r\n abstract getPrev(date: NgbDate, period?: NgbPeriod, number?: number): NgbDate;\r\n\r\n /**\r\n * Returns the week number for a given week.\r\n */\r\n abstract getWeekNumber(week: readonly NgbDate[], firstDayOfWeek: number): number;\r\n\r\n /**\r\n * Returns the today's date.\r\n */\r\n abstract getToday(): NgbDate;\r\n\r\n /**\r\n * Checks if a date is valid in the current calendar.\r\n */\r\n abstract isValid(date?: NgbDate | null): boolean;\r\n}\r\n\r\n@Injectable()\r\nexport class NgbCalendarGregorian extends NgbCalendar {\r\n getDaysPerWeek() { return 7; }\r\n\r\n getMonths() { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; }\r\n\r\n getWeeksPerMonth() { return 6; }\r\n\r\n getNext(date: NgbDate, period: NgbPeriod = 'd', number = 1) {\r\n let jsDate = toJSDate(date);\r\n let checkMonth = true;\r\n let expectedMonth = jsDate.getMonth();\r\n\r\n switch (period) {\r\n case 'y':\r\n jsDate.setFullYear(jsDate.getFullYear() + number);\r\n break;\r\n case 'm':\r\n expectedMonth += number;\r\n jsDate.setMonth(expectedMonth);\r\n expectedMonth = expectedMonth % 12;\r\n if (expectedMonth < 0) {\r\n expectedMonth = expectedMonth + 12;\r\n }\r\n break;\r\n case 'd':\r\n jsDate.setDate(jsDate.getDate() + number);\r\n checkMonth = false;\r\n break;\r\n default:\r\n return date;\r\n }\r\n\r\n if (checkMonth && jsDate.getMonth() !== expectedMonth) {\r\n // this means the destination month has less days than the initial month\r\n // let's go back to the end of the previous month:\r\n jsDate.setDate(0);\r\n }\r\n\r\n return fromJSDate(jsDate);\r\n }\r\n\r\n getPrev(date: NgbDate, period: NgbPeriod = 'd', number = 1) { return this.getNext(date, period, -number); }\r\n\r\n getWeekday(date: NgbDate) {\r\n let jsDate = toJSDate(date);\r\n let day = jsDate.getDay();\r\n // in JS Date Sun=0, in ISO 8601 Sun=7\r\n return day === 0 ? 7 : day;\r\n }\r\n\r\n getWeekNumber(week: readonly NgbDate[], firstDayOfWeek: number) {\r\n // in JS Date Sun=0, in ISO 8601 Sun=7\r\n if (firstDayOfWeek === 7) {\r\n firstDayOfWeek = 0;\r\n }\r\n\r\n const thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;\r\n let date = week[thursdayIndex];\r\n\r\n const jsDate = toJSDate(date);\r\n jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday\r\n const time = jsDate.getTime();\r\n jsDate.setMonth(0); // Compare with Jan 1\r\n jsDate.setDate(1);\r\n return Math.floor(Math.round((time - jsDate.getTime()) / 86400000) / 7) + 1;\r\n }\r\n\r\n getToday(): NgbDate { return fromJSDate(new Date()); }\r\n\r\n isValid(date?: NgbDate | null): boolean {\r\n if (!date || !isInteger(date.year) || !isInteger(date.month) || !isInteger(date.day)) {\r\n return false;\r\n }\r\n\r\n // year 0 doesn't exist in Gregorian calendar\r\n if (date.year === 0) {\r\n return false;\r\n }\r\n\r\n const jsDate = toJSDate(date);\r\n\r\n return !isNaN(jsDate.getTime()) && jsDate.getFullYear() === date.year && jsDate.getMonth() + 1 === date.month &&\r\n jsDate.getDate() === date.day;\r\n }\r\n}\r\n","import {NgbDate} from './ngb-date';\r\nimport {DatepickerViewModel, DayViewModel, MonthViewModel} from './datepicker-view-model';\r\nimport {NgbCalendar} from './ngb-calendar';\r\nimport {NgbDatepickerI18n} from './datepicker-i18n';\r\n\r\nexport function isChangedDate(prev?: NgbDate | null, next?: NgbDate | null): boolean {\r\n return !dateComparator(prev, next);\r\n}\r\n\r\nexport function isChangedMonth(prev?: NgbDate | null, next?: NgbDate | null): boolean {\r\n return !prev && !next ? false : !prev || !next ? true : prev.year !== next.year || prev.month !== next.month;\r\n}\r\n\r\nexport function dateComparator(prev?: NgbDate | null, next?: NgbDate | null): boolean {\r\n return (!prev && !next) || (!!prev && !!next && prev.equals(next));\r\n}\r\n\r\nexport function checkMinBeforeMax(minDate?: NgbDate | null, maxDate?: NgbDate | null): void {\r\n if (maxDate && minDate && maxDate.before(minDate)) {\r\n throw new Error(`'maxDate' ${maxDate} should be greater than 'minDate' ${minDate}`);\r\n }\r\n}\r\n\r\nexport function checkDateInRange(date?: NgbDate | null, minDate?: NgbDate | null, maxDate?: NgbDate | null): NgbDate |\r\n null {\r\n if (date && minDate && date.before(minDate)) {\r\n return minDate;\r\n }\r\n if (date && maxDate && date.after(maxDate)) {\r\n return maxDate;\r\n }\r\n\r\n return date || null;\r\n}\r\n\r\nexport function isDateSelectable(date: NgbDate | null | undefined, state: DatepickerViewModel) {\r\n const {minDate, maxDate, disabled, markDisabled} = state;\r\n // clang-format off\r\n return !(\r\n date === null ||\r\n date === undefined ||\r\n disabled ||\r\n (markDisabled && markDisabled(date, {year: date.year, month: date.month})) ||\r\n (minDate && date.before(minDate)) ||\r\n (maxDate && date.after(maxDate))\r\n );\r\n // clang-format on\r\n}\r\n\r\nexport function generateSelectBoxMonths(\r\n calendar: NgbCalendar, date: NgbDate, minDate: NgbDate | null, maxDate: NgbDate | null) {\r\n if (!date) {\r\n return [];\r\n }\r\n\r\n let months = calendar.getMonths(date.year);\r\n\r\n if (minDate && date.year === minDate.year) {\r\n const index = months.findIndex(month => month === minDate.month);\r\n months = months.slice(index);\r\n }\r\n\r\n if (maxDate && date.year === maxDate.year) {\r\n const index = months.findIndex(month => month === maxDate.month);\r\n months = months.slice(0, index + 1);\r\n }\r\n\r\n return months;\r\n}\r\n\r\nexport function generateSelectBoxYears(date: NgbDate, minDate: NgbDate | null, maxDate: NgbDate | null) {\r\n if (!date) {\r\n return [];\r\n }\r\n\r\n const start = minDate ? Math.max(minDate.year, date.year - 500) : date.year - 10;\r\n const end = maxDate ? Math.min(maxDate.year, date.year + 500) : date.year + 10;\r\n\r\n const length = end - start + 1;\r\n const numbers = Array(length);\r\n for (let i = 0; i < length; i++) {\r\n numbers[i] = start + i;\r\n }\r\n\r\n return numbers;\r\n}\r\n\r\nexport function nextMonthDisabled(calendar: NgbCalendar, date: NgbDate, maxDate: NgbDate | null) {\r\n const nextDate = Object.assign(calendar.getNext(date, 'm'), {day: 1});\r\n return maxDate != null && nextDate.after(maxDate);\r\n}\r\n\r\nexport function prevMonthDisabled(calendar: NgbCalendar, date: NgbDate, minDate: NgbDate | null) {\r\n const prevDate = Object.assign(calendar.getPrev(date, 'm'), {day: 1});\r\n return minDate != null && (prevDate.year === minDate.year && prevDate.month < minDate.month ||\r\n prevDate.year < minDate.year && minDate.month === 1);\r\n}\r\n\r\nexport function buildMonths(\r\n calendar: NgbCalendar, date: NgbDate, state: DatepickerViewModel, i18n: NgbDatepickerI18n,\r\n force: boolean): MonthViewModel[] {\r\n const {displayMonths, months} = state;\r\n // move old months to a temporary array\r\n const monthsToReuse = months.splice(0, months.length);\r\n\r\n // generate new first dates, nullify or reuse months\r\n const firstDates = Array.from({length: displayMonths}, (_, i) => {\r\n const firstDate = Object.assign(calendar.getNext(date, 'm', i), {day: 1});\r\n months[i] = <any>null;\r\n\r\n if (!force) {\r\n const reusedIndex = monthsToReuse.findIndex(month => month.firstDate.equals(firstDate));\r\n // move reused month back to months\r\n if (reusedIndex !== -1) {\r\n months[i] = monthsToReuse.splice(reusedIndex, 1)[0];\r\n }\r\n }\r\n\r\n return firstDate;\r\n });\r\n\r\n // rebuild nullified months\r\n firstDates.forEach((firstDate, i) => {\r\n if (months[i] === null) {\r\n months[i] = buildMonth(calendar, firstDate, state, i18n, monthsToReuse.shift() || {} as MonthViewModel);\r\n }\r\n });\r\n\r\n return months;\r\n}\r\n\r\nexport function buildMonth(\r\n calendar: NgbCalendar, date: NgbDate, state: DatepickerViewModel, i18n: NgbDatepickerI18n,\r\n month: MonthViewModel = {} as MonthViewModel): MonthViewModel {\r\n const {dayTemplateData, minDate, maxDate, firstDayOfWeek, markDisabled, outsideDays, weekdayWidth, weekdaysVisible} =\r\n state;\r\n const calendarToday = calendar.getToday();\r\n\r\n month.firstDate = <any>null;\r\n month.lastDate = <any>null;\r\n month.number = date.month;\r\n month.year = date.year;\r\n month.weeks = month.weeks || [];\r\n month.weekdays = month.weekdays || [];\r\n\r\n date = getFirstViewDate(calendar, date, firstDayOfWeek);\r\n\r\n // clearing weekdays, if not visible\r\n if (!weekdaysVisible) {\r\n month.weekdays.length = 0;\r\n }\r\n\r\n // month has weeks\r\n for (let week = 0; week < calendar.getWeeksPerMonth(); week++) {\r\n let weekObject = month.weeks[week];\r\n if (!weekObject) {\r\n weekObject = month.weeks[week] = {number: 0, days: [], collapsed: true};\r\n }\r\n const days = weekObject.days;\r\n\r\n // week has days\r\n for (let day = 0; day < calendar.getDaysPerWeek(); day++) {\r\n if (week === 0 && weekdaysVisible) {\r\n month.weekdays[day] = i18n.getWeekdayLabel(calendar.getWeekday(date), weekdayWidth);\r\n }\r\n\r\n const newDate = new NgbDate(date.year, date.month, date.day);\r\n const nextDate = calendar.getNext(newDate);\r\n\r\n const ariaLabel = i18n.getDayAriaLabel(newDate);\r\n\r\n // marking date as disabled\r\n let disabled = !!((minDate && newDate.before(minDate)) || (maxDate && newDate.after(maxDate)));\r\n if (!disabled && markDisabled) {\r\n disabled = markDisabled(newDate, {month: month.number, year: month.year});\r\n }\r\n\r\n // today\r\n let today = newDate.equals(calendarToday);\r\n\r\n // adding user-provided data to the context\r\n let contextUserData =\r\n dayTemplateData ? dayTemplateData(newDate, {month: month.number, year: month.year}) : undefined;\r\n\r\n // saving first date of the month\r\n if (month.firstDate === null && newDate.month === month.number) {\r\n month.firstDate = newDate;\r\n }\r\n\r\n // saving last date of the month\r\n if (newDate.month === month.number && nextDate.month !== month.number) {\r\n month.lastDate = newDate;\r\n }\r\n\r\n let dayObject = days[day];\r\n if (!dayObject) {\r\n dayObject = days[day] = {} as DayViewModel;\r\n }\r\n dayObject.date = newDate;\r\n dayObject.context = Object.assign(dayObject.context || {}, {\r\n $implicit: newDate,\r\n date: newDate,\r\n data: contextUserData,\r\n currentMonth: month.number,\r\n currentYear: month.year, disabled,\r\n focused: false,\r\n selected: false, today\r\n });\r\n dayObject.tabindex = -1;\r\n dayObject.ariaLabel = ariaLabel;\r\n dayObject.hidden = false;\r\n\r\n date = nextDate;\r\n }\r\n\r\n weekObject.number = calendar.getWeekNumber(days.map(day => day.date), firstDayOfWeek);\r\n\r\n // marking week as collapsed\r\n weekObject.collapsed = outsideDays === 'collapsed' && days[0].date.month !== month.number &&\r\n days[days.length - 1].date.month !== month.number;\r\n }\r\n\r\n return month;\r\n}\r\n\r\nexport function getFirstViewDate(calendar: NgbCalendar, date: NgbDate, firstDayOfWeek: number): NgbDate {\r\n const daysPerWeek = calendar.getDaysPerWeek();\r\n const firstMonthDate = new NgbDate(date.year, date.month, 1);\r\n const dayOfWeek = calendar.getWeekday(firstMonthDate) % daysPerWeek;\r\n return calendar.getPrev(firstMonthDate, 'd', (daysPerWeek + dayOfWeek - firstDayOfWeek) % daysPerWeek);\r\n}\r\n","import {Inject, Injectable, LOCALE_ID} from '@angular/core';\r\nimport {formatDate, FormStyle, getLocaleDayNames, getLocaleMonthNames, TranslationWidth} from '@angular/common';\r\nimport {NgbDateStruct} from './ngb-date-struct';\r\n\r\nexport function NGB_DATEPICKER_18N_FACTORY(locale) {\r\n return new NgbDatepickerI18nDefault(locale);\r\n}\r\n\r\n/**\r\n * A service supplying i18n data to the datepicker component.\r\n *\r\n * The default implementation of this service uses the Angular locale and registered locale data for\r\n * weekdays and month names (as explained in the Angular i18n guide).\r\n *\r\n * It also provides a way to i18n data that depends on calendar calculations, like aria labels, day, week and year\r\n * numerals. For other static labels the datepicker uses the default Angular i18n.\r\n *\r\n * See the [i18n demo](#/components/datepicker/examples#i18n) and\r\n * [Hebrew calendar demo](#/components/datepicker/calendars#hebrew) on how to extend this class and define\r\n * a custom provider for i18n.\r\n */\r\n@Injectable({providedIn: 'root', useFactory: NGB_DATEPICKER_18N_FACTORY, deps: [LOCALE_ID]})\r\nexport abstract class NgbDatepickerI18n {\r\n /**\r\n * Returns the short weekday name to display in the heading of the month view.\r\n *\r\n * With default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun.\r\n *\r\n * @deprecated 9.1.0, use 'getWeekdayLabel' instead\r\n */\r\n abstract getWeekdayShortName(weekday: number): string;\r\n\r\n /**\r\n * Returns the weekday label using specified width\r\n *\r\n * @since 9.1.0\r\n */\r\n getWeekdayLabel(weekday: number, width?: TranslationWidth): string { return this.getWeekdayShortName(weekday); }\r\n\r\n /**\r\n * Returns the short month name to display in the date picker navigation.\r\n *\r\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\r\n */\r\n abstract getMonthShortName(month: number, year?: number): string;\r\n\r\n /**\r\n * Returns the full month name to display in the date picker navigation.\r\n *\r\n * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\r\n */\r\n abstract getMonthFullName(month: number, year?: number): string;\r\n\r\n /**\r\n * Returns the text label to display above the day view.\r\n *\r\n * @since 9.1.0\r\n */\r\n getMonthLabel(date: NgbDateStruct): string {\r\n return `${this.getMonthFullName(date.month, date.year)} ${this.getYearNumerals(date.year)}`;\r\n }\r\n\r\n /**\r\n * Returns the value of the `aria-label` attribute for a specific date.\r\n *\r\n * @since 2.0.0\r\n */\r\n abstract getDayAriaLabel(date: NgbDateStruct): string;\r\n\r\n /**\r\n * Returns the textual representation of a day that is rendered in a day cell.\r\n *\r\n * @since 3.0.0\r\n */\r\n getDayNumerals(date: NgbDateStruct): string { return `${date.day}`; }\r\n\r\n /**\r\n * Returns the textual representation of a week number rendered by datepicker.\r\n *\r\n * @since 3.0.0\r\n */\r\n getWeekNumerals(weekNumber: number): string { return `${weekNumber}`; }\r\n\r\n /**\r\n * Returns the textual representation of a year that is rendered in the datepicker year select box.\r\n *\r\n * @since 3.0.0\r\n */\r\n getYearNumerals(year: number): string { return `${year}`; }\r\n\r\n /**\r\n * Returns the week label to display in the heading of the month view.\r\n *\r\n * @since 9.1.0\r\n */\r\n getWeekLabel(): string { return ''; }\r\n}\r\n\r\n/**\r\n * A service providing default implementation for the datepicker i18n.\r\n * It can be used as a base implementation if necessary.\r\n *\r\n * @since 9.1.0\r\n */\r\n@Injectable()\r\nexport class NgbDatepickerI18nDefault extends NgbDatepickerI18n {\r\n private _monthsShort: readonly string[];\r\n private _monthsFull: readonly string[];\r\n\r\n constructor(@Inject(LOCALE_ID) private _locale: string) {\r\n super();\r\n\r\n this._monthsShort = getLocaleMonthNames(_locale, FormStyle.Standalone, TranslationWidth.Abbreviated);\r\n this._monthsFull = getLocaleMonthNames(_locale, FormStyle.Standalone, TranslationWidth.Wide);\r\n }\r\n\r\n getWeekdayShortName(weekday: number): string { return this.getWeekdayLabel(weekday, TranslationWidth.Short); }\r\n\r\n getWeekdayLabel(weekday: number, width?: TranslationWidth): string {\r\n const weekdaysStartingOnSunday =\r\n getLocaleDayNames(this._locale, FormStyle.Standalone, width === undefined ? TranslationWidth.Short : width);\r\n const weekdays = weekdaysStartingOnSunday.map((day, index) => weekdaysStartingOnSunday[(index + 1) % 7]);\r\n return weekdays[weekday - 1] || '';\r\n }\r\n\r\n getMonthShortName(month: number): string { return this._monthsShort[month - 1] || ''; }\r\n\r\n getMonthFullName(month: number): string { return this._monthsFull[month - 1] || ''; }\r\n\r\n getDayAriaLabel(date: NgbDateStruct): string {\r\n const jsDate = new Date(date.year, date.month - 1, date.day);\r\n return formatDate(jsDate, 'fullDate', this._locale);\r\n }\r\n}\r\n","import {NgbCalendar} from './ngb-calendar';\r\nimport {NgbDate} from './ngb-date';\r\nimport {NgbDateStruct} from './ngb-date-struct';\r\nimport {DatepickerViewModel, NgbDayTemplateData, NgbMarkDisabled} from './datepicker-view-model';\r\nimport {Injectable} from '@angular/core';\r\nimport {isInteger, toInteger} from '../util/util';\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {\r\n buildMonths,\r\n checkDateInRange,\r\n checkMinBeforeMax,\r\n generateSelectBoxMonths,\r\n generateSelectBoxYears,\r\n isChangedDate,\r\n isChangedMonth,\r\n isDateSelectable,\r\n nextMonthDisabled,\r\n prevMonthDisabled\r\n} from './datepicker-tools';\r\n\r\nimport {filter} from 'rxjs/operators';\r\nimport {NgbDatepickerI18n} from './datepicker-i18n';\r\nimport {TranslationWidth} from '@angular/common';\r\n\r\n\r\nexport type DatepickerServiceInputs = Partial<{\r\n dayTemplateData: NgbDayTemplateData,\r\n displayMonths: number,\r\n disabled: boolean,\r\n firstDayOfWeek: number,\r\n focusVisible: boolean,\r\n markDisabled: NgbMarkDisabled,\r\n maxDate: NgbDate | null,\r\n minDate: NgbDate | null,\r\n navigation: 'select' | 'arrows' | 'none',\r\n outsideDays: 'visible' | 'collapsed' | 'hidden',\r\n weekdays: TranslationWidth | boolean\r\n}>;\r\n\r\n@Injectable()\r\nexport class NgbDatepickerService {\r\n private _VALIDATORS:\r\n {[K in keyof DatepickerServiceInputs]: (v: DatepickerServiceInputs[K]) => Partial<DatepickerViewModel>| void} = {\r\n dayTemplateData: (dayTemplateData: NgbDayTemplateData) => {\r\n if (this._state.dayTemplateData !== dayTemplateData) {\r\n return {dayTemplateData};\r\n }\r\n },\r\n displayMonths: (displayMonths: number) => {\r\n displayMonths = toInteger(displayMonths);\r\n if (isInteger(displayMonths) && displayMonths > 0 && this._state.displayMonths !== displayMonths) {\r\n return {displayMonths};\r\n }\r\n },\r\n disabled: (disabled: boolean) => {\r\n if (this._state.disabled !== disabled) {\r\n return {disabled};\r\n }\r\n },\r\n firstDayOfWeek: (firstDayOfWeek: number) => {\r\n firstDayOfWeek = toInteger(firstDayOfWeek);\r\n if (isInteger(firstDayOfWeek) && firstDayOfWeek >= 0 && this._state.firstDayOfWeek !== firstDayOfWeek) {\r\n return {firstDayOfWeek};\r\n }\r\n },\r\n focusVisible: (focusVisible: boolean) => {\r\n if (this._state.focusVisible !== focusVisible && !this._state.disabled) {\r\n return {focusVisible};\r\n }\r\n },\r\n markDisabled: (markDisabled: NgbMarkDisabled) => {\r\n if (this._state.markDisabled !== markDisabled) {\r\n return {markDisabled};\r\n }\r\n },\r\n maxDate: (date: NgbDate | null) => {\r\n const maxDate = this.toValidDate(date, null);\r\n if (isChangedDate(this._state.maxDate, maxDate)) {\r\n return {maxDate};\r\n }\r\n },\r\n minDate: (date: NgbDate | null) => {\r\n const minDate = this.toValidDate(date, null);\r\n if (isChangedDate(this._state.minDate, minDate)) {\r\n return {minDate};\r\n }\r\n },\r\n navigation: (navigation: 'select' | 'arrows' | 'none') => {\r\n if (this._state.navigation !== navigation) {\r\n return {navigation};\r\n }\r\n },\r\n outsideDays: (outsideDays: 'visible' | 'collapsed' | 'hidden') => {\r\n if (this._state.outsideDays !== outsideDays) {\r\n return {outsideDays};\r\n }\r\n },\r\n weekdays: (weekdays: boolean | TranslationWidth) => {\r\n const weekdayWidth = weekdays === true || weekdays === false ? TranslationWidth.Short : weekdays;\r\n const weekdaysVisible = weekdays === true || weekdays === false ? weekdays : true;\r\n if (this._state.weekdayWidth !== weekdayWidth || this._state.weekdaysVisible !== weekdaysVisible) {\r\n return {weekdayWidth, weekdaysVisible};\r\n }\r\n }\r\n };\r\n\r\n private _model$ = new Subject<DatepickerViewModel>();\r\n\r\n private _dateSelect$ = new Subject<NgbDate>();\r\n\r\n private _state: DatepickerViewModel = {\r\n dayTemplateData: null,\r\n markDisabled: null,\r\n maxDate: null,\r\n minDate: null,\r\n disabled: false,\r\n displayMonths: 1,\r\n firstDate: null,\r\n firstDayOfWeek: 1,\r\n lastDate: null,\r\n focusDate: null,\r\n focusVisible: false,\r\n months: [],\r\n navigation: 'select',\r\n outsideDays: 'visible',\r\n prevDisabled: false,\r\n nextDisabled: false,\r\n selectedDate: null,\r\n selectBoxes: {years: [], months: []},\r\n weekdayWidth: TranslationWidth.Short,\r\n weekdaysVisible: true\r\n };\r\n\r\n get model$(): Observable<DatepickerViewModel> { return this._model$.pipe(filter(model => model.months.length > 0)); }\r\n\r\n get dateSelect$(): Observable<NgbDate> { return this._dateSelect$.pipe(filter(date => date !== null)); }\r\n\r\n set(options: DatepickerServiceInputs) {\r\n let patch = Object.keys(options)\r\n .map(key => this._VALIDATORS[key](options[key]))\r\n .reduce((obj, part) => ({...obj, ...part}), {});\r\n\r\n if (Object.keys(patch).length > 0) {\r\n this._nextState(patch);\r\n }\r\n }\r\n\r\n constructor(private _calendar: NgbCalendar, private _i18n: NgbDatepickerI18n) {}\r\n\r\n focus(date?: NgbDate | null) {\r\n const focusedDate = this.toValidDate(date, null);\r\n if (focusedDate != null && !this._state.disabled && isChangedDate(this._state.focusDate, focusedDate)) {\r\n this._nextState({focusDate: date});\r\n }\r\n }\r\n\r\n focusSelect() {\r\n if (isDateSelectable(this._state.focusDate, this._state)) {\r\n this.select(this._state.focusDate, {emitEvent: true});\r\n }\r\n }\r\n\r\n open(date?: NgbDate | null) {\r\n const firstDate = this.toValidDate(date, this._calendar.getToday());\r\n if (firstDate != null && !this._state.disabled &&\r\n (!this._state.firstDate || isChangedMonth(this._state.firstDate, firstDate))) {\r\n this._nextState({firstDate});\r\n }\r\n }\r\n\r\n select(date?: NgbDate | null, options: {emitEvent?: boolean} = {}) {\r\n const selectedDate = this.toValidDate(date, null);\r\n if (selectedDate != null && !this._state.disabled) {\r\n if (isChangedDate(this._state.selectedDate, selectedDate)) {\r\n this._nextState({selectedDate});\r\n }\r\n\r\n if (options.emitEvent && isDateSelectable(selectedDate, this._state)) {\r\n this._dateSelect$.next(selectedDate);\r\n }\r\n }\r\n }\r\n\r\n toValidDate(date?: NgbDateStruct | null, defaultValue?: NgbDate | null): NgbDate | null {\r\n const ngbDate = NgbDate.from(date);\r\n if (defaultValue === undefined) {\r\n defaultValue = this._calendar.getToday();\r\n }\r\n return this._calendar.isValid(ngbDate) ? ngbDate : defaultValue;\r\n }\r\n\r\n getMonth(struct: NgbDateStruct) {\r\n for (let month of this._state.months) {\r\n if (struct.month === month.number && struct.year === month.year) {\r\n return month;\r\n }\r\n }\r\n throw new Error(`month ${struct.month} of year ${struct.year} not found`);\r\n }\r\n\r\n private _nextState(patch: Partial<DatepickerViewModel>) {\r\n const newState = this._updateState(patch);\r\n this._patchContexts(newState);\r\n this._state = newState;\r\n this._model$.next(this._state);\r\n }\r\n\r\n private _patchContexts(state: DatepickerViewModel) {\r\n const {months, displayMonths, selectedDate, focusDate, focusVisible, disabled, outsideDays} = state;\r\n state.months.forEach(month => {\r\n month.weeks.forEach(week => {\r\n week.days.forEach(day => {\r\n\r\n // patch focus flag\r\n if (focusDate) {\r\n day.context.focused = focusDate.equals(day.date) && focusVisible;\r\n }\r\n\r\n // calculating tabindex\r\n day.tabindex =\r\n !disabled && focusDate && day.date.equals(focusDate) && focusDate.month === month.number ? 0 : -1;\r\n\r\n // override context disabled\r\n if (disabled === true) {\r\n day.context.disabled = true;\r\n }\r\n\r\n // patch selection flag\r\n if (selectedDate !== undefined) {\r\n day.context.selected = selectedDate !== null && selectedDate.equals(day.date);\r\n }\r\n\r\n // visibility\r\n if (month.number !== day.date.month) {\r\n day.hidden = outsideDays === 'hidden' || outsideDays === 'collapsed' ||\r\n (displayMonths > 1 && day.date.after(months[0].firstDate) &&\r\n day.date.before(months[displayMonths - 1].lastDate));\r\n }\r\n });\r\n });\r\n });\r\n }\r\n\r\n private _updateState(patch: Partial<DatepickerViewModel>): DatepickerViewModel {\r\n // patching fields\r\n const state = Object.assign({}, this._state, patch);\r\n\r\n let startDate = state.firstDate;\r\n\r\n // min/max dates changed\r\n if ('minDate' in patch || 'maxDate' in patch) {\r\n checkMinBeforeMax(state.minDate, state.maxDate);\r\n state.focusDate = checkDateInRange(state.focusDate, state.minDate, state.maxDate);\r\n state.firstDate = checkDateInRange(state.firstDate, state.minDate, state.maxDate);\r\n startDate = state.focusDate;\r\n }\r\n\r\n // disabled\r\n if ('disabled' in patch) {\r\n state.focusVisible = false;\r\n }\r\n\r\n // initial rebuild via 'select()'\r\n if ('selectedDate' in patch && this._state.months.length === 0) {\r\n startDate = state.selectedDate;\r\n }\r\n\r\n // terminate early if only focus visibility was changed\r\n if ('focusVisible' in patch) {\r\n return state;\r\n }\r\n\r\n // focus date changed\r\n if ('focusDate' in patch) {\r\n state.focusDate = checkDateInRange(state.focusDate, state.minDate, state.maxDate);\r\n startDate = state.focusDate;\r\n\r\n // nothing to rebuild if only focus changed and it is still visible\r\n if (state.months.length !== 0 && state.focusDate && !state.focusDate.before(state.firstDate) &&\r\n !state.focusDate.after(state.lastDate)) {\r\n return state;\r\n }\r\n }\r\n\r\n // first date changed\r\n if ('firstDate' in patch) {\r\n state.firstDate = checkDateInRange(state.firstDate, state.minDate, state.maxDate);\r\n startDate = state.firstDate;\r\n }\r\n\r\n // rebuilding months\r\n if (startDate) {\r\n const forceRebuild = 'dayTemplateData' in patch || 'firstDayOfWeek' in patch || 'markDisabled' in patch ||\r\n 'minDate' in patch || 'maxDate' in patch || 'disabled' in patch || 'outsideDays' in patch ||\r\n 'weekdaysVisible' in patch;\r\n\r\n const months = buildMonths(this._calendar, startDate, state, this._i18n, forceRebuild);\r\n\r\n // updating months and boundary dates\r\n state.months = months;\r\n state.firstDate = months[0].firstDate;\r\n state.lastDate = months[months.length - 1].lastDate;\r\n\r\n // reset selected date if 'markDisabled' returns true\r\n if ('selectedDate' in patch && !isDateSelectable(state.selectedDate, state)) {\r\n state.selectedDate = null;\r\n }\r\n\r\n // adjusting focus after months were built\r\n if ('firstDate' in patch) {\r\n if (!state.focusDate || state.focusDate.before(state.firstDate) || state.focusDate.after(state.lastDate)) {\r\n state.focusDate = startDate;\r\n }\r\n }\r\n\r\n // adjusting months/years for the select box navigation\r\n const yearChanged = !this._state.firstDate || this._state.firstDate.year !== state.firstDate.year;\r\n const monthChanged = !this._state.firstDate || this._state.firstDate.month !== state.firstDate.month;\r\n if (state.navigation === 'select') {\r\n // years -> boundaries (min/max were changed)\r\n if ('minDate' in patch || 'maxDate' in patch || state.selectBoxes.years.length === 0 || yearChanged) {\r\n state.selectBoxes.years = generateSelectBoxYears(state.firstDate, state.minDate, state.maxDate);\r\n }\r\n\r\n // months -> when current year or boundaries change\r\n if ('minDate' in patch || 'maxDate' in patch || state.selectBoxes.months.length === 0 || yearChanged) {\r\n state.selectBoxes.months =\r\n generateSelectBoxMonths(this._calendar, state.firstDate, state.minDate, state.maxDate);\r\n }\r\n } else {\r\n state.selectBoxes = {years: [], months: []};\r\n }\r\n\r\n // updating navigation arrows -> boundaries change (min/max) or month/year changes\r\n if ((state.navigation === 'arrows' || state.navigation === 'select') &&\r\n (monthChanged || yearChanged || 'minDate' in patch || 'maxDate' in patch || 'disabled' in patch)) {\r\n state.prevDisabled = state.disabled || prevMonthDisabled(this._calendar, state.firstDate, state.minDate);\r\n state.nextDisabled = state.disabled || nextMonthDisabled(this._calendar, state.lastDate, state.maxDate);\r\n }\r\n }\r\n\r\n return state;\r\n }\r\n}\r\n","import {NgbDate} from './ngb-date';\r\nimport {NgbDateStruct} from './ngb-date-struct';\r\nimport {DayTemplateContext} from './datepicker-day-template-context';\r\nimport {TranslationWidth} from '@angular/common';\r\n\r\nexport type NgbMarkDisabled = (date: NgbDateStruct, current?: {year: number, month: number}) => boolean;\r\nexport type NgbDayTemplateData = (date: NgbDateStruct, current?: {year: number, month: number}) => any;\r\n\r\nexport type DayViewModel = {\r\n date: NgbDate,\r\n context: DayTemplateContext,\r\n tabindex: number,\r\n ariaLabel: string,\r\n hidden: boolean\r\n};\r\n\r\nexport type WeekViewModel = {\r\n number: number,\r\n days: DayViewModel[],\r\n collapsed: boolean\r\n};\r\n\r\nexport type MonthViewModel = {\r\n firstDate: NgbDate,\r\n lastDate: NgbDate,\r\n number: number,\r\n year: number,\r\n weeks: WeekViewModel[],\r\n weekdays: string[]\r\n};\r\n\r\n// clang-format off\r\nexport type DatepickerViewModel = {\r\n dayTemplateData: NgbDayTemplateData | null,\r\n disabled: boolean,\r\n displayMonths: number,\r\n firstDate: NgbDate | null,\r\n firstDayOfWeek: number,\r\n focusDate: NgbDate | null,\r\n focusVisible: boolean,\r\n lastDate: NgbDate | null,\r\n markDisabled: NgbMarkDisabled | null,\r\n maxDate: NgbDate | null,\r\n minDate: NgbDate | null,\r\n months: MonthViewModel[],\r\n navigation: 'select' | 'arrows' | 'none',\r\n outsideDays: 'visible' | 'collapsed' | 'hidden',\r\n prevDisabled: boolean,\r\n nextDisabled: boolean,\r\n selectBoxes: {\r\n years: number[],\r\n months: number[]\r\n },\r\n selectedDate: NgbDate | null,\r\n weekdayWidth: TranslationWidth,\r\n weekdaysVisible: boolean\r\n};\r\n// clang-format on\r\n\r\nexport enum NavigationEvent {\r\n PREV,\r\n NEXT\r\n}\r\n","import {Injectable, TemplateRef} from '@angular/core';\r\nimport {TranslationWidth} from '@angular/common';\r\nimport {DayTemplateContext} from './datepicker-day-template-context';\r\nimport {NgbDateStruct} from './ngb-date-struct';\r\n\r\n/**\r\n * A configuration service for the [`NgbDatepicker`](#/components/datepicker/api#NgbDatepicker) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the datepickers used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbDatepickerConfig {\r\n dayTemplate: TemplateRef<DayTemplateContext>;\r\n dayTemplateData: (date: NgbDateStruct, current?: {year: number, month: number}) => any;\r\n footerTemplate: TemplateRef<any>;\r\n displayMonths = 1;\r\n firstDayOfWeek = 1;\r\n markDisabled: (date: NgbDateStruct, current?: {year: number, month: number}) => boolean;\r\n minDate: NgbDateStruct;\r\n maxDate: NgbDateStruct;\r\n navigation: 'select' | 'arrows' | 'none' = 'select';\r\n outsideDays: 'visible' | 'collapsed' | 'hidden' = 'visible';\r\n showWeekdays = true;\r\n showWeekNumbers = false;\r\n startDate: {year: number, month: number};\r\n weekdays: TranslationWidth | boolean = TranslationWidth.Short;\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbDateStruct} from '../ngb-date-struct';\r\nimport {isInteger} from '../../util/util';\r\n\r\nexport function NGB_DATEPICKER_DATE_ADAPTER_FACTORY() {\r\n return new NgbDateStructAdapter();\r\n}\r\n\r\n/**\r\n * An abstract service that does the conversion between the internal datepicker `NgbDateStruct` model and\r\n * any provided user date model `D`, ex. a string, a native date, etc.\r\n *\r\n * The adapter is used **only** for conversion when binding datepicker to a form control,\r\n * ex. `[(ngModel)]=\"userDateModel\"`. Here `userDateModel` can be of any type.\r\n *\r\n * The default datepicker implementation assumes we use `NgbDateStruct` as a user model.\r\n *\r\n * See the [date format overview](#/components/datepicker/overview#date-model) for more details\r\n * and the [custom adapter demo](#/components/datepicker/examples#adapter) for an example.\r\n */\r\n@Injectable({providedIn: 'root', useFactory: NGB_DATEPICKER_DATE_ADAPTER_FACTORY})\r\nexport abstract class NgbDateAdapter<D> {\r\n /**\r\n * Converts a user-model date of type `D` to an `NgbDateStruct` for internal use.\r\n */\r\n abstract fromModel(value: D | null): NgbDateStruct | null;\r\n\r\n /**\r\n * Converts an internal `NgbDateStruct` date to a user-model date of type `D`.\r\n */\r\n abstract toModel(date: NgbDateStruct | null): D | null;\r\n}\r\n\r\n@Injectable()\r\nexport class NgbDateStructAdapter extends NgbDateAdapter<NgbDateStruct> {\r\n /**\r\n * Converts a NgbDateStruct value into NgbDateStruct value\r\n */\r\n fromModel(date: NgbDateStruct | null): NgbDateStruct | null {\r\n return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?\r\n {year: date.year, month: date.month, day: date.day} :\r\n null;\r\n }\r\n\r\n /**\r\n * Converts a NgbDateStruct value into NgbDateStruct value\r\n */\r\n toModel(date: NgbDateStruct | null): NgbDateStruct | null {\r\n return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?\r\n {year: date.year, month: date.month, day: date.day} :\r\n null;\r\n }\r\n}\r\n","import {fromEvent, merge, Subject} from 'rxjs';\r\nimport {filter, take, takeUntil} from 'rxjs/operators';\r\nimport {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ContentChild,\r\n Directive,\r\n ElementRef,\r\n EventEmitter,\r\n forwardRef,\r\n Input,\r\n NgZone,\r\n OnChanges,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n SimpleChanges,\r\n TemplateRef,\r\n ViewChild,\r\n ViewEncapsulation\r\n} from '@angular/core';\r\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\r\nimport {TranslationWidth} from '@angular/common';\r\n\r\nimport {NgbCalendar} from './ngb-calendar';\r\nimport {NgbDate} from './ngb-date';\r\nimport {DatepickerServiceInputs, NgbDatepickerService} from './datepicker-service';\r\nimport {DatepickerViewModel, NavigationEvent} from './datepicker-view-model';\r\nimport {DayTemplateContext} from './datepicker-day-template-context';\r\nimport {NgbDatepickerConfig} from './datepicker-config';\r\nimport {NgbDateAdapter} from './adapters/ngb-date-adapter';\r\nimport {NgbDateStruct} from './ngb-date-struct';\r\nimport {NgbDatepickerI18n} from './datepicker-i18n';\r\nimport {isChangedDate, isChangedMonth} from './datepicker-tools';\r\nimport {hasClassName} from '../util/util';\r\n\r\n/**\r\n * An event emitted right before the navigation happens and the month displayed by the datepicker changes.\r\n */\r\nexport interface NgbDatepickerNavigateEvent {\r\n /**\r\n * The currently displayed month.\r\n */\r\n current: {year: number, month: number} | null;\r\n\r\n /**\r\n * The month we're navigating to.\r\n */\r\n next: {year: number, month: number};\r\n\r\n /**\r\n * Calling this function will prevent navigation from happening.\r\n *\r\n * @since 4.1.0\r\n */\r\n preventDefault: () => void;\r\n}\r\n\r\n/**\r\n * An interface that represents the readonly public state of the datepicker.\r\n *\r\n * Accessible via the `datepicker.state` getter\r\n *\r\n * @since 5.2.0\r\n */\r\nexport interface NgbDatepickerState {\r\n /**\r\n * The earliest date that can be displayed or selected\r\n */\r\n readonly minDate: NgbDate | null;\r\n\r\n /**\r\n * The latest date that can be displayed or selected\r\n */\r\n readonly maxDate: NgbDate | null;\r\n\r\n /**\r\n * The first visible date of currently displayed months\r\n */\r\n readonly firstDate: NgbDate;\r\n\r\n /**\r\n * The last visible date of currently displayed months\r\n */\r\n readonly lastDate: NgbDate;\r\n\r\n /**\r\n * The date currently focused by the datepicker\r\n */\r\n readonly focusedDate: NgbDate;\r\n\r\n /**\r\n * First dates of months currently displayed by the datepicker\r\n *\r\n * @since 5.3.0\r\n */\r\n readonly months: NgbDate[];\r\n}\r\n\r\n/**\r\n * A directive that marks the content template that customizes the way datepicker months are displayed\r\n *\r\n * @since 5.3.0\r\n */\r\n@Directive({selector: 'ng-template[ngbDatepickerContent]'})\r\nexport class NgbDatepickerContent {\r\n constructor(public templateRef: TemplateRef<any>) {}\r\n}\r\n\r\n/**\r\n * A highly configurable component that helps you with selecting calendar dates.\r\n *\r\n * `NgbDatepicker` is meant to be displayed inline on a page or put inside a popup.\r\n */\r\n@Component({\r\n exportAs: 'ngbDatepicker',\r\n selector: 'ngb-datepicker',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n styleUrls: ['./datepicker.scss'],\r\n template: `\r\n <ng-template #defaultDayTemplate let-date=\"date\" let-currentMonth=\"currentMonth\" let-selected=\"selected\"\r\n let-disabled=\"disabled\" let-focused=\"focused\">\r\n <div ngbDatepickerDayView\r\n [date]=\"date\"\r\n [currentMonth]=\"currentMonth\"\r\n [selected]=\"selected\"\r\n [disabled]=\"disabled\"\r\n [focused]=\"focused\">\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #defaultContentTemplate>\r\n <div *ngFor=\"let month of model.months; let i = index;\" class=\"ngb-dp-month\">\r\n <div *ngIf=\"navigation === 'none' || (displayMonths > 1 && navigation === 'select')\" class=\"ngb-dp-month-name\">\r\n {{ i18n.getMonthLabel(month.firstDate) }}\r\n </div>\r\n <ngb-datepicker-month [month]=\"month.firstDate\"></ngb-datepicker-month>\r\n </div>\r\n </ng-template>\r\n\r\n <div class=\"ngb-dp-header\">\r\n <ngb-datepicker-navigation *ngIf=\"navigation !== 'none'\"\r\n [date]=\"model.firstDate!\"\r\n [months]=\"model.months\"\r\n [disabled]=\"model.disabled\"\r\n [showSelect]=\"model.navigation === 'select'\"\r\n [prevDisabled]=\"model.prevDisabled\"\r\n [nextDisabled]=\"model.nextDisabled\"\r\n [selectBoxes]=\"model.selectBoxes\"\r\n (navigate)=\"onNavigateEvent($event)\"\r\n (select)=\"onNavigateDateSelect($event)\">\r\n </ngb-datepicker-navigation>\r\n </div>\r\n\r\n <div class=\"ngb-dp-content\" [class.ngb-dp-months]=\"!contentTemplate\" #content>\r\n <ng-template [ngTemplateOutlet]=\"contentTemplate?.templateRef || defaultContentTemplate\"></ng-template>\r\n </div>\r\n\r\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"></ng-template>\r\n `,\r\n providers:\r\n [{provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgbDatepicker), multi: true}, NgbDatepickerService]\r\n})\r\nexport class NgbDatepicker implements OnDestroy,\r\n OnChanges, OnInit, ControlValueAccessor {\r\n static ngAcceptInputType_autoClose: boolean | string;\r\n static ngAcceptInputType_navigation: string;\r\n static ngAcceptInputType_outsideDays: string;\r\n static ngAcceptInputType_weekdays: boolean | number;\r\n\r\n model: DatepickerViewModel;\r\n\r\n @ViewChild('defaultDayTemplate', {static: true}) private _defaultDayTemplate: TemplateRef<DayTemplateContext>;\r\n @ViewChild('content', {static: true}) private _contentEl: ElementRef<HTMLElement>;\r\n @ContentChild(NgbDatepickerContent, {static: true}) contentTemplate: NgbDatepickerContent;\r\n\r\n private _controlValue: NgbDate | null = null;\r\n private _destroyed$ = new Subject<void>();\r\n private _publicState: NgbDatepickerState = <any>{};\r\n private _showWeekdays: boolean;\r\n\r\n /**\r\n * The reference to a custom template for the day.\r\n *\r\n * Allows to completely override the way a day 'cell' in the calendar is displayed.\r\n *\r\n * See [`DayTemplateContext`](#/components/datepicker/api#DayTemplateContext) for the data you get inside.\r\n */\r\n @Input() dayTemplate: TemplateRef<DayTemplateContext>;\r\n\r\n /**\r\n * The callback to pass any arbitrary data to the template cell via the\r\n * [`DayTemplateContext`](#/components/datepicker/api#DayTemplateContext)'s `data` parameter.\r\n *\r\n * `current` is the month that is currently displayed by the datepicker.\r\n *\r\n * @since 3.3.0\r\n */\r\n @Input() dayTemplateData: (date: NgbDate, current?: {year: number, month: number}) => any;\r\n\r\n /**\r\n * The number of months to display.\r\n */\r\n @Input() displayMonths: number;\r\n\r\n /**\r\n * The first day of the week.\r\n *\r\n * With default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun.\r\n */\r\n @Input() firstDayOfWeek: number;\r\n\r\n /**\r\n * The reference to the custom template for the datepicker footer.\r\n *\r\n * @since 3.3.0\r\n */\r\n @Input() footerTemplate: TemplateRef<any>;\r\n\r\n /**\r\n * The callback to mark some dates as disabled.\r\n *\r\n * It is called for each new date when navigating to a different month.\r\n *\r\n * `current` is the month that is currently displayed by the datepicker.\r\n */\r\n @Input() markDisabled: (date: NgbDate, current?: {year: number, month: number}) => boolean;\r\n\r\n /**\r\n * The latest date that can be displayed or selected.\r\n *\r\n * If not provided, 'year' select box will display 10 years after the current month.\r\n */\r\n @Input() maxDate: NgbDateStruct;\r\n\r\n /**\r\n * The earliest date that can be displayed or selected.\r\n *\r\n * If not provided, 'year' select box will display 10 years before the current month.\r\n */\r\n @Input() minDate: NgbDateStruct;\r\n\r\n /**\r\n * Navigation type.\r\n *\r\n * * `\"select\"` - select boxes for month and navigation arrows\r\n * * `\"arrows\"` - only navigation arrows\r\n * * `\"none\"` - no navigation visible at all\r\n */\r\n @Input() navigation: 'select' | 'arrows' | 'none';\r\n\r\n /**\r\n * The way of displaying days that don't belong to the current month.\r\n *\r\n * * `\"visible\"` - days are visible\r\n * * `\"hidden\"` - days are hidden, white space preserved\r\n * * `\"collapsed\"` - days are collapsed, so the datepicker height might change between months\r\n *\r\n * For the 2+ months view, days in between months are never shown.\r\n */\r\n @Input() outsideDays: 'visible' | 'collapsed' | 'hidden';\r\n\r\n /**\r\n * If `true`, weekdays will be displayed.\r\n *\r\n * @deprecated 9.1.0, please use 'weekdays' instead\r\n */\r\n @Input()\r\n set showWeekdays(weekdays: boolean) {\r\n this.weekdays = weekdays;\r\n this._showWeekdays = weekdays;\r\n }\r\n\r\n get showWeekdays(): boolean { return this._showWeekdays; }\r\n\r\n /**\r\n * If `true`, week numbers will be displayed.\r\n */\r\n @Input() showWeekNumbers: boolean;\r\n\r\n /**\r\n * The date to open calendar with.\r\n *\r\n * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\r\n * If nothing or invalid date is provided, calendar will open with current month.\r\n *\r\n * You could use `navigateTo(date)` method as an alternative.\r\n */\r\n @Input() startDate: {year: number, month: number, day?: number};\r\n\r\n /**\r\n * The way weekdays should be displayed.\r\n *\r\n * * `true` - weekdays are displayed using default width\r\n * * `false` - weekdays are not displayed\r\n * * `TranslationWidth` - weekdays are displayed using specified width\r\n *\r\n * @since 9.1.0\r\n */\r\n @Input() weekdays: TranslationWidth | boolean;\r\n\r\n /**\r\n * An event emitted right before the navigation happens and displayed month changes.\r\n *\r\n * See [`NgbDatepickerNavigateEvent`](#/components/datepicker/api#NgbDatepickerNavigateEvent) for the payload info.\r\n */\r\n @Output() navigate = new EventEmitter<NgbDatepickerNavigateEvent>();\r\n\r\n /**\r\n * An event emitted when user selects a date using keyboard or mouse.\r\n *\r\n * The payload of the event is currently selected `NgbDate`.\r\n *\r\n * @since 5.2.0\r\n */\r\n @Output() dateSelect = new EventEmitter<NgbDate>();\r\n\r\n onChange = (_: any) => {};\r\n onTouched = () => {};\r\n\r\n constructor(\r\n private _service: NgbDatepickerService, private _calendar: NgbCalendar, public i18n: NgbDatepickerI18n,\r\n config: NgbDatepickerConfig, cd: ChangeDetectorRef, private _elementRef: ElementRef<HTMLElement>,\r\n private _ngbDateAdapter: NgbDateAdapter<any>, private _ngZone: NgZone) {\r\n ['dayTemplate', 'dayTemplateData', 'displayMonths', 'firstDayOfWeek', 'footerTemplate', 'markDisabled', 'minDate',\r\n 'maxDate', 'navigation', 'outsideDays', 'showWeekdays', 'showWeekNumbers', 'startDate', 'weekdays']\r\n .forEach(input => this[input] = config[input]);\r\n\r\n _service.dateSelect$.pipe(takeUntil(this._destroyed$)).subscribe(date => { this.dateSelect.emit(date); });\r\n\r\n _service.model$.pipe(takeUntil(this._destroyed$)).subscribe(model => {\r\n const newDate = model.firstDate !;\r\n const oldDate = this.model ? this.model.firstDate : null;\r\n\r\n // update public state\r\n this._publicState = {\r\n maxDate: model.maxDate,\r\n minDate: model.minDate,\r\n firstDate: model.firstDate !,\r\n lastDate: model.lastDate !,\r\n focusedDate: model.focusDate !,\r\n months: model.months.map(viewModel => viewModel.firstDate)\r\n };\r\n\r\n let navigationPrevented = false;\r\n // emitting navigation event if the first month changes\r\n if (!newDate.equals(oldDate)) {\r\n this.navigate.emit({\r\n current: oldDate ? {year: oldDate.year, month: oldDate.month} : null,\r\n next: {year: newDate.year, month: newDate.month},\r\n preventDefault: () => navigationPrevented = true\r\n });\r\n\r\n // can't prevent the very first navigation\r\n if (navigationPrevented && oldDate !== null) {\r\n this._service.open(oldDate);\r\n return;\r\n }\r\n }\r\n\r\n const newSelectedDate = model.selectedDate;\r\n const newFocusedDate = model.focusDate;\r\n const oldFocusedDate = this.model ? this.model.focusDate : null;\r\n\r\n this.model = model;\r\n\r\n // handling selection change\r\n if (isChangedDate(newSelectedDate, this._controlValue)) {\r\n this._controlValue = newSelectedDate;\r\n this.onTouched();\r\n this.onChange(this._ngbDateAdapter.toModel(newSelectedDate));\r\n }\r\n\r\n // handling focus change\r\n if (isChangedDate(newFocusedDate, oldFocusedDate) && oldFocusedDate && model.focusVisible) {\r\n this.focus();\r\n }\r\n\r\n cd.markForCheck();\r\n });\r\n }\r\n\r\n /**\r\n * Returns the readonly public state of the datepicker\r\n *\r\n * @since 5.2.0\r\n */\r\n get state(): NgbDatepickerState { return this._publicState; }\r\n\r\n /**\r\n * Returns the calendar service used in the specific datepicker instance.\r\n *\r\n * @since 5.3.0\r\n */\r\n get calendar(): NgbCalendar { return this._calendar; }\r\n\r\n /**\r\n * Focuses on given date.\r\n */\r\n focusDate(date?: NgbDateStruct | null): void { this._service.focus(NgbDate.from(date)); }\r\n\r\n /**\r\n * Selects focused date.\r\n */\r\n focusSelect(): void { this._service.focusSelect(); }\r\n\r\n focus() {\r\n this._ngZone.onStable.asObservable().pipe(take(1)).subscribe(() => {\r\n const elementToFocus =\r\n this._elementRef.nativeElement.querySelector<HTMLDivElement>('div.ngb-dp-day[tabindex=\"0\"]');\r\n if (elementToFocus) {\r\n elementToFocus.focus();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Navigates to the provided date.\r\n *\r\n * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\r\n * If nothing or invalid date provided calendar will open current month.\r\n *\r\n * Use the `[startDate]` input as an alternative.\r\n */\r\n navigateTo(date?: {year: number, month: number, day?: number}) {\r\n this._service.open(NgbDate.from(date ? date.day ? date as NgbDateStruct : {...date, day: 1} : null));\r\n }\r\n\r\n ngAfterViewInit() {\r\n this._ngZone.runOutsideAngular(() => {\r\n const focusIns$ = fromEvent<FocusEvent>(this._contentEl.nativeElement, 'focusin');\r\n const focusOuts$ = fromEvent<FocusEvent>(this._contentEl.nativeElement, 'focusout');\r\n const {nativeElement} = this._elementRef;\r\n\r\n // we're changing 'focusVisible' only when entering or leaving months view\r\n // and ignoring all focus events where both 'target' and 'related' target are day cells\r\n merge(focusIns$, focusOuts$)\r\n .pipe(\r\n filter(\r\n ({target, relatedTarget}) =>\r\n !(hasClassName(target, 'ngb-dp-day') && hasClassName(relatedTarget, 'ngb-dp-day') &&\r\n nativeElement.contains(target as Node) && nativeElement.contains(relatedTarget as Node))),\r\n takeUntil(this._destroyed$))\r\n .subscribe(({type}) => this._ngZone.run(() => this._service.set({focusVisible: type === 'focusin'})));\r\n });\r\n }\r\n\r\n ngOnDestroy() { this._destroyed$.next(); }\r\n\r\n ngOnInit() {\r\n if (this.model === undefined) {\r\n const inputs: DatepickerServiceInputs = {};\r\n ['dayTemplateData', 'displayMonths', 'markDisabled', 'firstDayOfWeek', 'navigation', 'minDate', 'maxDate',\r\n 'outsideDays', 'weekdays']\r\n .forEach(name => inputs[name] = this[name]);\r\n this._service.set(inputs);\r\n\r\n this.navigateTo(this.startDate);\r\n }\r\n if (!this.dayTemplate) {\r\n this.dayTemplate = this._defaultDayTemplate;\r\n }\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n const inputs: DatepickerServiceInputs = {};\r\n\r\n if (changes.showWeekdays) {\r\n inputs['weekdays'] = this.weekdays;\r\n }\r\n\r\n ['dayTemplateData', 'displayMonths', 'markDisabled', 'firstDayOfWeek', 'navigation', 'minDate', 'maxDate',\r\n 'outsideDays', 'weekdays']\r\n .filter(name => name in changes)\r\n .forEach(name => inputs[name] = this[name]);\r\n this._service.set(inputs);\r\n\r\n if ('startDate' in changes) {\r\n const {currentValue, previousValue} = changes.startDate;\r\n if (isChangedMonth(previousValue, currentValue)) {\r\n this.navigateTo(this.startDate);\r\n }\r\n }\r\n }\r\n\r\n onDateSelect(date: NgbDate) {\r\n this._service.focus(date);\r\n this._service.select(date, {emitEvent: true});\r\n }\r\n\r\n onNavigateDateSelect(date: NgbDate) { this._service.open(date); }\r\n\r\n onNavigateEvent(event: NavigationEvent) {\r\n switch (event) {\r\n case NavigationEvent.PREV:\r\n this._service.open(this._calendar.getPrev(this.model.firstDate !, 'm', 1));\r\n break;\r\n case NavigationEvent.NEXT:\r\n this._service.open(this._calendar.getNext(this.model.firstDate !, 'm', 1));\r\n break;\r\n }\r\n }\r\n\r\n registerOnChange(fn: (value: any) => any): void { this.onChange = fn; }\r\n\r\n registerOnTouched(fn: () => any): void { this.onTouched = fn; }\r\n\r\n setDisabledState(disabled: boolean) { this._service.set({disabled}); }\r\n\r\n writeValue(value) {\r\n this._controlValue = NgbDate.from(this._ngbDateAdapter.fromModel(value));\r\n this._service.select(this._controlValue);\r\n }\r\n}\r\n","export enum Key {\r\n Tab = 9,\r\n Enter = 13,\r\n Escape = 27,\r\n Space = 32,\r\n PageUp = 33,\r\n PageDown = 34,\r\n End = 35,\r\n Home = 36,\r\n ArrowLeft = 37,\r\n ArrowUp = 38,\r\n ArrowRight = 39,\r\n ArrowDown = 40\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbDatepicker} from './datepicker';\r\nimport {Key} from '../util/key';\r\n\r\n/**\r\n * A service that represents the keyboard navigation.\r\n *\r\n * Default keyboard shortcuts [are documented in the overview](#/components/datepicker/overview#keyboard-shortcuts)\r\n *\r\n * @since 5.2.0\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbDatepickerKeyboardService {\r\n /**\r\n * Processes a keyboard event.\r\n */\r\n processKey(event: KeyboardEvent, datepicker: NgbDatepicker) {\r\n const {state, calendar} = datepicker;\r\n // tslint:disable-next-line:deprecation\r\n switch (event.which) {\r\n case Key.PageUp:\r\n datepicker.focusDate(calendar.getPrev(state.focusedDate, event.shiftKey ? 'y' : 'm', 1));\r\n break;\r\n case Key.PageDown:\r\n datepicker.focusDate(calendar.getNext(state.focusedDate, event.shiftKey ? 'y' : 'm', 1));\r\n break;\r\n case Key.End:\r\n datepicker.focusDate(event.shiftKey ? state.maxDate : state.lastDate);\r\n break;\r\n case Key.Home:\r\n datepicker.focusDate(event.shiftKey ? state.minDate : state.firstDate);\r\n break;\r\n case Key.ArrowLeft:\r\n datepicker.focusDate(calendar.getPrev(state.focusedDate, 'd', 1));\r\n break;\r\n case Key.ArrowUp:\r\n datepicker.focusDate(calendar.getPrev(state.focusedDate, 'd', calendar.getDaysPerWeek()));\r\n break;\r\n case Key.ArrowRight:\r\n datepicker.focusDate(calendar.getNext(state.focusedDate, 'd', 1));\r\n break;\r\n case Key.ArrowDown:\r\n datepicker.focusDate(calendar.getNext(state.focusedDate, 'd', calendar.getDaysPerWeek()));\r\n break;\r\n case Key.Enter:\r\n case Key.Space:\r\n datepicker.focusSelect();\r\n break;\r\n default:\r\n return;\r\n }\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n}\r\n","import {Component, Input, ViewEncapsulation} from '@angular/core';\r\nimport {NgbDatepicker} from './datepicker';\r\nimport {NgbDatepickerI18n} from './datepicker-i18n';\r\nimport {NgbDatepickerKeyboardService} from './datepicker-keyboard-service';\r\nimport {NgbDatepickerService} from './datepicker-service';\r\nimport {MonthViewModel, DayViewModel} from './datepicker-view-model';\r\nimport {NgbDateStruct} from './ngb-date-struct';\r\n\r\n/**\r\n * A component that renders one month including all the days, weekdays and week numbers. Can be used inside\r\n * the `<ng-template ngbDatepickerMonths></ng-template>` when you want to customize months layout.\r\n *\r\n * For a usage example, see [custom month layout demo](#/components/datepicker/examples#custommonth)\r\n *\r\n * @since 5.3.0\r\n */\r\n@Component({\r\n selector: 'ngb-datepicker-month',\r\n host: {'role': 'grid', '(keydown)': 'onKeyDown($event)'},\r\n encapsulation: ViewEncapsulation.None,\r\n styleUrls: ['./datepicker-month.scss'],\r\n template: `\r\n <div *ngIf=\"viewModel.weekdays.length > 0\" class=\"ngb-dp-week ngb-dp-weekdays\" role=\"row\">\r\n <div *ngIf=\"datepicker.showWeekNumbers\" class=\"ngb-dp-weekday ngb-dp-showweek small\">{{ i18n.getWeekLabel() }}</div>\r\n <div *ngFor=\"let weekday of viewModel.weekdays\" class=\"ngb-dp-weekday small\" role=\"columnheader\">{{ weekday }}</div>\r\n </div>\r\n <ng-template ngFor let-week [ngForOf]=\"viewModel.weeks\">\r\n <div *ngIf=\"!week.collapsed\" class=\"ngb-dp-week\" role=\"row\">\r\n <div *ngIf=\"datepicker.showWeekNumbers\" class=\"ngb-dp-week-number small text-muted\">{{ i18n.getWeekNumerals(week.number) }}</div>\r\n <div *ngFor=\"let day of week.days\" (click)=\"doSelect(day); $event.preventDefault()\" class=\"ngb-dp-day\" role=\"gridcell\"\r\n [class.disabled]=\"day.context.disabled\"\r\n [tabindex]=\"day.tabindex\"\r\n [class.hidden]=\"day.hidden\"\r\n [class.ngb-dp-today]=\"day.context.today\"\r\n [attr.aria-label]=\"day.ariaLabel\">\r\n <ng-template [ngIf]=\"!day.hidden\">\r\n <ng-template [ngTemplateOutlet]=\"datepicker.dayTemplate\" [ngTemplateOutletContext]=\"day.context\"></ng-template>\r\n </ng-template>\r\n </div>\r\n </div>\r\n </ng-template>\r\n `\r\n})\r\nexport class NgbDatepickerMonth {\r\n /**\r\n * The first date of month to be rendered.\r\n *\r\n * This month must one of the months present in the\r\n * [datepicker state](#/components/datepicker/api#NgbDatepickerState).\r\n */\r\n @Input()\r\n set month(month: NgbDateStruct) {\r\n this.viewModel = this._service.getMonth(month);\r\n }\r\n\r\n viewModel: MonthViewModel;\r\n\r\n constructor(\r\n public i18n: NgbDatepickerI18n, public datepicker: NgbDatepicker,\r\n private _keyboardService: NgbDatepickerKeyboardService, private _service: NgbDatepickerService) {}\r\n\r\n onKeyDown(event: KeyboardEvent) { this._keyboardService.processKey(event, this.datepicker); }\r\n\r\n doSelect(day: DayViewModel) {\r\n if (!day.context.disabled && !day.hidden) {\r\n this.datepicker.onDateSelect(day.date);\r\n }\r\n }\r\n}\r\n","import {Component, Input, Output, EventEmitter, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';\r\nimport {NavigationEvent, MonthViewModel} from './datepicker-view-model';\r\nimport {NgbDate} from './ngb-date';\r\nimport {NgbDatepickerI18n} from './datepicker-i18n';\r\n\r\n@Component({\r\n selector: 'ngb-datepicker-navigation',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n styleUrls: ['./datepicker-navigation.scss'],\r\n template: `\r\n <div class=\"ngb-dp-arrow\">\r\n <button type=\"button\" class=\"btn btn-link ngb-dp-arrow-btn\" (click)=\"onClickPrev($event)\" [disabled]=\"prevDisabled\"\r\n i18n-aria-label=\"@@ngb.datepicker.previous-month\" aria-label=\"Previous month\"\r\n i18n-title=\"@@ngb.datepicker.previous-month\" title=\"Previous month\">\r\n <span class=\"ngb-dp-navigation-chevron\"></span>\r\n </button>\r\n </div>\r\n <ngb-datepicker-navigation-select *ngIf=\"showSelect\" class=\"ngb-dp-navigation-select\"\r\n [date]=\"date\"\r\n [disabled] = \"disabled\"\r\n [months]=\"selectBoxes.months\"\r\n [years]=\"selectBoxes.years\"\r\n (select)=\"select.emit($event)\">\r\n </ngb-datepicker-navigation-select>\r\n\r\n <ng-template *ngIf=\"!showSelect\" ngFor let-month [ngForOf]=\"months\" let-i=\"index\">\r\n <div class=\"ngb-dp-arrow\" *ngIf=\"i > 0\"></div>\r\n <div class=\"ngb-dp-month-name\">\r\n {{ i18n.getMonthFullName(month.number, month.year) }} {{ i18n.getYearNumerals(month.year) }}\r\n </div>\r\n <div class=\"ngb-dp-arrow\" *ngIf=\"i !== months.length - 1\"></div>\r\n </ng-template>\r\n <div class=\"ngb-dp-arrow right\">\r\n <button type=\"button\" class=\"btn btn-link ngb-dp-arrow-btn\" (click)=\"onClickNext($event)\" [disabled]=\"nextDisabled\"\r\n i18n-aria-label=\"@@ngb.datepicker.next-month\" aria-label=\"Next month\"\r\n i18n-title=\"@@ngb.datepicker.next-month\" title=\"Next month\">\r\n <span class=\"ngb-dp-navigation-chevron\"></span>\r\n </button>\r\n </div>\r\n `\r\n})\r\nexport class NgbDatepickerNavigation {\r\n navigation = NavigationEvent;\r\n\r\n @Input() date: NgbDate;\r\n @Input() disabled: boolean;\r\n @Input() months: MonthViewModel[] = [];\r\n @Input() showSelect: boolean;\r\n @Input() prevDisabled: boolean;\r\n @Input() nextDisabled: boolean;\r\n @Input() selectBoxes: {years: number[], months: number[]};\r\n\r\n @Output() navigate = new EventEmitter<NavigationEvent>();\r\n @Output() select = new EventEmitter<NgbDate>();\r\n\r\n constructor(public i18n: NgbDatepickerI18n) {}\r\n\r\n onClickPrev(event: MouseEvent) {\r\n (event.currentTarget as HTMLElement).focus();\r\n this.navigate.emit(this.navigation.PREV);\r\n }\r\n\r\n onClickNext(event: MouseEvent) {\r\n (event.currentTarget as HTMLElement).focus();\r\n this.navigate.emit(this.navigation.NEXT);\r\n }\r\n}\r\n","import {NgZone} from '@angular/core';\r\nimport {fromEvent, Observable, race} from 'rxjs';\r\nimport {delay, filter, map, takeUntil, tap, withLatestFrom} from 'rxjs/operators';\r\nimport {Key} from './key';\r\nimport {closest} from './util';\r\n\r\nconst isContainedIn = (element: HTMLElement, array?: HTMLElement[]) =>\r\n array ? array.some(item => item.contains(element)) : false;\r\n\r\nconst matchesSelectorIfAny = (element: HTMLElement, selector?: string) =>\r\n !selector || closest(element, selector) != null;\r\n\r\n// we have to add a more significant delay to avoid re-opening when handling (click) on a toggling element\r\n// TODO: use proper Angular platform detection when NgbAutoClose becomes a service and we can inject PLATFORM_ID\r\nconst isMobile = (() => {\r\n const isIOS = () => /iPad|iPhone|iPod/.test(navigator.userAgent) ||\r\n (/Macintosh/.test(navigator.userAgent) && navigator.maxTouchPoints && navigator.maxTouchPoints > 2);\r\n const isAndroid = () => /Android/.test(navigator.userAgent);\r\n\r\n return typeof navigator !== 'undefined' ? !!navigator.userAgent && (isIOS() || isAndroid()) : false;\r\n})();\r\n\r\n// setting 'ngbAutoClose' synchronously on mobile results in immediate popup closing\r\n// when tapping on the triggering element\r\nconst wrapAsyncForMobile = fn => isMobile ? () => setTimeout(() => fn(), 100) : fn;\r\n\r\nexport const enum SOURCE {ESCAPE, CLICK}\r\n\r\nexport function ngbAutoClose(\r\n zone: NgZone, document: any, type: boolean | 'inside' | 'outside', close: (source: SOURCE) => void,\r\n closed$: Observable<any>, insideElements: HTMLElement[], ignoreElements?: HTMLElement[], insideSelector?: string) {\r\n // closing on ESC and outside clicks\r\n if (type) {\r\n zone.runOutsideAngular(wrapAsyncForMobile(() => {\r\n\r\n const shouldCloseOnClick = (event: MouseEvent) => {\r\n const element = event.target as HTMLElement;\r\n if (event.button === 2 || isContainedIn(element, ignoreElements)) {\r\n return false;\r\n }\r\n if (type === 'inside') {\r\n return isContainedIn(element, insideElements) && matchesSelectorIfAny(element, insideSelector);\r\n } else if (type === 'outside') {\r\n return !isContainedIn(element, insideElements);\r\n } else /* if (type === true) */ {\r\n return matchesSelectorIfAny(element, insideSelector) || !isContainedIn(element, insideElements);\r\n }\r\n };\r\n\r\n const escapes$ = fromEvent<KeyboardEvent>(document, 'keydown')\r\n .pipe(\r\n takeUntil(closed$),\r\n // tslint:disable-next-line:deprecation\r\n filter(e => e.which === Key.Escape), tap(e => e.preventDefault()));\r\n\r\n\r\n // we have to pre-calculate 'shouldCloseOnClick' on 'mousedown',\r\n // because on 'mouseup' DOM nodes might be detached\r\n const mouseDowns$ =\r\n fromEvent<MouseEvent>(document, 'mousedown').pipe(map(shouldCloseOnClick), takeUntil(closed$));\r\n\r\n const closeableClicks$ = fromEvent<MouseEvent>(document, 'mouseup')\r\n .pipe(\r\n withLatestFrom(mouseDowns$), filter(([_, shouldClose]) => shouldClose), delay(0),\r\n takeUntil(closed$)) as Observable<MouseEvent>;\r\n\r\n\r\n race<SOURCE>([\r\n escapes$.pipe(map(_ => SOURCE.ESCAPE)), closeableClicks$.pipe(map(_ => SOURCE.CLICK))\r\n ]).subscribe((source: SOURCE) => zone.run(() => close(source)));\r\n }));\r\n }\r\n}\r\n","import {NgZone} from '@angular/core';\r\n\r\nimport {fromEvent, Observable} from 'rxjs';\r\nimport {filter, map, takeUntil, withLatestFrom} from 'rxjs/operators';\r\n\r\nimport {Key} from './key';\r\n\r\n\r\nexport const FOCUSABLE_ELEMENTS_SELECTOR = [\r\n 'a[href]', 'button:not([disabled])', 'input:not([disabled]):not([type=\"hidden\"])', 'select:not([disabled])',\r\n 'textarea:not([disabled])', '[contenteditable]', '[tabindex]:not([tabindex=\"-1\"])'\r\n].join(', ');\r\n\r\n/**\r\n * Returns first and last focusable elements inside of a given element based on specific CSS selector\r\n */\r\nexport function getFocusableBoundaryElements(element: HTMLElement): HTMLElement[] {\r\n const list: HTMLElement[] =\r\n Array.from(element.querySelectorAll(FOCUSABLE_ELEMENTS_SELECTOR) as NodeListOf<HTMLElement>)\r\n .filter(el => el.tabIndex !== -1);\r\n return [list[0], list[list.length - 1]];\r\n}\r\n\r\n/**\r\n * Function that enforces browser focus to be trapped inside a DOM element.\r\n *\r\n * Works only for clicks inside the element and navigation with 'Tab', ignoring clicks outside of the element\r\n *\r\n * @param zone Angular zone\r\n * @param element The element around which focus will be trapped inside\r\n * @param stopFocusTrap$ The observable stream. When completed the focus trap will clean up listeners\r\n * and free internal resources\r\n * @param refocusOnClick Put the focus back to the last focused element whenever a click occurs on element (default to\r\n * false)\r\n */\r\nexport const ngbFocusTrap =\r\n (zone: NgZone, element: HTMLElement, stopFocusTrap$: Observable<any>, refocusOnClick = false) => {\r\n zone.runOutsideAngular(() => {\r\n // last focused element\r\n const lastFocusedElement$ =\r\n fromEvent<FocusEvent>(element, 'focusin').pipe(takeUntil(stopFocusTrap$), map(e => e.target));\r\n\r\n // 'tab' / 'shift+tab' stream\r\n fromEvent<KeyboardEvent>(element, 'keydown')\r\n .pipe(\r\n takeUntil(stopFocusTrap$),\r\n // tslint:disable:deprecation\r\n filter(e => e.which === Key.Tab),\r\n // tslint:enable:deprecation\r\n withLatestFrom(lastFocusedElement$))\r\n .subscribe(([tabEvent, focusedElement]) => {\r\n const[first, last] = getFocusableBoundaryElements(element);\r\n\r\n if ((focusedElement === first || focusedElement === element) && tabEvent.shiftKey) {\r\n last.focus();\r\n tabEvent.preventDefault();\r\n }\r\n\r\n if (focusedElement === last && !tabEvent.shiftKey) {\r\n first.focus();\r\n tabEvent.preventDefault();\r\n }\r\n });\r\n\r\n // inside click\r\n if (refocusOnClick) {\r\n fromEvent(element, 'click')\r\n .pipe(takeUntil(stopFocusTrap$), withLatestFrom(lastFocusedElement$), map(arr => arr[1] as HTMLElement))\r\n .subscribe(lastFocusedElement => lastFocusedElement.focus());\r\n }\r\n });\r\n };\r\n","// previous version:\r\n// https://github.com/angular-ui/bootstrap/blob/07c31d0731f7cb068a1932b8e01d2312b796b4ec/src/position/position.js\r\nexport class Positioning {\r\n private getAllStyles(element: HTMLElement) { return window.getComputedStyle(element); }\r\n\r\n private getStyle(element: HTMLElement, prop: string): string { return this.getAllStyles(element)[prop]; }\r\n\r\n private isStaticPositioned(element: HTMLElement): boolean {\r\n return (this.getStyle(element, 'position') || 'static') === 'static';\r\n }\r\n\r\n private offsetParent(element: HTMLElement): HTMLElement {\r\n let offsetParentEl = <HTMLElement>element.offsetParent || document.documentElement;\r\n\r\n while (offsetParentEl && offsetParentEl !== document.documentElement && this.isStaticPositioned(offsetParentEl)) {\r\n offsetParentEl = <HTMLElement>offsetParentEl.offsetParent;\r\n }\r\n\r\n return offsetParentEl || document.documentElement;\r\n }\r\n\r\n position(element: HTMLElement, round = true): ClientRect {\r\n let elPosition: ClientRect;\r\n let parentOffset: ClientRect = {width: 0, height: 0, top: 0, bottom: 0, left: 0, right: 0};\r\n\r\n if (this.getStyle(element, 'position') === 'fixed') {\r\n elPosition = element.getBoundingClientRect();\r\n elPosition = {\r\n top: elPosition.top,\r\n bottom: elPosition.bottom,\r\n left: elPosition.left,\r\n right: elPosition.right,\r\n height: elPosition.height,\r\n width: elPosition.width\r\n };\r\n } else {\r\n const offsetParentEl = this.offsetParent(element);\r\n\r\n elPosition = this.offset(element, false);\r\n\r\n if (offsetParentEl !== document.documentElement) {\r\n parentOffset = this.offset(offsetParentEl, false);\r\n }\r\n\r\n parentOffset.top += offsetParentEl.clientTop;\r\n parentOffset.left += offsetParentEl.clientLeft;\r\n }\r\n\r\n elPosition.top -= parentOffset.top;\r\n elPosition.bottom -= parentOffset.top;\r\n elPosition.left -= parentOffset.left;\r\n elPosition.right -= parentOffset.left;\r\n\r\n if (round) {\r\n elPosition.top = Math.round(elPosition.top);\r\n elPosition.bottom = Math.round(elPosition.bottom);\r\n elPosition.left = Math.round(elPosition.left);\r\n elPosition.right = Math.round(elPosition.right);\r\n }\r\n\r\n return elPosition;\r\n }\r\n\r\n offset(element: HTMLElement, round = true): ClientRect {\r\n const elBcr = element.getBoundingClientRect();\r\n const viewportOffset = {\r\n top: window.pageYOffset - document.documentElement.clientTop,\r\n left: window.pageXOffset - document.documentElement.clientLeft\r\n };\r\n\r\n let elOffset = {\r\n height: elBcr.height || element.offsetHeight,\r\n width: elBcr.width || element.offsetWidth,\r\n top: elBcr.top + viewportOffset.top,\r\n bottom: elBcr.bottom + viewportOffset.top,\r\n left: elBcr.left + viewportOffset.left,\r\n right: elBcr.right + viewportOffset.left\r\n };\r\n\r\n if (round) {\r\n elOffset.height = Math.round(elOffset.height);\r\n elOffset.width = Math.round(elOffset.width);\r\n elOffset.top = Math.round(elOffset.top);\r\n elOffset.bottom = Math.round(elOffset.bottom);\r\n elOffset.left = Math.round(elOffset.left);\r\n elOffset.right = Math.round(elOffset.right);\r\n }\r\n\r\n return elOffset;\r\n }\r\n\r\n /*\r\n Return false if the element to position is outside the viewport\r\n */\r\n positionElements(hostElement: HTMLElement, targetElement: HTMLElement, placement: string, appendToBody?: boolean):\r\n boolean {\r\n const[placementPrimary = 'top', placementSecondary = 'center'] = placement.split('-');\r\n\r\n const hostElPosition = appendToBody ? this.offset(hostElement, false) : this.position(hostElement, false);\r\n const targetElStyles = this.getAllStyles(targetElement);\r\n\r\n const marginTop = parseFloat(targetElStyles.marginTop);\r\n const marginBottom = parseFloat(targetElStyles.marginBottom);\r\n const marginLeft = parseFloat(targetElStyles.marginLeft);\r\n const marginRight = parseFloat(targetElStyles.marginRight);\r\n\r\n let topPosition = 0;\r\n let leftPosition = 0;\r\n\r\n switch (placementPrimary) {\r\n case 'top':\r\n topPosition = (hostElPosition.top - (targetElement.offsetHeight + marginTop + marginBottom));\r\n break;\r\n case 'bottom':\r\n topPosition = (hostElPosition.top + hostElPosition.height);\r\n break;\r\n case 'left':\r\n leftPosition = (hostElPosition.left - (targetElement.offsetWidth + marginLeft + marginRight));\r\n break;\r\n case 'right':\r\n leftPosition = (hostElPosition.left + hostElPosition.width);\r\n break;\r\n }\r\n\r\n switch (placementSecondary) {\r\n case 'top':\r\n topPosition = hostElPosition.top;\r\n break;\r\n case 'bottom':\r\n topPosition = hostElPosition.top + hostElPosition.height - targetElement.offsetHeight;\r\n break;\r\n case 'left':\r\n leftPosition = hostElPosition.left;\r\n break;\r\n case 'right':\r\n leftPosition = hostElPosition.left + hostElPosition.width - targetElement.offsetWidth;\r\n break;\r\n case 'center':\r\n if (placementPrimary === 'top' || placementPrimary === 'bottom') {\r\n leftPosition = (hostElPosition.left + hostElPosition.width / 2 - targetElement.offsetWidth / 2);\r\n } else {\r\n topPosition = (hostElPosition.top + hostElPosition.height / 2 - targetElement.offsetHeight / 2);\r\n }\r\n break;\r\n }\r\n\r\n /// The translate3d/gpu acceleration render a blurry text on chrome, the next line is commented until a browser fix\r\n // targetElement.style.transform = `translate3d(${Math.round(leftPosition)}px, ${Math.floor(topPosition)}px, 0px)`;\r\n targetElement.style.transform = `translate(${Math.round(leftPosition)}px, ${Math.round(topPosition)}px)`;\r\n\r\n // Check if the targetElement is inside the viewport\r\n const targetElBCR = targetElement.getBoundingClientRect();\r\n const html = document.documentElement;\r\n const windowHeight = window.innerHeight || html.clientHeight;\r\n const windowWidth = window.innerWidth || html.clientWidth;\r\n\r\n return targetElBCR.left >= 0 && targetElBCR.top >= 0 && targetElBCR.right <= windowWidth &&\r\n targetElBCR.bottom <= windowHeight;\r\n }\r\n}\r\n\r\nconst placementSeparator = /\\s+/;\r\nexport const positionService = new Positioning();\r\n\r\n/*\r\n * Accept the placement array and applies the appropriate placement dependent on the viewport.\r\n * Returns the applied placement.\r\n * In case of auto placement, placements are selected in order\r\n * 'top', 'bottom', 'left', 'right',\r\n * 'top-left', 'top-right',\r\n * 'bottom-left', 'bottom-right',\r\n * 'left-top', 'left-bottom',\r\n * 'right-top', 'right-bottom'.\r\n * */\r\nexport function positionElements(\r\n hostElement: HTMLElement, targetElement: HTMLElement, placement: string | Placement | PlacementArray,\r\n appendToBody?: boolean, baseClass?: string): Placement |\r\n null {\r\n let placementVals: Array<Placement> =\r\n Array.isArray(placement) ? placement : placement.split(placementSeparator) as Array<Placement>;\r\n\r\n const allowedPlacements = [\r\n 'top', 'bottom', 'left', 'right', 'top-left', 'top-right', 'bottom-left', 'bottom-right', 'left-top', 'left-bottom',\r\n 'right-top', 'right-bottom'\r\n ];\r\n\r\n const classList = targetElement.classList;\r\n const addClassesToTarget = (targetPlacement: Placement): Array<string> => {\r\n const[primary, secondary] = targetPlacement.split('-');\r\n const classes: string[] = [];\r\n if (baseClass) {\r\n classes.push(`${baseClass}-${primary}`);\r\n if (secondary) {\r\n classes.push(`${baseClass}-${primary}-${secondary}`);\r\n }\r\n\r\n classes.forEach((classname) => { classList.add(classname); });\r\n }\r\n return classes;\r\n };\r\n\r\n // Remove old placement classes to avoid issues\r\n if (baseClass) {\r\n allowedPlacements.forEach((placementToRemove) => { classList.remove(`${baseClass}-${placementToRemove}`); });\r\n }\r\n\r\n // replace auto placement with other placements\r\n let hasAuto = placementVals.findIndex(val => val === 'auto');\r\n if (hasAuto >= 0) {\r\n allowedPlacements.forEach(function(obj) {\r\n if (placementVals.find(val => val.search('^' + obj) !== -1) == null) {\r\n placementVals.splice(hasAuto++, 1, obj as Placement);\r\n }\r\n });\r\n }\r\n\r\n // coordinates where to position\r\n\r\n // Required for transform:\r\n const style = targetElement.style;\r\n style.position = 'absolute';\r\n style.top = '0';\r\n style.left = '0';\r\n style['will-change'] = 'transform';\r\n\r\n let testPlacement: Placement | null = null;\r\n let isInViewport = false;\r\n for (testPlacement of placementVals) {\r\n let addedClasses = addClassesToTarget(testPlacement);\r\n\r\n if (positionService.positionElements(hostElement, targetElement, testPlacement, appendToBody)) {\r\n isInViewport = true;\r\n break;\r\n }\r\n\r\n // Remove the baseClasses for further calculation\r\n if (baseClass) {\r\n addedClasses.forEach((classname) => { classList.remove(classname); });\r\n }\r\n }\r\n\r\n if (!isInViewport) {\r\n // If nothing match, the first placement is the default one\r\n testPlacement = placementVals[0];\r\n addClassesToTarget(testPlacement);\r\n positionService.positionElements(hostElement, targetElement, testPlacement, appendToBody);\r\n }\r\n\r\n return testPlacement;\r\n}\r\n\r\nexport type Placement = 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' |\r\n 'bottom-right' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom';\r\n\r\nexport type PlacementArray = Placement | Array<Placement>| string;\r\n","import {padNumber, toInteger, isNumber} from '../util/util';\r\nimport {NgbDateStruct} from './ngb-date-struct';\r\nimport {Injectable} from '@angular/core';\r\n\r\nexport function NGB_DATEPICKER_PARSER_FORMATTER_FACTORY() {\r\n return new NgbDateISOParserFormatter();\r\n}\r\n\r\n/**\r\n * An abstract service for parsing and formatting dates for the\r\n * [`NgbInputDatepicker`](#/components/datepicker/api#NgbInputDatepicker) directive.\r\n * Converts between the internal `NgbDateStruct` model presentation and a `string` that is displayed in the\r\n * input element.\r\n *\r\n * When user types something in the input this service attempts to parse it into a `NgbDateStruct` object.\r\n * And vice versa, when users selects a date in the calendar with the mouse, it must be displayed as a `string`\r\n * in the input.\r\n *\r\n * Default implementation uses the ISO 8601 format, but you can provide another implementation via DI\r\n * to use an alternative string format or a custom parsing logic.\r\n *\r\n * See the [date format overview](#/components/datepicker/overview#date-model) for more details.\r\n */\r\n@Injectable({providedIn: 'root', useFactory: NGB_DATEPICKER_PARSER_FORMATTER_FACTORY})\r\nexport abstract class NgbDateParserFormatter {\r\n /**\r\n * Parses the given `string` to an `NgbDateStruct`.\r\n *\r\n * Implementations should try their best to provide a result, even\r\n * partial. They must return `null` if the value can't be parsed.\r\n */\r\n abstract parse(value: string): NgbDateStruct | null;\r\n\r\n /**\r\n * Formats the given `NgbDateStruct` to a `string`.\r\n *\r\n * Implementations should return an empty string if the given date is `null`,\r\n * and try their best to provide a partial result if the given date is incomplete or invalid.\r\n */\r\n abstract format(date: NgbDateStruct | null): string;\r\n}\r\n\r\n@Injectable()\r\nexport class NgbDateISOParserFormatter extends NgbDateParserFormatter {\r\n parse(value: string): NgbDateStruct | null {\r\n if (value != null) {\r\n const dateParts = value.trim().split('-');\r\n if (dateParts.length === 1 && isNumber(dateParts[0])) {\r\n return {year: toInteger(dateParts[0]), month: <any>null, day: <any>null};\r\n } else if (dateParts.length === 2 && isNumber(dateParts[0]) && isNumber(dateParts[1])) {\r\n return {year: toInteger(dateParts[0]), month: toInteger(dateParts[1]), day: <any>null};\r\n } else if (dateParts.length === 3 && isNumber(dateParts[0]) && isNumber(dateParts[1]) && isNumber(dateParts[2])) {\r\n return {year: toInteger(dateParts[0]), month: toInteger(dateParts[1]), day: toInteger(dateParts[2])};\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n format(date: NgbDateStruct | null): string {\r\n return date ?\r\n `${date.year}-${isNumber(date.month) ? padNumber(date.month) : ''}-${isNumber(date.day) ? padNumber(date.day) : ''}` :\r\n '';\r\n }\r\n}\r\n","import {Injectable} from '@angular/core';\r\n\r\nimport {NgbDatepickerConfig} from './datepicker-config';\r\nimport {PlacementArray} from '../util/positioning';\r\n\r\n/**\r\n * A configuration service for the [`NgbDatepickerInput`](#/components/datepicker/api#NgbDatepicker) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the datepicker inputs used in the application.\r\n *\r\n * @since 5.2.0\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbInputDatepickerConfig extends NgbDatepickerConfig {\r\n autoClose: boolean | 'inside' | 'outside' = true;\r\n container: null | 'body';\r\n positionTarget: string | HTMLElement;\r\n placement: PlacementArray = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];\r\n restoreFocus: true | HTMLElement | string = true;\r\n}\r\n","import {\r\n ChangeDetectorRef,\r\n ComponentFactoryResolver,\r\n ComponentRef,\r\n Directive,\r\n ElementRef,\r\n EventEmitter,\r\n forwardRef,\r\n Inject,\r\n Input,\r\n NgZone,\r\n OnChanges,\r\n OnDestroy,\r\n Output,\r\n Renderer2,\r\n SimpleChanges,\r\n TemplateRef,\r\n ViewContainerRef\r\n} from '@angular/core';\r\nimport {DOCUMENT, TranslationWidth} from '@angular/common';\r\nimport {\r\n AbstractControl,\r\n ControlValueAccessor,\r\n NG_VALIDATORS,\r\n NG_VALUE_ACCESSOR,\r\n ValidationErrors,\r\n Validator\r\n} from '@angular/forms';\r\n\r\nimport {ngbAutoClose} from '../util/autoclose';\r\nimport {ngbFocusTrap} from '../util/focus-trap';\r\nimport {PlacementArray, positionElements} from '../util/positioning';\r\n\r\nimport {NgbDateAdapter} from './adapters/ngb-date-adapter';\r\nimport {NgbDatepicker, NgbDatepickerNavigateEvent} from './datepicker';\r\nimport {DayTemplateContext} from './datepicker-day-template-context';\r\nimport {NgbCalendar} from './ngb-calendar';\r\nimport {NgbDate} from './ngb-date';\r\nimport {NgbDateParserFormatter} from './ngb-date-parser-formatter';\r\nimport {NgbDateStruct} from './ngb-date-struct';\r\nimport {NgbInputDatepickerConfig} from './datepicker-input-config';\r\nimport {NgbDatepickerConfig} from './datepicker-config';\r\nimport {isString} from '../util/util';\r\n\r\n/**\r\n * A directive that allows to stick a datepicker popup to an input field.\r\n *\r\n * Manages interaction with the input field itself, does value formatting and provides forms integration.\r\n */\r\n@Directive({\r\n selector: 'input[ngbDatepicker]',\r\n exportAs: 'ngbDatepicker',\r\n host: {\r\n '(input)': 'manualDateChange($event.target.value)',\r\n '(change)': 'manualDateChange($event.target.value, true)',\r\n '(focus)': 'onFocus()',\r\n '(blur)': 'onBlur()',\r\n '[disabled]': 'disabled'\r\n },\r\n providers: [\r\n {provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgbInputDatepicker), multi: true},\r\n {provide: NG_VALIDATORS, useExisting: forwardRef(() => NgbInputDatepicker), multi: true},\r\n {provide: NgbDatepickerConfig, useExisting: NgbInputDatepickerConfig}\r\n ],\r\n})\r\nexport class NgbInputDatepicker implements OnChanges,\r\n OnDestroy, ControlValueAccessor, Validator {\r\n static ngAcceptInputType_autoClose: boolean | string;\r\n static ngAcceptInputType_disabled: boolean | '';\r\n static ngAcceptInputType_navigation: string;\r\n static ngAcceptInputType_outsideDays: string;\r\n static ngAcceptInputType_weekdays: boolean | number;\r\n\r\n private _cRef: ComponentRef<NgbDatepicker>| null = null;\r\n private _disabled = false;\r\n private _elWithFocus: HTMLElement | null = null;\r\n private _model: NgbDate | null = null;\r\n private _inputValue: string;\r\n private _showWeekdays: boolean;\r\n private _zoneSubscription: any;\r\n\r\n /**\r\n * Indicates whether the datepicker popup should be closed automatically after date selection / outside click or not.\r\n *\r\n * * `true` - the popup will close on both date selection and outside click.\r\n * * `false` - the popup can only be closed manually via `close()` or `toggle()` methods.\r\n * * `\"inside\"` - the popup will close on date selection, but not outside clicks.\r\n * * `\"outside\"` - the popup will close only on the outside click and not on date selection/inside clicks.\r\n *\r\n * @since 3.0.0\r\n */\r\n @Input() autoClose: boolean | 'inside' | 'outside';\r\n\r\n /**\r\n * An optional class applied to the datepicker popup element.\r\n *\r\n * @since 9.1.0\r\n */\r\n @Input() datepickerClass: string;\r\n\r\n /**\r\n * The reference to a custom template for the day.\r\n *\r\n * Allows to completely override the way a day 'cell' in the calendar is displayed.\r\n *\r\n * See [`DayTemplateContext`](#/components/datepicker/api#DayTemplateContext) for the data you get inside.\r\n */\r\n @Input() dayTemplate: TemplateRef<DayTemplateContext>;\r\n\r\n /**\r\n * The callback to pass any arbitrary data to the template cell via the\r\n * [`DayTemplateContext`](#/components/datepicker/api#DayTemplateContext)'s `data` parameter.\r\n *\r\n * `current` is the month that is currently displayed by the datepicker.\r\n *\r\n * @since 3.3.0\r\n */\r\n @Input() dayTemplateData: (date: NgbDate, current?: {year: number, month: number}) => any;\r\n\r\n /**\r\n * The number of months to display.\r\n */\r\n @Input() displayMonths: number;\r\n\r\n /**\r\n * The first day of the week.\r\n *\r\n * With default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun.\r\n */\r\n @Input() firstDayOfWeek: number;\r\n\r\n /**\r\n * The reference to the custom template for the datepicker footer.\r\n *\r\n * @since 3.3.0\r\n */\r\n @Input() footerTemplate: TemplateRef<any>;\r\n\r\n /**\r\n * The callback to mark some dates as disabled.\r\n *\r\n * It is called for each new date when navigating to a different month.\r\n *\r\n * `current` is the month that is currently displayed by the datepicker.\r\n */\r\n @Input() markDisabled: (date: NgbDate, current?: {year: number, month: number}) => boolean;\r\n\r\n /**\r\n * The earliest date that can be displayed or selected. Also used for form validation.\r\n *\r\n * If not provided, 'year' select box will display 10 years before the current month.\r\n */\r\n @Input() minDate: NgbDateStruct;\r\n\r\n /**\r\n * The latest date that can be displayed or selected. Also used for form validation.\r\n *\r\n * If not provided, 'year' select box will display 10 years after the current month.\r\n */\r\n @Input() maxDate: NgbDateStruct;\r\n\r\n /**\r\n * Navigation type.\r\n *\r\n * * `\"select\"` - select boxes for month and navigation arrows\r\n * * `\"arrows\"` - only navigation arrows\r\n * * `\"none\"` - no navigation visible at all\r\n */\r\n @Input() navigation: 'select' | 'arrows' | 'none';\r\n\r\n /**\r\n * The way of displaying days that don't belong to the current month.\r\n *\r\n * * `\"visible\"` - days are visible\r\n * * `\"hidden\"` - days are hidden, white space preserved\r\n * * `\"collapsed\"` - days are collapsed, so the datepicker height might change between months\r\n *\r\n * For the 2+ months view, days in between months are never shown.\r\n */\r\n @Input() outsideDays: 'visible' | 'collapsed' | 'hidden';\r\n\r\n /**\r\n * The preferred placement of the datepicker popup.\r\n *\r\n * Possible values are `\"top\"`, `\"top-left\"`, `\"top-right\"`, `\"bottom\"`, `\"bottom-left\"`,\r\n * `\"bottom-right\"`, `\"left\"`, `\"left-top\"`, `\"left-bottom\"`, `\"right\"`, `\"right-top\"`,\r\n * `\"right-bottom\"`\r\n *\r\n * Accepts an array of strings or a string with space separated possible values.\r\n *\r\n * The default order of preference is `\"bottom-left bottom-right top-left top-right\"`\r\n *\r\n * Please see the [positioning overview](#/positioning) for more details.\r\n */\r\n @Input() placement: PlacementArray;\r\n\r\n /**\r\n * If `true`, when closing datepicker will focus element that was focused before datepicker was opened.\r\n *\r\n * Alternatively you could provide a selector or an `HTMLElement` to focus. If the element doesn't exist or invalid,\r\n * we'll fallback to focus document body.\r\n *\r\n * @since 5.2.0\r\n */\r\n @Input() restoreFocus: true | string | HTMLElement;\r\n\r\n /**\r\n * If `true`, weekdays will be displayed.\r\n *\r\n * @deprecated 9.1.0, please use 'weekdays' instead\r\n */\r\n @Input()\r\n set showWeekdays(weekdays: boolean) {\r\n this.weekdays = weekdays;\r\n this._showWeekdays = weekdays;\r\n }\r\n\r\n get showWeekdays(): boolean { return this._showWeekdays; }\r\n\r\n /**\r\n * If `true`, week numbers will be displayed.\r\n */\r\n @Input() showWeekNumbers: boolean;\r\n\r\n /**\r\n * The date to open calendar with.\r\n *\r\n * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\r\n * If nothing or invalid date is provided, calendar will open with current month.\r\n *\r\n * You could use `navigateTo(date)` method as an alternative.\r\n */\r\n @Input() startDate: {year: number, month: number, day?: number};\r\n\r\n /**\r\n * A selector specifying the element the datepicker popup should be appended to.\r\n *\r\n * Currently only supports `\"body\"`.\r\n */\r\n @Input() container: string;\r\n\r\n /**\r\n * A css selector or html element specifying the element the datepicker popup should be positioned against.\r\n *\r\n * By default the input is used as a target.\r\n *\r\n * @since 4.2.0\r\n */\r\n @Input() positionTarget: string | HTMLElement;\r\n\r\n /**\r\n * The way weekdays should be displayed.\r\n *\r\n * * `true` - weekdays are displayed using default width\r\n * * `false` - weekdays are not displayed\r\n * * `TranslationWidth` - weekdays are displayed using specified width\r\n *\r\n * @since 9.1.0\r\n */\r\n @Input() weekdays: TranslationWidth | boolean;\r\n\r\n /**\r\n * An event emitted when user selects a date using keyboard or mouse.\r\n *\r\n * The payload of the event is currently selected `NgbDate`.\r\n *\r\n * @since 1.1.1\r\n */\r\n @Output() dateSelect = new EventEmitter<NgbDate>();\r\n\r\n /**\r\n * Event emitted right after the navigation happens and displayed month changes.\r\n *\r\n * See [`NgbDatepickerNavigateEvent`](#/components/datepicker/api#NgbDatepickerNavigateEvent) for the payload info.\r\n */\r\n @Output() navigate = new EventEmitter<NgbDatepickerNavigateEvent>();\r\n\r\n /**\r\n * An event fired after closing datepicker window.\r\n *\r\n * @since 4.2.0\r\n */\r\n @Output() closed = new EventEmitter<void>();\r\n\r\n @Input()\r\n get disabled() {\r\n return this._disabled;\r\n }\r\n set disabled(value: any) {\r\n this._disabled = value === '' || (value && value !== 'false');\r\n\r\n if (this.isOpen()) {\r\n this._cRef !.instance.setDisabledState(this._disabled);\r\n }\r\n }\r\n\r\n private _onChange = (_: any) => {};\r\n private _onTouched = () => {};\r\n private _validatorChange = () => {};\r\n\r\n\r\n constructor(\r\n private _parserFormatter: NgbDateParserFormatter, private _elRef: ElementRef<HTMLInputElement>,\r\n private _vcRef: ViewContainerRef, private _renderer: Renderer2, private _cfr: ComponentFactoryResolver,\r\n private _ngZone: NgZone, private _calendar: NgbCalendar, private _dateAdapter: NgbDateAdapter<any>,\r\n @Inject(DOCUMENT) private _document: any, private _changeDetector: ChangeDetectorRef,\r\n config: NgbInputDatepickerConfig) {\r\n ['autoClose', 'container', 'positionTarget', 'placement'].forEach(input => this[input] = config[input]);\r\n this._zoneSubscription = _ngZone.onStable.subscribe(() => this._updatePopupPosition());\r\n }\r\n\r\n registerOnChange(fn: (value: any) => any): void { this._onChange = fn; }\r\n\r\n registerOnTouched(fn: () => any): void { this._onTouched = fn; }\r\n\r\n registerOnValidatorChange(fn: () => void): void { this._validatorChange = fn; }\r\n\r\n setDisabledState(isDisabled: boolean): void { this.disabled = isDisabled; }\r\n\r\n validate(c: AbstractControl): ValidationErrors | null {\r\n const {value} = c;\r\n\r\n if (value != null) {\r\n const ngbDate = this._fromDateStruct(this._dateAdapter.fromModel(value));\r\n\r\n if (!ngbDate) {\r\n return {'ngbDate': {invalid: value}};\r\n }\r\n\r\n if (this.minDate && ngbDate.before(NgbDate.from(this.minDate))) {\r\n return {'ngbDate': {minDate: {minDate: this.minDate, actual: value}}};\r\n }\r\n\r\n if (this.maxDate && ngbDate.after(NgbDate.from(this.maxDate))) {\r\n return {'ngbDate': {maxDate: {maxDate: this.maxDate, actual: value}}};\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n writeValue(value) {\r\n this._model = this._fromDateStruct(this._dateAdapter.fromModel(value));\r\n this._writeModelValue(this._model);\r\n }\r\n\r\n manualDateChange(value: string, updateView = false) {\r\n const inputValueChanged = value !== this._inputValue;\r\n if (inputValueChanged) {\r\n this._inputValue = value;\r\n this._model = this._fromDateStruct(this._parserFormatter.parse(value));\r\n }\r\n if (inputValueChanged || !updateView) {\r\n this._onChange(this._model ? this._dateAdapter.toModel(this._model) : (value === '' ? null : value));\r\n }\r\n if (updateView && this._model) {\r\n this._writeModelValue(this._model);\r\n }\r\n }\r\n\r\n isOpen() { return !!this._cRef; }\r\n\r\n /**\r\n * Opens the datepicker popup.\r\n *\r\n * If the related form control contains a valid date, the corresponding month will be opened.\r\n */\r\n open() {\r\n if (!this.isOpen()) {\r\n const cf = this._cfr.resolveComponentFactory(NgbDatepicker);\r\n this._cRef = this._vcRef.createComponent(cf);\r\n\r\n this._applyPopupStyling(this._cRef.location.nativeElement);\r\n this._applyDatepickerInputs(this._cRef.instance);\r\n this._subscribeForDatepickerOutputs(this._cRef.instance);\r\n this._cRef.instance.ngOnInit();\r\n this._cRef.instance.writeValue(this._dateAdapter.toModel(this._model));\r\n\r\n // date selection event handling\r\n this._cRef.instance.registerOnChange((selectedDate) => {\r\n this.writeValue(selectedDate);\r\n this._onChange(selectedDate);\r\n this._onTouched();\r\n });\r\n\r\n this._cRef.changeDetectorRef.detectChanges();\r\n\r\n this._cRef.instance.setDisabledState(this.disabled);\r\n\r\n if (this.container === 'body') {\r\n this._document.querySelector(this.container).appendChild(this._cRef.location.nativeElement);\r\n }\r\n\r\n // focus handling\r\n this._elWithFocus = this._document.activeElement;\r\n ngbFocusTrap(this._ngZone, this._cRef.location.nativeElement, this.closed, true);\r\n this._cRef.instance.focus();\r\n\r\n ngbAutoClose(\r\n this._ngZone, this._document, this.autoClose, () => this.close(), this.closed, [],\r\n [this._elRef.nativeElement, this._cRef.location.nativeElement]);\r\n }\r\n }\r\n\r\n /**\r\n * Closes the datepicker popup.\r\n */\r\n close() {\r\n if (this.isOpen()) {\r\n this._vcRef.remove(this._vcRef.indexOf(this._cRef !.hostView));\r\n this._cRef = null;\r\n this.closed.emit();\r\n this._changeDetector.markForCheck();\r\n\r\n // restore focus\r\n let elementToFocus: HTMLElement | null = this._elWithFocus;\r\n if (isString(this.restoreFocus)) {\r\n elementToFocus = this._document.querySelector(this.restoreFocus);\r\n } else if (this.restoreFocus !== undefined) {\r\n elementToFocus = this.restoreFocus as HTMLElement;\r\n }\r\n\r\n // in IE document.activeElement can contain an object without 'focus()' sometimes\r\n if (elementToFocus && elementToFocus['focus']) {\r\n elementToFocus.focus();\r\n } else {\r\n this._document.body.focus();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Toggles the datepicker popup.\r\n */\r\n toggle() {\r\n if (this.isOpen()) {\r\n this.close();\r\n } else {\r\n this.open();\r\n }\r\n }\r\n\r\n /**\r\n * Navigates to the provided date.\r\n *\r\n * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\r\n * If nothing or invalid date provided calendar will open current month.\r\n *\r\n * Use the `[startDate]` input as an alternative.\r\n */\r\n navigateTo(date?: {year: number, month: number, day?: number}) {\r\n if (this.isOpen()) {\r\n this._cRef !.instance.navigateTo(date);\r\n }\r\n }\r\n\r\n onBlur() { this._onTouched(); }\r\n\r\n onFocus() { this._elWithFocus = this._elRef.nativeElement; }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['minDate'] || changes['maxDate']) {\r\n this._validatorChange();\r\n\r\n if (this.isOpen()) {\r\n if (changes['minDate']) {\r\n this._cRef !.instance.minDate = this.minDate;\r\n }\r\n if (changes['maxDate']) {\r\n this._cRef !.instance.maxDate = this.maxDate;\r\n }\r\n this._cRef !.instance.ngOnChanges(changes);\r\n }\r\n }\r\n\r\n if (changes['datepickerClass']) {\r\n const {currentValue, previousValue} = changes['datepickerClass'];\r\n this._applyPopupClass(currentValue, previousValue);\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.close();\r\n this._zoneSubscription.unsubscribe();\r\n }\r\n\r\n private _applyDatepickerInputs(datepickerInstance: NgbDatepicker): void {\r\n ['dayTemplate', 'dayTemplateData', 'displayMonths', 'firstDayOfWeek', 'footerTemplate', 'markDisabled', 'minDate',\r\n 'maxDate', 'navigation', 'outsideDays', 'showNavigation', 'showWeekNumbers', 'weekdays']\r\n .forEach((optionName: string) => {\r\n if (this[optionName] !== undefined) {\r\n datepickerInstance[optionName] = this[optionName];\r\n }\r\n });\r\n datepickerInstance.startDate = this.startDate || this._model;\r\n }\r\n\r\n private _applyPopupClass(newClass: string, oldClass?: string) {\r\n const popupEl = this._cRef ?.location.nativeElement;\r\n if (popupEl) {\r\n if (newClass) {\r\n this._renderer.addClass(popupEl, newClass);\r\n }\r\n if (oldClass) {\r\n this._renderer.removeClass(popupEl, oldClass);\r\n }\r\n }\r\n }\r\n\r\n private _applyPopupStyling(nativeElement: any) {\r\n this._renderer.addClass(nativeElement, 'dropdown-menu');\r\n this._renderer.addClass(nativeElement, 'show');\r\n\r\n if (this.container === 'body') {\r\n this._renderer.addClass(nativeElement, 'ngb-dp-body');\r\n }\r\n\r\n this._applyPopupClass(this.datepickerClass);\r\n }\r\n\r\n private _subscribeForDatepickerOutputs(datepickerInstance: NgbDatepicker) {\r\n datepickerInstance.navigate.subscribe(navigateEvent => this.navigate.emit(navigateEvent));\r\n datepickerInstance.dateSelect.subscribe(date => {\r\n this.dateSelect.emit(date);\r\n if (this.autoClose === true || this.autoClose === 'inside') {\r\n this.close();\r\n }\r\n });\r\n }\r\n\r\n private _writeModelValue(model: NgbDate | null) {\r\n const value = this._parserFormatter.format(model);\r\n this._inputValue = value;\r\n this._renderer.setProperty(this._elRef.nativeElement, 'value', value);\r\n if (this.isOpen()) {\r\n this._cRef !.instance.writeValue(this._dateAdapter.toModel(model));\r\n this._onTouched();\r\n }\r\n }\r\n\r\n private _fromDateStruct(date: NgbDateStruct | null): NgbDate | null {\r\n const ngbDate = date ? new NgbDate(date.year, date.month, date.day) : null;\r\n return this._calendar.isValid(ngbDate) ? ngbDate : null;\r\n }\r\n\r\n private _updatePopupPosition() {\r\n if (!this._cRef) {\r\n return;\r\n }\r\n\r\n let hostElement: HTMLElement;\r\n if (isString(this.positionTarget)) {\r\n hostElement = this._document.querySelector(this.positionTarget);\r\n } else if (this.positionTarget instanceof HTMLElement) {\r\n hostElement = this.positionTarget;\r\n } else {\r\n hostElement = this._elRef.nativeElement;\r\n }\r\n\r\n if (this.positionTarget && !hostElement) {\r\n throw new Error('ngbDatepicker could not find element declared in [positionTarget] to position against.');\r\n }\r\n\r\n positionElements(hostElement, this._cRef.location.nativeElement, this.placement, this.container === 'body');\r\n }\r\n}\r\n","import {ChangeDetectionStrategy, Component, Input, ViewEncapsulation} from '@angular/core';\r\nimport {NgbDate} from './ngb-date';\r\nimport {NgbDatepickerI18n} from './datepicker-i18n';\r\n\r\n@Component({\r\n selector: '[ngbDatepickerDayView]',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n styleUrls: ['./datepicker-day-view.scss'],\r\n host: {\r\n 'class': 'btn-light',\r\n '[class.bg-primary]': 'selected',\r\n '[class.text-white]': 'selected',\r\n '[class.text-muted]': 'isMuted()',\r\n '[class.outside]': 'isMuted()',\r\n '[class.active]': 'focused'\r\n },\r\n template: `{{ i18n.getDayNumerals(date) }}`\r\n})\r\nexport class NgbDatepickerDayView {\r\n @Input() currentMonth: number;\r\n @Input() date: NgbDate;\r\n @Input() disabled: boolean;\r\n @Input() focused: boolean;\r\n @Input() selected: boolean;\r\n\r\n constructor(public i18n: NgbDatepickerI18n) {}\r\n\r\n isMuted() { return !this.selected && (this.date.month !== this.currentMonth || this.disabled); }\r\n}\r\n","import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n ChangeDetectionStrategy,\r\n ViewEncapsulation,\r\n AfterViewChecked,\r\n ViewChild,\r\n ElementRef,\r\n Renderer2\r\n} from '@angular/core';\r\nimport {NgbDate} from './ngb-date';\r\nimport {toInteger} from '../util/util';\r\nimport {NgbDatepickerI18n} from './datepicker-i18n';\r\n\r\n@Component({\r\n selector: 'ngb-datepicker-navigation-select',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n styleUrls: ['./datepicker-navigation-select.scss'],\r\n template: `\r\n <select #month\r\n [disabled]=\"disabled\"\r\n class=\"custom-select\"\r\n i18n-aria-label=\"@@ngb.datepicker.select-month\" aria-label=\"Select month\"\r\n i18n-title=\"@@ngb.datepicker.select-month\" title=\"Select month\"\r\n (change)=\"changeMonth($any($event).target.value)\">\r\n <option *ngFor=\"let m of months\" [attr.aria-label]=\"i18n.getMonthFullName(m, date?.year)\"\r\n [value]=\"m\">{{ i18n.getMonthShortName(m, date?.year) }}</option>\r\n </select><select #year\r\n [disabled]=\"disabled\"\r\n class=\"custom-select\"\r\n i18n-aria-label=\"@@ngb.datepicker.select-year\" aria-label=\"Select year\"\r\n i18n-title=\"@@ngb.datepicker.select-year\" title=\"Select year\"\r\n (change)=\"changeYear($any($event).target.value)\">\r\n <option *ngFor=\"let y of years\" [value]=\"y\">{{ i18n.getYearNumerals(y) }}</option>\r\n </select>\r\n `\r\n})\r\nexport class NgbDatepickerNavigationSelect implements AfterViewChecked {\r\n @Input() date: NgbDate;\r\n @Input() disabled: boolean;\r\n @Input() months: number[];\r\n @Input() years: number[];\r\n\r\n @Output() select = new EventEmitter<NgbDate>();\r\n\r\n @ViewChild('month', {static: true, read: ElementRef}) monthSelect: ElementRef;\r\n @ViewChild('year', {static: true, read: ElementRef}) yearSelect: ElementRef;\r\n\r\n private _month = -1;\r\n private _year = -1;\r\n\r\n constructor(public i18n: NgbDatepickerI18n, private _renderer: Renderer2) {}\r\n\r\n changeMonth(month: string) { this.select.emit(new NgbDate(this.date.year, toInteger(month), 1)); }\r\n\r\n changeYear(year: string) { this.select.emit(new NgbDate(toInteger(year), this.date.month, 1)); }\r\n\r\n ngAfterViewChecked() {\r\n if (this.date) {\r\n if (this.date.month !== this._month) {\r\n this._month = this.date.month;\r\n this._renderer.setProperty(this.monthSelect.nativeElement, 'value', this._month);\r\n }\r\n if (this.date.year !== this._year) {\r\n this._year = this.date.year;\r\n this._renderer.setProperty(this.yearSelect.nativeElement, 'value', this._year);\r\n }\r\n }\r\n }\r\n}\r\n","import {NgbDate} from '../ngb-date';\r\nimport {NgbPeriod, NgbCalendar} from '../ngb-calendar';\r\nimport {Injectable} from '@angular/core';\r\nimport {isNumber} from '../../util/util';\r\n\r\n@Injectable()\r\nexport abstract class NgbCalendarHijri extends NgbCalendar {\r\n /**\r\n * Returns the number of days in a specific Hijri month.\r\n * `month` is 1 for Muharram, 2 for Safar, etc.\r\n * `year` is any Hijri year.\r\n */\r\n abstract getDaysPerMonth(month: number, year: number): number;\r\n\r\n /**\r\n * Returns the equivalent Hijri date value for a give input Gregorian date.\r\n * `gDate` is s JS Date to be converted to Hijri.\r\n */\r\n abstract fromGregorian(gDate: Date): NgbDate;\r\n\r\n /**\r\n * Converts the current Hijri date to Gregorian.\r\n */\r\n abstract toGregorian(hDate: NgbDate): Date;\r\n\r\n getDaysPerWeek() { return 7; }\r\n\r\n getMonths() { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; }\r\n\r\n getWeeksPerMonth() { return 6; }\r\n\r\n getNext(date: NgbDate, period: NgbPeriod = 'd', number = 1) {\r\n date = new NgbDate(date.year, date.month, date.day);\r\n\r\n switch (period) {\r\n case 'y':\r\n date = this._setYear(date, date.year + number);\r\n date.month = 1;\r\n date.day = 1;\r\n return date;\r\n case 'm':\r\n date = this._setMonth(date, date.month + number);\r\n date.day = 1;\r\n return date;\r\n case 'd':\r\n return this._setDay(date, date.day + number);\r\n default:\r\n return date;\r\n }\r\n }\r\n\r\n getPrev(date: NgbDate, period: NgbPeriod = 'd', number = 1) { return this.getNext(date, period, -number); }\r\n\r\n getWeekday(date: NgbDate) {\r\n const day = this.toGregorian(date).getDay();\r\n // in JS Date Sun=0, in ISO 8601 Sun=7\r\n return day === 0 ? 7 : day;\r\n }\r\n\r\n getWeekNumber(week: readonly NgbDate[], firstDayOfWeek: number) {\r\n // in JS Date Sun=0, in ISO 8601 Sun=7\r\n if (firstDayOfWeek === 7) {\r\n firstDayOfWeek = 0;\r\n }\r\n\r\n const thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;\r\n const date = week[thursdayIndex];\r\n\r\n const jsDate = this.toGregorian(date);\r\n jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday\r\n const time = jsDate.getTime();\r\n const MuhDate = this.toGregorian(new NgbDate(date.year, 1, 1)); // Compare with Muharram 1\r\n return Math.floor(Math.round((time - MuhDate.getTime()) / 86400000) / 7) + 1;\r\n }\r\n\r\n getToday(): NgbDate { return this.fromGregorian(new Date()); }\r\n\r\n\r\n isValid(date?: NgbDate | null): boolean {\r\n return date != null && isNumber(date.year) && isNumber(date.month) && isNumber(date.day) &&\r\n !isNaN(this.toGregorian(date).getTime());\r\n }\r\n\r\n private _setDay(date: NgbDate, day: number): NgbDate {\r\n day = +day;\r\n let mDays = this.getDaysPerMonth(date.month, date.year);\r\n if (day <= 0) {\r\n while (day <= 0) {\r\n date = this._setMonth(date, date.month - 1);\r\n mDays = this.getDaysPerMonth(date.month, date.year);\r\n day += mDays;\r\n }\r\n } else if (day > mDays) {\r\n while (day > mDays) {\r\n day -= mDays;\r\n date = this._setMonth(date, date.month + 1);\r\n mDays = this.getDaysPerMonth(date.month, date.year);\r\n }\r\n }\r\n date.day = day;\r\n return date;\r\n }\r\n\r\n private _setMonth(date: NgbDate, month: number): NgbDate {\r\n month = +month;\r\n date.year = date.year + Math.floor((month - 1) / 12);\r\n date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;\r\n return date;\r\n }\r\n\r\n private _setYear(date: NgbDate, year: number): NgbDate {\r\n date.year = +year;\r\n return date;\r\n }\r\n}\r\n","import {NgbCalendarHijri} from './ngb-calendar-hijri';\r\nimport {NgbDate} from '../ngb-date';\r\nimport {Injectable} from '@angular/core';\r\n\r\n/**\r\n * Checks if islamic year is a leap year\r\n */\r\nfunction isIslamicLeapYear(hYear: number): boolean {\r\n return (14 + 11 * hYear) % 30 < 11;\r\n}\r\n\r\n/**\r\n * Checks if gregorian years is a leap year\r\n */\r\nfunction isGregorianLeapYear(gDate: Date): boolean {\r\n const year = gDate.getFullYear();\r\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\r\n}\r\n\r\n/**\r\n * Returns the start of Hijri Month.\r\n * `hMonth` is 0 for Muharram, 1 for Safar, etc.\r\n * `hYear` is any Hijri hYear.\r\n */\r\nfunction getIslamicMonthStart(hYear: number, hMonth: number): number {\r\n return Math.ceil(29.5 * hMonth) + (hYear - 1) * 354 + Math.floor((3 + 11 * hYear) / 30.0);\r\n}\r\n\r\n/**\r\n * Returns the start of Hijri year.\r\n * `year` is any Hijri year.\r\n */\r\nfunction getIslamicYearStart(year: number): number {\r\n return (year - 1) * 354 + Math.floor((3 + 11 * year) / 30.0);\r\n}\r\n\r\nfunction mod(a: number, b: number): number {\r\n return a - b * Math.floor(a / b);\r\n}\r\n\r\n/**\r\n * The civil calendar is one type of Hijri calendars used in islamic countries.\r\n * Uses a fixed cycle of alternating 29- and 30-day months,\r\n * with a leap day added to the last month of 11 out of every 30 years.\r\n * http://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types\r\n * All the calculations here are based on the equations from \"Calendrical Calculations\" By Edward M. Reingold, Nachum\r\n * Dershowitz.\r\n */\r\n\r\nconst GREGORIAN_EPOCH = 1721425.5;\r\nconst ISLAMIC_EPOCH = 1948439.5;\r\n\r\n@Injectable()\r\nexport class NgbCalendarIslamicCivil extends NgbCalendarHijri {\r\n /**\r\n * Returns the equivalent islamic(civil) date value for a give input Gregorian date.\r\n * `gDate` is a JS Date to be converted to Hijri.\r\n */\r\n fromGregorian(gDate: Date): NgbDate {\r\n const gYear = gDate.getFullYear(), gMonth = gDate.getMonth(), gDay = gDate.getDate();\r\n\r\n let julianDay = GREGORIAN_EPOCH - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) +\r\n -Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +\r\n Math.floor(\r\n (367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear(gDate) ? -1 : -2) + gDay);\r\n julianDay = Math.floor(julianDay) + 0.5;\r\n\r\n const days = julianDay - ISLAMIC_EPOCH;\r\n const hYear = Math.floor((30 * days + 10646) / 10631.0);\r\n let hMonth = Math.ceil((days - 29 - getIslamicYearStart(hYear)) / 29.5);\r\n hMonth = Math.min(hMonth, 11);\r\n const hDay = Math.ceil(days - getIslamicMonthStart(hYear, hMonth)) + 1;\r\n return new NgbDate(hYear, hMonth + 1, hDay);\r\n }\r\n\r\n /**\r\n * Returns the equivalent JS date value for a give input islamic(civil) date.\r\n * `hDate` is an islamic(civil) date to be converted to Gregorian.\r\n */\r\n toGregorian(hDate: NgbDate): Date {\r\n const hYear = hDate.year;\r\n const hMonth = hDate.month - 1;\r\n const hDay = hDate.day;\r\n const julianDay =\r\n hDay + Math.ceil(29.5 * hMonth) + (hYear - 1) * 354 + Math.floor((3 + 11 * hYear) / 30) + ISLAMIC_EPOCH - 1;\r\n\r\n const wjd = Math.floor(julianDay - 0.5) + 0.5, depoch = wjd - GREGORIAN_EPOCH,\r\n quadricent = Math.floor(depoch / 146097), dqc = mod(depoch, 146097), cent = Math.floor(dqc / 36524),\r\n dcent = mod(dqc, 36524), quad = Math.floor(dcent / 1461), dquad = mod(dcent, 1461),\r\n yindex = Math.floor(dquad / 365);\r\n let year = quadricent * 400 + cent * 100 + quad * 4 + yindex;\r\n if (!(cent === 4 || yindex === 4)) {\r\n year++;\r\n }\r\n\r\n const gYearStart = GREGORIAN_EPOCH + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +\r\n Math.floor((year - 1) / 400);\r\n\r\n const yearday = wjd - gYearStart;\r\n\r\n const tjd = GREGORIAN_EPOCH - 1 + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +\r\n Math.floor((year - 1) / 400) + Math.floor(739 / 12 + (isGregorianLeapYear(new Date(year, 3, 1)) ? -1 : -2) + 1);\r\n\r\n const leapadj = wjd < tjd ? 0 : isGregorianLeapYear(new Date(year, 3, 1)) ? 1 : 2;\r\n\r\n const month = Math.floor(((yearday + leapadj) * 12 + 373) / 367);\r\n const tjd2 = GREGORIAN_EPOCH - 1 + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +\r\n Math.floor((year - 1) / 400) +\r\n Math.floor(\r\n (367 * month - 362) / 12 + (month <= 2 ? 0 : isGregorianLeapYear(new Date(year, month - 1, 1)) ? -1 : -2) +\r\n 1);\r\n\r\n const day = wjd - tjd2 + 1;\r\n\r\n return new Date(year, month - 1, day);\r\n }\r\n\r\n /**\r\n * Returns the number of days in a specific Hijri month.\r\n * `month` is 1 for Muharram, 2 for Safar, etc.\r\n * `year` is any Hijri year.\r\n */\r\n getDaysPerMonth(month: number, year: number): number {\r\n year = year + Math.floor(month / 13);\r\n month = ((month - 1) % 12) + 1;\r\n let length = 29 + month % 2;\r\n if (month === 12 && isIslamicLeapYear(year)) {\r\n length++;\r\n }\r\n return length;\r\n }\r\n}\r\n","import {NgbCalendarIslamicCivil} from './ngb-calendar-islamic-civil';\r\nimport {NgbDate} from '../ngb-date';\r\nimport {Injectable} from '@angular/core';\r\n\r\n/**\r\n * Umalqura calendar is one type of Hijri calendars used in islamic countries.\r\n * This Calendar is used by Saudi Arabia for administrative purpose.\r\n * Unlike tabular calendars, the algorithm involves astronomical calculation, but it's still deterministic.\r\n * http://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types\r\n */\r\n\r\nconst GREGORIAN_FIRST_DATE = new Date(1882, 10, 12);\r\nconst GREGORIAN_LAST_DATE = new Date(2174, 10, 25);\r\nconst HIJRI_BEGIN = 1300;\r\nconst HIJRI_END = 1600;\r\nconst ONE_DAY = 1000 * 60 * 60 * 24;\r\n\r\nconst MONTH_LENGTH = [\r\n // 1300-1304\r\n '101010101010', '110101010100', '111011001001', '011011010100', '011011101010',\r\n // 1305-1309\r\n '001101101100', '101010101101', '010101010101', '011010101001', '011110010010',\r\n // 1310-1314\r\n '101110101001', '010111010100', '101011011010', '010101011100', '110100101101',\r\n // 1315-1319\r\n '011010010101', '011101001010', '101101010100', '101101101010', '010110101101',\r\n // 1320-1324\r\n '010010101110', '101001001111', '010100010111', '011010001011', '011010100101',\r\n // 1325-1329\r\n '101011010101', '001011010110', '100101011011', '010010011101', '101001001101',\r\n // 1330-1334\r\n '110100100110', '110110010101', '010110101100', '100110110110', '001010111010',\r\n // 1335-1339\r\n '101001011011', '010100101011', '101010010101', '011011001010', '101011101001',\r\n // 1340-1344\r\n '001011110100', '100101110110', '001010110110', '100101010110', '101011001010',\r\n // 1345-1349\r\n '101110100100', '101111010010', '010111011001', '001011011100', '100101101101',\r\n // 1350-1354\r\n '010101001101', '101010100101', '101101010010', '101110100101', '010110110100',\r\n // 1355-1359\r\n '100110110110', '010101010111', '001010010111', '010101001011', '011010100011',\r\n // 1360-1364\r\n '011101010010', '101101100101', '010101101010', '101010101011', '010100101011',\r\n // 1365-1369\r\n '110010010101', '110101001010', '110110100101', '010111001010', '101011010110',\r\n // 1370-1374\r\n '100101010111', '010010101011', '100101001011', '101010100101', '101101010010',\r\n // 1375-1379\r\n '101101101010', '010101110101', '001001110110', '100010110111', '010001011011',\r\n // 1380-1384\r\n '010101010101', '010110101001', '010110110100', '100111011010', '010011011101',\r\n // 1385-1389\r\n '001001101110', '100100110110', '101010101010', '110101010100', '110110110010',\r\n // 1390-1394\r\n '010111010101', '001011011010', '100101011011', '010010101011', '101001010101',\r\n // 1395-1399\r\n '101101001001', '101101100100', '101101110001', '010110110100', '101010110101',\r\n // 1400-1404\r\n '101001010101', '110100100101', '111010010010', '111011001001', '011011010100',\r\n // 1405-1409\r\n '101011101001', '100101101011', '010010101011', '101010010011', '110101001001',\r\n // 1410-1414\r\n '110110100100', '110110110010', '101010111001', '010010111010', '101001011011',\r\n // 1415-1419\r\n '010100101011', '101010010101', '101100101010', '101101010101', '010101011100',\r\n // 1420-1424\r\n '010010111101', '001000111101', '100100011101', '101010010101', '101101001010',\r\n // 1425-1429\r\n '101101011010', '010101101101', '001010110110', '100100111011', '010010011011',\r\n // 1430-1434\r\n '011001010101', '011010101001', '011101010100', '101101101010', '010101101100',\r\n // 1435-1439\r\n '101010101101', '010101010101', '101100101001', '101110010010', '101110101001',\r\n // 1440-1444\r\n '010111010100', '101011011010', '010101011010', '101010101011', '010110010101',\r\n // 1445-1449\r\n '011101001001', '011101100100', '101110101010', '010110110101', '001010110110',\r\n // 1450-1454\r\n '101001010110', '111001001101', '101100100101', '101101010010', '101101101010',\r\n // 1455-1459\r\n '010110101101', '001010101110', '100100101111', '010010010111', '011001001011',\r\n // 1460-1464\r\n '011010100101', '011010101100', '101011010110', '010101011101', '010010011101',\r\n // 1465-1469\r\n '101001001101', '110100010110', '110110010101', '010110101010', '010110110101',\r\n // 1470-1474\r\n '001011011010', '100101011011', '010010101101', '010110010101', '011011001010',\r\n // 1475-1479\r\n '011011100100', '101011101010', '010011110101', '001010110110', '100101010110',\r\n // 1480-1484\r\n '101010101010', '101101010100', '101111010010', '010111011001', '001011101010',\r\n // 1485-1489\r\n '100101101101', '010010101101', '101010010101', '101101001010', '101110100101',\r\n // 1490-1494\r\n '010110110010', '100110110101', '010011010110', '101010010111', '010101000111',\r\n // 1495-1499\r\n '011010010011', '011101001001', '101101010101', '010101101010', '101001101011',\r\n // 1500-1504\r\n '010100101011', '101010001011', '110101000110', '110110100011', '010111001010',\r\n // 1505-1509\r\n '101011010110', '010011011011', '001001101011', '100101001011', '101010100101',\r\n // 1510-1514\r\n '101101010010', '101101101001', '010101110101', '000101110110', '100010110111',\r\n // 1515-1519\r\n '001001011011', '010100101011', '010101100101', '010110110100', '100111011010',\r\n // 1520-1524\r\n '010011101101', '000101101101', '100010110110', '101010100110', '110101010010',\r\n // 1525-1529\r\n '110110101001', '010111010100', '101011011010', '100101011011', '010010101011',\r\n // 1530-1534\r\n '011001010011', '011100101001', '011101100010', '101110101001', '010110110010',\r\n // 1535-1539\r\n '101010110101', '010101010101', '101100100101', '110110010010', '111011001001',\r\n // 1540-1544\r\n '011011010010', '101011101001', '010101101011', '010010101011', '101001010101',\r\n // 1545-1549\r\n '110100101001', '110101010100', '110110101010', '100110110101', '010010111010',\r\n // 1550-1554\r\n '101000111011', '010010011011', '101001001101', '101010101010', '101011010101',\r\n // 1555-1559\r\n '001011011010', '100101011101', '010001011110', '101000101110', '110010011010',\r\n // 1560-1564\r\n '110101010101', '011010110010', '011010111001', '010010111010', '101001011101',\r\n // 1565-1569\r\n '010100101101', '101010010101', '101101010010', '101110101000', '101110110100',\r\n // 1570-1574\r\n '010110111001', '001011011010', '100101011010', '101101001010', '110110100100',\r\n // 1575-1579\r\n '111011010001', '011011101000', '101101101010', '010101101101', '010100110101',\r\n // 1580-1584\r\n '011010010101', '110101001010', '110110101000', '110111010100', '011011011010',\r\n // 1585-1589\r\n '010101011011', '001010011101', '011000101011', '101100010101', '101101001010',\r\n // 1590-1594\r\n '101110010101', '010110101010', '101010101110', '100100101110', '110010001111',\r\n // 1595-1599\r\n '010100100111', '011010010101', '011010101010', '101011010110', '010101011101',\r\n // 1600\r\n '001010011101'\r\n];\r\n\r\nfunction getDaysDiff(date1: Date, date2: Date): number {\r\n // Ignores the time part in date1 and date2:\r\n const time1 = Date.UTC(date1.getFullYear(), date1.getMonth(), date1.getDate());\r\n const time2 = Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate());\r\n const diff = Math.abs(time1 - time2);\r\n return Math.round(diff / ONE_DAY);\r\n}\r\n\r\n@Injectable()\r\nexport class NgbCalendarIslamicUmalqura extends NgbCalendarIslamicCivil {\r\n /**\r\n * Returns the equivalent islamic(Umalqura) date value for a give input Gregorian date.\r\n * `gdate` is s JS Date to be converted to Hijri.\r\n */\r\n fromGregorian(gDate: Date): NgbDate {\r\n let hDay = 1, hMonth = 0, hYear = 1300;\r\n let daysDiff = getDaysDiff(gDate, GREGORIAN_FIRST_DATE);\r\n if (gDate.getTime() - GREGORIAN_FIRST_DATE.getTime() >= 0 && gDate.getTime() - GREGORIAN_LAST_DATE.getTime() <= 0) {\r\n let year = 1300;\r\n for (let i = 0; i < MONTH_LENGTH.length; i++, year++) {\r\n for (let j = 0; j < 12; j++) {\r\n let numOfDays = +MONTH_LENGTH[i][j] + 29;\r\n if (daysDiff <= numOfDays) {\r\n hDay = daysDiff + 1;\r\n if (hDay > numOfDays) {\r\n hDay = 1;\r\n j++;\r\n }\r\n if (j > 11) {\r\n j = 0;\r\n year++;\r\n }\r\n hMonth = j;\r\n hYear = year;\r\n return new NgbDate(hYear, hMonth + 1, hDay);\r\n }\r\n daysDiff = daysDiff - numOfDays;\r\n }\r\n }\r\n return null as any;\r\n } else {\r\n return super.fromGregorian(gDate);\r\n }\r\n }\r\n /**\r\n * Converts the current Hijri date to Gregorian.\r\n */\r\n toGregorian(hDate: NgbDate): Date {\r\n const hYear = hDate.year;\r\n const hMonth = hDate.month - 1;\r\n const hDay = hDate.day;\r\n let gDate = new Date(GREGORIAN_FIRST_DATE);\r\n let dayDiff = hDay - 1;\r\n if (hYear >= HIJRI_BEGIN && hYear <= HIJRI_END) {\r\n for (let y = 0; y < hYear - HIJRI_BEGIN; y++) {\r\n for (let m = 0; m < 12; m++) {\r\n dayDiff += +MONTH_LENGTH[y][m] + 29;\r\n }\r\n }\r\n for (let m = 0; m < hMonth; m++) {\r\n dayDiff += +MONTH_LENGTH[hYear - HIJRI_BEGIN][m] + 29;\r\n }\r\n gDate.setDate(GREGORIAN_FIRST_DATE.getDate() + dayDiff);\r\n } else {\r\n gDate = super.toGregorian(hDate);\r\n }\r\n return gDate;\r\n }\r\n /**\r\n * Returns the number of days in a specific Hijri hMonth.\r\n * `hMonth` is 1 for Muharram, 2 for Safar, etc.\r\n * `hYear` is any Hijri hYear.\r\n */\r\n getDaysPerMonth(hMonth: number, hYear: number): number {\r\n if (hYear >= HIJRI_BEGIN && hYear <= HIJRI_END) {\r\n const pos = hYear - HIJRI_BEGIN;\r\n return +MONTH_LENGTH[pos][hMonth - 1] + 29;\r\n }\r\n return super.getDaysPerMonth(hMonth, hYear);\r\n }\r\n}\r\n","import {NgbDate} from '../ngb-date';\r\n\r\n/**\r\n * Returns the equivalent JS date value for a give input Jalali date.\r\n * `jalaliDate` is an Jalali date to be converted to Gregorian.\r\n */\r\nexport function toGregorian(jalaliDate: NgbDate): Date {\r\n let jdn = jalaliToJulian(jalaliDate.year, jalaliDate.month, jalaliDate.day);\r\n let date = julianToGregorian(jdn);\r\n date.setHours(6, 30, 3, 200);\r\n return date;\r\n}\r\n\r\n/**\r\n * Returns the equivalent jalali date value for a give input Gregorian date.\r\n * `gdate` is a JS Date to be converted to jalali.\r\n * utc to local\r\n */\r\nexport function fromGregorian(gdate: Date): NgbDate {\r\n let g2d = gregorianToJulian(gdate.getFullYear(), gdate.getMonth() + 1, gdate.getDate());\r\n return julianToJalali(g2d);\r\n}\r\n\r\nexport function setJalaliYear(date: NgbDate, yearValue: number): NgbDate {\r\n date.year = +yearValue;\r\n return date;\r\n}\r\n\r\nexport function setJalaliMonth(date: NgbDate, month: number): NgbDate {\r\n month = +month;\r\n date.year = date.year + Math.floor((month - 1) / 12);\r\n date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;\r\n return date;\r\n}\r\n\r\nexport function setJalaliDay(date: NgbDate, day: number): NgbDate {\r\n let mDays = getDaysPerMonth(date.month, date.year);\r\n if (day <= 0) {\r\n while (day <= 0) {\r\n date = setJalaliMonth(date, date.month - 1);\r\n mDays = getDaysPerMonth(date.month, date.year);\r\n day += mDays;\r\n }\r\n } else if (day > mDays) {\r\n while (day > mDays) {\r\n day -= mDays;\r\n date = setJalaliMonth(date, date.month + 1);\r\n mDays = getDaysPerMonth(date.month, date.year);\r\n }\r\n }\r\n date.day = day;\r\n return date;\r\n}\r\n\r\nfunction mod(a: number, b: number): number {\r\n return a - b * Math.floor(a / b);\r\n}\r\n\r\nfunction div(a: number, b: number) {\r\n return Math.trunc(a / b);\r\n}\r\n\r\n/*\r\n This function determines if the Jalali (Persian) year is\r\n leap (366-day long) or is the common year (365 days), and\r\n finds the day in March (Gregorian calendar) of the first\r\n day of the Jalali year (jalaliYear).\r\n @param jalaliYear Jalali calendar year (-61 to 3177)\r\n @return\r\n leap: number of years since the last leap year (0 to 4)\r\n gYear: Gregorian year of the beginning of Jalali year\r\n march: the March day of Farvardin the 1st (1st day of jalaliYear)\r\n @see: http://www.astro.uni.torun.pl/~kb/Papers/EMP/PersianC-EMP.htm\r\n @see: http://www.fourmilab.ch/documents/calendar/\r\n */\r\nfunction jalCal(jalaliYear: number) {\r\n // Jalali years starting the 33-year rule.\r\n let breaks =\r\n [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178];\r\n const breaksLength = breaks.length;\r\n const gYear = jalaliYear + 621;\r\n let leapJ = -14;\r\n let jp = breaks[0];\r\n\r\n if (jalaliYear < jp || jalaliYear >= breaks[breaksLength - 1]) {\r\n throw new Error('Invalid Jalali year ' + jalaliYear);\r\n }\r\n\r\n // Find the limiting years for the Jalali year jalaliYear.\r\n let jump;\r\n for (let i = 1; i < breaksLength; i += 1) {\r\n const jm = breaks[i];\r\n jump = jm - jp;\r\n if (jalaliYear < jm) {\r\n break;\r\n }\r\n leapJ = leapJ + div(jump, 33) * 8 + div(mod(jump, 33), 4);\r\n jp = jm;\r\n }\r\n let n = jalaliYear - jp;\r\n\r\n // Find the number of leap years from AD 621 to the beginning\r\n // of the current Jalali year in the Persian calendar.\r\n leapJ = leapJ + div(n, 33) * 8 + div(mod(n, 33) + 3, 4);\r\n if (mod(jump, 33) === 4 && jump - n === 4) {\r\n leapJ += 1;\r\n }\r\n\r\n // And the same in the Gregorian calendar (until the year gYear).\r\n const leapG = div(gYear, 4) - div((div(gYear, 100) + 1) * 3, 4) - 150;\r\n\r\n // Determine the Gregorian date of Farvardin the 1st.\r\n const march = 20 + leapJ - leapG;\r\n\r\n // Find how many years have passed since the last leap year.\r\n if (jump - n < 6) {\r\n n = n - jump + div(jump + 4, 33) * 33;\r\n }\r\n let leap = mod(mod(n + 1, 33) - 1, 4);\r\n if (leap === -1) {\r\n leap = 4;\r\n }\r\n\r\n return {leap: leap, gy: gYear, march: march};\r\n}\r\n\r\n/*\r\n Calculates Gregorian and Julian calendar dates from the Julian Day number\r\n (jdn) for the period since jdn=-34839655 (i.e. the year -100100 of both\r\n calendars) to some millions years ahead of the present.\r\n @param jdn Julian Day number\r\n @return\r\n gYear: Calendar year (years BC numbered 0, -1, -2, ...)\r\n gMonth: Calendar month (1 to 12)\r\n gDay: Calendar day of the month M (1 to 28/29/30/31)\r\n */\r\nfunction julianToGregorian(julianDayNumber: number) {\r\n let j = 4 * julianDayNumber + 139361631;\r\n j = j + div(div(4 * julianDayNumber + 183187720, 146097) * 3, 4) * 4 - 3908;\r\n const i = div(mod(j, 1461), 4) * 5 + 308;\r\n const gDay = div(mod(i, 153), 5) + 1;\r\n const gMonth = mod(div(i, 153), 12) + 1;\r\n const gYear = div(j, 1461) - 100100 + div(8 - gMonth, 6);\r\n\r\n return new Date(gYear, gMonth - 1, gDay);\r\n}\r\n\r\n/*\r\n Converts a date of the Jalali calendar to the Julian Day number.\r\n @param jy Jalali year (1 to 3100)\r\n @param jm Jalali month (1 to 12)\r\n @param jd Jalali day (1 to 29/31)\r\n @return Julian Day number\r\n */\r\nfunction gregorianToJulian(gy: number, gm: number, gd: number) {\r\n let d = div((gy + div(gm - 8, 6) + 100100) * 1461, 4) + div(153 * mod(gm + 9, 12) + 2, 5) + gd - 34840408;\r\n d = d - div(div(gy + 100100 + div(gm - 8, 6), 100) * 3, 4) + 752;\r\n return d;\r\n}\r\n\r\n/*\r\n Converts the Julian Day number to a date in the Jalali calendar.\r\n @param julianDayNumber Julian Day number\r\n @return\r\n jalaliYear: Jalali year (1 to 3100)\r\n jalaliMonth: Jalali month (1 to 12)\r\n jalaliDay: Jalali day (1 to 29/31)\r\n */\r\nfunction julianToJalali(julianDayNumber: number) {\r\n let gy = julianToGregorian(julianDayNumber).getFullYear() // Calculate Gregorian year (gy).\r\n ,\r\n jalaliYear = gy - 621, r = jalCal(jalaliYear), gregorianDay = gregorianToJulian(gy, 3, r.march), jalaliDay,\r\n jalaliMonth, numberOfDays;\r\n\r\n // Find number of days that passed since 1 Farvardin.\r\n numberOfDays = julianDayNumber - gregorianDay;\r\n if (numberOfDays >= 0) {\r\n if (numberOfDays <= 185) {\r\n // The first 6 months.\r\n jalaliMonth = 1 + div(numberOfDays, 31);\r\n jalaliDay = mod(numberOfDays, 31) + 1;\r\n return new NgbDate(jalaliYear, jalaliMonth, jalaliDay);\r\n } else {\r\n // The remaining months.\r\n numberOfDays -= 186;\r\n }\r\n } else {\r\n // Previous Jalali year.\r\n jalaliYear -= 1;\r\n numberOfDays += 179;\r\n if (r.leap === 1) {\r\n numberOfDays += 1;\r\n }\r\n }\r\n jalaliMonth = 7 + div(numberOfDays, 30);\r\n jalaliDay = mod(numberOfDays, 30) + 1;\r\n\r\n return new NgbDate(jalaliYear, jalaliMonth, jalaliDay);\r\n}\r\n\r\n/*\r\n Converts a date of the Jalali calendar to the Julian Day number.\r\n @param jYear Jalali year (1 to 3100)\r\n @param jMonth Jalali month (1 to 12)\r\n @param jDay Jalali day (1 to 29/31)\r\n @return Julian Day number\r\n */\r\nfunction jalaliToJulian(jYear: number, jMonth: number, jDay: number) {\r\n let r = jalCal(jYear);\r\n return gregorianToJulian(r.gy, 3, r.march) + (jMonth - 1) * 31 - div(jMonth, 7) * (jMonth - 7) + jDay - 1;\r\n}\r\n\r\n/**\r\n * Returns the number of days in a specific jalali month.\r\n */\r\nfunction getDaysPerMonth(month: number, year: number): number {\r\n if (month <= 6) {\r\n return 31;\r\n }\r\n if (month <= 11) {\r\n return 30;\r\n }\r\n if (jalCal(year).leap === 0) {\r\n return 30;\r\n }\r\n return 29;\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbDate} from '../ngb-date';\r\nimport {NgbCalendar, NgbPeriod} from '../ngb-calendar';\r\nimport {isInteger} from '../../util/util';\r\n\r\nimport {fromGregorian, setJalaliDay, setJalaliMonth, setJalaliYear, toGregorian} from './jalali';\r\n\r\n@Injectable()\r\nexport class NgbCalendarPersian extends NgbCalendar {\r\n getDaysPerWeek() { return 7; }\r\n\r\n getMonths() { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; }\r\n\r\n getWeeksPerMonth() { return 6; }\r\n\r\n getNext(date: NgbDate, period: NgbPeriod = 'd', number = 1) {\r\n date = new NgbDate(date.year, date.month, date.day);\r\n\r\n switch (period) {\r\n case 'y':\r\n date = setJalaliYear(date, date.year + number);\r\n date.month = 1;\r\n date.day = 1;\r\n return date;\r\n case 'm':\r\n date = setJalaliMonth(date, date.month + number);\r\n date.day = 1;\r\n return date;\r\n case 'd':\r\n return setJalaliDay(date, date.day + number);\r\n default:\r\n return date;\r\n }\r\n }\r\n\r\n getPrev(date: NgbDate, period: NgbPeriod = 'd', number = 1) { return this.getNext(date, period, -number); }\r\n\r\n getWeekday(date: NgbDate) {\r\n const day = toGregorian(date).getDay();\r\n // in JS Date Sun=0, in ISO 8601 Sun=7\r\n return day === 0 ? 7 : day;\r\n }\r\n\r\n getWeekNumber(week: readonly NgbDate[], firstDayOfWeek: number) {\r\n // in JS Date Sun=0, in ISO 8601 Sun=7\r\n if (firstDayOfWeek === 7) {\r\n firstDayOfWeek = 0;\r\n }\r\n\r\n const thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;\r\n const date = week[thursdayIndex];\r\n\r\n const jsDate = toGregorian(date);\r\n jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday\r\n const time = jsDate.getTime();\r\n const startDate = toGregorian(new NgbDate(date.year, 1, 1));\r\n return Math.floor(Math.round((time - startDate.getTime()) / 86400000) / 7) + 1;\r\n }\r\n\r\n getToday(): NgbDate { return fromGregorian(new Date()); }\r\n\r\n isValid(date?: NgbDate | null): boolean {\r\n return date != null && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) &&\r\n !isNaN(toGregorian(date).getTime());\r\n }\r\n}\r\n","import {NgbDate} from '../ngb-date';\r\nimport {NgbDateStruct} from '../ngb-date-struct';\r\n\r\nconst PARTS_PER_HOUR = 1080;\r\nconst PARTS_PER_DAY = 24 * PARTS_PER_HOUR;\r\nconst PARTS_FRACTIONAL_MONTH = 12 * PARTS_PER_HOUR + 793;\r\nconst PARTS_PER_MONTH = 29 * PARTS_PER_DAY + PARTS_FRACTIONAL_MONTH;\r\nconst BAHARAD = 11 * PARTS_PER_HOUR + 204;\r\nconst HEBREW_DAY_ON_JAN_1_1970 = 2092591;\r\nconst GREGORIAN_EPOCH = 1721425.5;\r\n\r\nfunction isGregorianLeapYear(year: number): boolean {\r\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\r\n}\r\n\r\nfunction numberOfFirstDayInYear(year: number): number {\r\n let monthsBeforeYear = Math.floor((235 * year - 234) / 19);\r\n let fractionalMonthsBeforeYear = monthsBeforeYear * PARTS_FRACTIONAL_MONTH + BAHARAD;\r\n let dayNumber = monthsBeforeYear * 29 + Math.floor(fractionalMonthsBeforeYear / PARTS_PER_DAY);\r\n let timeOfDay = fractionalMonthsBeforeYear % PARTS_PER_DAY;\r\n\r\n let dayOfWeek = dayNumber % 7; // 0 == Monday\r\n\r\n if (dayOfWeek === 2 || dayOfWeek === 4 || dayOfWeek === 6) {\r\n dayNumber++;\r\n dayOfWeek = dayNumber % 7;\r\n }\r\n if (dayOfWeek === 1 && timeOfDay > 15 * PARTS_PER_HOUR + 204 && !isHebrewLeapYear(year)) {\r\n dayNumber += 2;\r\n } else if (dayOfWeek === 0 && timeOfDay > 21 * PARTS_PER_HOUR + 589 && isHebrewLeapYear(year - 1)) {\r\n dayNumber++;\r\n }\r\n return dayNumber;\r\n}\r\n\r\nfunction getDaysInGregorianMonth(month: number, year: number): number {\r\n let days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\r\n if (isGregorianLeapYear(year)) {\r\n days[1]++;\r\n }\r\n return days[month - 1];\r\n}\r\n\r\nfunction getHebrewMonths(year: number): number {\r\n return isHebrewLeapYear(year) ? 13 : 12;\r\n}\r\n\r\n/**\r\n * Returns the number of days in a specific Hebrew year.\r\n * `year` is any Hebrew year.\r\n */\r\nfunction getDaysInHebrewYear(year: number): number {\r\n return numberOfFirstDayInYear(year + 1) - numberOfFirstDayInYear(year);\r\n}\r\n\r\nexport function isHebrewLeapYear(year?: number): boolean {\r\n if (year != null) {\r\n let b = (year * 12 + 17) % 19;\r\n return b >= ((b < 0) ? -7 : 12);\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Returns the number of days in a specific Hebrew month.\r\n * `month` is 1 for Nisan, 2 for Iyar etc. Note: Hebrew leap year contains 13 months.\r\n * `year` is any Hebrew year.\r\n */\r\nexport function getDaysInHebrewMonth(month: number, year: number): number {\r\n let yearLength = numberOfFirstDayInYear(year + 1) - numberOfFirstDayInYear(year);\r\n let yearType = (yearLength <= 380 ? yearLength : (yearLength - 30)) - 353;\r\n let leapYear = isHebrewLeapYear(year);\r\n let daysInMonth = leapYear ? [30, 29, 29, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29] :\r\n [30, 29, 29, 29, 30, 29, 30, 29, 30, 29, 30, 29];\r\n if (yearType > 0) {\r\n daysInMonth[2]++; // Kislev gets an extra day in normal or complete years.\r\n }\r\n if (yearType > 1) {\r\n daysInMonth[1]++; // Heshvan gets an extra day in complete years only.\r\n }\r\n return daysInMonth[month - 1];\r\n}\r\n\r\nexport function getDayNumberInHebrewYear(date: NgbDate): number {\r\n let numberOfDay = 0;\r\n for (let i = 1; i < date.month; i++) {\r\n numberOfDay += getDaysInHebrewMonth(i, date.year);\r\n }\r\n return numberOfDay + date.day;\r\n}\r\n\r\nexport function setHebrewMonth(date: NgbDate, val: number): NgbDate {\r\n let after = val >= 0;\r\n if (!after) {\r\n val = -val;\r\n }\r\n while (val > 0) {\r\n if (after) {\r\n if (val > getHebrewMonths(date.year) - date.month) {\r\n val -= getHebrewMonths(date.year) - date.month + 1;\r\n date.year++;\r\n date.month = 1;\r\n } else {\r\n date.month += val;\r\n val = 0;\r\n }\r\n } else {\r\n if (val >= date.month) {\r\n date.year--;\r\n val -= date.month;\r\n date.month = getHebrewMonths(date.year);\r\n } else {\r\n date.month -= val;\r\n val = 0;\r\n }\r\n }\r\n }\r\n return date;\r\n}\r\n\r\nexport function setHebrewDay(date: NgbDate, val: number): NgbDate {\r\n let after = val >= 0;\r\n if (!after) {\r\n val = -val;\r\n }\r\n while (val > 0) {\r\n if (after) {\r\n if (val > getDaysInHebrewYear(date.year) - getDayNumberInHebrewYear(date)) {\r\n val -= getDaysInHebrewYear(date.year) - getDayNumberInHebrewYear(date) + 1;\r\n date.year++;\r\n date.month = 1;\r\n date.day = 1;\r\n } else if (val > getDaysInHebrewMonth(date.month, date.year) - date.day) {\r\n val -= getDaysInHebrewMonth(date.month, date.year) - date.day + 1;\r\n date.month++;\r\n date.day = 1;\r\n } else {\r\n date.day += val;\r\n val = 0;\r\n }\r\n } else {\r\n if (val >= date.day) {\r\n val -= date.day;\r\n date.month--;\r\n if (date.month === 0) {\r\n date.year--;\r\n date.month = getHebrewMonths(date.year);\r\n }\r\n date.day = getDaysInHebrewMonth(date.month, date.year);\r\n } else {\r\n date.day -= val;\r\n val = 0;\r\n }\r\n }\r\n }\r\n return date;\r\n}\r\n\r\n/**\r\n * Returns the equivalent Hebrew date value for a give input Gregorian date.\r\n * `gdate` is a JS Date to be converted to Hebrew date.\r\n */\r\nexport function fromGregorian(gdate: Date): NgbDate {\r\n const date = new Date(gdate);\r\n const gYear = date.getFullYear(), gMonth = date.getMonth(), gDay = date.getDate();\r\n let julianDay = GREGORIAN_EPOCH - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) -\r\n Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +\r\n Math.floor((367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear(gYear) ? -1 : -2) + gDay);\r\n julianDay = Math.floor(julianDay + 0.5);\r\n let daysSinceHebEpoch = julianDay - 347997;\r\n let monthsSinceHebEpoch = Math.floor(daysSinceHebEpoch * PARTS_PER_DAY / PARTS_PER_MONTH);\r\n let hYear = Math.floor((monthsSinceHebEpoch * 19 + 234) / 235) + 1;\r\n let firstDayOfThisYear = numberOfFirstDayInYear(hYear);\r\n let dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;\r\n while (dayOfYear < 1) {\r\n hYear--;\r\n firstDayOfThisYear = numberOfFirstDayInYear(hYear);\r\n dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;\r\n }\r\n let hMonth = 1;\r\n let hDay = dayOfYear;\r\n while (hDay > getDaysInHebrewMonth(hMonth, hYear)) {\r\n hDay -= getDaysInHebrewMonth(hMonth, hYear);\r\n hMonth++;\r\n }\r\n return new NgbDate(hYear, hMonth, hDay);\r\n}\r\n\r\n/**\r\n * Returns the equivalent JS date value for a given Hebrew date.\r\n * `hebrewDate` is an Hebrew date to be converted to Gregorian.\r\n */\r\nexport function toGregorian(hebrewDate: NgbDateStruct | NgbDate): Date {\r\n const hYear = hebrewDate.year;\r\n const hMonth = hebrewDate.month;\r\n const hDay = hebrewDate.day;\r\n let days = numberOfFirstDayInYear(hYear);\r\n for (let i = 1; i < hMonth; i++) {\r\n days += getDaysInHebrewMonth(i, hYear);\r\n }\r\n days += hDay;\r\n let diffDays = days - HEBREW_DAY_ON_JAN_1_1970;\r\n let after = diffDays >= 0;\r\n if (!after) {\r\n diffDays = -diffDays;\r\n }\r\n let gYear = 1970;\r\n let gMonth = 1;\r\n let gDay = 1;\r\n while (diffDays > 0) {\r\n if (after) {\r\n if (diffDays >= (isGregorianLeapYear(gYear) ? 366 : 365)) {\r\n diffDays -= isGregorianLeapYear(gYear) ? 366 : 365;\r\n gYear++;\r\n } else if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {\r\n diffDays -= getDaysInGregorianMonth(gMonth, gYear);\r\n gMonth++;\r\n } else {\r\n gDay += diffDays;\r\n diffDays = 0;\r\n }\r\n } else {\r\n if (diffDays >= (isGregorianLeapYear(gYear - 1) ? 366 : 365)) {\r\n diffDays -= isGregorianLeapYear(gYear - 1) ? 366 : 365;\r\n gYear--;\r\n } else {\r\n if (gMonth > 1) {\r\n gMonth--;\r\n } else {\r\n gMonth = 12;\r\n gYear--;\r\n }\r\n if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {\r\n diffDays -= getDaysInGregorianMonth(gMonth, gYear);\r\n } else {\r\n gDay = getDaysInGregorianMonth(gMonth, gYear) - diffDays + 1;\r\n diffDays = 0;\r\n }\r\n }\r\n }\r\n }\r\n return new Date(gYear, gMonth - 1, gDay);\r\n}\r\n\r\nexport function hebrewNumerals(numerals: number): string {\r\n if (!numerals) {\r\n return '';\r\n }\r\n const hArray0_9 = ['', '\\u05d0', '\\u05d1', '\\u05d2', '\\u05d3', '\\u05d4', '\\u05d5', '\\u05d6', '\\u05d7', '\\u05d8'];\r\n const hArray10_19 = [\r\n '\\u05d9', '\\u05d9\\u05d0', '\\u05d9\\u05d1', '\\u05d9\\u05d2', '\\u05d9\\u05d3', '\\u05d8\\u05d5', '\\u05d8\\u05d6',\r\n '\\u05d9\\u05d6', '\\u05d9\\u05d7', '\\u05d9\\u05d8'\r\n ];\r\n const hArray20_90 = ['', '', '\\u05db', '\\u05dc', '\\u05de', '\\u05e0', '\\u05e1', '\\u05e2', '\\u05e4', '\\u05e6'];\r\n const hArray100_900 = [\r\n '', '\\u05e7', '\\u05e8', '\\u05e9', '\\u05ea', '\\u05ea\\u05e7', '\\u05ea\\u05e8', '\\u05ea\\u05e9', '\\u05ea\\u05ea',\r\n '\\u05ea\\u05ea\\u05e7'\r\n ];\r\n const hArray1000_9000 = [\r\n '', '\\u05d0', '\\u05d1', '\\u05d1\\u05d0', '\\u05d1\\u05d1', '\\u05d4', '\\u05d4\\u05d0', '\\u05d4\\u05d1',\r\n '\\u05d4\\u05d1\\u05d0', '\\u05d4\\u05d1\\u05d1'\r\n ];\r\n const geresh = '\\u05f3', gershaim = '\\u05f4';\r\n let mem = 0;\r\n let result: string[] = [];\r\n let step = 0;\r\n while (numerals > 0) {\r\n let m = numerals % 10;\r\n if (step === 0) {\r\n mem = m;\r\n } else if (step === 1) {\r\n if (m !== 1) {\r\n result.unshift(hArray20_90[m], hArray0_9[mem]);\r\n } else {\r\n result.unshift(hArray10_19[mem]);\r\n }\r\n } else if (step === 2) {\r\n result.unshift(hArray100_900[m]);\r\n } else {\r\n if (m !== 5) {\r\n result.unshift(hArray1000_9000[m], geresh, ' ');\r\n }\r\n break;\r\n }\r\n numerals = Math.floor(numerals / 10);\r\n if (step === 0 && numerals === 0) {\r\n result.unshift(hArray0_9[m]);\r\n }\r\n step++;\r\n }\r\n result = result.join('').split('');\r\n if (result.length === 1) {\r\n result.push(geresh);\r\n } else if (result.length > 1) {\r\n result.splice(result.length - 1, 0, gershaim);\r\n }\r\n return result.join('');\r\n}\r\n","import {NgbDate} from '../ngb-date';\r\nimport {fromJSDate, NgbCalendar, NgbPeriod, toJSDate} from '../ngb-calendar';\r\nimport {Injectable} from '@angular/core';\r\nimport {isNumber} from '../../util/util';\r\nimport {\r\n fromGregorian,\r\n getDayNumberInHebrewYear,\r\n getDaysInHebrewMonth,\r\n isHebrewLeapYear,\r\n toGregorian,\r\n setHebrewDay,\r\n setHebrewMonth\r\n} from './hebrew';\r\n\r\n/**\r\n * @since 3.2.0\r\n */\r\n@Injectable()\r\nexport class NgbCalendarHebrew extends NgbCalendar {\r\n getDaysPerWeek() { return 7; }\r\n\r\n getMonths(year?: number) {\r\n if (year && isHebrewLeapYear(year)) {\r\n return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];\r\n } else {\r\n return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\r\n }\r\n }\r\n\r\n getWeeksPerMonth() { return 6; }\r\n\r\n isValid(date?: NgbDate | null): boolean {\r\n if (date != null) {\r\n let b = isNumber(date.year) && isNumber(date.month) && isNumber(date.day);\r\n b = b && date.month > 0 && date.month <= (isHebrewLeapYear(date.year) ? 13 : 12);\r\n b = b && date.day > 0 && date.day <= getDaysInHebrewMonth(date.month, date.year);\r\n return b && !isNaN(toGregorian(date).getTime());\r\n }\r\n\r\n return false;\r\n }\r\n\r\n getNext(date: NgbDate, period: NgbPeriod = 'd', number = 1) {\r\n date = new NgbDate(date.year, date.month, date.day);\r\n\r\n switch (period) {\r\n case 'y':\r\n date.year += number;\r\n date.month = 1;\r\n date.day = 1;\r\n return date;\r\n case 'm':\r\n date = setHebrewMonth(date, number);\r\n date.day = 1;\r\n return date;\r\n case 'd':\r\n return setHebrewDay(date, number);\r\n default:\r\n return date;\r\n }\r\n }\r\n\r\n getPrev(date: NgbDate, period: NgbPeriod = 'd', number = 1) { return this.getNext(date, period, -number); }\r\n\r\n getWeekday(date: NgbDate) {\r\n const day = toGregorian(date).getDay();\r\n // in JS Date Sun=0, in ISO 8601 Sun=7\r\n return day === 0 ? 7 : day;\r\n }\r\n\r\n getWeekNumber(week: readonly NgbDate[], firstDayOfWeek: number) {\r\n const date = week[week.length - 1];\r\n return Math.ceil(getDayNumberInHebrewYear(date) / 7);\r\n }\r\n\r\n getToday(): NgbDate { return fromGregorian(new Date()); }\r\n\r\n /**\r\n * @since 3.4.0\r\n */\r\n toGregorian(date: NgbDate): NgbDate { return fromJSDate(toGregorian(date)); }\r\n\r\n /**\r\n * @since 3.4.0\r\n */\r\n fromGregorian(date: NgbDate): NgbDate { return fromGregorian(toJSDate(date)); }\r\n}\r\n","import {NgbDatepickerI18n} from '../datepicker-i18n';\r\nimport {NgbDateStruct} from '../../index';\r\nimport {hebrewNumerals, isHebrewLeapYear} from './hebrew';\r\nimport {Injectable} from '@angular/core';\r\n\r\n\r\nconst WEEKDAYS = ['שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת', 'ראשון'];\r\nconst MONTHS = ['תשרי', 'חשון', 'כסלו', 'טבת', 'שבט', 'אדר', 'ניסן', 'אייר', 'סיון', 'תמוז', 'אב', 'אלול'];\r\nconst MONTHS_LEAP =\r\n ['תשרי', 'חשון', 'כסלו', 'טבת', 'שבט', 'אדר א׳', 'אדר ב׳', 'ניסן', 'אייר', 'סיון', 'תמוז', 'אב', 'אלול'];\r\n\r\n/**\r\n * @since 3.2.0\r\n */\r\n@Injectable()\r\nexport class NgbDatepickerI18nHebrew extends NgbDatepickerI18n {\r\n getMonthShortName(month: number, year?: number): string { return this.getMonthFullName(month, year); }\r\n\r\n getMonthFullName(month: number, year?: number): string {\r\n return isHebrewLeapYear(year) ? MONTHS_LEAP[month - 1] || '' : MONTHS[month - 1] || '';\r\n }\r\n\r\n getWeekdayShortName(weekday: number): string { return WEEKDAYS[weekday - 1] || ''; }\r\n\r\n getDayAriaLabel(date: NgbDateStruct): string {\r\n return `${hebrewNumerals(date.day)} ${this.getMonthFullName(date.month, date.year)} ${hebrewNumerals(date.year)}`;\r\n }\r\n\r\n getDayNumerals(date: NgbDateStruct): string { return hebrewNumerals(date.day); }\r\n\r\n getWeekNumerals(weekNumber: number): string { return hebrewNumerals(weekNumber); }\r\n\r\n getYearNumerals(year: number): string { return hebrewNumerals(year); }\r\n}\r\n","import {NgbDate} from '../ngb-date';\r\n\r\n/**\r\n * Returns the equivalent JS date value for a give input Buddhist date.\r\n * `date` is an Buddhist date to be converted to Gregorian.\r\n */\r\nexport function toGregorian(date: NgbDate): Date {\r\n return new Date(date.year - 543, date.month - 1, date.day);\r\n}\r\n\r\n/**\r\n * Returns the equivalent Buddhist date value for a give input Gregorian date.\r\n * `gdate` is a JS Date to be converted to Buddhist.\r\n * utc to local\r\n */\r\nexport function fromGregorian(gdate: Date): NgbDate {\r\n return new NgbDate(gdate.getFullYear() + 543, gdate.getMonth() + 1, gdate.getDate());\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {isInteger} from '../../util/util';\r\nimport {NgbCalendarGregorian, NgbPeriod} from '../ngb-calendar';\r\nimport {NgbDate} from '../ngb-date';\r\nimport {fromGregorian, toGregorian} from './buddhist';\r\n\r\n/**\r\n * @since 9.1.0\r\n */\r\n@Injectable()\r\nexport class NgbCalendarBuddhist extends NgbCalendarGregorian {\r\n getToday(): NgbDate { return fromGregorian(new Date()); }\r\n\r\n getNext(date: NgbDate, period: NgbPeriod = 'd', number = 1) {\r\n let jsDate = toGregorian(date);\r\n let checkMonth = true;\r\n let expectedMonth = jsDate.getMonth();\r\n\r\n switch (period) {\r\n case 'y':\r\n jsDate.setFullYear(jsDate.getFullYear() + number);\r\n break;\r\n case 'm':\r\n expectedMonth += number;\r\n jsDate.setMonth(expectedMonth);\r\n expectedMonth = expectedMonth % 12;\r\n if (expectedMonth < 0) {\r\n expectedMonth = expectedMonth + 12;\r\n }\r\n break;\r\n case 'd':\r\n jsDate.setDate(jsDate.getDate() + number);\r\n checkMonth = false;\r\n break;\r\n default:\r\n return date;\r\n }\r\n\r\n if (checkMonth && jsDate.getMonth() !== expectedMonth) {\r\n // this means the destination month has less days than the initial month\r\n // let's go back to the end of the previous month:\r\n jsDate.setDate(0);\r\n }\r\n\r\n return fromGregorian(jsDate);\r\n }\r\n\r\n getPrev(date: NgbDate, period: NgbPeriod = 'd', number = 1) { return this.getNext(date, period, -number); }\r\n\r\n getWeekday(date: NgbDate) {\r\n let jsDate = toGregorian(date);\r\n let day = jsDate.getDay();\r\n // in JS Date Sun=0, in ISO 8601 Sun=7\r\n return day === 0 ? 7 : day;\r\n }\r\n\r\n getWeekNumber(week: readonly NgbDate[], firstDayOfWeek: number) {\r\n // in JS Date Sun=0, in ISO 8601 Sun=7\r\n if (firstDayOfWeek === 7) {\r\n firstDayOfWeek = 0;\r\n }\r\n\r\n const thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;\r\n let date = week[thursdayIndex];\r\n\r\n const jsDate = toGregorian(date);\r\n jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday\r\n const time = jsDate.getTime();\r\n jsDate.setMonth(0); // Compare with Jan 1\r\n jsDate.setDate(1);\r\n return Math.floor(Math.round((time - jsDate.getTime()) / 86400000) / 7) + 1;\r\n }\r\n\r\n isValid(date?: NgbDate | null): boolean {\r\n if (!date || !isInteger(date.year) || !isInteger(date.month) || !isInteger(date.day)) {\r\n return false;\r\n }\r\n\r\n // year 0 doesn't exist in Gregorian calendar\r\n if (date.year === 0) {\r\n return false;\r\n }\r\n\r\n const jsDate = toGregorian(date);\r\n\r\n return !isNaN(jsDate.getTime()) && jsDate.getFullYear() === date.year - 543 &&\r\n jsDate.getMonth() + 1 === date.month && jsDate.getDate() === date.day;\r\n }\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbDateAdapter} from './ngb-date-adapter';\r\nimport {NgbDateStruct} from '../ngb-date-struct';\r\nimport {isInteger} from '../../util/util';\r\n\r\n/**\r\n * [`NgbDateAdapter`](#/components/datepicker/api#NgbDateAdapter) implementation that uses\r\n * native javascript dates as a user date model.\r\n */\r\n@Injectable()\r\nexport class NgbDateNativeAdapter extends NgbDateAdapter<Date> {\r\n /**\r\n * Converts a native `Date` to a `NgbDateStruct`.\r\n */\r\n fromModel(date: Date | null): NgbDateStruct | null {\r\n return (date instanceof Date && !isNaN(date.getTime())) ? this._fromNativeDate(date) : null;\r\n }\r\n\r\n /**\r\n * Converts a `NgbDateStruct` to a native `Date`.\r\n */\r\n toModel(date: NgbDateStruct | null): Date | null {\r\n return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) ? this._toNativeDate(date) :\r\n null;\r\n }\r\n\r\n protected _fromNativeDate(date: Date): NgbDateStruct {\r\n return {year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate()};\r\n }\r\n\r\n protected _toNativeDate(date: NgbDateStruct): Date {\r\n const jsDate = new Date(date.year, date.month - 1, date.day, 12);\r\n // avoid 30 -> 1930 conversion\r\n jsDate.setFullYear(date.year);\r\n return jsDate;\r\n }\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbDateStruct} from '../ngb-date-struct';\r\nimport {NgbDateNativeAdapter} from './ngb-date-native-adapter';\r\n\r\n/**\r\n * Same as [`NgbDateNativeAdapter`](#/components/datepicker/api#NgbDateNativeAdapter), but with UTC dates.\r\n *\r\n * @since 3.2.0\r\n */\r\n@Injectable()\r\nexport class NgbDateNativeUTCAdapter extends NgbDateNativeAdapter {\r\n protected _fromNativeDate(date: Date): NgbDateStruct {\r\n return {year: date.getUTCFullYear(), month: date.getUTCMonth() + 1, day: date.getUTCDate()};\r\n }\r\n\r\n protected _toNativeDate(date: NgbDateStruct): Date {\r\n const jsDate = new Date(Date.UTC(date.year, date.month - 1, date.day));\r\n // avoid 30 -> 1930 conversion\r\n jsDate.setUTCFullYear(date.year);\r\n return jsDate;\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\nimport {FormsModule} from '@angular/forms';\r\nimport {NgbDatepicker, NgbDatepickerContent} from './datepicker';\r\nimport {NgbDatepickerMonth} from './datepicker-month';\r\nimport {NgbDatepickerNavigation} from './datepicker-navigation';\r\nimport {NgbInputDatepicker} from './datepicker-input';\r\nimport {NgbDatepickerDayView} from './datepicker-day-view';\r\nimport {NgbDatepickerNavigationSelect} from './datepicker-navigation-select';\r\n\r\nexport {NgbDatepicker, NgbDatepickerContent, NgbDatepickerNavigateEvent, NgbDatepickerState} from './datepicker';\r\nexport {NgbInputDatepicker} from './datepicker-input';\r\nexport {NgbCalendar, NgbPeriod, NgbCalendarGregorian} from './ngb-calendar';\r\nexport {NgbCalendarIslamicCivil} from './hijri/ngb-calendar-islamic-civil';\r\nexport {NgbCalendarIslamicUmalqura} from './hijri/ngb-calendar-islamic-umalqura';\r\nexport {NgbCalendarPersian} from './jalali/ngb-calendar-persian';\r\nexport {NgbCalendarHebrew} from './hebrew/ngb-calendar-hebrew';\r\nexport {NgbDatepickerI18nHebrew} from './hebrew/datepicker-i18n-hebrew';\r\nexport {NgbCalendarBuddhist} from './buddhist/ngb-calendar-buddhist';\r\nexport {NgbDatepickerMonth} from './datepicker-month';\r\nexport {NgbDatepickerDayView} from './datepicker-day-view';\r\nexport {NgbDatepickerNavigation} from './datepicker-navigation';\r\nexport {NgbDatepickerNavigationSelect} from './datepicker-navigation-select';\r\nexport {NgbDatepickerConfig} from './datepicker-config';\r\nexport {NgbInputDatepickerConfig} from './datepicker-input-config';\r\nexport {NgbDatepickerI18n, NgbDatepickerI18nDefault} from './datepicker-i18n';\r\nexport {NgbDateStruct} from './ngb-date-struct';\r\nexport {NgbDate} from './ngb-date';\r\nexport {NgbDateAdapter} from './adapters/ngb-date-adapter';\r\nexport {NgbDateNativeAdapter} from './adapters/ngb-date-native-adapter';\r\nexport {NgbDateNativeUTCAdapter} from './adapters/ngb-date-native-utc-adapter';\r\nexport {NgbDateParserFormatter} from './ngb-date-parser-formatter';\r\nexport {NgbDatepickerKeyboardService} from './datepicker-keyboard-service';\r\n\r\n@NgModule({\r\n declarations: [\r\n NgbDatepicker, NgbDatepickerContent, NgbDatepickerMonth, NgbDatepickerNavigation, NgbDatepickerNavigationSelect,\r\n NgbDatepickerDayView, NgbInputDatepicker\r\n ],\r\n exports: [NgbDatepicker, NgbDatepickerContent, NgbInputDatepicker, NgbDatepickerMonth],\r\n imports: [CommonModule, FormsModule],\r\n entryComponents: [NgbDatepicker]\r\n})\r\nexport class NgbDatepickerModule {\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {PlacementArray} from '../util/positioning';\r\n\r\n/**\r\n * A configuration service for the [`NgbDropdown`](#/components/dropdown/api#NgbDropdown) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the dropdowns used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbDropdownConfig {\r\n autoClose: boolean | 'outside' | 'inside' = true;\r\n placement: PlacementArray = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];\r\n container: null | 'body';\r\n}\r\n","import {\r\n ChangeDetectorRef,\r\n ContentChild,\r\n ContentChildren,\r\n Directive,\r\n ElementRef,\r\n EventEmitter,\r\n forwardRef,\r\n Inject,\r\n Input,\r\n NgZone,\r\n AfterContentInit,\r\n OnDestroy,\r\n Output,\r\n QueryList,\r\n Renderer2,\r\n SimpleChanges,\r\n Optional\r\n} from '@angular/core';\r\nimport {DOCUMENT} from '@angular/common';\r\nimport {fromEvent, Subject, Subscription} from 'rxjs';\r\nimport {take} from 'rxjs/operators';\r\n\r\nimport {Placement, PlacementArray, positionElements} from '../util/positioning';\r\nimport {ngbAutoClose, SOURCE} from '../util/autoclose';\r\nimport {Key} from '../util/key';\r\n\r\nimport {NgbDropdownConfig} from './dropdown-config';\r\nimport {FOCUSABLE_ELEMENTS_SELECTOR} from '../util/focus-trap';\r\n\r\n@Directive({selector: '.navbar'})\r\nexport class NgbNavbar {\r\n}\r\n\r\n/**\r\n * A directive you should put on a dropdown item to enable keyboard navigation.\r\n * Arrow keys will move focus between items marked with this directive.\r\n *\r\n * @since 4.1.0\r\n */\r\n@Directive({selector: '[ngbDropdownItem]', host: {'class': 'dropdown-item', '[class.disabled]': 'disabled'}})\r\nexport class NgbDropdownItem {\r\n static ngAcceptInputType_disabled: boolean | '';\r\n\r\n private _disabled = false;\r\n\r\n @Input()\r\n set disabled(value: boolean) {\r\n this._disabled = <any>value === '' || value === true; // accept an empty attribute as true\r\n }\r\n\r\n get disabled(): boolean { return this._disabled; }\r\n\r\n constructor(public elementRef: ElementRef<HTMLElement>) {}\r\n}\r\n\r\n/**\r\n * A directive that wraps dropdown menu content and dropdown items.\r\n */\r\n@Directive({\r\n selector: '[ngbDropdownMenu]',\r\n host: {\r\n '[class.dropdown-menu]': 'true',\r\n '[class.show]': 'dropdown.isOpen()',\r\n '[attr.x-placement]': 'placement',\r\n '(keydown.ArrowUp)': 'dropdown.onKeyDown($event)',\r\n '(keydown.ArrowDown)': 'dropdown.onKeyDown($event)',\r\n '(keydown.Home)': 'dropdown.onKeyDown($event)',\r\n '(keydown.End)': 'dropdown.onKeyDown($event)',\r\n '(keydown.Enter)': 'dropdown.onKeyDown($event)',\r\n '(keydown.Space)': 'dropdown.onKeyDown($event)',\r\n '(keydown.Tab)': 'dropdown.onKeyDown($event)',\r\n '(keydown.Shift.Tab)': 'dropdown.onKeyDown($event)'\r\n }\r\n})\r\nexport class NgbDropdownMenu {\r\n nativeElement: HTMLElement;\r\n placement: Placement | null = 'bottom';\r\n isOpen = false;\r\n\r\n @ContentChildren(NgbDropdownItem) menuItems: QueryList<NgbDropdownItem>;\r\n\r\n constructor(@Inject(forwardRef(() => NgbDropdown)) public dropdown, _elementRef: ElementRef<HTMLElement>) {\r\n this.nativeElement = _elementRef.nativeElement;\r\n }\r\n}\r\n\r\n/**\r\n * A directive to mark an element to which dropdown menu will be anchored.\r\n *\r\n * This is a simple version of the `NgbDropdownToggle` directive.\r\n * It plays the same role, but doesn't listen to click events to toggle dropdown menu thus enabling support\r\n * for events other than click.\r\n *\r\n * @since 1.1.0\r\n */\r\n@Directive(\r\n {selector: '[ngbDropdownAnchor]', host: {'class': 'dropdown-toggle', '[attr.aria-expanded]': 'dropdown.isOpen()'}})\r\nexport class NgbDropdownAnchor {\r\n nativeElement: HTMLElement;\r\n constructor(@Inject(forwardRef(() => NgbDropdown)) public dropdown, _elementRef: ElementRef<HTMLElement>) {\r\n this.nativeElement = _elementRef.nativeElement;\r\n }\r\n}\r\n\r\n/**\r\n * A directive to mark an element that will toggle dropdown via the `click` event.\r\n *\r\n * You can also use `NgbDropdownAnchor` as an alternative.\r\n */\r\n@Directive({\r\n selector: '[ngbDropdownToggle]',\r\n host: {\r\n 'class': 'dropdown-toggle',\r\n '[attr.aria-expanded]': 'dropdown.isOpen()',\r\n '(click)': 'dropdown.toggle()',\r\n '(keydown.ArrowUp)': 'dropdown.onKeyDown($event)',\r\n '(keydown.ArrowDown)': 'dropdown.onKeyDown($event)',\r\n '(keydown.Home)': 'dropdown.onKeyDown($event)',\r\n '(keydown.End)': 'dropdown.onKeyDown($event)',\r\n '(keydown.Tab)': 'dropdown.onKeyDown($event)',\r\n '(keydown.Shift.Tab)': 'dropdown.onKeyDown($event)'\r\n },\r\n providers: [{provide: NgbDropdownAnchor, useExisting: forwardRef(() => NgbDropdownToggle)}]\r\n})\r\nexport class NgbDropdownToggle extends NgbDropdownAnchor {\r\n constructor(@Inject(forwardRef(() => NgbDropdown)) dropdown, elementRef: ElementRef<HTMLElement>) {\r\n super(dropdown, elementRef);\r\n }\r\n}\r\n\r\n/**\r\n * A directive that provides contextual overlays for displaying lists of links and more.\r\n */\r\n@Directive({selector: '[ngbDropdown]', exportAs: 'ngbDropdown', host: {'[class.show]': 'isOpen()'}})\r\nexport class NgbDropdown implements AfterContentInit, OnDestroy {\r\n static ngAcceptInputType_autoClose: boolean | string;\r\n static ngAcceptInputType_display: string;\r\n private _closed$ = new Subject<void>();\r\n private _zoneSubscription: Subscription;\r\n private _bodyContainer: HTMLElement | null = null;\r\n\r\n @ContentChild(NgbDropdownMenu, {static: false}) private _menu: NgbDropdownMenu;\r\n @ContentChild(NgbDropdownAnchor, {static: false}) private _anchor: NgbDropdownAnchor;\r\n\r\n /**\r\n * Indicates whether the dropdown should be closed when clicking one of dropdown items or pressing ESC.\r\n *\r\n * * `true` - the dropdown will close on both outside and inside (menu) clicks.\r\n * * `false` - the dropdown can only be closed manually via `close()` or `toggle()` methods.\r\n * * `\"inside\"` - the dropdown will close on inside menu clicks, but not outside clicks.\r\n * * `\"outside\"` - the dropdown will close only on the outside clicks and not on menu clicks.\r\n */\r\n @Input() autoClose: boolean | 'outside' | 'inside';\r\n\r\n /**\r\n * A custom class that is applied only to the `ngbDropdownMenu` parent element.\r\n * * In case of the inline dropdown it will be the `<div ngbDropdown>`\r\n * * In case of the dropdown with `container=\"body\"` it will be the `<div class=\"dropdown\">` attached to the `<body>`\r\n *\r\n * Useful mainly when dropdown is attached to the body.\r\n * If the dropdown is inline just use `<div ngbDropdown class=\"custom-class\">` instead.\r\n *\r\n * @since 9.1.0\r\n */\r\n @Input() dropdownClass: string;\r\n\r\n /**\r\n * Defines whether or not the dropdown menu is opened initially.\r\n */\r\n @Input('open') _open = false;\r\n\r\n /**\r\n * The preferred placement of the dropdown.\r\n *\r\n * Possible values are `\"top\"`, `\"top-left\"`, `\"top-right\"`, `\"bottom\"`, `\"bottom-left\"`,\r\n * `\"bottom-right\"`, `\"left\"`, `\"left-top\"`, `\"left-bottom\"`, `\"right\"`, `\"right-top\"`,\r\n * `\"right-bottom\"`\r\n *\r\n * Accepts an array of strings or a string with space separated possible values.\r\n *\r\n * The default order of preference is `\"bottom-left bottom-right top-left top-right\"`\r\n *\r\n * Please see the [positioning overview](#/positioning) for more details.\r\n */\r\n @Input() placement: PlacementArray;\r\n\r\n /**\r\n * A selector specifying the element the dropdown should be appended to.\r\n * Currently only supports \"body\".\r\n *\r\n * @since 4.1.0\r\n */\r\n @Input() container: null | 'body';\r\n\r\n /**\r\n * Enable or disable the dynamic positioning. The default value is dynamic unless the dropdown is used\r\n * inside a Bootstrap navbar. If you need custom placement for a dropdown in a navbar, set it to\r\n * dynamic explicitly. See the [positioning of dropdown](#/positioning#dropdown)\r\n * and the [navbar demo](/#/components/dropdown/examples#navbar) for more details.\r\n *\r\n * @since 4.2.0\r\n */\r\n @Input() display: 'dynamic' | 'static';\r\n\r\n /**\r\n * An event fired when the dropdown is opened or closed.\r\n *\r\n * The event payload is a `boolean`:\r\n * * `true` - the dropdown was opened\r\n * * `false` - the dropdown was closed\r\n */\r\n @Output() openChange = new EventEmitter<boolean>();\r\n\r\n constructor(\r\n private _changeDetector: ChangeDetectorRef, config: NgbDropdownConfig, @Inject(DOCUMENT) private _document: any,\r\n private _ngZone: NgZone, private _elementRef: ElementRef<HTMLElement>, private _renderer: Renderer2,\r\n @Optional() ngbNavbar: NgbNavbar) {\r\n this.placement = config.placement;\r\n this.container = config.container;\r\n this.autoClose = config.autoClose;\r\n\r\n this.display = ngbNavbar ? 'static' : 'dynamic';\r\n\r\n this._zoneSubscription = _ngZone.onStable.subscribe(() => { this._positionMenu(); });\r\n }\r\n\r\n ngAfterContentInit() {\r\n this._ngZone.onStable.pipe(take(1)).subscribe(() => {\r\n this._applyPlacementClasses();\r\n if (this._open) {\r\n this._setCloseHandlers();\r\n }\r\n });\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes.container && this._open) {\r\n this._applyContainer(this.container);\r\n }\r\n\r\n if (changes.placement && !changes.placement.isFirstChange) {\r\n this._applyPlacementClasses();\r\n }\r\n\r\n if (changes.dropdownClass) {\r\n const {currentValue, previousValue} = changes.dropdownClass;\r\n this._applyCustomDropdownClass(currentValue, previousValue);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the dropdown menu is open.\r\n */\r\n isOpen(): boolean { return this._open; }\r\n\r\n /**\r\n * Opens the dropdown menu.\r\n */\r\n open(): void {\r\n if (!this._open) {\r\n this._open = true;\r\n this._applyContainer(this.container);\r\n this.openChange.emit(true);\r\n this._setCloseHandlers();\r\n if (this._anchor) {\r\n this._anchor.nativeElement.focus();\r\n }\r\n }\r\n }\r\n\r\n private _setCloseHandlers() {\r\n ngbAutoClose(\r\n this._ngZone, this._document, this.autoClose,\r\n (source: SOURCE) => {\r\n this.close();\r\n if (source === SOURCE.ESCAPE) {\r\n this._anchor.nativeElement.focus();\r\n }\r\n },\r\n this._closed$, this._menu ? [this._menu.nativeElement] : [], this._anchor ? [this._anchor.nativeElement] : [],\r\n '.dropdown-item,.dropdown-divider');\r\n }\r\n\r\n /**\r\n * Closes the dropdown menu.\r\n */\r\n close(): void {\r\n if (this._open) {\r\n this._open = false;\r\n this._resetContainer();\r\n this._closed$.next();\r\n this.openChange.emit(false);\r\n this._changeDetector.markForCheck();\r\n }\r\n }\r\n\r\n /**\r\n * Toggles the dropdown menu.\r\n */\r\n toggle(): void {\r\n if (this.isOpen()) {\r\n this.close();\r\n } else {\r\n this.open();\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this._resetContainer();\r\n\r\n this._closed$.next();\r\n this._zoneSubscription.unsubscribe();\r\n }\r\n\r\n onKeyDown(event: KeyboardEvent) {\r\n // tslint:disable-next-line:deprecation\r\n const key = event.which;\r\n const itemElements = this._getMenuElements();\r\n\r\n let position = -1;\r\n let itemElement: HTMLElement | null = null;\r\n const isEventFromToggle = this._isEventFromToggle(event);\r\n\r\n if (!isEventFromToggle && itemElements.length) {\r\n itemElements.forEach((item, index) => {\r\n if (item.contains(event.target as HTMLElement)) {\r\n itemElement = item;\r\n }\r\n if (item === this._document.activeElement) {\r\n position = index;\r\n }\r\n });\r\n }\r\n\r\n // closing on Enter / Space\r\n if (key === Key.Space || key === Key.Enter) {\r\n if (itemElement && (this.autoClose === true || this.autoClose === 'inside')) {\r\n // Item is either a button or a link, so click will be triggered by the browser on Enter or Space.\r\n // So we have to register a one-time click handler that will fire after any user defined click handlers\r\n // to close the dropdown\r\n fromEvent(itemElement, 'click').pipe(take(1)).subscribe(() => this.close());\r\n }\r\n return;\r\n }\r\n\r\n if (key === Key.Tab) {\r\n if (event.target && this.isOpen() && this.autoClose) {\r\n if (this._anchor.nativeElement === event.target) {\r\n if (this.container === 'body' && !event.shiftKey) {\r\n /* This case is special: user is using [Tab] from the anchor/toggle.\r\n User expects the next focusable element in the dropdown menu to get focus.\r\n But the menu is not a sibling to anchor/toggle, it is at the end of the body.\r\n Trick is to synchronously focus the menu element, and let the [keydown.Tab] go\r\n so that browser will focus the proper element (first one focusable in the menu) */\r\n this._renderer.setAttribute(this._menu.nativeElement, 'tabindex', '0');\r\n this._menu.nativeElement.focus();\r\n this._renderer.removeAttribute(this._menu.nativeElement, 'tabindex');\r\n } else if (event.shiftKey) {\r\n this.close();\r\n }\r\n return;\r\n } else if (this.container === 'body') {\r\n const focusableElements = this._menu.nativeElement.querySelectorAll(FOCUSABLE_ELEMENTS_SELECTOR);\r\n if (event.shiftKey && event.target === focusableElements[0]) {\r\n this._anchor.nativeElement.focus();\r\n event.preventDefault();\r\n } else if (!event.shiftKey && event.target === focusableElements[focusableElements.length - 1]) {\r\n this._anchor.nativeElement.focus();\r\n this.close();\r\n }\r\n } else {\r\n fromEvent<FocusEvent>(event.target as HTMLElement, 'focusout').pipe(take(1)).subscribe(({relatedTarget}) => {\r\n if (!this._elementRef.nativeElement.contains(relatedTarget as HTMLElement)) {\r\n this.close();\r\n }\r\n });\r\n }\r\n }\r\n return;\r\n }\r\n\r\n // opening / navigating\r\n if (isEventFromToggle || itemElement) {\r\n this.open();\r\n\r\n if (itemElements.length) {\r\n switch (key) {\r\n case Key.ArrowDown:\r\n position = Math.min(position + 1, itemElements.length - 1);\r\n break;\r\n case Key.ArrowUp:\r\n if (this._isDropup() && position === -1) {\r\n position = itemElements.length - 1;\r\n break;\r\n }\r\n position = Math.max(position - 1, 0);\r\n break;\r\n case Key.Home:\r\n position = 0;\r\n break;\r\n case Key.End:\r\n position = itemElements.length - 1;\r\n break;\r\n }\r\n itemElements[position].focus();\r\n }\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n private _isDropup(): boolean { return this._elementRef.nativeElement.classList.contains('dropup'); }\r\n\r\n private _isEventFromToggle(event: KeyboardEvent) {\r\n return this._anchor.nativeElement.contains(event.target as HTMLElement);\r\n }\r\n\r\n private _getMenuElements(): HTMLElement[] {\r\n const menu = this._menu;\r\n if (menu == null) {\r\n return [];\r\n }\r\n return menu.menuItems.filter(item => !item.disabled).map(item => item.elementRef.nativeElement);\r\n }\r\n\r\n private _positionMenu() {\r\n const menu = this._menu;\r\n if (this.isOpen() && menu) {\r\n this._applyPlacementClasses(\r\n this.display === 'dynamic' ? positionElements(\r\n this._anchor.nativeElement, this._bodyContainer || this._menu.nativeElement,\r\n this.placement, this.container === 'body') :\r\n this._getFirstPlacement(this.placement));\r\n }\r\n }\r\n\r\n private _getFirstPlacement(placement: PlacementArray): Placement {\r\n return Array.isArray(placement) ? placement[0] : placement.split(' ')[0] as Placement;\r\n }\r\n\r\n private _resetContainer() {\r\n const renderer = this._renderer;\r\n if (this._menu) {\r\n const dropdownElement = this._elementRef.nativeElement;\r\n const dropdownMenuElement = this._menu.nativeElement;\r\n\r\n renderer.appendChild(dropdownElement, dropdownMenuElement);\r\n renderer.removeStyle(dropdownMenuElement, 'position');\r\n renderer.removeStyle(dropdownMenuElement, 'transform');\r\n }\r\n if (this._bodyContainer) {\r\n renderer.removeChild(this._document.body, this._bodyContainer);\r\n this._bodyContainer = null;\r\n }\r\n }\r\n\r\n private _applyContainer(container: null | 'body' = null) {\r\n this._resetContainer();\r\n if (container === 'body') {\r\n const renderer = this._renderer;\r\n const dropdownMenuElement = this._menu.nativeElement;\r\n const bodyContainer = this._bodyContainer = this._bodyContainer || renderer.createElement('div');\r\n\r\n // Override some styles to have the positioning working\r\n renderer.setStyle(bodyContainer, 'position', 'absolute');\r\n renderer.setStyle(dropdownMenuElement, 'position', 'static');\r\n renderer.setStyle(bodyContainer, 'z-index', '1050');\r\n\r\n renderer.appendChild(bodyContainer, dropdownMenuElement);\r\n renderer.appendChild(this._document.body, bodyContainer);\r\n }\r\n\r\n this._applyCustomDropdownClass(this.dropdownClass);\r\n }\r\n\r\n private _applyCustomDropdownClass(newClass: string, oldClass?: string) {\r\n const targetElement = this.container === 'body' ? this._bodyContainer : this._elementRef.nativeElement;\r\n if (targetElement) {\r\n if (oldClass) {\r\n this._renderer.removeClass(targetElement, oldClass);\r\n }\r\n if (newClass) {\r\n this._renderer.addClass(targetElement, newClass);\r\n }\r\n }\r\n }\r\n\r\n private _applyPlacementClasses(placement?: Placement | null) {\r\n const menu = this._menu;\r\n if (menu) {\r\n if (!placement) {\r\n placement = this._getFirstPlacement(this.placement);\r\n }\r\n\r\n const renderer = this._renderer;\r\n const dropdownElement = this._elementRef.nativeElement;\r\n\r\n // remove the current placement classes\r\n renderer.removeClass(dropdownElement, 'dropup');\r\n renderer.removeClass(dropdownElement, 'dropdown');\r\n menu.placement = this.display === 'static' ? null : placement;\r\n\r\n /*\r\n * apply the new placement\r\n * in case of top use up-arrow or down-arrow otherwise\r\n */\r\n const dropdownClass = placement.search('^top') !== -1 ? 'dropup' : 'dropdown';\r\n renderer.addClass(dropdownElement, dropdownClass);\r\n\r\n const bodyContainer = this._bodyContainer;\r\n if (bodyContainer) {\r\n renderer.removeClass(bodyContainer, 'dropup');\r\n renderer.removeClass(bodyContainer, 'dropdown');\r\n renderer.addClass(bodyContainer, dropdownClass);\r\n }\r\n }\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {\r\n NgbDropdown,\r\n NgbDropdownAnchor,\r\n NgbDropdownToggle,\r\n NgbDropdownMenu,\r\n NgbDropdownItem,\r\n NgbNavbar\r\n} from './dropdown';\r\n\r\nexport {\r\n NgbDropdown,\r\n NgbDropdownAnchor,\r\n NgbDropdownToggle,\r\n NgbDropdownMenu,\r\n NgbDropdownItem,\r\n NgbNavbar\r\n} from './dropdown';\r\nexport {NgbDropdownConfig} from './dropdown-config';\r\n\r\nconst NGB_DROPDOWN_DIRECTIVES =\r\n [NgbDropdown, NgbDropdownAnchor, NgbDropdownToggle, NgbDropdownMenu, NgbDropdownItem, NgbNavbar];\r\n\r\n@NgModule({declarations: NGB_DROPDOWN_DIRECTIVES, exports: NGB_DROPDOWN_DIRECTIVES})\r\nexport class NgbDropdownModule {\r\n}\r\n","import {Injectable, Injector} from '@angular/core';\r\nimport {NgbConfig} from '../ngb-config';\r\n\r\n/**\r\n * Options available when opening new modal windows with `NgbModal.open()` method.\r\n */\r\nexport interface NgbModalOptions {\r\n /**\r\n * If `true`, modal opening and closing will be animated.\r\n *\r\n * @since 8.0.0\r\n */\r\n animation?: boolean;\r\n\r\n /**\r\n * `aria-labelledby` attribute value to set on the modal window.\r\n *\r\n * @since 2.2.0\r\n */\r\n ariaLabelledBy?: string;\r\n\r\n /**\r\n * `aria-describedby` attribute value to set on the modal window.\r\n *\r\n * @since 6.1.0\r\n */\r\n ariaDescribedBy?: string;\r\n\r\n /**\r\n * If `true`, the backdrop element will be created for a given modal.\r\n *\r\n * Alternatively, specify `'static'` for a backdrop which doesn't close the modal on click.\r\n *\r\n * Default value is `true`.\r\n */\r\n backdrop?: boolean | 'static';\r\n\r\n /**\r\n * Callback right before the modal will be dismissed.\r\n *\r\n * If this function returns:\r\n * * `false`\r\n * * a promise resolved with `false`\r\n * * a promise that is rejected\r\n *\r\n * then the modal won't be dismissed.\r\n */\r\n beforeDismiss?: () => boolean | Promise<boolean>;\r\n\r\n /**\r\n * If `true`, the modal will be centered vertically.\r\n *\r\n * Default value is `false`.\r\n *\r\n * @since 1.1.0\r\n */\r\n centered?: boolean;\r\n\r\n /**\r\n * A selector specifying the element all new modal windows should be appended to.\r\n * Since v5.3.0 it is also possible to pass the reference to an `HTMLElement`.\r\n *\r\n * If not specified, will be `body`.\r\n */\r\n container?: string | HTMLElement;\r\n\r\n /**\r\n * The `Injector` to use for modal content.\r\n */\r\n injector?: Injector;\r\n\r\n /**\r\n * If `true`, the modal will be closed when `Escape` key is pressed\r\n *\r\n * Default value is `true`.\r\n */\r\n keyboard?: boolean;\r\n\r\n /**\r\n * Scrollable modal content (false by default).\r\n *\r\n * @since 5.0.0\r\n */\r\n scrollable?: boolean;\r\n\r\n /**\r\n * Size of a new modal window.\r\n */\r\n size?: 'sm' | 'lg' | 'xl' | string;\r\n\r\n /**\r\n * A custom class to append to the modal window.\r\n */\r\n windowClass?: string;\r\n\r\n /**\r\n * A custom class to append to the modal dialog.\r\n *\r\n * @since 9.1.0\r\n */\r\n modalDialogClass?: string;\r\n\r\n /**\r\n * A custom class to append to the modal backdrop.\r\n *\r\n * @since 1.1.0\r\n */\r\n backdropClass?: string;\r\n}\r\n\r\n/**\r\n * A configuration service for the [`NgbModal`](#/components/modal/api#NgbModal) service.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all modals used in the application.\r\n*\r\n* @since 3.1.0\r\n*/\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbModalConfig implements Required<NgbModalOptions> {\r\n ariaLabelledBy: string;\r\n ariaDescribedBy: string;\r\n backdrop: boolean | 'static' = true;\r\n beforeDismiss: () => boolean | Promise<boolean>;\r\n centered: boolean;\r\n container: string;\r\n injector: Injector;\r\n keyboard = true;\r\n scrollable: boolean;\r\n size: 'sm' | 'lg' | 'xl' | string;\r\n windowClass: string;\r\n modalDialogClass: string;\r\n backdropClass: string;\r\n\r\n private _animation: boolean;\r\n\r\n constructor(private _ngbConfig: NgbConfig) {}\r\n\r\n get animation(): boolean { return (this._animation === undefined) ? this._ngbConfig.animation : this._animation; }\r\n set animation(animation: boolean) { this._animation = animation; }\r\n}\r\n","import {\r\n ApplicationRef,\r\n ComponentFactoryResolver,\r\n ComponentRef,\r\n Injector,\r\n NgZone,\r\n Renderer2,\r\n TemplateRef,\r\n ViewContainerRef,\r\n ViewRef\r\n} from '@angular/core';\r\n\r\nimport {Observable, of} from 'rxjs';\r\nimport {mergeMap, take, tap} from 'rxjs/operators';\r\n\r\nimport {ngbRunTransition} from './transition/ngbTransition';\r\n\r\nexport class ContentRef {\r\n constructor(public nodes: any[], public viewRef?: ViewRef, public componentRef?: ComponentRef<any>) {}\r\n}\r\n\r\nexport class PopupService<T> {\r\n private _windowRef: ComponentRef<T>| null = null;\r\n private _contentRef: ContentRef | null = null;\r\n\r\n constructor(\r\n private _type: any, private _injector: Injector, private _viewContainerRef: ViewContainerRef,\r\n private _renderer: Renderer2, private _ngZone: NgZone,\r\n private _componentFactoryResolver: ComponentFactoryResolver, private _applicationRef: ApplicationRef) {}\r\n\r\n open(content?: string | TemplateRef<any>, context?: any, animation = false):\r\n {windowRef: ComponentRef<T>, transition$: Observable<void>} {\r\n if (!this._windowRef) {\r\n this._contentRef = this._getContentRef(content, context);\r\n this._windowRef = this._viewContainerRef.createComponent(\r\n this._componentFactoryResolver.resolveComponentFactory<T>(this._type), this._viewContainerRef.length,\r\n this._injector, this._contentRef.nodes);\r\n }\r\n\r\n const {nativeElement} = this._windowRef.location;\r\n const transition$ = this._ngZone.onStable.pipe(\r\n take(1), mergeMap(\r\n () => ngbRunTransition(\r\n this._ngZone, nativeElement, ({classList}) => classList.add('show'),\r\n {animation, runningTransition: 'continue'})));\r\n\r\n return {windowRef: this._windowRef, transition$};\r\n }\r\n\r\n close(animation = false): Observable<void> {\r\n if (!this._windowRef) {\r\n return of(undefined);\r\n }\r\n\r\n return ngbRunTransition(\r\n this._ngZone, this._windowRef.location.nativeElement, ({classList}) => classList.remove('show'),\r\n {animation, runningTransition: 'stop'})\r\n .pipe(tap(() => {\r\n if (this._windowRef) {\r\n // this is required because of the container='body' option\r\n this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView));\r\n this._windowRef = null;\r\n }\r\n if (this._contentRef?.viewRef) {\r\n this._applicationRef.detachView(this._contentRef.viewRef);\r\n this._contentRef.viewRef.destroy();\r\n this._contentRef = null;\r\n }\r\n }));\r\n }\r\n\r\n private _getContentRef(content?: string | TemplateRef<any>, context?: any): ContentRef {\r\n if (!content) {\r\n return new ContentRef([]);\r\n } else if (content instanceof TemplateRef) {\r\n const viewRef = content.createEmbeddedView(context);\r\n this._applicationRef.attachView(viewRef);\r\n return new ContentRef([viewRef.rootNodes], viewRef);\r\n } else {\r\n return new ContentRef([[this._renderer.createText(`${content}`)]]);\r\n }\r\n }\r\n}\r\n","import {Injectable, Inject} from '@angular/core';\r\nimport {DOCUMENT} from '@angular/common';\r\n\r\n\r\nconst noop = () => {};\r\n\r\n\r\n\r\n/** Type for the callback used to revert the scrollbar compensation. */\r\nexport type CompensationReverter = () => void;\r\n\r\n\r\n\r\n/**\r\n * Utility to handle the scrollbar.\r\n *\r\n * It allows to compensate the lack of a vertical scrollbar by adding an\r\n * equivalent padding on the right of the body, and to remove this compensation.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class ScrollBar {\r\n constructor(@Inject(DOCUMENT) private _document: any) {}\r\n\r\n /**\r\n * To be called right before a potential vertical scrollbar would be removed:\r\n *\r\n * - if there was a scrollbar, adds some compensation padding to the body\r\n * to keep the same layout as when the scrollbar is there\r\n * - if there was none, there is nothing to do\r\n *\r\n * @return a callback used to revert the compensation (noop if there was none,\r\n * otherwise a function removing the padding)\r\n */\r\n compensate(): CompensationReverter {\r\n const width = this._getWidth();\r\n return !this._isPresent(width) ? noop : this._adjustBody(width);\r\n }\r\n\r\n /**\r\n * Adds a padding of the given width on the right of the body.\r\n *\r\n * @return a callback used to revert the padding to its previous value\r\n */\r\n private _adjustBody(scrollbarWidth: number): CompensationReverter {\r\n const body = this._document.body;\r\n const userSetPaddingStyle = body.style.paddingRight;\r\n const actualPadding = parseFloat(window.getComputedStyle(body)['padding-right']);\r\n body.style['padding-right'] = `${actualPadding + scrollbarWidth}px`;\r\n return () => body.style['padding-right'] = userSetPaddingStyle;\r\n }\r\n\r\n /**\r\n * Tells whether a scrollbar is currently present on the body.\r\n *\r\n * @return true if scrollbar is present, false otherwise\r\n */\r\n private _isPresent(scrollbarWidth: number): boolean {\r\n const rect = this._document.body.getBoundingClientRect();\r\n const bodyToViewportGap = window.innerWidth - (rect.left + rect.right);\r\n const uncertainty = 0.1 * scrollbarWidth;\r\n return bodyToViewportGap >= scrollbarWidth - uncertainty;\r\n }\r\n\r\n /**\r\n * Calculates and returns the width of a scrollbar.\r\n *\r\n * @return the width of a scrollbar on this page\r\n */\r\n private _getWidth(): number {\r\n const measurer = this._document.createElement('div');\r\n measurer.className = 'modal-scrollbar-measure';\r\n\r\n const body = this._document.body;\r\n body.appendChild(measurer);\r\n const width = measurer.getBoundingClientRect().width - measurer.clientWidth;\r\n body.removeChild(measurer);\r\n\r\n return width;\r\n }\r\n}\r\n","import {Component, ElementRef, Input, NgZone, OnInit, ViewEncapsulation} from '@angular/core';\r\n\r\nimport {Observable} from 'rxjs';\r\nimport {take} from 'rxjs/operators';\r\n\r\nimport {ngbRunTransition} from '../util/transition/ngbTransition';\r\nimport {reflow} from '../util/util';\r\n\r\n@Component({\r\n selector: 'ngb-modal-backdrop',\r\n encapsulation: ViewEncapsulation.None,\r\n template: '',\r\n host: {\r\n '[class]': '\"modal-backdrop\" + (backdropClass ? \" \" + backdropClass : \"\")',\r\n '[class.show]': '!animation',\r\n '[class.fade]': 'animation',\r\n 'style': 'z-index: 1050'\r\n }\r\n})\r\nexport class NgbModalBackdrop implements OnInit {\r\n @Input() animation: boolean;\r\n @Input() backdropClass: string;\r\n\r\n constructor(private _el: ElementRef<HTMLElement>, private _zone: NgZone) {}\r\n\r\n ngOnInit() {\r\n this._zone.onStable.asObservable().pipe(take(1)).subscribe(() => {\r\n ngbRunTransition(this._zone, this._el.nativeElement, (element: HTMLElement, animation: boolean) => {\r\n if (animation) {\r\n reflow(element);\r\n }\r\n element.classList.add('show');\r\n }, {animation: this.animation, runningTransition: 'continue'});\r\n });\r\n }\r\n\r\n hide(): Observable<void> {\r\n return ngbRunTransition(\r\n this._zone, this._el.nativeElement, ({classList}) => classList.remove('show'),\r\n {animation: this.animation, runningTransition: 'stop'});\r\n }\r\n}\r\n","import {ComponentRef} from '@angular/core';\r\n\r\nimport {Observable, of, Subject, zip} from 'rxjs';\r\nimport {takeUntil} from 'rxjs/operators';\r\n\r\nimport {NgbModalBackdrop} from './modal-backdrop';\r\nimport {NgbModalWindow} from './modal-window';\r\n\r\nimport {ContentRef} from '../util/popup';\r\n\r\n/**\r\n * A reference to the currently opened (active) modal.\r\n *\r\n * Instances of this class can be injected into your component passed as modal content.\r\n * So you can `.close()` or `.dismiss()` the modal window from your component.\r\n */\r\nexport class NgbActiveModal {\r\n /**\r\n * Closes the modal with an optional `result` value.\r\n *\r\n * The `NgbModalRef.result` promise will be resolved with the provided value.\r\n */\r\n close(result?: any): void {}\r\n\r\n /**\r\n * Dismisses the modal with an optional `reason` value.\r\n *\r\n * The `NgbModalRef.result` promise will be rejected with the provided value.\r\n */\r\n dismiss(reason?: any): void {}\r\n}\r\n\r\n/**\r\n * A reference to the newly opened modal returned by the `NgbModal.open()` method.\r\n */\r\nexport class NgbModalRef {\r\n private _closed = new Subject<any>();\r\n private _dismissed = new Subject<any>();\r\n private _hidden = new Subject<void>();\r\n private _resolve: (result?: any) => void;\r\n private _reject: (reason?: any) => void;\r\n\r\n /**\r\n * The instance of a component used for the modal content.\r\n *\r\n * When a `TemplateRef` is used as the content or when the modal is closed, will return `undefined`.\r\n */\r\n get componentInstance(): any {\r\n if (this._contentRef && this._contentRef.componentRef) {\r\n return this._contentRef.componentRef.instance;\r\n }\r\n }\r\n\r\n /**\r\n * The promise that is resolved when the modal is closed and rejected when the modal is dismissed.\r\n */\r\n result: Promise<any>;\r\n\r\n /**\r\n * The observable that emits when the modal is closed via the `.close()` method.\r\n *\r\n * It will emit the result passed to the `.close()` method.\r\n *\r\n * @since 8.0.0\r\n */\r\n get closed(): Observable<any> { return this._closed.asObservable().pipe(takeUntil(this._hidden)); }\r\n\r\n /**\r\n * The observable that emits when the modal is dismissed via the `.dismiss()` method.\r\n *\r\n * It will emit the reason passed to the `.dismissed()` method by the user, or one of the internal\r\n * reasons like backdrop click or ESC key press.\r\n *\r\n * @since 8.0.0\r\n */\r\n get dismissed(): Observable<any> { return this._dismissed.asObservable().pipe(takeUntil(this._hidden)); }\r\n\r\n /**\r\n * The observable that emits when both modal window and backdrop are closed and animations were finished.\r\n * At this point modal and backdrop elements will be removed from the DOM tree.\r\n *\r\n * This observable will be completed after emitting.\r\n *\r\n * @since 8.0.0\r\n */\r\n get hidden(): Observable<void> { return this._hidden.asObservable(); }\r\n\r\n /**\r\n * The observable that emits when modal is fully visible and animation was finished.\r\n * Modal DOM element is always available synchronously after calling 'modal.open()' service.\r\n *\r\n * This observable will be completed after emitting.\r\n * It will not emit, if modal is closed before open animation is finished.\r\n *\r\n * @since 8.0.0\r\n */\r\n get shown(): Observable<void> { return this._windowCmptRef.instance.shown.asObservable(); }\r\n\r\n constructor(\r\n private _windowCmptRef: ComponentRef<NgbModalWindow>, private _contentRef: ContentRef,\r\n private _backdropCmptRef?: ComponentRef<NgbModalBackdrop>, private _beforeDismiss?: Function) {\r\n _windowCmptRef.instance.dismissEvent.subscribe((reason: any) => { this.dismiss(reason); });\r\n\r\n this.result = new Promise((resolve, reject) => {\r\n this._resolve = resolve;\r\n this._reject = reject;\r\n });\r\n this.result.then(null, () => {});\r\n }\r\n\r\n /**\r\n * Closes the modal with an optional `result` value.\r\n *\r\n * The `NgbMobalRef.result` promise will be resolved with the provided value.\r\n */\r\n close(result?: any): void {\r\n if (this._windowCmptRef) {\r\n this._closed.next(result);\r\n this._resolve(result);\r\n this._removeModalElements();\r\n }\r\n }\r\n\r\n private _dismiss(reason?: any) {\r\n this._dismissed.next(reason);\r\n this._reject(reason);\r\n this._removeModalElements();\r\n }\r\n\r\n /**\r\n * Dismisses the modal with an optional `reason` value.\r\n *\r\n * The `NgbModalRef.result` promise will be rejected with the provided value.\r\n */\r\n dismiss(reason?: any): void {\r\n if (this._windowCmptRef) {\r\n if (!this._beforeDismiss) {\r\n this._dismiss(reason);\r\n } else {\r\n const dismiss = this._beforeDismiss();\r\n if (dismiss && dismiss.then) {\r\n dismiss.then(\r\n result => {\r\n if (result !== false) {\r\n this._dismiss(reason);\r\n }\r\n },\r\n () => {});\r\n } else if (dismiss !== false) {\r\n this._dismiss(reason);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private _removeModalElements() {\r\n const windowTransition$ = this._windowCmptRef.instance.hide();\r\n const backdropTransition$ = this._backdropCmptRef ? this._backdropCmptRef.instance.hide() : of(undefined);\r\n\r\n // hiding window\r\n windowTransition$.subscribe(() => {\r\n const {nativeElement} = this._windowCmptRef.location;\r\n nativeElement.parentNode.removeChild(nativeElement);\r\n this._windowCmptRef.destroy();\r\n\r\n if (this._contentRef && this._contentRef.viewRef) {\r\n this._contentRef.viewRef.destroy();\r\n }\r\n\r\n this._windowCmptRef = <any>null;\r\n this._contentRef = <any>null;\r\n });\r\n\r\n // hiding backdrop\r\n backdropTransition$.subscribe(() => {\r\n if (this._backdropCmptRef) {\r\n const {nativeElement} = this._backdropCmptRef.location;\r\n nativeElement.parentNode.removeChild(nativeElement);\r\n this._backdropCmptRef.destroy();\r\n this._backdropCmptRef = <any>null;\r\n }\r\n });\r\n\r\n // all done\r\n zip(windowTransition$, backdropTransition$).subscribe(() => {\r\n this._hidden.next();\r\n this._hidden.complete();\r\n });\r\n }\r\n}\r\n","export enum ModalDismissReasons {\r\n BACKDROP_CLICK,\r\n ESC\r\n}\r\n","import {DOCUMENT} from '@angular/common';\r\nimport {\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n Inject,\r\n Input,\r\n NgZone,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n ViewEncapsulation\r\n} from '@angular/core';\r\n\r\nimport {fromEvent, Observable, Subject, zip} from 'rxjs';\r\nimport {filter, switchMap, take, takeUntil, tap} from 'rxjs/operators';\r\n\r\nimport {getFocusableBoundaryElements} from '../util/focus-trap';\r\nimport {Key} from '../util/key';\r\nimport {ModalDismissReasons} from './modal-dismiss-reasons';\r\nimport {ngbRunTransition, NgbTransitionOptions} from '../util/transition/ngbTransition';\r\nimport {reflow} from '../util/util';\r\n\r\n@Component({\r\n selector: 'ngb-modal-window',\r\n host: {\r\n '[class]': '\"modal d-block\" + (windowClass ? \" \" + windowClass : \"\")',\r\n '[class.fade]': 'animation',\r\n 'role': 'dialog',\r\n 'tabindex': '-1',\r\n '[attr.aria-modal]': 'true',\r\n '[attr.aria-labelledby]': 'ariaLabelledBy',\r\n '[attr.aria-describedby]': 'ariaDescribedBy'\r\n },\r\n template: `\r\n <div #dialog [class]=\"'modal-dialog' + (size ? ' modal-' + size : '') + (centered ? ' modal-dialog-centered' : '') +\r\n (scrollable ? ' modal-dialog-scrollable' : '') + (modalDialogClass ? ' ' + modalDialogClass : '')\" role=\"document\">\r\n <div class=\"modal-content\"><ng-content></ng-content></div>\r\n </div>\r\n `,\r\n encapsulation: ViewEncapsulation.None,\r\n styleUrls: ['./modal.scss']\r\n})\r\nexport class NgbModalWindow implements OnInit,\r\n OnDestroy {\r\n private _closed$ = new Subject<void>();\r\n private _elWithFocus: Element | null = null; // element that is focused prior to modal opening\r\n\r\n @ViewChild('dialog', {static: true}) private _dialogEl: ElementRef<HTMLElement>;\r\n\r\n @Input() animation: boolean;\r\n @Input() ariaLabelledBy: string;\r\n @Input() ariaDescribedBy: string;\r\n @Input() backdrop: boolean | string = true;\r\n @Input() centered: string;\r\n @Input() keyboard = true;\r\n @Input() scrollable: string;\r\n @Input() size: string;\r\n @Input() windowClass: string;\r\n @Input() modalDialogClass: string;\r\n\r\n @Output('dismiss') dismissEvent = new EventEmitter();\r\n\r\n shown = new Subject<void>();\r\n hidden = new Subject<void>();\r\n\r\n constructor(\r\n @Inject(DOCUMENT) private _document: any, private _elRef: ElementRef<HTMLElement>, private _zone: NgZone) {}\r\n\r\n dismiss(reason): void { this.dismissEvent.emit(reason); }\r\n\r\n ngOnInit() {\r\n this._elWithFocus = this._document.activeElement;\r\n this._zone.onStable.asObservable().pipe(take(1)).subscribe(() => { this._show(); });\r\n }\r\n\r\n ngOnDestroy() { this._disableEventHandling(); }\r\n\r\n hide(): Observable<any> {\r\n const {nativeElement} = this._elRef;\r\n const context: NgbTransitionOptions<any> = {animation: this.animation, runningTransition: 'stop'};\r\n\r\n const windowTransition$ =\r\n ngbRunTransition(this._zone, nativeElement, () => nativeElement.classList.remove('show'), context);\r\n const dialogTransition$ = ngbRunTransition(this._zone, this._dialogEl.nativeElement, () => {}, context);\r\n\r\n const transitions$ = zip(windowTransition$, dialogTransition$);\r\n transitions$.subscribe(() => {\r\n this.hidden.next();\r\n this.hidden.complete();\r\n });\r\n\r\n this._disableEventHandling();\r\n this._restoreFocus();\r\n\r\n return transitions$;\r\n }\r\n\r\n private _show() {\r\n const context: NgbTransitionOptions<any> = {animation: this.animation, runningTransition: 'continue'};\r\n\r\n const windowTransition$ =\r\n ngbRunTransition(this._zone, this._elRef.nativeElement, (element: HTMLElement, animation: boolean) => {\r\n if (animation) {\r\n reflow(element);\r\n }\r\n element.classList.add('show');\r\n }, context);\r\n const dialogTransition$ = ngbRunTransition(this._zone, this._dialogEl.nativeElement, () => {}, context);\r\n\r\n zip(windowTransition$, dialogTransition$).subscribe(() => {\r\n this.shown.next();\r\n this.shown.complete();\r\n });\r\n\r\n this._enableEventHandling();\r\n this._setFocus();\r\n }\r\n\r\n private _enableEventHandling() {\r\n const {nativeElement} = this._elRef;\r\n this._zone.runOutsideAngular(() => {\r\n fromEvent<KeyboardEvent>(nativeElement, 'keydown')\r\n .pipe(\r\n takeUntil(this._closed$),\r\n // tslint:disable-next-line:deprecation\r\n filter(e => e.which === Key.Escape))\r\n .subscribe(event => {\r\n if (this.keyboard) {\r\n requestAnimationFrame(() => {\r\n if (!event.defaultPrevented) {\r\n this._zone.run(() => this.dismiss(ModalDismissReasons.ESC));\r\n }\r\n });\r\n } else if (this.backdrop === 'static') {\r\n this._bumpBackdrop();\r\n }\r\n });\r\n\r\n // We're listening to 'mousedown' and 'mouseup' to prevent modal from closing when pressing the mouse\r\n // inside the modal dialog and releasing it outside\r\n let preventClose = false;\r\n fromEvent<MouseEvent>(this._dialogEl.nativeElement, 'mousedown')\r\n .pipe(\r\n takeUntil(this._closed$), tap(() => preventClose = false),\r\n switchMap(() => fromEvent<MouseEvent>(nativeElement, 'mouseup').pipe(takeUntil(this._closed$), take(1))),\r\n filter(({target}) => nativeElement === target))\r\n .subscribe(() => { preventClose = true; });\r\n\r\n // We're listening to 'click' to dismiss modal on modal window click, except when:\r\n // 1. clicking on modal dialog itself\r\n // 2. closing was prevented by mousedown/up handlers\r\n // 3. clicking on scrollbar when the viewport is too small and modal doesn't fit (click is not triggered at all)\r\n fromEvent<MouseEvent>(nativeElement, 'click').pipe(takeUntil(this._closed$)).subscribe(({target}) => {\r\n if (nativeElement === target) {\r\n if (this.backdrop === 'static') {\r\n this._bumpBackdrop();\r\n } else if (this.backdrop === true && !preventClose) {\r\n this._zone.run(() => this.dismiss(ModalDismissReasons.BACKDROP_CLICK));\r\n }\r\n }\r\n\r\n preventClose = false;\r\n });\r\n });\r\n }\r\n\r\n private _disableEventHandling() { this._closed$.next(); }\r\n\r\n private _setFocus() {\r\n const {nativeElement} = this._elRef;\r\n if (!nativeElement.contains(document.activeElement)) {\r\n const autoFocusable = nativeElement.querySelector(`[ngbAutofocus]`) as HTMLElement;\r\n const firstFocusable = getFocusableBoundaryElements(nativeElement)[0];\r\n\r\n const elementToFocus = autoFocusable || firstFocusable || nativeElement;\r\n elementToFocus.focus();\r\n }\r\n }\r\n\r\n private _restoreFocus() {\r\n const body = this._document.body;\r\n const elWithFocus = this._elWithFocus;\r\n\r\n let elementToFocus;\r\n if (elWithFocus && elWithFocus['focus'] && body.contains(elWithFocus)) {\r\n elementToFocus = elWithFocus;\r\n } else {\r\n elementToFocus = body;\r\n }\r\n this._zone.runOutsideAngular(() => {\r\n setTimeout(() => elementToFocus.focus());\r\n this._elWithFocus = null;\r\n });\r\n }\r\n\r\n private _bumpBackdrop() {\r\n if (this.backdrop === 'static') {\r\n ngbRunTransition(this._zone, this._elRef.nativeElement, ({classList}) => {\r\n classList.add('modal-static');\r\n return () => classList.remove('modal-static');\r\n }, {animation: this.animation, runningTransition: 'continue'});\r\n }\r\n }\r\n}\r\n","import {DOCUMENT} from '@angular/common';\r\nimport {\r\n ApplicationRef,\r\n ComponentFactoryResolver,\r\n ComponentRef,\r\n EventEmitter,\r\n Inject,\r\n Injectable,\r\n Injector,\r\n NgZone,\r\n RendererFactory2,\r\n TemplateRef\r\n} from '@angular/core';\r\nimport {Subject} from 'rxjs';\r\n\r\nimport {ngbFocusTrap} from '../util/focus-trap';\r\nimport {ContentRef} from '../util/popup';\r\nimport {ScrollBar} from '../util/scrollbar';\r\nimport {isDefined, isString} from '../util/util';\r\nimport {NgbModalBackdrop} from './modal-backdrop';\r\nimport {NgbModalOptions} from './modal-config';\r\nimport {NgbActiveModal, NgbModalRef} from './modal-ref';\r\nimport {NgbModalWindow} from './modal-window';\r\n\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbModalStack {\r\n private _activeWindowCmptHasChanged = new Subject();\r\n private _ariaHiddenValues: Map<Element, string | null> = new Map();\r\n private _backdropAttributes = ['animation', 'backdropClass'];\r\n private _modalRefs: NgbModalRef[] = [];\r\n private _windowAttributes = [\r\n 'animation', 'ariaLabelledBy', 'ariaDescribedBy', 'backdrop', 'centered', 'keyboard', 'scrollable', 'size',\r\n 'windowClass', 'modalDialogClass'\r\n ];\r\n private _windowCmpts: ComponentRef<NgbModalWindow>[] = [];\r\n private _activeInstances: EventEmitter<NgbModalRef[]> = new EventEmitter();\r\n\r\n constructor(\r\n private _applicationRef: ApplicationRef, private _injector: Injector, @Inject(DOCUMENT) private _document: any,\r\n private _scrollBar: ScrollBar, private _rendererFactory: RendererFactory2, private _ngZone: NgZone) {\r\n // Trap focus on active WindowCmpt\r\n this._activeWindowCmptHasChanged.subscribe(() => {\r\n if (this._windowCmpts.length) {\r\n const activeWindowCmpt = this._windowCmpts[this._windowCmpts.length - 1];\r\n ngbFocusTrap(this._ngZone, activeWindowCmpt.location.nativeElement, this._activeWindowCmptHasChanged);\r\n this._revertAriaHidden();\r\n this._setAriaHidden(activeWindowCmpt.location.nativeElement);\r\n }\r\n });\r\n }\r\n\r\n open(moduleCFR: ComponentFactoryResolver, contentInjector: Injector, content: any, options): NgbModalRef {\r\n const containerEl = options.container instanceof HTMLElement ? options.container : isDefined(options.container) ?\r\n this._document.querySelector(options.container) :\r\n this._document.body;\r\n const renderer = this._rendererFactory.createRenderer(null, null);\r\n\r\n const revertPaddingForScrollBar = this._scrollBar.compensate();\r\n const removeBodyClass = () => {\r\n if (!this._modalRefs.length) {\r\n renderer.removeClass(this._document.body, 'modal-open');\r\n this._revertAriaHidden();\r\n }\r\n };\r\n\r\n if (!containerEl) {\r\n throw new Error(`The specified modal container \"${options.container || 'body'}\" was not found in the DOM.`);\r\n }\r\n\r\n const activeModal = new NgbActiveModal();\r\n const contentRef =\r\n this._getContentRef(moduleCFR, options.injector || contentInjector, content, activeModal, options);\r\n\r\n let backdropCmptRef: ComponentRef<NgbModalBackdrop>| undefined =\r\n options.backdrop !== false ? this._attachBackdrop(moduleCFR, containerEl) : undefined;\r\n let windowCmptRef: ComponentRef<NgbModalWindow> = this._attachWindowComponent(moduleCFR, containerEl, contentRef);\r\n let ngbModalRef: NgbModalRef = new NgbModalRef(windowCmptRef, contentRef, backdropCmptRef, options.beforeDismiss);\r\n\r\n this._registerModalRef(ngbModalRef);\r\n this._registerWindowCmpt(windowCmptRef);\r\n ngbModalRef.result.then(revertPaddingForScrollBar, revertPaddingForScrollBar);\r\n ngbModalRef.result.then(removeBodyClass, removeBodyClass);\r\n activeModal.close = (result: any) => { ngbModalRef.close(result); };\r\n activeModal.dismiss = (reason: any) => { ngbModalRef.dismiss(reason); };\r\n\r\n this._applyWindowOptions(windowCmptRef.instance, options);\r\n if (this._modalRefs.length === 1) {\r\n renderer.addClass(this._document.body, 'modal-open');\r\n }\r\n\r\n if (backdropCmptRef && backdropCmptRef.instance) {\r\n this._applyBackdropOptions(backdropCmptRef.instance, options);\r\n backdropCmptRef.changeDetectorRef.detectChanges();\r\n }\r\n windowCmptRef.changeDetectorRef.detectChanges();\r\n return ngbModalRef;\r\n }\r\n\r\n get activeInstances() { return this._activeInstances; }\r\n\r\n dismissAll(reason?: any) { this._modalRefs.forEach(ngbModalRef => ngbModalRef.dismiss(reason)); }\r\n\r\n hasOpenModals(): boolean { return this._modalRefs.length > 0; }\r\n\r\n private _attachBackdrop(moduleCFR: ComponentFactoryResolver, containerEl: any): ComponentRef<NgbModalBackdrop> {\r\n let backdropFactory = moduleCFR.resolveComponentFactory(NgbModalBackdrop);\r\n let backdropCmptRef = backdropFactory.create(this._injector);\r\n this._applicationRef.attachView(backdropCmptRef.hostView);\r\n containerEl.appendChild(backdropCmptRef.location.nativeElement);\r\n return backdropCmptRef;\r\n }\r\n\r\n private _attachWindowComponent(moduleCFR: ComponentFactoryResolver, containerEl: any, contentRef: any):\r\n ComponentRef<NgbModalWindow> {\r\n let windowFactory = moduleCFR.resolveComponentFactory(NgbModalWindow);\r\n let windowCmptRef = windowFactory.create(this._injector, contentRef.nodes);\r\n this._applicationRef.attachView(windowCmptRef.hostView);\r\n containerEl.appendChild(windowCmptRef.location.nativeElement);\r\n return windowCmptRef;\r\n }\r\n\r\n private _applyWindowOptions(windowInstance: NgbModalWindow, options: Object): void {\r\n this._windowAttributes.forEach((optionName: string) => {\r\n if (isDefined(options[optionName])) {\r\n windowInstance[optionName] = options[optionName];\r\n }\r\n });\r\n }\r\n\r\n private _applyBackdropOptions(backdropInstance: NgbModalBackdrop, options: Object): void {\r\n this._backdropAttributes.forEach((optionName: string) => {\r\n if (isDefined(options[optionName])) {\r\n backdropInstance[optionName] = options[optionName];\r\n }\r\n });\r\n }\r\n\r\n private _getContentRef(\r\n moduleCFR: ComponentFactoryResolver, contentInjector: Injector, content: any, activeModal: NgbActiveModal,\r\n options: NgbModalOptions): ContentRef {\r\n if (!content) {\r\n return new ContentRef([]);\r\n } else if (content instanceof TemplateRef) {\r\n return this._createFromTemplateRef(content, activeModal);\r\n } else if (isString(content)) {\r\n return this._createFromString(content);\r\n } else {\r\n return this._createFromComponent(moduleCFR, contentInjector, content, activeModal, options);\r\n }\r\n }\r\n\r\n private _createFromTemplateRef(content: TemplateRef<any>, activeModal: NgbActiveModal): ContentRef {\r\n const context = {\r\n $implicit: activeModal,\r\n close(result) { activeModal.close(result); },\r\n dismiss(reason) { activeModal.dismiss(reason); }\r\n };\r\n const viewRef = content.createEmbeddedView(context);\r\n this._applicationRef.attachView(viewRef);\r\n return new ContentRef([viewRef.rootNodes], viewRef);\r\n }\r\n\r\n private _createFromString(content: string): ContentRef {\r\n const component = this._document.createTextNode(`${content}`);\r\n return new ContentRef([[component]]);\r\n }\r\n\r\n private _createFromComponent(\r\n moduleCFR: ComponentFactoryResolver, contentInjector: Injector, content: any, context: NgbActiveModal,\r\n options: NgbModalOptions): ContentRef {\r\n const contentCmptFactory = moduleCFR.resolveComponentFactory(content);\r\n const modalContentInjector =\r\n Injector.create({providers: [{provide: NgbActiveModal, useValue: context}], parent: contentInjector});\r\n const componentRef = contentCmptFactory.create(modalContentInjector);\r\n const componentNativeEl = componentRef.location.nativeElement;\r\n if (options.scrollable) {\r\n (componentNativeEl as HTMLElement).classList.add('component-host-scrollable');\r\n }\r\n this._applicationRef.attachView(componentRef.hostView);\r\n // FIXME: we should here get rid of the component nativeElement\r\n // and use `[Array.from(componentNativeEl.childNodes)]` instead and remove the above CSS class.\r\n return new ContentRef([[componentNativeEl]], componentRef.hostView, componentRef);\r\n }\r\n\r\n private _setAriaHidden(element: Element) {\r\n const parent = element.parentElement;\r\n if (parent && element !== this._document.body) {\r\n Array.from(parent.children).forEach(sibling => {\r\n if (sibling !== element && sibling.nodeName !== 'SCRIPT') {\r\n this._ariaHiddenValues.set(sibling, sibling.getAttribute('aria-hidden'));\r\n sibling.setAttribute('aria-hidden', 'true');\r\n }\r\n });\r\n\r\n this._setAriaHidden(parent);\r\n }\r\n }\r\n\r\n private _revertAriaHidden() {\r\n this._ariaHiddenValues.forEach((value, element) => {\r\n if (value) {\r\n element.setAttribute('aria-hidden', value);\r\n } else {\r\n element.removeAttribute('aria-hidden');\r\n }\r\n });\r\n this._ariaHiddenValues.clear();\r\n }\r\n\r\n private _registerModalRef(ngbModalRef: NgbModalRef) {\r\n const unregisterModalRef = () => {\r\n const index = this._modalRefs.indexOf(ngbModalRef);\r\n if (index > -1) {\r\n this._modalRefs.splice(index, 1);\r\n this._activeInstances.emit(this._modalRefs);\r\n }\r\n };\r\n this._modalRefs.push(ngbModalRef);\r\n this._activeInstances.emit(this._modalRefs);\r\n ngbModalRef.result.then(unregisterModalRef, unregisterModalRef);\r\n }\r\n\r\n private _registerWindowCmpt(ngbWindowCmpt: ComponentRef<NgbModalWindow>) {\r\n this._windowCmpts.push(ngbWindowCmpt);\r\n this._activeWindowCmptHasChanged.next();\r\n\r\n ngbWindowCmpt.onDestroy(() => {\r\n const index = this._windowCmpts.indexOf(ngbWindowCmpt);\r\n if (index > -1) {\r\n this._windowCmpts.splice(index, 1);\r\n this._activeWindowCmptHasChanged.next();\r\n }\r\n });\r\n }\r\n}\r\n","import {Injectable, Injector, ComponentFactoryResolver} from '@angular/core';\r\n\r\nimport {NgbModalOptions, NgbModalConfig} from './modal-config';\r\nimport {NgbModalRef} from './modal-ref';\r\nimport {NgbModalStack} from './modal-stack';\r\n\r\n/**\r\n * A service for opening modal windows.\r\n *\r\n * Creating a modal is straightforward: create a component or a template and pass it as an argument to\r\n * the `.open()` method.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbModal {\r\n constructor(\r\n private _moduleCFR: ComponentFactoryResolver, private _injector: Injector, private _modalStack: NgbModalStack,\r\n private _config: NgbModalConfig) {}\r\n\r\n /**\r\n * Opens a new modal window with the specified content and supplied options.\r\n *\r\n * Content can be provided as a `TemplateRef` or a component type. If you pass a component type as content,\r\n * then instances of those components can be injected with an instance of the `NgbActiveModal` class. You can then\r\n * use `NgbActiveModal` methods to close / dismiss modals from \"inside\" of your component.\r\n *\r\n * Also see the [`NgbModalOptions`](#/components/modal/api#NgbModalOptions) for the list of supported options.\r\n */\r\n open(content: any, options: NgbModalOptions = {}): NgbModalRef {\r\n const combinedOptions = {...this._config, animation: this._config.animation, ...options};\r\n return this._modalStack.open(this._moduleCFR, this._injector, content, combinedOptions);\r\n }\r\n\r\n /**\r\n * Returns an observable that holds the active modal instances.\r\n */\r\n get activeInstances() { return this._modalStack.activeInstances; }\r\n\r\n /**\r\n * Dismisses all currently displayed modal windows with the supplied reason.\r\n *\r\n * @since 3.1.0\r\n */\r\n dismissAll(reason?: any) { this._modalStack.dismissAll(reason); }\r\n\r\n /**\r\n * Indicates if there are currently any open modal windows in the application.\r\n *\r\n * @since 3.3.0\r\n */\r\n hasOpenModals(): boolean { return this._modalStack.hasOpenModals(); }\r\n}\r\n","import {NgModule} from '@angular/core';\r\n\r\nimport {NgbModal} from './modal';\r\nimport {NgbModalBackdrop} from './modal-backdrop';\r\nimport {NgbModalWindow} from './modal-window';\r\n\r\nexport {NgbModal} from './modal';\r\nexport {NgbModalConfig, NgbModalOptions} from './modal-config';\r\nexport {NgbModalRef, NgbActiveModal} from './modal-ref';\r\nexport {ModalDismissReasons} from './modal-dismiss-reasons';\r\n\r\n@NgModule({\r\n declarations: [NgbModalBackdrop, NgbModalWindow],\r\n entryComponents: [NgbModalBackdrop, NgbModalWindow],\r\n providers: [NgbModal]\r\n})\r\nexport class NgbModalModule {\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbConfig} from '../ngb-config';\r\n\r\n/**\r\n * A configuration service for the [`NgbNav`](#/components/nav/api#NgbNav) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the navs used in the application.\r\n *\r\n * @since 5.2.0\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbNavConfig {\r\n destroyOnHide = true;\r\n orientation: 'horizontal' | 'vertical' = 'horizontal';\r\n roles: 'tablist' | false = 'tablist';\r\n keyboard: boolean | 'changeWithArrows' = false;\r\n\r\n private _animation: boolean;\r\n\r\n constructor(private _ngbConfig: NgbConfig) {}\r\n\r\n get animation(): boolean { return (this._animation === undefined) ? this._ngbConfig.animation : this._animation; }\r\n set animation(animation: boolean) { this._animation = animation; }\r\n}\r\n","import {\r\n AfterContentChecked,\r\n AfterContentInit,\r\n Attribute,\r\n ChangeDetectorRef,\r\n ContentChildren,\r\n Directive,\r\n ElementRef,\r\n EventEmitter,\r\n forwardRef,\r\n Inject,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n QueryList,\r\n SimpleChanges,\r\n TemplateRef\r\n} from '@angular/core';\r\nimport {DOCUMENT} from '@angular/common';\r\n\r\nimport {Subject} from 'rxjs';\r\nimport {takeUntil} from 'rxjs/operators';\r\n\r\nimport {isDefined} from '../util/util';\r\nimport {NgbNavConfig} from './nav-config';\r\nimport {Key} from '../util/key';\r\n\r\nconst isValidNavId = (id: any) => isDefined(id) && id !== '';\r\n\r\nlet navCounter = 0;\r\n\r\n/**\r\n * Context passed to the nav content template.\r\n *\r\n * See [this demo](#/components/nav/examples#keep-content) as the example.\r\n *\r\n * @since 5.2.0\r\n */\r\nexport interface NgbNavContentContext {\r\n /**\r\n * If `true`, current nav content is visible and active\r\n */\r\n $implicit: boolean;\r\n}\r\n\r\n\r\n/**\r\n * This directive must be used to wrap content to be displayed in the nav.\r\n *\r\n * @since 5.2.0\r\n */\r\n@Directive({selector: 'ng-template[ngbNavContent]'})\r\nexport class NgbNavContent {\r\n constructor(public templateRef: TemplateRef<any>) {}\r\n}\r\n\r\n\r\n/**\r\n * The directive used to group nav link and related nav content. As well as set nav identifier and some options.\r\n *\r\n * @since 5.2.0\r\n */\r\n@Directive({selector: '[ngbNavItem]', exportAs: 'ngbNavItem', host: {'[class.nav-item]': 'true'}})\r\nexport class NgbNavItem implements AfterContentChecked, OnInit {\r\n private _nav: NgbNav;\r\n\r\n /**\r\n * If `true`, non-active current nav item content will be removed from DOM\r\n * Otherwise it will just be hidden\r\n */\r\n @Input() destroyOnHide;\r\n\r\n /**\r\n * If `true`, the current nav item is disabled and can't be toggled by user.\r\n *\r\n * Nevertheless disabled nav can be selected programmatically via the `.select()` method and the `[activeId]` binding.\r\n */\r\n @Input() disabled = false;\r\n\r\n /**\r\n * The id used for the DOM elements.\r\n * Must be unique inside the document in case you have multiple `ngbNav`s on the page.\r\n *\r\n * Autogenerated as `ngb-nav-XXX` if not provided.\r\n */\r\n @Input() domId: string;\r\n\r\n /**\r\n * The id used as a model for active nav.\r\n * It can be anything, but must be unique inside one `ngbNav`.\r\n *\r\n * The only limitation is that it is not possible to have the `''` (empty string) as id,\r\n * because ` ngbNavItem `, `ngbNavItem=''` and `[ngbNavItem]=\"''\"` are indistinguishable\r\n */\r\n @Input('ngbNavItem') _id: any;\r\n\r\n /**\r\n * An event emitted when the fade in transition is finished on the related nav content\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() shown = new EventEmitter<void>();\r\n\r\n /**\r\n * An event emitted when the fade out transition is finished on the related nav content\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() hidden = new EventEmitter<void>();\r\n\r\n contentTpl: NgbNavContent | null;\r\n\r\n @ContentChildren(NgbNavContent, {descendants: false}) contentTpls: QueryList<NgbNavContent>;\r\n\r\n constructor(@Inject(forwardRef(() => NgbNav)) nav, public elementRef: ElementRef<any>) {\r\n // TODO: cf https://github.com/angular/angular/issues/30106\r\n this._nav = nav;\r\n }\r\n\r\n ngAfterContentChecked() {\r\n // We are using @ContentChildren instead of @ContentChild as in the Angular version being used\r\n // only @ContentChildren allows us to specify the {descendants: false} option.\r\n // Without {descendants: false} we are hitting bugs described in:\r\n // https://github.com/ng-bootstrap/ng-bootstrap/issues/2240\r\n this.contentTpl = this.contentTpls.first;\r\n }\r\n\r\n ngOnInit() {\r\n if (!isDefined(this.domId)) {\r\n this.domId = `ngb-nav-${navCounter++}`;\r\n }\r\n }\r\n\r\n get active() { return this._nav.activeId === this.id; }\r\n\r\n get id() { return isValidNavId(this._id) ? this._id : this.domId; }\r\n\r\n get panelDomId() { return `${this.domId}-panel`; }\r\n\r\n isPanelInDom() {\r\n return (isDefined(this.destroyOnHide) ? !this.destroyOnHide : !this._nav.destroyOnHide) || this.active;\r\n }\r\n}\r\n\r\n\r\n/**\r\n * A nav directive that helps with implementing tabbed navigation components.\r\n *\r\n * @since 5.2.0\r\n */\r\n@Directive({\r\n selector: '[ngbNav]',\r\n exportAs: 'ngbNav',\r\n host: {\r\n '[class.nav]': 'true',\r\n '[class.flex-column]': `orientation === 'vertical'`,\r\n '[attr.aria-orientation]': `orientation === 'vertical' && roles === 'tablist' ? 'vertical' : undefined`,\r\n '[attr.role]': `role ? role : roles ? 'tablist' : undefined`,\r\n '(keydown.arrowLeft)': 'onKeyDown($event)',\r\n '(keydown.arrowRight)': 'onKeyDown($event)',\r\n '(keydown.arrowDown)': 'onKeyDown($event)',\r\n '(keydown.arrowUp)': 'onKeyDown($event)',\r\n '(keydown.Home)': 'onKeyDown($event)',\r\n '(keydown.End)': 'onKeyDown($event)'\r\n }\r\n})\r\nexport class NgbNav implements AfterContentInit,\r\n OnDestroy {\r\n static ngAcceptInputType_orientation: string;\r\n static ngAcceptInputType_roles: boolean | string;\r\n\r\n /**\r\n * The id of the nav that should be active\r\n *\r\n * You could also use the `.select()` method and the `(navChange)` event\r\n */\r\n @Input() activeId: any;\r\n\r\n /**\r\n * The event emitted after the active nav changes\r\n * The payload of the event is the newly active nav id\r\n *\r\n * If you want to prevent nav change, you should use `(navChange)` event\r\n */\r\n @Output() activeIdChange = new EventEmitter<any>();\r\n\r\n /**\r\n * If `true`, nav change will be animated.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Input() animation: boolean;\r\n\r\n /**\r\n * If `true`, non-active nav content will be removed from DOM\r\n * Otherwise it will just be hidden\r\n */\r\n @Input() destroyOnHide;\r\n\r\n /**\r\n * The orientation of navs.\r\n *\r\n * Using `vertical` will also add the `aria-orientation` attribute\r\n */\r\n @Input() orientation: 'horizontal' | 'vertical';\r\n\r\n /**\r\n * Role attribute generating strategy:\r\n * - `false` - no role attributes will be generated\r\n * - `'tablist'` - 'tablist', 'tab' and 'tabpanel' will be generated (default)\r\n */\r\n @Input() roles: 'tablist' | false;\r\n\r\n /**\r\n * Keyboard support for nav focus/selection using arrow keys.\r\n *\r\n * * `false` - no keyboard support.\r\n * * `true` - navs will be focused using keyboard arrow keys\r\n * * `'changeWithArrows'` - nav will be selected using keyboard arrow keys\r\n *\r\n * See the [list of available keyboard shortcuts](#/components/nav/overview#keyboard-shortcuts).\r\n *\r\n * @since 6.1.0\r\n */\r\n @Input() keyboard: boolean | 'changeWithArrows';\r\n\r\n /**\r\n * An event emitted when the fade in transition is finished for one of the items.\r\n *\r\n * Payload of the event is the nav id that was just shown.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() shown = new EventEmitter<any>();\r\n\r\n /**\r\n * An event emitted when the fade out transition is finished for one of the items.\r\n *\r\n * Payload of the event is the nav id that was just hidden.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() hidden = new EventEmitter<any>();\r\n\r\n @ContentChildren(NgbNavItem) items: QueryList<NgbNavItem>;\r\n @ContentChildren(forwardRef(() => NgbNavLink), {descendants: true}) links: QueryList<NgbNavLink>;\r\n\r\n destroy$ = new Subject<void>();\r\n navItemChange$ = new Subject<NgbNavItem | null>();\r\n\r\n constructor(\r\n @Attribute('role') public role: string, config: NgbNavConfig, private _cd: ChangeDetectorRef,\r\n @Inject(DOCUMENT) private _document: any) {\r\n this.animation = config.animation;\r\n this.destroyOnHide = config.destroyOnHide;\r\n this.orientation = config.orientation;\r\n this.roles = config.roles;\r\n this.keyboard = config.keyboard;\r\n }\r\n\r\n /**\r\n * The nav change event emitted right before the nav change happens on user click.\r\n *\r\n * This event won't be emitted if nav is changed programmatically via `[activeId]` or `.select()`.\r\n *\r\n * See [`NgbNavChangeEvent`](#/components/nav/api#NgbNavChangeEvent) for payload details.\r\n */\r\n @Output() navChange = new EventEmitter<NgbNavChangeEvent>();\r\n\r\n click(item: NgbNavItem) {\r\n if (!item.disabled) {\r\n this._updateActiveId(item.id);\r\n }\r\n }\r\n\r\n onKeyDown(event: KeyboardEvent) {\r\n if (this.roles !== 'tablist' || !this.keyboard) {\r\n return;\r\n }\r\n // tslint:disable-next-line: deprecation\r\n const key = event.which;\r\n const enabledLinks = this.links.filter(link => !link.navItem.disabled);\r\n const {length} = enabledLinks;\r\n\r\n let position = -1;\r\n\r\n enabledLinks.forEach((link, index) => {\r\n if (link.elRef.nativeElement === this._document.activeElement) {\r\n position = index;\r\n }\r\n });\r\n\r\n if (length) {\r\n switch (key) {\r\n case Key.ArrowLeft:\r\n if (this.orientation === 'vertical') {\r\n return;\r\n }\r\n position = (position - 1 + length) % length;\r\n break;\r\n case Key.ArrowRight:\r\n if (this.orientation === 'vertical') {\r\n return;\r\n }\r\n position = (position + 1) % length;\r\n break;\r\n case Key.ArrowDown:\r\n if (this.orientation === 'horizontal') {\r\n return;\r\n }\r\n position = (position + 1) % length;\r\n break;\r\n case Key.ArrowUp:\r\n if (this.orientation === 'horizontal') {\r\n return;\r\n }\r\n position = (position - 1 + length) % length;\r\n break;\r\n case Key.Home:\r\n position = 0;\r\n break;\r\n case Key.End:\r\n position = length - 1;\r\n break;\r\n }\r\n if (this.keyboard === 'changeWithArrows') {\r\n this.select(enabledLinks[position].navItem.id);\r\n }\r\n enabledLinks[position].elRef.nativeElement.focus();\r\n\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n /**\r\n * Selects the nav with the given id and shows its associated pane.\r\n * Any other nav that was previously selected becomes unselected and its associated pane is hidden.\r\n */\r\n select(id: any) { this._updateActiveId(id, false); }\r\n\r\n ngAfterContentInit() {\r\n if (!isDefined(this.activeId)) {\r\n const nextId = this.items.first ? this.items.first.id : null;\r\n if (isValidNavId(nextId)) {\r\n this._updateActiveId(nextId, false);\r\n this._cd.detectChanges();\r\n }\r\n }\r\n\r\n this.items.changes.pipe(takeUntil(this.destroy$)).subscribe(() => this._notifyItemChanged(this.activeId));\r\n }\r\n\r\n ngOnChanges({activeId}: SimpleChanges): void {\r\n if (activeId && !activeId.firstChange) {\r\n this._notifyItemChanged(activeId.currentValue);\r\n }\r\n }\r\n\r\n ngOnDestroy() { this.destroy$.next(); }\r\n\r\n private _updateActiveId(nextId: any, emitNavChange = true) {\r\n if (this.activeId !== nextId) {\r\n let defaultPrevented = false;\r\n\r\n if (emitNavChange) {\r\n this.navChange.emit({activeId: this.activeId, nextId, preventDefault: () => { defaultPrevented = true; }});\r\n }\r\n\r\n if (!defaultPrevented) {\r\n this.activeId = nextId;\r\n this.activeIdChange.emit(nextId);\r\n this._notifyItemChanged(nextId);\r\n }\r\n }\r\n }\r\n\r\n private _notifyItemChanged(nextItemId: any) { this.navItemChange$.next(this._getItemById(nextItemId)); }\r\n\r\n private _getItemById(itemId: any): NgbNavItem | null {\r\n return this.items && this.items.find(item => item.id === itemId) || null;\r\n }\r\n}\r\n\r\n\r\n/**\r\n * A directive to put on the nav link.\r\n *\r\n * @since 5.2.0\r\n */\r\n@Directive({\r\n selector: 'a[ngbNavLink]',\r\n host: {\r\n '[id]': 'navItem.domId',\r\n '[class.nav-link]': 'true',\r\n '[class.nav-item]': 'hasNavItemClass()',\r\n '[attr.role]': `role ? role : nav.roles ? 'tab' : undefined`,\r\n 'href': '',\r\n '[class.active]': 'navItem.active',\r\n '[class.disabled]': 'navItem.disabled',\r\n '[attr.tabindex]': 'navItem.disabled ? -1 : undefined',\r\n '[attr.aria-controls]': 'navItem.isPanelInDom() ? navItem.panelDomId : null',\r\n '[attr.aria-selected]': 'navItem.active',\r\n '[attr.aria-disabled]': 'navItem.disabled',\r\n '(click)': 'nav.click(navItem); $event.preventDefault()'\r\n }\r\n})\r\nexport class NgbNavLink {\r\n constructor(\r\n @Attribute('role') public role: string, public navItem: NgbNavItem, public nav: NgbNav,\r\n public elRef: ElementRef) {}\r\n\r\n hasNavItemClass() {\r\n // with alternative markup we have to add `.nav-item` class, because `ngbNavItem` is on the ng-container\r\n return this.navItem.elementRef.nativeElement.nodeType === Node.COMMENT_NODE;\r\n }\r\n}\r\n\r\n\r\n/**\r\n * The payload of the change event emitted right before the nav change happens on user click.\r\n *\r\n * This event won't be emitted if nav is changed programmatically via `[activeId]` or `.select()`.\r\n *\r\n * @since 5.2.0\r\n */\r\nexport interface NgbNavChangeEvent<T = any> {\r\n /**\r\n * Id of the currently active nav.\r\n */\r\n activeId: T;\r\n\r\n /**\r\n * Id of the newly selected nav.\r\n */\r\n nextId: T;\r\n\r\n /**\r\n * Function that will prevent nav change if called.\r\n */\r\n preventDefault: () => void;\r\n}\r\n","import {NgbTransitionStartFn} from '../util/transition/ngbTransition';\r\nimport {reflow} from '../util/util';\r\n\r\nexport const ngbNavFadeOutTransition: NgbTransitionStartFn = ({classList}) => {\r\n classList.remove('show');\r\n return () => classList.remove('active');\r\n};\r\n\r\nexport const ngbNavFadeInTransition: NgbTransitionStartFn = (element: HTMLElement, animation: boolean) => {\r\n if (animation) {\r\n reflow(element);\r\n }\r\n element.classList.add('show');\r\n};\r\n","import {\r\n AfterViewInit,\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n Directive,\r\n ElementRef,\r\n Input,\r\n NgZone,\r\n QueryList,\r\n ViewChildren,\r\n ViewEncapsulation\r\n} from '@angular/core';\r\nimport {distinctUntilChanged, skip, startWith, takeUntil} from 'rxjs/operators';\r\n\r\nimport {ngbNavFadeInTransition, ngbNavFadeOutTransition} from './nav-transition';\r\nimport {ngbRunTransition, NgbTransitionOptions} from '../util/transition/ngbTransition';\r\nimport {NgbNav, NgbNavItem} from './nav';\r\n\r\n@Directive({\r\n selector: '[ngbNavPane]',\r\n host: {\r\n '[id]': 'item.panelDomId',\r\n 'class': 'tab-pane',\r\n '[class.fade]': 'nav.animation',\r\n '[attr.role]': 'role ? role : nav.roles ? \"tabpanel\" : undefined',\r\n '[attr.aria-labelledby]': 'item.domId'\r\n }\r\n})\r\nexport class NgbNavPane {\r\n @Input() item: NgbNavItem;\r\n @Input() nav: NgbNav;\r\n @Input() role: string;\r\n\r\n constructor(public elRef: ElementRef<HTMLElement>) {}\r\n}\r\n\r\n/**\r\n * The outlet where currently active nav content will be displayed.\r\n *\r\n * @since 5.2.0\r\n */\r\n@Component({\r\n selector: '[ngbNavOutlet]',\r\n host: {'[class.tab-content]': 'true'},\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <ng-template ngFor let-item [ngForOf]=\"nav.items\">\r\n <div ngbNavPane *ngIf=\"item.isPanelInDom() || isPanelTransitioning(item)\" [item]=\"item\" [nav]=\"nav\" [role]=\"paneRole\">\r\n <ng-template [ngTemplateOutlet]=\"item.contentTpl?.templateRef || null\"\r\n [ngTemplateOutletContext]=\"{$implicit: item.active || isPanelTransitioning(item)}\"></ng-template>\r\n </div>\r\n </ng-template>\r\n `\r\n})\r\nexport class NgbNavOutlet implements AfterViewInit {\r\n private _activePane: NgbNavPane | null = null;\r\n\r\n @ViewChildren(NgbNavPane) private _panes: QueryList<NgbNavPane>;\r\n\r\n /**\r\n * A role to set on the nav pane\r\n */\r\n @Input() paneRole;\r\n\r\n /**\r\n * Reference to the `NgbNav`\r\n */\r\n @Input('ngbNavOutlet') nav: NgbNav;\r\n\r\n constructor(private _cd: ChangeDetectorRef, private _ngZone: NgZone) {}\r\n\r\n isPanelTransitioning(item: NgbNavItem) { return this._activePane ?.item === item; }\r\n\r\n ngAfterViewInit() {\r\n // initial display\r\n this._updateActivePane();\r\n\r\n // this will be emitted for all 3 types of nav changes: .select(), [activeId] or (click)\r\n this.nav.navItemChange$\r\n .pipe(takeUntil(this.nav.destroy$), startWith(this._activePane ?.item || null), distinctUntilChanged(), skip(1))\r\n .subscribe(nextItem => {\r\n const options: NgbTransitionOptions<undefined> = {animation: this.nav.animation, runningTransition: 'stop'};\r\n\r\n // next panel we're switching to will only appear in DOM after the change detection is done\r\n // and `this._panes` will be updated\r\n this._cd.detectChanges();\r\n\r\n // fading out\r\n if (this._activePane) {\r\n ngbRunTransition(this._ngZone, this._activePane.elRef.nativeElement, ngbNavFadeOutTransition, options)\r\n .subscribe(() => {\r\n const activeItem = this._activePane ?.item;\r\n this._activePane = this._getPaneForItem(nextItem);\r\n\r\n // mark for check when transition finishes as outlet or parent containers might be OnPush\r\n // without this the panes that have \"faded out\" will stay in DOM\r\n this._cd.markForCheck();\r\n\r\n // fading in\r\n if (this._activePane) {\r\n // we have to add the '.active' class before running the transition,\r\n // because it should be in place before `ngbRunTransition` does `reflow()`\r\n this._activePane.elRef.nativeElement.classList.add('active');\r\n ngbRunTransition(this._ngZone, this._activePane.elRef.nativeElement, ngbNavFadeInTransition, options)\r\n .subscribe(() => {\r\n if (nextItem) {\r\n nextItem.shown.emit();\r\n this.nav.shown.emit(nextItem.id);\r\n }\r\n });\r\n }\r\n\r\n if (activeItem) {\r\n activeItem.hidden.emit();\r\n this.nav.hidden.emit(activeItem.id);\r\n }\r\n });\r\n } else {\r\n this._updateActivePane();\r\n }\r\n });\r\n }\r\n\r\n private _updateActivePane() {\r\n this._activePane = this._getActivePane();\r\n this._activePane ?.elRef.nativeElement.classList.add('show');\r\n this._activePane ?.elRef.nativeElement.classList.add('active');\r\n }\r\n\r\n private _getPaneForItem(item: NgbNavItem | null) {\r\n return this._panes && this._panes.find(pane => pane.item === item) || null;\r\n }\r\n\r\n private _getActivePane(): NgbNavPane | null {\r\n return this._panes && this._panes.find(pane => pane.item.active) || null;\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport {NgbNav, NgbNavContent, NgbNavItem, NgbNavLink} from './nav';\r\nimport {NgbNavOutlet, NgbNavPane} from './nav-outlet';\r\n\r\nexport {NgbNav, NgbNavContent, NgbNavContentContext, NgbNavItem, NgbNavLink, NgbNavChangeEvent} from './nav';\r\nexport {NgbNavOutlet, NgbNavPane} from './nav-outlet';\r\nexport {NgbNavConfig} from './nav-config';\r\n\r\nconst NGB_NAV_DIRECTIVES = [NgbNavContent, NgbNav, NgbNavItem, NgbNavLink, NgbNavOutlet, NgbNavPane];\r\n\r\n@NgModule({declarations: NGB_NAV_DIRECTIVES, exports: NGB_NAV_DIRECTIVES, imports: [CommonModule]})\r\nexport class NgbNavModule {\r\n}\r\n","import {Injectable} from '@angular/core';\r\n\r\n/**\r\n * A configuration service for the [`NgbPagination`](#/components/pagination/api#NgbPagination) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the paginations used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbPaginationConfig {\r\n disabled = false;\r\n boundaryLinks = false;\r\n directionLinks = true;\r\n ellipses = true;\r\n maxSize = 0;\r\n pageSize = 10;\r\n rotate = false;\r\n size: 'sm' | 'lg';\r\n}\r\n","import {\r\n Component,\r\n ContentChild,\r\n Directive,\r\n EventEmitter,\r\n Input,\r\n Output,\r\n OnChanges,\r\n ChangeDetectionStrategy,\r\n SimpleChanges,\r\n TemplateRef\r\n} from '@angular/core';\r\nimport {getValueInRange, isNumber} from '../util/util';\r\nimport {NgbPaginationConfig} from './pagination-config';\r\n\r\n/**\r\n * A context for the\r\n * * `NgbPaginationFirst`\r\n * * `NgbPaginationPrevious`\r\n * * `NgbPaginationNext`\r\n * * `NgbPaginationLast`\r\n * * `NgbPaginationEllipsis`\r\n * * `NgbPaginationPages`\r\n *\r\n * link templates in case you want to override one.\r\n *\r\n * @since 4.1.0\r\n */\r\nexport interface NgbPaginationLinkContext {\r\n /**\r\n * Page number displayed by the current link.\r\n */\r\n currentPage: number;\r\n\r\n /**\r\n * If `true`, the current link is disabled.\r\n */\r\n disabled: boolean;\r\n}\r\n\r\n/**\r\n * A context for the `NgbPaginationNumber` link template in case you want to override one.\r\n *\r\n * Extends `NgbPaginationLinkContext`.\r\n *\r\n * @since 4.1.0\r\n */\r\nexport interface NgbPaginationNumberContext extends NgbPaginationLinkContext {\r\n /**\r\n * The page number, displayed by the current page link.\r\n */\r\n $implicit: number;\r\n}\r\n\r\n/**\r\n * A context for the `NgbPaginationPages` pages template in case you want to override\r\n * the way all pages are displayed.\r\n *\r\n * @since 9.1.0\r\n */\r\nexport interface NgbPaginationPagesContext {\r\n /**\r\n * The currently selected page number.\r\n */\r\n $implicit: number;\r\n\r\n /**\r\n * If `true`, pagination is disabled.\r\n */\r\n disabled: boolean;\r\n\r\n /**\r\n * Pages numbers that should be rendered starting with 1.\r\n */\r\n pages: number[];\r\n}\r\n\r\n/**\r\n * A directive to match the 'ellipsis' link template\r\n *\r\n * @since 4.1.0\r\n */\r\n@Directive({selector: 'ng-template[ngbPaginationEllipsis]'})\r\nexport class NgbPaginationEllipsis {\r\n constructor(public templateRef: TemplateRef<NgbPaginationLinkContext>) {}\r\n}\r\n\r\n/**\r\n * A directive to match the 'first' link template\r\n *\r\n * @since 4.1.0\r\n */\r\n@Directive({selector: 'ng-template[ngbPaginationFirst]'})\r\nexport class NgbPaginationFirst {\r\n constructor(public templateRef: TemplateRef<NgbPaginationLinkContext>) {}\r\n}\r\n\r\n/**\r\n * A directive to match the 'last' link template\r\n *\r\n * @since 4.1.0\r\n */\r\n@Directive({selector: 'ng-template[ngbPaginationLast]'})\r\nexport class NgbPaginationLast {\r\n constructor(public templateRef: TemplateRef<NgbPaginationLinkContext>) {}\r\n}\r\n\r\n/**\r\n * A directive to match the 'next' link template\r\n *\r\n * @since 4.1.0\r\n */\r\n@Directive({selector: 'ng-template[ngbPaginationNext]'})\r\nexport class NgbPaginationNext {\r\n constructor(public templateRef: TemplateRef<NgbPaginationLinkContext>) {}\r\n}\r\n\r\n/**\r\n * A directive to match the page 'number' link template\r\n *\r\n * @since 4.1.0\r\n */\r\n@Directive({selector: 'ng-template[ngbPaginationNumber]'})\r\nexport class NgbPaginationNumber {\r\n constructor(public templateRef: TemplateRef<NgbPaginationNumberContext>) {}\r\n}\r\n\r\n/**\r\n * A directive to match the 'previous' link template\r\n *\r\n * @since 4.1.0\r\n */\r\n@Directive({selector: 'ng-template[ngbPaginationPrevious]'})\r\nexport class NgbPaginationPrevious {\r\n constructor(public templateRef: TemplateRef<NgbPaginationLinkContext>) {}\r\n}\r\n\r\n/**\r\n * A directive to match the 'pages' whole content\r\n *\r\n * @since 9.1.0\r\n */\r\n@Directive({selector: 'ng-template[ngbPaginationPages]'})\r\nexport class NgbPaginationPages {\r\n constructor(public templateRef: TemplateRef<NgbPaginationPagesContext>) {}\r\n}\r\n\r\n/**\r\n * A component that displays page numbers and allows to customize them in several ways.\r\n */\r\n@Component({\r\n selector: 'ngb-pagination',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {'role': 'navigation'},\r\n template: `\r\n <ng-template #first><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.first\">&laquo;&laquo;</span></ng-template>\r\n <ng-template #previous><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.previous\">&laquo;</span></ng-template>\r\n <ng-template #next><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.next\">&raquo;</span></ng-template>\r\n <ng-template #last><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.last\">&raquo;&raquo;</span></ng-template>\r\n <ng-template #ellipsis>...</ng-template>\r\n <ng-template #defaultNumber let-page let-currentPage=\"currentPage\">\r\n {{ page }}\r\n <span *ngIf=\"page === currentPage\" class=\"sr-only\">(current)</span>\r\n </ng-template>\r\n <ng-template #defaultPages let-page let-pages=\"pages\" let-disabled=\"disabled\">\r\n <li *ngFor=\"let pageNumber of pages\" class=\"page-item\" [class.active]=\"pageNumber === page\"\r\n [class.disabled]=\"isEllipsis(pageNumber) || disabled\" [attr.aria-current]=\"(pageNumber === page ? 'page' : null)\">\r\n <a *ngIf=\"isEllipsis(pageNumber)\" class=\"page-link\" tabindex=\"-1\" aria-disabled=\"true\">\r\n <ng-template [ngTemplateOutlet]=\"tplEllipsis?.templateRef || ellipsis\"\r\n [ngTemplateOutletContext]=\"{disabled: true, currentPage: page}\"></ng-template>\r\n </a>\r\n <a *ngIf=\"!isEllipsis(pageNumber)\" class=\"page-link\" href (click)=\"selectPage(pageNumber); $event.preventDefault()\"\r\n [attr.tabindex]=\"disabled ? '-1' : null\" [attr.aria-disabled]=\"disabled ? 'true' : null\">\r\n <ng-template [ngTemplateOutlet]=\"tplNumber?.templateRef || defaultNumber\"\r\n [ngTemplateOutletContext]=\"{disabled: disabled, $implicit: pageNumber, currentPage: page}\"></ng-template>\r\n </a>\r\n </li>\r\n </ng-template>\r\n <ul [class]=\"'pagination' + (size ? ' pagination-' + size : '')\">\r\n <li *ngIf=\"boundaryLinks\" class=\"page-item\"\r\n [class.disabled]=\"previousDisabled()\">\r\n <a aria-label=\"First\" i18n-aria-label=\"@@ngb.pagination.first-aria\" class=\"page-link\" href\r\n (click)=\"selectPage(1); $event.preventDefault()\" [attr.tabindex]=\"previousDisabled() ? '-1' : null\"\r\n [attr.aria-disabled]=\"previousDisabled() ? 'true' : null\">\r\n <ng-template [ngTemplateOutlet]=\"tplFirst?.templateRef || first\"\r\n [ngTemplateOutletContext]=\"{disabled: previousDisabled(), currentPage: page}\"></ng-template>\r\n </a>\r\n </li>\r\n\r\n <li *ngIf=\"directionLinks\" class=\"page-item\"\r\n [class.disabled]=\"previousDisabled()\">\r\n <a aria-label=\"Previous\" i18n-aria-label=\"@@ngb.pagination.previous-aria\" class=\"page-link\" href\r\n (click)=\"selectPage(page-1); $event.preventDefault()\" [attr.tabindex]=\"previousDisabled() ? '-1' : null\"\r\n [attr.aria-disabled]=\"previousDisabled() ? 'true' : null\">\r\n <ng-template [ngTemplateOutlet]=\"tplPrevious?.templateRef || previous\"\r\n [ngTemplateOutletContext]=\"{disabled: previousDisabled()}\"></ng-template>\r\n </a>\r\n </li>\r\n <ng-template\r\n [ngTemplateOutlet]=\"tplPages?.templateRef || defaultPages\"\r\n [ngTemplateOutletContext]=\"{ $implicit: page, pages: pages, disabled: disabled }\"\r\n >\r\n </ng-template>\r\n <li *ngIf=\"directionLinks\" class=\"page-item\" [class.disabled]=\"nextDisabled()\">\r\n <a aria-label=\"Next\" i18n-aria-label=\"@@ngb.pagination.next-aria\" class=\"page-link\" href\r\n (click)=\"selectPage(page+1); $event.preventDefault()\" [attr.tabindex]=\"nextDisabled() ? '-1' : null\"\r\n [attr.aria-disabled]=\"nextDisabled() ? 'true' : null\">\r\n <ng-template [ngTemplateOutlet]=\"tplNext?.templateRef || next\"\r\n [ngTemplateOutletContext]=\"{disabled: nextDisabled(), currentPage: page}\"></ng-template>\r\n </a>\r\n </li>\r\n\r\n <li *ngIf=\"boundaryLinks\" class=\"page-item\" [class.disabled]=\"nextDisabled()\">\r\n <a aria-label=\"Last\" i18n-aria-label=\"@@ngb.pagination.last-aria\" class=\"page-link\" href\r\n (click)=\"selectPage(pageCount); $event.preventDefault()\" [attr.tabindex]=\"nextDisabled() ? '-1' : null\"\r\n [attr.aria-disabled]=\"nextDisabled() ? 'true' : null\">\r\n <ng-template [ngTemplateOutlet]=\"tplLast?.templateRef || last\"\r\n [ngTemplateOutletContext]=\"{disabled: nextDisabled(), currentPage: page}\"></ng-template>\r\n </a>\r\n </li>\r\n </ul>\r\n `\r\n})\r\nexport class NgbPagination implements OnChanges {\r\n pageCount = 0;\r\n pages: number[] = [];\r\n\r\n @ContentChild(NgbPaginationEllipsis, {static: false}) tplEllipsis: NgbPaginationEllipsis;\r\n @ContentChild(NgbPaginationFirst, {static: false}) tplFirst: NgbPaginationFirst;\r\n @ContentChild(NgbPaginationLast, {static: false}) tplLast: NgbPaginationLast;\r\n @ContentChild(NgbPaginationNext, {static: false}) tplNext: NgbPaginationNext;\r\n @ContentChild(NgbPaginationNumber, {static: false}) tplNumber: NgbPaginationNumber;\r\n @ContentChild(NgbPaginationPrevious, {static: false}) tplPrevious: NgbPaginationPrevious;\r\n @ContentChild(NgbPaginationPages, {static: false}) tplPages: NgbPaginationPages;\r\n\r\n /**\r\n * If `true`, pagination links will be disabled.\r\n */\r\n @Input() disabled: boolean;\r\n\r\n /**\r\n * If `true`, the \"First\" and \"Last\" page links are shown.\r\n */\r\n @Input() boundaryLinks: boolean;\r\n\r\n /**\r\n * If `true`, the \"Next\" and \"Previous\" page links are shown.\r\n */\r\n @Input() directionLinks: boolean;\r\n\r\n /**\r\n * If `true`, the ellipsis symbols and first/last page numbers will be shown when `maxSize` > number of pages.\r\n */\r\n @Input() ellipses: boolean;\r\n\r\n /**\r\n * Whether to rotate pages when `maxSize` > number of pages.\r\n *\r\n * The current page always stays in the middle if `true`.\r\n */\r\n @Input() rotate: boolean;\r\n\r\n /**\r\n * The number of items in your paginated collection.\r\n *\r\n * Note, that this is not the number of pages. Page numbers are calculated dynamically based on\r\n * `collectionSize` and `pageSize`. Ex. if you have 100 items in your collection and displaying 20 items per page,\r\n * you'll end up with 5 pages.\r\n */\r\n @Input() collectionSize: number;\r\n\r\n /**\r\n * The maximum number of pages to display.\r\n */\r\n @Input() maxSize: number;\r\n\r\n /**\r\n * The current page.\r\n *\r\n * Page numbers start with `1`.\r\n */\r\n @Input() page = 1;\r\n\r\n /**\r\n * The number of items per page.\r\n */\r\n @Input() pageSize: number;\r\n\r\n /**\r\n * An event fired when the page is changed. Will fire only if collection size is set and all values are valid.\r\n *\r\n * Event payload is the number of the newly selected page.\r\n *\r\n * Page numbers start with `1`.\r\n */\r\n @Output() pageChange = new EventEmitter<number>(true);\r\n\r\n /**\r\n * The pagination display size.\r\n *\r\n * Bootstrap currently supports small and large sizes.\r\n */\r\n @Input() size: 'sm' | 'lg';\r\n\r\n constructor(config: NgbPaginationConfig) {\r\n this.disabled = config.disabled;\r\n this.boundaryLinks = config.boundaryLinks;\r\n this.directionLinks = config.directionLinks;\r\n this.ellipses = config.ellipses;\r\n this.maxSize = config.maxSize;\r\n this.pageSize = config.pageSize;\r\n this.rotate = config.rotate;\r\n this.size = config.size;\r\n }\r\n\r\n hasPrevious(): boolean { return this.page > 1; }\r\n\r\n hasNext(): boolean { return this.page < this.pageCount; }\r\n\r\n nextDisabled(): boolean { return !this.hasNext() || this.disabled; }\r\n\r\n previousDisabled(): boolean { return !this.hasPrevious() || this.disabled; }\r\n\r\n selectPage(pageNumber: number): void { this._updatePages(pageNumber); }\r\n\r\n ngOnChanges(changes: SimpleChanges): void { this._updatePages(this.page); }\r\n\r\n isEllipsis(pageNumber): boolean { return pageNumber === -1; }\r\n\r\n /**\r\n * Appends ellipses and first/last page number to the displayed pages\r\n */\r\n private _applyEllipses(start: number, end: number) {\r\n if (this.ellipses) {\r\n if (start > 0) {\r\n // The first page will always be included. If the displayed range\r\n // starts after the third page, then add ellipsis. But if the range\r\n // starts on the third page, then add the second page instead of\r\n // an ellipsis, because the ellipsis would only hide a single page.\r\n if (start > 2) {\r\n this.pages.unshift(-1);\r\n } else if (start === 2) {\r\n this.pages.unshift(2);\r\n }\r\n this.pages.unshift(1);\r\n }\r\n if (end < this.pageCount) {\r\n // The last page will always be included. If the displayed range\r\n // ends before the third-last page, then add ellipsis. But if the range\r\n // ends on third-last page, then add the second-last page instead of\r\n // an ellipsis, because the ellipsis would only hide a single page.\r\n if (end < (this.pageCount - 2)) {\r\n this.pages.push(-1);\r\n } else if (end === (this.pageCount - 2)) {\r\n this.pages.push(this.pageCount - 1);\r\n }\r\n this.pages.push(this.pageCount);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Rotates page numbers based on maxSize items visible.\r\n * Currently selected page stays in the middle:\r\n *\r\n * Ex. for selected page = 6:\r\n * [5,*6*,7] for maxSize = 3\r\n * [4,5,*6*,7] for maxSize = 4\r\n */\r\n private _applyRotation(): [number, number] {\r\n let start = 0;\r\n let end = this.pageCount;\r\n let leftOffset = Math.floor(this.maxSize / 2);\r\n let rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;\r\n\r\n if (this.page <= leftOffset) {\r\n // very beginning, no rotation -> [0..maxSize]\r\n end = this.maxSize;\r\n } else if (this.pageCount - this.page < leftOffset) {\r\n // very end, no rotation -> [len-maxSize..len]\r\n start = this.pageCount - this.maxSize;\r\n } else {\r\n // rotate\r\n start = this.page - leftOffset - 1;\r\n end = this.page + rightOffset;\r\n }\r\n\r\n return [start, end];\r\n }\r\n\r\n /**\r\n * Paginates page numbers based on maxSize items per page.\r\n */\r\n private _applyPagination(): [number, number] {\r\n let page = Math.ceil(this.page / this.maxSize) - 1;\r\n let start = page * this.maxSize;\r\n let end = start + this.maxSize;\r\n\r\n return [start, end];\r\n }\r\n\r\n private _setPageInRange(newPageNo) {\r\n const prevPageNo = this.page;\r\n this.page = getValueInRange(newPageNo, this.pageCount, 1);\r\n\r\n if (this.page !== prevPageNo && isNumber(this.collectionSize)) {\r\n this.pageChange.emit(this.page);\r\n }\r\n }\r\n\r\n private _updatePages(newPage: number) {\r\n this.pageCount = Math.ceil(this.collectionSize / this.pageSize);\r\n\r\n if (!isNumber(this.pageCount)) {\r\n this.pageCount = 0;\r\n }\r\n\r\n // fill-in model needed to render pages\r\n this.pages.length = 0;\r\n for (let i = 1; i <= this.pageCount; i++) {\r\n this.pages.push(i);\r\n }\r\n\r\n // set page within 1..max range\r\n this._setPageInRange(newPage);\r\n\r\n // apply maxSize if necessary\r\n if (this.maxSize > 0 && this.pageCount > this.maxSize) {\r\n let start = 0;\r\n let end = this.pageCount;\r\n\r\n // either paginating or rotating page numbers\r\n if (this.rotate) {\r\n [start, end] = this._applyRotation();\r\n } else {\r\n [start, end] = this._applyPagination();\r\n }\r\n\r\n this.pages = this.pages.slice(start, end);\r\n\r\n // adding ellipses\r\n this._applyEllipses(start, end);\r\n }\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport {\r\n NgbPagination,\r\n NgbPaginationEllipsis,\r\n NgbPaginationFirst,\r\n NgbPaginationLast,\r\n NgbPaginationNext,\r\n NgbPaginationNumber,\r\n NgbPaginationPrevious,\r\n NgbPaginationPages\r\n} from './pagination';\r\n\r\nexport {\r\n NgbPagination,\r\n NgbPaginationEllipsis,\r\n NgbPaginationFirst,\r\n NgbPaginationLast,\r\n NgbPaginationNext,\r\n NgbPaginationNumber,\r\n NgbPaginationPrevious,\r\n NgbPaginationPages\r\n} from './pagination';\r\nexport {NgbPaginationConfig} from './pagination-config';\r\n\r\nconst DIRECTIVES = [\r\n NgbPagination, NgbPaginationEllipsis, NgbPaginationFirst, NgbPaginationLast, NgbPaginationNext, NgbPaginationNumber,\r\n NgbPaginationPrevious, NgbPaginationPages\r\n];\r\n\r\n@NgModule({declarations: DIRECTIVES, exports: DIRECTIVES, imports: [CommonModule]})\r\nexport class NgbPaginationModule {\r\n}\r\n","import {Observable, merge} from 'rxjs';\r\nimport {share, filter, delay, map} from 'rxjs/operators';\r\nimport {Renderer2} from '@angular/core';\r\n\r\nexport class Trigger {\r\n constructor(public open: string, public close?: string) {\r\n if (!close) {\r\n this.close = open;\r\n }\r\n }\r\n\r\n isManual() { return this.open === 'manual' || this.close === 'manual'; }\r\n}\r\n\r\nconst DEFAULT_ALIASES = {\r\n 'hover': ['mouseenter', 'mouseleave'],\r\n 'focus': ['focusin', 'focusout'],\r\n};\r\n\r\nexport function parseTriggers(triggers: string, aliases = DEFAULT_ALIASES): Trigger[] {\r\n const trimmedTriggers = (triggers || '').trim();\r\n\r\n if (trimmedTriggers.length === 0) {\r\n return [];\r\n }\r\n\r\n const parsedTriggers = trimmedTriggers.split(/\\s+/).map(trigger => trigger.split(':')).map((triggerPair) => {\r\n let alias = aliases[triggerPair[0]] || triggerPair;\r\n return new Trigger(alias[0], alias[1]);\r\n });\r\n\r\n const manualTriggers = parsedTriggers.filter(triggerPair => triggerPair.isManual());\r\n\r\n if (manualTriggers.length > 1) {\r\n throw 'Triggers parse error: only one manual trigger is allowed';\r\n }\r\n\r\n if (manualTriggers.length === 1 && parsedTriggers.length > 1) {\r\n throw 'Triggers parse error: manual trigger can\\'t be mixed with other triggers';\r\n }\r\n\r\n return parsedTriggers;\r\n}\r\n\r\nexport function observeTriggers(\r\n renderer: Renderer2, nativeElement: HTMLElement, triggers: Trigger[], isOpenedFn: () => boolean) {\r\n return new Observable<boolean>(subscriber => {\r\n const listeners: Function[] = [];\r\n const openFn = () => subscriber.next(true);\r\n const closeFn = () => subscriber.next(false);\r\n const toggleFn = () => subscriber.next(!isOpenedFn());\r\n\r\n triggers.forEach((trigger: Trigger) => {\r\n if (trigger.open === trigger.close) {\r\n listeners.push(renderer.listen(nativeElement, trigger.open, toggleFn));\r\n } else {\r\n listeners.push(\r\n renderer.listen(nativeElement, trigger.open, openFn),\r\n renderer.listen(nativeElement, trigger.close !, closeFn));\r\n }\r\n });\r\n\r\n return () => { listeners.forEach(unsubscribeFn => unsubscribeFn()); };\r\n });\r\n}\r\n\r\nconst delayOrNoop = <T>(time: number) => time > 0 ? delay<T>(time) : (a: Observable<T>) => a;\r\n\r\nexport function triggerDelay(openDelay: number, closeDelay: number, isOpenedFn: () => boolean) {\r\n return (input$: Observable<boolean>) => {\r\n let pending: {open: boolean} | null = null;\r\n const filteredInput$ = input$.pipe(\r\n map(open => ({open})), filter(event => {\r\n const currentlyOpen = isOpenedFn();\r\n if (currentlyOpen !== event.open && (!pending || pending.open === currentlyOpen)) {\r\n pending = event;\r\n return true;\r\n }\r\n if (pending && pending.open !== event.open) {\r\n pending = null;\r\n }\r\n return false;\r\n }),\r\n share());\r\n const delayedOpen$ = filteredInput$.pipe(filter(event => event.open), delayOrNoop(openDelay));\r\n const delayedClose$ = filteredInput$.pipe(filter(event => !event.open), delayOrNoop(closeDelay));\r\n return merge(delayedOpen$, delayedClose$)\r\n .pipe(\r\n filter(event => {\r\n if (event === pending) {\r\n pending = null;\r\n return event.open !== isOpenedFn();\r\n }\r\n return false;\r\n }),\r\n map(event => event.open));\r\n };\r\n}\r\n\r\nexport function listenToTriggers(\r\n renderer: Renderer2, nativeElement: HTMLElement, triggers: string, isOpenedFn: () => boolean, openFn: Function,\r\n closeFn: Function, openDelay = 0, closeDelay = 0) {\r\n const parsedTriggers = parseTriggers(triggers);\r\n\r\n if (parsedTriggers.length === 1 && parsedTriggers[0].isManual()) {\r\n return () => {};\r\n }\r\n\r\n const subscription = observeTriggers(renderer, nativeElement, parsedTriggers, isOpenedFn)\r\n .pipe(triggerDelay(openDelay, closeDelay, isOpenedFn))\r\n .subscribe(open => (open ? openFn() : closeFn()));\r\n\r\n return () => subscription.unsubscribe();\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {PlacementArray} from '../util/positioning';\r\nimport {NgbConfig} from '../ngb-config';\r\n\r\n/**\r\n * A configuration service for the [`NgbPopover`](#/components/popover/api#NgbPopover) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the popovers used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbPopoverConfig {\r\n autoClose: boolean | 'inside' | 'outside' = true;\r\n placement: PlacementArray = 'auto';\r\n triggers = 'click';\r\n container: string;\r\n disablePopover = false;\r\n popoverClass: string;\r\n openDelay = 0;\r\n closeDelay = 0;\r\n\r\n private _animation: boolean;\r\n\r\n constructor(private _ngbConfig: NgbConfig) {}\r\n\r\n get animation(): boolean { return (this._animation === undefined) ? this._ngbConfig.animation : this._animation; }\r\n set animation(animation: boolean) { this._animation = animation; }\r\n}\r\n","import {\r\n Component,\r\n Directive,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n ChangeDetectionStrategy,\r\n OnInit,\r\n OnDestroy,\r\n OnChanges,\r\n Inject,\r\n Injector,\r\n Renderer2,\r\n ComponentRef,\r\n ElementRef,\r\n TemplateRef,\r\n ViewContainerRef,\r\n ComponentFactoryResolver,\r\n NgZone,\r\n SimpleChanges,\r\n ViewEncapsulation,\r\n ChangeDetectorRef,\r\n ApplicationRef\r\n} from '@angular/core';\r\nimport {DOCUMENT} from '@angular/common';\r\n\r\nimport {listenToTriggers} from '../util/triggers';\r\nimport {ngbAutoClose} from '../util/autoclose';\r\nimport {positionElements, PlacementArray} from '../util/positioning';\r\nimport {PopupService} from '../util/popup';\r\n\r\nimport {NgbPopoverConfig} from './popover-config';\r\n\r\nlet nextId = 0;\r\n\r\n@Component({\r\n selector: 'ngb-popover-window',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n host: {\r\n '[class]': '\"popover\" + (popoverClass ? \" \" + popoverClass : \"\")',\r\n '[class.fade]': 'animation',\r\n 'role': 'tooltip',\r\n '[id]': 'id'\r\n },\r\n template: `\r\n <div class=\"arrow\"></div>\r\n <h3 class=\"popover-header\" *ngIf=\"title\">\r\n <ng-template #simpleTitle>{{title}}</ng-template>\r\n <ng-template [ngTemplateOutlet]=\"isTitleTemplate() ? $any(title) : simpleTitle\" [ngTemplateOutletContext]=\"context\"></ng-template>\r\n </h3>\r\n <div class=\"popover-body\"><ng-content></ng-content></div>`,\r\n styleUrls: ['./popover.scss']\r\n})\r\nexport class NgbPopoverWindow {\r\n @Input() animation: boolean;\r\n @Input() title: string | TemplateRef<any>| null | undefined;\r\n @Input() id: string;\r\n @Input() popoverClass: string;\r\n @Input() context: any;\r\n\r\n isTitleTemplate() { return this.title instanceof TemplateRef; }\r\n}\r\n\r\n/**\r\n * A lightweight and extensible directive for fancy popover creation.\r\n */\r\n@Directive({selector: '[ngbPopover]', exportAs: 'ngbPopover'})\r\nexport class NgbPopover implements OnInit, OnDestroy, OnChanges {\r\n static ngAcceptInputType_autoClose: boolean | string;\r\n\r\n /**\r\n * If `true`, popover opening and closing will be animated.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Input() animation: boolean;\r\n\r\n /**\r\n * Indicates whether the popover should be closed on `Escape` key and inside/outside clicks:\r\n *\r\n * * `true` - closes on both outside and inside clicks as well as `Escape` presses\r\n * * `false` - disables the autoClose feature (NB: triggers still apply)\r\n * * `\"inside\"` - closes on inside clicks as well as Escape presses\r\n * * `\"outside\"` - closes on outside clicks (sometimes also achievable through triggers)\r\n * as well as `Escape` presses\r\n *\r\n * @since 3.0.0\r\n */\r\n @Input() autoClose: boolean | 'inside' | 'outside';\r\n\r\n /**\r\n * The string content or a `TemplateRef` for the content to be displayed in the popover.\r\n *\r\n * If the title and the content are falsy, the popover won't open.\r\n */\r\n @Input() ngbPopover: string | TemplateRef<any>| null | undefined;\r\n\r\n /**\r\n * The title of the popover.\r\n *\r\n * If the title and the content are falsy, the popover won't open.\r\n */\r\n @Input() popoverTitle: string | TemplateRef<any>| null | undefined;\r\n\r\n /**\r\n * The preferred placement of the popover.\r\n *\r\n * Possible values are `\"top\"`, `\"top-left\"`, `\"top-right\"`, `\"bottom\"`, `\"bottom-left\"`,\r\n * `\"bottom-right\"`, `\"left\"`, `\"left-top\"`, `\"left-bottom\"`, `\"right\"`, `\"right-top\"`,\r\n * `\"right-bottom\"`\r\n *\r\n * Accepts an array of strings or a string with space separated possible values.\r\n *\r\n * The default order of preference is `\"auto\"` (same as the sequence above).\r\n *\r\n * Please see the [positioning overview](#/positioning) for more details.\r\n */\r\n @Input() placement: PlacementArray;\r\n\r\n /**\r\n * Specifies events that should trigger the tooltip.\r\n *\r\n * Supports a space separated list of event names.\r\n * For more details see the [triggers demo](#/components/popover/examples#triggers).\r\n */\r\n @Input() triggers: string;\r\n\r\n /**\r\n * A selector specifying the element the popover should be appended to.\r\n *\r\n * Currently only supports `body`.\r\n */\r\n @Input() container: string;\r\n\r\n /**\r\n * If `true`, popover is disabled and won't be displayed.\r\n *\r\n * @since 1.1.0\r\n */\r\n @Input() disablePopover: boolean;\r\n\r\n /**\r\n * An optional class applied to the popover window element.\r\n *\r\n * @since 2.2.0\r\n */\r\n @Input() popoverClass: string;\r\n\r\n /**\r\n * The opening delay in ms. Works only for \"non-manual\" opening triggers defined by the `triggers` input.\r\n *\r\n * @since 4.1.0\r\n */\r\n @Input() openDelay: number;\r\n\r\n /**\r\n * The closing delay in ms. Works only for \"non-manual\" opening triggers defined by the `triggers` input.\r\n *\r\n * @since 4.1.0\r\n */\r\n @Input() closeDelay: number;\r\n\r\n /**\r\n * An event emitted when the popover opening animation has finished. Contains no payload.\r\n */\r\n @Output() shown = new EventEmitter<void>();\r\n\r\n /**\r\n * An event emitted when the popover closing animation has finished. Contains no payload.\r\n *\r\n * At this point popover is not in the DOM anymore.\r\n */\r\n @Output() hidden = new EventEmitter<void>();\r\n\r\n private _ngbPopoverWindowId = `ngb-popover-${nextId++}`;\r\n private _popupService: PopupService<NgbPopoverWindow>;\r\n private _windowRef: ComponentRef<NgbPopoverWindow>| null = null;\r\n private _unregisterListenersFn;\r\n private _zoneSubscription: any;\r\n private _isDisabled(): boolean {\r\n if (this.disablePopover) {\r\n return true;\r\n }\r\n if (!this.ngbPopover && !this.popoverTitle) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n constructor(\r\n private _elementRef: ElementRef<HTMLElement>, private _renderer: Renderer2, injector: Injector,\r\n componentFactoryResolver: ComponentFactoryResolver, viewContainerRef: ViewContainerRef, config: NgbPopoverConfig,\r\n private _ngZone: NgZone, @Inject(DOCUMENT) private _document: any, private _changeDetector: ChangeDetectorRef,\r\n applicationRef: ApplicationRef) {\r\n this.animation = config.animation;\r\n this.autoClose = config.autoClose;\r\n this.placement = config.placement;\r\n this.triggers = config.triggers;\r\n this.container = config.container;\r\n this.disablePopover = config.disablePopover;\r\n this.popoverClass = config.popoverClass;\r\n this.openDelay = config.openDelay;\r\n this.closeDelay = config.closeDelay;\r\n this._popupService = new PopupService<NgbPopoverWindow>(\r\n NgbPopoverWindow, injector, viewContainerRef, _renderer, this._ngZone, componentFactoryResolver,\r\n applicationRef);\r\n\r\n this._zoneSubscription = _ngZone.onStable.subscribe(() => {\r\n if (this._windowRef) {\r\n positionElements(\r\n this._elementRef.nativeElement, this._windowRef.location.nativeElement, this.placement,\r\n this.container === 'body', 'bs-popover');\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Opens the popover.\r\n *\r\n * This is considered to be a \"manual\" triggering.\r\n * The `context` is an optional value to be injected into the popover template when it is created.\r\n */\r\n open(context?: any) {\r\n if (!this._windowRef && !this._isDisabled()) {\r\n // this type assertion is safe because otherwise _isDisabled would return true\r\n const {windowRef, transition$} =\r\n this._popupService.open(this.ngbPopover as(string | TemplateRef<any>), context, this.animation);\r\n this._windowRef = windowRef;\r\n this._windowRef.instance.animation = this.animation;\r\n this._windowRef.instance.title = this.popoverTitle;\r\n this._windowRef.instance.context = context;\r\n this._windowRef.instance.popoverClass = this.popoverClass;\r\n this._windowRef.instance.id = this._ngbPopoverWindowId;\r\n\r\n this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', this._ngbPopoverWindowId);\r\n\r\n if (this.container === 'body') {\r\n this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);\r\n }\r\n\r\n // We need to detect changes, because we don't know where .open() might be called from.\r\n // Ex. opening popover from one of lifecycle hooks that run after the CD\r\n // (say from ngAfterViewInit) will result in 'ExpressionHasChanged' exception\r\n this._windowRef.changeDetectorRef.detectChanges();\r\n\r\n // We need to mark for check, because popover won't work inside the OnPush component.\r\n // Ex. when we use expression like `{{ popover.isOpen() : 'opened' : 'closed' }}`\r\n // inside the template of an OnPush component and we change the popover from\r\n // open -> closed, the expression in question won't be updated unless we explicitly\r\n // mark the parent component to be checked.\r\n this._windowRef.changeDetectorRef.markForCheck();\r\n\r\n ngbAutoClose(\r\n this._ngZone, this._document, this.autoClose, () => this.close(), this.hidden,\r\n [this._windowRef.location.nativeElement]);\r\n\r\n transition$.subscribe(() => this.shown.emit());\r\n }\r\n }\r\n\r\n /**\r\n * Closes the popover.\r\n *\r\n * This is considered to be a \"manual\" triggering of the popover.\r\n */\r\n close() {\r\n if (this._windowRef) {\r\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\r\n this._popupService.close(this.animation).subscribe(() => {\r\n this._windowRef = null;\r\n this.hidden.emit();\r\n this._changeDetector.markForCheck();\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Toggles the popover.\r\n *\r\n * This is considered to be a \"manual\" triggering of the popover.\r\n */\r\n toggle(): void {\r\n if (this._windowRef) {\r\n this.close();\r\n } else {\r\n this.open();\r\n }\r\n }\r\n\r\n /**\r\n * Returns `true`, if the popover is currently shown.\r\n */\r\n isOpen(): boolean { return this._windowRef != null; }\r\n\r\n ngOnInit() {\r\n this._unregisterListenersFn = listenToTriggers(\r\n this._renderer, this._elementRef.nativeElement, this.triggers, this.isOpen.bind(this), this.open.bind(this),\r\n this.close.bind(this), +this.openDelay, +this.closeDelay);\r\n }\r\n\r\n ngOnChanges({ngbPopover, popoverTitle, disablePopover, popoverClass}: SimpleChanges) {\r\n if (popoverClass && this.isOpen()) {\r\n this._windowRef !.instance.popoverClass = popoverClass.currentValue;\r\n }\r\n // close popover if title and content become empty, or disablePopover set to true\r\n if ((ngbPopover || popoverTitle || disablePopover) && this._isDisabled()) {\r\n this.close();\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.close();\r\n // This check is needed as it might happen that ngOnDestroy is called before ngOnInit\r\n // under certain conditions, see: https://github.com/ng-bootstrap/ng-bootstrap/issues/2199\r\n if (this._unregisterListenersFn) {\r\n this._unregisterListenersFn();\r\n }\r\n this._zoneSubscription.unsubscribe();\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\n\r\nimport {NgbPopover, NgbPopoverWindow} from './popover';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nexport {NgbPopover} from './popover';\r\nexport {NgbPopoverConfig} from './popover-config';\r\nexport {Placement} from '../util/positioning';\r\n\r\n@NgModule({\r\n declarations: [NgbPopover, NgbPopoverWindow],\r\n exports: [NgbPopover],\r\n imports: [CommonModule],\r\n entryComponents: [NgbPopoverWindow]\r\n})\r\nexport class NgbPopoverModule {\r\n}\r\n","import {Injectable} from '@angular/core';\r\n\r\n/**\r\n * A configuration service for the [`NgbProgressbar`](#/components/progressbar/api#NgbProgressbar) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the progress bars used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbProgressbarConfig {\r\n max = 100;\r\n animated = false;\r\n striped = false;\r\n textType: string;\r\n type: string;\r\n showValue = false;\r\n height: string;\r\n}\r\n","import {ChangeDetectionStrategy, Component, Input, ViewEncapsulation, HostBinding} from '@angular/core';\r\nimport {getValueInRange, isNumber} from '../util/util';\r\nimport {NgbProgressbarConfig} from './progressbar-config';\r\n\r\n/**\r\n * A directive that provides feedback on the progress of a workflow or an action.\r\n */\r\n@Component({\r\n selector: 'ngb-progressbar',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n host: {class: 'progress'},\r\n template: `\r\n <div class=\"progress-bar{{type ? ' bg-' + type : ''}}{{textType ? ' text-' + textType : ''}}\r\n {{animated ? ' progress-bar-animated' : ''}}{{striped ? ' progress-bar-striped' : ''}}\"\r\n role=\"progressbar\" [style.width.%]=\"getPercentValue()\"\r\n [attr.aria-valuenow]=\"getValue()\" aria-valuemin=\"0\" [attr.aria-valuemax]=\"max\">\r\n <span *ngIf=\"showValue\" i18n=\"@@ngb.progressbar.value\">{{getValue() / max | percent}}</span><ng-content></ng-content>\r\n </div>\r\n `\r\n})\r\nexport class NgbProgressbar {\r\n private _max: number;\r\n\r\n /**\r\n * The maximal value to be displayed in the progress bar.\r\n *\r\n * Should be a positive number. Will default to 100 otherwise.\r\n */\r\n @Input()\r\n set max(max: number) {\r\n this._max = !isNumber(max) || max <= 0 ? 100 : max;\r\n }\r\n\r\n get max(): number { return this._max; }\r\n\r\n /**\r\n * If `true`, the stripes on the progress bar are animated.\r\n *\r\n * Takes effect only for browsers supporting CSS3 animations, and if `striped` is `true`.\r\n */\r\n @Input() animated: boolean;\r\n\r\n /**\r\n * If `true`, the progress bars will be displayed as striped.\r\n */\r\n @Input() striped: boolean;\r\n\r\n /**\r\n * If `true`, the current percentage will be shown in the `xx%` format.\r\n */\r\n @Input() showValue: boolean;\r\n\r\n /**\r\n * Optional text variant type of the progress bar.\r\n *\r\n * Supports types based on Bootstrap background color variants, like:\r\n * `\"success\"`, `\"info\"`, `\"warning\"`, `\"danger\"`, `\"primary\"`, `\"secondary\"`, `\"dark\"` and so on.\r\n *\r\n * @since 5.2.0\r\n */\r\n @Input() textType: string;\r\n\r\n /**\r\n * The type of the progress bar.\r\n *\r\n * Supports types based on Bootstrap background color variants, like:\r\n * `\"success\"`, `\"info\"`, `\"warning\"`, `\"danger\"`, `\"primary\"`, `\"secondary\"`, `\"dark\"` and so on.\r\n */\r\n @Input() type: string;\r\n\r\n /**\r\n * The current value for the progress bar.\r\n *\r\n * Should be in the `[0, max]` range.\r\n */\r\n @Input() value = 0;\r\n\r\n /**\r\n * The height of the progress bar.\r\n *\r\n * Accepts any valid CSS height values, ex. `\"2rem\"`\r\n */\r\n @Input() @HostBinding('style.height') height: string;\r\n\r\n constructor(config: NgbProgressbarConfig) {\r\n this.max = config.max;\r\n this.animated = config.animated;\r\n this.striped = config.striped;\r\n this.textType = config.textType;\r\n this.type = config.type;\r\n this.showValue = config.showValue;\r\n this.height = config.height;\r\n }\r\n\r\n getValue() { return getValueInRange(this.value, this.max); }\r\n\r\n getPercentValue() { return 100 * this.getValue() / this.max; }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport {NgbProgressbar} from './progressbar';\r\n\r\nexport {NgbProgressbar} from './progressbar';\r\nexport {NgbProgressbarConfig} from './progressbar-config';\r\n\r\n@NgModule({declarations: [NgbProgressbar], exports: [NgbProgressbar], imports: [CommonModule]})\r\nexport class NgbProgressbarModule {\r\n}\r\n","import {Injectable} from '@angular/core';\r\n\r\n/**\r\n * A configuration service for the [`NgbRating`](#/components/rating/api#NgbRating) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the ratings used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbRatingConfig {\r\n max = 10;\r\n readonly = false;\r\n resettable = false;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ContentChild,\r\n EventEmitter,\r\n forwardRef,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n Output,\r\n SimpleChanges,\r\n TemplateRef,\r\n ViewEncapsulation\r\n} from '@angular/core';\r\nimport {NgbRatingConfig} from './rating-config';\r\nimport {getValueInRange} from '../util/util';\r\nimport {Key} from '../util/key';\r\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\r\n\r\n/**\r\n * The context for the custom star display template defined in the `starTemplate`.\r\n */\r\nexport interface StarTemplateContext {\r\n /**\r\n * The star fill percentage, an integer in the `[0, 100]` range.\r\n */\r\n fill: number;\r\n\r\n /**\r\n * Index of the star, starts with `0`.\r\n */\r\n index: number;\r\n}\r\n\r\n/**\r\n * A directive that helps visualising and interacting with a star rating bar.\r\n */\r\n@Component({\r\n selector: 'ngb-rating',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n host: {\r\n 'class': 'd-inline-flex',\r\n '[tabindex]': 'disabled ? -1 : 0',\r\n 'role': 'slider',\r\n 'aria-valuemin': '0',\r\n '[attr.aria-valuemax]': 'max',\r\n '[attr.aria-valuenow]': 'nextRate',\r\n '[attr.aria-valuetext]': 'ariaValueText()',\r\n '[attr.aria-disabled]': 'readonly ? true : null',\r\n '(blur)': 'handleBlur()',\r\n '(keydown)': 'handleKeyDown($event)',\r\n '(mouseleave)': 'reset()'\r\n },\r\n template: `\r\n <ng-template #t let-fill=\"fill\">{{ fill === 100 ? '&#9733;' : '&#9734;' }}</ng-template>\r\n <ng-template ngFor [ngForOf]=\"contexts\" let-index=\"index\">\r\n <span class=\"sr-only\">({{ index < nextRate ? '*' : ' ' }})</span>\r\n <span (mouseenter)=\"enter(index + 1)\" (click)=\"handleClick(index + 1)\" [style.cursor]=\"isInteractive() ? 'pointer' : 'default'\">\r\n <ng-template [ngTemplateOutlet]=\"starTemplate || starTemplateFromContent || t\" [ngTemplateOutletContext]=\"contexts[index]\">\r\n </ng-template>\r\n </span>\r\n </ng-template>\r\n `,\r\n providers: [{provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgbRating), multi: true}]\r\n})\r\nexport class NgbRating implements ControlValueAccessor,\r\n OnInit, OnChanges {\r\n contexts: StarTemplateContext[] = [];\r\n disabled = false;\r\n nextRate: number;\r\n\r\n\r\n /**\r\n * The maximal rating that can be given.\r\n */\r\n @Input() max: number;\r\n\r\n /**\r\n * The current rating. Could be a decimal value like `3.75`.\r\n */\r\n @Input() rate: number;\r\n\r\n /**\r\n * If `true`, the rating can't be changed.\r\n */\r\n @Input() readonly: boolean;\r\n\r\n /**\r\n * If `true`, the rating can be reset to `0` by mouse clicking currently set rating.\r\n */\r\n @Input() resettable: boolean;\r\n\r\n /**\r\n * The template to override the way each star is displayed.\r\n *\r\n * Alternatively put an `<ng-template>` as the only child of your `<ngb-rating>` element\r\n */\r\n @Input() starTemplate: TemplateRef<StarTemplateContext>;\r\n @ContentChild(TemplateRef, {static: false}) starTemplateFromContent: TemplateRef<StarTemplateContext>;\r\n\r\n /**\r\n * An event emitted when the user is hovering over a given rating.\r\n *\r\n * Event payload equals to the rating being hovered over.\r\n */\r\n @Output() hover = new EventEmitter<number>();\r\n\r\n /**\r\n * An event emitted when the user stops hovering over a given rating.\r\n *\r\n * Event payload equals to the rating of the last item being hovered over.\r\n */\r\n @Output() leave = new EventEmitter<number>();\r\n\r\n /**\r\n * An event emitted when the user selects a new rating.\r\n *\r\n * Event payload equals to the newly selected rating.\r\n */\r\n @Output() rateChange = new EventEmitter<number>(true);\r\n\r\n onChange = (_: any) => {};\r\n onTouched = () => {};\r\n\r\n constructor(config: NgbRatingConfig, private _changeDetectorRef: ChangeDetectorRef) {\r\n this.max = config.max;\r\n this.readonly = config.readonly;\r\n }\r\n\r\n ariaValueText() { return `${this.nextRate} out of ${this.max}`; }\r\n\r\n isInteractive(): boolean { return !this.readonly && !this.disabled; }\r\n\r\n enter(value: number): void {\r\n if (this.isInteractive()) {\r\n this._updateState(value);\r\n }\r\n this.hover.emit(value);\r\n }\r\n\r\n handleBlur() { this.onTouched(); }\r\n\r\n handleClick(value: number) {\r\n if (this.isInteractive()) {\r\n this.update(this.resettable && this.rate === value ? 0 : value);\r\n }\r\n }\r\n\r\n handleKeyDown(event: KeyboardEvent) {\r\n // tslint:disable-next-line:deprecation\r\n switch (event.which) {\r\n case Key.ArrowDown:\r\n case Key.ArrowLeft:\r\n this.update(this.rate - 1);\r\n break;\r\n case Key.ArrowUp:\r\n case Key.ArrowRight:\r\n this.update(this.rate + 1);\r\n break;\r\n case Key.Home:\r\n this.update(0);\r\n break;\r\n case Key.End:\r\n this.update(this.max);\r\n break;\r\n default:\r\n return;\r\n }\r\n\r\n // note 'return' in default case\r\n event.preventDefault();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['rate']) {\r\n this.update(this.rate);\r\n }\r\n }\r\n\r\n ngOnInit(): void {\r\n this.contexts = Array.from({length: this.max}, (v, k) => ({fill: 0, index: k}));\r\n this._updateState(this.rate);\r\n }\r\n\r\n registerOnChange(fn: (value: any) => any): void { this.onChange = fn; }\r\n\r\n registerOnTouched(fn: () => any): void { this.onTouched = fn; }\r\n\r\n reset(): void {\r\n this.leave.emit(this.nextRate);\r\n this._updateState(this.rate);\r\n }\r\n\r\n setDisabledState(isDisabled: boolean) { this.disabled = isDisabled; }\r\n\r\n update(value: number, internalChange = true): void {\r\n const newRate = getValueInRange(value, this.max, 0);\r\n if (this.isInteractive() && this.rate !== newRate) {\r\n this.rate = newRate;\r\n this.rateChange.emit(this.rate);\r\n }\r\n if (internalChange) {\r\n this.onChange(this.rate);\r\n this.onTouched();\r\n }\r\n this._updateState(this.rate);\r\n }\r\n\r\n writeValue(value) {\r\n this.update(value, false);\r\n this._changeDetectorRef.markForCheck();\r\n }\r\n\r\n private _updateState(nextValue: number) {\r\n this.nextRate = nextValue;\r\n this.contexts.forEach(\r\n (context, index) => context.fill = Math.round(getValueInRange(nextValue - index, 1, 0) * 100));\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport {NgbRating} from './rating';\r\n\r\nexport {NgbRating} from './rating';\r\nexport {NgbRatingConfig} from './rating-config';\r\n\r\n@NgModule({declarations: [NgbRating], exports: [NgbRating], imports: [CommonModule]})\r\nexport class NgbRatingModule {\r\n}\r\n","import {isNumber, toInteger} from '../util/util';\r\n\r\nexport class NgbTime {\r\n hour: number;\r\n minute: number;\r\n second: number;\r\n\r\n constructor(hour?: number, minute?: number, second?: number) {\r\n this.hour = toInteger(hour);\r\n this.minute = toInteger(minute);\r\n this.second = toInteger(second);\r\n }\r\n\r\n changeHour(step = 1) { this.updateHour((isNaN(this.hour) ? 0 : this.hour) + step); }\r\n\r\n updateHour(hour: number) {\r\n if (isNumber(hour)) {\r\n this.hour = (hour < 0 ? 24 + hour : hour) % 24;\r\n } else {\r\n this.hour = NaN;\r\n }\r\n }\r\n\r\n changeMinute(step = 1) { this.updateMinute((isNaN(this.minute) ? 0 : this.minute) + step); }\r\n\r\n updateMinute(minute: number) {\r\n if (isNumber(minute)) {\r\n this.minute = minute % 60 < 0 ? 60 + minute % 60 : minute % 60;\r\n this.changeHour(Math.floor(minute / 60));\r\n } else {\r\n this.minute = NaN;\r\n }\r\n }\r\n\r\n changeSecond(step = 1) { this.updateSecond((isNaN(this.second) ? 0 : this.second) + step); }\r\n\r\n updateSecond(second: number) {\r\n if (isNumber(second)) {\r\n this.second = second < 0 ? 60 + second % 60 : second % 60;\r\n this.changeMinute(Math.floor(second / 60));\r\n } else {\r\n this.second = NaN;\r\n }\r\n }\r\n\r\n isValid(checkSecs = true) {\r\n return isNumber(this.hour) && isNumber(this.minute) && (checkSecs ? isNumber(this.second) : true);\r\n }\r\n\r\n toString() { return `${this.hour || 0}:${this.minute || 0}:${this.second || 0}`; }\r\n}\r\n","import {Injectable} from '@angular/core';\r\n\r\n/**\r\n * A configuration service for the [`NgbTimepicker`](#/components/timepicker/api#NgbTimepicker) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the timepickers used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbTimepickerConfig {\r\n meridian = false;\r\n spinners = true;\r\n seconds = false;\r\n hourStep = 1;\r\n minuteStep = 1;\r\n secondStep = 1;\r\n disabled = false;\r\n readonlyInputs = false;\r\n size: 'small' | 'medium' | 'large' = 'medium';\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbTimeStruct} from './ngb-time-struct';\r\nimport {isInteger} from '../util/util';\r\n\r\nexport function NGB_DATEPICKER_TIME_ADAPTER_FACTORY() {\r\n return new NgbTimeStructAdapter();\r\n}\r\n\r\n/**\r\n * An abstract service that does the conversion between the internal timepicker `NgbTimeStruct` model and\r\n * any provided user time model `T`, ex. a string, a native date, etc.\r\n *\r\n * The adapter is used **only** for conversion when binding timepicker to a form control,\r\n * ex. `[(ngModel)]=\"userTimeModel\"`. Here `userTimeModel` can be of any type.\r\n *\r\n * The default timepicker implementation assumes we use `NgbTimeStruct` as a user model.\r\n *\r\n * See the [custom time adapter demo](#/components/timepicker/examples#adapter) for an example.\r\n *\r\n * @since 2.2.0\r\n */\r\n@Injectable({providedIn: 'root', useFactory: NGB_DATEPICKER_TIME_ADAPTER_FACTORY})\r\nexport abstract class NgbTimeAdapter<T> {\r\n /**\r\n * Converts a user-model time of type `T` to an `NgbTimeStruct` for internal use.\r\n */\r\n abstract fromModel(value: T | null): NgbTimeStruct | null;\r\n\r\n /**\r\n * Converts an internal `NgbTimeStruct` time to a user-model time of type `T`.\r\n */\r\n abstract toModel(time: NgbTimeStruct | null): T | null;\r\n}\r\n\r\n@Injectable()\r\nexport class NgbTimeStructAdapter extends NgbTimeAdapter<NgbTimeStruct> {\r\n /**\r\n * Converts a NgbTimeStruct value into NgbTimeStruct value\r\n */\r\n fromModel(time: NgbTimeStruct | null): NgbTimeStruct | null {\r\n return (time && isInteger(time.hour) && isInteger(time.minute)) ?\r\n {hour: time.hour, minute: time.minute, second: isInteger(time.second) ? time.second : <any>null} :\r\n null;\r\n }\r\n\r\n /**\r\n * Converts a NgbTimeStruct value into NgbTimeStruct value\r\n */\r\n toModel(time: NgbTimeStruct | null): NgbTimeStruct | null {\r\n return (time && isInteger(time.hour) && isInteger(time.minute)) ?\r\n {hour: time.hour, minute: time.minute, second: isInteger(time.second) ? time.second : <any>null} :\r\n null;\r\n }\r\n}\r\n","import {Inject, Injectable, LOCALE_ID} from '@angular/core';\r\nimport {FormStyle, getLocaleDayPeriods, TranslationWidth} from '@angular/common';\r\n\r\nexport function NGB_TIMEPICKER_I18N_FACTORY(locale) {\r\n return new NgbTimepickerI18nDefault(locale);\r\n}\r\n\r\n/**\r\n * Type of the service supplying day periods (for example, 'AM' and 'PM') to NgbTimepicker component.\r\n * The default implementation of this service honors the Angular locale, and uses the registered locale data,\r\n * as explained in the Angular i18n guide.\r\n */\r\n@Injectable({providedIn: 'root', useFactory: NGB_TIMEPICKER_I18N_FACTORY, deps: [LOCALE_ID]})\r\nexport abstract class NgbTimepickerI18n {\r\n /**\r\n * Returns the name for the period before midday.\r\n */\r\n abstract getMorningPeriod(): string;\r\n\r\n /**\r\n * Returns the name for the period after midday.\r\n */\r\n abstract getAfternoonPeriod(): string;\r\n}\r\n\r\n@Injectable()\r\nexport class NgbTimepickerI18nDefault extends NgbTimepickerI18n {\r\n private _periods: Readonly<[string, string]>;\r\n\r\n constructor(@Inject(LOCALE_ID) locale: string) {\r\n super();\r\n\r\n this._periods = getLocaleDayPeriods(locale, FormStyle.Standalone, TranslationWidth.Narrow);\r\n }\r\n\r\n getMorningPeriod(): string { return this._periods[0]; }\r\n\r\n getAfternoonPeriod(): string { return this._periods[1]; }\r\n}\r\n","import {\r\n ChangeDetectorRef,\r\n Component,\r\n forwardRef,\r\n Input,\r\n OnChanges,\r\n SimpleChanges,\r\n ViewEncapsulation\r\n} from '@angular/core';\r\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\r\n\r\nimport {isInteger, isNumber, padNumber, toInteger} from '../util/util';\r\nimport {NgbTime} from './ngb-time';\r\nimport {NgbTimepickerConfig} from './timepicker-config';\r\nimport {NgbTimeAdapter} from './ngb-time-adapter';\r\nimport {NgbTimepickerI18n} from './timepicker-i18n';\r\n\r\nconst FILTER_REGEX = /[^0-9]/g;\r\n\r\n/**\r\n * A directive that helps with wth picking hours, minutes and seconds.\r\n */\r\n@Component({\r\n selector: 'ngb-timepicker',\r\n encapsulation: ViewEncapsulation.None,\r\n styleUrls: ['./timepicker.scss'],\r\n template: `\r\n <fieldset [disabled]=\"disabled\" [class.disabled]=\"disabled\">\r\n <div class=\"ngb-tp\">\r\n <div class=\"ngb-tp-input-container ngb-tp-hour\">\r\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeHour(hourStep)\"\r\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\r\n [disabled]=\"disabled\">\r\n <span class=\"chevron ngb-tp-chevron\"></span>\r\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.increment-hours\">Increment hours</span>\r\n </button>\r\n <input type=\"text\" class=\"ngb-tp-input form-control\" [class.form-control-sm]=\"isSmallSize\"\r\n [class.form-control-lg]=\"isLargeSize\"\r\n maxlength=\"2\" inputmode=\"numeric\" placeholder=\"HH\" i18n-placeholder=\"@@ngb.timepicker.HH\"\r\n [value]=\"formatHour(model?.hour)\" (change)=\"updateHour($any($event).target.value)\"\r\n [readOnly]=\"readonlyInputs\" [disabled]=\"disabled\" aria-label=\"Hours\" i18n-aria-label=\"@@ngb.timepicker.hours\"\r\n (blur)=\"handleBlur()\"\r\n (input)=\"formatInput($any($event).target)\"\r\n (keydown.ArrowUp)=\"changeHour(hourStep); $event.preventDefault()\"\r\n (keydown.ArrowDown)=\"changeHour(-hourStep); $event.preventDefault()\">\r\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeHour(-hourStep)\"\r\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\r\n [disabled]=\"disabled\">\r\n <span class=\"chevron ngb-tp-chevron bottom\"></span>\r\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.decrement-hours\">Decrement hours</span>\r\n </button>\r\n </div>\r\n <div class=\"ngb-tp-spacer\">:</div>\r\n <div class=\"ngb-tp-input-container ngb-tp-minute\">\r\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeMinute(minuteStep)\"\r\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\r\n [disabled]=\"disabled\">\r\n <span class=\"chevron ngb-tp-chevron\"></span>\r\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.increment-minutes\">Increment minutes</span>\r\n </button>\r\n <input type=\"text\" class=\"ngb-tp-input form-control\" [class.form-control-sm]=\"isSmallSize\" [class.form-control-lg]=\"isLargeSize\"\r\n maxlength=\"2\" inputmode=\"numeric\" placeholder=\"MM\" i18n-placeholder=\"@@ngb.timepicker.MM\"\r\n [value]=\"formatMinSec(model?.minute)\" (change)=\"updateMinute($any($event).target.value)\"\r\n [readOnly]=\"readonlyInputs\" [disabled]=\"disabled\" aria-label=\"Minutes\" i18n-aria-label=\"@@ngb.timepicker.minutes\"\r\n (blur)=\"handleBlur()\"\r\n (input)=\"formatInput($any($event).target)\"\r\n (keydown.ArrowUp)=\"changeMinute(minuteStep); $event.preventDefault()\"\r\n (keydown.ArrowDown)=\"changeMinute(-minuteStep); $event.preventDefault()\">\r\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeMinute(-minuteStep)\"\r\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\r\n [disabled]=\"disabled\">\r\n <span class=\"chevron ngb-tp-chevron bottom\"></span>\r\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.decrement-minutes\">Decrement minutes</span>\r\n </button>\r\n </div>\r\n <div *ngIf=\"seconds\" class=\"ngb-tp-spacer\">:</div>\r\n <div *ngIf=\"seconds\" class=\"ngb-tp-input-container ngb-tp-second\">\r\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeSecond(secondStep)\"\r\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\r\n [disabled]=\"disabled\">\r\n <span class=\"chevron ngb-tp-chevron\"></span>\r\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.increment-seconds\">Increment seconds</span>\r\n </button>\r\n <input type=\"text\" class=\"ngb-tp-input form-control\" [class.form-control-sm]=\"isSmallSize\" [class.form-control-lg]=\"isLargeSize\"\r\n maxlength=\"2\" inputmode=\"numeric\" placeholder=\"SS\" i18n-placeholder=\"@@ngb.timepicker.SS\"\r\n [value]=\"formatMinSec(model?.second)\" (change)=\"updateSecond($any($event).target.value)\"\r\n [readOnly]=\"readonlyInputs\" [disabled]=\"disabled\" aria-label=\"Seconds\" i18n-aria-label=\"@@ngb.timepicker.seconds\"\r\n (blur)=\"handleBlur()\"\r\n (input)=\"formatInput($any($event).target)\"\r\n (keydown.ArrowUp)=\"changeSecond(secondStep); $event.preventDefault()\"\r\n (keydown.ArrowDown)=\"changeSecond(-secondStep); $event.preventDefault()\">\r\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeSecond(-secondStep)\"\r\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\r\n [disabled]=\"disabled\">\r\n <span class=\"chevron ngb-tp-chevron bottom\"></span>\r\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.decrement-seconds\">Decrement seconds</span>\r\n </button>\r\n </div>\r\n <div *ngIf=\"meridian\" class=\"ngb-tp-spacer\"></div>\r\n <div *ngIf=\"meridian\" class=\"ngb-tp-meridian\">\r\n <button type=\"button\" class=\"btn btn-outline-primary\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\"\r\n [disabled]=\"disabled\" [class.disabled]=\"disabled\"\r\n (click)=\"toggleMeridian()\">\r\n <ng-container *ngIf=\"model && model.hour >= 12; else am\"\r\n i18n=\"@@ngb.timepicker.PM\">{{ i18n.getAfternoonPeriod() }}</ng-container>\r\n <ng-template #am i18n=\"@@ngb.timepicker.AM\">{{ i18n.getMorningPeriod() }}</ng-template>\r\n </button>\r\n </div>\r\n </div>\r\n </fieldset>\r\n `,\r\n providers: [{provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgbTimepicker), multi: true}]\r\n})\r\nexport class NgbTimepicker implements ControlValueAccessor,\r\n OnChanges {\r\n static ngAcceptInputType_size: string;\r\n\r\n disabled: boolean;\r\n model: NgbTime;\r\n\r\n private _hourStep: number;\r\n private _minuteStep: number;\r\n private _secondStep: number;\r\n\r\n /**\r\n * Whether to display 12H or 24H mode.\r\n */\r\n @Input() meridian: boolean;\r\n\r\n /**\r\n * If `true`, the spinners above and below inputs are visible.\r\n */\r\n @Input() spinners: boolean;\r\n\r\n /**\r\n * If `true`, it is possible to select seconds.\r\n */\r\n @Input() seconds: boolean;\r\n\r\n /**\r\n * The number of hours to add/subtract when clicking hour spinners.\r\n */\r\n @Input()\r\n set hourStep(step: number) {\r\n this._hourStep = isInteger(step) ? step : this._config.hourStep;\r\n }\r\n\r\n get hourStep(): number { return this._hourStep; }\r\n\r\n /**\r\n * The number of minutes to add/subtract when clicking minute spinners.\r\n */\r\n @Input()\r\n set minuteStep(step: number) {\r\n this._minuteStep = isInteger(step) ? step : this._config.minuteStep;\r\n }\r\n\r\n get minuteStep(): number { return this._minuteStep; }\r\n\r\n /**\r\n * The number of seconds to add/subtract when clicking second spinners.\r\n */\r\n @Input()\r\n set secondStep(step: number) {\r\n this._secondStep = isInteger(step) ? step : this._config.secondStep;\r\n }\r\n\r\n get secondStep(): number { return this._secondStep; }\r\n\r\n /**\r\n * If `true`, the timepicker is readonly and can't be changed.\r\n */\r\n @Input() readonlyInputs: boolean;\r\n\r\n /**\r\n * The size of inputs and buttons.\r\n */\r\n @Input() size: 'small' | 'medium' | 'large';\r\n\r\n constructor(\r\n private readonly _config: NgbTimepickerConfig, private _ngbTimeAdapter: NgbTimeAdapter<any>,\r\n private _cd: ChangeDetectorRef, public i18n: NgbTimepickerI18n) {\r\n this.meridian = _config.meridian;\r\n this.spinners = _config.spinners;\r\n this.seconds = _config.seconds;\r\n this.hourStep = _config.hourStep;\r\n this.minuteStep = _config.minuteStep;\r\n this.secondStep = _config.secondStep;\r\n this.disabled = _config.disabled;\r\n this.readonlyInputs = _config.readonlyInputs;\r\n this.size = _config.size;\r\n }\r\n\r\n onChange = (_: any) => {};\r\n onTouched = () => {};\r\n\r\n writeValue(value) {\r\n const structValue = this._ngbTimeAdapter.fromModel(value);\r\n this.model = structValue ? new NgbTime(structValue.hour, structValue.minute, structValue.second) : new NgbTime();\r\n if (!this.seconds && (!structValue || !isNumber(structValue.second))) {\r\n this.model.second = 0;\r\n }\r\n this._cd.markForCheck();\r\n }\r\n\r\n registerOnChange(fn: (value: any) => any): void { this.onChange = fn; }\r\n\r\n registerOnTouched(fn: () => any): void { this.onTouched = fn; }\r\n\r\n setDisabledState(isDisabled: boolean) { this.disabled = isDisabled; }\r\n\r\n changeHour(step: number) {\r\n this.model.changeHour(step);\r\n this.propagateModelChange();\r\n }\r\n\r\n changeMinute(step: number) {\r\n this.model.changeMinute(step);\r\n this.propagateModelChange();\r\n }\r\n\r\n changeSecond(step: number) {\r\n this.model.changeSecond(step);\r\n this.propagateModelChange();\r\n }\r\n\r\n updateHour(newVal: string) {\r\n const isPM = this.model.hour >= 12;\r\n const enteredHour = toInteger(newVal);\r\n if (this.meridian && (isPM && enteredHour < 12 || !isPM && enteredHour === 12)) {\r\n this.model.updateHour(enteredHour + 12);\r\n } else {\r\n this.model.updateHour(enteredHour);\r\n }\r\n this.propagateModelChange();\r\n }\r\n\r\n updateMinute(newVal: string) {\r\n this.model.updateMinute(toInteger(newVal));\r\n this.propagateModelChange();\r\n }\r\n\r\n updateSecond(newVal: string) {\r\n this.model.updateSecond(toInteger(newVal));\r\n this.propagateModelChange();\r\n }\r\n\r\n toggleMeridian() {\r\n if (this.meridian) {\r\n this.changeHour(12);\r\n }\r\n }\r\n\r\n formatInput(input: HTMLInputElement) { input.value = input.value.replace(FILTER_REGEX, ''); }\r\n\r\n formatHour(value?: number) {\r\n if (isNumber(value)) {\r\n if (this.meridian) {\r\n return padNumber(value % 12 === 0 ? 12 : value % 12);\r\n } else {\r\n return padNumber(value % 24);\r\n }\r\n } else {\r\n return padNumber(NaN);\r\n }\r\n }\r\n\r\n formatMinSec(value?: number) { return padNumber(isNumber(value) ? value : NaN); }\r\n\r\n handleBlur() { this.onTouched(); }\r\n\r\n get isSmallSize(): boolean { return this.size === 'small'; }\r\n\r\n get isLargeSize(): boolean { return this.size === 'large'; }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['seconds'] && !this.seconds && this.model && !isNumber(this.model.second)) {\r\n this.model.second = 0;\r\n this.propagateModelChange(false);\r\n }\r\n }\r\n\r\n private propagateModelChange(touched = true) {\r\n if (touched) {\r\n this.onTouched();\r\n }\r\n if (this.model.isValid(this.seconds)) {\r\n this.onChange(\r\n this._ngbTimeAdapter.toModel({hour: this.model.hour, minute: this.model.minute, second: this.model.second}));\r\n } else {\r\n this.onChange(this._ngbTimeAdapter.toModel(null));\r\n }\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport {NgbTimepicker} from './timepicker';\r\n\r\nexport {NgbTimepicker} from './timepicker';\r\nexport {NgbTimepickerConfig} from './timepicker-config';\r\nexport {NgbTimeStruct} from './ngb-time-struct';\r\nexport {NgbTimeAdapter} from './ngb-time-adapter';\r\nexport {NgbTimepickerI18n} from './timepicker-i18n';\r\n\r\n@NgModule({declarations: [NgbTimepicker], exports: [NgbTimepicker], imports: [CommonModule]})\r\nexport class NgbTimepickerModule {\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {NgbConfig} from '../ngb-config';\r\n\r\n/**\r\n * Interface used to type all toast config options. See `NgbToastConfig`.\r\n *\r\n * @since 5.0.0\r\n */\r\nexport interface NgbToastOptions {\r\n /**\r\n * Specify if the toast component should emit the `hide()` output\r\n * after a certain `delay` in ms.\r\n */\r\n autohide?: boolean;\r\n\r\n /**\r\n * Delay in ms after which the `hide()` output should be emitted.\r\n */\r\n delay?: number;\r\n\r\n /**\r\n * Type of aria-live attribute to be used.\r\n *\r\n * Could be one of these 2 values (as string):\r\n * - `polite` (default)\r\n * - `alert`\r\n */\r\n ariaLive?: 'polite' | 'alert';\r\n}\r\n\r\n/**\r\n * Configuration service for the NgbToast component. You can inject this service, typically in your root component,\r\n * and customize the values of its properties in order to provide default values for all the toasts used in the\r\n * application.\r\n *\r\n * @since 5.0.0\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbToastConfig implements NgbToastOptions {\r\n autohide = true;\r\n delay = 500;\r\n ariaLive: 'polite' | 'alert' = 'polite';\r\n\r\n private _animation: boolean;\r\n\r\n constructor(private _ngbConfig: NgbConfig) {}\r\n\r\n get animation(): boolean { return (this._animation === undefined) ? this._ngbConfig.animation : this._animation; }\r\n set animation(animation: boolean) { this._animation = animation; }\r\n}\r\n","import {NgbTransitionStartFn} from '../util/transition/ngbTransition';\r\nimport {reflow} from '../util/util';\r\n\r\nexport const ngbToastFadeInTransition: NgbTransitionStartFn = (element: HTMLElement, animation: true) => {\r\n const {classList} = element;\r\n\r\n if (!animation) {\r\n classList.add('show');\r\n return;\r\n }\r\n\r\n classList.remove('hide');\r\n reflow(element);\r\n classList.add('showing');\r\n\r\n return () => {\r\n classList.remove('showing');\r\n classList.add('show');\r\n };\r\n};\r\n\r\nexport const ngbToastFadeOutTransition: NgbTransitionStartFn = ({classList}: HTMLElement) => {\r\n classList.remove('show');\r\n return () => { classList.add('hide'); };\r\n};\r\n","import {\r\n AfterContentInit,\r\n Attribute,\r\n Component,\r\n ContentChild,\r\n Directive,\r\n EventEmitter,\r\n Input,\r\n OnChanges,\r\n Output,\r\n SimpleChanges,\r\n TemplateRef,\r\n ViewEncapsulation,\r\n ElementRef,\r\n NgZone,\r\n} from '@angular/core';\r\n\r\nimport {Observable} from 'rxjs';\r\nimport {take} from 'rxjs/operators';\r\n\r\nimport {NgbToastConfig} from './toast-config';\r\nimport {ngbRunTransition} from '../util/transition/ngbTransition';\r\nimport {ngbToastFadeInTransition, ngbToastFadeOutTransition} from './toast-transition';\r\n\r\n\r\n/**\r\n * This directive allows the usage of HTML markup or other directives\r\n * inside of the toast's header.\r\n *\r\n * @since 5.0.0\r\n */\r\n@Directive({selector: '[ngbToastHeader]'})\r\nexport class NgbToastHeader {\r\n}\r\n\r\n/**\r\n * Toasts provide feedback messages as notifications to the user.\r\n * Goal is to mimic the push notifications available both on mobile and desktop operating systems.\r\n *\r\n * @since 5.0.0\r\n */\r\n@Component({\r\n selector: 'ngb-toast',\r\n exportAs: 'ngbToast',\r\n encapsulation: ViewEncapsulation.None,\r\n host: {\r\n 'role': 'alert',\r\n '[attr.aria-live]': 'ariaLive',\r\n 'aria-atomic': 'true',\r\n 'class': 'toast',\r\n '[class.fade]': 'animation',\r\n },\r\n template: `\r\n <ng-template #headerTpl>\r\n <strong class=\"mr-auto\">{{header}}</strong>\r\n </ng-template>\r\n <ng-template [ngIf]=\"contentHeaderTpl || header\">\r\n <div class=\"toast-header\">\r\n <ng-template [ngTemplateOutlet]=\"contentHeaderTpl || headerTpl\"></ng-template>\r\n <button type=\"button\" class=\"close\" aria-label=\"Close\" i18n-aria-label=\"@@ngb.toast.close-aria\" (click)=\"hide()\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n </ng-template>\r\n <div class=\"toast-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n `,\r\n styleUrls: ['./toast.scss']\r\n})\r\nexport class NgbToast implements AfterContentInit,\r\n OnChanges {\r\n /**\r\n * If `true`, toast opening and closing will be animated.\r\n *\r\n * Animation is triggered only when the `.hide()` or `.show()` functions are called\r\n *\r\n * @since 8.0.0\r\n */\r\n @Input() animation: boolean;\r\n\r\n private _timeoutID;\r\n\r\n /**\r\n * Delay after which the toast will hide (ms).\r\n * default: `500` (ms) (inherited from NgbToastConfig)\r\n */\r\n @Input() delay: number;\r\n\r\n /**\r\n * Auto hide the toast after a delay in ms.\r\n * default: `true` (inherited from NgbToastConfig)\r\n */\r\n @Input() autohide: boolean;\r\n\r\n /**\r\n * Text to be used as toast's header.\r\n * Ignored if a ContentChild template is specified at the same time.\r\n */\r\n @Input() header: string;\r\n\r\n /**\r\n * A template like `<ng-template ngbToastHeader></ng-template>` can be\r\n * used in the projected content to allow markup usage.\r\n */\r\n @ContentChild(NgbToastHeader, {read: TemplateRef, static: true}) contentHeaderTpl: TemplateRef<any>| null = null;\r\n\r\n /**\r\n * An event fired after the animation triggered by calling `.show()` method has finished.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() shown = new EventEmitter<void>();\r\n\r\n /**\r\n * An event fired after the animation triggered by calling `.hide()` method has finished.\r\n *\r\n * It can only occur in 2 different scenarios:\r\n * - `autohide` timeout fires\r\n * - user clicks on a closing cross\r\n *\r\n * Additionally this output is purely informative. The toast won't be removed from DOM automatically, it's up\r\n * to the user to take care of that.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Output() hidden = new EventEmitter<void>();\r\n\r\n constructor(\r\n @Attribute('aria-live') public ariaLive: string, config: NgbToastConfig, private _zone: NgZone,\r\n private _element: ElementRef) {\r\n if (this.ariaLive == null) {\r\n this.ariaLive = config.ariaLive;\r\n }\r\n this.delay = config.delay;\r\n this.autohide = config.autohide;\r\n this.animation = config.animation;\r\n }\r\n\r\n ngAfterContentInit() {\r\n this._zone.onStable.asObservable().pipe(take(1)).subscribe(() => {\r\n this._init();\r\n this.show();\r\n });\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if ('autohide' in changes) {\r\n this._clearTimeout();\r\n this._init();\r\n }\r\n }\r\n\r\n /**\r\n * Triggers toast closing programmatically.\r\n *\r\n * The returned observable will emit and be completed once the closing transition has finished.\r\n * If the animations are turned off this happens synchronously.\r\n *\r\n * Alternatively you could listen or subscribe to the `(hidden)` output\r\n *\r\n * @since 8.0.0\r\n */\r\n hide(): Observable<void> {\r\n this._clearTimeout();\r\n const transition = ngbRunTransition(\r\n this._zone, this._element.nativeElement, ngbToastFadeOutTransition,\r\n {animation: this.animation, runningTransition: 'stop'});\r\n transition.subscribe(() => { this.hidden.emit(); });\r\n return transition;\r\n }\r\n\r\n /**\r\n * Triggers toast opening programmatically.\r\n *\r\n * The returned observable will emit and be completed once the opening transition has finished.\r\n * If the animations are turned off this happens synchronously.\r\n *\r\n * Alternatively you could listen or subscribe to the `(shown)` output\r\n *\r\n * @since 8.0.0\r\n */\r\n show(): Observable<void> {\r\n const transition = ngbRunTransition(this._zone, this._element.nativeElement, ngbToastFadeInTransition, {\r\n animation: this.animation,\r\n runningTransition: 'continue',\r\n });\r\n transition.subscribe(() => { this.shown.emit(); });\r\n return transition;\r\n }\r\n\r\n private _init() {\r\n if (this.autohide && !this._timeoutID) {\r\n this._timeoutID = setTimeout(() => this.hide(), this.delay);\r\n }\r\n }\r\n\r\n private _clearTimeout() {\r\n if (this._timeoutID) {\r\n clearTimeout(this._timeoutID);\r\n this._timeoutID = null;\r\n }\r\n }\r\n}\r\n","import {CommonModule} from '@angular/common';\r\nimport {NgModule} from '@angular/core';\r\n\r\nimport {NgbToast, NgbToastHeader} from './toast';\r\n\r\nexport {NgbToast, NgbToastHeader} from './toast';\r\nexport {NgbToastConfig, NgbToastOptions} from './toast-config';\r\n\r\n@NgModule({declarations: [NgbToast, NgbToastHeader], imports: [CommonModule], exports: [NgbToast, NgbToastHeader]})\r\nexport class NgbToastModule {\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {PlacementArray} from '../util/positioning';\r\nimport {NgbConfig} from '../ngb-config';\r\n\r\n/**\r\n * A configuration service for the [`NgbTooltip`](#/components/tooltip/api#NgbTooltip) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the tooltips used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbTooltipConfig {\r\n autoClose: boolean | 'inside' | 'outside' = true;\r\n placement: PlacementArray = 'auto';\r\n triggers = 'hover focus';\r\n container: string;\r\n disableTooltip = false;\r\n tooltipClass: string;\r\n openDelay = 0;\r\n closeDelay = 0;\r\n\r\n private _animation: boolean;\r\n\r\n constructor(private _ngbConfig: NgbConfig) {}\r\n\r\n get animation(): boolean { return (this._animation === undefined) ? this._ngbConfig.animation : this._animation; }\r\n set animation(animation: boolean) { this._animation = animation; }\r\n}\r\n","import {\r\n Component,\r\n Directive,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n ChangeDetectionStrategy,\r\n OnInit,\r\n OnDestroy,\r\n Inject,\r\n Injector,\r\n Renderer2,\r\n ComponentRef,\r\n ElementRef,\r\n TemplateRef,\r\n ViewContainerRef,\r\n ComponentFactoryResolver,\r\n NgZone,\r\n ViewEncapsulation,\r\n ChangeDetectorRef,\r\n ApplicationRef,\r\n OnChanges,\r\n SimpleChanges\r\n} from '@angular/core';\r\nimport {DOCUMENT} from '@angular/common';\r\n\r\nimport {listenToTriggers} from '../util/triggers';\r\nimport {ngbAutoClose} from '../util/autoclose';\r\nimport {positionElements, PlacementArray} from '../util/positioning';\r\nimport {PopupService} from '../util/popup';\r\n\r\nimport {NgbTooltipConfig} from './tooltip-config';\r\n\r\nlet nextId = 0;\r\n\r\n@Component({\r\n selector: 'ngb-tooltip-window',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n host: {\r\n '[class]': '\"tooltip\" + (tooltipClass ? \" \" + tooltipClass : \"\")',\r\n '[class.fade]': 'animation',\r\n 'role': 'tooltip',\r\n '[id]': 'id'\r\n },\r\n template: `<div class=\"arrow\"></div><div class=\"tooltip-inner\"><ng-content></ng-content></div>`,\r\n styleUrls: ['./tooltip.scss']\r\n})\r\nexport class NgbTooltipWindow {\r\n @Input() animation: boolean;\r\n @Input() id: string;\r\n @Input() tooltipClass: string;\r\n}\r\n\r\n/**\r\n * A lightweight and extensible directive for fancy tooltip creation.\r\n */\r\n@Directive({selector: '[ngbTooltip]', exportAs: 'ngbTooltip'})\r\nexport class NgbTooltip implements OnInit, OnDestroy, OnChanges {\r\n static ngAcceptInputType_autoClose: boolean | string;\r\n\r\n /**\r\n * If `true`, tooltip opening and closing will be animated.\r\n *\r\n * @since 8.0.0\r\n */\r\n @Input() animation: boolean;\r\n\r\n /**\r\n * Indicates whether the tooltip should be closed on `Escape` key and inside/outside clicks:\r\n *\r\n * * `true` - closes on both outside and inside clicks as well as `Escape` presses\r\n * * `false` - disables the autoClose feature (NB: triggers still apply)\r\n * * `\"inside\"` - closes on inside clicks as well as Escape presses\r\n * * `\"outside\"` - closes on outside clicks (sometimes also achievable through triggers)\r\n * as well as `Escape` presses\r\n *\r\n * @since 3.0.0\r\n */\r\n @Input() autoClose: boolean | 'inside' | 'outside';\r\n\r\n /**\r\n * The preferred placement of the tooltip.\r\n *\r\n * Possible values are `\"top\"`, `\"top-left\"`, `\"top-right\"`, `\"bottom\"`, `\"bottom-left\"`,\r\n * `\"bottom-right\"`, `\"left\"`, `\"left-top\"`, `\"left-bottom\"`, `\"right\"`, `\"right-top\"`,\r\n * `\"right-bottom\"`\r\n *\r\n * Accepts an array of strings or a string with space separated possible values.\r\n *\r\n * The default order of preference is `\"auto\"` (same as the sequence above).\r\n *\r\n * Please see the [positioning overview](#/positioning) for more details.\r\n */\r\n @Input() placement: PlacementArray;\r\n\r\n /**\r\n * Specifies events that should trigger the tooltip.\r\n *\r\n * Supports a space separated list of event names.\r\n * For more details see the [triggers demo](#/components/tooltip/examples#triggers).\r\n */\r\n @Input() triggers: string;\r\n\r\n /**\r\n * A selector specifying the element the tooltip should be appended to.\r\n *\r\n * Currently only supports `\"body\"`.\r\n */\r\n @Input() container: string;\r\n\r\n /**\r\n * If `true`, tooltip is disabled and won't be displayed.\r\n *\r\n * @since 1.1.0\r\n */\r\n @Input() disableTooltip: boolean;\r\n\r\n /**\r\n * An optional class applied to the tooltip window element.\r\n *\r\n * @since 3.2.0\r\n */\r\n @Input() tooltipClass: string;\r\n\r\n /**\r\n * The opening delay in ms. Works only for \"non-manual\" opening triggers defined by the `triggers` input.\r\n *\r\n * @since 4.1.0\r\n */\r\n @Input() openDelay: number;\r\n\r\n /**\r\n * The closing delay in ms. Works only for \"non-manual\" opening triggers defined by the `triggers` input.\r\n *\r\n * @since 4.1.0\r\n */\r\n @Input() closeDelay: number;\r\n\r\n /**\r\n * An event emitted when the tooltip opening animation has finished. Contains no payload.\r\n */\r\n @Output() shown = new EventEmitter();\r\n\r\n /**\r\n * An event emitted when the tooltip closing animation has finished. Contains no payload.\r\n */\r\n @Output() hidden = new EventEmitter();\r\n\r\n private _ngbTooltip: string | TemplateRef<any>| null | undefined;\r\n private _ngbTooltipWindowId = `ngb-tooltip-${nextId++}`;\r\n private _popupService: PopupService<NgbTooltipWindow>;\r\n private _windowRef: ComponentRef<NgbTooltipWindow>| null = null;\r\n private _unregisterListenersFn;\r\n private _zoneSubscription: any;\r\n\r\n constructor(\r\n private _elementRef: ElementRef<HTMLElement>, private _renderer: Renderer2, injector: Injector,\r\n componentFactoryResolver: ComponentFactoryResolver, viewContainerRef: ViewContainerRef, config: NgbTooltipConfig,\r\n private _ngZone: NgZone, @Inject(DOCUMENT) private _document: any, private _changeDetector: ChangeDetectorRef,\r\n applicationRef: ApplicationRef) {\r\n this.animation = config.animation;\r\n this.autoClose = config.autoClose;\r\n this.placement = config.placement;\r\n this.triggers = config.triggers;\r\n this.container = config.container;\r\n this.disableTooltip = config.disableTooltip;\r\n this.tooltipClass = config.tooltipClass;\r\n this.openDelay = config.openDelay;\r\n this.closeDelay = config.closeDelay;\r\n this._popupService = new PopupService<NgbTooltipWindow>(\r\n NgbTooltipWindow, injector, viewContainerRef, _renderer, this._ngZone, componentFactoryResolver,\r\n applicationRef);\r\n\r\n this._zoneSubscription = _ngZone.onStable.subscribe(() => {\r\n if (this._windowRef) {\r\n positionElements(\r\n this._elementRef.nativeElement, this._windowRef.location.nativeElement, this.placement,\r\n this.container === 'body', 'bs-tooltip');\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * The string content or a `TemplateRef` for the content to be displayed in the tooltip.\r\n *\r\n * If the content if falsy, the tooltip won't open.\r\n */\r\n @Input()\r\n set ngbTooltip(value: string | TemplateRef<any>| null | undefined) {\r\n this._ngbTooltip = value;\r\n if (!value && this._windowRef) {\r\n this.close();\r\n }\r\n }\r\n\r\n get ngbTooltip() { return this._ngbTooltip; }\r\n\r\n /**\r\n * Opens the tooltip.\r\n *\r\n * This is considered to be a \"manual\" triggering.\r\n * The `context` is an optional value to be injected into the tooltip template when it is created.\r\n */\r\n open(context?: any) {\r\n if (!this._windowRef && this._ngbTooltip && !this.disableTooltip) {\r\n const {windowRef, transition$} = this._popupService.open(this._ngbTooltip, context, this.animation);\r\n this._windowRef = windowRef;\r\n this._windowRef.instance.animation = this.animation;\r\n this._windowRef.instance.tooltipClass = this.tooltipClass;\r\n this._windowRef.instance.id = this._ngbTooltipWindowId;\r\n\r\n this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', this._ngbTooltipWindowId);\r\n\r\n if (this.container === 'body') {\r\n this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);\r\n }\r\n\r\n // We need to detect changes, because we don't know where .open() might be called from.\r\n // Ex. opening tooltip from one of lifecycle hooks that run after the CD\r\n // (say from ngAfterViewInit) will result in 'ExpressionHasChanged' exception\r\n this._windowRef.changeDetectorRef.detectChanges();\r\n\r\n // We need to mark for check, because tooltip won't work inside the OnPush component.\r\n // Ex. when we use expression like `{{ tooltip.isOpen() : 'opened' : 'closed' }}`\r\n // inside the template of an OnPush component and we change the tooltip from\r\n // open -> closed, the expression in question won't be updated unless we explicitly\r\n // mark the parent component to be checked.\r\n this._windowRef.changeDetectorRef.markForCheck();\r\n\r\n ngbAutoClose(\r\n this._ngZone, this._document, this.autoClose, () => this.close(), this.hidden,\r\n [this._windowRef.location.nativeElement]);\r\n\r\n transition$.subscribe(() => this.shown.emit());\r\n }\r\n }\r\n\r\n /**\r\n * Closes the tooltip.\r\n *\r\n * This is considered to be a \"manual\" triggering of the tooltip.\r\n */\r\n close(): void {\r\n if (this._windowRef != null) {\r\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\r\n this._popupService.close(this.animation).subscribe(() => {\r\n this._windowRef = null;\r\n this.hidden.emit();\r\n this._changeDetector.markForCheck();\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Toggles the tooltip.\r\n *\r\n * This is considered to be a \"manual\" triggering of the tooltip.\r\n */\r\n toggle(): void {\r\n if (this._windowRef) {\r\n this.close();\r\n } else {\r\n this.open();\r\n }\r\n }\r\n\r\n /**\r\n * Returns `true`, if the popover is currently shown.\r\n */\r\n isOpen(): boolean { return this._windowRef != null; }\r\n\r\n ngOnInit() {\r\n this._unregisterListenersFn = listenToTriggers(\r\n this._renderer, this._elementRef.nativeElement, this.triggers, this.isOpen.bind(this), this.open.bind(this),\r\n this.close.bind(this), +this.openDelay, +this.closeDelay);\r\n }\r\n\r\n ngOnChanges({tooltipClass}: SimpleChanges) {\r\n if (tooltipClass && this.isOpen()) {\r\n this._windowRef !.instance.tooltipClass = tooltipClass.currentValue;\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.close();\r\n // This check is needed as it might happen that ngOnDestroy is called before ngOnInit\r\n // under certain conditions, see: https://github.com/ng-bootstrap/ng-bootstrap/issues/2199\r\n if (this._unregisterListenersFn) {\r\n this._unregisterListenersFn();\r\n }\r\n this._zoneSubscription.unsubscribe();\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\n\r\nimport {NgbTooltip, NgbTooltipWindow} from './tooltip';\r\n\r\nexport {NgbTooltipConfig} from './tooltip-config';\r\nexport {NgbTooltip} from './tooltip';\r\nexport {Placement} from '../util/positioning';\r\n\r\n@NgModule({declarations: [NgbTooltip, NgbTooltipWindow], exports: [NgbTooltip], entryComponents: [NgbTooltipWindow]})\r\nexport class NgbTooltipModule {\r\n}\r\n","import {Component, Input, OnChanges, ChangeDetectionStrategy, SimpleChanges, ViewEncapsulation} from '@angular/core';\r\nimport {regExpEscape, toString, removeAccents} from '../util/util';\r\n\r\n/**\r\n * A component that helps with text highlighting.\r\n *\r\n * If splits the `result` text into parts that contain the searched `term` and generates the HTML markup to simplify\r\n * highlighting:\r\n *\r\n * Ex. `result=\"Alaska\"` and `term=\"as\"` will produce `Al<span class=\"ngb-highlight\">as</span>ka`.\r\n */\r\n@Component({\r\n selector: 'ngb-highlight',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n template: `<ng-template ngFor [ngForOf]=\"parts\" let-part let-isOdd=\"odd\">` +\r\n `<span *ngIf=\"isOdd; else even\" [class]=\"highlightClass\">{{part}}</span><ng-template #even>{{part}}</ng-template>` +\r\n `</ng-template>`, // template needs to be formatted in a certain way so we don't add empty text nodes\r\n styleUrls: ['./highlight.scss']\r\n})\r\nexport class NgbHighlight implements OnChanges {\r\n parts: string[];\r\n\r\n /**\r\n * The CSS class for `<span>` elements wrapping the `term` inside the `result`.\r\n */\r\n @Input() highlightClass = 'ngb-highlight';\r\n\r\n /**\r\n * The text highlighting is added to.\r\n *\r\n * If the `term` is found inside this text, it will be highlighted.\r\n * If the `term` contains array then all the items from it will be highlighted inside the text.\r\n */\r\n @Input() result?: string | null;\r\n\r\n /**\r\n * The term or array of terms to be highlighted.\r\n * Since version `v4.2.0` term could be a `string[]`\r\n */\r\n @Input() term: string | readonly string[];\r\n\r\n /**\r\n * Boolean option to determine if the highlighting should be sensitive to accents or not.\r\n *\r\n * This feature is only available for browsers that implement the `String.normalize` function\r\n * (typically not Internet Explorer).\r\n * If you want to use this feature in a browser that does not implement `String.normalize`,\r\n * you will have to include a polyfill in your application (`unorm` for example).\r\n *\r\n * @since 9.1.0\r\n */\r\n @Input() accentSensitive = true;\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (!this.accentSensitive && !String.prototype.normalize) {\r\n console.warn(\r\n 'The `accentSensitive` input in `ngb-highlight` cannot be set to `false` in a browser ' +\r\n 'that does not implement the `String.normalize` function. ' +\r\n 'You will have to include a polyfill in your application to use this feature in the current browser.');\r\n this.accentSensitive = true;\r\n }\r\n const result = toString(this.result);\r\n\r\n const terms = Array.isArray(this.term) ? this.term : [this.term];\r\n const prepareTerm = term => this.accentSensitive ? term : removeAccents(term);\r\n const escapedTerms = terms.map(term => regExpEscape(prepareTerm(toString(term)))).filter(term => term);\r\n const toSplit = this.accentSensitive ? result : removeAccents(result);\r\n\r\n const parts = escapedTerms.length ? toSplit.split(new RegExp(`(${escapedTerms.join('|')})`, 'gmi')) : [result];\r\n\r\n if (this.accentSensitive) {\r\n this.parts = parts;\r\n } else {\r\n let offset = 0;\r\n this.parts = parts.map(part => result.substring(offset, offset += part.length));\r\n }\r\n }\r\n}\r\n","import {Component, EventEmitter, Input, OnInit, Output, TemplateRef, ViewEncapsulation} from '@angular/core';\r\n\r\nimport {toString} from '../util/util';\r\n\r\n/**\r\n * The context for the typeahead result template in case you want to override the default one.\r\n */\r\nexport interface ResultTemplateContext {\r\n /**\r\n * Your typeahead result item.\r\n */\r\n result: any;\r\n\r\n /**\r\n * Search term from the `<input>` used to get current result.\r\n */\r\n term: string;\r\n}\r\n\r\n@Component({\r\n selector: 'ngb-typeahead-window',\r\n exportAs: 'ngbTypeaheadWindow',\r\n encapsulation: ViewEncapsulation.None,\r\n host: {\r\n '(mousedown)': '$event.preventDefault()',\r\n '[class]': '\"dropdown-menu show\" + (popupClass ? \" \" + popupClass : \"\")',\r\n 'role': 'listbox',\r\n '[id]': 'id'\r\n },\r\n template: `\r\n <ng-template #rt let-result=\"result\" let-term=\"term\" let-formatter=\"formatter\">\r\n <ngb-highlight [result]=\"formatter(result)\" [term]=\"term\"></ngb-highlight>\r\n </ng-template>\r\n <ng-template ngFor [ngForOf]=\"results\" let-result let-idx=\"index\">\r\n <button type=\"button\" class=\"dropdown-item\" role=\"option\"\r\n [id]=\"id + '-' + idx\"\r\n [class.active]=\"idx === activeIdx\"\r\n (mouseenter)=\"markActive(idx)\"\r\n (click)=\"select(result)\">\r\n <ng-template [ngTemplateOutlet]=\"resultTemplate || rt\"\r\n [ngTemplateOutletContext]=\"{result: result, term: term, formatter: formatter}\"></ng-template>\r\n </button>\r\n </ng-template>\r\n `\r\n})\r\nexport class NgbTypeaheadWindow implements OnInit {\r\n activeIdx = 0;\r\n\r\n /**\r\n * The id for the typeahead window. The id should be unique and the same\r\n * as the associated typeahead's id.\r\n */\r\n @Input() id: string;\r\n\r\n /**\r\n * Flag indicating if the first row should be active initially\r\n */\r\n @Input() focusFirst = true;\r\n\r\n /**\r\n * Typeahead match results to be displayed\r\n */\r\n @Input() results;\r\n\r\n /**\r\n * Search term used to get current results\r\n */\r\n @Input() term: string;\r\n\r\n /**\r\n * A function used to format a given result before display. This function should return a formatted string without any\r\n * HTML markup\r\n */\r\n @Input() formatter = toString;\r\n\r\n /**\r\n * A template to override a matching result default display\r\n */\r\n @Input() resultTemplate: TemplateRef<ResultTemplateContext>;\r\n\r\n /**\r\n * A custom class to append to the typeahead window\r\n *\r\n * @since 9.1.0\r\n */\r\n @Input() popupClass: string;\r\n\r\n /**\r\n * Event raised when user selects a particular result row\r\n */\r\n @Output('select') selectEvent = new EventEmitter();\r\n\r\n @Output('activeChange') activeChangeEvent = new EventEmitter();\r\n\r\n hasActive() { return this.activeIdx > -1 && this.activeIdx < this.results.length; }\r\n\r\n getActive() { return this.results[this.activeIdx]; }\r\n\r\n markActive(activeIdx: number) {\r\n this.activeIdx = activeIdx;\r\n this._activeChanged();\r\n }\r\n\r\n next() {\r\n if (this.activeIdx === this.results.length - 1) {\r\n this.activeIdx = this.focusFirst ? (this.activeIdx + 1) % this.results.length : -1;\r\n } else {\r\n this.activeIdx++;\r\n }\r\n this._activeChanged();\r\n }\r\n\r\n prev() {\r\n if (this.activeIdx < 0) {\r\n this.activeIdx = this.results.length - 1;\r\n } else if (this.activeIdx === 0) {\r\n this.activeIdx = this.focusFirst ? this.results.length - 1 : -1;\r\n } else {\r\n this.activeIdx--;\r\n }\r\n this._activeChanged();\r\n }\r\n\r\n resetActive() {\r\n this.activeIdx = this.focusFirst ? 0 : -1;\r\n this._activeChanged();\r\n }\r\n\r\n select(item) { this.selectEvent.emit(item); }\r\n\r\n ngOnInit() { this.resetActive(); }\r\n\r\n private _activeChanged() {\r\n this.activeChangeEvent.emit(this.activeIdx >= 0 ? this.id + '-' + this.activeIdx : undefined);\r\n }\r\n}\r\n","import {Injectable, Inject, InjectionToken, OnDestroy} from '@angular/core';\r\nimport {DOCUMENT} from '@angular/common';\r\n\r\n\r\n\r\n// usefulness (and default value) of delay documented in Material's CDK\r\n// https://github.com/angular/material2/blob/6405da9b8e8532a7e5c854c920ee1815c275d734/src/cdk/a11y/live-announcer/live-announcer.ts#L50\r\nexport type ARIA_LIVE_DELAY_TYPE = number | null;\r\nexport const ARIA_LIVE_DELAY = new InjectionToken<ARIA_LIVE_DELAY_TYPE>(\r\n 'live announcer delay', {providedIn: 'root', factory: ARIA_LIVE_DELAY_FACTORY});\r\nexport function ARIA_LIVE_DELAY_FACTORY(): number {\r\n return 100;\r\n}\r\n\r\n\r\nfunction getLiveElement(document: any, lazyCreate = false): HTMLElement | null {\r\n let element = document.body.querySelector('#ngb-live') as HTMLElement;\r\n\r\n if (element == null && lazyCreate) {\r\n element = document.createElement('div');\r\n\r\n element.setAttribute('id', 'ngb-live');\r\n element.setAttribute('aria-live', 'polite');\r\n element.setAttribute('aria-atomic', 'true');\r\n\r\n element.classList.add('sr-only');\r\n\r\n document.body.appendChild(element);\r\n }\r\n\r\n return element;\r\n}\r\n\r\n\r\n\r\n@Injectable({providedIn: 'root'})\r\nexport class Live implements OnDestroy {\r\n constructor(@Inject(DOCUMENT) private _document: any, @Inject(ARIA_LIVE_DELAY) private _delay: any) {}\r\n\r\n ngOnDestroy() {\r\n const element = getLiveElement(this._document);\r\n if (element) {\r\n // if exists, it will always be attached to the <body>\r\n element.parentElement !.removeChild(element);\r\n }\r\n }\r\n\r\n say(message: string) {\r\n const element = getLiveElement(this._document, true);\r\n const delay = this._delay;\r\n\r\n if (element != null) {\r\n element.textContent = '';\r\n const setText = () => element.textContent = message;\r\n if (delay === null) {\r\n setText();\r\n } else {\r\n setTimeout(setText, delay);\r\n }\r\n }\r\n }\r\n}\r\n","import {Injectable} from '@angular/core';\r\nimport {PlacementArray} from '../util/positioning';\r\n\r\n/**\r\n * A configuration service for the [`NgbTypeahead`](#/components/typeahead/api#NgbTypeahead) component.\r\n *\r\n * You can inject this service, typically in your root component, and customize the values of its properties in\r\n * order to provide default values for all the typeaheads used in the application.\r\n */\r\n@Injectable({providedIn: 'root'})\r\nexport class NgbTypeaheadConfig {\r\n container;\r\n editable = true;\r\n focusFirst = true;\r\n showHint = false;\r\n placement: PlacementArray = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];\r\n}\r\n","import {\r\n ChangeDetectorRef,\r\n ComponentFactoryResolver,\r\n ComponentRef,\r\n Directive,\r\n ElementRef,\r\n EventEmitter,\r\n forwardRef,\r\n Inject,\r\n Injector,\r\n Input,\r\n NgZone,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n Renderer2,\r\n TemplateRef,\r\n ViewContainerRef,\r\n ApplicationRef,\r\n OnChanges,\r\n SimpleChanges\r\n} from '@angular/core';\r\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\r\nimport {DOCUMENT} from '@angular/common';\r\nimport {BehaviorSubject, fromEvent, Observable, of, OperatorFunction, Subject, Subscription} from 'rxjs';\r\nimport {map, switchMap, tap} from 'rxjs/operators';\r\n\r\nimport {Live} from '../util/accessibility/live';\r\nimport {ngbAutoClose} from '../util/autoclose';\r\nimport {Key} from '../util/key';\r\nimport {PopupService} from '../util/popup';\r\nimport {PlacementArray, positionElements} from '../util/positioning';\r\nimport {isDefined, toString} from '../util/util';\r\n\r\nimport {NgbTypeaheadConfig} from './typeahead-config';\r\nimport {NgbTypeaheadWindow, ResultTemplateContext} from './typeahead-window';\r\n\r\n/**\r\n * An event emitted right before an item is selected from the result list.\r\n */\r\nexport interface NgbTypeaheadSelectItemEvent<T = any> {\r\n /**\r\n * The item from the result list about to be selected.\r\n */\r\n item: T;\r\n\r\n /**\r\n * Calling this function will prevent item selection from happening.\r\n */\r\n preventDefault: () => void;\r\n}\r\n\r\nlet nextWindowId = 0;\r\n\r\n/**\r\n * A directive providing a simple way of creating powerful typeaheads from any text input.\r\n */\r\n@Directive({\r\n selector: 'input[ngbTypeahead]',\r\n exportAs: 'ngbTypeahead',\r\n host: {\r\n '(blur)': 'handleBlur()',\r\n '[class.open]': 'isPopupOpen()',\r\n '(keydown)': 'handleKeyDown($event)',\r\n '[autocomplete]': 'autocomplete',\r\n 'autocapitalize': 'off',\r\n 'autocorrect': 'off',\r\n 'role': 'combobox',\r\n 'aria-multiline': 'false',\r\n '[attr.aria-autocomplete]': 'showHint ? \"both\" : \"list\"',\r\n '[attr.aria-activedescendant]': 'activeDescendant',\r\n '[attr.aria-owns]': 'isPopupOpen() ? popupId : null',\r\n '[attr.aria-expanded]': 'isPopupOpen()'\r\n },\r\n providers: [{provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgbTypeahead), multi: true}]\r\n})\r\nexport class NgbTypeahead implements ControlValueAccessor,\r\n OnInit, OnChanges, OnDestroy {\r\n private _popupService: PopupService<NgbTypeaheadWindow>;\r\n private _subscription: Subscription | null = null;\r\n private _closed$ = new Subject();\r\n private _inputValueBackup: string | null = null;\r\n private _valueChanges: Observable<string>;\r\n private _resubscribeTypeahead: BehaviorSubject<any>;\r\n private _windowRef: ComponentRef<NgbTypeaheadWindow>| null = null;\r\n private _zoneSubscription: any;\r\n\r\n /**\r\n * The value for the `autocomplete` attribute for the `<input>` element.\r\n *\r\n * Defaults to `\"off\"` to disable the native browser autocomplete, but you can override it if necessary.\r\n *\r\n * @since 2.1.0\r\n */\r\n @Input() autocomplete = 'off';\r\n\r\n /**\r\n * A selector specifying the element the typeahead popup will be appended to.\r\n *\r\n * Currently only supports `\"body\"`.\r\n */\r\n @Input() container: string;\r\n\r\n /**\r\n * If `true`, model values will not be restricted only to items selected from the popup.\r\n */\r\n @Input() editable: boolean;\r\n\r\n /**\r\n * If `true`, the first item in the result list will always stay focused while typing.\r\n */\r\n @Input() focusFirst: boolean;\r\n\r\n /**\r\n * The function that converts an item from the result list to a `string` to display in the `<input>` field.\r\n *\r\n * It is called when the user selects something in the popup or the model value changes, so the input needs to\r\n * be updated.\r\n */\r\n @Input() inputFormatter: (item: any) => string;\r\n\r\n /**\r\n * The function that converts a stream of text values from the `<input>` element to the stream of the array of items\r\n * to display in the typeahead popup.\r\n *\r\n * If the resulting observable emits a non-empty array - the popup will be shown. If it emits an empty array - the\r\n * popup will be closed.\r\n *\r\n * See the [basic example](#/components/typeahead/examples#basic) for more details.\r\n *\r\n * Note that the `this` argument is `undefined` so you need to explicitly bind it to a desired \"this\" target.\r\n */\r\n @Input() ngbTypeahead: OperatorFunction<string, readonly any[]>| null | undefined;\r\n\r\n /**\r\n * The function that converts an item from the result list to a `string` to display in the popup.\r\n *\r\n * Must be provided, if your `ngbTypeahead` returns something other than `Observable<string[]>`.\r\n *\r\n * Alternatively for more complex markup in the popup you should use `resultTemplate`.\r\n */\r\n @Input() resultFormatter: (item: any) => string;\r\n\r\n /**\r\n * The template to override the way resulting items are displayed in the popup.\r\n *\r\n * See the [ResultTemplateContext](#/components/typeahead/api#ResultTemplateContext) for the template context.\r\n *\r\n * Also see the [template for results demo](#/components/typeahead/examples#template) for more details.\r\n */\r\n @Input() resultTemplate: TemplateRef<ResultTemplateContext>;\r\n\r\n /**\r\n * If `true`, will show the hint in the `<input>` when an item in the result list matches.\r\n */\r\n @Input() showHint: boolean;\r\n\r\n /**\r\n * The preferred placement of the typeahead.\r\n *\r\n * Possible values are `\"top\"`, `\"top-left\"`, `\"top-right\"`, `\"bottom\"`, `\"bottom-left\"`,\r\n * `\"bottom-right\"`, `\"left\"`, `\"left-top\"`, `\"left-bottom\"`, `\"right\"`, `\"right-top\"`,\r\n * `\"right-bottom\"`\r\n *\r\n * Accepts an array of strings or a string with space separated possible values.\r\n *\r\n * The default order of preference is `\"bottom-left bottom-right top-left top-right\"`\r\n *\r\n * Please see the [positioning overview](#/positioning) for more details.\r\n */\r\n @Input() placement: PlacementArray = 'bottom-left';\r\n\r\n /**\r\n * A custom class to append to the typeahead popup window\r\n *\r\n * Accepts a string containing CSS class to be applied on the `ngb-typeahead-window`.\r\n *\r\n * This can be used to provide instance-specific styling, ex. you can override popup window `z-index`\r\n *\r\n * @since 9.1.0\r\n */\r\n @Input() popupClass: string;\r\n\r\n /**\r\n * An event emitted right before an item is selected from the result list.\r\n *\r\n * Event payload is of type [`NgbTypeaheadSelectItemEvent`](#/components/typeahead/api#NgbTypeaheadSelectItemEvent).\r\n */\r\n @Output() selectItem = new EventEmitter<NgbTypeaheadSelectItemEvent>();\r\n\r\n activeDescendant: string | null = null;\r\n popupId = `ngb-typeahead-${nextWindowId++}`;\r\n\r\n private _onTouched = () => {};\r\n private _onChange = (_: any) => {};\r\n\r\n constructor(\r\n private _elementRef: ElementRef<HTMLInputElement>, viewContainerRef: ViewContainerRef,\r\n private _renderer: Renderer2, injector: Injector, componentFactoryResolver: ComponentFactoryResolver,\r\n config: NgbTypeaheadConfig, ngZone: NgZone, private _live: Live, @Inject(DOCUMENT) private _document: any,\r\n private _ngZone: NgZone, private _changeDetector: ChangeDetectorRef, applicationRef: ApplicationRef) {\r\n this.container = config.container;\r\n this.editable = config.editable;\r\n this.focusFirst = config.focusFirst;\r\n this.showHint = config.showHint;\r\n this.placement = config.placement;\r\n\r\n this._valueChanges = fromEvent<Event>(_elementRef.nativeElement, 'input')\r\n .pipe(map($event => ($event.target as HTMLInputElement).value));\r\n\r\n this._resubscribeTypeahead = new BehaviorSubject(null);\r\n\r\n this._popupService = new PopupService<NgbTypeaheadWindow>(\r\n NgbTypeaheadWindow, injector, viewContainerRef, _renderer, this._ngZone, componentFactoryResolver,\r\n applicationRef);\r\n\r\n this._zoneSubscription = ngZone.onStable.subscribe(() => {\r\n if (this.isPopupOpen()) {\r\n positionElements(\r\n this._elementRef.nativeElement, this._windowRef !.location.nativeElement, this.placement,\r\n this.container === 'body');\r\n }\r\n });\r\n }\r\n\r\n ngOnInit(): void { this._subscribeToUserInput(); }\r\n\r\n ngOnChanges({ngbTypeahead}: SimpleChanges): void {\r\n if (ngbTypeahead && !ngbTypeahead.firstChange) {\r\n this._unsubscribeFromUserInput();\r\n this._subscribeToUserInput();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._closePopup();\r\n this._unsubscribeFromUserInput();\r\n this._zoneSubscription.unsubscribe();\r\n }\r\n\r\n registerOnChange(fn: (value: any) => any): void { this._onChange = fn; }\r\n\r\n registerOnTouched(fn: () => any): void { this._onTouched = fn; }\r\n\r\n writeValue(value) {\r\n this._writeInputValue(this._formatItemForInput(value));\r\n if (this.showHint) {\r\n this._inputValueBackup = value;\r\n }\r\n }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\r\n }\r\n\r\n /**\r\n * Dismisses typeahead popup window\r\n */\r\n dismissPopup() {\r\n if (this.isPopupOpen()) {\r\n this._resubscribeTypeahead.next(null);\r\n this._closePopup();\r\n if (this.showHint && this._inputValueBackup !== null) {\r\n this._writeInputValue(this._inputValueBackup);\r\n }\r\n this._changeDetector.markForCheck();\r\n }\r\n }\r\n\r\n /**\r\n * Returns true if the typeahead popup window is displayed\r\n */\r\n isPopupOpen() { return this._windowRef != null; }\r\n\r\n handleBlur() {\r\n this._resubscribeTypeahead.next(null);\r\n this._onTouched();\r\n }\r\n\r\n handleKeyDown(event: KeyboardEvent) {\r\n if (!this.isPopupOpen()) {\r\n return;\r\n }\r\n\r\n // tslint:disable-next-line:deprecation\r\n switch (event.which) {\r\n case Key.ArrowDown:\r\n event.preventDefault();\r\n this._windowRef !.instance.next();\r\n this._showHint();\r\n break;\r\n case Key.ArrowUp:\r\n event.preventDefault();\r\n this._windowRef !.instance.prev();\r\n this._showHint();\r\n break;\r\n case Key.Enter:\r\n case Key.Tab:\r\n const result = this._windowRef !.instance.getActive();\r\n if (isDefined(result)) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this._selectResult(result);\r\n }\r\n this._closePopup();\r\n break;\r\n }\r\n }\r\n\r\n private _openPopup() {\r\n if (!this.isPopupOpen()) {\r\n this._inputValueBackup = this._elementRef.nativeElement.value;\r\n const {windowRef} = this._popupService.open();\r\n this._windowRef = windowRef;\r\n this._windowRef.instance.id = this.popupId;\r\n this._windowRef.instance.selectEvent.subscribe((result: any) => this._selectResultClosePopup(result));\r\n this._windowRef.instance.activeChangeEvent.subscribe((activeId: string) => this.activeDescendant = activeId);\r\n this._windowRef.instance.popupClass = this.popupClass;\r\n\r\n if (this.container === 'body') {\r\n this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);\r\n }\r\n\r\n this._changeDetector.markForCheck();\r\n\r\n ngbAutoClose(\r\n this._ngZone, this._document, 'outside', () => this.dismissPopup(), this._closed$,\r\n [this._elementRef.nativeElement, this._windowRef.location.nativeElement]);\r\n }\r\n }\r\n\r\n private _closePopup() {\r\n this._popupService.close().subscribe(() => {\r\n this._closed$.next();\r\n this._windowRef = null;\r\n this.activeDescendant = null;\r\n });\r\n }\r\n\r\n private _selectResult(result: any) {\r\n let defaultPrevented = false;\r\n this.selectItem.emit({item: result, preventDefault: () => { defaultPrevented = true; }});\r\n this._resubscribeTypeahead.next(null);\r\n\r\n if (!defaultPrevented) {\r\n this.writeValue(result);\r\n this._onChange(result);\r\n }\r\n }\r\n\r\n private _selectResultClosePopup(result: any) {\r\n this._selectResult(result);\r\n this._closePopup();\r\n }\r\n\r\n private _showHint() {\r\n if (this.showHint && this._windowRef?.instance.hasActive() && this._inputValueBackup != null) {\r\n const userInputLowerCase = this._inputValueBackup.toLowerCase();\r\n const formattedVal = this._formatItemForInput(this._windowRef.instance.getActive());\r\n\r\n if (userInputLowerCase === formattedVal.substr(0, this._inputValueBackup.length).toLowerCase()) {\r\n this._writeInputValue(this._inputValueBackup + formattedVal.substr(this._inputValueBackup.length));\r\n this._elementRef.nativeElement['setSelectionRange'].apply(\r\n this._elementRef.nativeElement, [this._inputValueBackup.length, formattedVal.length]);\r\n } else {\r\n this._writeInputValue(formattedVal);\r\n }\r\n }\r\n }\r\n\r\n private _formatItemForInput(item: any): string {\r\n return item != null && this.inputFormatter ? this.inputFormatter(item) : toString(item);\r\n }\r\n\r\n private _writeInputValue(value: string): void {\r\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', toString(value));\r\n }\r\n\r\n private _subscribeToUserInput(): void {\r\n const results$ = this._valueChanges.pipe(\r\n tap(value => {\r\n this._inputValueBackup = this.showHint ? value : null;\r\n this._onChange(this.editable ? value : undefined);\r\n }),\r\n this.ngbTypeahead ? this.ngbTypeahead : () => of([]));\r\n\r\n this._subscription = this._resubscribeTypeahead.pipe(switchMap(() => results$)).subscribe(results => {\r\n if (!results || results.length === 0) {\r\n this._closePopup();\r\n } else {\r\n this._openPopup();\r\n\r\n this._windowRef !.instance.focusFirst = this.focusFirst;\r\n this._windowRef !.instance.results = results;\r\n this._windowRef !.instance.term = this._elementRef.nativeElement.value;\r\n if (this.resultFormatter) {\r\n this._windowRef !.instance.formatter = this.resultFormatter;\r\n }\r\n if (this.resultTemplate) {\r\n this._windowRef !.instance.resultTemplate = this.resultTemplate;\r\n }\r\n this._windowRef !.instance.resetActive();\r\n\r\n // The observable stream we are subscribing to might have async steps\r\n // and if a component containing typeahead is using the OnPush strategy\r\n // the change detection turn wouldn't be invoked automatically.\r\n this._windowRef !.changeDetectorRef.detectChanges();\r\n\r\n this._showHint();\r\n }\r\n\r\n // live announcer\r\n const count = results ? results.length : 0;\r\n this._live.say(count === 0 ? 'No results available' : `${count} result${count === 1 ? '' : 's'} available`);\r\n });\r\n }\r\n\r\n private _unsubscribeFromUserInput() {\r\n if (this._subscription) {\r\n this._subscription.unsubscribe();\r\n }\r\n this._subscription = null;\r\n }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport {NgbHighlight} from './highlight';\r\nimport {NgbTypeaheadWindow} from './typeahead-window';\r\nimport {NgbTypeahead} from './typeahead';\r\n\r\nexport {NgbHighlight} from './highlight';\r\nexport {NgbTypeaheadWindow} from './typeahead-window';\r\nexport {NgbTypeaheadConfig} from './typeahead-config';\r\nexport {NgbTypeahead, NgbTypeaheadSelectItemEvent} from './typeahead';\r\n\r\n@NgModule({\r\n declarations: [NgbTypeahead, NgbHighlight, NgbTypeaheadWindow],\r\n exports: [NgbTypeahead, NgbHighlight],\r\n imports: [CommonModule],\r\n entryComponents: [NgbTypeaheadWindow]\r\n})\r\nexport class NgbTypeaheadModule {\r\n}\r\n","import {NgModule} from '@angular/core';\r\n\r\nimport {NgbAccordionModule} from './accordion/accordion.module';\r\nimport {NgbAlertModule} from './alert/alert.module';\r\nimport {NgbButtonsModule} from './buttons/buttons.module';\r\nimport {NgbCarouselModule} from './carousel/carousel.module';\r\nimport {NgbCollapseModule} from './collapse/collapse.module';\r\nimport {NgbDatepickerModule} from './datepicker/datepicker.module';\r\nimport {NgbDropdownModule} from './dropdown/dropdown.module';\r\nimport {NgbModalModule} from './modal/modal.module';\r\nimport {NgbNavModule} from './nav/nav.module';\r\nimport {NgbPaginationModule} from './pagination/pagination.module';\r\nimport {NgbPopoverModule} from './popover/popover.module';\r\nimport {NgbProgressbarModule} from './progressbar/progressbar.module';\r\nimport {NgbRatingModule} from './rating/rating.module';\r\nimport {NgbTimepickerModule} from './timepicker/timepicker.module';\r\nimport {NgbToastModule} from './toast/toast.module';\r\nimport {NgbTooltipModule} from './tooltip/tooltip.module';\r\nimport {NgbTypeaheadModule} from './typeahead/typeahead.module';\r\n\r\n\r\n\r\nexport {\r\n NgbAccordion,\r\n NgbAccordionConfig,\r\n NgbAccordionModule,\r\n NgbPanel,\r\n NgbPanelChangeEvent,\r\n NgbPanelContent,\r\n NgbPanelHeader,\r\n NgbPanelHeaderContext,\r\n NgbPanelTitle,\r\n NgbPanelToggle\r\n} from './accordion/accordion.module';\r\nexport {NgbAlert, NgbAlertConfig, NgbAlertModule} from './alert/alert.module';\r\nexport {NgbButtonLabel, NgbButtonsModule, NgbCheckBox, NgbRadio, NgbRadioGroup} from './buttons/buttons.module';\r\nexport {\r\n NgbCarousel,\r\n NgbCarouselConfig,\r\n NgbCarouselModule,\r\n NgbSlide,\r\n NgbSlideEvent,\r\n NgbSlideEventDirection,\r\n NgbSlideEventSource\r\n} from './carousel/carousel.module';\r\nexport {NgbCollapse, NgbCollapseConfig, NgbCollapseModule} from './collapse/collapse.module';\r\nexport {\r\n NgbCalendar,\r\n NgbCalendarGregorian,\r\n NgbCalendarHebrew,\r\n NgbCalendarIslamicCivil,\r\n NgbCalendarIslamicUmalqura,\r\n NgbCalendarPersian,\r\n NgbCalendarBuddhist,\r\n NgbDate,\r\n NgbDateAdapter,\r\n NgbDateNativeAdapter,\r\n NgbDateNativeUTCAdapter,\r\n NgbDateParserFormatter,\r\n NgbDatepicker,\r\n NgbDatepickerConfig,\r\n NgbInputDatepickerConfig,\r\n NgbDatepickerContent,\r\n NgbDatepickerI18n,\r\n NgbDatepickerI18nDefault,\r\n NgbDatepickerI18nHebrew,\r\n NgbDatepickerKeyboardService,\r\n NgbDatepickerModule,\r\n NgbDatepickerMonth,\r\n NgbDatepickerNavigateEvent,\r\n NgbDatepickerState,\r\n NgbDateStruct,\r\n NgbInputDatepicker,\r\n NgbPeriod\r\n} from './datepicker/datepicker.module';\r\nexport {\r\n NgbDropdown,\r\n NgbDropdownAnchor,\r\n NgbDropdownConfig,\r\n NgbDropdownItem,\r\n NgbDropdownMenu,\r\n NgbDropdownModule,\r\n NgbDropdownToggle,\r\n NgbNavbar\r\n} from './dropdown/dropdown.module';\r\nexport {\r\n ModalDismissReasons,\r\n NgbActiveModal,\r\n NgbModal,\r\n NgbModalConfig,\r\n NgbModalModule,\r\n NgbModalOptions,\r\n NgbModalRef\r\n} from './modal/modal.module';\r\nexport {\r\n NgbNavChangeEvent,\r\n NgbNavConfig,\r\n NgbNav,\r\n NgbNavContent,\r\n NgbNavContentContext,\r\n NgbNavItem,\r\n NgbNavLink,\r\n NgbNavModule,\r\n NgbNavOutlet,\r\n NgbNavPane\r\n} from './nav/nav.module';\r\nexport {\r\n NgbPagination,\r\n NgbPaginationConfig,\r\n NgbPaginationEllipsis,\r\n NgbPaginationFirst,\r\n NgbPaginationLast,\r\n NgbPaginationModule,\r\n NgbPaginationNext,\r\n NgbPaginationNumber,\r\n NgbPaginationPrevious,\r\n NgbPaginationPages\r\n} from './pagination/pagination.module';\r\nexport {NgbPopover, NgbPopoverConfig, NgbPopoverModule} from './popover/popover.module';\r\nexport {NgbProgressbar, NgbProgressbarConfig, NgbProgressbarModule} from './progressbar/progressbar.module';\r\nexport {NgbRating, NgbRatingConfig, NgbRatingModule} from './rating/rating.module';\r\nexport {\r\n NgbTimeAdapter,\r\n NgbTimepickerI18n,\r\n NgbTimepicker,\r\n NgbTimepickerConfig,\r\n NgbTimepickerModule,\r\n NgbTimeStruct\r\n} from './timepicker/timepicker.module';\r\nexport {NgbToast, NgbToastConfig, NgbToastHeader, NgbToastModule} from './toast/toast.module';\r\nexport {NgbTooltip, NgbTooltipConfig, NgbTooltipModule} from './tooltip/tooltip.module';\r\nexport {\r\n NgbHighlight,\r\n NgbTypeahead,\r\n NgbTypeaheadConfig,\r\n NgbTypeaheadModule,\r\n NgbTypeaheadSelectItemEvent\r\n} from './typeahead/typeahead.module';\r\nexport {Placement} from './util/positioning';\r\n\r\nexport {NgbConfig} from './ngb-config';\r\n\r\n\r\nconst NGB_MODULES = [\r\n NgbAccordionModule, NgbAlertModule, NgbButtonsModule, NgbCarouselModule, NgbCollapseModule, NgbDatepickerModule,\r\n NgbDropdownModule, NgbModalModule, NgbNavModule, NgbPaginationModule, NgbPopoverModule, NgbProgressbarModule,\r\n NgbRatingModule, NgbTimepickerModule, NgbToastModule, NgbTooltipModule, NgbTypeaheadModule\r\n];\r\n\r\n@NgModule({imports: NGB_MODULES, exports: NGB_MODULES})\r\nexport class NgbModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {NGB_CAROUSEL_DIRECTIVES as ɵa} from './carousel/carousel';\nexport {NGB_DATEPICKER_DATE_ADAPTER_FACTORY as ɵg,NgbDateStructAdapter as ɵh} from './datepicker/adapters/ngb-date-adapter';\nexport {NgbDatepickerDayView as ɵc} from './datepicker/datepicker-day-view';\nexport {NGB_DATEPICKER_18N_FACTORY as ɵf} from './datepicker/datepicker-i18n';\nexport {NgbDatepickerNavigation as ɵd} from './datepicker/datepicker-navigation';\nexport {NgbDatepickerNavigationSelect as ɵe} from './datepicker/datepicker-navigation-select';\nexport {NgbDatepickerService as ɵr} from './datepicker/datepicker-service';\nexport {NgbCalendarHijri as ɵz} from './datepicker/hijri/ngb-calendar-hijri';\nexport {NGB_DATEPICKER_CALENDAR_FACTORY as ɵb} from './datepicker/ngb-calendar';\nexport {NGB_DATEPICKER_PARSER_FORMATTER_FACTORY as ɵi,NgbDateISOParserFormatter as ɵj} from './datepicker/ngb-date-parser-formatter';\nexport {NgbModalBackdrop as ɵs} from './modal/modal-backdrop';\nexport {NgbModalStack as ɵu} from './modal/modal-stack';\nexport {NgbModalWindow as ɵt} from './modal/modal-window';\nexport {NgbPopoverWindow as ɵk} from './popover/popover';\nexport {NGB_DATEPICKER_TIME_ADAPTER_FACTORY as ɵl,NgbTimeStructAdapter as ɵm} from './timepicker/ngb-time-adapter';\nexport {NGB_TIMEPICKER_I18N_FACTORY as ɵn,NgbTimepickerI18nDefault as ɵo} from './timepicker/timepicker-i18n';\nexport {NgbTooltipWindow as ɵp} from './tooltip/tooltip';\nexport {NgbTypeaheadWindow as ɵq} from './typeahead/typeahead-window';\nexport {ARIA_LIVE_DELAY as ɵw,ARIA_LIVE_DELAY_FACTORY as ɵx,Live as ɵy} from './util/accessibility/live';\nexport {ContentRef as ɵba} from './util/popup';\nexport {ScrollBar as ɵv} from './util/scrollbar';"],"names":["nextId","mod","GREGORIAN_EPOCH","isGregorianLeapYear","fromGregorian","toGregorian"],"mappings":";;;;;;SAGgB,SAAS,CAAC,KAAU;IAClC,OAAO,QAAQ,CAAC,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;AAClC,CAAC;SAEe,QAAQ,CAAC,KAAU;IACjC,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,KAAK,EAAE,GAAG,EAAE,CAAC;AACnE,CAAC;SAEe,eAAe,CAAC,KAAa,EAAE,GAAW,EAAE,GAAG,GAAG,CAAC;IACjE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC;SAEe,QAAQ,CAAC,KAAU;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;SAEe,QAAQ,CAAC,KAAU;IACjC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAClC,CAAC;SAEe,SAAS,CAAC,KAAU;IAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;AACrF,CAAC;SAEe,SAAS,CAAC,KAAU;IAClC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;AAC/C,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