-
Notifications
You must be signed in to change notification settings - Fork 1
/
src_app_custom-elements_events_event-list_module_ts.0250c264ec889be1.js.map
1 lines (1 loc) · 11.7 KB
/
src_app_custom-elements_events_event-list_module_ts.0250c264ec889be1.js.map
1
{"version":3,"file":"src_app_custom-elements_events_event-list_module_ts.0250c264ec889be1.js","mappings":"gPAOA,MAAMA,EAAaC,KAAqB,cAGjC,IAAMC,EAAY,UAAAC,EAAnB,MAAOD,EAMTE,YAAoBC,GAAAC,KAAAD,OAChB,MAAME,EAAM,IAAIC,KAEhBF,KAAKG,YAAc,IAAID,KAAKA,KAAKE,IAAIH,EAAII,cAAeJ,EAAIK,WAAYL,EAAIM,YAC5EP,KAAKQ,QAAUR,KAAKS,YACpBT,KAAKU,gBAAkBV,KAAKQ,QAAQG,QAChCC,KAAIC,GACAA,EAAOC,OAAOC,GAASA,EAAMC,SAAWhB,KAAKG,eAGrDH,KAAKiB,YAAcjB,KAAKQ,QAAQG,QAC5BC,KAAIC,GACAA,EAAOC,OAAOC,GAASA,EAAMC,QAAUhB,KAAKG,cAGxD,CAKQM,YACJ,MAAMI,EAASb,KAAKD,KAAKmB,IAAqBxB,GAAYiB,QACtDC,KAAIO,GACAA,EAAeP,IAAIQ,QAERA,EACHC,UAAWD,EAAcC,UAAY,IAAInB,KAAKkB,EAAcC,gBAAaC,EACzEN,QAAS,IAAId,KAAKkB,EAAcJ,cAGtC,EAENO,QAGHV,SAA0CW,UACpCX,CACX,WA3CSjB,0CAAY6B,MAAAC,MAAA,4BAAZ9B,EAAY+B,QAAZ/B,EAAYgC,YAAZhC,CAAY,KCEZiC,EAAkB,UAAAC,EAAzB,MAAOD,EACTE,UAAUhB,GACN,MAAMM,EAAYN,EAAMM,UAClBL,EAAUD,EAAMC,QACtB,OAAKK,GAAaA,EAAUW,YAAchB,EAAQgB,UAG1C1B,EAASe,KAAef,EAASU,IAAYiB,EAAQZ,KAAeY,EAAQjB,GACrEV,EAASe,GACpB,IAAMa,EAAOb,GAAa,MAAQ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,KAAAA,MAAA,MAAAqC,EAAA7C,aAAA,+DASrBoC,CAAkB,KC/BlBY,EAAe,UAAAC,EAAtB,MAAOD,EALbnE,cAMIE,KAAAmE,uBAAoCd,YAD3BY,yCAAe,0BAAfA,iCAFE,CAACrE,GAAawE,QAAA,CAFfC,QAIDJ,CAAe","names":["eventsPath","CONTENT_URL_PREFIX","EventService","_EventService","constructor","http","this","now","Date","currentDate","UTC","getFullYear","getMonth","getDate","events$","getEvents","upcomingEvents$","pipe","map","events","filter","event","endDate","pastEvents$","get","eventResponses","eventResponse","startDate","undefined","publishLast","connect","i0","i1","factory","ɵfac","EventDateRangePipe","_EventDateRangePipe","transform","getTime","getYear","getDay","getDateString","pure","date","getUTCDate","months","getUTCMonth","getUTCFullYear","EventOrderByPipe","_EventOrderByPipe","orderBy","sort","eventOne","eventTwo","upcomingEvent_r2","url","name","location","pastEvent_r3","EventListComponent","_EventListComponent","eventService","selectors","decls","vars","consts","template","rf","ctx","EventListComponent_tr_12_Template","EventListComponent_tr_27_Template","EventListModule","_EventListModule","customElementComponent","imports","CommonModule"],"sourceRoot":"webpack:///","sources":["./src/app/custom-elements/events/event.service.ts","./src/app/custom-elements/events/event-date-range.pipe.ts","./src/app/custom-elements/events/event-order-by.pipe.ts","./src/app/custom-elements/events/event-list.component.ts","./src/app/custom-elements/events/event-list.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { ConnectableObservable, Observable } from 'rxjs';\nimport { publishLast, map } from 'rxjs/operators';\nimport { CONTENT_URL_PREFIX } from 'app/documents/document.service';\nimport { EventResponse, Event } from './event.model';\n\nconst eventsPath = CONTENT_URL_PREFIX + 'events.json';\n\n@Injectable()\nexport class EventService {\n currentDate: Date;\n private events$: Observable<Event[]>;\n upcomingEvents$: Observable<Event[]>;\n pastEvents$: Observable<Event[]>;\n\n constructor(private http: HttpClient) {\n const now = new Date();\n // Compare soley on UTC date, without factoring in time.\n this.currentDate = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()));\n this.events$ = this.getEvents();\n this.upcomingEvents$ = this.events$.pipe(\n map(events =>\n events.filter(event => event.endDate >= this.currentDate)\n )\n );\n this.pastEvents$ = this.events$.pipe(\n map(events =>\n events.filter(event => event.endDate < this.currentDate)\n )\n );\n }\n\n /**\n * Fetch Event JSON from file and return an Observable that emits an Event array.\n */\n private getEvents(): Observable<Event[]> {\n const events = this.http.get<EventResponse[]>(eventsPath).pipe(\n map(eventResponses =>\n eventResponses.map(eventResponse => {\n const event: Event = {\n ...eventResponse,\n startDate: eventResponse.startDate ? new Date(eventResponse.startDate) : undefined,\n endDate: new Date(eventResponse.endDate)\n };\n return event;\n })\n ),\n publishLast(),\n );\n\n (events as ConnectableObservable<Event[]>).connect();\n return events;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Event } from './event.model';\n\n/**\n * Transforms the startDate and endDate for a given event into a dange range string.\n * undefined until '01-01-2019' -> 'January 1, 2019'\n * '01-01-2019' until '01-01-2019' -> 'January 1, 2019'\n * '01-01-2019' until '01-02-2019' -> 'January 1 - 2, 2019'\n * '01-28-2019' until '02-01-2019' -> 'January 28 - February 1, 2019'\n * '12-31-2018' until '01-01-2019' -> 'December 31, 2018 - January 1, 2019'\n */\n@Pipe({name: 'eventDateRange'})\nexport class EventDateRangePipe implements PipeTransform {\n transform(event: Event): string {\n const startDate = event.startDate;\n const endDate = event.endDate;\n if (!startDate || startDate.getTime() === endDate.getTime()) {\n return getDateString(endDate);\n } else {\n if (getMonth(startDate) === getMonth(endDate) && getYear(startDate) === getYear(endDate)) {\n return getMonth(startDate)\n + ' ' + getDay(startDate) + ' - ' + getDay(endDate)\n + ', ' + getYear(startDate);\n } else if (getYear(startDate) === getYear(endDate)) {\n return getMonth(startDate)\n + ' ' + getDay(startDate)\n + ' - ' + getMonth(endDate)\n + ' ' + getDay(endDate)\n + ', ' + getYear(startDate);\n } else {\n return getDateString(startDate)\n + ' - ' + getDateString(endDate);\n }\n }\n }\n}\n\nconst getDay = (date: Date) => date.getUTCDate();\nconst getMonth = (date: Date) => months[date.getUTCMonth()];\nconst getYear = (date: Date) => date.getUTCFullYear();\nconst getDateString = (date: Date) => getMonth(date) + ' ' + getDay(date) + ', ' + getYear(date);\nconst months = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n];\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Event } from './event.model';\n\ntype EventOrderBy = 'ascending' | 'descending';\n\n/**\n * Transforms the events to sorted ascending or descending order by date.\n * If an event has a startDate, order based on it. If not, use it's endDate.\n */\n@Pipe({name: 'eventOrderBy'})\nexport class EventOrderByPipe implements PipeTransform {\n transform(events: Event[] | null, orderBy: EventOrderBy): Event[] {\n if (events === null) {\n return [];\n }\n switch (orderBy) {\n case 'ascending': {\n return events.sort((eventOne, eventTwo) => +(eventOne.startDate || eventOne.endDate) - +(eventTwo.startDate || eventTwo.endDate));\n }\n case 'descending': {\n return events.sort((eventOne, eventTwo) => +(eventTwo.startDate || eventTwo.endDate) - +(eventOne.startDate || eventOne.endDate));\n }\n }\n }\n}\n","import { Component } from '@angular/core';\nimport { Event } from './event.model';\nimport { EventService } from './event.service';\nimport { Observable } from 'rxjs';\n\n@Component({\n selector: 'aio-event-list',\n template: `\n <p>Upcoming Events presenting about NgRx:</p>\n <table class=\"is-full-width\">\n <thead>\n <tr>\n <th>Event</th>\n <th>Location</th>\n <th>Date</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let upcomingEvent of upcomingEvents$ | async | eventOrderBy:'ascending'\">\n <th><a [href]=\"upcomingEvent.url\" [title]=\"upcomingEvent.name\">{{upcomingEvent.name}}</a></th>\n <td>{{upcomingEvent.location}}</td>\n <td>{{upcomingEvent | eventDateRange}}</td>\n </tr>\n </tbody>\n </table>\n <p>Past Events:</p>\n <table class=\"is-full-width\">\n <thead>\n <tr>\n <th>Event</th>\n <th>Location</th>\n <th>Date</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let pastEvent of pastEvents$ | async | eventOrderBy:'descending'\">\n <th><a [href]=\"pastEvent.url\" [title]=\"pastEvent.name\">{{pastEvent.name}}</a></th>\n <td>{{pastEvent.location}}</td>\n <td>{{pastEvent | eventDateRange}}</td>\n </tr>\n </tbody>\n </table>\n`\n})\nexport class EventListComponent {\n upcomingEvents$: Observable<Event[]> = this.eventService.upcomingEvents$;\n pastEvents$: Observable<Event[]> = this.eventService.pastEvents$;\n\n constructor(private eventService: EventService) { }\n}\n","import { NgModule, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { WithCustomElementComponent } from '../element-registry';\nimport { EventListComponent } from './event-list.component';\nimport { EventService } from './event.service';\nimport { EventDateRangePipe } from './event-date-range.pipe';\nimport { EventOrderByPipe } from './event-order-by.pipe';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [EventListComponent, EventDateRangePipe, EventOrderByPipe],\n providers: [EventService],\n})\nexport class EventListModule implements WithCustomElementComponent {\n customElementComponent: Type<any> = EventListComponent;\n}\n"],"x_google_ignoreList":[]}