@sedeh/into-pipes
Version:
Have you ever wanted to transform data in different parts of your application into interactive objects without writing a single line of code?
1 lines • 358 kB
Source Map (JSON)
{"version":3,"file":"sedeh-into-pipes.mjs","sources":["../../../projects/into-pipes/src/lib/address/address.component.ts","../../../projects/into-pipes/src/lib/address/address.pipe.ts","../../../projects/into-pipes/src/lib/common/component.pool.ts","../../../projects/into-pipes/src/lib/address/addess-pipe.module.ts","../../../projects/into-pipes/src/lib/audio/audio.component.ts","../../../projects/into-pipes/src/lib/audio/audio.pipe.ts","../../../projects/into-pipes/src/lib/audio/audio-pipe.module.ts","../../../projects/into-pipes/src/lib/calendar/calendar.component.ts","../../../projects/into-pipes/src/lib/calendar/calendar-pipe.module.ts","../../../projects/into-pipes/src/lib/checkbox/checkbox.component.ts","../../../projects/into-pipes/src/lib/checkbox/checkbox-pipe.module.ts","../../../projects/into-pipes/src/lib/email/email.component.ts","../../../projects/into-pipes/src/lib/email/email.pipe.ts","../../../projects/into-pipes/src/lib/email/email-pipe.module.ts","../../../projects/into-pipes/src/lib/font/font.component.ts","../../../projects/into-pipes/src/lib/font/font.pipe.ts","../../../projects/into-pipes/src/lib/font/font-pipe.module.ts","../../../projects/into-pipes/src/lib/image/image.component.ts","../../../projects/into-pipes/src/lib/image/image.pipe.ts","../../../projects/into-pipes/src/lib/image/image-pipe.module.ts","../../../projects/into-pipes/src/lib/common/into.pipe.ts","../../../projects/into-pipes/src/lib/input/input.component.ts","../../../projects/into-pipes/src/lib/common/append.pipe.ts","../../../projects/into-pipes/src/lib/common/conditional.pipe.ts","../../../projects/into-pipes/src/lib/common/join.pipe.ts","../../../projects/into-pipes/src/lib/common/map.pipe.ts","../../../projects/into-pipes/src/lib/common/mask.pipe.ts","../../../projects/into-pipes/src/lib/common/prepend.pipe.ts","../../../projects/into-pipes/src/lib/common/sanitizeHtml.pipe.ts","../../../projects/into-pipes/src/lib/common/valueof.pipe.ts","../../../projects/into-pipes/src/lib/common/wrap.pipe.ts","../../../projects/into-pipes/src/lib/common/into.directive.ts","../../../projects/into-pipes/src/lib/common/common-pipes.module.ts","../../../projects/into-pipes/src/lib/input/input-pipe.module.ts","../../../projects/into-pipes/src/lib/inputgroup/input-group.component.ts","../../../projects/into-pipes/src/lib/inputgroup/inputgroup-pipe.module.ts","../../../projects/into-pipes/src/lib/json/json.component.ts","../../../projects/into-pipes/src/lib/json/json-pipe.module.ts","../../../projects/into-pipes/src/lib/lastupdate/lastupdate.component.ts","../../../projects/into-pipes/src/lib/lastupdate/lastupdate-pipe.module.ts","../../../projects/into-pipes/src/lib/like/like.component.ts","../../../projects/into-pipes/src/lib/like/like-pipe.module.ts","../../../projects/into-pipes/src/lib/link/link.component.ts","../../../projects/into-pipes/src/lib/link/link.pipe.ts","../../../projects/into-pipes/src/lib/link/link-pipe.module.ts","../../../projects/into-pipes/src/lib/phone/phone.component.ts","../../../projects/into-pipes/src/lib/phone/phone.pipe.ts","../../../projects/into-pipes/src/lib/phone/phone-pipe.module.ts","../../../projects/into-pipes/src/lib/rating/rating.component.ts","../../../projects/into-pipes/src/lib/rating/rating.pipe.ts","../../../projects/into-pipes/src/lib/rating/rating-pipe.module.ts","../../../projects/into-pipes/src/lib/notice/notice.component.ts","../../../projects/into-pipes/src/lib/notice/notice.pipe.ts","../../../projects/into-pipes/src/lib/notice/notice-pipe.module.ts","../../../projects/into-pipes/src/lib/select/select.component.ts","../../../projects/into-pipes/src/lib/select/select-pipe.module.ts","../../../projects/into-pipes/src/lib/share/share.component.ts","../../../projects/into-pipes/src/lib/share/share-pipe.module.ts","../../../projects/into-pipes/src/lib/span/span.component.ts","../../../projects/into-pipes/src/lib/span/span-pipe.module.ts","../../../projects/into-pipes/src/lib/switch/switch.component.ts","../../../projects/into-pipes/src/lib/switch/switch-pipe.module.ts","../../../projects/into-pipes/src/lib/slider/slider.component.ts","../../../projects/into-pipes/src/lib/slider/slider-pipe.module.ts","../../../projects/into-pipes/src/lib/table/table.component.ts","../../../projects/into-pipes/src/lib/table/table.pipe.ts","../../../projects/into-pipes/src/lib/table/table-pipe.module.ts","../../../projects/into-pipes/src/lib/text/text.component.ts","../../../projects/into-pipes/src/lib/text/text-pipe.module.ts","../../../projects/into-pipes/src/lib/toggler/toggler.component.ts","../../../projects/into-pipes/src/lib/toggler/toggler-pipe.module.ts","../../../projects/into-pipes/src/lib/video/video.component.ts","../../../projects/into-pipes/src/lib/video/video.pipe.ts","../../../projects/into-pipes/src/lib/video/video-pipe.module.ts","../../../projects/into-pipes/src/lib/pipe.module.ts","../../../projects/into-pipes/src/public-api.ts","../../../projects/into-pipes/src/sedeh-into-pipes.ts"],"sourcesContent":["import { Component, EventEmitter } from '@angular/core';\r\nimport { PipeComponentInterface } from '../common/pipe.component.interface';\r\n\r\n@Component({\r\n selector: 'address-component',\r\n template: `\r\n <a *ngIf=\"isLink\" \r\n [href]=\"disabled ? null : url\" \r\n [target]=\"!disabled && hasTarget ? '_blank' : null\"\r\n class=\"google-map {{disabled ? 'disabled':''}}\" \r\n tabindex=\"{{active ? 0 : -1}}\"\r\n (keyup)='keyup($event)' \r\n (click)=\"change($event)\">\r\n <span class=\"fa fa-map-marker\" aria-hidden=\"true\"></span>\r\n <span class=\"off-screen\">View in google map</span>\r\n <span class=\"address\" [textContent]=\"addr1\"></span>\r\n <span class=\"address\" [textContent]=\"addr2\"></span>\r\n </a>\r\n <span *ngIf=\"!isLink\" class=\"google-map\">\r\n <span class=\"fa fa-map-marker\" aria-hidden=\"true\"></span>\r\n <span class=\"address\" [textContent]=\"addr1\"></span>\r\n <span class=\"address\" [textContent]=\"addr2\"></span>\r\n </span>\r\n `,\r\n styles: [\r\n `:host .address {float: left;margin-right: var(--sedeh-margin-right,5px);}\r\n :host .google-map {float: left;text-decoration: none;margin-right: var(--sedeh-margin-right,5px);}\r\n :host .fa {float:left;margin: var(--sedeh-margin, 0 5px);}\r\n :host .off-screen {position: absolute;left: -999em;}\r\n :host a:hover, a:hover .fa-map-marker{opacity: var(--sedeh-hover-opacity, 0.5);}\r\n :host a:focus {outline: none}\r\n :host a:focus .fa{zoom: 1.1;right: var(--sedeh-shift-right, 0);position: relative;color: var(--sedeh-focus-color, darkblue);}\r\n :host a.disabled:hover .fa-map-marker{color: var(--sedeh-disabled-color, #888);}\r\n :host a.disabled{color: var(--sedeh-disabled-color,#888);cursor:default;text-decoration: none;}\r\n :host span{float: left;}\r\n :host {display: table;float:left;min-height: var(--sedeh-min-height, 25px)}\r\n @media print {\r\n :host {\r\n text-decoration: none;\r\n }\r\n :host .fa-map-marker {display: none;}\r\n }\r\n `\r\n ]\r\n})\r\nexport class AddressComponent implements PipeComponentInterface {\r\n url!: string;\r\n source!: string;\r\n id!: string;\r\n isLink!: boolean;\r\n\tname!: string;\r\n addr1!: string;\r\n addr2!: string;\r\n hasTarget!: boolean;\r\n disabled = false;\r\n active = true;\r\n validate = (item: any, newValue: any) => true;\r\n\r\n\tonIntoComponentChange = new EventEmitter();\r\n\r\n static settingsPatterns() {\r\n return ['address:true:false', 'address:true:true']; //link, target\r\n }\r\n transform(source: any, data: any, args: any[]) {\r\n this.source= source;\r\n this.isLink= (args && args.length && args[0].length) ? args[0]=== 'true' : true;\r\n this.hasTarget = (args && args.length > 1 && args[1].length) ? args[1] === 'true' : false;\r\n this.addr1 = source.street + ', ' + source.suite;\r\n this.addr2 = source.city + ', ' + source.zipcode;\r\n\r\n if (this.isLink) {\r\n const x = \"https://maps.google.com/?q=\" + source.street + \", \" + this.addr2 +\"&ie=UTF-8\";\r\n this.url = x.replace(\"\\\\s+\", \"+\");\r\n }\r\n }\r\n keyup(event: any) {\r\n const code = event.which;\r\n event.stopPropagation();\r\n event.preventDefault();\r\n \r\n if (code === 13 && !this.disabled) {\r\n event.target.click();\r\n }\r\n }\r\n change(event: any) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n if (!this.disabled) {\r\n this.onIntoComponentChange.emit({\r\n id: this.id,\r\n name: this.name,\r\n value: this.source,\r\n item: event.type\r\n });\r\n }\r\n }\r\n}\r\n","/*\r\n* Defines a filter to convert url into an address display.\r\n*/\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({ name: 'address' })\r\nexport class AddressPipe implements PipeTransform {\r\n static transformationMethod() {\r\n const x = function (content: any, args: string[], callback?: any, data?: any) {\r\n return new AddressPipe().transform(content, args.length > 1 ? args[1]==='true' : true); \r\n };\r\n return x;\r\n }\r\n transform(source: any, ...args: any[]): any {\r\n const isLink= args.length ? args[0] : true;\r\n const hasTarget = args.length > 1 ? args[1] : false;\r\n if ((typeof source === \"string\") || !(source instanceof Array)) {\r\n return this.addressFromString(source, isLink, hasTarget);\r\n } else {\r\n const result: any[] = [];\r\n source.map((item) => {\r\n result.push(this.addressFromString(item, isLink, hasTarget));\r\n });\r\n return result;\r\n }\r\n }\r\n private addressFromString(source: any, isLink: boolean, hasTarget: boolean) {\r\n if (isLink) {\r\n let url = \"https://maps.google.com/?q=\" + \r\n source.street + \", \" + source.city + \", \" + source.zipcode +\"&ie=UTF-8\";\r\n url = url.replace(\"\\\\s+\", \"+\");\r\n\r\n return \"<a href=\\'\" + url + \"\\' \" + \r\n (hasTarget ? \"target='_blank'\" : \"\") + \r\n \"class='google-map'><span class='fa fa-map-marker' aria-hidden='true'>\" +\r\n \"</span><span class='off-screen'>View in google map</span><span class='address'>\" +\r\n source.street + \", \" + source.suite + \"</span>\" +\r\n \"<span class='address'> \" + source.city +\", \" + source.zipcode + \"</span></a>\";\r\n }\r\n return \"<span class='google-map'><span class='fa fa-map-marker' style='margin: 0 5px' aria-hidden='true'>\" +\r\n \"</span><span class='address'>\" + source.street + \", \" + source.suite + \"</span>\" +\r\n \"<span class='address'> \" + source.city +\", \" + source.zipcode + \"</span></span>\";\r\n }\r\n}\r\n","\nimport {\n\tInjectable, \n\tComponentRef, \n\tViewContainerRef,\n\tEmbeddedViewRef\n} from '@angular/core';\n\nimport { PipeComponentInterface } from './pipe.component.interface';\n\n@Injectable()\nexport class ComponentPool {\n\tprivate registeredPipes: any= {};\n\tprivate registeredComponents: any= {};\n\tprivate registeredServices: any= {};\n\tprivate registeredPatterns:any = {};\n\n\tgetRegisteredPatterns() {\n\t\treturn this.registeredPatterns;\n\t}\n\tregisterPipeTransformation (name: string, pipe: any) {\n\t\tthis.registeredPipes[name] = pipe;\n\t\tif (!this.registeredPatterns[name]) {\n\t\t\tthis.registeredPatterns[name] = name;\n\t\t}\n\t}\n\tregisteredForPipeTransformationNamed(key: string) {\n\t\treturn this.registeredPipes[key] !== undefined;\n\t}\n\tregisteredPipeTransformation(key: string, content: any, args: string[], callback?: any, data?: any) {\n const pipe = this.registeredPipes[key];\n \n return pipe ? pipe(content, args, callback, data) : null;\n\t}\n\tremovePipeTransformation (key: string) {\n\t\tdelete this.registeredPipes[key];\n\n\t\tconst v = this.registeredPatterns[key];\n\t\tif ( v === key) {\n\t\t\tdelete this.registeredPatterns[key];\n\t\t}\n\t}\n\n\tregisterComponent (name: string, component: any) {\n\t\tthis.registeredComponents[name] = component;\n\t\tthis.registeredPatterns[name] = component.settingsPatterns()\n\t}\n\tregisteredForComponentWithNamed(name: string) {\n\t\treturn this.registeredComponents[name] !== undefined;\n\t}\n\tregisteredComponent(\n\t\tname: string,\n\t\tviewRefrence: ViewContainerRef,\n\t\tel: HTMLElement): PipeComponentInterface {\n\t\tconst component = name ? this.registeredComponents[name] : undefined;\n\t\tlet result!: PipeComponentInterface;\n\t\t\n if (component) {\n\t\t\tconst componentRef: ComponentRef<any> = viewRefrence.createComponent(component);\n\t\t\tconst domElem = (componentRef.hostView as EmbeddedViewRef < any > ).rootNodes[0] as HTMLElement;\n\t\t\tel.appendChild(domElem);\n\t\t\tdomElem.setAttribute(\"class\", \"into\");\n\t\t\tresult = (<PipeComponentInterface>componentRef.instance);\n }\n return result;\n\t}\n\tremoveComponent (name: string) {\n\t\tdelete this.registeredComponents[name];\n\t\tdelete this.registeredPatterns[name];\n\t}\n\n\tregisterServiceForComponent (name: string, service: any) {\n\t\tthis.registeredServices[name] = service;\n\t}\n\tregisteredServiceForComponent(name: string): any {\n\t\treturn this.registeredServices[name];\n\t}\n\tregisteredForServiceNamed(name: string) {\n\t\treturn this.registeredServices[name] !== undefined;\n\t}\n\tremoveServiceForComponent (name: string) {\n\t\tdelete this.registeredServices[name];\n\t}\n}","import { NgModule, ModuleWithProviders, Inject, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { AddressComponent } from './address.component';\r\nimport { AddressPipe } from './address.pipe';\r\nimport { ComponentPool } from '../common/component.pool';\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [AddressComponent, AddressPipe],\r\n exports: [AddressComponent, AddressPipe],\r\n entryComponents: [AddressComponent],\r\n schemas: [CUSTOM_ELEMENTS_SCHEMA]\r\n})\r\n\r\nexport class AddressIntoPipeModule {\r\n static forRoot(): ModuleWithProviders<any> {\r\n return {\r\n ngModule: AddressIntoPipeModule,\r\n providers: [\r\n AddressPipe\r\n ]\r\n }\r\n }\r\n constructor(@Inject(ComponentPool) pool: ComponentPool) {\r\n pool.registerComponent('address', AddressComponent);\r\n pool.registerPipeTransformation('address', AddressPipe.transformationMethod());\r\n }\r\n}\r\n","import { Component, EventEmitter } from '@angular/core';\r\nimport { PipeComponentInterface } from '../common/pipe.component.interface';\r\n\r\n@Component({\r\n selector: 'audio-component',\r\n template: `\r\n <span class=\"audio-hidden\" [innerText]=\"source\"></span>\r\n <audio [src]=\"source\" \r\n tabindex=\"{{active ? 0 : -1}}\"\r\n [class.disabled]=\"disabled\"\r\n (keyup)=\"keyup($event)\"\r\n (play)=\"change($event)\"\r\n (ended)=\"change($event)\"\r\n (pause)=\"change($event)\"\r\n (seeked)=\"change($event)\"\r\n (error)=\"change($event)\"\r\n controls=\"true\">Your browser does not support the audio element.</audio>`,\r\n styles: [`\r\n :host {display: table;float: left;min-height: var(--sedeh-min-height, 25px);}\r\n :host audio.disabled{color: var(--sedeh-disabled-color, #888); opacity: var(--sedeh-hover-opacity, 0.5);pointer-events: none}\r\n :host .audio-hidden {\r\n display: none;\r\n }\r\n `]\r\n})\r\nexport class AudioComponent implements PipeComponentInterface {\r\n source!: string;\r\n\tid!: string;\r\n\tname!: string;\r\n disabled = false;\r\n active = true;\r\n validate = (item: any, newValue: any) => true;\r\n\r\n\tonIntoComponentChange = new EventEmitter();\r\n\r\n static settingsPatterns() {\r\n return ['audio']; // no arguments\r\n }\r\n transform(source: any, data: any, args: any[]) {\r\n this.source = source;\r\n }\r\n\r\n private isPlaying(audio: any) {\r\n return !!(audio.currentTime > 0 && !audio.paused && !audio.ended && audio.readyState > 2);\r\n }\r\n keyup(event: any) {\r\n const code = event.which;\r\n if (code === 13 && !this.disabled) {\r\n if (this.isPlaying(event.target)) {\r\n event.target.pause();\r\n } else {\r\n event.target.play();\r\n }\r\n }\r\n }\r\n change(event: any) {\r\n this.onIntoComponentChange.emit({\r\n id: this.id,\r\n name: this.name,\r\n value: this.source,\r\n type: event.type,\r\n item: {\r\n autoplay: event.target.autoplay,\r\n controls: event.target.controls,\r\n duration: event.target.duration,\r\n currentTime: event.target.currentTime,\r\n ended: event.target.ended,\r\n error: event.target.error,\r\n paused: event.target.paused,\r\n muted: event.target.muted,\r\n defaultMuted: event.target.defaultMuted,\r\n volume: event.target.volume\r\n }\r\n });\r\n }\r\n}\r\n","/*\r\n* Defines a filter to convert url into an image display. \r\n* if transforming object is an array, all elements in the array will be transformed and the resulting array will be returned.\r\n*/\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({ name: 'audio' })\r\nexport class AudioPipe implements PipeTransform {\r\n static transformationMethod() {\r\n const x = function (content: any, args: string[], callback?: any, data?: any) {\r\n return new AudioPipe().transform(content, args.length > 1 ? args[1]==='true' : true); \r\n };\r\n return x;\r\n }\r\n\r\n stringToAudio(source: any) {\r\n return \"<audio src=\\'\"+source+\"\\' controls=\\'true\\' />\";\r\n }\r\n arrayToAudio(sources: any) {\r\n const result: any[] = [];\r\n sources.map((source: any) => {\r\n result.push(this.stringToAudio(source));\r\n });\r\n return result;\r\n }\r\n transform(source: any, ...args: any[]): any {\r\n if ((typeof source === \"string\") || !(source instanceof Array)) {\r\n return this.stringToAudio(source);\r\n }\r\n return this.arrayToAudio(source);\r\n }\r\n}\r\n","import { NgModule, ModuleWithProviders, Inject, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { AudioComponent } from './audio.component';\r\nimport { AudioPipe } from './audio.pipe';\r\nimport { ComponentPool } from '../common/component.pool';\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [AudioComponent, AudioPipe],\r\n exports: [AudioComponent, AudioPipe],\r\n entryComponents: [AudioComponent],\r\n schemas: [CUSTOM_ELEMENTS_SCHEMA]\r\n})\r\n\r\nexport class AudioIntoPipeModule {\r\n static forRoot(): ModuleWithProviders<any> {\r\n return {\r\n ngModule: AudioIntoPipeModule,\r\n providers: [\r\n AudioPipe\r\n ]\r\n }\r\n }\r\n constructor(@Inject(ComponentPool) pool: ComponentPool) {\r\n pool.registerComponent('audio', AudioComponent);\r\n pool.registerPipeTransformation('audio', AudioPipe.transformationMethod());\r\n }\r\n}\r\n","/* calendar code is copied from \"ben tedder\" \r\n* http://www.bentedder.com/create-calendar-grid-component-angular-4/\r\n*/\r\nimport { Component, ViewChild, Renderer2, Output, EventEmitter } from '@angular/core';\r\nimport { PipeComponentInterface } from '../common/pipe.component.interface';\r\n\r\nexport interface CalendarDateInterface {\r\n date: Date;\r\n selected?: boolean;\r\n today?: boolean;\r\n }\r\n \r\n@Component({\r\n selector: 'calendar-component',\r\n template: `\r\n <span class=\"calendar-box\">\r\n <span class=\"date\" [textContent]=\"origDate | date:formatting\"></span>\r\n <a \r\n tabindex=\"{{active ? 0 : -1}}\" \r\n class=\"popper {{disabled ? 'disabled': ''}}\" \r\n (keyup)=\"keyup($event)\" \r\n (click)=\"popdatepicker($event)\">\r\n <span class=\"fa fa-calendar\" aria-hidden=\"true\"></span>\r\n <span class=\"off-screen\">Pick a date</span>\r\n </a>\r\n </span>\r\n <div class=\"calendar\" *ngIf=\"!disabled && showCalendar\">\r\n\t\t<div class=\"calendar-navs\">\r\n\t\t\t<div class=\"month-nav\">\r\n <button (click)=\"prevMonth($event)\">\r\n <span class=\"fa fa-chevron-left\"></span>\r\n <span class=\"off-screen\">Back a month</span>\r\n </button>\r\n\t\t\t\t<span class=\"p4\">{{ currentDate | date:'MMMM' }}</span>\r\n <button (click)=\"nextMonth($event)\">\r\n <span class=\"fa fa-chevron-right\"></span>\r\n <span class=\"off-screen\">Forward a month</span>\r\n </button>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"year-nav\">\r\n <button (click)=\"prevYear($event)\">\r\n <span class=\"fa fa-chevron-left\"></span>\r\n <span class=\"off-screen\">Back a year</span>\r\n </button>\r\n\t\t\t\t<span>{{ currentDate | date: 'yyyy' }}</span>\r\n <button (click)=\"nextYear($event)\">\r\n <span class=\"fa fa-chevron-right\"></span>\r\n <span class=\"off-screen\">Forward a year</span>\r\n </button>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t<div class=\"month-grid\">\r\n\t\t\t<div class=\"day-names\">\r\n\t\t\t\t<div *ngFor=\"let name of dayNames\" class=\"day-name p9\">{{ name }}</div>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"weeks\">\r\n\t\t\t\t<div *ngFor=\"let week of weeks\" class=\"week\">\r\n\t\t\t\t\t<ng-container *ngFor=\"let day of week\">\r\n\t\t\t\t\t\t<div class=\"week-date disabled\" *ngIf=\"!isSelectedMonth(day.date)\">\r\n\t\t\t\t\t\t\t<span class=\"date-text\">{{ day.date.getDate() }}</span>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"week-date enabled\"\r\n *ngIf=\"isSelectedMonth(day.date)\"\r\n tabindex=\"{{active ? 0 : -1}}\"\r\n (keyup)=\"keyup($event)\"\r\n\t\t\t\t\t\t (click)=\"selectDate($event, day)\"\r\n\t\t\t\t\t\t [class.today]=\"day.today\"\r\n\t\t\t\t\t\t [class.selected]=\"day.selected\">\r\n\t\t\t\t\t\t\t<span class=\"date-text\">{{ day.date.getDate() }}</span>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</ng-container>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n `,\r\n styles: [\r\n `\r\n :host {display:table;float:left;min-height: var(--sedeh-min-height, 25px);}\r\n .popper .fa-calendar{display: inline-block;margin: var(--sedeh-margin, 0 5px);}\r\n .popper:hover .fa-calendar{color: var(--sedeh-hover-opacity, 0.5);}\r\n .popper:focus {outline: none;}\r\n .popper:focus .fa{zoom: 1.1;right: var(--sedeh-shift-right, 0);position: relative;color: var(--sedeh-focus-color, darkblue);}\r\n .popper.disabled .fa-calendar{color: var(--sedeh-disabled-color, #888);}\r\n .popper.disabled:hover .fa-calendar{cursor:default;color: var(--sedeh-disabled-color, #888);}\r\n .popper.disabled{color: var(--sedeh-disabled-color, #888);pointer-events:none;cursor:default;text-decoration: none;}\r\n .calendar-box {\r\n display: flex;\r\n flex-direction: row;\r\n cursor: default;\r\n width: 100%;\r\n display: inline-block;\r\n }\r\n .calendar-box date {flex: 1;}\r\n .calendar-box .popper {cursor: pointer;flex: 0 0 15px}\r\n .calendar {\r\n display: table;\r\n width: 210px;\r\n position: absolute;\r\n background-color: #fff;\r\n z-index: 2;\r\n border: 1px solid #ddd;\r\n border-radius: 4px;\r\n box-shadow: var(--sedeh-box-shadow, 3px 3px 3px #999);\r\n }\r\n .calendar * {\r\n box-sizing: border-box;\r\n }\r\n .calendar .calendar-navs {\r\n background-color: whitesmoke;\r\n }\r\n .calendar .month-nav {\r\n padding: 2px;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n }\r\n .calendar .year-nav {\r\n padding: 2px;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n }\r\n .calendar .month-nav button,\r\n .calendar .year-nav button {\r\n border: 0;\r\n background: transparent;\r\n cursor: pointer;\r\n }\r\n .calendar .month-nav button:hover,\r\n .calendar .year-nav button:hover {\r\n color: red;\r\n }\r\n .calendar .month-grid .day-names {\r\n display: flex;\r\n flex-direction: row;\r\n background: whitesmoke;\r\n border-bottom-right-radius: 3px;\r\n border-bottom-left-radius: 3px;\r\n }\r\n .calendar .month-grid .weeks {\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n .calendar .month-grid .week {\r\n display: flex;\r\n flex-direction: row;\r\n }\r\n .calendar .month-grid .day-names {\r\n border-top: 1px dotted #ddd;\r\n border-bottom: 1px dashed #ddd;\r\n }\r\n .calendar .month-grid .week-date,\r\n .calendar .month-grid .day-name {\r\n text-align: center;\r\n padding: 2px;\r\n display: block;\r\n width: 30px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n }\r\n .calendar .month-grid .week-date {\r\n height: 30px;\r\n position: relative;\r\n padding: 5px;\r\n }\r\n .calendar .month-grid .week-date .date-text {\r\n font-size: 10px;\r\n z-index: 10;\r\n }\r\n .calendar .month-grid .week-date::after {\r\n content: '';\r\n height: 24px;\r\n width: 24px;\r\n position: absolute;\r\n top: 50%;\r\n left: 50%;\r\n transform: translate(-50%, -50%);\r\n border-radius: 50%;\r\n transition: background-color 150ms linear, color 150ms linear;\r\n z-index: 1;\r\n }\r\n .calendar .month-grid .week-date.disabled {color: #aaa;}\r\n .calendar .month-grid .week-date.enabled {\r\n cursor: pointer;\r\n }\r\n .calendar .month-grid .week-date.enabled:focus {\r\n outline: 0;\r\n }\r\n .calendar .month-grid .week-date.enabled:hover .date-text,\r\n .calendar .month-grid .week-date.enabled:focus .date-text {\r\n font-weight: bold;\r\n color: blue;\r\n }\r\n .calendar .month-grid .week-date.enabled:hover::after,\r\n .calendar .month-grid .week-date.enabled:focus::after {\r\n background-color: whitesmoke;\r\n }\r\n .calendar .month-grid .week-date.selected .date-text {\r\n color: #fff !important;\r\n }\r\n .calendar .month-grid .week-date.selected::after{\r\n background-color: blue !important;\r\n }\r\n .calendar .month-grid .week-date.today::after {\r\n background-color: lightblue;\r\n font-weight: bold;\r\n color: #fff;\r\n }\r\n @media print {\r\n .calendar-box .popper {\r\n display: none;\r\n }\r\n }\r\n `\r\n ]\r\n})\r\nexport class CalendarComponent implements PipeComponentInterface {\r\n\r\n source!: Date;\r\n id!: string;\r\n name!: string;\r\n item: any;\r\n showCalendar = false;\r\n formatting!:string;\r\n editName = false;\r\n multiselect = false;\r\n disabled = false;\r\n active = true;\r\n validate = (item: any, newValue: any) => true;\r\n\r\n origDate!: Date;\r\n currentDate!: Date;\r\n dayNames = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];\r\n weeks: CalendarDateInterface[][] = [];\r\n selectedDays: Date[] = [];\r\n\r\n @Output(\"onIntoComponentChange\")\r\n onIntoComponentChange = new EventEmitter();\r\n\r\n constructor(private renderer: Renderer2) {\r\n\r\n }\r\n\r\n keyup(event: any) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n const code = event.which;\r\n if (code === 13 && !this.disabled) {\r\n event.target.click();\r\n }\r\n }\r\n popdatepicker(event: any) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n this.showCalendar = !this.showCalendar;\r\n }\r\n\r\n static settingsPatterns() {\r\n return ['calendar:MM/dd/yyyy']; //date format\r\n }\r\n transform(source: Date, data: any, args?: any[]) {\r\n this.source= source;\r\n this.currentDate = new Date(source);\r\n this.origDate = new Date(source);\r\n\r\n if (source instanceof Array) {\r\n this.multiselect = true;\r\n source.map( (item) => {\r\n this.selectedDays.push(new Date(item));\r\n })\r\n } else {\r\n this.multiselect = false;\r\n this.selectedDays.push(new Date(this.source));\r\n }\r\n this.item = data;\r\n this.generateCalendar();\r\n this.formatting= (args && args.length) ? args[0] : \"\";\r\n }\r\n\r\n isSelected(date: Date): boolean {\r\n let index = -1;\r\n for (let i = 0; i < this.selectedDays.length; i++) {\r\n const selectedDate: Date = this.selectedDays[i];\r\n if (this.isSameDay(date, selectedDate)) {\r\n index = i;\r\n }\r\n }\r\n return index > -1;\r\n }\r\n\r\n isSelectedMonth(date: Date): boolean {\r\n return this.isSameMonth(date, this.currentDate);\r\n }\r\n\r\n toggleSelectedDates(day: CalendarDateInterface) {\r\n let found = false;\r\n if (this.multiselect) {\r\n for (let i = 0; i < this.selectedDays.length; i++) {\r\n const date: Date = this.selectedDays[i];\r\n if (this.isSameDay(day.date, date)) {\r\n this.selectedDays.splice(i,1);\r\n found = true;\r\n day.selected = false;\r\n break;\r\n }\r\n }\r\n if(!found) {\r\n this.selectedDays.push(day.date);\r\n day.selected = true;\r\n }\r\n } else {\r\n this.selectedDays = [day.date];\r\n day.selected = true;\r\n }\r\n }\r\n selectDate(event: any, day: CalendarDateInterface): void {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n if(this.validate(this.item, day.date)) {\r\n this.origDate = day.date;\r\n this.currentDate = day.date;\r\n this.toggleSelectedDates( day );\r\n \r\n this.selectedDays.sort( (a, b) => {\r\n return a > b ? -1 : 1;\r\n });\r\n this.onIntoComponentChange.emit({\r\n id: this.id,\r\n name: this.name,\r\n value: this.selectedDays,\r\n type: \"select\",\r\n item: this.item\r\n });\r\n this.generateCalendar();\r\n }\r\n this.showCalendar = false;\r\n }\r\n\r\n // actions from calendar\r\n prevMonth(event: any): void {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n this.currentDate = new Date(this.currentDate.getFullYear(),this.currentDate.getMonth()-1, this.currentDate.getDate());\r\n this.generateCalendar();\r\n }\r\n\r\n nextMonth(event: any): void {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n this.currentDate = new Date(this.currentDate.getFullYear(),this.currentDate.getMonth()+1, this.currentDate.getDate());\r\n this.generateCalendar();\r\n }\r\n\r\n prevYear(event: any): void {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n this.currentDate = new Date(this.currentDate.getFullYear()-1,this.currentDate.getMonth(), this.currentDate.getDate());\r\n this.generateCalendar();\r\n }\r\n\r\n nextYear(event: any): void {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n this.currentDate = new Date(this.currentDate.getFullYear()+1,this.currentDate.getMonth(), this.currentDate.getDate());\r\n this.generateCalendar();\r\n }\r\n\r\n // generate the calendar grid\r\n generateCalendar(): void {\r\n const dates = this.fillDates(this.currentDate);\r\n const weeks: CalendarDateInterface[][] = [];\r\n while (dates.length > 0) {\r\n weeks.push(dates.splice(0, 7));\r\n }\r\n this.weeks = weeks;\r\n }\r\n private isSameDay(a: Date, b: Date) {\r\n return a.getFullYear() === b.getFullYear() && \r\n a.getMonth() === b.getMonth() && \r\n a.getDate() === b.getDate();\r\n }\r\n private isSameMonth(a: any, b: any) {\r\n return a.getYear() === b.getYear() && \r\n a.getMonth() === b.getMonth();\r\n }\r\n\r\n fillDates(currentDate: Date): CalendarDateInterface[] {\r\n const cm = new Date(currentDate);\r\n const tm = new Date();\r\n const firstDay = new Date(cm.getFullYear(), cm.getMonth(), 1)\r\n const firstOfMonth = firstDay.getDay();\r\n const firstDayOfGrid = new Date(firstDay.getFullYear(), firstDay.getMonth(), firstDay.getDate() - firstOfMonth);\r\n const start = firstDayOfGrid.getDate();\r\n const list = [];\r\n for (let i = start; i< (start + 42);i++){\r\n const d = new Date(firstDayOfGrid.getFullYear(), firstDayOfGrid.getMonth(), i);\r\n list.push({\r\n today: this.isSameDay(tm, d),\r\n selected: this.isSelected(d),\r\n date: d\r\n });\r\n }\r\n return list;\r\n }\r\n}\r\n\r\n","import { NgModule, ModuleWithProviders, Inject, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { CalendarComponent } from './calendar.component';\r\nimport { ComponentPool } from '../common/component.pool';\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [CalendarComponent],\r\n exports: [CalendarComponent],\r\n entryComponents: [CalendarComponent],\r\n schemas: [CUSTOM_ELEMENTS_SCHEMA]\r\n})\r\n\r\nexport class CalendarIntoPipeModule {\r\n static forRoot(): ModuleWithProviders<any> {\r\n return {\r\n ngModule: CalendarIntoPipeModule,\r\n providers: [\r\n ]\r\n }\r\n }\r\n constructor(@Inject(ComponentPool) pool: ComponentPool) {\r\n pool.registerComponent('calendar', CalendarComponent);\r\n }\r\n}\r\n","import { Component, ViewChild, Output, EventEmitter } from '@angular/core';\r\nimport { PipeComponentInterface } from '../common/pipe.component.interface';\r\n\r\n@Component({\r\n selector: 'checkbox-component',\r\n template: `\r\n <span *ngIf=\"useFont\" class=\"check-font {{disabled ? 'disabled' : ''}}\">\r\n <span *ngIf=\"source === state1\" \r\n #check tabindex=\"{{active ? 0 : -1}}\" \r\n class=\"fa\" \r\n [class.fa-toggle-on]=\"onOff\" \r\n [class.fa-check]=\"!onOff\" \r\n (keyup)=\"keyup($event)\" \r\n (click)=\"click($event, false)\"></span>\r\n <span *ngIf=\"source === state2\"\r\n #uncheck tabindex=\"{{active ? 0 : -1}}\" \r\n class=\"fa\" \r\n checked\r\n [class.fa-toggle-off]=\"onOff\" \r\n [class.fa-close]=\"!onOff\" \r\n (keyup)=\"keyup($event)\" \r\n (click)=\"click($event, true)\"></span>\r\n </span>\r\n <input *ngIf=\"!useFont && displayable\" \r\n type=\"checkbox\" \r\n tabindex=\"{{active ? 0 : -1}}\" \r\n [disabled]=\"disabled\"\r\n [checked]=\"source===state1\" \r\n (keyup)=\"keyup($event)\"\r\n (click)=\"click($event, source!==state1)\" />\r\n `,\r\n styles: [\r\n `\r\n :host .check-font .fa{margin: var(--sedeh-margin, 0 5px);}\r\n :host {display:table;float:left;min-height: var(--sedeh-min-height, 25px);}\r\n .check-font:hover{opacity: var(--sedeh-hover-opacity, 0.5);}\r\n .check-font .fa:focus{outline: none;zoom: 1.1;right: var(--sedeh-shift-right, 0);position: relative;color: var(--sedeh-focus-color, darkblue);}\r\n .check-font {cursor: pointer;}\r\n .check-font.disabled:hover{color: var(--sedeh-disabled-color, #888);}\r\n .check-font.disabled {color: var(--sedeh-disabled-color, #888); pointer-events: none}\r\n `\r\n ]\r\n})\r\nexport class CheckboxComponent implements PipeComponentInterface {\r\n\r\n data: any;\r\n source!: string;\r\n state1!: string;\r\n state2!: string;\r\n id!: string;\r\n name!: string;\r\n onOff!: boolean;\r\n useFont!: boolean;\r\n displayable = true;\r\n disabled = false;\r\n active = true;\r\n validate = (item: any, newValue: any) => true;\r\n\r\n @ViewChild(\"check\")\r\n check: any;\r\n\r\n @ViewChild(\"uncheck\")\r\n uncheck: any;\r\n\r\n @Output(\"onIntoComponentChange\")\r\n onIntoComponentChange = new EventEmitter();\r\n\r\n keyup(event: any) {\r\n const code = event.which;\r\n if (code === 13 && !this.disabled) {\r\n event.target.click();\r\n\t\t}\r\n }\r\n\r\n click(event: any, checked: boolean) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n\r\n const newState = (checked ? this.state1 : this.state2);\r\n if (!this.disabled && this.validate(this.data, newState)) {\r\n this.displayable = false;\r\n this.source = newState;\r\n this.onIntoComponentChange.emit({\r\n id: this.id,\r\n name: this.name,\r\n value: this.source,\r\n type: \"check\",\r\n item: this.data\r\n });\r\n if (this.useFont) {\r\n setTimeout(() => {\r\n if (this.check) {\r\n this.check.nativeElement.focus();\r\n }\r\n if (this.uncheck) {\r\n this.uncheck.nativeElement.focus();\r\n }\r\n },66);\r\n } else {\r\n setTimeout(()=> this.displayable = true, 66)\r\n }\r\n }\r\n }\r\n\r\n static settingsPatterns() {\r\n return ['checkbox:true:false:false:false', 'checkbox:true:false:true:false', 'checkbox:true:false:true:true']; //state1 state2, useFont, onoff\r\n }\r\n transform(source: any, data: any, args: any[]) {\r\n this.state1= args && args.length ? String(args[0]) : \"\";\r\n this.state2= (args && args.length > 1) ? String(args[1]) : '';\r\n this.useFont= (args && args.length > 2 && args[2].length) ? args[2] === 'true' : false;\r\n this.onOff= (args && args.length > 3 && args[3].length) ? args[3] === 'true' : false;\r\n this.source= String(source);\r\n this.data = data;\r\n }\r\n}\r\n\r\n","import { NgModule, ModuleWithProviders, Inject, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { CheckboxComponent } from './checkbox.component';\r\nimport { ComponentPool } from '../common/component.pool';\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [CheckboxComponent],\r\n exports: [CheckboxComponent],\r\n entryComponents: [CheckboxComponent],\r\n schemas: [CUSTOM_ELEMENTS_SCHEMA]\r\n})\r\n\r\nexport class CheckboxIntoPipeModule {\r\n static forRoot(): ModuleWithProviders<any> {\r\n return {\r\n ngModule: CheckboxIntoPipeModule,\r\n providers: [\r\n ]\r\n }\r\n }\r\n constructor(@Inject(ComponentPool) pool: ComponentPool) {\r\n pool.registerComponent('checkbox', CheckboxComponent);\r\n }\r\n}\r\n","import { Component, EventEmitter } from '@angular/core';\r\nimport { PipeComponentInterface } from '../common/pipe.component.interface';\r\n\r\n@Component({\r\n selector: 'email',\r\n template: `\r\n <a \r\n *ngIf=\"isLink\" \r\n tabindex=\"{{active ? 0 : -1}}\" \r\n class=\"email {{disabled ? 'disabled':''}}\"\r\n [href]=\"'mailto:' + source\" (keyup)='keyup($event)' \r\n (click)=\"change($event)\">\r\n <span class='fa fa-envelope' aria-hidden='true'></span>\r\n <span [textContent]=\"source\"></span>\r\n </a>\r\n <span *ngIf=\"!isLink\">\r\n <span class='fa fa-envelope' aria-hidden='true'></span>\r\n <span [textContent]=\"source\"></span>\r\n </span>\r\n `,\r\n styles: [\r\n `\r\n :host {display:table;float:left;min-height: var(--sedeh-min-height, 25px)}\r\n :host:hover .email{opacity: var(--sedeh-hover-opacity, 0.5);}\r\n :host .email{text-decoration: none;}\r\n :host .email:focus{outline: none;}\r\n :host .email:focus .fa{zoom: 1.1;right: var(--sedeh-shift-right, 0);position: relative;color: var(--sedeh-focus-color, darkblue);}\r\n :host .email.disabled{color: var(--sedeh-disabled-color, #888);cursor:default;pointer-events: none;text-decoration: none;}\r\n :host .email.disabled .fa{color: var(--sedeh-disabled-color, #888);}\r\n :host .fa{margin: var(--sedeh-margin, 0 5px);}\r\n @media print {\r\n :host a { text-decoration: none;}\r\n :host a .fa-envelope {display: none;}\r\n :host .fa-envelope {display: none;}\r\n }\r\n `\r\n ]\r\n})\r\nexport class EmailComponent implements PipeComponentInterface {\r\n source!: string;\r\n\tid!: string;\r\n name!: string;\r\n isLink!: boolean;\r\n disabled = false;\r\n active = true;\r\n validate = (item: any, newValue: any) => true;\r\n\r\n\tonIntoComponentChange = new EventEmitter();\r\n\r\n static settingsPatterns() {\r\n return ['email:true']; //islink\r\n }\r\n transform(source: any, data: any, args: any[]) {\r\n this.isLink= (args && args.length && args[0].length) ? args[0] === 'true' : true;\r\n this.source = source;\r\n }\r\n keyup(event: any) {\r\n const code = event.which;\r\n event.stopPropagation();\r\n event.preventDefault();\r\n \r\n if (code === 13 && !this.disabled) {\r\n event.target.click();\r\n }\r\n }\r\n change(event: any) {\r\n if (!this.disabled) {\r\n this.onIntoComponentChange.emit({\r\n id: this.id,\r\n name: this.name,\r\n value: this.source,\r\n type: \"mail-to\",\r\n item: event.type\r\n });\r\n }\r\n }\r\n}\r\n","/*\r\n* Defines a filter to convert url into an email display.\r\n*/\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({ name: 'email' })\r\nexport class EmailPipe implements PipeTransform {\r\n static transformationMethod() {\r\n const x = function (content: any, args: string[], callback?: any, data?: any) {\r\n // email\r\n return new EmailPipe().transform(content, args.length > 1 ? args[1]==='true' : true); \r\n };\r\n return x;\r\n }\r\n\r\n emailFromString(source: string, isLink: boolean) {\r\n let x: string;\r\n if (isLink) {\r\n x = \"<a href=\\'mailto:\"+source+\"\\' ><span class='fa fa-envelope' aria-hidden='true'></span><span>\" + source + \"</span></a>\";\r\n } else {\r\n x = \"<span><span class='fa fa-envelope' style='margin: 0 5px' aria-hidden='true'></span><span>\" + source + \"</span></span>\";\r\n }\r\n return x;\r\n }\r\n transform(source: any, ...args: any[]): any {\r\n const isLink= args.length ? args[0] : true;\r\n if ((typeof source === \"string\") || !(source instanceof Array)) {\r\n return this.emailFromString(source, isLink);\r\n } else {\r\n const result: any[] = [];\r\n source.map((item) => {\r\n result.push(this.emailFromString(item, isLink));\r\n });\r\n return result;\r\n } \r\n }\r\n}\r\n","import { NgModule, ModuleWithProviders, Inject, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { EmailComponent } from './email.component';\r\nimport { EmailPipe } from './email.pipe';\r\nimport { ComponentPool } from '../common/component.pool';\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [EmailComponent, EmailPipe],\r\n exports: [EmailComponent, EmailPipe],\r\n entryComponents: [EmailComponent],\r\n schemas: [CUSTOM_ELEMENTS_SCHEMA]\r\n}) \r\n\r\nexport class EmailIntoPipeModule {\r\n static forRoot(): ModuleWithProviders<any> {\r\n return {\r\n ngModule: EmailIntoPipeModule,\r\n providers: [EmailPipe]\r\n }\r\n }\r\n constructor(@Inject(ComponentPool) pool: ComponentPool) {\r\n pool.registerComponent('email', EmailComponent);\r\n pool.registerPipeTransformation('email', EmailPipe.transformationMethod());\r\n }\r\n}\r\n","import { Component, EventEmitter } from '@angular/core';\r\nimport { PipeComponentInterface } from '../common/pipe.component.interface';\r\n\r\n@Component({\r\n selector: 'font-component',\r\n template: `\r\n <span *ngIf=\"location === 'left'\" [class]=\"font\" aria-hidden='true'></span>\r\n <span *ngIf=\"location !== 'replace'\" [textContent]=\"content\"></span>\r\n <span *ngIf=\"location === 'right'\" [class]=\"font\" aria-hidden='true'></span>\r\n <span *ngIf=\"location === 'replace'\" [class]=\"font\" aria-hidden='true'></span>\r\n `,\r\n styles: [\r\n `\r\n :host {display:table;float:left;min-height: var(--sedeh-min-height, 25px)}\r\n :host span {\r\n float: left;\r\n margin: var(--sedeh-margin, 0 5px);\r\n }\r\n `\r\n ]\r\n})\r\nexport class FontComponent implements PipeComponentInterface {\r\n font!: string;\r\n location!: string;\r\n source!: string;\r\n\tid!: string;\r\n\tname!: string;\r\n content!: string;\r\n disabled = false;\r\n active = true;\r\n validate = (item: any, newValue: any) => true;\r\n\r\n\tonIntoComponentChange!: EventEmitter<any>;\r\n\r\n static settingsPatterns() {\r\n return ['font:fa fa-check::*']; //font class, location left/right, action\r\n }\r\n transform(source: any, data: any, args: any[]) {\r\n this.source = source;\r\n this.font = args[0];\r\n this.location = (args.length > 1 && args[1].length) ? args[1] : \"left\";\r\n const action = args.length > 2 ? args[2].toLowerCase() : \"\";\r\n this.content = action === \"*\" ? source : (\"replace\" === action.toLowerCase() ? \"\" : source);\r\n }\r\n}\r\n","/*\r\n* Defines a filter to convert url into an email display.\r\n*/\r\nimport { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({ name: 'font' })\r\nexport class FontPipe implements PipeTransform {\r\n static transformationMethod() {\r\n const x = function (content: any, args: string[], callback?: any, data?: any) {\r\n // font:fa fa-check:left:*\r\n return new FontPipe().transform(content, args.length > 1 ? args[1] : \"\", args.length > 2 ? args[2] : \"\", args.length > 3 ? args[3] : \"\"); \r\n };\r\n return x;\r\n }\r\n\r\n fontFromString(font: any, location: any, action: any, content: any) {\r\n return (location === \"left\" ? \r\n (font + content) : \r\n ((location === \"right\") ? content + font : font));\r\n }\r\n transform(source: any, ...args: any[]): any {\r\n const font = args.length ? \"<span class=\\'\" + args[0] + \"\\' style='margin: 0 5px' aria-hidden='true'></span>\" : \"\";\r\n const location = args.length > 1 ? args[1] : \"\";\r\n const action = args.length > 2 ? args[2].toLowerCase() : \"\";\r\n const content = action === \"*\" ? source : (\"replace\" === action.toLowerCase() ? \"\" : source);\r\n \r\n if ((typeof content === \"string\") || !(content instanceof Array)) {\r\n return this.fontFromString(font, location, action, content);\r\n } else {\r\n const result: any[] = [];\r\n source.map((item: any) => {\r\n result.push(this.fontFromString(font, location, action, item));\r\n });\r\n return result; \r\n }\r\n }\r\n}\r\n","import { NgModule, ModuleWithProviders, Inject, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { FontComponent } from './font.component';\r\nimport { FontPipe } from './font.pipe';\r\nimport { ComponentPool } from '../common/component.pool';\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [FontComponent, FontPipe],\r\n exports: [FontComponent, FontPipe],\r\n entryComponents: [FontComponent],\r\n schemas: [CUSTOM_ELEMENTS_SCHEMA]\r\n})\r\n\r\nexport class FontIntoPipeModule {\r\n static forRo