mis-crystal-design-system 2.6.5 → 2.6.6-rc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/mis-crystal-design-system-button.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-drawer.umd.js +40 -39
- package/bundles/mis-crystal-design-system-drawer.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-drawer.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-drawer.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-input.umd.js +1 -1
- package/bundles/mis-crystal-design-system-input.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-input.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-modal.umd.js +8 -1
- package/bundles/mis-crystal-design-system-modal.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-modal.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-modal.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-radio-button.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-radio-button.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-table.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-toast.umd.js.map +1 -1
- package/drawer/drawer-body/drawer-body.component.d.ts +3 -4
- package/drawer/drawer.service.d.ts +2 -1
- package/drawer/mis-crystal-design-system-drawer.metadata.json +1 -1
- package/esm2015/drawer/drawer-body/drawer-body.component.js +2 -8
- package/esm2015/drawer/drawer.service.js +10 -4
- package/esm2015/input/mis-input.component.js +1 -1
- package/esm2015/modal/modal.service.js +10 -3
- package/esm2015/modal/module-wrapper/module-wrapper.component.js +1 -1
- package/fesm2015/mis-crystal-design-system-button.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-datepicker_v2.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-drawer.js +37 -36
- package/fesm2015/mis-crystal-design-system-drawer.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-input.js +1 -1
- package/fesm2015/mis-crystal-design-system-modal.js +10 -3
- package/fesm2015/mis-crystal-design-system-modal.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-radio-button.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-table.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-toast.js.map +1 -1
- package/input/mis-crystal-design-system-input.metadata.json +1 -1
- package/input/mis-input.component.scss +1 -0
- package/modal/mis-crystal-design-system-modal.metadata.json +1 -1
- package/modal/module-wrapper/module-wrapper.component.d.ts +3 -3
- package/package.json +1 -1
- package/styles/mis-icons.css +0 -896
|
@@ -30,4 +30,4 @@ ModuleWrapperComponent.ctorParameters = () => [];
|
|
|
30
30
|
ModuleWrapperComponent.propDecorators = {
|
|
31
31
|
place: [{ type: ViewChild, args: ["place", { static: false, read: ViewContainerRef },] }]
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kdWxlLXdyYXBwZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbWlzLWNvbXBvbmVudHMvbW9kYWwvbW9kdWxlLXdyYXBwZXIvbW9kdWxlLXdyYXBwZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxPQUFPLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRSxPQUFPLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUMxRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDdEQsT0FBTyxFQUFFLF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zAlKVwiLCBvcGFjaXR5OiAwIH0pKV0pXG4gICAgXSlcbiAgXVxufSlcbmV4cG9ydCBjbGFzcyBNb2R1bGVXcmFwcGVyQ29tcG9uZW50IHtcbiAgbW9kYWxQb3J0YWw6IENvbXBvbmVudFBvcnRhbDxhbnk+O1xuICBjb25zdHJ1Y3RvcigpIHt9XG5cbiAgQFZpZXdDaGlsZChcInBsYWNlXCIsIHsgc3RhdGljOiBmYWxzZSwgcmVhZDogVmlld0NvbnRhaW5lclJlZiB9KSBwbGFjZTogVmlld0NvbnRhaW5lclJlZjtcblxuICBiaW5kQ29tcG9uZW50KHR5cGU6IGFueSwgaW5qZWN0b3I6IEluamVjdG9yKSB7XG4gICAgdGhpcy5pbml0Q29tcG9uZW50KHR5cGUsIGluamVjdG9yKTtcbiAgfVxuXG4gIHByaXZhdGUgaW5pdENvbXBvbmVudCh0eXBlOiBhbnksIGluamVjdG9yOiBJbmplY3Rvcikge1xuICAgIHRoaXMubW9kYWxQb3J0YWwgPSBuZXcgQ29tcG9uZW50UG9ydGFsKHR5cGUsIHRoaXMucGxhY2UsIGluamVjdG9yKTtcbiAgfVxufVxuIl19
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-button.js","sources":["../../../projects/mis-components/button/button.component.ts","../../../projects/mis-components/button/button.directive.ts","../../../projects/mis-components/button/button.module.ts","../../../projects/mis-components/button/mis-crystal-design-system-button.ts"],"sourcesContent":["import { Component, Input, OnInit, Output, EventEmitter, ContentChild, TemplateRef } from \"@angular/core\";\n\n@Component({\n selector: \"mis-button\",\n templateUrl: \"./button.component.html\",\n styleUrls: [\"./button.component.scss\"]\n})\nexport class ButtonComponent implements OnInit {\n @Input() name: string = \"Enabled\";\n @Input() type: \"Solid\" | \"Outline\" | \"Text\" = \"Solid\";\n @Input() size: \"Small\" | \"Medium\" | \"Large\" | \"Small-M\" | \"Large-M\" = \"Medium\";\n @Input() width: string = \"\";\n\n @Input() showIcon: boolean = false;\n @Input() iconUrl: string = \"\";\n @Input() iconPosition: \"Left\" | \"Right\" = \"Left\";\n\n @Input() disabled: boolean = false;\n @Input() disableLeftBorderRadius: boolean = false;\n @Input() disableRightBorderRadius: boolean = false;\n\n /** Emits event when button is clicked */\n @Output() click = new EventEmitter<any>();\n\n constructor() {}\n\n ngOnInit() {}\n\n onClick(event) {\n this.click.emit(event);\n }\n}\n","import { AfterViewInit, Directive, ElementRef, HostBinding, Input, Renderer2 } from \"@angular/core\";\n\n@Directive({\n selector: \"[mis-button]\"\n})\nexport class ButtonDirective implements AfterViewInit {\n @Input() type: \"primary\" | \"outline\" | \"none\" = \"none\";\n @Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n @HostBinding(\"class\") elementClass = \"mis-btn\";\n\n constructor(private el: ElementRef, private renderer: Renderer2) {}\n\n ngAfterViewInit(): void {\n this.bindTypeClass();\n this.bindSizeClass();\n }\n\n private bindTypeClass(): void {\n let className = \"\";\n switch (this.type) {\n case \"primary\":\n className = \"mis-primary\";\n break;\n case \"outline\":\n className = \"mis-outline\";\n break;\n default:\n className = \"mis-none\";\n }\n this.renderer.addClass(this.el.nativeElement, className);\n }\n\n private bindSizeClass(): void {\n let className = \"\";\n switch (this.size) {\n case \"lg\":\n className = \"mis-btn-lg\";\n break;\n case \"sm\":\n className = \"mis-btn-sm\";\n break;\n default:\n className = \"mis-btn-md\";\n }\n this.renderer.addClass(this.el.nativeElement, className);\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { ButtonDirective } from \"./button.directive\";\nimport { ButtonComponent } from \"./button.component\";\n\n@NgModule({\n declarations: [ButtonComponent, ButtonDirective],\n imports: [CommonModule],\n exports: [ButtonComponent, ButtonDirective]\n})\nexport class ButtonModule {\n static forRoot(): ModuleWithProviders<ButtonModule> {\n return { ngModule: ButtonModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {ButtonDirective as
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-button.js","sources":["../../../projects/mis-components/button/button.component.ts","../../../projects/mis-components/button/button.directive.ts","../../../projects/mis-components/button/button.module.ts","../../../projects/mis-components/button/mis-crystal-design-system-button.ts"],"sourcesContent":["import { Component, Input, OnInit, Output, EventEmitter, ContentChild, TemplateRef } from \"@angular/core\";\n\n@Component({\n selector: \"mis-button\",\n templateUrl: \"./button.component.html\",\n styleUrls: [\"./button.component.scss\"]\n})\nexport class ButtonComponent implements OnInit {\n @Input() name: string = \"Enabled\";\n @Input() type: \"Solid\" | \"Outline\" | \"Text\" = \"Solid\";\n @Input() size: \"Small\" | \"Medium\" | \"Large\" | \"Small-M\" | \"Large-M\" = \"Medium\";\n @Input() width: string = \"\";\n\n @Input() showIcon: boolean = false;\n @Input() iconUrl: string = \"\";\n @Input() iconPosition: \"Left\" | \"Right\" = \"Left\";\n\n @Input() disabled: boolean = false;\n @Input() disableLeftBorderRadius: boolean = false;\n @Input() disableRightBorderRadius: boolean = false;\n\n /** Emits event when button is clicked */\n @Output() click = new EventEmitter<any>();\n\n constructor() {}\n\n ngOnInit() {}\n\n onClick(event) {\n this.click.emit(event);\n }\n}\n","import { AfterViewInit, Directive, ElementRef, HostBinding, Input, Renderer2 } from \"@angular/core\";\n\n@Directive({\n selector: \"[mis-button]\"\n})\nexport class ButtonDirective implements AfterViewInit {\n @Input() type: \"primary\" | \"outline\" | \"none\" = \"none\";\n @Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n @HostBinding(\"class\") elementClass = \"mis-btn\";\n\n constructor(private el: ElementRef, private renderer: Renderer2) {}\n\n ngAfterViewInit(): void {\n this.bindTypeClass();\n this.bindSizeClass();\n }\n\n private bindTypeClass(): void {\n let className = \"\";\n switch (this.type) {\n case \"primary\":\n className = \"mis-primary\";\n break;\n case \"outline\":\n className = \"mis-outline\";\n break;\n default:\n className = \"mis-none\";\n }\n this.renderer.addClass(this.el.nativeElement, className);\n }\n\n private bindSizeClass(): void {\n let className = \"\";\n switch (this.size) {\n case \"lg\":\n className = \"mis-btn-lg\";\n break;\n case \"sm\":\n className = \"mis-btn-sm\";\n break;\n default:\n className = \"mis-btn-md\";\n }\n this.renderer.addClass(this.el.nativeElement, className);\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { ButtonDirective } from \"./button.directive\";\nimport { ButtonComponent } from \"./button.component\";\n\n@NgModule({\n declarations: [ButtonComponent, ButtonDirective],\n imports: [CommonModule],\n exports: [ButtonComponent, ButtonDirective]\n})\nexport class ButtonModule {\n static forRoot(): ModuleWithProviders<ButtonModule> {\n return { ngModule: ButtonModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {ButtonDirective as ɵa} from './button.directive';"],"names":[],"mappings":";;;MAOa,eAAe;IAiB1B;QAhBS,SAAI,GAAW,SAAS,CAAC;QACzB,SAAI,GAAiC,OAAO,CAAC;QAC7C,SAAI,GAAyD,QAAQ,CAAC;QACtE,UAAK,GAAW,EAAE,CAAC;QAEnB,aAAQ,GAAY,KAAK,CAAC;QAC1B,YAAO,GAAW,EAAE,CAAC;QACrB,iBAAY,GAAqB,MAAM,CAAC;QAExC,aAAQ,GAAY,KAAK,CAAC;QAC1B,4BAAuB,GAAY,KAAK,CAAC;QACzC,6BAAwB,GAAY,KAAK,CAAC;;QAGzC,UAAK,GAAG,IAAI,YAAY,EAAO,CAAC;KAE1B;IAEhB,QAAQ,MAAK;IAEb,OAAO,CAAC,KAAK;QACX,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACxB;;;YA5BF,SAAS,SAAC;gBACT,QAAQ,EAAE,YAAY;gBACtB,88BAAsC;;aAEvC;;;;mBAEE,KAAK;mBACL,KAAK;mBACL,KAAK;oBACL,KAAK;uBAEL,KAAK;sBACL,KAAK;2BACL,KAAK;uBAEL,KAAK;sCACL,KAAK;uC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AAE,SAAS,EAAE,EAAE,EAAE,CAAC;KAClD;;;YARF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;gBAChD,OAAO,EAAE,CAAC,YAAY,CAAC;gBACvB,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;aAC5C;;;ACTD;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-datepicker_v2.js","sources":["../../../projects/mis-components/datepicker_v2/datepicker-constants.ts","../../../projects/mis-components/datepicker_v2/utils/index.ts","../../../projects/mis-components/datepicker_v2/tz-dp-container/tz-dp-container.component.ts","../../../projects/mis-components/datepicker_v2/tz-datepicker.directive.ts","../../../projects/mis-components/datepicker_v2/datepicker.module.ts","../../../projects/mis-components/datepicker_v2/mis-crystal-design-system-datepicker_v2.ts"],"sourcesContent":["/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const CONTAINER_DATA = new InjectionToken<{}>(\"CONTAINER_DATA\");\nexport const DATE_FORMAT = \"DD-MM-YYYY\";\n","import { ICurrentMonth } from \"../models/dp-config.model\";\n\nexport const getMonth = (index: number): ICurrentMonth => {\n let month;\n switch (index) {\n case 0:\n month = \"January\";\n break;\n case 1:\n month = \"February\";\n break;\n case 2:\n month = \"March\";\n break;\n case 3:\n month = \"April\";\n break;\n case 4:\n month = \"May\";\n break;\n case 5:\n month = \"June\";\n break;\n case 6:\n month = \"July\";\n break;\n case 7:\n month = \"August\";\n break;\n case 8:\n month = \"September\";\n break;\n case 9:\n month = \"October\";\n break;\n case 10:\n month = \"November\";\n break;\n case 11:\n month = \"December\";\n break;\n default:\n break;\n }\n return month;\n};\n","import { Component, Inject, OnInit } from \"@angular/core\";\nimport { CONTAINER_DATA, DATE_FORMAT } from \"../datepicker-constants\";\nimport { ICurrentMonth, ICurrentMonthDates, IDatePickerData, IWeekDay } from \"../models/dp-config.model\";\nimport { parseZone, Moment, tz } from \"moment-timezone\";\nimport { getMonth } from \"../utils\";\nimport { ToastService } from \"mis-crystal-design-system/toast\";\n\n@Component({\n selector: \"mis-tz-dp\",\n templateUrl: \"./tz-dp-container.component.html\",\n styleUrls: [\"./tz-dp-container.component.scss\"]\n})\nexport class TzDpContainerComponent implements OnInit {\n data: IDatePickerData;\n private parseZoneInstance = (...args) => {\n return parseZone(...args);\n };\n private rawWeekDays: string[] = [\"SUN\", \"MON\", \"TUE\", \"WED\", \"THU\", \"FRI\", \"SAT\"];\n weekDays: IWeekDay[] = [];\n currentMonthNumber: number;\n currentMonth: ICurrentMonth;\n currentYearNumber: number;\n currentMonthDates: ICurrentMonthDates[] = [];\n isPreviousMonthDisabled: boolean = false;\n isNextMonthDisabled: boolean = false;\n localSelectedDate: ICurrentMonthDates;\n\n constructor(@Inject(CONTAINER_DATA) data: IDatePickerData, private toast: ToastService) {\n this.data = data;\n if (this.data?.dpConfig?.timezone) {\n this.parseZoneInstance = (...args) => {\n return tz(args[0], args[1], this.data.dpConfig.timezone);\n };\n }\n this.currentMonthNumber = this.parseZoneInstance().month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.currentYearNumber = this.parseZoneInstance().year();\n this.weekDays = this.rawWeekDays.map((day, index) => ({\n label: `${day[0]}${day.slice(1).toLowerCase()}`,\n isCurrentDay: this.parseZoneInstance().day() === index\n }));\n if (!this.data?.dpConfig?.format) {\n this.data.dpConfig = {\n ...this.data.dpConfig,\n format: DATE_FORMAT\n };\n }\n }\n\n ngOnInit(): void {\n this.currentDateInstance();\n this.calculateMinMaxDays();\n }\n\n private currentDateInstance(): void {\n const selectedDate = parseZone(this.data.date, this.data.dpConfig.format);\n if (selectedDate.isValid()) {\n this.currentYearNumber = selectedDate.year();\n this.currentMonthNumber = selectedDate.month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n }\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n }\n\n private calculateMinMaxDays() {\n const currentInstance = this.parseZoneInstance().year(this.currentYearNumber).month(this.currentMonthNumber);\n const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);\n if (minDate.isValid()) {\n this.isPreviousMonthDisabled = minDate.isSameOrAfter(currentInstance, \"month\");\n }\n const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);\n if (maxDate.isValid()) {\n this.isNextMonthDisabled = maxDate.isSameOrBefore(currentInstance, \"month\");\n }\n }\n\n navigateMonth(direction: \"NEXT\" | \"PREVIOUS\"): void {\n let thisMonth: Moment = parseZone().year(this.currentYearNumber).month(this.currentMonthNumber);\n if (direction === \"NEXT\") {\n thisMonth = thisMonth.add(1, \"month\");\n } else if (direction === \"PREVIOUS\") {\n thisMonth = thisMonth.subtract(1, \"month\");\n }\n this.currentMonthNumber = thisMonth.month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.currentYearNumber = thisMonth.year();\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.calculateMinMaxDays();\n }\n\n private generateDates(month: number, currentYearNumber: number): ICurrentMonthDates[] {\n let dates: ICurrentMonthDates[] = [];\n const daysInMonth = parseZone().year(currentYearNumber).month(month).daysInMonth();\n for (let currentDate = 1; currentDate <= daysInMonth; currentDate++) {\n const date = this.parseZoneInstance().year(currentYearNumber).month(month).date(currentDate);\n const dateString = date.format(this.data.dpConfig.format);\n let isDisabledDay = this.data.datesDisabled.some(d => d === dateString);\n const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);\n if (!isDisabledDay && minDate.isValid()) {\n isDisabledDay = minDate.isAfter(date, \"day\");\n }\n const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);\n if (!isDisabledDay && maxDate.isValid()) {\n isDisabledDay = maxDate.isBefore(date, \"day\");\n }\n dates.push({\n date: currentDate,\n weekDay: date.day(),\n isCurrentDay:\n this.parseZoneInstance().year(currentYearNumber).month(month).date(currentDate).format(this.data.dpConfig.format) ===\n this.parseZoneInstance().format(this.data.dpConfig.format),\n isSelectedDay: !isDisabledDay && date.format(this.data.dpConfig.format) === this.data.date,\n toastMessage: this.data.messages.find(q => date.format(this.data.dpConfig.format) === q.date)?.message || \"\",\n isDisabledDay\n });\n }\n for (let i = dates[0].weekDay; i > 0; i--) {\n dates.unshift({ date: 0, weekDay: i - 1 });\n }\n return dates;\n }\n\n selectDay(day: ICurrentMonthDates) {\n if (day.date <= 0) return;\n if (!day.isDisabledDay) {\n this.localSelectedDate = day;\n if (!this.data.dpConfig.showApplyButton) {\n this.applyDate(day);\n }\n }\n if (day.toastMessage) {\n this.toast.displayMsg(day.toastMessage, 4000);\n }\n }\n\n applyDate(day?: ICurrentMonthDates) {\n if (day || this.localSelectedDate) {\n this.data.dateChange(\n parseZone()\n .year(this.currentYearNumber)\n .month(this.currentMonthNumber)\n .date(day ? day.date : this.localSelectedDate.date)\n .format(this.data.dpConfig.format)\n );\n } else {\n this.cancelDatePicker();\n }\n }\n\n cancelDatePicker() {\n this.data.dateChange(\"\");\n }\n}\n","import { ConnectionPositionPair, Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { Directive, ElementRef, EventEmitter, HostListener, Injector, Input, OnInit, Optional, Output, Self, ViewContainerRef } from \"@angular/core\";\nimport { NgControl } from \"@angular/forms\";\nimport { take } from \"rxjs/operators\";\nimport { genPositionPairs } from \"mis-crystal-design-system/utils\";\nimport { CONTAINER_DATA, DATE_FORMAT } from \"./datepicker-constants\";\nimport { IDatePickerConfig, IDatePickerToastText } from \"./models/dp-config.model\";\nimport { TzDpContainerComponent } from \"./tz-dp-container/tz-dp-container.component\";\n\n@Directive({\n selector: \"input[misTzDp]\"\n})\nexport class TzDatepickerDirective implements OnInit {\n @Input() dpConfig: Partial<IDatePickerConfig>;\n // dd-mm-yyyy 01-12-2022\n @Input() set selectedDate(date: string) {\n this.date = date;\n }\n @Input() set datesDisabled(dates: string[]) {\n this.dpDisabledDates = dates;\n }\n @Input() dateMessages: IDatePickerToastText[] = [];\n @Input() positionX: \"start\" | \"center\" | \"end\" = \"center\";\n @Input() positionY: \"top\" | \"center\" | \"bottom\" = \"bottom\";\n @Input() offsetX: number = 0;\n @Input() offsetY: number = 0;\n private overlayRef: OverlayRef;\n @Output() dateChange = new EventEmitter<string>(true);\n private isOpen = false;\n date: string;\n\n private dpDisabledDates: string[] = [];\n\n constructor(\n @Self() @Optional() private control: NgControl,\n private element: ElementRef,\n private overlay: Overlay,\n private viewContainerRef: ViewContainerRef\n ) {}\n ngOnInit(): void {}\n\n @HostListener(\"click\")\n toggleDatePicker() {\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n }\n\n private open() {\n this.dpConfig = {\n format: DATE_FORMAT,\n minDate: \"\",\n maxDate: \"\",\n showApplyButton: false,\n ...this.dpConfig\n };\n this.isOpen = true;\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(\n genPositionPairs(\n {\n positionX: this.positionX,\n positionY: this.positionY,\n offsetX: this.offsetX,\n offsetY: this.offsetY\n },\n true\n )\n )\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n backdropClass: \"cdk-overlay-transparent-backdrop\"\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(\n TzDpContainerComponent,\n this.viewContainerRef,\n Injector.create({\n providers: [\n {\n provide: CONTAINER_DATA,\n useValue: {\n messages: this.dateMessages,\n date: this.control?.control.value || this.date,\n dpConfig: this.dpConfig,\n datesDisabled: this.dpDisabledDates,\n dateChange: this.applyDate.bind(this)\n }\n }\n ]\n })\n );\n this.overlayRef.attach(tempRef);\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.close();\n });\n }\n\n applyDate(date: string = \"\") {\n if (!date) {\n this.close();\n return;\n }\n this.dateChange.emit(date);\n this.control?.control.patchValue(date);\n this.date = date;\n this.close();\n }\n\n private close() {\n this.isOpen = false;\n this.overlayRef.detach();\n this.overlayRef.dispose();\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { TzDpContainerComponent } from \"./tz-dp-container/tz-dp-container.component\";\nimport { TzDatepickerDirective } from \"./tz-datepicker.directive\";\nimport { ToastModule } from \"mis-crystal-design-system/toast\";\nimport { ButtonModule } from \"mis-crystal-design-system/button\";\n\n@NgModule({\n declarations: [TzDpContainerComponent, TzDatepickerDirective],\n imports: [CommonModule, OverlayModule, ToastModule.forRoot(), ButtonModule],\n exports: [TzDpContainerComponent, TzDatepickerDirective],\n entryComponents: [TzDpContainerComponent]\n})\nexport class DatepickerModuleV2 {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {CONTAINER_DATA as ɵc} from './datepicker-constants';\nexport {IDatePickerData as ɵa} from './models/dp-config.model';\nexport {TzDpContainerComponent as ɵb} from './tz-dp-container/tz-dp-container.component';"],"names":[],"mappings":";;;;;;;;;;;AAAA;MAIa,cAAc,GAAG,IAAI,cAAc,CAAK,gBAAgB,EAAE;AAChE,MAAM,WAAW,GAAG,YAAY;;ACHhC,MAAM,QAAQ,GAAG,CAAC,KAAa;IACpC,IAAI,KAAK,CAAC;IACV,QAAQ,KAAK;QACX,KAAK,CAAC;YACJ,KAAK,GAAG,SAAS,CAAC;YAClB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,UAAU,CAAC;YACnB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,OAAO,CAAC;YAChB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,OAAO,CAAC;YAChB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,KAAK,CAAC;YACd,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,MAAM,CAAC;YACf,MAAM;QACR,KAAK,CAAC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O;SACR;QACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE;QACvC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,EAAE,CAAC;KACd;IAEO,KAAK;QACX,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;KAC3B;;;YAlHF,SAAS,SAAC;gBACT,QAAQ,EAAE,gBAAgB;aAC3B;;;YATQ,SAAS,uBAgCb,IAAI,YAAI,QAAQ;YAjCD,UAAU;YAFG,OAAO;YAEqE,gBAAgB;;;uBAY1H,KAAK;2BAEL,KAAK;4BAGL,KAAK;2BAGL,KAAK;wBACL,KAAK;wBACL,KAAK;sBACL,KAAK;sBACL,KAAK;yBAEL,MAAM;+BAcN,YAAY,SAAC,OAAO;;;MC5BV,kBAAkB;;;YAN9B,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;gBAC7D,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,WAAW,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC;gBAC3E,OAAO,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;gBACxD,eAAe,EAAE,CAAC,sBAAsB,CAAC;aAC1C;;;ACbD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-datepicker_v2.js","sources":["../../../projects/mis-components/datepicker_v2/datepicker-constants.ts","../../../projects/mis-components/datepicker_v2/utils/index.ts","../../../projects/mis-components/datepicker_v2/tz-dp-container/tz-dp-container.component.ts","../../../projects/mis-components/datepicker_v2/tz-datepicker.directive.ts","../../../projects/mis-components/datepicker_v2/datepicker.module.ts","../../../projects/mis-components/datepicker_v2/mis-crystal-design-system-datepicker_v2.ts"],"sourcesContent":["/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const CONTAINER_DATA = new InjectionToken<{}>(\"CONTAINER_DATA\");\nexport const DATE_FORMAT = \"DD-MM-YYYY\";\n","import { ICurrentMonth } from \"../models/dp-config.model\";\n\nexport const getMonth = (index: number): ICurrentMonth => {\n let month;\n switch (index) {\n case 0:\n month = \"January\";\n break;\n case 1:\n month = \"February\";\n break;\n case 2:\n month = \"March\";\n break;\n case 3:\n month = \"April\";\n break;\n case 4:\n month = \"May\";\n break;\n case 5:\n month = \"June\";\n break;\n case 6:\n month = \"July\";\n break;\n case 7:\n month = \"August\";\n break;\n case 8:\n month = \"September\";\n break;\n case 9:\n month = \"October\";\n break;\n case 10:\n month = \"November\";\n break;\n case 11:\n month = \"December\";\n break;\n default:\n break;\n }\n return month;\n};\n","import { Component, Inject, OnInit } from \"@angular/core\";\nimport { CONTAINER_DATA, DATE_FORMAT } from \"../datepicker-constants\";\nimport { ICurrentMonth, ICurrentMonthDates, IDatePickerData, IWeekDay } from \"../models/dp-config.model\";\nimport { parseZone, Moment, tz } from \"moment-timezone\";\nimport { getMonth } from \"../utils\";\nimport { ToastService } from \"mis-crystal-design-system/toast\";\n\n@Component({\n selector: \"mis-tz-dp\",\n templateUrl: \"./tz-dp-container.component.html\",\n styleUrls: [\"./tz-dp-container.component.scss\"]\n})\nexport class TzDpContainerComponent implements OnInit {\n data: IDatePickerData;\n private parseZoneInstance = (...args) => {\n return parseZone(...args);\n };\n private rawWeekDays: string[] = [\"SUN\", \"MON\", \"TUE\", \"WED\", \"THU\", \"FRI\", \"SAT\"];\n weekDays: IWeekDay[] = [];\n currentMonthNumber: number;\n currentMonth: ICurrentMonth;\n currentYearNumber: number;\n currentMonthDates: ICurrentMonthDates[] = [];\n isPreviousMonthDisabled: boolean = false;\n isNextMonthDisabled: boolean = false;\n localSelectedDate: ICurrentMonthDates;\n\n constructor(@Inject(CONTAINER_DATA) data: IDatePickerData, private toast: ToastService) {\n this.data = data;\n if (this.data?.dpConfig?.timezone) {\n this.parseZoneInstance = (...args) => {\n return tz(args[0], args[1], this.data.dpConfig.timezone);\n };\n }\n this.currentMonthNumber = this.parseZoneInstance().month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.currentYearNumber = this.parseZoneInstance().year();\n this.weekDays = this.rawWeekDays.map((day, index) => ({\n label: `${day[0]}${day.slice(1).toLowerCase()}`,\n isCurrentDay: this.parseZoneInstance().day() === index\n }));\n if (!this.data?.dpConfig?.format) {\n this.data.dpConfig = {\n ...this.data.dpConfig,\n format: DATE_FORMAT\n };\n }\n }\n\n ngOnInit(): void {\n this.currentDateInstance();\n this.calculateMinMaxDays();\n }\n\n private currentDateInstance(): void {\n const selectedDate = parseZone(this.data.date, this.data.dpConfig.format);\n if (selectedDate.isValid()) {\n this.currentYearNumber = selectedDate.year();\n this.currentMonthNumber = selectedDate.month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n }\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n }\n\n private calculateMinMaxDays() {\n const currentInstance = this.parseZoneInstance().year(this.currentYearNumber).month(this.currentMonthNumber);\n const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);\n if (minDate.isValid()) {\n this.isPreviousMonthDisabled = minDate.isSameOrAfter(currentInstance, \"month\");\n }\n const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);\n if (maxDate.isValid()) {\n this.isNextMonthDisabled = maxDate.isSameOrBefore(currentInstance, \"month\");\n }\n }\n\n navigateMonth(direction: \"NEXT\" | \"PREVIOUS\"): void {\n let thisMonth: Moment = parseZone().year(this.currentYearNumber).month(this.currentMonthNumber);\n if (direction === \"NEXT\") {\n thisMonth = thisMonth.add(1, \"month\");\n } else if (direction === \"PREVIOUS\") {\n thisMonth = thisMonth.subtract(1, \"month\");\n }\n this.currentMonthNumber = thisMonth.month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.currentYearNumber = thisMonth.year();\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.calculateMinMaxDays();\n }\n\n private generateDates(month: number, currentYearNumber: number): ICurrentMonthDates[] {\n let dates: ICurrentMonthDates[] = [];\n const daysInMonth = parseZone().year(currentYearNumber).month(month).daysInMonth();\n for (let currentDate = 1; currentDate <= daysInMonth; currentDate++) {\n const date = this.parseZoneInstance().year(currentYearNumber).month(month).date(currentDate);\n const dateString = date.format(this.data.dpConfig.format);\n let isDisabledDay = this.data.datesDisabled.some(d => d === dateString);\n const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);\n if (!isDisabledDay && minDate.isValid()) {\n isDisabledDay = minDate.isAfter(date, \"day\");\n }\n const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);\n if (!isDisabledDay && maxDate.isValid()) {\n isDisabledDay = maxDate.isBefore(date, \"day\");\n }\n dates.push({\n date: currentDate,\n weekDay: date.day(),\n isCurrentDay:\n this.parseZoneInstance().year(currentYearNumber).month(month).date(currentDate).format(this.data.dpConfig.format) ===\n this.parseZoneInstance().format(this.data.dpConfig.format),\n isSelectedDay: !isDisabledDay && date.format(this.data.dpConfig.format) === this.data.date,\n toastMessage: this.data.messages.find(q => date.format(this.data.dpConfig.format) === q.date)?.message || \"\",\n isDisabledDay\n });\n }\n for (let i = dates[0].weekDay; i > 0; i--) {\n dates.unshift({ date: 0, weekDay: i - 1 });\n }\n return dates;\n }\n\n selectDay(day: ICurrentMonthDates) {\n if (day.date <= 0) return;\n if (!day.isDisabledDay) {\n this.localSelectedDate = day;\n if (!this.data.dpConfig.showApplyButton) {\n this.applyDate(day);\n }\n }\n if (day.toastMessage) {\n this.toast.displayMsg(day.toastMessage, 4000);\n }\n }\n\n applyDate(day?: ICurrentMonthDates) {\n if (day || this.localSelectedDate) {\n this.data.dateChange(\n parseZone()\n .year(this.currentYearNumber)\n .month(this.currentMonthNumber)\n .date(day ? day.date : this.localSelectedDate.date)\n .format(this.data.dpConfig.format)\n );\n } else {\n this.cancelDatePicker();\n }\n }\n\n cancelDatePicker() {\n this.data.dateChange(\"\");\n }\n}\n","import { ConnectionPositionPair, Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { Directive, ElementRef, EventEmitter, HostListener, Injector, Input, OnInit, Optional, Output, Self, ViewContainerRef } from \"@angular/core\";\nimport { NgControl } from \"@angular/forms\";\nimport { take } from \"rxjs/operators\";\nimport { genPositionPairs } from \"mis-crystal-design-system/utils\";\nimport { CONTAINER_DATA, DATE_FORMAT } from \"./datepicker-constants\";\nimport { IDatePickerConfig, IDatePickerToastText } from \"./models/dp-config.model\";\nimport { TzDpContainerComponent } from \"./tz-dp-container/tz-dp-container.component\";\n\n@Directive({\n selector: \"input[misTzDp]\"\n})\nexport class TzDatepickerDirective implements OnInit {\n @Input() dpConfig: Partial<IDatePickerConfig>;\n // dd-mm-yyyy 01-12-2022\n @Input() set selectedDate(date: string) {\n this.date = date;\n }\n @Input() set datesDisabled(dates: string[]) {\n this.dpDisabledDates = dates;\n }\n @Input() dateMessages: IDatePickerToastText[] = [];\n @Input() positionX: \"start\" | \"center\" | \"end\" = \"center\";\n @Input() positionY: \"top\" | \"center\" | \"bottom\" = \"bottom\";\n @Input() offsetX: number = 0;\n @Input() offsetY: number = 0;\n private overlayRef: OverlayRef;\n @Output() dateChange = new EventEmitter<string>(true);\n private isOpen = false;\n date: string;\n\n private dpDisabledDates: string[] = [];\n\n constructor(\n @Self() @Optional() private control: NgControl,\n private element: ElementRef,\n private overlay: Overlay,\n private viewContainerRef: ViewContainerRef\n ) {}\n ngOnInit(): void {}\n\n @HostListener(\"click\")\n toggleDatePicker() {\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n }\n\n private open() {\n this.dpConfig = {\n format: DATE_FORMAT,\n minDate: \"\",\n maxDate: \"\",\n showApplyButton: false,\n ...this.dpConfig\n };\n this.isOpen = true;\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(\n genPositionPairs(\n {\n positionX: this.positionX,\n positionY: this.positionY,\n offsetX: this.offsetX,\n offsetY: this.offsetY\n },\n true\n )\n )\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n backdropClass: \"cdk-overlay-transparent-backdrop\"\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(\n TzDpContainerComponent,\n this.viewContainerRef,\n Injector.create({\n providers: [\n {\n provide: CONTAINER_DATA,\n useValue: {\n messages: this.dateMessages,\n date: this.control?.control.value || this.date,\n dpConfig: this.dpConfig,\n datesDisabled: this.dpDisabledDates,\n dateChange: this.applyDate.bind(this)\n }\n }\n ]\n })\n );\n this.overlayRef.attach(tempRef);\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.close();\n });\n }\n\n applyDate(date: string = \"\") {\n if (!date) {\n this.close();\n return;\n }\n this.dateChange.emit(date);\n this.control?.control.patchValue(date);\n this.date = date;\n this.close();\n }\n\n private close() {\n this.isOpen = false;\n this.overlayRef.detach();\n this.overlayRef.dispose();\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { TzDpContainerComponent } from \"./tz-dp-container/tz-dp-container.component\";\nimport { TzDatepickerDirective } from \"./tz-datepicker.directive\";\nimport { ToastModule } from \"mis-crystal-design-system/toast\";\nimport { ButtonModule } from \"mis-crystal-design-system/button\";\n\n@NgModule({\n declarations: [TzDpContainerComponent, TzDatepickerDirective],\n imports: [CommonModule, OverlayModule, ToastModule.forRoot(), ButtonModule],\n exports: [TzDpContainerComponent, TzDatepickerDirective],\n entryComponents: [TzDpContainerComponent]\n})\nexport class DatepickerModuleV2 {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {CONTAINER_DATA as ɵc} from './datepicker-constants';\nexport {IDatePickerData as ɵa} from './models/dp-config.model';\nexport {TzDpContainerComponent as ɵb} from './tz-dp-container/tz-dp-container.component';"],"names":[],"mappings":";;;;;;;;;;;AAAA;MAIa,cAAc,GAAG,IAAI,cAAc,CAAK,gBAAgB,EAAE;AAChE,MAAM,WAAW,GAAG,YAAY;;ACHhC,MAAM,QAAQ,GAAG,CAAC,KAAa;IACpC,IAAI,KAAK,CAAC;IACV,QAAQ,KAAK;QACX,KAAK,CAAC;YACJ,KAAK,GAAG,SAAS,CAAC;YAClB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,UAAU,CAAC;YACnB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,OAAO,CAAC;YAChB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,OAAO,CAAC;YAChB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,KAAK,CAAC;YACd,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,MAAM,CAAC;YACf,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,MAAM,CAAC;YACf,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,QAAQ,CAAC;YACjB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,WAAW,CAAC;YACpB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,SAAS,CAAC;YAClB,MAAM;QACR,KAAK,EAAE;YACL,KAAK,GAAG,UAAU,CAAC;YACnB,MAAM;QACR,KAAK,EAAE;YACL,KAAK,GAAG,UAAU,CAAC;YACnB,MAAM;QACR;YACE,MAAM;KACT;IACD,OAAO,KAAK,CAAC;AACf,CAAC;;MCjCY,sBAAsB;IAejC,YAAoC,IAAqB,EAAU,KAAmB;;QAAnB,UAAK,GAAL,KAAK,CAAc;QAb9E,sBAAiB,GAAG,CAAC,GAAG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AEqE,gBAAgB;;;uBAY1H,KAAK;2BAEL,KAAK;4BAGL,KAAK;2BAGL,KAAK;wBACL,KAAK;wBACL,KAAK;sBACL,KAAK;sBACL,KAAK;yBAEL,MAAM;+BAcN,YAAY,SAAC,OAAO;;;MC5BV,kBAAkB;;;YAN9B,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;gBAC7D,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,WAAW,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC;gBAC3E,OAAO,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;gBACxD,eAAe,EAAE,CAAC,sBAAsB,CAAC;aAC1C;;;ACbD;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-daterangepicker_v2.js","sources":["../../../projects/mis-components/daterangepicker_v2/daterangepicker-constants.ts","../../../projects/mis-components/daterangepicker_v2/utils/index.ts","../../../projects/mis-components/daterangepicker_v2/tz-drp-container/tz-drp-container.component.ts","../../../projects/mis-components/daterangepicker_v2/tz-daterangepicker.directive.ts","../../../projects/mis-components/daterangepicker_v2/daterangepicker.module.ts","../../../projects/mis-components/daterangepicker_v2/mis-crystal-design-system-daterangepicker_v2.ts"],"sourcesContent":["/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const CONTAINER_DATA = new InjectionToken<{}>(\"CONTAINER_DATA\");\nexport const DATE_FORMAT = \"DD-MM-YYYY\";\n","import { ICurrentMonth } from \"../models/drp-config.model\";\n\nexport const getMonth = (index: number): ICurrentMonth => {\n let month;\n switch (index) {\n case 0:\n month = \"January\";\n break;\n case 1:\n month = \"February\";\n break;\n case 2:\n month = \"March\";\n break;\n case 3:\n month = \"April\";\n break;\n case 4:\n month = \"May\";\n break;\n case 5:\n month = \"June\";\n break;\n case 6:\n month = \"July\";\n break;\n case 7:\n month = \"August\";\n break;\n case 8:\n month = \"September\";\n break;\n case 9:\n month = \"October\";\n break;\n case 10:\n month = \"November\";\n break;\n case 11:\n month = \"December\";\n break;\n default:\n break;\n }\n return month;\n};\n","import { Component, Inject, OnInit } from \"@angular/core\";\nimport { CONTAINER_DATA, DATE_FORMAT } from \"../daterangepicker-constants\";\nimport { ICurrentMonth, ICurrentMonthDates, IDatePickerData, IWeekDay, ISelectedDatesConfig } from \"../models/drp-config.model\";\nimport { parseZone, Moment } from \"moment-timezone\";\nimport { getMonth } from \"../utils\";\nimport { ToastService } from \"mis-crystal-design-system/toast\";\n\n@Component({\n selector: \"mis-tz-drp\",\n templateUrl: \"./tz-drp-container.component.html\",\n styleUrls: [\"./tz-drp-container.component.scss\"]\n})\nexport class TzDrpContainerComponent implements OnInit {\n data: IDatePickerData;\n private parseZoneInstance = (...args) => {\n return parseZone(...args);\n };\n private rawWeekDays: string[] = [\"SUN\", \"MON\", \"TUE\", \"WED\", \"THU\", \"FRI\", \"SAT\"];\n weekDays: IWeekDay[] = [];\n currentMonthNumber: number;\n currentMonth: ICurrentMonth;\n currentYearNumber: number;\n currentMonthDates: ICurrentMonthDates[] = [];\n nextMonthNumber: number;\n nextMonth: ICurrentMonth;\n nextYearNumber: number;\n nextMonthDates: ICurrentMonthDates[] = [];\n isPreviousMonthDisabled: boolean = false;\n isNextMonthDisabled: boolean = false;\n selectionStarted = false;\n localSelectedDates: ISelectedDatesConfig;\n isDatesValid = false;\n\n constructor(@Inject(CONTAINER_DATA) data: IDatePickerData, private toast: ToastService) {\n this.data = data;\n this.localSelectedDates = this.data.dates;\n this.isDatesValid = false;\n if (this.localSelectedDates.startDate && this.localSelectedDates.endDate) {\n this.isDatesValid = true;\n }\n if (this.data?.dpConfig?.timezone) {\n this.parseZoneInstance = (...args) => {\n return parseZone(...args).tz(this.data.dpConfig.timezone);\n };\n }\n this.currentMonthNumber = this.parseZoneInstance().month();\n this.nextMonthNumber = this.parseZoneInstance().add(1, \"month\").month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.nextMonth = getMonth(this.nextMonthNumber);\n this.currentYearNumber = this.parseZoneInstance().year();\n this.nextYearNumber = this.parseZoneInstance().add(1, \"month\").year();\n this.weekDays = this.rawWeekDays.map((day, index) => ({\n label: `${day[0]}${day.slice(1).toLowerCase()}`,\n isCurrentDay: this.parseZoneInstance().day() === index\n }));\n if (!this.data?.dpConfig?.format) {\n this.data.dpConfig = {\n ...this.data.dpConfig,\n format: DATE_FORMAT\n };\n }\n }\n\n ngOnInit(): void {\n this.currentDateInstance();\n this.calculateMinMaxDays();\n }\n\n private currentDateInstance(): void {\n if (!this.localSelectedDates?.startDate) {\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.nextMonthDates = this.generateDates(this.nextMonthNumber, this.nextYearNumber);\n return;\n }\n const selectedStartDate = this.parseZoneInstance(this.localSelectedDates?.startDate, this.data.dpConfig.format);\n if (selectedStartDate.isValid()) {\n this.currentYearNumber = selectedStartDate.year();\n this.nextYearNumber = selectedStartDate.add(1, \"month\").year();\n this.currentMonthNumber = selectedStartDate.get(\"month\") - 1;\n this.nextMonthNumber = selectedStartDate.add(1, \"month\").month() - 1;\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.nextMonth = getMonth(this.nextMonthNumber);\n }\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.nextMonthDates = this.generateDates(this.nextMonthNumber, this.nextYearNumber);\n }\n\n private calculateMinMaxDays() {\n const currentInstance = this.parseZoneInstance().year(this.currentYearNumber).month(this.currentMonthNumber);\n const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);\n if (minDate.isValid()) {\n this.isPreviousMonthDisabled = minDate.isSameOrAfter(currentInstance, \"month\");\n }\n const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);\n if (maxDate.isValid()) {\n this.isNextMonthDisabled = maxDate.isSameOrBefore(currentInstance, \"month\");\n }\n }\n\n navigateMonth(direction: \"NEXT\" | \"PREVIOUS\"): void {\n let thisMonth: Moment = parseZone().year(this.currentYearNumber).month(this.currentMonthNumber);\n if (direction === \"NEXT\") {\n thisMonth = thisMonth.add(1, \"month\");\n } else if (direction === \"PREVIOUS\") {\n thisMonth = thisMonth.subtract(1, \"month\");\n }\n this.currentMonthNumber = thisMonth.month();\n this.nextMonthNumber = thisMonth.add(1, \"month\").month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.nextMonth = getMonth(this.nextMonthNumber);\n this.currentYearNumber = thisMonth.year();\n this.nextYearNumber = thisMonth.add(1, \"month\").year();\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.nextMonthDates = this.generateDates(this.nextMonthNumber, this.nextYearNumber);\n this.calculateMinMaxDays();\n }\n\n private generateDates(month: number, currentYearNumber: number): ICurrentMonthDates[] {\n let dates: ICurrentMonthDates[] = [];\n const daysInMonth = parseZone().year(currentYearNumber).month(month).daysInMonth();\n for (let currentDate = 1; currentDate <= daysInMonth; currentDate++) {\n const date = this.parseZoneInstance().year(currentYearNumber).month(month).date(currentDate);\n const dateString = date.format(this.data.dpConfig.format);\n let isDisabledDay = this.data.datesDisabled.some(d => d === dateString);\n const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);\n if (!isDisabledDay && minDate.isValid()) {\n isDisabledDay = minDate.isAfter(date, \"day\");\n }\n const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);\n if (!isDisabledDay && maxDate.isValid()) {\n isDisabledDay = maxDate.isBefore(date, \"day\");\n }\n const isCurrentDay =\n this.parseZoneInstance().year(currentYearNumber).month(month).date(currentDate).format(this.data.dpConfig.format) ===\n this.parseZoneInstance().format(this.data.dpConfig.format);\n const isSelectedStartDay =\n !isDisabledDay &&\n (this.localSelectedDates?.startDate ?? false) &&\n date.format(this.data.dpConfig.format) === this.localSelectedDates?.startDate;\n const isAfterSelectedStartDate = this.parseZoneInstance(date).isAfter(this.localSelectedDates.startDate, \"day\");\n const isBeforeSelectedEndDate = this.parseZoneInstance(date).isBefore(parseZone(this.localSelectedDates.endDate), \"day\");\n const inRangeDay =\n (this.localSelectedDates.startDate ?? false) &&\n (this.localSelectedDates.endDate ?? false) &&\n isAfterSelectedStartDate &&\n isBeforeSelectedEndDate;\n\n const isSelectedEndDay =\n !isDisabledDay &&\n ((this.localSelectedDates?.startDate && this.localSelectedDates?.endDate) ?? false) &&\n date.format(this.data.dpConfig.format) === this.localSelectedDates?.endDate;\n dates.push({\n date: currentDate,\n weekDay: date.day(),\n isCurrentDay,\n isSelectedStartDay,\n isSelectedEndDay,\n inRangeDay,\n toastMessage: this.data.messages.find(q => date.format(this.data.dpConfig.format) === q.date)?.message || \"\",\n isDisabledDay\n });\n }\n for (let i = dates[0].weekDay; i > 0; i--) {\n dates.unshift({ date: 0, weekDay: i - 1 });\n }\n return dates;\n }\n\n selectDay(from: \"LEFT\" | \"RIGHT\", day: ICurrentMonthDates) {\n if (day.date <= 0) return;\n if (!day.isDisabledDay) {\n if (this.selectionStarted) {\n const momentDay = parseZone()\n .year(from === \"LEFT\" ? this.currentYearNumber : this.nextYearNumber)\n .month(from === \"LEFT\" ? this.currentMonthNumber : this.nextMonthNumber)\n .date(day.date);\n if (momentDay.isBefore(this.localSelectedDates.startDate, \"day\")) {\n this.localSelectedDates = {\n startDate: momentDay.format(this.data.dpConfig.format),\n endDate: null\n };\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.nextMonthDates = this.generateDates(this.nextMonthNumber, this.nextYearNumber);\n return;\n }\n this.selectionStarted = false;\n this.localSelectedDates = {\n ...this.localSelectedDates,\n endDate: momentDay.format(this.data.dpConfig.format)\n };\n } else {\n this.selectionStarted = true;\n this.localSelectedDates = {\n startDate: parseZone()\n .year(from === \"LEFT\" ? this.currentYearNumber : this.nextYearNumber)\n .month(from === \"LEFT\" ? this.currentMonthNumber : this.nextMonthNumber)\n .date(day.date)\n .format(this.data.dpConfig.format),\n endDate: null\n };\n }\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.nextMonthDates = this.generateDates(this.nextMonthNumber, this.nextYearNumber);\n this.isDatesValid = false;\n if (this.localSelectedDates.startDate && this.localSelectedDates.endDate) {\n this.isDatesValid = true;\n }\n }\n if (day.toastMessage) {\n this.toast.displayMsg(day.toastMessage, 4000);\n }\n }\n applyDates() {\n this.data.dateChange(this.localSelectedDates);\n }\n cancelDatePicker() {\n this.data.close();\n }\n}\n","import { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { Directive, ElementRef, EventEmitter, HostListener, Injector, Input, Optional, Output, Self, ViewContainerRef } from \"@angular/core\";\nimport { NgControl } from \"@angular/forms\";\nimport { take } from \"rxjs/operators\";\nimport { genPositionPairs } from \"mis-crystal-design-system/utils\";\nimport { CONTAINER_DATA, DATE_FORMAT } from \"./daterangepicker-constants\";\nimport { IDatePickerConfig, IDatePickerToastText, ISelectedDatesConfig } from \"./models/drp-config.model\";\nimport { TzDrpContainerComponent } from \"./tz-drp-container/tz-drp-container.component\";\n\n@Directive({\n selector: \"input[misTzDrp]\"\n})\nexport class TzDaterangepickerDirective {\n @Input() dpConfig: Partial<IDatePickerConfig> = {\n format: DATE_FORMAT,\n minDate: \"\",\n maxDate: \"\"\n };\n // dd-mm-yyyy 01-12-2022\n @Input() set selectedDates(dates: ISelectedDatesConfig) {\n this.dates = { startDate: null, endDate: null, ...dates };\n }\n @Input() set datesDisabled(dates: string[]) {\n this.dpDisabledDates = dates;\n }\n @Input() dateMessages: IDatePickerToastText[] = [];\n @Input() positionX: \"start\" | \"center\" | \"end\" = \"center\";\n @Input() positionY: \"top\" | \"center\" | \"bottom\" = \"bottom\";\n @Input() offsetX: number = 0;\n @Input() offsetY: number = 0;\n private overlayRef: OverlayRef;\n @Output() dateChange = new EventEmitter<ISelectedDatesConfig>(true);\n private isOpen = false;\n dates: ISelectedDatesConfig;\n\n private dpDisabledDates: string[] = [];\n\n constructor(\n @Self() @Optional() private control: NgControl,\n private element: ElementRef,\n private overlay: Overlay,\n private viewContainerRef: ViewContainerRef\n ) {}\n\n @HostListener(\"click\")\n toggleDatePicker() {\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n }\n\n private open() {\n this.isOpen = true;\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(\n genPositionPairs(\n {\n positionX: this.positionX,\n positionY: this.positionY,\n offsetX: this.offsetX,\n offsetY: this.offsetY\n },\n true\n )\n )\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n backdropClass: \"cdk-overlay-transparent-backdrop\"\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(\n TzDrpContainerComponent,\n this.viewContainerRef,\n Injector.create({\n providers: [\n {\n provide: CONTAINER_DATA,\n useValue: {\n messages: this.dateMessages,\n dates: this.control?.control.value || this.dates,\n dpConfig: this.dpConfig,\n datesDisabled: this.dpDisabledDates,\n dateChange: this.applyDate.bind(this),\n close: this.close.bind(this)\n }\n }\n ]\n })\n );\n this.overlayRef.attach(tempRef);\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.close();\n });\n }\n\n applyDate(dates: ISelectedDatesConfig) {\n this.dateChange.emit(dates);\n this.control?.control.patchValue(dates);\n this.dates = dates;\n this.close();\n }\n\n close() {\n this.isOpen = false;\n this.overlayRef.detach();\n this.overlayRef.dispose();\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { TzDrpContainerComponent } from \"./tz-drp-container/tz-drp-container.component\";\nimport { TzDaterangepickerDirective } from \"./tz-daterangepicker.directive\";\nimport { ToastModule } from \"mis-crystal-design-system/toast\";\nimport { ButtonModule } from \"mis-crystal-design-system/button\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\n\n@NgModule({\n declarations: [TzDrpContainerComponent, TzDaterangepickerDirective],\n imports: [CommonModule, OverlayModule, ToastModule.forRoot(), ButtonModule.forRoot()],\n exports: [TzDrpContainerComponent, TzDaterangepickerDirective],\n entryComponents: [TzDrpContainerComponent]\n})\nexport class DateRangepickerModuleV2 {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {CONTAINER_DATA as ɵc} from './daterangepicker-constants';\nexport {IDatePickerData as ɵa} from './models/drp-config.model';\nexport {TzDrpContainerComponent as ɵb} from './tz-drp-container/tz-drp-container.component';"],"names":[],"mappings":";;;;;;;;;;;AAAA;MAIa,cAAc,GAAG,IAAI,cAAc,CAAK,gBAAgB,EAAE;AAChE,MAAM,WAAW,GAAG,YAAY;;ACHhC,MAAM,QAAQ,GAAG,CAAC,KAAa;IACpC,IAAI,KAAK,CAAC;IACV,QAAQ,KAAK;QACX,KAAK,CAAC;YACJ,KAAK,GAAG,SAAS,CAAC;YAClB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,UAAU,CAAC;YACnB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,OAAO,CAAC;YAChB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,OAAO,CAAC;YAChB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,KAAK,CAAC;YACd,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,MAAM,CAAC;YACf,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,MAAM,CAAC;YACf,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,QAAQ,CAAC;YACjB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,WAAW,CAAC;YACpB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,SAAS,CAAC;YAClB,MAAM;QACR,KAAK,EAAE;YACL,KAAK,GAAG,UAAU,CAAC;YACnB,MAAM;QACR,KAAK,EAAE;YACL,K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C;SACd,CAAC,CAAC;KACN;IAED,SAAS,CAAC,KAA2B;;QACnC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE;QACxC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,EAAE,CAAC;KACd;IAED,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;KAC3B;;;YA3GF,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;aAC5B;;;YATQ,SAAS,uBAoCb,IAAI,YAAI,QAAQ;YArCD,UAAU;YAFrB,OAAO;YAEqF,gBAAgB;;;uBAYlH,KAAK;4BAML,KAAK;4BAGL,KAAK;2BAGL,KAAK;wBACL,KAAK;wBACL,KAAK;sBACL,KAAK;sBACL,KAAK;yBAEL,MAAM;+BAaN,YAAY,SAAC,OAAO;;;MC/BV,uBAAuB;;;YANnC,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,uBAAuB,EAAE,0BAA0B,CAAC;gBACnE,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,WAAW,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC;gBACrF,OAAO,EAAE,CAAC,uBAAuB,EAAE,0BAA0B,CAAC;gBAC9D,eAAe,EAAE,CAAC,uBAAuB,CAAC;aAC3C;;;ACbD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-daterangepicker_v2.js","sources":["../../../projects/mis-components/daterangepicker_v2/daterangepicker-constants.ts","../../../projects/mis-components/daterangepicker_v2/utils/index.ts","../../../projects/mis-components/daterangepicker_v2/tz-drp-container/tz-drp-container.component.ts","../../../projects/mis-components/daterangepicker_v2/tz-daterangepicker.directive.ts","../../../projects/mis-components/daterangepicker_v2/daterangepicker.module.ts","../../../projects/mis-components/daterangepicker_v2/mis-crystal-design-system-daterangepicker_v2.ts"],"sourcesContent":["/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const CONTAINER_DATA = new InjectionToken<{}>(\"CONTAINER_DATA\");\nexport const DATE_FORMAT = \"DD-MM-YYYY\";\n","import { ICurrentMonth } from \"../models/drp-config.model\";\n\nexport const getMonth = (index: number): ICurrentMonth => {\n let month;\n switch (index) {\n case 0:\n month = \"January\";\n break;\n case 1:\n month = \"February\";\n break;\n case 2:\n month = \"March\";\n break;\n case 3:\n month = \"April\";\n break;\n case 4:\n month = \"May\";\n break;\n case 5:\n month = \"June\";\n break;\n case 6:\n month = \"July\";\n break;\n case 7:\n month = \"August\";\n break;\n case 8:\n month = \"September\";\n break;\n case 9:\n month = \"October\";\n break;\n case 10:\n month = \"November\";\n break;\n case 11:\n month = \"December\";\n break;\n default:\n break;\n }\n return month;\n};\n","import { Component, Inject, OnInit } from \"@angular/core\";\nimport { CONTAINER_DATA, DATE_FORMAT } from \"../daterangepicker-constants\";\nimport { ICurrentMonth, ICurrentMonthDates, IDatePickerData, IWeekDay, ISelectedDatesConfig } from \"../models/drp-config.model\";\nimport { parseZone, Moment } from \"moment-timezone\";\nimport { getMonth } from \"../utils\";\nimport { ToastService } from \"mis-crystal-design-system/toast\";\n\n@Component({\n selector: \"mis-tz-drp\",\n templateUrl: \"./tz-drp-container.component.html\",\n styleUrls: [\"./tz-drp-container.component.scss\"]\n})\nexport class TzDrpContainerComponent implements OnInit {\n data: IDatePickerData;\n private parseZoneInstance = (...args) => {\n return parseZone(...args);\n };\n private rawWeekDays: string[] = [\"SUN\", \"MON\", \"TUE\", \"WED\", \"THU\", \"FRI\", \"SAT\"];\n weekDays: IWeekDay[] = [];\n currentMonthNumber: number;\n currentMonth: ICurrentMonth;\n currentYearNumber: number;\n currentMonthDates: ICurrentMonthDates[] = [];\n nextMonthNumber: number;\n nextMonth: ICurrentMonth;\n nextYearNumber: number;\n nextMonthDates: ICurrentMonthDates[] = [];\n isPreviousMonthDisabled: boolean = false;\n isNextMonthDisabled: boolean = false;\n selectionStarted = false;\n localSelectedDates: ISelectedDatesConfig;\n isDatesValid = false;\n\n constructor(@Inject(CONTAINER_DATA) data: IDatePickerData, private toast: ToastService) {\n this.data = data;\n this.localSelectedDates = this.data.dates;\n this.isDatesValid = false;\n if (this.localSelectedDates.startDate && this.localSelectedDates.endDate) {\n this.isDatesValid = true;\n }\n if (this.data?.dpConfig?.timezone) {\n this.parseZoneInstance = (...args) => {\n return parseZone(...args).tz(this.data.dpConfig.timezone);\n };\n }\n this.currentMonthNumber = this.parseZoneInstance().month();\n this.nextMonthNumber = this.parseZoneInstance().add(1, \"month\").month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.nextMonth = getMonth(this.nextMonthNumber);\n this.currentYearNumber = this.parseZoneInstance().year();\n this.nextYearNumber = this.parseZoneInstance().add(1, \"month\").year();\n this.weekDays = this.rawWeekDays.map((day, index) => ({\n label: `${day[0]}${day.slice(1).toLowerCase()}`,\n isCurrentDay: this.parseZoneInstance().day() === index\n }));\n if (!this.data?.dpConfig?.format) {\n this.data.dpConfig = {\n ...this.data.dpConfig,\n format: DATE_FORMAT\n };\n }\n }\n\n ngOnInit(): void {\n this.currentDateInstance();\n this.calculateMinMaxDays();\n }\n\n private currentDateInstance(): void {\n if (!this.localSelectedDates?.startDate) {\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.nextMonthDates = this.generateDates(this.nextMonthNumber, this.nextYearNumber);\n return;\n }\n const selectedStartDate = this.parseZoneInstance(this.localSelectedDates?.startDate, this.data.dpConfig.format);\n if (selectedStartDate.isValid()) {\n this.currentYearNumber = selectedStartDate.year();\n this.nextYearNumber = selectedStartDate.add(1, \"month\").year();\n this.currentMonthNumber = selectedStartDate.get(\"month\") - 1;\n this.nextMonthNumber = selectedStartDate.add(1, \"month\").month() - 1;\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.nextMonth = getMonth(this.nextMonthNumber);\n }\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.nextMonthDates = this.generateDates(this.nextMonthNumber, this.nextYearNumber);\n }\n\n private calculateMinMaxDays() {\n const currentInstance = this.parseZoneInstance().year(this.currentYearNumber).month(this.currentMonthNumber);\n const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);\n if (minDate.isValid()) {\n this.isPreviousMonthDisabled = minDate.isSameOrAfter(currentInstance, \"month\");\n }\n const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);\n if (maxDate.isValid()) {\n this.isNextMonthDisabled = maxDate.isSameOrBefore(currentInstance, \"month\");\n }\n }\n\n navigateMonth(direction: \"NEXT\" | \"PREVIOUS\"): void {\n let thisMonth: Moment = parseZone().year(this.currentYearNumber).month(this.currentMonthNumber);\n if (direction === \"NEXT\") {\n thisMonth = thisMonth.add(1, \"month\");\n } else if (direction === \"PREVIOUS\") {\n thisMonth = thisMonth.subtract(1, \"month\");\n }\n this.currentMonthNumber = thisMonth.month();\n this.nextMonthNumber = thisMonth.add(1, \"month\").month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.nextMonth = getMonth(this.nextMonthNumber);\n this.currentYearNumber = thisMonth.year();\n this.nextYearNumber = thisMonth.add(1, \"month\").year();\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.nextMonthDates = this.generateDates(this.nextMonthNumber, this.nextYearNumber);\n this.calculateMinMaxDays();\n }\n\n private generateDates(month: number, currentYearNumber: number): ICurrentMonthDates[] {\n let dates: ICurrentMonthDates[] = [];\n const daysInMonth = parseZone().year(currentYearNumber).month(month).daysInMonth();\n for (let currentDate = 1; currentDate <= daysInMonth; currentDate++) {\n const date = this.parseZoneInstance().year(currentYearNumber).month(month).date(currentDate);\n const dateString = date.format(this.data.dpConfig.format);\n let isDisabledDay = this.data.datesDisabled.some(d => d === dateString);\n const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);\n if (!isDisabledDay && minDate.isValid()) {\n isDisabledDay = minDate.isAfter(date, \"day\");\n }\n const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);\n if (!isDisabledDay && maxDate.isValid()) {\n isDisabledDay = maxDate.isBefore(date, \"day\");\n }\n const isCurrentDay =\n this.parseZoneInstance().year(currentYearNumber).month(month).date(currentDate).format(this.data.dpConfig.format) ===\n this.parseZoneInstance().format(this.data.dpConfig.format);\n const isSelectedStartDay =\n !isDisabledDay &&\n (this.localSelectedDates?.startDate ?? false) &&\n date.format(this.data.dpConfig.format) === this.localSelectedDates?.startDate;\n const isAfterSelectedStartDate = this.parseZoneInstance(date).isAfter(this.localSelectedDates.startDate, \"day\");\n const isBeforeSelectedEndDate = this.parseZoneInstance(date).isBefore(parseZone(this.localSelectedDates.endDate), \"day\");\n const inRangeDay =\n (this.localSelectedDates.startDate ?? false) &&\n (this.localSelectedDates.endDate ?? false) &&\n isAfterSelectedStartDate &&\n isBeforeSelectedEndDate;\n\n const isSelectedEndDay =\n !isDisabledDay &&\n ((this.localSelectedDates?.startDate && this.localSelectedDates?.endDate) ?? false) &&\n date.format(this.data.dpConfig.format) === this.localSelectedDates?.endDate;\n dates.push({\n date: currentDate,\n weekDay: date.day(),\n isCurrentDay,\n isSelectedStartDay,\n isSelectedEndDay,\n inRangeDay,\n toastMessage: this.data.messages.find(q => date.format(this.data.dpConfig.format) === q.date)?.message || \"\",\n isDisabledDay\n });\n }\n for (let i = dates[0].weekDay; i > 0; i--) {\n dates.unshift({ date: 0, weekDay: i - 1 });\n }\n return dates;\n }\n\n selectDay(from: \"LEFT\" | \"RIGHT\", day: ICurrentMonthDates) {\n if (day.date <= 0) return;\n if (!day.isDisabledDay) {\n if (this.selectionStarted) {\n const momentDay = parseZone()\n .year(from === \"LEFT\" ? this.currentYearNumber : this.nextYearNumber)\n .month(from === \"LEFT\" ? this.currentMonthNumber : this.nextMonthNumber)\n .date(day.date);\n if (momentDay.isBefore(this.localSelectedDates.startDate, \"day\")) {\n this.localSelectedDates = {\n startDate: momentDay.format(this.data.dpConfig.format),\n endDate: null\n };\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.nextMonthDates = this.generateDates(this.nextMonthNumber, this.nextYearNumber);\n return;\n }\n this.selectionStarted = false;\n this.localSelectedDates = {\n ...this.localSelectedDates,\n endDate: momentDay.format(this.data.dpConfig.format)\n };\n } else {\n this.selectionStarted = true;\n this.localSelectedDates = {\n startDate: parseZone()\n .year(from === \"LEFT\" ? this.currentYearNumber : this.nextYearNumber)\n .month(from === \"LEFT\" ? this.currentMonthNumber : this.nextMonthNumber)\n .date(day.date)\n .format(this.data.dpConfig.format),\n endDate: null\n };\n }\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.nextMonthDates = this.generateDates(this.nextMonthNumber, this.nextYearNumber);\n this.isDatesValid = false;\n if (this.localSelectedDates.startDate && this.localSelectedDates.endDate) {\n this.isDatesValid = true;\n }\n }\n if (day.toastMessage) {\n this.toast.displayMsg(day.toastMessage, 4000);\n }\n }\n applyDates() {\n this.data.dateChange(this.localSelectedDates);\n }\n cancelDatePicker() {\n this.data.close();\n }\n}\n","import { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { Directive, ElementRef, EventEmitter, HostListener, Injector, Input, Optional, Output, Self, ViewContainerRef } from \"@angular/core\";\nimport { NgControl } from \"@angular/forms\";\nimport { take } from \"rxjs/operators\";\nimport { genPositionPairs } from \"mis-crystal-design-system/utils\";\nimport { CONTAINER_DATA, DATE_FORMAT } from \"./daterangepicker-constants\";\nimport { IDatePickerConfig, IDatePickerToastText, ISelectedDatesConfig } from \"./models/drp-config.model\";\nimport { TzDrpContainerComponent } from \"./tz-drp-container/tz-drp-container.component\";\n\n@Directive({\n selector: \"input[misTzDrp]\"\n})\nexport class TzDaterangepickerDirective {\n @Input() dpConfig: Partial<IDatePickerConfig> = {\n format: DATE_FORMAT,\n minDate: \"\",\n maxDate: \"\"\n };\n // dd-mm-yyyy 01-12-2022\n @Input() set selectedDates(dates: ISelectedDatesConfig) {\n this.dates = { startDate: null, endDate: null, ...dates };\n }\n @Input() set datesDisabled(dates: string[]) {\n this.dpDisabledDates = dates;\n }\n @Input() dateMessages: IDatePickerToastText[] = [];\n @Input() positionX: \"start\" | \"center\" | \"end\" = \"center\";\n @Input() positionY: \"top\" | \"center\" | \"bottom\" = \"bottom\";\n @Input() offsetX: number = 0;\n @Input() offsetY: number = 0;\n private overlayRef: OverlayRef;\n @Output() dateChange = new EventEmitter<ISelectedDatesConfig>(true);\n private isOpen = false;\n dates: ISelectedDatesConfig;\n\n private dpDisabledDates: string[] = [];\n\n constructor(\n @Self() @Optional() private control: NgControl,\n private element: ElementRef,\n private overlay: Overlay,\n private viewContainerRef: ViewContainerRef\n ) {}\n\n @HostListener(\"click\")\n toggleDatePicker() {\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n }\n\n private open() {\n this.isOpen = true;\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(\n genPositionPairs(\n {\n positionX: this.positionX,\n positionY: this.positionY,\n offsetX: this.offsetX,\n offsetY: this.offsetY\n },\n true\n )\n )\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n backdropClass: \"cdk-overlay-transparent-backdrop\"\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(\n TzDrpContainerComponent,\n this.viewContainerRef,\n Injector.create({\n providers: [\n {\n provide: CONTAINER_DATA,\n useValue: {\n messages: this.dateMessages,\n dates: this.control?.control.value || this.dates,\n dpConfig: this.dpConfig,\n datesDisabled: this.dpDisabledDates,\n dateChange: this.applyDate.bind(this),\n close: this.close.bind(this)\n }\n }\n ]\n })\n );\n this.overlayRef.attach(tempRef);\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.close();\n });\n }\n\n applyDate(dates: ISelectedDatesConfig) {\n this.dateChange.emit(dates);\n this.control?.control.patchValue(dates);\n this.dates = dates;\n this.close();\n }\n\n close() {\n this.isOpen = false;\n this.overlayRef.detach();\n this.overlayRef.dispose();\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { TzDrpContainerComponent } from \"./tz-drp-container/tz-drp-container.component\";\nimport { TzDaterangepickerDirective } from \"./tz-daterangepicker.directive\";\nimport { ToastModule } from \"mis-crystal-design-system/toast\";\nimport { ButtonModule } from \"mis-crystal-design-system/button\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\n\n@NgModule({\n declarations: [TzDrpContainerComponent, TzDaterangepickerDirective],\n imports: [CommonModule, OverlayModule, ToastModule.forRoot(), ButtonModule.forRoot()],\n exports: [TzDrpContainerComponent, TzDaterangepickerDirective],\n entryComponents: [TzDrpContainerComponent]\n})\nexport class DateRangepickerModuleV2 {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {CONTAINER_DATA as ɵc} from './daterangepicker-constants';\nexport {IDatePickerData as ɵa} from './models/drp-config.model';\nexport {TzDrpContainerComponent as ɵb} from './tz-drp-container/tz-drp-container.component';"],"names":[],"mappings":";;;;;;;;;;;AAAA;MAIa,cAAc,GAAG,IAAI,cAAc,CAAK,gBAAgB,EAAE;AAChE,MAAM,WAAW,GAAG,YAAY;;ACHhC,MAAM,QAAQ,GAAG,CAAC,KAAa;IACpC,IAAI,KAAK,CAAC;IACV,QAAQ,KAAK;QACX,KAAK,CAAC;YACJ,KAAK,GAAG,SAAS,CAAC;YAClB,MAAM;QACR,KAAK,CAAC;YACJ,KAAK,GAAG,UAAU,CAAC;YACnB,MAAM;QACR,KAAK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SAAC,OAAO;;;MC/BV,uBAAuB;;;YANnC,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,uBAAuB,EAAE,0BAA0B,CAAC;gBACnE,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,WAAW,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC;gBACrF,OAAO,EAAE,CAAC,uBAAuB,EAAE,0BAA0B,CAAC;gBAC9D,eAAe,EAAE,CAAC,uBAAuB,CAAC;aAC3C;;;ACbD;;;;;;"}
|
|
@@ -1,38 +1,11 @@
|
|
|
1
1
|
import { OverlayConfig, Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
2
|
-
import { ComponentPortal,
|
|
3
|
-
import { Component, ComponentFactoryResolver, ViewChild, ViewContainerRef, InjectionToken, ɵɵdefineInjectable, ɵɵinject, INJECTOR, Injectable,
|
|
2
|
+
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
3
|
+
import { Component, ComponentFactoryResolver, ViewChild, ViewContainerRef, InjectionToken, Injector, ɵɵdefineInjectable, ɵɵinject, INJECTOR, Injectable, NgModule } from '@angular/core';
|
|
4
4
|
import { take } from 'rxjs/operators';
|
|
5
5
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
6
6
|
import { Subject } from 'rxjs';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
|
|
9
|
-
/** @format */
|
|
10
|
-
class DrawerRef {
|
|
11
|
-
constructor(overlay) {
|
|
12
|
-
this.overlay = overlay;
|
|
13
|
-
this._isExpanded = false;
|
|
14
|
-
this.afterClosed$ = new Subject();
|
|
15
|
-
this.afterClosed = this.afterClosed$.asObservable();
|
|
16
|
-
}
|
|
17
|
-
get isExpanded() {
|
|
18
|
-
return this._isExpanded;
|
|
19
|
-
}
|
|
20
|
-
close(data) {
|
|
21
|
-
this.overlay.detach();
|
|
22
|
-
this.overlay.dispose();
|
|
23
|
-
this.afterClosed$.next(data);
|
|
24
|
-
this.afterClosed$.complete();
|
|
25
|
-
}
|
|
26
|
-
expand() {
|
|
27
|
-
this.overlay.updateSize({ width: "100%" });
|
|
28
|
-
this._isExpanded = true;
|
|
29
|
-
}
|
|
30
|
-
collapse() {
|
|
31
|
-
this.overlay.updateSize({ width: "422px" });
|
|
32
|
-
this._isExpanded = false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
9
|
/** @format */
|
|
37
10
|
class DrawerBodyComponent {
|
|
38
11
|
constructor(cfr) {
|
|
@@ -44,11 +17,6 @@ class DrawerBodyComponent {
|
|
|
44
17
|
initComponent(type, injector) {
|
|
45
18
|
this.drawerPortal = new ComponentPortal(type, this.place, injector);
|
|
46
19
|
}
|
|
47
|
-
createInjector(ref, inj) {
|
|
48
|
-
const injectorTokens = new WeakMap([[DrawerRef, ref]]);
|
|
49
|
-
return new PortalInjector(inj, injectorTokens);
|
|
50
|
-
// return Injector.create({ providers: [{ provide: inj, useValue: injectorTokens }] });
|
|
51
|
-
}
|
|
52
20
|
}
|
|
53
21
|
DrawerBodyComponent.decorators = [
|
|
54
22
|
{ type: Component, args: [{
|
|
@@ -70,6 +38,33 @@ DrawerBodyComponent.propDecorators = {
|
|
|
70
38
|
place: [{ type: ViewChild, args: ["place", { static: false, read: ViewContainerRef },] }]
|
|
71
39
|
};
|
|
72
40
|
|
|
41
|
+
/** @format */
|
|
42
|
+
class DrawerRef {
|
|
43
|
+
constructor(overlay) {
|
|
44
|
+
this.overlay = overlay;
|
|
45
|
+
this._isExpanded = false;
|
|
46
|
+
this.afterClosed$ = new Subject();
|
|
47
|
+
this.afterClosed = this.afterClosed$.asObservable();
|
|
48
|
+
}
|
|
49
|
+
get isExpanded() {
|
|
50
|
+
return this._isExpanded;
|
|
51
|
+
}
|
|
52
|
+
close(data) {
|
|
53
|
+
this.overlay.detach();
|
|
54
|
+
this.overlay.dispose();
|
|
55
|
+
this.afterClosed$.next(data);
|
|
56
|
+
this.afterClosed$.complete();
|
|
57
|
+
}
|
|
58
|
+
expand() {
|
|
59
|
+
this.overlay.updateSize({ width: "100%" });
|
|
60
|
+
this._isExpanded = true;
|
|
61
|
+
}
|
|
62
|
+
collapse() {
|
|
63
|
+
this.overlay.updateSize({ width: "422px" });
|
|
64
|
+
this._isExpanded = false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
73
68
|
/** @format */
|
|
74
69
|
const DRAWER_DATA_VAR = new InjectionToken("MISDrawerDataInjectionToken");
|
|
75
70
|
|
|
@@ -108,8 +103,14 @@ class DrawerService {
|
|
|
108
103
|
const injectorTokens = new WeakMap();
|
|
109
104
|
injectorTokens.set(DrawerRef, ref);
|
|
110
105
|
injectorTokens.set(DRAWER_DATA_VAR, data);
|
|
111
|
-
return new PortalInjector(inj, injectorTokens);
|
|
112
|
-
|
|
106
|
+
// return new PortalInjector(inj, injectorTokens);
|
|
107
|
+
return Injector.create({
|
|
108
|
+
parent: inj,
|
|
109
|
+
providers: [
|
|
110
|
+
{ provide: DrawerRef, useValue: ref },
|
|
111
|
+
{ provide: DRAWER_DATA_VAR, useValue: data }
|
|
112
|
+
]
|
|
113
|
+
});
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
DrawerService.ɵprov = ɵɵdefineInjectable({ factory: function DrawerService_Factory() { return new DrawerService(ɵɵinject(Overlay), ɵɵinject(INJECTOR)); }, token: DrawerService, providedIn: "root" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-drawer.js","sources":["../../../projects/mis-components/drawer/drawer-
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-drawer.js","sources":["../../../projects/mis-components/drawer/drawer-body/drawer-body.component.ts","../../../projects/mis-components/drawer/drawer-ref.ts","../../../projects/mis-components/drawer/drawer-constants.ts","../../../projects/mis-components/drawer/drawer.service.ts","../../../projects/mis-components/drawer/drawer.module.ts","../../../projects/mis-components/drawer/mis-crystal-design-system-drawer.ts"],"sourcesContent":["/** @format */\n\nimport { trigger, transition, style, animate } from \"@angular/animations\";\nimport { ComponentPortal, PortalInjector } from \"@angular/cdk/portal\";\nimport { Component, ComponentFactoryResolver, Injector, OnInit, ViewChild, ViewContainerRef } from \"@angular/core\";\nimport { DrawerRef } from \"../drawer-ref\";\n\n@Component({\n selector: \"mis-drawer-body\",\n templateUrl: \"./drawer-body.component.html\",\n styleUrls: [\"./drawer-body.component.scss\"],\n animations: [\n trigger(\"slideInOut\", [\n transition(\":enter\", [style({ transform: \"translateX(100%)\" }), animate(\"200ms ease-out\", style({ transform: \"translateX(0%)\" }))]),\n transition(\":leave\", [animate(\"200ms ease-out\", style({ transform: \"translateX(100%)\" }))])\n ])\n ]\n})\nexport class DrawerBodyComponent {\n drawerPortal: ComponentPortal<any>;\n constructor(private cfr: ComponentFactoryResolver) {}\n\n @ViewChild(\"place\", { static: false, read: ViewContainerRef }) place: ViewContainerRef;\n\n bindComponent(type: any, injector: Injector) {\n this.initComponent(type, injector);\n }\n\n private initComponent(type: any, injector: Injector) {\n this.drawerPortal = new ComponentPortal(type, this.place, injector);\n }\n}\n","/** @format */\n\nimport { OverlayRef } from \"@angular/cdk/overlay\";\nimport { Injectable } from \"@angular/core\";\nimport { Subject } from \"rxjs\";\n\nexport class DrawerRef {\n private _isExpanded = false;\n private afterClosed$ = new Subject<any>();\n afterClosed = this.afterClosed$.asObservable();\n get isExpanded(): boolean {\n return this._isExpanded;\n }\n constructor(public overlay: OverlayRef) {}\n\n close(data?: any): void {\n this.overlay.detach();\n this.overlay.dispose();\n this.afterClosed$.next(data);\n this.afterClosed$.complete();\n }\n\n expand(): void {\n this.overlay.updateSize({ width: \"100%\" });\n this._isExpanded = true;\n }\n\n collapse(): void {\n this.overlay.updateSize({ width: \"422px\" });\n this._isExpanded = false;\n }\n}\n","/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const DRAWER_DATA_VAR = new InjectionToken<any>(\"MISDrawerDataInjectionToken\");\n","/** @format */\n\nimport { Overlay, OverlayConfig } from \"@angular/cdk/overlay\";\nimport { ComponentPortal, ComponentType } from \"@angular/cdk/portal\";\nimport { ComponentRef, Injectable, Injector } from \"@angular/core\";\nimport { take } from \"rxjs/operators\";\nimport { DrawerBodyComponent } from \"./drawer-body/drawer-body.component\";\nimport { DrawerRef } from \"./drawer-ref\";\nimport { DRAWER_DATA_VAR } from \"./drawer-constants\";\n\n@Injectable({\n providedIn: \"root\"\n})\nexport class DrawerService {\n drawerRef: DrawerRef;\n componentInstance: ComponentRef<DrawerBodyComponent>;\n\n constructor(private overlay: Overlay, private injector: Injector) {}\n\n show<T, D>(component: ComponentType<T>, data?: D, options?: { width?: string; height?: string }): DrawerRef {\n const positionStrategy = this.overlay.position().global().top(\"0px\").right(\"0px\");\n const { width = \"422px\", height = \"100%\" } = options || {};\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n width: width,\n height,\n panelClass: \"mis-drawer\",\n backdropClass: \"mis-drawer-overlay\"\n });\n const overlayRef = this.overlay.create(config);\n this.drawerRef = new DrawerRef(overlayRef);\n const injector = this.createInjector(this.drawerRef, this.injector, data);\n const portal = new ComponentPortal(DrawerBodyComponent, null);\n this.componentInstance = overlayRef.attach(portal);\n this.componentInstance.instance.bindComponent(component, injector);\n overlayRef.backdropClick().pipe(take(1)).subscribe(this.hide.bind(this));\n return this.drawerRef;\n }\n\n hide(): void {\n this.drawerRef?.close();\n }\n\n private createInjector<D>(ref: DrawerRef, inj: Injector, data?: D): Injector {\n const injectorTokens = new WeakMap();\n injectorTokens.set(DrawerRef, ref);\n injectorTokens.set(DRAWER_DATA_VAR, data);\n // return new PortalInjector(inj, injectorTokens);\n return Injector.create({\n parent: inj,\n providers: [\n { provide: DrawerRef, useValue: ref },\n { provide: DRAWER_DATA_VAR, useValue: data }\n ]\n });\n }\n}\n","import { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { DrawerService } from \"./drawer.service\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { DrawerBodyComponent } from \"./drawer-body/drawer-body.component\";\nimport { PortalModule } from \"@angular/cdk/portal\";\n\n@NgModule({\n declarations: [DrawerBodyComponent],\n imports: [CommonModule, OverlayModule, PortalModule],\n entryComponents: [DrawerBodyComponent]\n})\nexport class DrawerModule {\n static forRoot(): ModuleWithProviders<DrawerModule> {\n return {\n ngModule: DrawerModule,\n providers: [DrawerService]\n };\n }\n\n static forChild(): ModuleWithProviders<DrawerModule> {\n return {\n ngModule: DrawerModule,\n providers: [DrawerService]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {DrawerBodyComponent as ɵa} from './drawer-body/drawer-body.component';"],"names":[],"mappings":";;;;;;;;AAAA;MAkBa,mBAAmB;IAE9B,YAAoB,GAA6B;QAA7B,QAAG,GAAH,GAAG,CAA0B;KAAI;IAIrD,aAAa,CAAC,IAAS,EAAE,QAAkB;QACzC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACpC;IAEO,aAAa,CAAC,IAAS,EAAE,QAAkB;QACjD,IAAI,CAAC,YAAY,GAAG,IAAI,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;KACrE;;;YAvBF,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,8JAA2C;gBAE3C,UAAU,EAAE;oBACV,OAAO,CAAC,YAAY,EAAE;wBACpB,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,EAAE,OAAO,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC;wBACnI,UAAU,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,kBAAkB,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GAAG;KACzB;IAEO,cAAc,CAAI,GAAc,EAAE,GAAa,EAAE,IAAQ;QAC/D,MAAM,cAAc,GAAG,IAAI,OAAO,EAAE,CAAC;QACrC,cAAc,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QACnC,cAAc,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;;QAE1C,OAAO,QAAQ,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,GAAG;YACX,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE;gBACrC,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE;aAC7C;SACF,CAAC,CAAC;KACJ;;;;YA/CF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;YAVQ,OAAO;YAEmB,QAAQ;;;MCQ9B,YAAY;IACvB,OAAO,OAAO;QACZ,OAAO;YACL,QAAQ,EAAE,YAAY;YACtB,SAAS,EAAE,CAAC,aAAa,CAAC;SAC3B,CAAC;KACH;IAED,OAAO,QAAQ;QACb,OAAO;YACL,QAAQ,EAAE,YAAY;YACtB,SAAS,EAAE,CAAC,aAAa,CAAC;SAC3B,CAAC;KACH;;;YAlBF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;gBACnC,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,YAAY,CAAC;gBACpD,eAAe,EAAE,CAAC,mBAAmB,CAAC;aACvC;;;ACXD;;;;;;"}
|
|
@@ -65,7 +65,7 @@ MisInputComponent.decorators = [
|
|
|
65
65
|
{ type: Component, args: [{
|
|
66
66
|
selector: "mis-input",
|
|
67
67
|
template: "<div\n [class]=\"'input-container ' + size\"\n [ngClass]=\"{\n rounded: type === 'rounded',\n floating: type === 'floating',\n 'has-error': !inputValidity || hasError,\n 'no-hint': noHints\n }\"\n>\n <div class=\"input-wrapper\">\n <ng-content select=\"[mis-input-icon]\"></ng-content>\n <div class=\"mis-input\">\n <ng-content select=\"input\"></ng-content>\n <span class=\"mis-placeholder\">{{ placeholder }}</span>\n </div>\n <ng-content select=\"[mis-input-act]\"></ng-content>\n </div>\n <ng-content select=\"[mis-input-hint]\"></ng-content>\n <ng-content select=\"[mis-input-error]\"></ng-content>\n</div>\n",
|
|
68
|
-
styles: [".input-container{position:relative;padding-bottom:24px}.input-container .input-wrapper{box-sizing:border-box;display:flex;align-items:center;flex-direction:row;flex-wrap:nowrap;transition:all 60ms ease-in;background-color:#fff;padding:3px 16px}.input-container .input-wrapper>:not(:last-child){margin-right:16px}.input-container .input-wrapper .mis-input{flex:1 1 auto;z-index:0;position:relative;display:flex;align-items:center}.input-container .input-wrapper input{flex:1 1 auto;border:none;outline:none;height:100%;padding:0;font-family:Lato;font-style:normal;font-weight:400;font-size:16px;height:24px;color:#181f33;background-color:transparent;width:100%;vertical-align:middle}.input-container .input-wrapper input::-moz-placeholder{-moz-transition:all .1s ease-in;transition:all .1s ease-in;opacity:0;transform-origin:left center;color:transparent}.input-container .input-wrapper input:-ms-input-placeholder{-ms-transition:all .1s ease-in;transition:all .1s ease-in;opacity:0;transform-origin:left center;color:transparent}.input-container .input-wrapper input::placeholder{transition:all .1s ease-in;opacity:0;transform-origin:left center;color:transparent}.input-container .input-wrapper .mis-placeholder{position:absolute;font-family:Lato;font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#6a737d;z-index:-1;transition:all .15s ease-in}.input-container .input-wrapper:focus-within{background-color:#f5f5f5}.input-container .input-wrapper:focus-within{border:1px solid #0937b2}.input-container .input-wrapper [mis-input-act],.input-container .input-wrapper [mis-input-icon]{width:18px;height:18px;color:#6a737d;font-size:24px;line-height:18px}.input-container .input-wrapper [mis-input-act]{cursor:pointer}.input-container.no-hint{padding-bottom:0}.input-container.rounded.sm input{padding:3px 16px}.input-container.rounded.md input{padding:9px 16px}.input-container.rounded.lg input{padding:15px 16px}.input-container.rounded .input-wrapper{border-radius:4px;border:1px solid #e0e0e0;padding:0}.input-container.rounded .input-wrapper input:not(:disabled):focus,.input-container.rounded .input-wrapper input:not(:disabled):hover{background-color:#f5f5f5}.input-container.rounded .input-wrapper:focus-within{border:1px solid #0937b2}.input-container.rounded .input-wrapper input:not(:-moz-placeholder-shown)+.mis-placeholder{color:transparent!important}.input-container.rounded .input-wrapper input:not(:-ms-input-placeholder)+.mis-placeholder{color:transparent!important}.input-container.rounded .input-wrapper input:not(:placeholder-shown)+.mis-placeholder{color:transparent!important}.input-container.rounded .input-wrapper .mis-placeholder{transition-duration:50ms}.input-container.rounded.has-error .input-wrapper{border:1px solid #b00020!important}.input-container.floating .input-wrapper{padding-top:24px;padding-bottom:7px;border-bottom:1px solid #e0e0e0}.input-container.floating .input-wrapper input:focus+.mis-placeholder{color:#0937b2!important}.input-container.floating .input-wrapper input:not(:-moz-placeholder-shown)+.mis-placeholder{transform:translateY(calc(-100% + 6px))!important;font-size:12px!important;letter-spacing:.2px!important}.input-container.floating .input-wrapper input:not(:-ms-input-placeholder)+.mis-placeholder{transform:translateY(calc(-100% + 6px))!important;font-size:12px!important;letter-spacing:.2px!important}.input-container.floating .input-wrapper input:focus+.mis-placeholder,.input-container.floating .input-wrapper input:not(:placeholder-shown)+.mis-placeholder{transform:translateY(calc(-100% + 6px))!important;font-size:12px!important;letter-spacing:.2px!important}.input-container.floating .input-wrapper:focus-within{border:none;border-bottom:1px solid #0937b2}.input-container.floating .input-wrapper:focus-within input::-moz-placeholder{color:#6a737d;opacity:1;font-size:16px}.input-container.floating .input-wrapper:focus-within input:-ms-input-placeholder{color:#6a737d;opacity:1;font-size:16px}.input-container.floating .input-wrapper:focus-within input::placeholder{color:#6a737d;opacity:1;font-size:16px}.input-container.floating.has-error .input-wrapper{border-bottom:1px solid #b00020!important}.input-container.floating.has-error .input-wrapper .mis-placeholder{color:#b00020!important}.input-container [mis-input-error],.input-container [mis-input-hint]{position:absolute;left:0;right:0;bottom:0;line-height:24px;height:24px;font-size:12px;color:#6a737d;letter-spacing:.2px}.input-container [mis-input-error]{color:#b00020}"]
|
|
68
|
+
styles: [".input-container{position:relative;padding-bottom:24px}.input-container .input-wrapper{box-sizing:border-box;display:flex;align-items:center;flex-direction:row;flex-wrap:nowrap;transition:all 60ms ease-in;background-color:#fff;padding:3px 16px}.input-container .input-wrapper>:not(:last-child){margin-right:16px}.input-container .input-wrapper .mis-input{flex:1 1 auto;z-index:0;position:relative;display:flex;align-items:center}.input-container .input-wrapper input{flex:1 1 auto;border:none;outline:none;height:100%;padding:0;font-family:Lato;font-style:normal;font-weight:400;font-size:16px;height:24px;color:#181f33;background-color:transparent;width:100%;vertical-align:middle}.input-container .input-wrapper input::-moz-placeholder{-moz-transition:all .1s ease-in;transition:all .1s ease-in;opacity:0;transform-origin:left center;color:transparent}.input-container .input-wrapper input:-ms-input-placeholder{-ms-transition:all .1s ease-in;transition:all .1s ease-in;opacity:0;transform-origin:left center;color:transparent}.input-container .input-wrapper input::placeholder{transition:all .1s ease-in;opacity:0;transform-origin:left center;color:transparent}.input-container .input-wrapper .mis-placeholder{position:absolute;font-family:Lato;font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#6a737d;z-index:-1;transition:all .15s ease-in}.input-container .input-wrapper:focus-within{background-color:#f5f5f5}.input-container .input-wrapper:focus-within{border:1px solid #0937b2}.input-container .input-wrapper [mis-input-act],.input-container .input-wrapper [mis-input-icon]{width:18px;height:18px;color:#6a737d;font-size:24px;line-height:18px}.input-container .input-wrapper [mis-input-act]{cursor:pointer}.input-container.no-hint{padding-bottom:0}.input-container.rounded{box-sizing:initial}.input-container.rounded.sm input{padding:3px 16px}.input-container.rounded.md input{padding:9px 16px}.input-container.rounded.lg input{padding:15px 16px}.input-container.rounded .input-wrapper{border-radius:4px;border:1px solid #e0e0e0;padding:0}.input-container.rounded .input-wrapper input:not(:disabled):focus,.input-container.rounded .input-wrapper input:not(:disabled):hover{background-color:#f5f5f5}.input-container.rounded .input-wrapper:focus-within{border:1px solid #0937b2}.input-container.rounded .input-wrapper input:not(:-moz-placeholder-shown)+.mis-placeholder{color:transparent!important}.input-container.rounded .input-wrapper input:not(:-ms-input-placeholder)+.mis-placeholder{color:transparent!important}.input-container.rounded .input-wrapper input:not(:placeholder-shown)+.mis-placeholder{color:transparent!important}.input-container.rounded .input-wrapper .mis-placeholder{transition-duration:50ms}.input-container.rounded.has-error .input-wrapper{border:1px solid #b00020!important}.input-container.floating .input-wrapper{padding-top:24px;padding-bottom:7px;border-bottom:1px solid #e0e0e0}.input-container.floating .input-wrapper input:focus+.mis-placeholder{color:#0937b2!important}.input-container.floating .input-wrapper input:not(:-moz-placeholder-shown)+.mis-placeholder{transform:translateY(calc(-100% + 6px))!important;font-size:12px!important;letter-spacing:.2px!important}.input-container.floating .input-wrapper input:not(:-ms-input-placeholder)+.mis-placeholder{transform:translateY(calc(-100% + 6px))!important;font-size:12px!important;letter-spacing:.2px!important}.input-container.floating .input-wrapper input:focus+.mis-placeholder,.input-container.floating .input-wrapper input:not(:placeholder-shown)+.mis-placeholder{transform:translateY(calc(-100% + 6px))!important;font-size:12px!important;letter-spacing:.2px!important}.input-container.floating .input-wrapper:focus-within{border:none;border-bottom:1px solid #0937b2}.input-container.floating .input-wrapper:focus-within input::-moz-placeholder{color:#6a737d;opacity:1;font-size:16px}.input-container.floating .input-wrapper:focus-within input:-ms-input-placeholder{color:#6a737d;opacity:1;font-size:16px}.input-container.floating .input-wrapper:focus-within input::placeholder{color:#6a737d;opacity:1;font-size:16px}.input-container.floating.has-error .input-wrapper{border-bottom:1px solid #b00020!important}.input-container.floating.has-error .input-wrapper .mis-placeholder{color:#b00020!important}.input-container [mis-input-error],.input-container [mis-input-hint]{position:absolute;left:0;right:0;bottom:0;line-height:24px;height:24px;font-size:12px;color:#6a737d;letter-spacing:.2px}.input-container [mis-input-error]{color:#b00020}"]
|
|
69
69
|
},] }
|
|
70
70
|
];
|
|
71
71
|
MisInputComponent.ctorParameters = () => [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OverlayConfig, Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
2
|
-
import { ComponentPortal,
|
|
3
|
-
import { InjectionToken, Component, ViewChild, ViewContainerRef, ɵɵdefineInjectable, ɵɵinject, INJECTOR, Injectable,
|
|
2
|
+
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
3
|
+
import { InjectionToken, Component, ViewChild, ViewContainerRef, Injector, ɵɵdefineInjectable, ɵɵinject, INJECTOR, Injectable, NgModule } from '@angular/core';
|
|
4
4
|
import { Subject } from 'rxjs';
|
|
5
5
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
@@ -85,7 +85,14 @@ class ModalService {
|
|
|
85
85
|
const injectorTokens = new WeakMap();
|
|
86
86
|
injectorTokens.set(ModalRef, ref);
|
|
87
87
|
injectorTokens.set(MODAL_DATA_VAR, data);
|
|
88
|
-
return new PortalInjector(inj, injectorTokens);
|
|
88
|
+
// return new PortalInjector(inj, injectorTokens);
|
|
89
|
+
return Injector.create({
|
|
90
|
+
parent: inj,
|
|
91
|
+
providers: [
|
|
92
|
+
{ provide: ModalRef, useValue: ref },
|
|
93
|
+
{ provide: MODAL_DATA_VAR, useValue: data }
|
|
94
|
+
]
|
|
95
|
+
});
|
|
89
96
|
}
|
|
90
97
|
calculatePosition(options) {
|
|
91
98
|
const position = this.overlay.position().global().centerHorizontally().centerVertically();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-modal.js","sources":["../../../projects/mis-components/modal/modal-constants.ts","../../../projects/mis-components/modal/modal-ref.ts","../../../projects/mis-components/modal/module-wrapper/module-wrapper.component.ts","../../../projects/mis-components/modal/modal.service.ts","../../../projects/mis-components/modal/modal.module.ts","../../../projects/mis-components/modal/mis-crystal-design-system-modal.ts"],"sourcesContent":["/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const MODAL_DATA_VAR = new InjectionToken<any>(\"MISModalDataInjectionToken\");\n","/** @format */\n\nimport { OverlayRef } from \"@angular/cdk/overlay\";\nimport { Injectable } from \"@angular/core\";\nimport { Subject } from \"rxjs\";\n\nexport class ModalRef {\n private afterClosed$ = new Subject<unknown>();\n afterClosed = this.afterClosed$.asObservable();\n\n constructor(public overlay: OverlayRef) {}\n\n close(data?: unknown): void {\n this.overlay.detach();\n this.overlay.dispose();\n this.afterClosed$.next(data);\n this.afterClosed$.complete();\n }\n}\n","import { trigger, transition, style, animate } from \"@angular/animations\";\nimport { ComponentPortal
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-modal.js","sources":["../../../projects/mis-components/modal/modal-constants.ts","../../../projects/mis-components/modal/modal-ref.ts","../../../projects/mis-components/modal/module-wrapper/module-wrapper.component.ts","../../../projects/mis-components/modal/modal.service.ts","../../../projects/mis-components/modal/modal.module.ts","../../../projects/mis-components/modal/mis-crystal-design-system-modal.ts"],"sourcesContent":["/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const MODAL_DATA_VAR = new InjectionToken<any>(\"MISModalDataInjectionToken\");\n","/** @format */\n\nimport { OverlayRef } from \"@angular/cdk/overlay\";\nimport { Injectable } from \"@angular/core\";\nimport { Subject } from \"rxjs\";\n\nexport class ModalRef {\n private afterClosed$ = new Subject<unknown>();\n afterClosed = this.afterClosed$.asObservable();\n\n constructor(public overlay: OverlayRef) {}\n\n close(data?: unknown): void {\n this.overlay.detach();\n this.overlay.dispose();\n this.afterClosed$.next(data);\n this.afterClosed$.complete();\n }\n}\n","import { trigger, transition, style, animate } from \"@angular/animations\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { Component, Injector, ViewChild, ViewContainerRef } from \"@angular/core\";\n\n@Component({\n selector: \"mis-module-wrapper\",\n templateUrl: \"./module-wrapper.component.html\",\n styleUrls: [\"./module-wrapper.component.scss\"],\n animations: [\n trigger(\"slideInOut\", [\n transition(\":enter\", [\n style({ transform: \"translateY(-30%)\", opacity: 0 }),\n animate(\"200ms ease-out\", style({ transform: \"translatey(0%)\", opacity: 1 }))\n ]),\n transition(\":leave\", [animate(\"200ms ease-out\", style({ transform: \"translatey(-30%)\", opacity: 0 }))])\n ])\n ]\n})\nexport class ModuleWrapperComponent {\n modalPortal: ComponentPortal<any>;\n constructor() {}\n\n @ViewChild(\"place\", { static: false, read: ViewContainerRef }) place: ViewContainerRef;\n\n bindComponent(type: any, injector: Injector) {\n this.initComponent(type, injector);\n }\n\n private initComponent(type: any, injector: Injector) {\n this.modalPortal = new ComponentPortal(type, this.place, injector);\n }\n}\n","import { ComponentType, Overlay, OverlayConfig } from \"@angular/cdk/overlay\";\nimport { ComponentPortal, PortalInjector } from \"@angular/cdk/portal\";\nimport { ComponentRef, Injectable, Injector } from \"@angular/core\";\nimport { MODAL_DATA_VAR } from \"./modal-constants\";\nimport { ModalRef } from \"./modal-ref\";\nimport { ModuleWrapperComponent } from \"./module-wrapper/module-wrapper.component\";\n\ninterface IModalOptions {\n width?: string;\n height?: string;\n top?: string;\n right?: string;\n bottom?: string;\n left?: string;\n closeOnBackdropClick?: boolean;\n}\n@Injectable({\n providedIn: \"root\"\n})\nexport class ModalService {\n private componentInstance: ComponentRef<ModuleWrapperComponent>;\n\n constructor(private overlay: Overlay, private injector: Injector) {}\n\n show<T, D>(component: ComponentType<T>, data?: D, options?: IModalOptions): ModalRef {\n const positionStrategy = this.calculatePosition(options);\n const { width, height } = options || {};\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n width: width,\n height,\n panelClass: \"mis-modal\",\n backdropClass: \"mis-modal-overlay\"\n });\n const overlayRef = this.overlay.create(config);\n const modalRef = new ModalRef(overlayRef);\n const injector = this.createInjector(modalRef, this.injector, data);\n const portal = new ComponentPortal(ModuleWrapperComponent, null);\n this.componentInstance = overlayRef.attach(portal);\n if (options?.closeOnBackdropClick) {\n overlayRef.backdropClick().subscribe(() => modalRef.close());\n }\n this.componentInstance.instance.bindComponent(component, injector);\n return modalRef;\n }\n private createInjector<D>(ref: ModalRef, inj: Injector, data?: D): Injector {\n const injectorTokens = new WeakMap();\n injectorTokens.set(ModalRef, ref);\n injectorTokens.set(MODAL_DATA_VAR, data);\n // return new PortalInjector(inj, injectorTokens);\n return Injector.create({\n parent: inj,\n providers: [\n { provide: ModalRef, useValue: ref },\n { provide: MODAL_DATA_VAR, useValue: data }\n ]\n });\n }\n\n private calculatePosition(options: IModalOptions) {\n const position = this.overlay.position().global().centerHorizontally().centerVertically();\n if (options && screen.width > 600) {\n if (options.top) {\n position.top(options.top);\n }\n if (options.left) {\n position.left(options.left);\n }\n if (options.right) {\n position.right(options.right);\n }\n if (options.bottom) {\n position.bottom(options.bottom);\n }\n }\n return position;\n }\n}\n","import { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { PortalModule } from \"@angular/cdk/portal\";\nimport { ModuleWrapperComponent } from \"./module-wrapper/module-wrapper.component\";\nimport { ModalService } from \"./modal.service\";\n\n@NgModule({\n declarations: [ModuleWrapperComponent],\n imports: [CommonModule, OverlayModule, PortalModule],\n entryComponents: [ModuleWrapperComponent]\n})\nexport class ModalModule {\n static forRoot(): ModuleWithProviders<ModalModule> {\n return {\n ngModule: ModalModule,\n providers: [ModalService]\n };\n }\n\n static forChild(): ModuleWithProviders<ModalModule> {\n return {\n ngModule: ModalModule,\n providers: [ModalService]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {ModuleWrapperComponent as ɵa} from './module-wrapper/module-wrapper.component';"],"names":[],"mappings":";;;;;;;AAAA;MAIa,cAAc,GAAG,IAAI,cAAc,CAAM,4BAA4B;;ACJlF;MAMa,QAAQ;IAInB,YAAmB,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;QAH9B,iBAAY,GAAG,IAAI,OAAO,EAAW,CAAC;QAC9C,gBAAW,G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