ack-angular
Version:
Extra special directives, components, providers and pipes to aide in tackling everyday interface development needs in Angular2
1 lines • 276 kB
Source Map (JSON)
{"version":3,"file":"ack-angular.mjs","sources":["../../src/directives/HtmlSizeWatcher.ts","../../src/providers/Log.ts","../../src/providers/Prompts.ts","../../src/providers/AckApp.provider.ts","../../src/providers/ErrorLog.ts","../../src/providers/WindowService.ts","../../src/providers/UrlVars.ts","../../src/providers/DocumentService.ts","../../src/providers.ts","../../src/providers/AckSections.provider.ts","../../src/components/templates/ack-sections.pug.ts","../../src/directives/HtmlWidthModel.directive.ts","../../src/directives/HtmlHeightModel.directive.ts","../../src/directives/ElementSizeModel.directive.ts","../../src/components/AckSections.component.ts","../../src/components/AckSectionTemplates.component.ts","../../src/components/AckCloseIcon.component.ts","../../src/components/AckModalLayout.component.ts","../../src/components/ack-modal-layout.component.html","../../src/components/AckModal.component.ts","../../src/components/ack-modal.component.html","../../src/components/AckFixedElementStage.component.ts","../../src/components/ack-fixed-element-stage.html","../../src/components/AckFixedElement.component.ts","../../src/invokeRotator.ts","../../src/pipes.class.ts","../../src/TemplateReader.class.ts","../../src/components/templates/ack-options.pug.ts","../../src/pipes/keys.pipe.ts","../../src/pipes.ts","../../src/components/AckOptions.component.ts","../../src/components/AckOptionsModal.component.ts","../../src/components/ack-options-modal.html","../../src/components/templates/absolute-overflow-x.pug.ts","../../src/components/AbsoluteOverflowX.component.ts","../../src/components/templates/error-well.pug.ts","../../src/components/ErrorWell.component.ts","../../src/components/templates/reader-header-body.pug.ts","../../src/components/ReaderHeaderBody.component.ts","../../src/directives/VarDirective.directive.ts","../../src/components/debug-area/DebugArea.component.ts","../../src/components/debug-area/debug-area.template.html","../../src/directives/AckAggregate.directive.ts","../../src/directives/AckArray.directive.ts","../../src/components/templates/scroll-past-fixed.pug.ts","../../src/components/ScrollPastFixed.component.ts","../../src/directives/FxOn.directive.ts","../../src/directives/ShakeOn.directive.ts","../../src/directives/FocusOn.directive.ts","../../src/directives/Init.directive.ts","../../src/directives/ContentModel.directive.ts","../../src/directives/SelectOn.directive.ts","../../src/directives/InnerHtmlModel.directive.ts","../../src/directives/ReplaceModel.directive.ts","../../src/directives/ScreenScrollHeightDiff.directive.ts","../../src/directives/ScreenScroll.directive.ts","../../src/directives/PxFromHtmlTop.directive.ts","../../src/directives/ScreenScrollModelY.directive.ts","../../src/directives/ScreenWidthModel.directive.ts","../../src/directives/ScreenHeightModel.directive.ts","../../src/directives/StatusOnlineModel.directive.ts","../../src/directives/StatusOfflineModel.directive.ts","../../src/declarations.short.ts","../../src/declarations.ts","../../src/AckModule.ts","../../src/modules/router/RouteWatchReporter.ts","../../src/modules/router/RouteHistory.provider.ts","../../src/modules/router/RouteReporter.directive.ts","../../src/modules/router/AckRouterModule.ts","../../src/ack-angular.ts"],"sourcesContent":["import {\n Injectable, Output, EventEmitter\n} from \"@angular/core\"\n\nexport interface htmlSize{\n width: number | null\n height: number | null\n}\n\n@Injectable() export class HtmlSizeService {\n private onResize:()=>void\n htmlSize:htmlSize\n\n @Output() change:EventEmitter<void> = new EventEmitter()\n\n constructor(){\n this.htmlSize = {width:null, height:null}\n\n this.onResize = ()=>{\n this.htmlSize.width = window.document.documentElement.clientWidth\n this.htmlSize.height = window.document.documentElement.clientHeight\n this.change.emit()\n }\n\n this.checkWatchers()\n this.onResize()\n }\n\n checkWatchers(){\n if( this.change.observers.length ){\n window.addEventListener('resize', this.onResize)\n //window.addEventListener('scroll', this.onResize)\n }else{\n window.removeEventListener('resize', this.onResize)\n //window.removeEventListener('scroll', this.onResize)\n }\n }\n}","import { Injectable } from '@angular/core';\n\n@Injectable() export class Log{\n public log: any[] = []\n public maxLog = 80\n\n add(e: any, toConsole?: any){\n const ob = this.paramAudit(e,toConsole)\n this.log.unshift( ob );\n if(this.maxLog){\n while(this.log.length>this.maxLog){\n this.log.pop()//remove last\n }\n }\n return e\n }\n\n paramAudit(e: any, toConsole?: any){\n switch(e.constructor){\n case String:\n case Boolean:\n case Number:{\n e = {message:e}\n }\n }\n\n if(toConsole==null || toConsole)console.log(e)\n\n e['datetime'] = e['datetime']||getDateTimeString()\n\n return e\n }\n}\n\nfunction getDateTimeString(){\n return (function(d){return (('0'+(d.getMonth()+1)).slice(-2)+'/'+('0'+d.getDate()).slice(-2)+'/'+d.getFullYear())})(new Date())+' '+(function(d){var h=d.getHours(),t='AM',m=d.getMinutes();var mn = m<10?'0'+m:m;h = h>=12?(t='PM',h-12||12):h==0?12:h;return ('0'+h).slice(-2)+':'+('0'+mn).slice(-2)+' '+t})(new Date())\n}","import { Injectable, EventEmitter } from '@angular/core';\n\nexport interface button{\n text: string\n //role?: \"cancel\"//when \"cancel\" then auto configs to close prompt\n handler?: () => any\n}\n\nexport interface promptOptions{\n title? : string\n buttons? : button[]//not yet used\n emitter? : EventEmitter<boolean>\n message? : string\n type? : \"confirm\"|\"alert\"|\"string\"\n}\n\nexport interface prompt extends promptOptions{\n type:\"confirm\"|\"alert\"|\"string\"\n message:string\n emitter:EventEmitter<boolean>\n}\n\n@Injectable() export class Prompts{\n prompts:prompt[] = []\n \n remove(prompt:prompt){\n for(let x=this.prompts.length-1; x >= 0; --x){\n if(this.prompts[x] == prompt){\n this.prompts.splice(x, 1)\n return\n }\n }\n }\n\n issuePrompt(prompt:prompt){\n this.prompts.push(prompt)\n prompt.emitter.subscribe(()=>this.remove(prompt))\n return prompt.emitter\n }\n\n alert(\n message:string,\n options:promptOptions=<promptOptions>{}\n ):EventEmitter<boolean>{\n options.emitter = new EventEmitter()\n options.type = \"alert\"\n options.message = message\n return this.issuePrompt( <prompt>options )\n }\n\n confirm(\n message:string,\n options:promptOptions=<promptOptions>{}\n ):EventEmitter<boolean>{\n options.emitter = new EventEmitter()\n options.type = \"confirm\"\n options.message = message\n return this.issuePrompt( <prompt>options )\n }\n}","import {\n //TemplateRef,\n Injectable,\n ElementRef\n} from \"@angular/core\"\nimport { AckModal } from \"../components/AckModal.component\"\n//import { AckSectionTemplates } from \"../components/AckSectionTemplates.component\"\n//import { AckAppHeader } from \"../components/AckAppHeader.component\"\n//import { AckAppFooter } from \"../components/AckAppFooter.component\"\nimport { AckFixedElement } from \"../components/AckFixedElement.component\"\nimport {\n //prompt,\n Prompts\n} from \"./Prompts\"\n\n@Injectable() export class AckApp{\n warnedFixElements: boolean = true\n fixedElementStage!: ElementRef\n\n fixedElms:AckFixedElement[] = []\n modals:AckModal[] = []\n\n constructor( public prompts:Prompts ){}\n\n registerModal( item:AckModal ):AckApp{\n this.modals.push(item)\n return this\n }\n\n unregisterModal( item:AckModal ){\n for(let index=this.modals.length-1; index >= 0; --index){\n if(this.modals[index]==item){\n this.modals.splice(index,1)\n break\n }\n }\n return this\n }\n}","import { Injectable } from '@angular/core';\n\n@Injectable() export class ErrorLog{\n public log: any[] = []\n public maxLog = 30\n\n monitorWindow(win?: any){\n win = win || window\n const callback = (evt: any) => this.add(evt,false)\n win.addEventListener('error', callback);\n }\n\n reject(err: any){\n const e = this.add(err)\n return Promise.reject(e)\n }\n\n rejector(){\n return (err: any) => this.reject(err)\n }\n\n add(e: any, toConsole?: any){\n const ob = this.paramAudit(e,toConsole)\n this.log.unshift( ob );\n if(this.maxLog){\n while(this.log.length>this.maxLog){\n this.log.pop()//remove last\n }\n }\n return logObToErrorObject(ob)\n }\n\n //api error to js Error object\n paramAudit(e: any, toConsole?: any){\n if(e.constructor === String){\n e = new Error(e as string);\n }\n\n if(toConsole==null || toConsole)console.error(e)\n\n const err = this.objectifyError(e);\n err['datetime'] = err['datetime']||getDateTimeString()\n\n if(!e.message && e.status==-1){\n e.message = \"Cannot connect to server\"\n e.details = e.details || \"Connection to internet maybe down. Also possible CORS needs be to enabled at remote server.\"\n }\n\n return err\n }\n\n /** Convert Error object to a regular object */\n objectifyError(err: any){\n const keys = Object.getOwnPropertyNames(err)\n keys.push.apply(keys, Object.keys(err))\n\n const recErr:{data?:any} = {}//new Error(err.message || err.name || err.type || 'Unexpected Error Occured')\n keys.forEach(v=>recErr[v]=err[v])\n\n const knownKeys = [\"stack\",\"message\",\"name\",\"arguments\",\"type\"]\n knownKeys.forEach(key=>{\n if(typeof err[key]!='undefined'){\n recErr[key] = err[key]\n }\n })\n\n const body = err.body || err._body\n\n //auto attempt to parse body\n if(body && !err.data && err.headers){\n const contentType = err.headers.get('content-type')\n if(contentType && contentType.toLowerCase()=='application/json'){\n try{\n recErr.data = JSON.parse(body)\n }catch(e){}\n }\n }\n\n return recErr\n }\n\n /** same as reject but uses native throw instead of native Promise.reject */\n rethrow(err: any){\n const e = this.add(err)\n throw e\n }\n}\n\nfunction getErrorMessage(err: any){\n return err.message || err.statusText || err.name || 'Unexpected Error Occured'\n}\n\nfunction getResponseMessage(res: any){\n if(res.data && res.data.error && res.data.error.message){\n return res.data.error.message\n }\n return getErrorMessage(res)\n}\n\nfunction logObToErrorObject(log: any){\n const e = new Error( getResponseMessage(log) )\n Object.keys(log).forEach( v=>e[v]=log[v] )\n return e\n}\n\nfunction getDateTimeString(){\n return (function(d){return (('0'+(d.getMonth()+1)).slice(-2)+'/'+('0'+d.getDate()).slice(-2)+'/'+d.getFullYear())})(new Date())+' '+(function(d){var h=d.getHours(),t='AM',m=d.getMinutes();var mn = m<10?'0'+m:m;h = h>=12?(t='PM',h-12||12):h==0?12:h;return ('0'+h).slice(-2)+':'+('0'+mn).slice(-2)+' '+t})(new Date())\n}","import { Injectable } from '@angular/core';\n\nfunction getWindow():any{return window}\n\n@Injectable() export class WindowService {\n get nativeElement(): any {return getWindow()}\n //deprecated\n get nativeWindow(): any {return getWindow()}\n}","import { Injectable } from '@angular/core'\nimport { WindowService } from \"./WindowService\"\n\n@Injectable() export class UrlVars{\n vars\n\n constructor(public WindowService:WindowService){\n this.vars = this.parse()\n }\n\n parse(){\n var regex = /[?&]([^=#]+)(=([^&#]*))?/g,\n url = this.WindowService.nativeWindow.location.href,\n params = {},\n match;\n\n while(match = regex.exec(url)) {\n params[match[1]] = match[2]==null ? true : match[3]\n }\n return params\n }\n\n /** case in-sensative variable fetch */\n get(name: any, param?: any){\n if(!name)return\n\n if(this.vars && this.vars[name]!=null)//try exact match first\n return this.vars[name]\n\n //case insensative search\n var lcase = name.toLowerCase()\n for(var key in this.vars){\n if(lcase == key.toLowerCase())\n return this.vars[key]\n }\n\n return param\n }\n}\n\n","import { Injectable } from '@angular/core';\n\nfunction getDocument():any{return document}\n\n@Injectable() export class DocumentService {\n get nativeElement(): any {return getDocument()}\n}","export { HtmlSizeService } from \"./directives/HtmlSizeWatcher\";\nimport { HtmlSizeService } from \"./directives/HtmlSizeWatcher\";\n\nexport { Log } from \"./providers/Log\";\nimport { Log } from \"./providers/Log\";\n\nexport { AckApp } from \"./providers/AckApp.provider\";\nimport { AckApp } from \"./providers/AckApp.provider\";\n\nexport { Prompts } from \"./providers/Prompts\";\nimport { Prompts } from \"./providers/Prompts\";\n\nexport { ErrorLog } from \"./providers/ErrorLog\";\nimport { ErrorLog } from \"./providers/ErrorLog\";\n\nexport { UrlVars } from \"./providers/UrlVars\";\nimport { UrlVars } from \"./providers/UrlVars\";\n\nexport { WindowService } from \"./providers/WindowService\";\nimport { WindowService } from \"./providers/WindowService\";\n\nexport { DocumentService } from \"./providers/DocumentService\";\nimport { DocumentService } from \"./providers/DocumentService\";\n\nexport const providers = [\n Log,\n ErrorLog,\n AckApp,\n UrlVars,\n WindowService,\n DocumentService,\n Prompts,\n HtmlSizeService\n]\n","import {\n TemplateRef, Injectable, ElementRef\n} from \"@angular/core\"\n\n@Injectable() export class SectionProvider{\n //appTemplates:AckSectionTemplates[] = []\n headerTemplates:TemplateRef<ElementRef>[] = []\n footerTemplates:TemplateRef<ElementRef>[] = []\n \n leftBodyTemplates:TemplateRef<ElementRef>[] = []\n rightBodyTemplates:TemplateRef<ElementRef>[] = []\n\n unregisterHeaderTemplate( item:TemplateRef<ElementRef> ){\n this.unregisterTemplateFrom(item, this.headerTemplates)\n }\n\n unregisterFooterTemplate( item:TemplateRef<ElementRef> ){\n this.unregisterTemplateFrom(item, this.footerTemplates)\n }\n\n unregisterTemplateFrom(\n item:TemplateRef<ElementRef>,\n templates:TemplateRef<ElementRef>[]\n ){\n for(let x=templates.length-1; x >= 0; --x){\n if( templates[x]===item ){\n templates.splice(x,1)\n break\n }\n } \n }\n\n unregisterTemplate( item:TemplateRef<ElementRef> ){\n this.unregisterTemplateFrom(item, this.headerTemplates)\n this.unregisterTemplateFrom(item, this.footerTemplates)\n this.unregisterTemplateFrom(item, this.leftBodyTemplates)\n this.unregisterTemplateFrom(item, this.rightBodyTemplates)\n }\n}","export const string = \"<ng-container [(htmlHeightModel)]=\\\"htmlHeightModel\\\"></ng-container><ng-container *ngIf=\\\"SectionProvider.headerTemplates.length\\\"><div *ngIf=\\\"mode==='calculate'\\\" style=\\\"position:fixed;top:0;width:100%\\\" [style.z-index]=\\\"zIndex\\\" [(elementHeightModel)]=\\\"headerHeight\\\" [elementSizeModelWatch]=\\\"SectionProvider.headerTemplates.length\\\"><ng-template *ngTemplateOutlet=\\\"headerWrap || headerContent;context:{outlet:headerContent}\\\"></ng-template></div><ng-template #headerContent=\\\"\\\"><ng-container *ngFor=\\\"let item of SectionProvider.headerTemplates\\\"><ng-template *ngTemplateOutlet=\\\"item\\\"></ng-template></ng-container></ng-template><div *ngIf=\\\"!mode || mode==='clone'\\\" style=\\\"position:fixed;top:0;width:100%\\\" [style.z-index]=\\\"zIndex\\\"><ng-template *ngTemplateOutlet=\\\"headerContent\\\"></ng-template></div></ng-container><ng-template *ngTemplateOutlet=\\\"table || defaultTableTag;context:{outlet:tableRows}\\\"></ng-template><ng-template #defaultTableTag=\\\"\\\"><table style=\\\"height:100%;width:100%;border-collapse: collapse;\\\" cellPadding=\\\"0\\\" cellSpacing=\\\"0\\\" border=\\\"0\\\"><ng-template *ngTemplateOutlet=\\\"tableRows\\\"></ng-template></table></ng-template><ng-template #tableRows=\\\"\\\"><tr *ngIf=\\\"SectionProvider.headerTemplates.length\\\"><td colspan=\\\"3\\\" [style.height.px]=\\\"headerHeight\\\" style=\\\"visibility:hidden\\\"><ng-container *ngIf=\\\"!mode || mode==='clone'\\\"><ng-container *ngFor=\\\"let item of SectionProvider.headerTemplates\\\"><ng-template *ngTemplateOutlet=\\\"item\\\"></ng-template></ng-container></ng-container></td></tr><tr><td *ngIf=\\\"SectionProvider.leftBodyTemplates.length\\\" [style.min-width.px]=\\\"leftBodyWidth\\\" valign=\\\"top\\\" align=\\\"right\\\"><ng-template #defaultLeftBodyWrap=\\\"\\\"><div style=\\\"overflow:auto;height:100%;\\\"><ng-template *ngTemplateOutlet=\\\"leftBodyContent\\\"></ng-template></div></ng-template><ng-template #leftBodyContent=\\\"\\\"><ng-container *ngFor=\\\"let item of SectionProvider.leftBodyTemplates\\\"><ng-template *ngTemplateOutlet=\\\"item\\\"></ng-template></ng-container></ng-template><div *ngIf=\\\"mode==='calculate'\\\" style=\\\"position:fixed;\\\" [style.z-index]=\\\"zIndex - 1\\\" [style.height.px]=\\\"htmlHeightModel - (SectionProvider.headerTemplates.length ? headerHeight : 0) - (SectionProvider.footerTemplates.length ? footerHeight : 0)\\\" [(elementWidthModel)]=\\\"leftBodyWidth\\\" [elementSizeModelWatch]=\\\"SectionProvider.leftBodyTemplates.length\\\"><ng-template *ngTemplateOutlet=\\\"leftBodyWrap || defaultLeftBodyWrap;context:{outlet:leftBodyContent}\\\"></ng-template></div><div *ngIf=\\\"!mode || mode==='clone'\\\" style=\\\"position:fixed;top:0;\\\" [style.z-index]=\\\"zIndex - 1\\\"><ng-template *ngTemplateOutlet=\\\"leftBodyWrap || defaultLeftBodyWrap;context:{outlet:leftBodyContent}\\\"></ng-template></div><ng-container *ngIf=\\\"!mode || mode==='clone'\\\"><ng-template *ngTemplateOutlet=\\\"leftBodyWrap || defaultLeftBodyWrap;context:{outlet:leftBodyContent}\\\"></ng-template></ng-container></td><ng-container *ngTemplateOutlet=\\\"bodyCell || defaultBodyCell;context:{outlet:body}\\\"></ng-container><ng-template #defaultBodyCell=\\\"\\\"><td style=\\\"height:100%\\\" valign=\\\"top\\\"><ng-template *ngTemplateOutlet=\\\"body\\\"></ng-template></td></ng-template><ng-template #body=\\\"\\\"><ng-content></ng-content></ng-template><td *ngIf=\\\"SectionProvider.rightBodyTemplates.length\\\" [style.min-width.px]=\\\"rightBodyWidth\\\" valign=\\\"top\\\" align=\\\"left\\\"><ng-template #defaultRightBodyWrap=\\\"\\\"><div style=\\\"overflow:auto;height:100%;\\\"><ng-template *ngTemplateOutlet=\\\"rightBodyContent\\\"></ng-template></div></ng-template><ng-template #rightBodyContent=\\\"\\\"><ng-container *ngFor=\\\"let item of SectionProvider.rightBodyTemplates\\\"><ng-template *ngTemplateOutlet=\\\"item\\\"></ng-template></ng-container></ng-template><div *ngIf=\\\"mode==='calculate'\\\" style=\\\"position:fixed;\\\" [style.z-index]=\\\"zIndex - 1\\\" [style.height.px]=\\\"htmlHeightModel - (SectionProvider.headerTemplates.length ? headerHeight : 0) - (SectionProvider.footerTemplates.length ? footerHeight : 0)\\\" [(elementWidthModel)]=\\\"rightBodyWidth\\\" [elementSizeModelWatch]=\\\"SectionProvider.rightBodyTemplates.length\\\"><ng-template *ngTemplateOutlet=\\\"rightBodyWrap || defaultRightBodyWrap;context:{outlet:rightBodyContent}\\\"></ng-template></div><div *ngIf=\\\"!mode || mode==='clone'\\\" style=\\\"position:fixed;top:0;overflow:auto;\\\" [style.z-index]=\\\"zIndex - 1\\\"><ng-template *ngTemplateOutlet=\\\"rightBodyWrap || defaultRightBodyWrap;context:{outlet:rightBodyContent}\\\"></ng-template></div><ng-container *ngIf=\\\"!mode || mode==='clone'\\\"><ng-template *ngTemplateOutlet=\\\"rightBodyWrap || defaultRightBodyWrap;context:{outlet:rightBodyContent}\\\"></ng-template></ng-container></td></tr><tr *ngIf=\\\"SectionProvider.footerTemplates.length\\\"><td colspan=\\\"3\\\" [style.height.px]=\\\"footerHeight\\\"><div *ngIf=\\\"!mode || mode==='clone'\\\" style=\\\"visibility:hidden\\\"><ng-container *ngFor=\\\"let item of SectionProvider.footerTemplates\\\"><ng-template *ngTemplateOutlet=\\\"item\\\"></ng-template></ng-container></div></td></tr></ng-template><ng-container *ngIf=\\\"SectionProvider.footerTemplates.length\\\"><div *ngIf=\\\"mode==='calculate'\\\" style=\\\"position:fixed;bottom:0;width:100%\\\" [style.z-index]=\\\"zIndex\\\" [(elementHeightModel)]=\\\"footerHeight\\\" [elementSizeModelWatch]=\\\"SectionProvider.footerTemplates.length\\\"><ng-container *ngFor=\\\"let item of SectionProvider.footerTemplates\\\"><ng-template *ngTemplateOutlet=\\\"item\\\"></ng-template></ng-container></div><div *ngIf=\\\"!mode || mode==='clone'\\\" style=\\\"position:fixed;bottom:0;width:100%\\\" [style.z-index]=\\\"zIndex\\\"><ng-container *ngFor=\\\"let item of SectionProvider.footerTemplates\\\"><ng-template *ngTemplateOutlet=\\\"item\\\"></ng-template></ng-container></div></ng-container>\"","import { Subscription } from \"rxjs\"\n\nimport {\n Directive,\n Input,\n Output,\n EventEmitter\n} from \"@angular/core\"\n\nimport {\n htmlSize, HtmlSizeService\n} from \"./HtmlSizeWatcher\"\n\n@Directive({\n selector: '[htmlWidthModel]'\n}) export class HtmlWidthModel{\n sub:Subscription\n\n @Input() htmlWidthModel?: number | null\n @Output() htmlWidthModelChange:EventEmitter<number | null> = new EventEmitter()\n\n constructor(\n public HtmlSizeService:HtmlSizeService\n ){\n this.sub = this.HtmlSizeService.change.subscribe(()=>this.changed())\n\n this.HtmlSizeService.checkWatchers()\n\n /*if( this.HtmlSizeService.htmlSize ){\n this.changed()\n }*/\n }\n\n ngAfterViewInit(){\n Promise.resolve().then(()=>this.changed())//two way bind often needs init override\n }\n\n ngOnDestroy(){\n this.sub.unsubscribe()\n this.HtmlSizeService.checkWatchers()\n }\n\n changed(){\n if( !this.HtmlSizeService.htmlSize || !this.hasChanged() )return\n this.setModel( this.HtmlSizeService.htmlSize )\n }\n\n hasChanged(){\n return this.htmlWidthModel !== window.document.documentElement.clientWidth\n }\n\n setModel( htmlSize: htmlSize ){\n this.htmlWidthModel = htmlSize.width\n this.htmlWidthModelChange.emit( this.htmlWidthModel )\n }\n}\n","import {\n Directive,\n Input,\n Output,\n EventEmitter\n} from \"@angular/core\"\n\nimport {\n htmlSize, HtmlSizeService\n} from \"./HtmlSizeWatcher\"\n\nimport { HtmlWidthModel } from \"./HtmlWidthModel.directive\"\n\n@Directive({\n selector: '[htmlHeightModel]'\n}) export class HtmlHeightModel extends HtmlWidthModel{\n @Input() htmlHeightModel!: number | null\n @Output() htmlHeightModelChange:EventEmitter<number |null> = new EventEmitter()\n\n constructor(\n public HtmlSizeService:HtmlSizeService\n ){\n super( HtmlSizeService )\n }\n\n hasChanged(){\n return this.htmlHeightModel !== window.document.documentElement.clientHeight\n }\n\n setModel( model:htmlSize ){\n this.htmlHeightModel = model.height\n this.htmlHeightModelChange.emit( this.htmlHeightModel )\n }\n}\n","import {\n Directive,\n Input,\n Output,\n EventEmitter,\n ElementRef\n} from \"@angular/core\"\n\n@Directive({\n selector: '[elementSizeModel]'\n}) export class ElementSizeModel{\n onResize: any\n observer: any\n timeout: any\n inChange!: boolean\n\n @Input() elementSizeModelWatch:any//causes ngOnChanges to fire\n\n @Input() elementSizeModel: any\n @Output() elementSizeModelChange = new EventEmitter()\n\n constructor(public element:ElementRef){}\n\n ngAfterViewInit(){\n this.onResize = ()=>{\n this.setModel()\n }\n\n window.addEventListener('resize', this.onResize)\n Promise.resolve().then(()=>this.setModel())\n\n this.observer = new MutationObserver(()=>{\n this.setModel()\n })\n\n const config = {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true\n }\n\n this.observer.observe(this.element.nativeElement, config);\n\n setTimeout(()=>this.setModel(), 800)\n }\n\n ngOnChanges(){\n Promise.resolve().then(()=>{\n if(!this.inChange){\n this.setModel()\n }\n })\n }\n\n setModel(){\n this.elementSizeModel = this.elementSizeModel || {}\n this.inChange = true\n this.elementSizeModel.width = this.element.nativeElement.offsetWidth\n this.elementSizeModel.height = this.element.nativeElement.offsetHeight\n this.elementSizeModelChange.emit(this.elementSizeModel)\n\n Promise.resolve().then(()=>{\n this.inChange=false\n })\n }\n\n ngOnDestroy(){\n this.observer.disconnect()\n window.removeEventListener('resize', this.onResize)\n }\n}\n\n@Directive({\n selector: '[elementHeightModel]'\n}) export class ElementHeightModel extends ElementSizeModel{\n @Input() elementHeightModel: any\n @Output() elementHeightModelChange = new EventEmitter()\n\n constructor(public element:ElementRef){\n super( element )\n }\n\n setModel(){\n this.elementHeightModel = this.element.nativeElement.offsetHeight\n this.elementHeightModelChange.emit(this.elementHeightModel)\n }\n}\n\n@Directive({\n selector: '[elementWidthModel]',\n exportAs: 'ElementWidthModel'\n}) export class ElementWidthModel extends ElementSizeModel{\n @Input() elementWidthModel: any\n @Output() elementWidthModelChange = new EventEmitter()\n\n constructor(public element:ElementRef){\n super( element )\n }\n\n setModel(){\n this.elementWidthModel = this.element.nativeElement.offsetWidth\n this.elementWidthModelChange.emit(this.elementWidthModel)\n }\n}\n","import {\n ContentChild,\n\n Component,\n Input,\n ElementRef,\n\n TemplateRef\n} from \"@angular/core\"\n\nimport { SectionProvider } from \"../providers/AckSections.provider\"\nimport { string } from \"./templates/ack-sections.pug\"\n\n@Component({\n selector:'ack-sections',\n template:string,\n providers:[ SectionProvider ]\n //,exportAs:\"AckSections\"\n}) export class AckSections{\n //clone is more performant in most cases but things duplicate like requests and timers may result\n @Input() mode:\"calculate\"|\"clone\" = \"calculate\"\n\n @Input() zIndex:number = 19\n\n @ContentChild(\"table\") table!: TemplateRef<any>\n @ContentChild(\"headerWrap\") headerWrap!: TemplateRef<any>\n @ContentChild(\"bodyCell\") bodyCell!: TemplateRef<any>\n @ContentChild(\"leftBodyWrap\") leftBodyWrap!: TemplateRef<any>\n @ContentChild(\"rightBodyWrap\") rightBodyWrap!: TemplateRef<any>\n\n //@ContentChild(\"header\") header:TemplateRef<any>\n //@ContentChild(\"footer\") footer:TemplateRef<any>\n //@ContentChild(\"leftBody\") leftBody:TemplateRef<any>\n //@ContentChild(\"rightBody\") rightBody:TemplateRef<any>\n\n htmlHeightModel!: number\n\n headerHeight!: number\n leftBodyWidth!: number\n footerHeight!: number\n rightBodyWidth!: number\n\n constructor(\n public SectionProvider:SectionProvider,\n public ElementRef:ElementRef\n ){\n const elmStyle = ElementRef.nativeElement.style\n\n elmStyle.height = \"100%\"\n elmStyle.display = \"block\"\n }\n}","import { Directive, TemplateRef, ContentChild } from \"@angular/core\"\nimport { SectionProvider } from \"../providers/AckSections.provider\"\n\n@Directive({\n selector:\"ack-section-templates\"\n}) export class AckSectionTemplates{\n inited!: boolean\n pushed!: boolean\n\n @ContentChild('sectionHeader') header!: TemplateRef<any>\n @ContentChild('sectionFooter') footer!: TemplateRef<any>\n @ContentChild('sectionLeftBody') leftBody!: TemplateRef<any>\n @ContentChild('sectionRightBody') rightBody!: TemplateRef<any>\n\n constructor(\n public SectionProvider:SectionProvider\n ){}\n\n ngAfterViewInit(){\n Promise.resolve().then(()=>{\n this.check()\n this.inited = true\n })\n }\n\n ngOnChanges(){\n if( this.inited ){\n this.check()\n }\n }\n\n check(){\n if( this.pushed )return\n\n if( this.header ){\n this.SectionProvider.headerTemplates.unshift( this.header )\n }\n\n if( this.footer ){\n this.SectionProvider.footerTemplates.unshift( this.footer )\n }\n\n if( this.leftBody ){\n this.SectionProvider.leftBodyTemplates.unshift( this.leftBody )\n }\n\n if( this.rightBody ){\n this.SectionProvider.rightBodyTemplates.unshift( this.rightBody )\n }\n\n this.pushed = true\n }\n\n ngOnDestroy(){\n Promise.resolve().then(()=>this.unregister())\n }\n\n unregister(){\n this.pushed = false\n this.SectionProvider.unregisterHeaderTemplate( this.header )\n this.SectionProvider.unregisterFooterTemplate( this.footer )\n this.SectionProvider.unregisterTemplate( this.leftBody )\n this.SectionProvider.unregisterTemplate( this.rightBody )\n }\n}","import { Component } from \"@angular/core\"\nconst template=\n'<div style=\"display:inline-block;cursor:pointer;border:3px solid white;border-radius:50%;background-color:#666;color:white;text-align:center;font-family:Arial\">'+\n '<div style=\"font-weight:bold;line-height:22px;font-size:23px;height:25px;width:25px\">x</div>'+\n'</div>'\n\n@Component({\n selector:'ack-close-icon',\n template:template\n}) export class AckCloseIcon{}","import {\n Component,\n Input,\n Output,\n EventEmitter,\n ElementRef\n} from \"@angular/core\"\n\n// import { AckApp } from \"../providers/AckApp.provider\"\nimport { animations } from \"ack-angular-fx\"\n\n@Component({\n selector:'ack-modal-layout',\n templateUrl: './ack-modal-layout.component.html',\n animations\n}) export class AckModalLayout {\n @Input() zIndex: number | string = 20\n @Output() close: EventEmitter<AckModalLayout> = new EventEmitter()\n @Input() allowClose: boolean | number = true\n\n @Input() wrapStyle: any\n \n @Input() wrapContentClass: any\n @Input() wrapCellStyle: any\n \n @Input() backgroundColor: any\n @Input() valign: 'top' | 'center' | 'bottom' = 'top'\n \n @Input() isModelMode: boolean | number = false\n @Input() showModel: boolean | number = true // when using, do not allow to be undefined\n @Output() showModelChange: EventEmitter<boolean> = new EventEmitter()\n //@Input() template:ElementRef<any>\n\n constructor(\n public element:ElementRef,\n // public AckApp:AckApp\n ){\n //after possible double click, close on outside content click\n setTimeout(()=>this.clickListenForClose(), 400)\n }\n\n clickListenForClose(){\n this.element.nativeElement.addEventListener('click', (event: any)=>{\n if(!this.allowClose)return false\n\n const eTar = event.srcElement || event.toElement || event.target\n const isDirectChild = eTar == this.element.nativeElement.children[0] || eTar == this.element.nativeElement.children[0].children[0]\n\n if( isDirectChild ){\n this.fireClose()\n }\n\n return true\n })\n }\n\n ngOnInit(){\n return Promise.resolve().then(()=>{\n if( this.showModel!==undefined && this.showModelChange.observers.length ){\n this.isModelMode = true\n }\n })\n }\n\n fireClose(){\n this.showModelChange.emit( this.showModel=false )\n this.close.emit(this)\n }\n}\n","<div *ngIf=\"showModel || !isModelMode\"\n [@fadeInOutUp]=\"1\"\n style=\"\n position: fixed;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n overflow: auto;\n \"\n [style.z-index]=\"zIndex || 20\"\n>\n <div\n style=\"height: 100%; width: 100%; padding: 20px; display: inline-table\"\n [ngStyle]=\"{ 'background-color': backgroundColor || 'rgba(0,0,0,.7)' }\"\n >\n <table\n style=\"height: 100%; margin: auto\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"\n [ngStyle]=\"wrapStyle\"\n >\n <tr>\n <td (click)=\"allowClose ? fireClose() : 0\"></td>\n </tr>\n <tr>\n <td [attr.valign]=\"valign\" [ngStyle]=\"wrapCellStyle\" [ngClass]=\"wrapContentClass\">\n <div *ngIf=\"allowClose\" style=\"position: relative\">\n <div style=\"position: absolute;bottom: -17px;right: -16px;z-index: 20;\">\n <ack-close-icon (click)=\"fireClose()\"></ack-close-icon>\n </div>\n </div>\n <ng-content></ng-content>\n </td>\n </tr>\n <tr>\n <td (click)=\"allowClose ? fireClose() : 0\"></td>\n </tr>\n </table>\n </div>\n</div>\n","import {\n ContentChild,\n //Directive,\n Component,\n Input,\n Output,\n EventEmitter,\n ElementRef,\n\n TemplateRef,\n ViewChild,\n} from \"@angular/core\"\n\nimport { AckApp } from \"../providers/AckApp.provider\"\n\n@Component({\n selector:\"ack-modal\",\n templateUrl: './ack-modal.component.html',\n}) export class AckModal{\n @ContentChild('body') body!:TemplateRef<any>\n @ViewChild('placeholder') layout!: TemplateRef<any>\n\n //one way binds\n @Input() inline?:boolean\n @Input() isModelMode?: boolean | number\n @Input() zIndex:number = 20\n \n @Input() valign: 'top' | 'center' | 'bottom' = 'top'\n @Input() wrapStyle: any\n @Input() wrapCellStyle: any\n @Input() wrapContentClass: any\n @Input() backgroundColor?: string\n \n @Input() allowClose:boolean = true\n\n //two way binds\n @Input() showModel?: boolean | number\n @Output() showModelChange:EventEmitter<boolean> = new EventEmitter()\n\n //one way expression binds\n @Output() close:EventEmitter<any> = new EventEmitter()\n\n constructor(\n public element:ElementRef,\n public AckApp:AckApp\n ){\n Promise.resolve().then(() => this.determineStage())\n }\n\n determineStage():void{\n if(this.inline)return\n\n if( this.AckApp.fixedElementStage ){\n this.AckApp.registerModal(this)\n }else if( !this.AckApp.warnedFixElements ){\n this.AckApp.warnedFixElements = true\n console.warn('Please put the element tag <ack-fixed-element-stage> inside your app so <ack-modal> renders properly amongst other elements. OR set <ack-modal inline=\"true\">')\n }\n }\n\n ngOnDestroy(){\n this.AckApp.unregisterModal(this)\n }\n}\n","<ng-template #placeholder>\n <ack-modal-layout\n [zIndex] = \"zIndex\"\n [valign] = \"valign\"\n (close) = \"close.emit($event)\"\n [isModelMode] = \"isModelMode==null ? showModelChange.observers.length : isModelMode\"\n [showModel] = \"showModel\"\n (showModelChange) = \"showModelChange.emit(showModel=$event)\"\n [backgroundColor] = \"backgroundColor\"\n [wrapStyle] = \"wrapStyle\"\n [wrapContentClass]= \"wrapContentClass\"\n [wrapCellStyle] = \"wrapCellStyle\"\n [allowClose] = \"allowClose\"\n >\n <ng-template [ngTemplateOutlet]=\"body\"></ng-template>\n <ng-content *ngIf=\"!body\"></ng-content>\n </ack-modal-layout>\n</ng-template>\n\n<ng-template\n *ngIf=\"!AckApp.fixedElementStage || inline\"\n [ngTemplateOutlet]=\"layout\"\n></ng-template>\n","import { ElementRef, Component } from \"@angular/core\"\nimport { AckApp } from \"../providers/AckApp.provider\"\n\n@Component({\n selector:'ack-fixed-element-stage',\n templateUrl: './ack-fixed-element-stage.html'\n}) export class AckFixedElementStage{\n constructor(\n public AckApp:AckApp,\n public ElementRef:ElementRef\n ){\n AckApp.fixedElementStage = ElementRef\n }\n}","<ng-container *ngFor=\"let fixedElm of AckApp.fixedElms\">\n <ng-container *ngTemplateOutlet=\"fixedElm.content\"></ng-container>\n</ng-container>\n<ng-container *ngFor=\"let prompt of AckApp.prompts.prompts;let i=index\">\n <ack-modal-layout zIndex=\"99\" [allowClose]=\"0\">\n <div\n style=\"\n color:black;\n text-align: left;\n max-width: 900px;\n border: 1px solid #ddd;\n border-radius: 5px;\n margin: 1em;\n padding: 1em;\n background-color: white;\n \"\n >\n <h3 *ngIf=\"prompt.title\" style=\"margin-top: 0\">{{ prompt.title }}</h3>\n <div style=\"padding-right: 1em\">{{ prompt.message }}</div>\n <br /><br />\n <div style=\"text-align: right\">\n <a\n *ngIf=\"prompt.type=='confirm'\"\n (click)=\"prompt.emitter.emit(false)\"\n style=\"\n text-align: center;\n display: inline-block;\n min-width: 75px;\n border-radius: 3px;\n border: 1px solid #aaa;\n padding: 0 0.5em;\n margin-right: 0.5em;\n \"\n >Cancel</a\n ><a\n (click)=\"prompt.emitter.emit(true)\"\n style=\"\n text-align: center;\n display: inline-block;\n min-width: 75px;\n border-radius: 3px;\n border: 1px solid #aaa;\n padding: 0 0.5em;\n \"\n [ngStyle]=\"{'font-weight':prompt.type=='confirm' ? 'bold' : null}\"\n >OK</a\n >\n </div>\n </div></ack-modal-layout\n ></ng-container\n><ng-container *ngFor=\"let item of AckApp.modals\"\n ><ng-container *ngIf=\"!item.isModelMode || item.showModel\"\n ><ng-template [ngTemplateOutlet]=\"$any(item.layout)\"></ng-template></ng-container\n></ng-container>\n","import {\n TemplateRef, ViewChild, ElementRef,\n Component\n} from \"@angular/core\"\nimport { AckApp } from \"../providers/AckApp.provider\"\n\n@Component({\n selector:'ack-fixed-element',\n template:'<ng-template #content><ng-content></ng-content></ng-template>'\n}) export class AckFixedElement{\n @ViewChild('content') content!: TemplateRef<ElementRef>\n\n constructor(\n public AckApp:AckApp\n ){\n this.AckApp.fixedElms.push(this)\n }\n\n ngOnDestroy(){\n for(let x=this.AckApp.fixedElms.length-1; x >= 0; --x){\n const iClass = this.AckApp.fixedElms[x]\n if( iClass === this ){\n this.AckApp.fixedElms.splice(x,1)\n break\n }\n }\n }\n}","/** responsible for ack-angular pipe'in system into ackX */\nexport function invokeRotator(\n invoke:any//|(any[])=>any\n){\n return getInvokerBy(invoke)\n}\n\nexport function objectInvoker(\n object:any,\n plan:(string|any)[]\n){\n var rtn=object\n var subargs: any\n var item: any\n let newkey:string\n let key:string|string[]\n let typo:string\n\n //loop extra arguments as property collectors\n for(let x=0; x < plan.length; ++x){\n key = plan[x]\n subargs = []\n\n //undefined error catcher\n if( rtn==null ){\n typo = typeof(rtn)\n const msg = \"TypeError: Cannot read property '\"+key+\"' of \"+ typo +\". Invoke instructions: \"+ JSON.stringify(plan)\n throw new Error( msg )\n }\n\n let asFunc = key.constructor==Array\n\n //array where 1st arg is method and subs are positional arguments\n if( asFunc ){\n key = []\n key.push.apply(key, plan[x])//clone array memory, do not touch original array\n\n newkey = key.shift() as any// first arg is name of key, remove it from array\n subargs = key//what is left in array is the arguments\n key = newkey//key to string\n }\n\n item = rtn[ <string>key ]\n\n let isFunc = item && item.constructor==Function\n\n if( asFunc && !isFunc ){\n if(item==null || item.constructor!==Function ){\n typo = typeof(item)\n const msg = \"TypeError: '\"+key+\"' of \"+ typo +\" is not a function. Invoke instructions: \"+ JSON.stringify(plan)\n throw new Error( msg )\n }\n }\n\n if( isFunc ){\n rtn = item.apply(rtn, subargs)\n }else{\n rtn = item\n }\n }\n\n return rtn\n}\n\nexport function getInvokerBy(\n invoke:any\n):Function{\n const isF = typeof invoke=='function'\n\n if( isF ){\n return function(...args: any):any{\n var x = invoke(args[0]);\n args.shift()\n return objectInvoker(x, args)\n }\n }\n\n return function(...plan: any){\n const a = plan[0]\n plan[0] = plan[1]\n plan[1] = a\n\n return objectInvoker(invoke,[plan])\n }\n\n/*\n return function(args:any[]):any{\n const rtn = invoke[ args[1] ]( args[0] )\n\n for(let x=0; x<args.length; ++x){\n if( x<1 ){\n delete args[x]\n }else{\n args[ x-1 ] = args[x]\n }\n }\n\n args.length = args.length - 2\n\n return rtn\n }\n*/\n}","import { ack as ackX } from \"ack-x/es/index-browser\"\n\nexport function between(\n input: number, a: number, b: number\n) {\n if(a==null || b==null)return false\n return (input >= a && input <= b) || (input <= a && input >= b) ? true : false\n}\n\nexport function replaceMaxLength(\n input:string, max: number, replacement: string = '...'\n): string {\n if(input?.length > max) {\n return input.slice(0, max) + replacement\n }\n\n return input\n}\n\nexport function numberToPhone(\n val: number | string\n): string | unknown {\n if (val == null || !val){\n return val\n }\n\n val = String(val).replace(/[^0-9]/g, '')\n\n if ( val.length==0 )return val\n\n return '(' + val.substring(0, 3) + ') ' + val.substring(3, 6) + '-' + val.substring(6, 10)\n}\n\nexport function toNumber(val: string | number){\n return Number( numbers(val, \".\") )\n}\n\nexport function numberSuffix(\n val: number | string, rtnVal=false\n){\n var rtn = rtnVal ? val : ''\n val = Number(val)\n\n if(!val || isNaN(val))return ''\n\n var j = val % 10,\n k = val % 100;\n if (j == 1 && k != 11) {\n return rtn+\"st\";\n }\n if (j == 2 && k != 12) {\n return rtn+\"nd\";\n }\n if (j == 3 && k != 13) {\n return rtn+\"rd\";\n }\n return rtn+\"th\";\n}\n\n/** if input is array returned otherwise array created with */\nexport function array(\n input: string | any[],\n repeat?:number,\n repeatValue?: unknown | number | string\n): any[] {\n const isArray = input!=null && input.constructor == Array\n let rtn: any[] = isArray ? input as any[] : []\n\n if(!repeat && !isArray && input!=null){\n rtn.push(input)\n }\n\n if( repeat && !isNaN(Number(repeat)) ){\n const val = typeof(repeatValue)==='undefined' ? input : repeatValue\n while( rtn.length < repeat ){\n rtn.push( val )\n }\n }\n\n return rtn\n}\n\nexport function arrayOfObjects(\n input: string | any[],\n repeat?:number,\n repeatValue?: unknown | string | number\n): any[] {\n return array(input, repeat, repeatValue).map((v,i)=>({value:v, index:i}))\n}\n\nexport function markdownAnchor(input:string){\n input = input.toString().replace(/&/gi, 'amp')//possibly unneeded\n input = input.toString().replace(/ /gi,'-')\n input = input.replace(/[^a-z0-9_-]/gi,'')\n return input.toLowerCase()\n}\n\n //use with bypassSecurityTrustResourceUrl for href\nexport function textDownload(input:any){\n if(input==null)return input\n return 'data:text/plain;charset=utf-8,' + encodeURIComponent(input)\n}\n\nexport function yesno(input:any){\n if(input==null)return input\n return input ? 'yes' : 'no';\n}\n\nexport function yesNo(input:any){\n if(input==null)return input\n return input ? 'Yes' : 'No';\n}\n\nexport function boolean(input:any){\n if(input==null)return false\n\n const num = Number(input)\n if(!isNaN(num)){\n return Boolean(num) ? true : false;\n }\n\n if(input.toLowerCase){\n if( input.toLowerCase()=='true' )return true\n if( input.toLowerCase()=='false' )return false\n }\n\n return Boolean(input) ? true : false;\n}\n\nexport function bit(input:any){\n return boolean(input) ? 1 : 0;\n}\n\nexport function numbers(\n input:any,\n safeChars?:string//upto 4 acceptable characters\n){\n let xString = '[^0-9'\n\n if( safeChars ){\n if( safeChars.length>4 ){\n safeChars = safeChars.substring(0, 4)//do not allow safeChars to create a maliscous regx\n }\n\n xString += safeChars\n }\n\n xString += ']'\n const regX = new RegExp(xString, 'g')\n\n return input ? String(input).replace(regX,'') : input\n}\n\nexport function capitalizeWords(input:any){\n var reg = /[^\\W_]+[^\\s-]* */g\n return (!!input) ? input.replace(reg, function(txt:any){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()}) : ''\n}\n\n/** each sentence word is capitalized */\nexport function capitalize(input:any){\n input = pipes.capitalizeOne(input)\n var reg = /[.?!][\\s\\r\\t]+\\w/g\n return (!!input) ? input.replace(reg, pipes.capitalizeAfterSentence) : ''\n}\n\nexport function capitalizeAfterSentence(input:any){\n var reg = /[\\s\\r\\t]\\w/g\n return (!!input) ? input.replace(reg, function(txt:any){return txt.charAt(0) + txt.charAt(1).toUpperCase() + txt.substr(2).toLowerCase()}) : ''\n}\n\nexport function capitalizeOne(input:any) {\n var reg = /[^\\W_]+[^\\s-]*/\n return (!!input) ? input.replace(reg, function(txt:any){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()}) : ''\n}\n\nfunction a(name:string){\n const av = new ackX()\n return invokeRotator( av[name] )\n}\n\nimport { invokeRotator } from \"./invokeRotator\"\n\nexport const aDate = a('date')\nexport const aTime = a('time')\nexport const aMath = invokeRotator( Math )\nexport const aString = invokeRotator( String )\nexport const ack = invokeRotator( ackX )\n\n// maybe deprecated . Remove in future releases. Just an array ref of all pipes\nexport const pipes = {\n ack,\n aDate,\n aMath,\n array,\n aString,\n aTime,\n between,\n capitalize,\n capitalizeAfterSentence,\n capitalizeOne,\n capitalizeWords,\n numbers,\n numberSuffix,\n numberToPhone,\n markdownAnchor,\n replaceMaxLength,\n textDownload,\n toNumber,\n yesno,\n yesNo,\n}","import {\n TemplateRef\n //ElementRef,\n //ContentChildren\n} from '@angular/core'\n\nexport interface types{\n [index:string]:string// #ref : this.name\n}\n\nexport interface templates{\n [index:string]:TemplateRef<any>\n}\n\nexport interface options{\n types?:types\n lastTemplateName?:string\n}\n\nexport class TemplateReader{\n types: types = {}\n templates: templates = {}\n lastTemplateName!: string\n\n constructor(options?:options){\n Object.assign(this,options)\n }\n\n readTemplates( templateRefs:TemplateRef<any>[] ){\n const count = templateRefs['_results'].length\n for(let x=count-1; x >= 0; --x){\n let row = templateRefs['_results'][x]\n this.applyReferences(row._def.references, row)\n }\n\n if( this.lastTemplateName && (!this.templates[this.lastTemplateName] || !templateRefs.length) ){\n this.afterReadTemplates( templateRefs )\n }\n }\n\n //look to apply last template as a specified templates[name]\n afterReadTemplates( templateRefs:TemplateRef<any>[] ){\n const index = templateRefs['_results'].length-1\n const lastTemplate = templateRefs['_results'][ index ]\n\n if( !lastTemplate || !this.lastTemplateName )return;\n\n const matched = this.applyReferences(lastTemplate._def.references, lastTemplate)\n if( !matched ){\n this.templates[this.lastTemplateName] = lastTemplate\n }\n }\n\n applyReferences(refs:any, row:TemplateRef<any>):boolean{\n for(let x in refs){\n if( this.types[x] ){\n this.templates[ this.types[x] ] = row\n return true\n }\n }\n\n return false\n }\n}","export const string = \"<div [ngClass]=\\\"{'border-grey-6x border-top':stylize}\\\"></div><div *ngFor=\\\"let item of array|array\\\" (click)=\\\"selectItem(item)\\\" [ngClass]=\\\"getItemClass(item)\\\"><ng-template *ngIf=\\\"TemplateReader.templates.selected && isItemSelected(item)\\\" [ngTemplateOutlet]=\\\"TemplateReader.templates.selected\\\" [ngTemplateOutletContext]=\\\"{item:item}\\\"></ng-template><ng-template *ngIf=\\\"TemplateReader.templates.templateRef && (!TemplateReader.templates.selected || !isItemSelected(item))\\\" [ngTemplateOutlet]=\\\"TemplateReader.templates.templateRef\\\" [ngTemplateOutletContext]=\\\"{item:item, selected:isItemSelected(item)}\\\"></ng-template><span *ngIf=\\\"!TemplateReader.templates.templateRef\\\">{{ item }}</span></div>\"","import { Pipe } from '@angular/core'\n\n@Pipe({name: 'keys'}) export class KeysPipe {\n transform(input:any){\n const type = typeof(input)=='object'\n const isOb = input && type\n const isArray = isOb && input.constructor == Array\n\n if(isArray){\n return input.map((_value: any, index: any)=>index)\n }\n\n return input ? Object.keys(input) : []\n }\n}\n","import { DomSanitizer } from '@angular/platform-browser'\nimport { KeysPipe } from './pipes/keys.pipe'\nimport * as pipesUtils from \"./pipes.class\"\nimport { Pipe } from '@angular/core'\n\nexport { KeysPipe } from './pipes/keys.pipe'\n\n/* ONLY THIS FILE */\n @Pipe({name: 'indexTrack'}) export class IndexTrack {\n transform(_x: any) {\n return function(index: any){return index}\n }\n }\n\n @Pipe({name: 'stringify'}) export class Stringify {\n transform(input: any, spaces=0) {\n return JSON.stringify(input, null, spaces)\n }\n }\n\n @Pipe({name: 'array'}) export class ForceArray {\n transform(input: any, repeat?: any, repeatValue?: any) {\n return pipesUtils.array(input, repeat, repeatValue)\n }\n }\n\n @Pipe({name: 'arrayOfObjects'}) export class ArrayOfObjects {\n transform(input: any, repeat?: number | undefined, repeatValue?: unknown) {\n return pipesUtils.arrayOfObjects(input, repeat, repeatValue)\n }\n }\n\n @Pipe({name: 'safeUrl'}) export class SafeUrl {\n constructor(private domSanitizer: DomSanitizer) {}\n transform(input: any) {\n return this.domSanitizer.bypassSecurityTrustResourceUrl(input)\n }\n }\n\n @Pipe({name: 'numberWord'}) export class NumberWord {\n constructor() {}\n transform(input: any, number: any) {\n return input + (number && number==1 ? '' : 's')\n }\n }\n\n @Pipe({name: 'endNumberWord'}) export class EndNumberWord {\n constructor() {}\n transform(input: any) {\n return input && input==1 ? '' : 's'\n }\n }\n\n @Pipe({name: 'safeHtml'}) export class SafeHtml {\n constructor(private domSanitizer: DomSanitizer) {}\n transform(input: any) {\n return this.domSanitizer.bypassSecurityTrustHtml(input)\n }\n }\n\n @Pipe({name: 'safeStyle'}) export class SafeStyle {\n constructor(private domSanitizer: DomSanitizer) {}\n transform(input: any) {\n return this.domSanitizer.bypassSecurityTrustStyle(input)\n }\n }\n/* end: only this file */\n\n\n/** (input>=a