mis-crystal-design-system 4.0.49 → 4.0.51

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.
Files changed (48) hide show
  1. package/async-search-dropdown/mis-crystal-design-system-async-search-dropdown.metadata.json +1 -1
  2. package/bundles/mis-crystal-design-system-action-list.umd.js +4 -3
  3. package/bundles/mis-crystal-design-system-action-list.umd.js.map +1 -1
  4. package/bundles/mis-crystal-design-system-action-list.umd.min.js +1 -1
  5. package/bundles/mis-crystal-design-system-action-list.umd.min.js.map +1 -1
  6. package/bundles/mis-crystal-design-system-async-search-dropdown.umd.js +1 -1
  7. package/bundles/mis-crystal-design-system-async-search-dropdown.umd.min.js +1 -1
  8. package/bundles/mis-crystal-design-system-async-search-dropdown.umd.min.js.map +1 -1
  9. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js +2 -3
  10. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js.map +1 -1
  11. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.min.js +1 -1
  12. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.min.js.map +1 -1
  13. package/bundles/mis-crystal-design-system-input-stepper.umd.js +2 -0
  14. package/bundles/mis-crystal-design-system-input-stepper.umd.js.map +1 -1
  15. package/bundles/mis-crystal-design-system-input-stepper.umd.min.js +1 -1
  16. package/bundles/mis-crystal-design-system-input-stepper.umd.min.js.map +1 -1
  17. package/bundles/mis-crystal-design-system-snackbar.umd.js +19 -11
  18. package/bundles/mis-crystal-design-system-snackbar.umd.js.map +1 -1
  19. package/bundles/mis-crystal-design-system-snackbar.umd.min.js +1 -1
  20. package/bundles/mis-crystal-design-system-snackbar.umd.min.js.map +1 -1
  21. package/bundles/mis-crystal-design-system-star-rating.umd.js +2 -2
  22. package/bundles/mis-crystal-design-system-star-rating.umd.js.map +1 -1
  23. package/bundles/mis-crystal-design-system-star-rating.umd.min.js +1 -1
  24. package/bundles/mis-crystal-design-system-star-rating.umd.min.js.map +1 -1
  25. package/daterangepicker_v2/mis-crystal-design-system-daterangepicker_v2.metadata.json +1 -1
  26. package/daterangepicker_v2/tz-drp-container/tz-drp-container.component.d.ts +0 -1
  27. package/esm2015/action-list/action-list.component.js +5 -4
  28. package/esm2015/async-search-dropdown/async-dropdown.component.js +1 -1
  29. package/esm2015/daterangepicker_v2/tz-drp-container/tz-drp-container.component.js +3 -4
  30. package/esm2015/input-stepper/input-stepper/input-stepper.component.js +3 -1
  31. package/esm2015/snackbar/snackbar/snackbar.component.js +9 -13
  32. package/esm2015/snackbar/snackbar.module.js +13 -2
  33. package/esm2015/star-rating/star-rating.component.js +3 -3
  34. package/fesm2015/mis-crystal-design-system-action-list.js +4 -3
  35. package/fesm2015/mis-crystal-design-system-action-list.js.map +1 -1
  36. package/fesm2015/mis-crystal-design-system-async-search-dropdown.js +1 -1
  37. package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js +2 -3
  38. package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js.map +1 -1
  39. package/fesm2015/mis-crystal-design-system-input-stepper.js +2 -0
  40. package/fesm2015/mis-crystal-design-system-input-stepper.js.map +1 -1
  41. package/fesm2015/mis-crystal-design-system-snackbar.js +20 -12
  42. package/fesm2015/mis-crystal-design-system-snackbar.js.map +1 -1
  43. package/fesm2015/mis-crystal-design-system-star-rating.js +2 -2
  44. package/fesm2015/mis-crystal-design-system-star-rating.js.map +1 -1
  45. package/package.json +1 -1
  46. package/snackbar/mis-crystal-design-system-snackbar.metadata.json +1 -1
  47. package/snackbar/snackbar/snackbar.component.d.ts +5 -5
  48. package/snackbar/snackbar.module.d.ts +3 -0
@@ -1 +1 @@
1
- {"version":3,"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"],"names":["CONTAINER_DATA","InjectionToken","DATE_FORMAT","getMonth","index","month","TzDrpContainerComponent","data","toast","_this","this","parseZoneInstance","args","_i","arguments","length","tz","dpConfig","timezone","rawWeekDays","weekDays","currentMonthDates","nextMonthDates","isPreviousMonthDisabled","isNextMonthDisabled","selectionStarted","isDatesValid","localSelectedDates","dates","startDate","endDate","_b","_a","currentMonthNumber","nextMonthNumber","add","currentMonth","nextMonth","currentYearNumber","year","nextYearNumber","map","day","label","slice","toLowerCase","isCurrentDay","_d","_c","format","Object","assign","arrowUrl","prototype","ngOnInit","currentDateInstance","calculateMinMaxDays","generateDates","selectedStartDate","isValid","get","currentInstance","minDate","isSameOrAfter","maxDate","isSameOrBefore","navigateMonth","direction","thisMonth","parseZone","subtract","clone","daysInMonth","currentDate","date","moment","dateString","this_1","isDisabledDay","datesDisabled","some","d","Date","isAfter","isBefore","isSelectedStartDay","isAfterSelectedStartDate","_e","startOf","_g","_f","isBeforeSelectedEndDate","_j","_h","_l","_k","inRangeDay","_m","_o","isSelectedEndDay","_p","_q","_r","_s","push","weekDay","toastMessage","_t","messages","find","q","message","i","unshift","selectDay","from","momentDay","displayMsg","applyDates","dateChange","cancelDatePicker","close","Component","selector","template","Inject","ToastService","TzDaterangepickerDirective","control","element","overlay","viewContainerRef","dateMessages","positionX","positionY","offsetX","offsetY","EventEmitter","isOpen","dpDisabledDates","defineProperty","toggleDatePicker","open","positionStrategy","position","flexibleConnectedTo","withPositions","genPositionPairs","withPush","config","OverlayConfig","hasBackdrop","scrollStrategy","scrollStrategies","reposition","backdropClass","overlayRef","create","tempRef","ComponentPortal","Injector","providers","provide","useValue","value","applyDate","bind","attach","backdropClick","pipe","take","subscribe","emit","patchValue","detach","dispose","Directive","NgControl","decorators","type","Self","Optional","ElementRef","Overlay","ViewContainerRef","Input","Output","HostListener","NgModule","declarations","imports","CommonModule","OverlayModule","ToastModule","forRoot","ButtonModule","exports","entryComponents"],"mappings":"g/CAI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A,CAAC,kBC/BhB,iCANCgL,EAAAA,SAAQhL,KAAA,CAAC,CACRiL,aAAc,CAACvL,EAAyByH,GACxC+D,QAAS,CAACC,EAAAA,aAAcC,EAAAA,cAAeC,EAAAA,YAAYC,UAAWC,EAAAA,aAAaD,WAC3EE,QAAS,CAAC9L,EAAyByH,GACnCsE,gBAAiB,CAAC/L","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, tz } from \"moment-timezone\";\nimport { getMonth } from \"../utils\";\nimport { ToastService } from \"mis-crystal-design-system/toast\";\nimport * as moment from \"moment\";\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 tz(args[0], args[1], this.data.dpConfig.timezone);\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 arrowUrl: string;\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 tz(args[0], args[1], 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 this.arrowUrl = 'assets/arrow__icon.svg';\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 if(this.currentMonthNumber === -1){\n this.currentMonthNumber = 11\n }\n if(this.nextMonthNumber === -1){\n this.nextMonthNumber = 11\n }\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.clone().add(1, \"month\").month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.nextMonth = getMonth(this.nextMonthNumber);\n if (this.nextMonthNumber === 0 && direction === \"PREVIOUS\") {\n this.currentYearNumber--;\n } else if (this.currentMonthNumber === 11 && direction === \"NEXT\") {\n this.nextYearNumber++;\n }else if (this.currentMonthNumber === 0 && direction === \"NEXT\") {\n this.currentYearNumber++;\n } else if (this.nextMonthNumber === 11 && direction === \"PREVIOUS\") {\n this.nextYearNumber--;\n }else{\n this.nextYearNumber = this.currentYearNumber;\n }\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 = moment().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 let Date = this.parseZoneInstance().year(currentYearNumber).month(month).date(currentDate);\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 = moment(date,this.data?.dpConfig?.format).startOf('day').isAfter(moment(this.localSelectedDates.startDate,this.data?.dpConfig?.format).startOf('day'), 'day');\n\n const isBeforeSelectedEndDate = moment(date,this.data?.dpConfig?.format).startOf('day').isBefore(moment(this.localSelectedDates.endDate,this.data?.dpConfig?.format).startOf('day'), 'day');\n const inRangeDay =\n (this.localSelectedDates.startDate ?? false) &&\n (this.localSelectedDates.endDate ?? false) &&\n isAfterSelectedStartDate &&\n isBeforeSelectedEndDate;\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 \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\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"]}
1
+ {"version":3,"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"],"names":["CONTAINER_DATA","InjectionToken","DATE_FORMAT","getMonth","index","month","TzDrpContainerComponent","data","toast","_this","this","parseZoneInstance","args","_i","arguments","length","tz","dpConfig","timezone","rawWeekDays","weekDays","currentMonthDates","nextMonthDates","isPreviousMonthDisabled","isNextMonthDisabled","selectionStarted","isDatesValid","localSelectedDates","dates","startDate","endDate","_b","_a","currentMonthNumber","nextMonthNumber","add","currentMonth","nextMonth","currentYearNumber","year","nextYearNumber","map","day","label","slice","toLowerCase","isCurrentDay","_d","_c","format","Object","assign","prototype","ngOnInit","currentDateInstance","calculateMinMaxDays","generateDates","selectedStartDate","isValid","get","currentInstance","minDate","isSameOrAfter","maxDate","isSameOrBefore","navigateMonth","direction","thisMonth","parseZone","subtract","clone","daysInMonth","currentDate","date","moment","dateString","this_1","isDisabledDay","datesDisabled","some","d","Date","isAfter","isBefore","isSelectedStartDay","isAfterSelectedStartDate","_e","startOf","_g","_f","isBeforeSelectedEndDate","_j","_h","_l","_k","inRangeDay","_m","_o","isSelectedEndDay","_p","_q","_r","_s","push","weekDay","toastMessage","_t","messages","find","q","message","i","unshift","selectDay","from","momentDay","displayMsg","applyDates","dateChange","cancelDatePicker","close","Component","selector","template","Inject","ToastService","TzDaterangepickerDirective","control","element","overlay","viewContainerRef","dateMessages","positionX","positionY","offsetX","offsetY","EventEmitter","isOpen","dpDisabledDates","defineProperty","toggleDatePicker","open","positionStrategy","position","flexibleConnectedTo","withPositions","genPositionPairs","withPush","config","OverlayConfig","hasBackdrop","scrollStrategy","scrollStrategies","reposition","backdropClass","overlayRef","create","tempRef","ComponentPortal","Injector","providers","provide","useValue","value","applyDate","bind","attach","backdropClick","pipe","take","subscribe","emit","patchValue","detach","dispose","Directive","NgControl","decorators","type","Self","Optional","ElementRef","Overlay","ViewContainerRef","Input","Output","HostListener","NgModule","declarations","imports","CommonModule","OverlayModule","ToastModule","forRoot","ButtonModule","exports","entryComponents"],"mappings":"g/CAIaA,EAAiB,IAAIC,EAAAA,eAAmB,kBACxCC,EAAc,aCHdC,EAAW,SAACC,GACvB,IAAIC,EACJ,OAAQD,GACN,KAAK,EACHC,EAAQ,UACR,MACF,KAAK,EACHA,EAAQ,WACR,MACF,KAAK,EACHA,EAAQ,QACR,MACF,KAAK,EACHA,EAAQ,QACR,MACF,KAAK,EACHA,EAAQ,MACR,MACF,KAAK,EACHA,EAAQ,OACR,MACF,KAAK,EACHA,EAAQ,OACR,MACF,KAAK,EACHA,EAAQ,SACR,MACF,KAAK,EACHA,EAAQ,YACR,MACF,KAAK,EACHA,EAAQ,UACR,MACF,KAAK,GACHA,EAAQ,WACR,MACF,KAAK,GACHA,EAAQ,WAKZ,OAAOA,gBCXP,SAAAC,EAAoCC,EAA+BC,GAAnE,YAAAC,EAAAC,KAAmEA,KAAAF,MAAAA,EAlB3DE,KAAAC,kBAAoB,eAAC,IAAAC,EAAA,GAAAC,EAAA,EAAAA,EAAAC,UAAAC,OAAAF,IAAAD,EAAAC,GAAAC,UAAAD,GAC3B,OAAOG,EAAAA,GAAGJ,EAAK,GAAIA,EAAK,GAAIH,EAAKF,KAAKU,SAASC,WAEzCR,KAAAS,YAAwB,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAC3ET,KAAAU,SAAuB,GAIvBV,KAAAW,kBAA0C,GAI1CX,KAAAY,eAAuC,GACvCZ,KAAAa,yBAAmC,EACnCb,KAAAc,qBAA+B,EAC/Bd,KAAAe,kB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AA,UAASC,WAAA,CAAA,CAAAC,KAoCbC,EAAAA,MAAI,CAAAD,KAAIE,EAAAA,kBArCOC,EAAAA,kBAFXC,EAAAA,eAE4FC,EAAAA,sDAYlGC,EAAAA,6BAMAA,EAAAA,6BAGAA,EAAAA,4BAGAA,EAAAA,yBACAA,EAAAA,yBACAA,EAAAA,uBACAA,EAAAA,uBACAA,EAAAA,0BAEAC,EAAAA,iCAaAC,EAAAA,aAAY9K,KAAA,CAAC,kBC/BhB,iCANC+K,EAAAA,SAAQ/K,KAAA,CAAC,CACRgL,aAAc,CAACtL,EAAyBwH,GACxC+D,QAAS,CAACC,EAAAA,aAAcC,EAAAA,cAAeC,EAAAA,YAAYC,UAAWC,EAAAA,aAAaD,WAC3EE,QAAS,CAAC7L,EAAyBwH,GACnCsE,gBAAiB,CAAC9L","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, tz } from \"moment-timezone\";\nimport { getMonth } from \"../utils\";\nimport { ToastService } from \"mis-crystal-design-system/toast\";\nimport * as moment from \"moment\";\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 tz(args[0], args[1], this.data.dpConfig.timezone);\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 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 tz(args[0], args[1], 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 if(this.currentMonthNumber === -1){\n this.currentMonthNumber = 11\n }\n if(this.nextMonthNumber === -1){\n this.nextMonthNumber = 11\n }\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.clone().add(1, \"month\").month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.nextMonth = getMonth(this.nextMonthNumber);\n if (this.nextMonthNumber === 0 && direction === \"PREVIOUS\") {\n this.currentYearNumber--;\n } else if (this.currentMonthNumber === 11 && direction === \"NEXT\") {\n this.nextYearNumber++;\n }else if (this.currentMonthNumber === 0 && direction === \"NEXT\") {\n this.currentYearNumber++;\n } else if (this.nextMonthNumber === 11 && direction === \"PREVIOUS\") {\n this.nextYearNumber--;\n }else{\n this.nextYearNumber = this.currentYearNumber;\n }\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 = moment().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 let Date = this.parseZoneInstance().year(currentYearNumber).month(month).date(currentDate);\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 = moment(date,this.data?.dpConfig?.format).startOf('day').isAfter(moment(this.localSelectedDates.startDate,this.data?.dpConfig?.format).startOf('day'), 'day');\n\n const isBeforeSelectedEndDate = moment(date,this.data?.dpConfig?.format).startOf('day').isBefore(moment(this.localSelectedDates.endDate,this.data?.dpConfig?.format).startOf('day'), 'day');\n const inRangeDay =\n (this.localSelectedDates.startDate ?? false) &&\n (this.localSelectedDates.endDate ?? false) &&\n isAfterSelectedStartDate &&\n isBeforeSelectedEndDate;\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 \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\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"]}
@@ -13,6 +13,8 @@
13
13
  this.valueChange = new core.EventEmitter();
14
14
  }
15
15
  InputStepperComponent.prototype.increment = function () {
16
+ if (this.value === this.maxLimit)
17
+ return;
16
18
  this.value++;
17
19
  this.emitValueChange();
18
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mis-crystal-design-system-input-stepper.umd.js","sources":["../../../projects/mis-components/input-stepper/input-stepper/input-stepper.component.ts","../../../projects/mis-components/input-stepper/input-stepper.module.ts","../../../projects/mis-components/input-stepper/mis-crystal-design-system-input-stepper.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\n\n@Component({\n selector: 'mis-input-stepper',\n templateUrl: './input-stepper.component.html',\n styleUrls: ['./input-stepper.component.css']\n})\nexport class InputStepperComponent {\n @Input() value: number = 1;\n @Input() width?: string = '200px';\n @Input() minLimit : number = 0;\n @Input() maxLimit: number = 2;\n @Output() valueChange: EventEmitter<number> = new EventEmitter<number>();\n\n constructor() { }\n\n increment() {\n this.value++;\n this.emitValueChange();\n }\n\n decrement() {\n if (this.value > 0) {\n this.value--;\n this.emitValueChange();\n }\n }\n\n onInputChange(newValue: string) {\n const parsedValue = parseInt(newValue, 10);\n if (!isNaN(parsedValue)) {\n this.value = parsedValue;\n this.emitValueChange();\n }\n }\n\n private emitValueChange() {\n console.log(\"value change\", this.value);\n this.valueChange.emit(this.value);\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { InputStepperComponent } from './input-stepper/input-stepper.component';\n\n\n\n@NgModule({\n declarations: [\n InputStepperComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [\n InputStepperComponent\n ]\n})\nexport class InputStepperModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["EventEmitter","Component","Input","Output","NgModule","CommonModule"],"mappings":";;;;;;;QAcE;YANS,UAAK,GAAW,CAAC,CAAC;YAClB,UAAK,GAAY,OAAO,CAAC;YACzB,aAAQ,GAAY,CAAC,CAAC;YACtB,aAAQ,GAAW,CAAC,CAAC;YACpB,gBAAW,GAAyB,IAAIA,iBAAY,EAAU,CAAC;SAExD;QAEjB,yCAAS,GAAT;YACE,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,eAAe,EAAE,CAAC;SACxB;QAED,yCAAS,GAAT;YACE,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE;gBAClB,IAAI,CAAC,KAAK,EAAE,CAAC;gBACb,IAAI,CAAC,eAAe,EAAE,CAAC;aACxB;SACF;QAED,6CAAa,GAAb,UAAc,QAAgB;YAC5B,IAAM,WAAW,GAAG,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAC3C,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;gBACvB,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;gBACzB,IAAI,CAAC,eAAe,EAAE,CAAC;aACxB;SACF;QAEO,+CAAe,GAAf;YACN,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YACxC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnC;;;;gBArCFC,cAAS,SAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,4WAA6C;;iBAE9C;;;;wBAEEC,UAAK;wBACLA,UAAK;2BACLA,UAAK;2BACLA,UAAK;8BACLC,WAAM;;;;QCKT;;;;;gBAXCC,aAAQ,SAAC;oBACR,YAAY,EAAE;wBACZ,qBAAqB;qBACtB;oBACD,OAAO,EAAE;wBACPC,mBAAY;qBACb;oBACD,OAAO,EAAE;wBACP,qBAAqB;qBACtB;iBACF;;;IChBD;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"mis-crystal-design-system-input-stepper.umd.js","sources":["../../../projects/mis-components/input-stepper/input-stepper/input-stepper.component.ts","../../../projects/mis-components/input-stepper/input-stepper.module.ts","../../../projects/mis-components/input-stepper/mis-crystal-design-system-input-stepper.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\n\n@Component({\n selector: 'mis-input-stepper',\n templateUrl: './input-stepper.component.html',\n styleUrls: ['./input-stepper.component.css']\n})\nexport class InputStepperComponent {\n @Input() value: number = 1;\n @Input() width?: string = '200px';\n @Input() minLimit : number = 0;\n @Input() maxLimit: number = 2;\n @Output() valueChange: EventEmitter<number> = new EventEmitter<number>();\n\n constructor() { }\n\n increment() {\n if(this.value === this.maxLimit) return;\n this.value++;\n this.emitValueChange();\n }\n\n decrement() {\n if (this.value > 0) {\n this.value--;\n this.emitValueChange();\n }\n }\n\n onInputChange(newValue: string) {\n const parsedValue = parseInt(newValue, 10);\n if (!isNaN(parsedValue)) {\n this.value = parsedValue;\n this.emitValueChange();\n }\n }\n\n private emitValueChange() {\n console.log(\"value change\", this.value);\n this.valueChange.emit(this.value);\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { InputStepperComponent } from './input-stepper/input-stepper.component';\n\n\n\n@NgModule({\n declarations: [\n InputStepperComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [\n InputStepperComponent\n ]\n})\nexport class InputStepperModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["EventEmitter","Component","Input","Output","NgModule","CommonModule"],"mappings":";;;;;;;QAcE;Y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"}
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/input-stepper",["exports","@angular/core","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["mis-crystal-design-system"]=e["mis-crystal-design-system"]||{},e["mis-crystal-design-system"]["input-stepper"]={}),e.ng.core,e.ng.common)}(this,(function(e,t,n){"use strict";var i=function(){function e(){this.value=1,this.width="200px",this.minLimit=0,this.maxLimit=2,this.valueChange=new t.EventEmitter}return e.prototype.increment=function(){this.value++,this.emitValueChange()},e.prototype.decrement=function(){this.value>0&&(this.value--,this.emitValueChange())},e.prototype.onInputChange=function(e){var t=parseInt(e,10);isNaN(t)||(this.value=t,this.emitValueChange())},e.prototype.emitValueChange=function(){console.log("value change",this.value),this.valueChange.emit(this.value)},e}();i.decorators=[{type:t.Component,args:[{selector:"mis-input-stepper",template:'<div class="nudger" [ngStyle]="{\'max-width\': width }">\n <button (click)="decrement()" [ngClass]="{\'disabled\': value === minLimit}">-</button>\n <input type="text" [value]="value" (input)="onInputChange($event.target.value)">\n <button (click)="increment()" [ngClass]="{\'disabled\': value === maxLimit}">+</button>\n</div>\n ',styles:[".nudger{display:flex;align-items:center;justify-content:center;width:100%;border:1px solid #0937b2;border-radius:4px}button{padding:.5em 1em;cursor:pointer;border:none;transition:background-color .3s;color:#0937b2}button,button:hover{background-color:#fff}input{width:40%;text-align:center;padding:.5em 1em;color:#0937b2;border:none}@media screen and (max-width:600px){.nudger{max-width:150px}}.disabled{opacity:.6;cursor:not-allowed}"]}]}],i.ctorParameters=function(){return[]},i.propDecorators={value:[{type:t.Input}],width:[{type:t.Input}],minLimit:[{type:t.Input}],maxLimit:[{type:t.Input}],valueChange:[{type:t.Output}]};var o=function(){};o.decorators=[{type:t.NgModule,args:[{declarations:[i],imports:[n.CommonModule],exports:[i]}]}],e.InputStepperComponent=i,e.InputStepperModule=o,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/input-stepper",["exports","@angular/core","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["mis-crystal-design-system"]=e["mis-crystal-design-system"]||{},e["mis-crystal-design-system"]["input-stepper"]={}),e.ng.core,e.ng.common)}(this,(function(e,t,n){"use strict";var i=function(){function e(){this.value=1,this.width="200px",this.minLimit=0,this.maxLimit=2,this.valueChange=new t.EventEmitter}return e.prototype.increment=function(){this.value!==this.maxLimit&&(this.value++,this.emitValueChange())},e.prototype.decrement=function(){this.value>0&&(this.value--,this.emitValueChange())},e.prototype.onInputChange=function(e){var t=parseInt(e,10);isNaN(t)||(this.value=t,this.emitValueChange())},e.prototype.emitValueChange=function(){console.log("value change",this.value),this.valueChange.emit(this.value)},e}();i.decorators=[{type:t.Component,args:[{selector:"mis-input-stepper",template:'<div class="nudger" [ngStyle]="{\'max-width\': width }">\n <button (click)="decrement()" [ngClass]="{\'disabled\': value === minLimit}">-</button>\n <input type="text" [value]="value" (input)="onInputChange($event.target.value)">\n <button (click)="increment()" [ngClass]="{\'disabled\': value === maxLimit}">+</button>\n</div>\n ',styles:[".nudger{display:flex;align-items:center;justify-content:center;width:100%;border:1px solid #0937b2;border-radius:4px}button{padding:.5em 1em;cursor:pointer;border:none;transition:background-color .3s;color:#0937b2}button,button:hover{background-color:#fff}input{width:40%;text-align:center;padding:.5em 1em;color:#0937b2;border:none}@media screen and (max-width:600px){.nudger{max-width:150px}}.disabled{opacity:.6;cursor:not-allowed}"]}]}],i.ctorParameters=function(){return[]},i.propDecorators={value:[{type:t.Input}],width:[{type:t.Input}],minLimit:[{type:t.Input}],maxLimit:[{type:t.Input}],valueChange:[{type:t.Output}]};var o=function(){};o.decorators=[{type:t.NgModule,args:[{declarations:[i],imports:[n.CommonModule],exports:[i]}]}],e.InputStepperComponent=i,e.InputStepperModule=o,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=mis-crystal-design-system-input-stepper.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../projects/mis-components/input-stepper/input-stepper/input-stepper.component.ts","../../../projects/mis-components/input-stepper/input-stepper.module.ts"],"names":["InputStepperComponent","this","value","width","minLimit","maxLimit","valueChange","EventEmitter","prototype","increment","emitValueChange","decrement","onInputChange","newValue","parsedValue","parseInt","isNaN","console","log","emit","Component","args","selector","template","Input","Output","NgModule","declarations","imports","CommonModule","exports"],"mappings":"ogBAcE,SAAAA,IANSC,KAAAC,MAAgB,EAChBD,KAAAE,MAAiB,QACjBF,KAAAG,SAAoB,EACpBH,KAAAI,SAAmB,EAClBJ,KAAAK,YAAoC,IAAIC,EAAAA,oBAIlDP,EAAAQ,UAAAC,UAAA,WACER,KAAKC,QACLD,KAAKS,mBAGPV,EAAAQ,UAAAG,UAAA,WACMV,KAAKC,MAAQ,IACfD,KAAKC,QACLD,KAAKS,oBAITV,EAAAQ,UAAAI,cAAA,SAAcC,GACZ,IAAMC,EAAcC,SAASF,EAAU,IAClCG,MAAMF,KACTb,KAAKC,MAAQY,EACbb,KAAKS,oBAIDV,EAAAQ,UAAAE,gBAAA,WACNO,QAAQC,IAAI,eAAgBjB,KAAKC,OACjCD,KAAKK,YAAYa,KAAKlB,KAAKC,iCApC9BkB,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,oBACVC,SAAA,81BAICC,EAAAA,qBACAA,EAAAA,wBACAA,EAAAA,wBACAA,EAAAA,2BACAC,EAAAA,gBCKH,iCAXCC,EAAAA,SAAQL,KAAA,CAAC,CACRM,aAAc,CACZ3B,GAEF4B,QAAS,CACPC,EAAAA,cAEFC,QAAS,CACP9B","sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\n\n@Component({\n selector: 'mis-input-stepper',\n templateUrl: './input-stepper.component.html',\n styleUrls: ['./input-stepper.component.css']\n})\nexport class InputStepperComponent {\n @Input() value: number = 1;\n @Input() width?: string = '200px';\n @Input() minLimit : number = 0;\n @Input() maxLimit: number = 2;\n @Output() valueChange: EventEmitter<number> = new EventEmitter<number>();\n\n constructor() { }\n\n increment() {\n this.value++;\n this.emitValueChange();\n }\n\n decrement() {\n if (this.value > 0) {\n this.value--;\n this.emitValueChange();\n }\n }\n\n onInputChange(newValue: string) {\n const parsedValue = parseInt(newValue, 10);\n if (!isNaN(parsedValue)) {\n this.value = parsedValue;\n this.emitValueChange();\n }\n }\n\n private emitValueChange() {\n console.log(\"value change\", this.value);\n this.valueChange.emit(this.value);\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { InputStepperComponent } from './input-stepper/input-stepper.component';\n\n\n\n@NgModule({\n declarations: [\n InputStepperComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [\n InputStepperComponent\n ]\n})\nexport class InputStepperModule { }\n"]}
1
+ {"version":3,"sources":["../../../projects/mis-components/input-stepper/input-stepper/input-stepper.component.ts","../../../projects/mis-components/input-stepper/input-stepper.module.ts"],"names":["InputStepperComponent","this","value","width","minLimit","maxLimit","valueChange","EventEmitter","prototype","increment","emitValueChange","decrement","onInputChange","newValue","parsedValue","parseInt","isNaN","console","log","emit","Component","args","selector","template","Input","Output","NgModule","declarations","imports","CommonModule","exports"],"mappings":"ogBAcE,SAAAA,IANSC,KAAAC,MAAgB,EAChBD,KAAAE,MAAiB,QACjBF,KAAAG,SAAoB,EACpBH,KAAAI,SAAmB,EAClBJ,KAAAK,YAAoC,IAAIC,EAAAA,oBAIlDP,EAAAQ,UAAAC,UAAA,WACKR,KAAKC,QAAUD,KAAKI,WACvBJ,KAAKC,QACLD,KAAKS,oBAGPV,EAAAQ,UAAAG,UAAA,WACMV,KAAKC,MAAQ,IACfD,KAAKC,QACLD,KAAKS,oBAITV,EAAAQ,UAAAI,cAAA,SAAcC,GACZ,IAAMC,EAAcC,SAASF,EAAU,IAClCG,MAAMF,KACTb,KAAKC,MAAQY,EACbb,KAAKS,oBAIDV,EAAAQ,UAAAE,gBAAA,WACNO,QAAQC,IAAI,eAAgBjB,KAAKC,OACjCD,KAAKK,YAAYa,KAAKlB,KAAKC,iCArC9BkB,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,oBACVC,SAAA,81BAICC,EAAAA,qBACAA,EAAAA,wBACAA,EAAAA,wBACAA,EAAAA,2BACAC,EAAAA,gBCKH,iCAXCC,EAAAA,SAAQL,KAAA,CAAC,CACRM,aAAc,CACZ3B,GAEF4B,QAAS,CACPC,EAAAA,cAEFC,QAAS,CACP9B","sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\n\n@Component({\n selector: 'mis-input-stepper',\n templateUrl: './input-stepper.component.html',\n styleUrls: ['./input-stepper.component.css']\n})\nexport class InputStepperComponent {\n @Input() value: number = 1;\n @Input() width?: string = '200px';\n @Input() minLimit : number = 0;\n @Input() maxLimit: number = 2;\n @Output() valueChange: EventEmitter<number> = new EventEmitter<number>();\n\n constructor() { }\n\n increment() {\n if(this.value === this.maxLimit) return;\n this.value++;\n this.emitValueChange();\n }\n\n decrement() {\n if (this.value > 0) {\n this.value--;\n this.emitValueChange();\n }\n }\n\n onInputChange(newValue: string) {\n const parsedValue = parseInt(newValue, 10);\n if (!isNaN(parsedValue)) {\n this.value = parsedValue;\n this.emitValueChange();\n }\n }\n\n private emitValueChange() {\n console.log(\"value change\", this.value);\n this.valueChange.emit(this.value);\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { InputStepperComponent } from './input-stepper/input-stepper.component';\n\n\n\n@NgModule({\n declarations: [\n InputStepperComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [\n InputStepperComponent\n ]\n})\nexport class InputStepperModule { }\n"]}
@@ -4,28 +4,25 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['mis-crystal-design-system'] = global['mis-crystal-design-system'] || {}, global['mis-crystal-design-system'].snackbar = {}), global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.core, global.ng.common));
5
5
  }(this, (function (exports, i1, portal, i0, common) { 'use strict';
6
6
 
7
- // snackbar.component.ts
8
7
  var SnackbarComponent = /** @class */ (function () {
9
- function SnackbarComponent(input) {
10
- this.input = input;
8
+ function SnackbarComponent() {
11
9
  this.triggerAction = new i0.EventEmitter();
12
10
  }
13
- SnackbarComponent.prototype.triggerActionFunction = function () {
14
- this.triggerAction.emit(true);
11
+ SnackbarComponent.prototype.onActionClick = function () {
12
+ this.triggerAction.emit();
15
13
  };
16
14
  return SnackbarComponent;
17
15
  }());
18
16
  SnackbarComponent.decorators = [
19
17
  { type: i0.Component, args: [{
20
- selector: 'mis-snackbar',
21
- template: "<div class=\"snackbar-container\">\n <div class=\"messages\" *ngIf=\"!input.config.hasComponent\">\n\n <span class=\"message\">\n <img *ngIf=\"input.config.iconUrl\" [src]=\"input.config.iconUrl\" alt=\"\">\n {{ input.config.message }}\n </span>\n <div class=\"snackbar-action\" *ngIf=\"input.config.actionString\">\n <button (click)=\"triggerActionFunction()\">{{ input.config.actionString }}</button>\n </div>\n </div>\n <div class=\"component-container\" *ngIf=\"input.config.hasComponent\">\n <ng-content></ng-content>\n </div>\n</div>\n",
18
+ selector: 'app-snackbar',
19
+ template: "<div class=\"snackbar-container\">\n <div class=\"messages\" *ngIf=\"!config.hasComponent\">\n <span class=\"message\">\n <img *ngIf=\"config.iconUrl\" [src]=\"config.iconUrl\" alt=\"\">\n {{ config.message }}\n </span>\n <div class=\"snackbar-action\" *ngIf=\"config.actionString\">\n <button (click)=\"onActionClick()\">{{ config.actionString }}</button>\n </div>\n </div>\n <div class=\"component-container\" *ngIf=\"config.hasComponent\">\n <ng-content></ng-content>\n </div>\n</div>\n",
22
20
  styles: [".snackbar-container{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background-color:#181f33;color:#fff;border-radius:8px;padding:8px 12px;max-width:400px;width:90%;z-index:1000;box-shadow:0 4px 8px rgba(0,0,0,.2)}.messages{display:flex;align-items:center;justify-content:space-between}.message{flex:1;padding-right:10px;font-size:16px;font-weight:700}.snackbar-action button{background-color:#181f33;color:#fff;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-size:16px!important;transition:background-color .3s ease}.snackbar-action button:hover{background-color:#0056b3}.component-container{margin-top:10px}@media (max-width:768px){.snackbar-container{left:10px;right:10px;transform:none;width:auto;max-width:none}}"]
23
21
  },] }
24
22
  ];
25
- SnackbarComponent.ctorParameters = function () { return [
26
- { type: SnackbarService }
27
- ]; };
23
+ SnackbarComponent.ctorParameters = function () { return []; };
28
24
  SnackbarComponent.propDecorators = {
25
+ config: [{ type: i0.Input }],
29
26
  triggerAction: [{ type: i0.Output }]
30
27
  };
31
28
 
@@ -76,6 +73,18 @@
76
73
  var SnackbarModule = /** @class */ (function () {
77
74
  function SnackbarModule() {
78
75
  }
76
+ SnackbarModule.forRoot = function () {
77
+ return {
78
+ ngModule: SnackbarModule,
79
+ providers: [SnackbarService]
80
+ };
81
+ };
82
+ SnackbarModule.forChild = function () {
83
+ return {
84
+ ngModule: SnackbarModule,
85
+ providers: [SnackbarService]
86
+ };
87
+ };
79
88
  return SnackbarModule;
80
89
  }());
81
90
  SnackbarModule.decorators = [
@@ -88,7 +97,6 @@
88
97
  ],
89
98
  exports: [SnackbarComponent],
90
99
  entryComponents: [SnackbarComponent],
91
- providers: [SnackbarService]
92
100
  },] }
93
101
  ];
94
102
 
@@ -1 +1 @@
1
- {"version":3,"file":"mis-crystal-design-system-snackbar.umd.js","sources":["../../../projects/mis-components/snackbar/snackbar/snackbar.component.ts","../../../projects/mis-components/snackbar/snackbar.service.ts","../../../projects/mis-components/snackbar/snackbar.module.ts","../../../projects/mis-components/snackbar/mis-crystal-design-system-snackbar.ts"],"sourcesContent":["// snackbar.component.ts\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { SnackbarService } from '../snackbar.service';\n\n@Component({\n selector: 'mis-snackbar',\n templateUrl: \"./snackbar.component.html\",\n styleUrls: [\"./snackbar.component.css\"],\n})\nexport class SnackbarComponent {\n @Output() triggerAction = new EventEmitter<any>();\n constructor(public input: SnackbarService){}\n triggerActionFunction(){\n this.triggerAction.emit(true)\n }\n}\n","export interface ISnackBarConfig {\n message: string;\n actionString: string;\n hasComponent: boolean;\n iconUrl?: string;\n component?: ComponentRef<any>;\n duration?: number;\n onActionClick?: () => void;\n}\nimport { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { ComponentRef, Injectable } from \"@angular/core\"; // Assuming you have defined ISnackBarConfig interface\nimport { SnackbarComponent } from \"./snackbar/snackbar.component\";\n\n@Injectable({\n providedIn: \"root\"\n})\nexport class SnackbarService {\n config: ISnackBarConfig;\n private snackbarRef: OverlayRef;\n\n constructor(private overlay: Overlay) {}\n\n openSnackbar(config: ISnackBarConfig): void {\n this.config = config;\n const overlayConfig = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy: this.overlay.position().global().centerHorizontally().bottom(\"48px\")\n });\n\n this.snackbarRef = this.overlay.create(overlayConfig);\n\n const snackbarPortal = new ComponentPortal(SnackbarComponent);\n const componentRef = this.snackbarRef.attach(snackbarPortal);\n\n // componentRef.instance.config = config;\n\n config.duration = config.duration || 3000;\n setTimeout(() => {\n this.closeSnackbar();\n }, config.duration);\n\n componentRef.instance.triggerAction.subscribe(() => {\n if (config.onActionClick) {\n config.onActionClick();\n }\n this.closeSnackbar();\n });\n }\n\n closeSnackbar(): void {\n if (this.snackbarRef) {\n this.snackbarRef.dispose();\n this.snackbarRef = null;\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SnackbarComponent } from './snackbar/snackbar.component';\nimport { SnackbarService } from './snackbar.service';\n\n\n\n@NgModule({\n declarations: [\n SnackbarComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [SnackbarComponent],\n entryComponents: [SnackbarComponent],\n providers: [SnackbarService]\n})\nexport class SnackbarModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["EventEmitter","Component","Output","OverlayConfig","ComponentPortal","Injectable","Overlay","NgModule","CommonModule"],"mappings":";;;;;;IAAA;;QAWE,2BAAmB,KAAsB;YAAtB,UAAK,GAAL,KAAK,CAAiB;YAD/B,kBAAa,GAAG,IAAIA,eAAY,EAAO,CAAC;SACN;QAC5C,iDAAqB,GAArB;YACE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SAC9B;;;;gBAVFC,YAAS,SAAC;oBACT,QAAQ,EAAE,cAAc;oBACxB,2kBAAwC;;iBAEzC;;;gBANQ,eAAe;;;gCAQrBC,SAAM;;;;QCWP,yBAAoB,OAAgB;YAAhB,YAAO,GAAP,OAAO,CAAS;SAAI;QAExC,sCAAY,GAAZ,UAAa,MAAuB;YAApC,iBAyBC;YAxBC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YACrB,IAAM,aAAa,GAAG,IAAIC,gBAAa,CAAC;gBACtC,WAAW,EAAE,KAAK;gBAClB,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;aACvF,CAAC,CAAC;YAEH,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAEtD,IAAM,cAAc,GAAG,IAAIC,sBAAe,CAAC,iBAAiB,CAAC,CAAC;YAC9D,IAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;;YAI7D,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC;YAC1C,UAAU,CAAC;gBACT,KAAI,CAAC,aAAa,EAAE,CAAC;aACtB,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEpB,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC;gBAC5C,IAAI,MAAM,CAAC,aAAa,EAAE;oBACxB,MAAM,CAAC,aAAa,EAAE,CAAC;iBACxB;gBACD,KAAI,CAAC,aAAa,EAAE,CAAC;aACtB,CAAC,CAAC;SACJ;QAED,uCAAa,GAAb;YACE,IAAI,IAAI,CAAC,WAAW,EAAE;gBACpB,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;gBAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;aACzB;SACF;;;;;gBAzCFC,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;gBAPQC,UAAO;;;;QCShB;;;;;gBAXCC,WAAQ,SAAC;oBACR,YAAY,EAAE;wBACZ,iBAAiB;qBAClB;oBACD,OAAO,EAAE;wBACPC,mBAAY;qBACb;oBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,eAAe,EAAE,CAAC,iBAAiB,CAAC;oBACpC,SAAS,EAAE,CAAC,eAAe,CAAC;iBAC7B;;;ICjBD;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"mis-crystal-design-system-snackbar.umd.js","sources":["../../../projects/mis-components/snackbar/snackbar/snackbar.component.ts","../../../projects/mis-components/snackbar/snackbar.service.ts","../../../projects/mis-components/snackbar/snackbar.module.ts","../../../projects/mis-components/snackbar/mis-crystal-design-system-snackbar.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { ISnackBarConfig } from '../snackbar.service';\n\n@Component({\n selector: 'app-snackbar',\n templateUrl: './snackbar.component.html',\n styleUrls: ['./snackbar.component.css']\n})\nexport class SnackbarComponent {\n @Input() config: ISnackBarConfig;\n @Output() triggerAction = new EventEmitter<void>();\n constructor(){}\n onActionClick(): void {\n this.triggerAction.emit();\n }\n}\n","export interface ISnackBarConfig {\n message: string;\n actionString: string;\n hasComponent: boolean;\n iconUrl?: string;\n component?: ComponentRef<any>;\n duration?: number;\n onActionClick?: () => void;\n}\nimport { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { ComponentRef, Injectable } from \"@angular/core\"; // Assuming you have defined ISnackBarConfig interface\nimport { SnackbarComponent } from \"./snackbar/snackbar.component\";\n\n@Injectable({\n providedIn: \"root\"\n})\nexport class SnackbarService {\n config: ISnackBarConfig;\n private snackbarRef: OverlayRef;\n\n constructor(private overlay: Overlay) {}\n\n openSnackbar(config: ISnackBarConfig): void {\n this.config = config;\n const overlayConfig = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy: this.overlay.position().global().centerHorizontally().bottom(\"48px\")\n });\n\n this.snackbarRef = this.overlay.create(overlayConfig);\n\n const snackbarPortal = new ComponentPortal(SnackbarComponent);\n const componentRef = this.snackbarRef.attach(snackbarPortal);\n\n // componentRef.instance.config = config;\n\n config.duration = config.duration || 3000;\n setTimeout(() => {\n this.closeSnackbar();\n }, config.duration);\n\n componentRef.instance.triggerAction.subscribe(() => {\n if (config.onActionClick) {\n config.onActionClick();\n }\n this.closeSnackbar();\n });\n }\n\n closeSnackbar(): void {\n if (this.snackbarRef) {\n this.snackbarRef.dispose();\n this.snackbarRef = null;\n }\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SnackbarComponent } from './snackbar/snackbar.component';\nimport { SnackbarService } from './snackbar.service';\n\n\n\n@NgModule({\n declarations: [\n SnackbarComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [SnackbarComponent],\n entryComponents: [SnackbarComponent],\n})\nexport class SnackbarModule {\n static forRoot(): ModuleWithProviders<SnackbarModule> {\n return {\n ngModule: SnackbarModule,\n providers: [SnackbarService]\n };\n }\n\n static forChild(): ModuleWithProviders<SnackbarModule> {\n return {\n ngModule: SnackbarModule,\n providers: [ SnackbarService]\n };\n }\n }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["EventEmitter","Component","Input","Output","OverlayConfig","ComponentPortal","Injectable","Overlay","NgModule","CommonModule"],"mappings":";;;;;;;QAWE;YADU,kBAAa,GAAG,IAAIA,eAAY,EAAQ,CAAC;SACpC;QACf,yCAAa,GAAb;YACE,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;SAC3B;;;;gBAXFC,YAAS,SAAC;oBACT,QAAQ,EAAE,cAAc;oBACxB,uhBAAwC;;iBAEzC;;;;yBAEEC,QAAK;gCACLC,SAAM;;;;QCWP,yBAAoB,OAAgB;YAAhB,YAAO,GAAP,OAAO,CAAS;SAAI;QAExC,sCAAY,GAAZ,UAAa,MAAuB;YAApC,iBAyBC;YAxBC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YACrB,IAAM,aAAa,GAAG,IAAIC,gBAAa,CAAC;gBACtC,WAAW,EAAE,KAAK;gBAClB,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;aACvF,CAAC,CAAC;YAEH,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAEtD,IAAM,cAAc,GAAG,IAAIC,sBAAe,CAAC,iBAAiB,CAAC,CAAC;YAC9D,IAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;;YAI7D,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC;YAC1C,UAAU,CAAC;gBACT,KAAI,CAAC,aAAa,EAAE,CAAC;aACtB,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEpB,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC;gBAC5C,IAAI,MAAM,CAAC,aAAa,EAAE;oBACxB,MAAM,CAAC,aAAa,EAAE,CAAC;iBACxB;gBACD,KAAI,CAAC,aAAa,EAAE,CAAC;aACtB,CAAC,CAAC;SACJ;QAED,uCAAa,GAAb;YACE,IAAI,IAAI,CAAC,WAAW,EAAE;gBACpB,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;gBAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;aACzB;SACF;;;;;gBAzCFC,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;gBAPQC,UAAO;;;;QCQhB;;QACS,sBAAO,GAAd;YACE,OAAO;gBACL,QAAQ,EAAE,cAAc;gBACxB,SAAS,EAAE,CAAC,eAAe,CAAC;aAC7B,CAAC;SACH;QAEM,uBAAQ,GAAf;YACE,OAAO;gBACL,QAAQ,EAAE,cAAc;gBACxB,SAAS,EAAE,CAAE,eAAe,CAAC;aAC9B,CAAC;SACH;;;;gBAvBFC,WAAQ,SAAC;oBACR,YAAY,EAAE;wBACZ,iBAAiB;qBAClB;oBACD,OAAO,EAAE;wBACPC,mBAAY;qBACb;oBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,eAAe,EAAE,CAAC,iBAAiB,CAAC;iBACrC;;;IChBD;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/snackbar",["exports","@angular/cdk/overlay","@angular/cdk/portal","@angular/core","@angular/common"],t):t(((n="undefined"!=typeof globalThis?globalThis:n||self)["mis-crystal-design-system"]=n["mis-crystal-design-system"]||{},n["mis-crystal-design-system"].snackbar={}),n.ng.cdk.overlay,n.ng.cdk.portal,n.ng.core,n.ng.common)}(this,(function(n,t,o,e,r){"use strict";var a=function(){function n(n){this.input=n,this.triggerAction=new e.EventEmitter}return n.prototype.triggerActionFunction=function(){this.triggerAction.emit(!0)},n}();a.decorators=[{type:e.Component,args:[{selector:"mis-snackbar",template:'<div class="snackbar-container">\n <div class="messages" *ngIf="!input.config.hasComponent">\n\n <span class="message">\n <img *ngIf="input.config.iconUrl" [src]="input.config.iconUrl" alt="">\n {{ input.config.message }}\n </span>\n <div class="snackbar-action" *ngIf="input.config.actionString">\n <button (click)="triggerActionFunction()">{{ input.config.actionString }}</button>\n </div>\n </div>\n <div class="component-container" *ngIf="input.config.hasComponent">\n <ng-content></ng-content>\n </div>\n</div>\n',styles:[".snackbar-container{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background-color:#181f33;color:#fff;border-radius:8px;padding:8px 12px;max-width:400px;width:90%;z-index:1000;box-shadow:0 4px 8px rgba(0,0,0,.2)}.messages{display:flex;align-items:center;justify-content:space-between}.message{flex:1;padding-right:10px;font-size:16px;font-weight:700}.snackbar-action button{background-color:#181f33;color:#fff;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-size:16px!important;transition:background-color .3s ease}.snackbar-action button:hover{background-color:#0056b3}.component-container{margin-top:10px}@media (max-width:768px){.snackbar-container{left:10px;right:10px;transform:none;width:auto;max-width:none}}"]}]}],a.ctorParameters=function(){return[{type:i}]},a.propDecorators={triggerAction:[{type:e.Output}]};var i=function(){function n(n){this.overlay=n}return n.prototype.openSnackbar=function(n){var e=this;this.config=n;var r=new t.OverlayConfig({hasBackdrop:!1,positionStrategy:this.overlay.position().global().centerHorizontally().bottom("48px")});this.snackbarRef=this.overlay.create(r);var i=new o.ComponentPortal(a),c=this.snackbarRef.attach(i);n.duration=n.duration||3e3,setTimeout((function(){e.closeSnackbar()}),n.duration),c.instance.triggerAction.subscribe((function(){n.onActionClick&&n.onActionClick(),e.closeSnackbar()}))},n.prototype.closeSnackbar=function(){this.snackbarRef&&(this.snackbarRef.dispose(),this.snackbarRef=null)},n}();i.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new i(e.ɵɵinject(t.Overlay))},token:i,providedIn:"root"}),i.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],i.ctorParameters=function(){return[{type:t.Overlay}]};var c=function(){};c.decorators=[{type:e.NgModule,args:[{declarations:[a],imports:[r.CommonModule],exports:[a],entryComponents:[a],providers:[i]}]}],n.SnackbarComponent=a,n.SnackbarModule=c,n.SnackbarService=i,Object.defineProperty(n,"__esModule",{value:!0})}));
1
+ !function(n,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/snackbar",["exports","@angular/cdk/overlay","@angular/cdk/portal","@angular/core","@angular/common"],o):o(((n="undefined"!=typeof globalThis?globalThis:n||self)["mis-crystal-design-system"]=n["mis-crystal-design-system"]||{},n["mis-crystal-design-system"].snackbar={}),n.ng.cdk.overlay,n.ng.cdk.portal,n.ng.core,n.ng.common)}(this,(function(n,o,t,e,r){"use strict";var a=function(){function n(){this.triggerAction=new e.EventEmitter}return n.prototype.onActionClick=function(){this.triggerAction.emit()},n}();a.decorators=[{type:e.Component,args:[{selector:"app-snackbar",template:'<div class="snackbar-container">\n <div class="messages" *ngIf="!config.hasComponent">\n <span class="message">\n <img *ngIf="config.iconUrl" [src]="config.iconUrl" alt="">\n {{ config.message }}\n </span>\n <div class="snackbar-action" *ngIf="config.actionString">\n <button (click)="onActionClick()">{{ config.actionString }}</button>\n </div>\n </div>\n <div class="component-container" *ngIf="config.hasComponent">\n <ng-content></ng-content>\n </div>\n</div>\n',styles:[".snackbar-container{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background-color:#181f33;color:#fff;border-radius:8px;padding:8px 12px;max-width:400px;width:90%;z-index:1000;box-shadow:0 4px 8px rgba(0,0,0,.2)}.messages{display:flex;align-items:center;justify-content:space-between}.message{flex:1;padding-right:10px;font-size:16px;font-weight:700}.snackbar-action button{background-color:#181f33;color:#fff;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-size:16px!important;transition:background-color .3s ease}.snackbar-action button:hover{background-color:#0056b3}.component-container{margin-top:10px}@media (max-width:768px){.snackbar-container{left:10px;right:10px;transform:none;width:auto;max-width:none}}"]}]}],a.ctorParameters=function(){return[]},a.propDecorators={config:[{type:e.Input}],triggerAction:[{type:e.Output}]};var i=function(){function n(n){this.overlay=n}return n.prototype.openSnackbar=function(n){var e=this;this.config=n;var r=new o.OverlayConfig({hasBackdrop:!1,positionStrategy:this.overlay.position().global().centerHorizontally().bottom("48px")});this.snackbarRef=this.overlay.create(r);var i=new t.ComponentPortal(a),c=this.snackbarRef.attach(i);n.duration=n.duration||3e3,setTimeout((function(){e.closeSnackbar()}),n.duration),c.instance.triggerAction.subscribe((function(){n.onActionClick&&n.onActionClick(),e.closeSnackbar()}))},n.prototype.closeSnackbar=function(){this.snackbarRef&&(this.snackbarRef.dispose(),this.snackbarRef=null)},n}();i.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new i(e.ɵɵinject(o.Overlay))},token:i,providedIn:"root"}),i.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],i.ctorParameters=function(){return[{type:o.Overlay}]};var c=function(){function n(){}return n.forRoot=function(){return{ngModule:n,providers:[i]}},n.forChild=function(){return{ngModule:n,providers:[i]}},n}();c.decorators=[{type:e.NgModule,args:[{declarations:[a],imports:[r.CommonModule],exports:[a],entryComponents:[a]}]}],n.SnackbarComponent=a,n.SnackbarModule=c,n.SnackbarService=i,Object.defineProperty(n,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=mis-crystal-design-system-snackbar.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../projects/mis-components/snackbar/snackbar/snackbar.component.ts","../../../projects/mis-components/snackbar/snackbar.service.ts","../../../projects/mis-components/snackbar/snackbar.module.ts"],"names":["SnackbarComponent","input","this","triggerAction","EventEmitter","prototype","triggerActionFunction","emit","Component","args","selector","template","SnackbarService","Output","overlay","openSnackbar","config","_this","overlayConfig","OverlayConfig","hasBackdrop","positionStrategy","position","global","centerHorizontally","bottom","snackbarRef","create","snackbarPortal","ComponentPortal","componentRef","attach","duration","setTimeout","closeSnackbar","instance","subscribe","onActionClick","dispose","Injectable","providedIn","Overlay","NgModule","declarations","imports","CommonModule","exports","entryComponents","providers"],"mappings":"woBAWE,SAAAA,EAAmBC,GAAAC,KAAAD,MAAAA,EADTC,KAAAC,cAAgB,IAAIC,EAAAA,oBAE9BJ,EAAAK,UAAAC,sBAAA,WACEJ,KAAKC,cAAcI,MAAK,6BAT3BC,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,eACVC,SAAA,k1CAJOC,4CAQNC,EAAAA,2BCWD,SAAAD,EAAoBE,GAAAZ,KAAAY,QAAAA,SAEpBF,EAAAP,UAAAU,aAAA,SAAaC,GAAb,IAAAC,EAAAf,KACEA,KAAKc,OAASA,EACd,IAAME,EAAgB,IAAIC,EAAAA,cAAc,CACtCC,aAAa,EACbC,iBAAkBnB,KAAKY,QAAQQ,WAAWC,SAASC,qBAAqBC,OAAO,UAGjFvB,KAAKwB,YAAcxB,KAAKY,QAAQa,OAAOT,GAEvC,IAAMU,EAAiB,IAAIC,EAAAA,gBAAgB7B,GACrC8B,EAAe5B,KAAKwB,YAAYK,OAAOH,GAI7CZ,EAAOgB,SAAWhB,EAAOgB,UAAY,IACrCC,YAAW,WACThB,EAAKiB,kBACJlB,EAAOgB,UAEVF,EAAaK,SAAShC,cAAciC,WAAU,WACxCpB,EAAOqB,eACTrB,EAAOqB,gBAETpB,EAAKiB,oBAITtB,EAAAP,UAAA6B,cAAA,WACMhC,KAAKwB,cACPxB,KAAKwB,YAAYY,UACjBpC,KAAKwB,YAAc,kJAvCxBa,EAAAA,WAAU9B,KAAA,CAAC,CACV+B,WAAY,oDANLC,EAAAA,iBCST,iCAXCC,EAAAA,SAAQjC,KAAA,CAAC,CACRkC,aAAc,CACZ3C,GAEF4C,QAAS,CACPC,EAAAA,cAEFC,QAAS,CAAC9C,GACV+C,gBAAiB,CAAC/C,GAClBgD,UAAW,CAACpC","sourcesContent":["// snackbar.component.ts\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { SnackbarService } from '../snackbar.service';\n\n@Component({\n selector: 'mis-snackbar',\n templateUrl: \"./snackbar.component.html\",\n styleUrls: [\"./snackbar.component.css\"],\n})\nexport class SnackbarComponent {\n @Output() triggerAction = new EventEmitter<any>();\n constructor(public input: SnackbarService){}\n triggerActionFunction(){\n this.triggerAction.emit(true)\n }\n}\n","export interface ISnackBarConfig {\n message: string;\n actionString: string;\n hasComponent: boolean;\n iconUrl?: string;\n component?: ComponentRef<any>;\n duration?: number;\n onActionClick?: () => void;\n}\nimport { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { ComponentRef, Injectable } from \"@angular/core\"; // Assuming you have defined ISnackBarConfig interface\nimport { SnackbarComponent } from \"./snackbar/snackbar.component\";\n\n@Injectable({\n providedIn: \"root\"\n})\nexport class SnackbarService {\n config: ISnackBarConfig;\n private snackbarRef: OverlayRef;\n\n constructor(private overlay: Overlay) {}\n\n openSnackbar(config: ISnackBarConfig): void {\n this.config = config;\n const overlayConfig = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy: this.overlay.position().global().centerHorizontally().bottom(\"48px\")\n });\n\n this.snackbarRef = this.overlay.create(overlayConfig);\n\n const snackbarPortal = new ComponentPortal(SnackbarComponent);\n const componentRef = this.snackbarRef.attach(snackbarPortal);\n\n // componentRef.instance.config = config;\n\n config.duration = config.duration || 3000;\n setTimeout(() => {\n this.closeSnackbar();\n }, config.duration);\n\n componentRef.instance.triggerAction.subscribe(() => {\n if (config.onActionClick) {\n config.onActionClick();\n }\n this.closeSnackbar();\n });\n }\n\n closeSnackbar(): void {\n if (this.snackbarRef) {\n this.snackbarRef.dispose();\n this.snackbarRef = null;\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SnackbarComponent } from './snackbar/snackbar.component';\nimport { SnackbarService } from './snackbar.service';\n\n\n\n@NgModule({\n declarations: [\n SnackbarComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [SnackbarComponent],\n entryComponents: [SnackbarComponent],\n providers: [SnackbarService]\n})\nexport class SnackbarModule { }\n"]}
1
+ {"version":3,"sources":["../../../projects/mis-components/snackbar/snackbar/snackbar.component.ts","../../../projects/mis-components/snackbar/snackbar.service.ts","../../../projects/mis-components/snackbar/snackbar.module.ts"],"names":["SnackbarComponent","this","triggerAction","EventEmitter","prototype","onActionClick","emit","Component","args","selector","template","Input","Output","SnackbarService","overlay","openSnackbar","config","_this","overlayConfig","OverlayConfig","hasBackdrop","positionStrategy","position","global","centerHorizontally","bottom","snackbarRef","create","snackbarPortal","ComponentPortal","componentRef","attach","duration","setTimeout","closeSnackbar","instance","subscribe","dispose","Injectable","providedIn","Overlay","SnackbarModule","forRoot","ngModule","providers","forChild","NgModule","declarations","imports","CommonModule","exports","entryComponents"],"mappings":"woBAWE,SAAAA,IADUC,KAAAC,cAAgB,IAAIC,EAAAA,oBAE9BH,EAAAI,UAAAC,cAAA,WACEJ,KAAKC,cAAcI,iCAVtBC,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,eACVC,SAAA,2zCAICC,EAAAA,6BACAC,EAAAA,2BCWD,SAAAC,EAAoBC,GAAAb,KAAAa,QAAAA,SAEpBD,EAAAT,UAAAW,aAAA,SAAaC,GAAb,IAAAC,EAAAhB,KACEA,KAAKe,OAASA,EACd,IAAME,EAAgB,IAAIC,EAAAA,cAAc,CACtCC,aAAa,EACbC,iBAAkBpB,KAAKa,QAAQQ,WAAWC,SAASC,qBAAqBC,OAAO,UAGjFxB,KAAKyB,YAAczB,KAAKa,QAAQa,OAAOT,GAEvC,IAAMU,EAAiB,IAAIC,EAAAA,gBAAgB7B,GACrC8B,EAAe7B,KAAKyB,YAAYK,OAAOH,GAI7CZ,EAAOgB,SAAWhB,EAAOgB,UAAY,IACrCC,YAAW,WACThB,EAAKiB,kBACJlB,EAAOgB,UAEVF,EAAaK,SAASjC,cAAckC,WAAU,WACxCpB,EAAOX,eACTW,EAAOX,gBAETY,EAAKiB,oBAITrB,EAAAT,UAAA8B,cAAA,WACMjC,KAAKyB,cACPzB,KAAKyB,YAAYW,UACjBpC,KAAKyB,YAAc,kJAvCxBY,EAAAA,WAAU9B,KAAA,CAAC,CACV+B,WAAY,oDANLC,EAAAA,4BCQT,SAAAC,YACSA,EAAAC,QAAP,WACE,MAAO,CACLC,SAAUF,EACVG,UAAW,CAAC/B,KAIT4B,EAAAI,SAAP,WACE,MAAO,CACLF,SAAUF,EACVG,UAAW,CAAE/B,8BArBlBiC,EAAAA,SAAQtC,KAAA,CAAC,CACRuC,aAAc,CACZ/C,GAEFgD,QAAS,CACPC,EAAAA,cAEFC,QAAS,CAAClD,GACVmD,gBAAiB,CAACnD","sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { ISnackBarConfig } from '../snackbar.service';\n\n@Component({\n selector: 'app-snackbar',\n templateUrl: './snackbar.component.html',\n styleUrls: ['./snackbar.component.css']\n})\nexport class SnackbarComponent {\n @Input() config: ISnackBarConfig;\n @Output() triggerAction = new EventEmitter<void>();\n constructor(){}\n onActionClick(): void {\n this.triggerAction.emit();\n }\n}\n","export interface ISnackBarConfig {\n message: string;\n actionString: string;\n hasComponent: boolean;\n iconUrl?: string;\n component?: ComponentRef<any>;\n duration?: number;\n onActionClick?: () => void;\n}\nimport { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { ComponentRef, Injectable } from \"@angular/core\"; // Assuming you have defined ISnackBarConfig interface\nimport { SnackbarComponent } from \"./snackbar/snackbar.component\";\n\n@Injectable({\n providedIn: \"root\"\n})\nexport class SnackbarService {\n config: ISnackBarConfig;\n private snackbarRef: OverlayRef;\n\n constructor(private overlay: Overlay) {}\n\n openSnackbar(config: ISnackBarConfig): void {\n this.config = config;\n const overlayConfig = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy: this.overlay.position().global().centerHorizontally().bottom(\"48px\")\n });\n\n this.snackbarRef = this.overlay.create(overlayConfig);\n\n const snackbarPortal = new ComponentPortal(SnackbarComponent);\n const componentRef = this.snackbarRef.attach(snackbarPortal);\n\n // componentRef.instance.config = config;\n\n config.duration = config.duration || 3000;\n setTimeout(() => {\n this.closeSnackbar();\n }, config.duration);\n\n componentRef.instance.triggerAction.subscribe(() => {\n if (config.onActionClick) {\n config.onActionClick();\n }\n this.closeSnackbar();\n });\n }\n\n closeSnackbar(): void {\n if (this.snackbarRef) {\n this.snackbarRef.dispose();\n this.snackbarRef = null;\n }\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SnackbarComponent } from './snackbar/snackbar.component';\nimport { SnackbarService } from './snackbar.service';\n\n\n\n@NgModule({\n declarations: [\n SnackbarComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [SnackbarComponent],\n entryComponents: [SnackbarComponent],\n})\nexport class SnackbarModule {\n static forRoot(): ModuleWithProviders<SnackbarModule> {\n return {\n ngModule: SnackbarModule,\n providers: [SnackbarService]\n };\n }\n\n static forChild(): ModuleWithProviders<SnackbarModule> {\n return {\n ngModule: SnackbarModule,\n providers: [ SnackbarService]\n };\n }\n }\n"]}
@@ -8,8 +8,8 @@
8
8
  function StarRatingComponent() {
9
9
  this.noOfStars = 0;
10
10
  this.selectedRating = -1;
11
- this.selectedStarSvg = '';
12
- this.emptyStarSvg = '';
11
+ this.selectedStarSvg = 'assets/selectedStar.svg';
12
+ this.emptyStarSvg = 'assets/star.svg';
13
13
  this.starHeight = '24px';
14
14
  this.starWidth = '24px';
15
15
  this.starSelectionAllowed = true;
@@ -1 +1 @@
1
- {"version":3,"file":"mis-crystal-design-system-star-rating.umd.js","sources":["../../../projects/mis-components/star-rating/star-rating.component.ts","../../../projects/mis-components/star-rating/star-rating.module.ts","../../../projects/mis-components/star-rating/mis-crystal-design-system-star-rating.ts"],"sourcesContent":["import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n@Component({\n selector: 'mis-star-rating',\n templateUrl: './star-rating.component.html',\n styleUrls: ['./star-rating.component.scss']\n})\nexport class StarRatingComponent implements OnInit, OnChanges {\n\n @Input() noOfStars: number = 0;\n @Input() selectedRating: number = -1;\n @Input() selectedStarSvg = '';\n @Input() emptyStarSvg = '';\n @Input() starHeight = '24px';\n @Input() starWidth = '24px';\n @Input() starSelectionAllowed = true;\n @Input() starHoverAllowed = true;\n @Output('starRated') starRated: EventEmitter<number> = new EventEmitter();\n\n starData: STAR_DATA[] = [];\n selectedData: STAR_DATA[] = [];\n constructor() { }\n\n ngOnInit(): void {\n if(this.noOfStars > 0){\n this.starData = Array.from({ length: this.noOfStars }, (_, i) => ({\n id: i,\n asset: this.emptyStarSvg,\n hoverId: -1,\n }));\n }\n this.selectedRating = this.selectedRating > this.noOfStars ? this.noOfStars : this.selectedRating; \n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n assetsSelection(index: number = -1){\n this.starData.forEach((item: STAR_DATA) => {\n item.asset = item.id <= index - 1 ? this.selectedStarSvg : this.emptyStarSvg;\n item.hoverId = -1;\n });\n }\n\n starMouseOver(index){\n if (!this.starHoverAllowed) return;\n\n const threshold = this.selectedRating - 1;\n this.starData.forEach(item => {\n item.hoverId = index;\n item.asset = index > threshold && item.id <= index ? this.selectedStarSvg : this.selectedData[item.id].asset;\n });\n\n }\n\n starMouseLeave(){\n if(!this.starHoverAllowed) return;\n\n this.starData = JSON.parse(JSON.stringify(this.selectedData));\n this.assetsSelection(this.selectedRating);\n }\n\n selectedStarData(index: number){\n if(this.starSelectionAllowed){\n this.starRated.emit(index+1)\n }\n }\n\n}\n\nexport interface STAR_DATA {\n id: number,\n asset: string,\n hoverId: number\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { StarRatingComponent } from \"./star-rating.component\";\n\n@NgModule({\n declarations: [StarRatingComponent],\n imports: [CommonModule],\n exports: [StarRatingComponent]\n})\nexport class StarRatingModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["EventEmitter","Component","Input","Output","NgModule","CommonModule"],"mappings":";;;;;;;QAqBE;YAZS,cAAS,GAAW,CAAC,CAAC;YACtB,mBAAc,GAAW,CAAC,CAAC,CAAC;YAC5B,oBAAe,GAAG,EAAE,CAAC;YACrB,iBAAY,GAAG,EAAE,CAAC;YAClB,eAAU,GAAG,MAAM,CAAC;YACpB,cAAS,GAAG,MAAM,CAAC;YACnB,yBAAoB,GAAG,IAAI,CAAC;YAC5B,qBAAgB,GAAG,IAAI,CAAC;YACZ,cAAS,GAAyB,IAAIA,iBAAY,EAAE,CAAC;YAE1E,aAAQ,GAAgB,EAAE,CAAC;YAC3B,iBAAY,GAAgB,EAAE,CAAC;SACd;QAEjB,sCAAQ,GAAR;YAAA,iBAWC;YAVC,IAAG,IAAI,CAAC,SAAS,GAAG,CAAC,EAAC;gBACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,UAAC,CAAC,EAAE,CAAC,IAAK,QAAC;oBAChE,EAAE,EAAE,CAAC;oBACL,KAAK,EAAE,KAAI,CAAC,YAAY;oBACxB,OAAO,EAAE,CAAC,CAAC;iBACZ,IAAC,CAAC,CAAC;aACL;YACD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC;YAClG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC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G,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;YAC9D,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SAC3C;QAED,8CAAgB,GAAhB,UAAiB,KAAa;YAC5B,IAAG,IAAI,CAAC,oBAAoB,EAAC;gBAC3B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,GAAC,CAAC,CAAC,CAAA;aAC7B;SACF;;;;gBApEFC,cAAS,SAAC;oBACT,QAAQ,EAAE,iBAAiB;oBAC3B,+mBAA2C;;iBAE5C;;;;4BAGEC,UAAK;iCACLA,UAAK;kCACLA,UAAK;+BACLA,UAAK;6BACLA,UAAK;4BACLA,UAAK;uCACLA,UAAK;mCACLA,UAAK;4BACLC,WAAM,SAAC,WAAW;;;;QCRrB;;;;;gBALCC,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAACC,mBAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,mBAAmB,CAAC;iBAC/B;;;ICRD;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"mis-crystal-design-system-star-rating.umd.js","sources":["../../../projects/mis-components/star-rating/star-rating.component.ts","../../../projects/mis-components/star-rating/star-rating.module.ts","../../../projects/mis-components/star-rating/mis-crystal-design-system-star-rating.ts"],"sourcesContent":["import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n@Component({\n selector: 'mis-star-rating',\n templateUrl: './star-rating.component.html',\n styleUrls: ['./star-rating.component.scss']\n})\nexport class StarRatingComponent implements OnInit, OnChanges {\n\n @Input() noOfStars: number = 0;\n @Input() selectedRating: number = -1;\n @Input() selectedStarSvg = 'assets/selectedStar.svg';\n @Input() emptyStarSvg = 'assets/star.svg';\n @Input() starHeight = '24px';\n @Input() starWidth = '24px';\n @Input() starSelectionAllowed = true;\n @Input() starHoverAllowed = true;\n @Output('starRated') starRated: EventEmitter<number> = new EventEmitter();\n\n starData: STAR_DATA[] = [];\n selectedData: STAR_DATA[] = [];\n constructor() { }\n\n ngOnInit(): void {\n if(this.noOfStars > 0){\n this.starData = Array.from({ length: this.noOfStars }, (_, i) => ({\n id: i,\n asset: this.emptyStarSvg,\n hoverId: -1,\n }));\n }\n this.selectedRating = this.selectedRating > this.noOfStars ? this.noOfStars : this.selectedRating; \n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n assetsSelection(index: number = -1){\n this.starData.forEach((item: STAR_DATA) => {\n item.asset = item.id <= index - 1 ? this.selectedStarSvg : this.emptyStarSvg;\n item.hoverId = -1;\n });\n }\n\n starMouseOver(index){\n if (!this.starHoverAllowed) return;\n\n const threshold = this.selectedRating - 1;\n this.starData.forEach(item => {\n item.hoverId = index;\n item.asset = index > threshold && item.id <= index ? this.selectedStarSvg : this.selectedData[item.id].asset;\n });\n\n }\n\n starMouseLeave(){\n if(!this.starHoverAllowed) return;\n\n this.starData = JSON.parse(JSON.stringify(this.selectedData));\n this.assetsSelection(this.selectedRating);\n }\n\n selectedStarData(index: number){\n if(this.starSelectionAllowed){\n this.starRated.emit(index+1)\n }\n }\n\n}\n\nexport interface STAR_DATA {\n id: number,\n asset: string,\n hoverId: number\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { StarRatingComponent } from \"./star-rating.component\";\n\n@NgModule({\n declarations: [StarRatingComponent],\n imports: [CommonModule],\n exports: [StarRatingComponent]\n})\nexport class StarRatingModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["EventEmitter","Component","Input","Output","NgModule","CommonModule"],"mappings":";;;;;;;QAqBE;YAZS,cAAS,GAAW,CAAC,CAAC;Y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AAQ,EAAE,iBAAiB;oBAC3B,+mBAA2C;;iBAE5C;;;;4BAGEC,UAAK;iCACLA,UAAK;kCACLA,UAAK;+BACLA,UAAK;6BACLA,UAAK;4BACLA,UAAK;uCACLA,UAAK;mCACLA,UAAK;4BACLC,WAAM,SAAC,WAAW;;;;QCRrB;;;;;gBALCC,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAACC,mBAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,mBAAmB,CAAC;iBAC/B;;;ICRD;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/star-rating",["exports","@angular/common","@angular/core"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["mis-crystal-design-system"]=t["mis-crystal-design-system"]||{},t["mis-crystal-design-system"]["star-rating"]={}),t.ng.common,t.ng.core)}(this,(function(t,e,s){"use strict";var a=function(){function t(){this.noOfStars=0,this.selectedRating=-1,this.selectedStarSvg="",this.emptyStarSvg="",this.starHeight="24px",this.starWidth="24px",this.starSelectionAllowed=!0,this.starHoverAllowed=!0,this.starRated=new s.EventEmitter,this.starData=[],this.selectedData=[]}return t.prototype.ngOnInit=function(){var t=this;this.noOfStars>0&&(this.starData=Array.from({length:this.noOfStars},(function(e,s){return{id:s,asset:t.emptyStarSvg,hoverId:-1}}))),this.selectedRating=this.selectedRating>this.noOfStars?this.noOfStars:this.selectedRating,this.assetsSelection(this.selectedRating),this.selectedData=JSON.parse(JSON.stringify(this.starData))},t.prototype.ngOnChanges=function(t){this.assetsSelection(this.selectedRating),this.selectedData=JSON.parse(JSON.stringify(this.starData))},t.prototype.assetsSelection=function(t){var e=this;void 0===t&&(t=-1),this.starData.forEach((function(s){s.asset=s.id<=t-1?e.selectedStarSvg:e.emptyStarSvg,s.hoverId=-1}))},t.prototype.starMouseOver=function(t){var e=this;if(this.starHoverAllowed){var s=this.selectedRating-1;this.starData.forEach((function(a){a.hoverId=t,a.asset=t>s&&a.id<=t?e.selectedStarSvg:e.selectedData[a.id].asset}))}},t.prototype.starMouseLeave=function(){this.starHoverAllowed&&(this.starData=JSON.parse(JSON.stringify(this.selectedData)),this.assetsSelection(this.selectedRating))},t.prototype.selectedStarData=function(t){this.starSelectionAllowed&&this.starRated.emit(t+1)},t}();a.decorators=[{type:s.Component,args:[{selector:"mis-star-rating",template:'<div class="rating-container" (mouseleave)="starMouseLeave()" [ngStyle]="{\'cursor\': starSelectionAllowed ? \'pointer\' : \'not-allowed\'}">\n <div class="stars-container" *ngFor="let star of starData">\n <div class="star" \n (click)="selectedStarData(star.id)" \n (mouseover)="starMouseOver(star.id)"\n [ngClass]="{\'hoveredStarZoom\': star.id === star.hoverId, \'not-hovered\' : star.hoverId >=0 && star.id > star.hoverId}"\n >\n <img [src]="star.asset" [ngStyle]="{\'height\': starHeight, \'width\': starWidth}">\n </div>\n </div>\n</div>\n',styles:[".rating-container{display:flex;flex-direction:row;gap:12px}.not-hovered{opacity:.6}.hoveredStarZoom{transform:scale(1.2);filter:drop-shadow(0 2px 5px #e79c11);transition:all .3s ease-out}"]}]}],a.ctorParameters=function(){return[]},a.propDecorators={noOfStars:[{type:s.Input}],selectedRating:[{type:s.Input}],selectedStarSvg:[{type:s.Input}],emptyStarSvg:[{type:s.Input}],starHeight:[{type:s.Input}],starWidth:[{type:s.Input}],starSelectionAllowed:[{type:s.Input}],starHoverAllowed:[{type:s.Input}],starRated:[{type:s.Output,args:["starRated"]}]};var r=function(){};r.decorators=[{type:s.NgModule,args:[{declarations:[a],imports:[e.CommonModule],exports:[a]}]}],t.StarRatingComponent=a,t.StarRatingModule=r,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/star-rating",["exports","@angular/common","@angular/core"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["mis-crystal-design-system"]=t["mis-crystal-design-system"]||{},t["mis-crystal-design-system"]["star-rating"]={}),t.ng.common,t.ng.core)}(this,(function(t,e,s){"use strict";var a=function(){function t(){this.noOfStars=0,this.selectedRating=-1,this.selectedStarSvg="assets/selectedStar.svg",this.emptyStarSvg="assets/star.svg",this.starHeight="24px",this.starWidth="24px",this.starSelectionAllowed=!0,this.starHoverAllowed=!0,this.starRated=new s.EventEmitter,this.starData=[],this.selectedData=[]}return t.prototype.ngOnInit=function(){var t=this;this.noOfStars>0&&(this.starData=Array.from({length:this.noOfStars},(function(e,s){return{id:s,asset:t.emptyStarSvg,hoverId:-1}}))),this.selectedRating=this.selectedRating>this.noOfStars?this.noOfStars:this.selectedRating,this.assetsSelection(this.selectedRating),this.selectedData=JSON.parse(JSON.stringify(this.starData))},t.prototype.ngOnChanges=function(t){this.assetsSelection(this.selectedRating),this.selectedData=JSON.parse(JSON.stringify(this.starData))},t.prototype.assetsSelection=function(t){var e=this;void 0===t&&(t=-1),this.starData.forEach((function(s){s.asset=s.id<=t-1?e.selectedStarSvg:e.emptyStarSvg,s.hoverId=-1}))},t.prototype.starMouseOver=function(t){var e=this;if(this.starHoverAllowed){var s=this.selectedRating-1;this.starData.forEach((function(a){a.hoverId=t,a.asset=t>s&&a.id<=t?e.selectedStarSvg:e.selectedData[a.id].asset}))}},t.prototype.starMouseLeave=function(){this.starHoverAllowed&&(this.starData=JSON.parse(JSON.stringify(this.selectedData)),this.assetsSelection(this.selectedRating))},t.prototype.selectedStarData=function(t){this.starSelectionAllowed&&this.starRated.emit(t+1)},t}();a.decorators=[{type:s.Component,args:[{selector:"mis-star-rating",template:'<div class="rating-container" (mouseleave)="starMouseLeave()" [ngStyle]="{\'cursor\': starSelectionAllowed ? \'pointer\' : \'not-allowed\'}">\n <div class="stars-container" *ngFor="let star of starData">\n <div class="star" \n (click)="selectedStarData(star.id)" \n (mouseover)="starMouseOver(star.id)"\n [ngClass]="{\'hoveredStarZoom\': star.id === star.hoverId, \'not-hovered\' : star.hoverId >=0 && star.id > star.hoverId}"\n >\n <img [src]="star.asset" [ngStyle]="{\'height\': starHeight, \'width\': starWidth}">\n </div>\n </div>\n</div>\n',styles:[".rating-container{display:flex;flex-direction:row;gap:12px}.not-hovered{opacity:.6}.hoveredStarZoom{transform:scale(1.2);filter:drop-shadow(0 2px 5px #e79c11);transition:all .3s ease-out}"]}]}],a.ctorParameters=function(){return[]},a.propDecorators={noOfStars:[{type:s.Input}],selectedRating:[{type:s.Input}],selectedStarSvg:[{type:s.Input}],emptyStarSvg:[{type:s.Input}],starHeight:[{type:s.Input}],starWidth:[{type:s.Input}],starSelectionAllowed:[{type:s.Input}],starHoverAllowed:[{type:s.Input}],starRated:[{type:s.Output,args:["starRated"]}]};var r=function(){};r.decorators=[{type:s.NgModule,args:[{declarations:[a],imports:[e.CommonModule],exports:[a]}]}],t.StarRatingComponent=a,t.StarRatingModule=r,Object.defineProperty(t,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=mis-crystal-design-system-star-rating.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../projects/mis-components/star-rating/star-rating.component.ts","../../../projects/mis-components/star-rating/star-rating.module.ts"],"names":["StarRatingComponent","this","noOfStars","selectedRating","selectedStarSvg","emptyStarSvg","starHeight","starWidth","starSelectionAllowed","starHoverAllowed","starRated","EventEmitter","starData","selectedData","prototype","ngOnInit","_this","Array","from","length","_","i","id","asset","hoverId","assetsSelection","JSON","parse","stringify","ngOnChanges","changes","index","forEach","item","starMouseOver","threshold","starMouseLeave","selectedStarData","emit","Component","args","selector","template","Input","Output","NgModule","declarations","imports","CommonModule","exports"],"mappings":"ggBAqBE,SAAAA,IAZSC,KAAAC,UAAoB,EACpBD,KAAAE,gBAA0B,EAC1BF,KAAAG,gBAAkB,GAClBH,KAAAI,aAAe,GACfJ,KAAAK,WAAa,OACbL,KA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C,MAAMD,KAAKE,UAAU3B,KAAKY,eAC/CZ,KAAKwB,gBAAgBxB,KAAKE,kBAG5BH,EAAAc,UAAAuB,iBAAA,SAAiBN,GACZ9B,KAAKO,sBACNP,KAAKS,UAAU4B,KAAKP,EAAM,6BAlE/BQ,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,kBACVC,SAAA,k3BAKCC,EAAAA,8BACAA,EAAAA,+BACAA,EAAAA,4BACAA,EAAAA,0BACAA,EAAAA,yBACAA,EAAAA,oCACAA,EAAAA,gCACAA,EAAAA,yBACAC,EAAAA,OAAMJ,KAAA,CAAC,sBCRV,iCALCK,EAAAA,SAAQL,KAAA,CAAC,CACRM,aAAc,CAAC9C,GACf+C,QAAS,CAACC,EAAAA,cACVC,QAAS,CAACjD","sourcesContent":["import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n@Component({\n selector: 'mis-star-rating',\n templateUrl: './star-rating.component.html',\n styleUrls: ['./star-rating.component.scss']\n})\nexport class StarRatingComponent implements OnInit, OnChanges {\n\n @Input() noOfStars: number = 0;\n @Input() selectedRating: number = -1;\n @Input() selectedStarSvg = '';\n @Input() emptyStarSvg = '';\n @Input() starHeight = '24px';\n @Input() starWidth = '24px';\n @Input() starSelectionAllowed = true;\n @Input() starHoverAllowed = true;\n @Output('starRated') starRated: EventEmitter<number> = new EventEmitter();\n\n starData: STAR_DATA[] = [];\n selectedData: STAR_DATA[] = [];\n constructor() { }\n\n ngOnInit(): void {\n if(this.noOfStars > 0){\n this.starData = Array.from({ length: this.noOfStars }, (_, i) => ({\n id: i,\n asset: this.emptyStarSvg,\n hoverId: -1,\n }));\n }\n this.selectedRating = this.selectedRating > this.noOfStars ? this.noOfStars : this.selectedRating; \n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n assetsSelection(index: number = -1){\n this.starData.forEach((item: STAR_DATA) => {\n item.asset = item.id <= index - 1 ? this.selectedStarSvg : this.emptyStarSvg;\n item.hoverId = -1;\n });\n }\n\n starMouseOver(index){\n if (!this.starHoverAllowed) return;\n\n const threshold = this.selectedRating - 1;\n this.starData.forEach(item => {\n item.hoverId = index;\n item.asset = index > threshold && item.id <= index ? this.selectedStarSvg : this.selectedData[item.id].asset;\n });\n\n }\n\n starMouseLeave(){\n if(!this.starHoverAllowed) return;\n\n this.starData = JSON.parse(JSON.stringify(this.selectedData));\n this.assetsSelection(this.selectedRating);\n }\n\n selectedStarData(index: number){\n if(this.starSelectionAllowed){\n this.starRated.emit(index+1)\n }\n }\n\n}\n\nexport interface STAR_DATA {\n id: number,\n asset: string,\n hoverId: number\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { StarRatingComponent } from \"./star-rating.component\";\n\n@NgModule({\n declarations: [StarRatingComponent],\n imports: [CommonModule],\n exports: [StarRatingComponent]\n})\nexport class StarRatingModule {\n}\n"]}
1
+ {"version":3,"sources":["../../../projects/mis-components/star-rating/star-rating.component.ts","../../../projects/mis-components/star-rating/star-rating.module.ts"],"names":["StarRatingComponent","this","noOfStars","selectedRating","selectedStarSvg","emptyStarSvg","starHeight","starWidth","starSelectionAllowed","starHoverAllowed","starRated","EventEmitter","starData","selectedData","prototype","ngOnInit","_this","Array","from","length","_","i","id","asset","hoverId","assetsSelection","JSON","parse","stringify","ngOnChanges","changes","index","forEach","item","starMouseOver","threshold","starMouseLeave","selectedStarData","emit","Component","args","selector","template","Input","Output","NgModule","declarations","imports","CommonModule","exports"],"mappings":"ggBAqBE,SAAAA,IAZSC,KAAAC,UAAoB,EACpBD,KAAAE,gBAA0B,EAC1BF,KAAAG,gBAAkB,0BAClBH,KAAAI,aAAe,kBACfJ,KAAAK,WAAa,OACbL,KAAAM,UAAY,OACZN,KAAAO,sBAAuB,EACvBP,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,KAAKwB,gBAAgBxB,KAAKE,kBAG5BH,EAAAc,UAAAuB,iBAAA,SAAiBN,GACZ9B,KAAKO,sBACNP,KAAKS,UAAU4B,KAAKP,EAAM,6BAlE/BQ,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,kBACVC,SAAA,k3BAKCC,EAAAA,8BACAA,EAAAA,+BACAA,EAAAA,4BACAA,EAAAA,0BACAA,EAAAA,yBACAA,EAAAA,oCACAA,EAAAA,gCACAA,EAAAA,yBACAC,EAAAA,OAAMJ,KAAA,CAAC,sBCRV,iCALCK,EAAAA,SAAQL,KAAA,CAAC,CACRM,aAAc,CAAC9C,GACf+C,QAAS,CAACC,EAAAA,cACVC,QAAS,CAACjD","sourcesContent":["import { Component, OnInit, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';\n\n@Component({\n selector: 'mis-star-rating',\n templateUrl: './star-rating.component.html',\n styleUrls: ['./star-rating.component.scss']\n})\nexport class StarRatingComponent implements OnInit, OnChanges {\n\n @Input() noOfStars: number = 0;\n @Input() selectedRating: number = -1;\n @Input() selectedStarSvg = 'assets/selectedStar.svg';\n @Input() emptyStarSvg = 'assets/star.svg';\n @Input() starHeight = '24px';\n @Input() starWidth = '24px';\n @Input() starSelectionAllowed = true;\n @Input() starHoverAllowed = true;\n @Output('starRated') starRated: EventEmitter<number> = new EventEmitter();\n\n starData: STAR_DATA[] = [];\n selectedData: STAR_DATA[] = [];\n constructor() { }\n\n ngOnInit(): void {\n if(this.noOfStars > 0){\n this.starData = Array.from({ length: this.noOfStars }, (_, i) => ({\n id: i,\n asset: this.emptyStarSvg,\n hoverId: -1,\n }));\n }\n this.selectedRating = this.selectedRating > this.noOfStars ? this.noOfStars : this.selectedRating; \n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.assetsSelection(this.selectedRating);\n this.selectedData = JSON.parse(JSON.stringify(this.starData));\n }\n\n assetsSelection(index: number = -1){\n this.starData.forEach((item: STAR_DATA) => {\n item.asset = item.id <= index - 1 ? this.selectedStarSvg : this.emptyStarSvg;\n item.hoverId = -1;\n });\n }\n\n starMouseOver(index){\n if (!this.starHoverAllowed) return;\n\n const threshold = this.selectedRating - 1;\n this.starData.forEach(item => {\n item.hoverId = index;\n item.asset = index > threshold && item.id <= index ? this.selectedStarSvg : this.selectedData[item.id].asset;\n });\n\n }\n\n starMouseLeave(){\n if(!this.starHoverAllowed) return;\n\n this.starData = JSON.parse(JSON.stringify(this.selectedData));\n this.assetsSelection(this.selectedRating);\n }\n\n selectedStarData(index: number){\n if(this.starSelectionAllowed){\n this.starRated.emit(index+1)\n }\n }\n\n}\n\nexport interface STAR_DATA {\n id: number,\n asset: string,\n hoverId: number\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { StarRatingComponent } from \"./star-rating.component\";\n\n@NgModule({\n declarations: [StarRatingComponent],\n imports: [CommonModule],\n exports: [StarRatingComponent]\n})\nexport class StarRatingModule {\n}\n"]}