From df2f5d99671d7da4da2d332b5a83d26fc418eae8 Mon Sep 17 00:00:00 2001 From: Nicolas Daures Date: Fri, 18 Mar 2022 15:54:09 +0100 Subject: [PATCH] DATA-122: fix JQuery import. --- .../esm2020/lib/daterangepicker.component.mjs | 60 +++++------ .../fesm2015/ng2-daterangepicker.mjs | 59 +++++------ .../fesm2015/ng2-daterangepicker.mjs.map | 2 +- .../fesm2020/ng2-daterangepicker.mjs | 59 +++++------ .../fesm2020/ng2-daterangepicker.mjs.map | 2 +- dist/ng2-daterangepicker/package.json | 2 +- projects/ng2-daterangepicker/package.json | 2 +- .../src/lib/daterangepicker.component.ts | 100 ++++++++---------- 8 files changed, 135 insertions(+), 151 deletions(-) diff --git a/dist/ng2-daterangepicker/esm2020/lib/daterangepicker.component.mjs b/dist/ng2-daterangepicker/esm2020/lib/daterangepicker.component.mjs index 9ff0d60..426b65b 100644 --- a/dist/ng2-daterangepicker/esm2020/lib/daterangepicker.component.mjs +++ b/dist/ng2-daterangepicker/esm2020/lib/daterangepicker.component.mjs @@ -1,7 +1,7 @@ import { Directive, Input, Output, EventEmitter } from '@angular/core'; import { KeyValueDiffers, ElementRef } from '@angular/core'; import { DaterangepickerConfig } from './config.service'; -import * as $ from "jquery"; +import $ from "jquery"; import 'bootstrap-daterangepicker'; import * as i0 from "@angular/core"; import * as i1 from "./config.service"; @@ -33,38 +33,34 @@ export class DaterangePickerComponent { render() { this.targetOptions = Object.assign({}, this.config.settings, this.options); // cast $ to any to avoid jquery type checking - if ($) { - $(this.input.nativeElement).daterangepicker(this.targetOptions, this.callback.bind(this)); - this.datePicker = $(this.input.nativeElement).data('daterangepicker'); - } + $(this.input.nativeElement).daterangepicker(this.targetOptions, this.callback.bind(this)); + this.datePicker = $(this.input.nativeElement).data('daterangepicker'); } attachEvents() { - if ($) { - $(this.input.nativeElement).on('cancel.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.cancelDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('apply.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.applyDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('hideCalendar.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.hideCalendarDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('showCalendar.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.showCalendarDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('hide.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.hideDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('show.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.showDaterangepicker.emit(event); - }); - } + $(this.input.nativeElement).on('cancel.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.cancelDaterangepicker.emit(event); + }); + $(this.input.nativeElement).on('apply.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.applyDaterangepicker.emit(event); + }); + $(this.input.nativeElement).on('hideCalendar.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.hideCalendarDaterangepicker.emit(event); + }); + $(this.input.nativeElement).on('showCalendar.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.showCalendarDaterangepicker.emit(event); + }); + $(this.input.nativeElement).on('hide.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.hideDaterangepicker.emit(event); + }); + $(this.input.nativeElement).on('show.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.showDaterangepicker.emit(event); + }); } callback(start, end, label) { this.activeRange = { @@ -122,4 +118,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor }], showDaterangepicker: [{ type: Output }] } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXJhbmdlcGlja2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3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2ZUVsZW1lbnQpKS5kYXRlcmFuZ2VwaWNrZXIodGhpcy50YXJnZXRPcHRpb25zLCB0aGlzLmNhbGxiYWNrLmJpbmQodGhpcykpO1xyXG4gICAgICAgICAgICB0aGlzLmRhdGVQaWNrZXIgPSAoPGFueT4kKHRoaXMuaW5wdXQubmF0aXZlRWxlbWVudCkpLmRhdGEoJ2RhdGVyYW5nZXBpY2tlcicpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBhdHRhY2hFdmVudHMoKSB7XHJcbiAgICAgICAgaWYgKCQpXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICAkKHRoaXMuaW5wdXQubmF0aXZlRWxlbWVudCkub24oJ2NhbmNlbC5kYXRlcmFuZ2VwaWNrZXInLFxyXG4gICAgICAgICAgICAgICAgKGU6YW55LCBwaWNrZXI6YW55KSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGV2ZW50ID0geyBldmVudDogZSwgcGlja2VyOiBwaWNrZXIgfTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbmNlbERhdGVyYW5nZXBpY2tlci5lbWl0KGV2ZW50KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgKTtcclxuXHJcbiAgICAgICAgICAgICQodGhpcy5pbnB1dC5uYXRpdmVFbGVtZW50KS5vbignYXBwbHkuZGF0ZXJhbmdlcGlja2VyJyxcclxuICAgICAgICAgICAgICAgIChlOmFueSwgcGlja2VyOmFueSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBldmVudCA9IHsgZXZlbnQ6IGUsIHBpY2tlcjogcGlja2VyIH07XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5hcHBseURhdGVyYW5nZXBpY2tlci5lbWl0KGV2ZW50KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgKTtcclxuXHJcbiAgICAgICAgICAgICQodGhpcy5pbnB1dC5uYXRpdmVFbGVtZW50KS5vbignaGlkZUNhbGVuZGFyLmRhdGVyYW5nZXBpY2tlcicsXHJcbiAgICAgICAgICAgICAgICAoZTphbnksIHBpY2tlcjphbnkpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgZXZlbnQgPSB7IGV2ZW50OiBlLCBwaWNrZXI6IHBpY2tlciB9O1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaGlkZUNhbGVuZGFyRGF0ZXJhbmdlcGlja2VyLmVtaXQoZXZlbnQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICApO1xyXG5cclxuICAgICAgICAgICAgJCh0aGlzLmlucHV0Lm5hdGl2ZUVsZW1lbnQpLm9uKCdzaG93Q2FsZW5kYXIuZGF0ZXJhbmdlcGlja2VyJyxcclxuICAgICAgICAgICAgICAgIChlOmFueSwgcGlja2VyOmFueSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBldmVudCA9IHsgZXZlbnQ6IGUsIHBpY2tlcjogcGlja2VyIH07XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zaG93Q2FsZW5kYXJEYXRlcmFuZ2VwaWNrZXIuZW1pdChldmVudCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICk7XHJcblxyXG4gICAgICAgICAgICAkKHRoaXMuaW5wdXQubmF0aXZlRWxlbWVudCkub24oJ2hpZGUuZGF0ZXJhbmdlcGlja2VyJyxcclxuICAgICAgICAgICAgICAgIChlOmFueSwgcGlja2VyOmFueSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBldmVudCA9IHsgZXZlbnQ6IGUsIHBpY2tlcjogcGlja2VyIH07XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5oaWRlRGF0ZXJhbmdlcGlja2VyLmVtaXQoZXZlbnQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICApO1xyXG5cclxuICAgICAgICAgICAgJCh0aGlzLmlucH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kge1xyXG4gICAgICAgIGxldCBvcHRpb25zQ2hhbmdlZCA9IHRoaXMuX2RpZmZlclsnb3B0aW9ucyddLmRpZmYodGhpcy5vcHRpb25zKTtcclxuICAgICAgICBsZXQgc2V0dGluZ3NDaGFuZ2VkID0gdGhpcy5fZGlmZmVyWydzZXR0aW5ncyddLmRpZmYodGhpcy5jb25maWcuc2V0dGluZ3MpO1xyXG5cclxuICAgICAgICBpZihvcHRpb25zQ2hhbmdlZCB8fCBzZXR0aW5nc0NoYW5nZWQpIHtcclxuICAgICAgICAgICAgdGhpcy5yZW5kZXIoKTtcclxuICAgICAgICAgICAgdGhpcy5hdHRhY2hFdmVudHMoKTtcclxuICAgICAgICAgICAgaWYodGhpcy5hY3RpdmVSYW5nZSAmJiB0aGlzLmRhdGVQaWNrZXIpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuZGF0ZVBpY2tlci5zZXRTdGFydERhdGUodGhpcy5hY3RpdmVSYW5nZS5zdGFydCk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmRhdGVQaWNrZXIuc2V0RW5kRGF0ZSh0aGlzLmFjdGl2ZVJhbmdlLmVuZCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuIl19 \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXJhbmdlcGlja2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL25nMi1kYXRlcmFuZ2VwaWNrZXIvc3JjL2xpYi9kYXRlcmFuZ2VwaWNrZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQWlCLEtBQUssRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3RGL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BwaWNrZXIgfTtcclxuICAgICAgICAgICAgICAgIHRoaXMuY2FuY2VsRGF0ZXJhbmdlcGlja2VyLmVtaXQoZXZlbnQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgKTtcclxuXHJcbiAgICAgICAgJCh0aGlzLmlucHV0Lm5hdGl2ZUVsZW1lbnQpLm9uKCdhcHBseS5kYXRlcmFuZ2VwaWNrZXInLFxyXG4gICAgICAgICAgICAoZTphbnksIHBpY2tlcjphbnkpID0+IHtcclxuICAgICAgICAgICAgICAgIGxldCBldmVudCA9IHsgZXZlbnQ6IGUsIHBpY2tlcjogcGlja2VyIH07XHJcbiAgICAgICAgICAgICAgICB0aGlzLmFwcGx5RGF0ZXJhbmdlcGlja2VyLmVtaXQoZXZlbnQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgKTtcclxuXHJcbiAgICAgICAgJCh0aGlzLmlucHV0Lm5hdGl2ZUVsZW1lbnQpLm9uKCdoaWRlQ2FsZW5kYXIuZGF0ZXJhbmdlcGlja2VyJyxcclxuICAgICAgICAgICAgKGU6YW55LCBwaWNrZXI6YW55KSA9PiB7XHJcbiAgICAgICAgICAgICAgICBsZXQgZXZlbnQgPSB7IGV2ZW50OiBlLCBwaWNrZXI6IHBpY2tlciB9O1xyXG4gICAgICAgICAgICAgICAgdGhpcy5oaWRlQ2FsZW5kYXJEYXRlcmFuZ2VwaWNrZXIuZW1pdChldmVudCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICApO1xyXG5cclxuICAgICAgICAkKHRoaXMuaW5wdXQubmF0aXZlRWxlbWVudCkub24oJ3Nob3dDYWxlbmRhci5kYXRlcmFuZ2VwaWNrZXInLFxyXG4gICAgICAgICAgICAoZTphbnksIHBpY2tlcjphbnkpID0+IHtcclxuICAgICAgICAgICAgICAgIGxldCBldmVudCA9IHsgZXZlbnQ6IGUsIHBpY2tlcjogcGlja2VyIH07XHJcbiAgICAgICAgICAgICAgICB0aGlzLnNob3dDYWxlbmRhckRhdGVyYW5nZXBpY2tlci5lbWl0KGV2ZW50KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICk7XHJcblxyXG4gICAgICAgICQodGhpcy5pbnB1dC5uYXRpdmVFbGVtZW50KS5vbignaGlkZS5kYXRlcmFuZ2VwaWNrZXInLFxyXG4gICAgICAgICAgICAoZTphbnksIHBpY2tlcjphbnkpID0+IHtcclxuICAgICAgICAgICAgICAgIGxldCBldmVudCA9IHsgZXZlbnQ6IGUsIHBpY2tlcjogcGlja2VyIH07XHJcbiAgICAgICAgICAgICAgICB0aGlzLmhpZGVEYXRlcmFuZ2VwaWNrZXIuZW1pdChldmVudCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICApO1xyXG5cclxuICAgICAgICAkKHRoaXMuaW5wdXQubmF0aXZlRWxlbWVudCkub24oJ3Nob3cuZGF0ZXJhbmdlcGlja2VyJyxcclxuICAgICAgICAgICAgKGU6YW55LCBwaWNrZXI6YW55KSA9PiB7XHJcbiAgICAgICAgICAgICAgICBsZXQgZXZlbnQgPSB7IGV2ZW50OiBlLCBwaWNrZXI6IHBpY2tlciB9O1xyXG4gICAgICAgICAgICAgICAgdGhpcy5zaG93RGF0ZXJhbmdlcGlja2VyLmVtaXQoZXZlbnQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgKTtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIGNhbGxiYWNrKHN0YXJ0PzogYW55LCBlbmQ/OiBhbnksIGxhYmVsPzogYW55KTogdm9pZCB7XHJcbiAgICAgICAgdGhpcy5hY3RpdmVSYW5nZSA9IHtcclxuICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LFxyXG4gICAgICAgICAgICBlbmQ6IGVuZCxcclxuICAgICAgICAgICAgbGFiZWw6IGxhYmVsXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICB0aGlzLnNlbGVjdGVkLmVtaXQodGhpcy5hY3RpdmVSYW5nZSk7XHJcbiAgICB9XH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clxufVxyXG4iXX0= \ No newline at end of file diff --git a/dist/ng2-daterangepicker/fesm2015/ng2-daterangepicker.mjs b/dist/ng2-daterangepicker/fesm2015/ng2-daterangepicker.mjs index 33330ab..c51a995 100644 --- a/dist/ng2-daterangepicker/fesm2015/ng2-daterangepicker.mjs +++ b/dist/ng2-daterangepicker/fesm2015/ng2-daterangepicker.mjs @@ -1,6 +1,7 @@ import * as i0 from '@angular/core'; import { Injectable, EventEmitter, Directive, Input, Output, NgModule } from '@angular/core'; import * as $ from 'jquery'; +import $__default from 'jquery'; import 'bootstrap-daterangepicker'; class DaterangepickerConfig { @@ -55,38 +56,34 @@ class DaterangePickerComponent { render() { this.targetOptions = Object.assign({}, this.config.settings, this.options); // cast $ to any to avoid jquery type checking - if ($) { - $(this.input.nativeElement).daterangepicker(this.targetOptions, this.callback.bind(this)); - this.datePicker = $(this.input.nativeElement).data('daterangepicker'); - } + $__default(this.input.nativeElement).daterangepicker(this.targetOptions, this.callback.bind(this)); + this.datePicker = $__default(this.input.nativeElement).data('daterangepicker'); } attachEvents() { - if ($) { - $(this.input.nativeElement).on('cancel.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.cancelDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('apply.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.applyDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('hideCalendar.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.hideCalendarDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('showCalendar.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.showCalendarDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('hide.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.hideDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('show.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.showDaterangepicker.emit(event); - }); - } + $__default(this.input.nativeElement).on('cancel.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.cancelDaterangepicker.emit(event); + }); + $__default(this.input.nativeElement).on('apply.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.applyDaterangepicker.emit(event); + }); + $__default(this.input.nativeElement).on('hideCalendar.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.hideCalendarDaterangepicker.emit(event); + }); + $__default(this.input.nativeElement).on('showCalendar.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.showCalendarDaterangepicker.emit(event); + }); + $__default(this.input.nativeElement).on('hide.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.hideDaterangepicker.emit(event); + }); + $__default(this.input.nativeElement).on('show.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.showDaterangepicker.emit(event); + }); } callback(start, end, label) { this.activeRange = { @@ -98,7 +95,7 @@ class DaterangePickerComponent { } destroyPicker() { try { - $(this.input.nativeElement).data('daterangepicker').remove(); + $__default(this.input.nativeElement).data('daterangepicker').remove(); } catch (e) { console.log(e.message); diff --git a/dist/ng2-daterangepicker/fesm2015/ng2-daterangepicker.mjs.map b/dist/ng2-daterangepicker/fesm2015/ng2-daterangepicker.mjs.map index 1619b59..d0997e6 100644 --- a/dist/ng2-daterangepicker/fesm2015/ng2-daterangepicker.mjs.map +++ b/dist/ng2-daterangepicker/fesm2015/ng2-daterangepicker.mjs.map @@ -1 +1 @@ -{"version":3,"file":"ng2-daterangepicker.mjs","sources":["../../../projects/ng2-daterangepicker/src/lib/config.service.ts","../../../projects/ng2-daterangepicker/src/lib/daterangepicker.component.ts","../../../projects/ng2-daterangepicker/src/lib/daterangepicker.module.ts","../../../projects/ng2-daterangepicker/src/public-api.ts","../../../projects/ng2-daterangepicker/src/ng2-daterangepicker.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\ndeclare var require:any;\r\nimport * as $ from \"jquery\";\r\n\r\n@Injectable()\r\nexport class DaterangepickerConfig {\r\n\r\n public settings: any;\r\n public skipCSS: boolean = false;\r\n private addedCSS = false;\r\n\r\n constructor() {\r\n this.settings = {};\r\n }\r\n\r\n public embedCSS(): void {\r\n // avoid adding duplicated styles\r\n if(this.addedCSS) {\r\n return;\r\n }\r\n\r\n if(this.skipCSS === false) {\r\n $('head').append('');\r\n }\r\n }\r\n\r\n}\r\n","import { Directive, OnInit, AfterViewInit, Input, Output, EventEmitter } from '@angular/core';\r\nimport { KeyValueDiffer, KeyValueDiffers, ElementRef, OnDestroy, DoCheck } from '@angular/core';\r\nimport { BehaviorSubject } from 'rxjs';\r\nimport { DaterangepickerConfig } from './config.service';\r\n\r\nimport * as $ from \"jquery\";\r\nimport * as moment from 'moment';\r\nimport 'bootstrap-daterangepicker';\r\n\r\n@Directive({\r\n selector: '[daterangepicker]',\r\n})\r\nexport class DaterangePickerComponent implements AfterViewInit, OnDestroy, DoCheck {\r\n\r\n private activeRange: any;\r\n private targetOptions: any = {};\r\n private _differ: any = {};\r\n\r\n public datePicker: any;\r\n\r\n // daterangepicker properties\r\n @Input() options: any = {};\r\n\r\n // daterangepicker events\r\n @Output() selected = new EventEmitter();\r\n @Output() cancelDaterangepicker = new EventEmitter();\r\n @Output() applyDaterangepicker = new EventEmitter();\r\n @Output() hideCalendarDaterangepicker = new EventEmitter();\r\n @Output() showCalendarDaterangepicker = new EventEmitter();\r\n @Output() hideDaterangepicker = new EventEmitter();\r\n @Output() showDaterangepicker = new EventEmitter();\r\n\r\n constructor(\r\n private input: ElementRef,\r\n private config: DaterangepickerConfig,\r\n private differs: KeyValueDiffers\r\n ) {\r\n this._differ['options'] = differs.find(this.options).create();\r\n this._differ['settings'] = differs.find(this.config.settings).create();\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.config.embedCSS();\r\n this.render();\r\n this.attachEvents();\r\n }\r\n\r\n render() {\r\n this.targetOptions = Object.assign({}, this.config.settings, this.options);\r\n\r\n // cast $ to any to avoid jquery type checking\r\n if ($)\r\n {\r\n ($(this.input.nativeElement)).daterangepicker(this.targetOptions, this.callback.bind(this));\r\n this.datePicker = ($(this.input.nativeElement)).data('daterangepicker');\r\n }\r\n }\r\n\r\n attachEvents() {\r\n if ($)\r\n {\r\n $(this.input.nativeElement).on('cancel.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.cancelDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('apply.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.applyDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('hideCalendar.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.hideCalendarDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('showCalendar.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.showCalendarDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('hide.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.hideDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('show.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.showDaterangepicker.emit(event);\r\n }\r\n );\r\n }\r\n }\r\n\r\n private callback(start?: any, end?: any, label?: any): void {\r\n this.activeRange = {\r\n start: start,\r\n end: end,\r\n label: label\r\n }\r\n\r\n this.selected.emit(this.activeRange);\r\n }\r\n\r\n destroyPicker() {\r\n try {\r\n ($(this.input.nativeElement)).data('daterangepicker').remove();\r\n } catch(e) {\r\n console.log(e.message);\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.destroyPicker();\r\n }\r\n\r\n ngDoCheck() {\r\n let optionsChanged = this._differ['options'].diff(this.options);\r\n let settingsChanged = this._differ['settings'].diff(this.config.settings);\r\n\r\n if(optionsChanged || settingsChanged) {\r\n this.render();\r\n this.attachEvents();\r\n if(this.activeRange && this.datePicker) {\r\n this.datePicker.setStartDate(this.activeRange.start);\r\n this.datePicker.setEndDate(this.activeRange.end);\r\n }\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\n//import { FormsModule } from '@angular/forms';\r\nimport { DaterangePickerComponent } from './daterangepicker.component';\r\nimport { DaterangepickerConfig } from './config.service';\r\n\r\n@NgModule({\r\n //imports: [FormsModule],\r\n declarations: [DaterangePickerComponent],\r\n providers: [DaterangepickerConfig],\r\n exports: [DaterangePickerComponent]\r\n\r\n})\r\nexport class Daterangepicker { }\r\n","/*\n * Public API Surface of ng2-daterangepicker\n */\n\nexport * from './lib/config.service';\nexport * from './lib/daterangepicker.component';\nexport * from './lib/daterangepicker.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DaterangepickerConfig"],"mappings":";;;;;MAMa,qBAAqB,CAAA;AAM9B,IAAA,WAAA,GAAA;AAHO,QAAA,IAAO,CAAA,OAAA,GAAY,KAAK,CAAC;AACxB,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAGrB,QAAA,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;KACtB;IAEM,QAAQ,GAAA;;QAEX,IAAG,IAAI,CAAC,QAAQ,EAAE;YACd,OAAO;AACV,SAAA;AAED,QAAA,IAAG,IAAI,CAAC,OAAO,KAAK,KAAK,EAAE;AACvB,YAAA,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS;gBAC1B,kvLAAkvL;AACjvL,kBAAA,UAAU,CAAC,CAAC;AAChB,SAAA;KACJ;;kHArBQ,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;sHAArB,qBAAqB,EAAA,CAAA,CAAA;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;;;MCOE,wBAAwB,CAAA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AA;2FAIzB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAP3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;;oBAEN,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,SAAS,EAAE,CAAC,qBAAqB,CAAC;oBAClC,OAAO,EAAE,CAAC,wBAAwB,CAAC;iBAEtC,CAAA;;;ACXD;;AAEG;;ACFH;;AAEG;;;;"} \ No newline at end of file +{"version":3,"file":"ng2-daterangepicker.mjs","sources":["../../../projects/ng2-daterangepicker/src/lib/config.service.ts","../../../projects/ng2-daterangepicker/src/lib/daterangepicker.component.ts","../../../projects/ng2-daterangepicker/src/lib/daterangepicker.module.ts","../../../projects/ng2-daterangepicker/src/public-api.ts","../../../projects/ng2-daterangepicker/src/ng2-daterangepicker.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\ndeclare var require:any;\r\nimport * as $ from \"jquery\";\r\n\r\n@Injectable()\r\nexport class DaterangepickerConfig {\r\n\r\n public settings: any;\r\n public skipCSS: boolean = false;\r\n private addedCSS = false;\r\n\r\n constructor() {\r\n this.settings = {};\r\n }\r\n\r\n public embedCSS(): void {\r\n // avoid adding duplicated styles\r\n if(this.addedCSS) {\r\n return;\r\n }\r\n\r\n if(this.skipCSS === false) {\r\n $('head').append('');\r\n }\r\n }\r\n\r\n}\r\n","import { Directive, AfterViewInit, Input, Output, EventEmitter } from '@angular/core';\r\nimport { KeyValueDiffers, ElementRef, OnDestroy, DoCheck } from '@angular/core';\r\nimport { DaterangepickerConfig } from './config.service';\r\n\r\nimport $ from \"jquery\";\r\nimport * as moment from 'moment';\r\nimport 'bootstrap-daterangepicker';\r\n\r\n\r\n@Directive({\r\n selector: '[daterangepicker]',\r\n})\r\nexport class DaterangePickerComponent implements AfterViewInit, OnDestroy, DoCheck {\r\n\r\n private activeRange: any;\r\n private targetOptions: any = {};\r\n private _differ: any = {};\r\n\r\n public datePicker: any;\r\n\r\n // daterangepicker properties\r\n @Input() options: any = {};\r\n\r\n // daterangepicker events\r\n @Output() selected = new EventEmitter();\r\n @Output() cancelDaterangepicker = new EventEmitter();\r\n @Output() applyDaterangepicker = new EventEmitter();\r\n @Output() hideCalendarDaterangepicker = new EventEmitter();\r\n @Output() showCalendarDaterangepicker = new EventEmitter();\r\n @Output() hideDaterangepicker = new EventEmitter();\r\n @Output() showDaterangepicker = new EventEmitter();\r\n\r\n constructor(\r\n private input: ElementRef,\r\n private config: DaterangepickerConfig,\r\n private differs: KeyValueDiffers\r\n ) {\r\n this._differ['options'] = differs.find(this.options).create();\r\n this._differ['settings'] = differs.find(this.config.settings).create();\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.config.embedCSS();\r\n this.render();\r\n this.attachEvents();\r\n }\r\n\r\n render() {\r\n this.targetOptions = Object.assign({}, this.config.settings, this.options);\r\n\r\n // cast $ to any to avoid jquery type checking\r\n ($(this.input.nativeElement)).daterangepicker(this.targetOptions, this.callback.bind(this));\r\n this.datePicker = $(this.input.nativeElement).data('daterangepicker'); \r\n }\r\n\r\n attachEvents() {\r\n $(this.input.nativeElement).on('cancel.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.cancelDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('apply.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.applyDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('hideCalendar.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.hideCalendarDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('showCalendar.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.showCalendarDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('hide.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.hideDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('show.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.showDaterangepicker.emit(event);\r\n }\r\n );\r\n }\r\n\r\n private callback(start?: any, end?: any, label?: any): void {\r\n this.activeRange = {\r\n start: start,\r\n end: end,\r\n label: label\r\n }\r\n\r\n this.selected.emit(this.activeRange);\r\n }\r\n\r\n destroyPicker() {\r\n try {\r\n ($(this.input.nativeElement)).data('daterangepicker').remove();\r\n } catch(e) {\r\n console.log(e.message);\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.destroyPicker();\r\n }\r\n\r\n ngDoCheck() {\r\n let optionsChanged = this._differ['options'].diff(this.options);\r\n let settingsChanged = this._differ['settings'].diff(this.config.settings);\r\n\r\n if(optionsChanged || settingsChanged) {\r\n this.render();\r\n this.attachEvents();\r\n if(this.activeRange && this.datePicker) {\r\n this.datePicker.setStartDate(this.activeRange.start);\r\n this.datePicker.setEndDate(this.activeRange.end);\r\n }\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\n//import { FormsModule } from '@angular/forms';\r\nimport { DaterangePickerComponent } from './daterangepicker.component';\r\nimport { DaterangepickerConfig } from './config.service';\r\n\r\n@NgModule({\r\n //imports: [FormsModule],\r\n declarations: [DaterangePickerComponent],\r\n providers: [DaterangepickerConfig],\r\n exports: [DaterangePickerComponent]\r\n\r\n})\r\nexport class Daterangepicker { }\r\n","/*\n * Public API Surface of ng2-daterangepicker\n */\n\nexport * from './lib/config.service';\nexport * from './lib/daterangepicker.component';\nexport * from './lib/daterangepicker.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["$","i1.DaterangepickerConfig"],"mappings":";;;;;;MAMa,qBAAqB,CAAA;AAM9B,IAAA,WAAA,GAAA;AAHO,QAAA,IAAO,CAAA,OAAA,GAAY,KAAK,CAAC;AACxB,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK,C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,2BAA2B,EAAA,CAAA;sBAApC,MAAM;gBACG,2BAA2B,EAAA,CAAA;sBAApC,MAAM;gBACG,mBAAmB,EAAA,CAAA;sBAA5B,MAAM;gBACG,mBAAmB,EAAA,CAAA;sBAA5B,MAAM;;;MClBE,eAAe,CAAA;;4GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;6GAAf,eAAe,EAAA,YAAA,EAAA,CALT,wBAAwB,CAAA,EAAA,OAAA,EAAA,CAE7B,wBAAwB,CAAA,EAAA,CAAA,CAAA;6GAGzB,eAAe,EAAA,SAAA,EAJb,CAAC,qBAAqB,CAAC,EAAA,CAAA,CAAA;2FAIzB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAP3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;;oBAEN,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,SAAS,EAAE,CAAC,qBAAqB,CAAC;oBAClC,OAAO,EAAE,CAAC,wBAAwB,CAAC;iBAEtC,CAAA;;;ACXD;;AAEG;;ACFH;;AAEG;;;;"} \ No newline at end of file diff --git a/dist/ng2-daterangepicker/fesm2020/ng2-daterangepicker.mjs b/dist/ng2-daterangepicker/fesm2020/ng2-daterangepicker.mjs index 33330ab..c51a995 100644 --- a/dist/ng2-daterangepicker/fesm2020/ng2-daterangepicker.mjs +++ b/dist/ng2-daterangepicker/fesm2020/ng2-daterangepicker.mjs @@ -1,6 +1,7 @@ import * as i0 from '@angular/core'; import { Injectable, EventEmitter, Directive, Input, Output, NgModule } from '@angular/core'; import * as $ from 'jquery'; +import $__default from 'jquery'; import 'bootstrap-daterangepicker'; class DaterangepickerConfig { @@ -55,38 +56,34 @@ class DaterangePickerComponent { render() { this.targetOptions = Object.assign({}, this.config.settings, this.options); // cast $ to any to avoid jquery type checking - if ($) { - $(this.input.nativeElement).daterangepicker(this.targetOptions, this.callback.bind(this)); - this.datePicker = $(this.input.nativeElement).data('daterangepicker'); - } + $__default(this.input.nativeElement).daterangepicker(this.targetOptions, this.callback.bind(this)); + this.datePicker = $__default(this.input.nativeElement).data('daterangepicker'); } attachEvents() { - if ($) { - $(this.input.nativeElement).on('cancel.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.cancelDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('apply.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.applyDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('hideCalendar.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.hideCalendarDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('showCalendar.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.showCalendarDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('hide.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.hideDaterangepicker.emit(event); - }); - $(this.input.nativeElement).on('show.daterangepicker', (e, picker) => { - let event = { event: e, picker: picker }; - this.showDaterangepicker.emit(event); - }); - } + $__default(this.input.nativeElement).on('cancel.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.cancelDaterangepicker.emit(event); + }); + $__default(this.input.nativeElement).on('apply.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.applyDaterangepicker.emit(event); + }); + $__default(this.input.nativeElement).on('hideCalendar.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.hideCalendarDaterangepicker.emit(event); + }); + $__default(this.input.nativeElement).on('showCalendar.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.showCalendarDaterangepicker.emit(event); + }); + $__default(this.input.nativeElement).on('hide.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.hideDaterangepicker.emit(event); + }); + $__default(this.input.nativeElement).on('show.daterangepicker', (e, picker) => { + let event = { event: e, picker: picker }; + this.showDaterangepicker.emit(event); + }); } callback(start, end, label) { this.activeRange = { @@ -98,7 +95,7 @@ class DaterangePickerComponent { } destroyPicker() { try { - $(this.input.nativeElement).data('daterangepicker').remove(); + $__default(this.input.nativeElement).data('daterangepicker').remove(); } catch (e) { console.log(e.message); diff --git a/dist/ng2-daterangepicker/fesm2020/ng2-daterangepicker.mjs.map b/dist/ng2-daterangepicker/fesm2020/ng2-daterangepicker.mjs.map index 233c2eb..ea31021 100644 --- a/dist/ng2-daterangepicker/fesm2020/ng2-daterangepicker.mjs.map +++ b/dist/ng2-daterangepicker/fesm2020/ng2-daterangepicker.mjs.map @@ -1 +1 @@ -{"version":3,"file":"ng2-daterangepicker.mjs","sources":["../../../projects/ng2-daterangepicker/src/lib/config.service.ts","../../../projects/ng2-daterangepicker/src/lib/daterangepicker.component.ts","../../../projects/ng2-daterangepicker/src/lib/daterangepicker.module.ts","../../../projects/ng2-daterangepicker/src/public-api.ts","../../../projects/ng2-daterangepicker/src/ng2-daterangepicker.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\ndeclare var require:any;\r\nimport * as $ from \"jquery\";\r\n\r\n@Injectable()\r\nexport class DaterangepickerConfig {\r\n\r\n public settings: any;\r\n public skipCSS: boolean = false;\r\n private addedCSS = false;\r\n\r\n constructor() {\r\n this.settings = {};\r\n }\r\n\r\n public embedCSS(): void {\r\n // avoid adding duplicated styles\r\n if(this.addedCSS) {\r\n return;\r\n }\r\n\r\n if(this.skipCSS === false) {\r\n $('head').append('');\r\n }\r\n }\r\n\r\n}\r\n","import { Directive, OnInit, AfterViewInit, Input, Output, EventEmitter } from '@angular/core';\r\nimport { KeyValueDiffer, KeyValueDiffers, ElementRef, OnDestroy, DoCheck } from '@angular/core';\r\nimport { BehaviorSubject } from 'rxjs';\r\nimport { DaterangepickerConfig } from './config.service';\r\n\r\nimport * as $ from \"jquery\";\r\nimport * as moment from 'moment';\r\nimport 'bootstrap-daterangepicker';\r\n\r\n@Directive({\r\n selector: '[daterangepicker]',\r\n})\r\nexport class DaterangePickerComponent implements AfterViewInit, OnDestroy, DoCheck {\r\n\r\n private activeRange: any;\r\n private targetOptions: any = {};\r\n private _differ: any = {};\r\n\r\n public datePicker: any;\r\n\r\n // daterangepicker properties\r\n @Input() options: any = {};\r\n\r\n // daterangepicker events\r\n @Output() selected = new EventEmitter();\r\n @Output() cancelDaterangepicker = new EventEmitter();\r\n @Output() applyDaterangepicker = new EventEmitter();\r\n @Output() hideCalendarDaterangepicker = new EventEmitter();\r\n @Output() showCalendarDaterangepicker = new EventEmitter();\r\n @Output() hideDaterangepicker = new EventEmitter();\r\n @Output() showDaterangepicker = new EventEmitter();\r\n\r\n constructor(\r\n private input: ElementRef,\r\n private config: DaterangepickerConfig,\r\n private differs: KeyValueDiffers\r\n ) {\r\n this._differ['options'] = differs.find(this.options).create();\r\n this._differ['settings'] = differs.find(this.config.settings).create();\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.config.embedCSS();\r\n this.render();\r\n this.attachEvents();\r\n }\r\n\r\n render() {\r\n this.targetOptions = Object.assign({}, this.config.settings, this.options);\r\n\r\n // cast $ to any to avoid jquery type checking\r\n if ($)\r\n {\r\n ($(this.input.nativeElement)).daterangepicker(this.targetOptions, this.callback.bind(this));\r\n this.datePicker = ($(this.input.nativeElement)).data('daterangepicker');\r\n }\r\n }\r\n\r\n attachEvents() {\r\n if ($)\r\n {\r\n $(this.input.nativeElement).on('cancel.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.cancelDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('apply.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.applyDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('hideCalendar.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.hideCalendarDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('showCalendar.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.showCalendarDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('hide.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.hideDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('show.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.showDaterangepicker.emit(event);\r\n }\r\n );\r\n }\r\n }\r\n\r\n private callback(start?: any, end?: any, label?: any): void {\r\n this.activeRange = {\r\n start: start,\r\n end: end,\r\n label: label\r\n }\r\n\r\n this.selected.emit(this.activeRange);\r\n }\r\n\r\n destroyPicker() {\r\n try {\r\n ($(this.input.nativeElement)).data('daterangepicker').remove();\r\n } catch(e) {\r\n console.log(e.message);\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.destroyPicker();\r\n }\r\n\r\n ngDoCheck() {\r\n let optionsChanged = this._differ['options'].diff(this.options);\r\n let settingsChanged = this._differ['settings'].diff(this.config.settings);\r\n\r\n if(optionsChanged || settingsChanged) {\r\n this.render();\r\n this.attachEvents();\r\n if(this.activeRange && this.datePicker) {\r\n this.datePicker.setStartDate(this.activeRange.start);\r\n this.datePicker.setEndDate(this.activeRange.end);\r\n }\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\n//import { FormsModule } from '@angular/forms';\r\nimport { DaterangePickerComponent } from './daterangepicker.component';\r\nimport { DaterangepickerConfig } from './config.service';\r\n\r\n@NgModule({\r\n //imports: [FormsModule],\r\n declarations: [DaterangePickerComponent],\r\n providers: [DaterangepickerConfig],\r\n exports: [DaterangePickerComponent]\r\n\r\n})\r\nexport class Daterangepicker { }\r\n","/*\n * Public API Surface of ng2-daterangepicker\n */\n\nexport * from './lib/config.service';\nexport * from './lib/daterangepicker.component';\nexport * from './lib/daterangepicker.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.Daterangep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EAAE,mBAAmB;AAChC,iBAAA,CAAA;gKAUY,OAAO,EAAA,CAAA;sBAAf,KAAK;gBAGI,QAAQ,EAAA,CAAA;sBAAjB,MAAM;gBACG,qBAAqB,EAAA,CAAA;sBAA9B,MAAM;gBACG,oBAAoB,EAAA,CAAA;sBAA7B,MAAM;gBACG,2BAA2B,EAAA,CAAA;sBAApC,MAAM;gBACG,2BAA2B,EAAA,CAAA;sBAApC,MAAM;gBACG,mBAAmB,EAAA,CAAA;sBAA5B,MAAM;gBACG,mBAAmB,EAAA,CAAA;sBAA5B,MAAM;;;MClBE,eAAe,CAAA;;4GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;6GAAf,eAAe,EAAA,YAAA,EAAA,CALT,wBAAwB,CAAA,EAAA,OAAA,EAAA,CAE7B,wBAAwB,CAAA,EAAA,CAAA,CAAA;6GAGzB,eAAe,EAAA,SAAA,EAJb,CAAC,qBAAqB,CAAC,EAAA,CAAA,CAAA;2FAIzB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAP3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;;oBAEN,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,SAAS,EAAE,CAAC,qBAAqB,CAAC;oBAClC,OAAO,EAAE,CAAC,wBAAwB,CAAC;AAEtC,iBAAA,CAAA;;;ACXD;;AAEG;;ACFH;;AAEG;;;;"} \ No newline at end of file +{"version":3,"file":"ng2-daterangepicker.mjs","sources":["../../../projects/ng2-daterangepicker/src/lib/config.service.ts","../../../projects/ng2-daterangepicker/src/lib/daterangepicker.component.ts","../../../projects/ng2-daterangepicker/src/lib/daterangepicker.module.ts","../../../projects/ng2-daterangepicker/src/public-api.ts","../../../projects/ng2-daterangepicker/src/ng2-daterangepicker.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\ndeclare var require:any;\r\nimport * as $ from \"jquery\";\r\n\r\n@Injectable()\r\nexport class DaterangepickerConfig {\r\n\r\n public settings: any;\r\n public skipCSS: boolean = false;\r\n private addedCSS = false;\r\n\r\n constructor() {\r\n this.settings = {};\r\n }\r\n\r\n public embedCSS(): void {\r\n // avoid adding duplicated styles\r\n if(this.addedCSS) {\r\n return;\r\n }\r\n\r\n if(this.skipCSS === false) {\r\n $('head').append('');\r\n }\r\n }\r\n\r\n}\r\n","import { Directive, AfterViewInit, Input, Output, EventEmitter } from '@angular/core';\r\nimport { KeyValueDiffers, ElementRef, OnDestroy, DoCheck } from '@angular/core';\r\nimport { DaterangepickerConfig } from './config.service';\r\n\r\nimport $ from \"jquery\";\r\nimport * as moment from 'moment';\r\nimport 'bootstrap-daterangepicker';\r\n\r\n\r\n@Directive({\r\n selector: '[daterangepicker]',\r\n})\r\nexport class DaterangePickerComponent implements AfterViewInit, OnDestroy, DoCheck {\r\n\r\n private activeRange: any;\r\n private targetOptions: any = {};\r\n private _differ: any = {};\r\n\r\n public datePicker: any;\r\n\r\n // daterangepicker properties\r\n @Input() options: any = {};\r\n\r\n // daterangepicker events\r\n @Output() selected = new EventEmitter();\r\n @Output() cancelDaterangepicker = new EventEmitter();\r\n @Output() applyDaterangepicker = new EventEmitter();\r\n @Output() hideCalendarDaterangepicker = new EventEmitter();\r\n @Output() showCalendarDaterangepicker = new EventEmitter();\r\n @Output() hideDaterangepicker = new EventEmitter();\r\n @Output() showDaterangepicker = new EventEmitter();\r\n\r\n constructor(\r\n private input: ElementRef,\r\n private config: DaterangepickerConfig,\r\n private differs: KeyValueDiffers\r\n ) {\r\n this._differ['options'] = differs.find(this.options).create();\r\n this._differ['settings'] = differs.find(this.config.settings).create();\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.config.embedCSS();\r\n this.render();\r\n this.attachEvents();\r\n }\r\n\r\n render() {\r\n this.targetOptions = Object.assign({}, this.config.settings, this.options);\r\n\r\n // cast $ to any to avoid jquery type checking\r\n ($(this.input.nativeElement)).daterangepicker(this.targetOptions, this.callback.bind(this));\r\n this.datePicker = $(this.input.nativeElement).data('daterangepicker'); \r\n }\r\n\r\n attachEvents() {\r\n $(this.input.nativeElement).on('cancel.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.cancelDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('apply.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.applyDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('hideCalendar.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.hideCalendarDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('showCalendar.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.showCalendarDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('hide.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.hideDaterangepicker.emit(event);\r\n }\r\n );\r\n\r\n $(this.input.nativeElement).on('show.daterangepicker',\r\n (e:any, picker:any) => {\r\n let event = { event: e, picker: picker };\r\n this.showDaterangepicker.emit(event);\r\n }\r\n );\r\n }\r\n\r\n private callback(start?: any, end?: any, label?: any): void {\r\n this.activeRange = {\r\n start: start,\r\n end: end,\r\n label: label\r\n }\r\n\r\n this.selected.emit(this.activeRange);\r\n }\r\n\r\n destroyPicker() {\r\n try {\r\n ($(this.input.nativeElement)).data('daterangepicker').remove();\r\n } catch(e) {\r\n console.log(e.message);\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.destroyPicker();\r\n }\r\n\r\n ngDoCheck() {\r\n let optionsChanged = this._differ['options'].diff(this.options);\r\n let settingsChanged = this._differ['settings'].diff(this.config.settings);\r\n\r\n if(optionsChanged || settingsChanged) {\r\n this.render();\r\n this.attachEvents();\r\n if(this.activeRange && this.datePicker) {\r\n this.datePicker.setStartDate(this.activeRange.start);\r\n this.datePicker.setEndDate(this.activeRange.end);\r\n }\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\n//import { FormsModule } from '@angular/forms';\r\nimport { DaterangePickerComponent } from './daterangepicker.component';\r\nimport { DaterangepickerConfig } from './config.service';\r\n\r\n@NgModule({\r\n //imports: [FormsModule],\r\n declarations: [DaterangePickerComponent],\r\n providers: [DaterangepickerConfig],\r\n exports: [DaterangePickerComponent]\r\n\r\n})\r\nexport class Daterangepicker { }\r\n","/*\n * Public API Surface of ng2-daterangepicker\n */\n\nexport * from './lib/config.service';\nexport * from './lib/daterangepicker.component';\nexport * from './lib/daterangepicker.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["$","i1.DaterangepickerConfig"],"mappings":";;;;;;MAMa,qBAAqB,CAAA;AAM9B,IAAA,WAAA,GAAA;QAHO,IAAO,CAAA,OAAA,GAAY,KAAK,CAAC;QACxB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAGrB,QAAA,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;KACtB;IAEM,QAAQ,GAAA;;QAEX,IAAG,IAAI,CAAC,QAAQ,EAAE;YACd,OAAO;AACV,SAAA;AAED,QAAA,IAAG,IAAI,CAAC,OAAO,KAAK,KAAK,EAAE;AACvB,YAAA,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS;gBAC1B,kvLAAkvL;AACjvL,kBAAA,UAAU,CAAC,CAAC;AAChB,SAAA;KACJ;;kHArBQ,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;sHAArB,qBAAqB,EAAA,CAAA,CAAA;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;;;MCOE,wBAAwB,CAAA;AAoBjC,IAAA,WAAA,CACY,KAAiB,EACjB,M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qBAAqB,CAAC;oBAClC,OAAO,EAAE,CAAC,wBAAwB,CAAC;AAEtC,iBAAA,CAAA;;;ACXD;;AAEG;;ACFH;;AAEG;;;;"} \ No newline at end of file diff --git a/dist/ng2-daterangepicker/package.json b/dist/ng2-daterangepicker/package.json index daf24a9..c44afa0 100644 --- a/dist/ng2-daterangepicker/package.json +++ b/dist/ng2-daterangepicker/package.json @@ -1,6 +1,6 @@ { "name": "ng2-daterangepicker", - "version": "2.1.2", + "version": "2.1.3", "peerDependencies": { "@angular/common": "^13.2.0", "@angular/core": "^13.2.0", diff --git a/projects/ng2-daterangepicker/package.json b/projects/ng2-daterangepicker/package.json index f300779..85a2380 100644 --- a/projects/ng2-daterangepicker/package.json +++ b/projects/ng2-daterangepicker/package.json @@ -1,6 +1,6 @@ { "name": "ng2-daterangepicker", - "version": "2.1.2", + "version": "2.1.3", "peerDependencies": { "@angular/common": "^13.2.0", "@angular/core": "^13.2.0", diff --git a/projects/ng2-daterangepicker/src/lib/daterangepicker.component.ts b/projects/ng2-daterangepicker/src/lib/daterangepicker.component.ts index 39dad2b..608b4b3 100644 --- a/projects/ng2-daterangepicker/src/lib/daterangepicker.component.ts +++ b/projects/ng2-daterangepicker/src/lib/daterangepicker.component.ts @@ -1,12 +1,12 @@ -import { Directive, OnInit, AfterViewInit, Input, Output, EventEmitter } from '@angular/core'; -import { KeyValueDiffer, KeyValueDiffers, ElementRef, OnDestroy, DoCheck } from '@angular/core'; -import { BehaviorSubject } from 'rxjs'; +import { Directive, AfterViewInit, Input, Output, EventEmitter } from '@angular/core'; +import { KeyValueDiffers, ElementRef, OnDestroy, DoCheck } from '@angular/core'; import { DaterangepickerConfig } from './config.service'; -import * as $ from "jquery"; +import $ from "jquery"; import * as moment from 'moment'; import 'bootstrap-daterangepicker'; + @Directive({ selector: '[daterangepicker]', }) @@ -49,58 +49,52 @@ export class DaterangePickerComponent implements AfterViewInit, OnDestroy, DoChe this.targetOptions = Object.assign({}, this.config.settings, this.options); // cast $ to any to avoid jquery type checking - if ($) - { - ($(this.input.nativeElement)).daterangepicker(this.targetOptions, this.callback.bind(this)); - this.datePicker = ($(this.input.nativeElement)).data('daterangepicker'); - } + ($(this.input.nativeElement)).daterangepicker(this.targetOptions, this.callback.bind(this)); + this.datePicker = $(this.input.nativeElement).data('daterangepicker'); } attachEvents() { - if ($) - { - $(this.input.nativeElement).on('cancel.daterangepicker', - (e:any, picker:any) => { - let event = { event: e, picker: picker }; - this.cancelDaterangepicker.emit(event); - } - ); - - $(this.input.nativeElement).on('apply.daterangepicker', - (e:any, picker:any) => { - let event = { event: e, picker: picker }; - this.applyDaterangepicker.emit(event); - } - ); - - $(this.input.nativeElement).on('hideCalendar.daterangepicker', - (e:any, picker:any) => { - let event = { event: e, picker: picker }; - this.hideCalendarDaterangepicker.emit(event); - } - ); - - $(this.input.nativeElement).on('showCalendar.daterangepicker', - (e:any, picker:any) => { - let event = { event: e, picker: picker }; - this.showCalendarDaterangepicker.emit(event); - } - ); - - $(this.input.nativeElement).on('hide.daterangepicker', - (e:any, picker:any) => { - let event = { event: e, picker: picker }; - this.hideDaterangepicker.emit(event); - } - ); - - $(this.input.nativeElement).on('show.daterangepicker', - (e:any, picker:any) => { - let event = { event: e, picker: picker }; - this.showDaterangepicker.emit(event); - } - ); - } + $(this.input.nativeElement).on('cancel.daterangepicker', + (e:any, picker:any) => { + let event = { event: e, picker: picker }; + this.cancelDaterangepicker.emit(event); + } + ); + + $(this.input.nativeElement).on('apply.daterangepicker', + (e:any, picker:any) => { + let event = { event: e, picker: picker }; + this.applyDaterangepicker.emit(event); + } + ); + + $(this.input.nativeElement).on('hideCalendar.daterangepicker', + (e:any, picker:any) => { + let event = { event: e, picker: picker }; + this.hideCalendarDaterangepicker.emit(event); + } + ); + + $(this.input.nativeElement).on('showCalendar.daterangepicker', + (e:any, picker:any) => { + let event = { event: e, picker: picker }; + this.showCalendarDaterangepicker.emit(event); + } + ); + + $(this.input.nativeElement).on('hide.daterangepicker', + (e:any, picker:any) => { + let event = { event: e, picker: picker }; + this.hideDaterangepicker.emit(event); + } + ); + + $(this.input.nativeElement).on('show.daterangepicker', + (e:any, picker:any) => { + let event = { event: e, picker: picker }; + this.showDaterangepicker.emit(event); + } + ); } private callback(start?: any, end?: any, label?: any): void {