@stratusjs/angular 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular.bundle.js +7189 -5777
- package/dist/angular.bundle.min.js +1 -1
- package/package.json +1 -1
- package/src/app.module.js +8 -2
- package/src/app.module.js.map +1 -1
- package/src/app.module.min.js +1 -1
- package/src/app.module.ts +4 -0
- package/src/base/base.component.min.js +1 -1
- package/src/confirm-dialog/confirm-dialog.component.min.js +1 -1
- package/src/core/root.component.min.js +1 -1
- package/src/editor/citation-dialog.component.min.js +1 -1
- package/src/editor/code-view-dialog.component.min.js +1 -1
- package/src/editor/editor.component.min.js +1 -1
- package/src/editor/link-dialog.component.min.js +1 -1
- package/src/editor/media-dialog.component.min.js +1 -1
- package/src/editor/quill-break-blot.plugin.js +38 -0
- package/src/editor/quill-break-blot.plugin.js.map +1 -0
- package/src/editor/quill-break-blot.plugin.min.js +1 -0
- package/src/editor/quill-html-edit.plugin.js +164 -0
- package/src/editor/quill-html-edit.plugin.js.map +1 -0
- package/src/editor/quill-html-edit.plugin.min.js +1 -0
- package/src/editor/quill-image-format.plugin.js +50 -0
- package/src/editor/quill-image-format.plugin.js.map +1 -0
- package/src/editor/quill-image-format.plugin.min.js +1 -0
- package/src/editor/quill-input-button.plugin.js +98 -0
- package/src/editor/quill-input-button.plugin.js.map +1 -0
- package/src/editor/quill-input-button.plugin.min.js +1 -0
- package/src/froala/editor/froala-editor.directive.js +328 -0
- package/src/froala/editor/froala-editor.directive.js.map +1 -0
- package/src/froala/editor/froala-editor.directive.min.js +1 -0
- package/src/froala/editor/froala-editor.module.js +37 -0
- package/src/froala/editor/froala-editor.module.js.map +1 -0
- package/src/froala/editor/froala-editor.module.min.js +1 -0
- package/src/froala/editor/index.js +22 -0
- package/src/froala/editor/index.js.map +1 -0
- package/src/froala/editor/index.min.js +1 -0
- package/src/froala/plugins/citationManager.min.js +1 -1
- package/src/froala/plugins/image_manager.js +364 -0
- package/src/froala/plugins/image_manager.js.map +1 -0
- package/src/froala/plugins/image_manager.min.js +1 -0
- package/src/froala/plugins/inputButton.min.js +1 -1
- package/src/froala/plugins/mediaManager.min.js +1 -1
- package/src/froala/plugins/menuButton.min.js +1 -1
- package/src/froala/view/froala-view.directive.js +49 -0
- package/src/froala/view/froala-view.directive.js.map +1 -0
- package/src/froala/view/froala-view.directive.min.js +1 -0
- package/src/froala/view/froala-view.module.js +37 -0
- package/src/froala/view/froala-view.module.js.map +1 -0
- package/src/froala/view/froala-view.module.min.js +1 -0
- package/src/froala/view/index.js +22 -0
- package/src/froala/view/index.js.map +1 -0
- package/src/froala/view/index.min.js +1 -0
- package/src/media-selector/media-selector.component.min.js +1 -1
- package/src/quill-plugins/quill-html-edit.plugin.min.js +1 -1
- package/src/quill-plugins/quill-image-format.plugin.min.js +1 -1
- package/src/root/root.component.js +43 -0
- package/src/root/root.component.js.map +1 -0
- package/src/root/root.component.min.js +1 -0
- package/src/selector/selector.component.min.js +1 -1
- package/src/test/test.directive.min.js +1 -1
- package/src/timezone-selector/timezone-selector.component.html +11 -0
- package/src/timezone-selector/timezone-selector.component.js +224 -0
- package/src/timezone-selector/timezone-selector.component.js.map +1 -0
- package/src/timezone-selector/timezone-selector.component.min.html +1 -0
- package/src/timezone-selector/timezone-selector.component.min.js +1 -0
- package/src/timezone-selector/timezone-selector.component.ts +254 -0
- package/src/tree/tree-dialog.component.html +1 -1
- package/src/tree/tree-dialog.component.js +2 -1
- package/src/tree/tree-dialog.component.js.map +1 -1
- package/src/tree/tree-dialog.component.min.html +1 -1
- package/src/tree/tree-dialog.component.min.js +1 -1
- package/src/tree/tree-dialog.component.ts +8 -4
- package/src/tree/tree-node.component.min.js +1 -1
- package/src/tree/tree.component.min.js +1 -1
- package/src/core/dialog.interface.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["@angular/core","@angular/cdk/drag-drop","rxjs","@angular/platform-browser","@angular/material/icon","@stratusjs/runtime/stratus","lodash","@stratusjs/core/environment","../core/root.component","@stratusjs/angularjs/services/registry","@stratusjs/core/events/eventManager","@angular/cdk/scrolling"],function(e,t){"use strict";var i,r,s,o,n,a,l,d,c,h,u,g,p,m,f,v,y,I=this&&this.__decorate||function(e,t,i,r){var s,o=arguments.length,n=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},S=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};t&&t.id;function b(e,t){return Array.prototype.indexOf.call(e,t)}return{setters:[function(e){i=e},function(e){r=e},function(e){s=e},function(e){o=e},function(e){n=e},function(e){a=e},function(e){l=e},function(e){d=e},function(e){c=e},function(e){h=e},function(e){u=e},function(e){g=e}],execute:function(){"@stratusjs/angular",p="media-selector",m=d.cookie("env")?"":".min",f=`${a.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"").replace(/\/dist\/$/,"/src/")}`,v=(e,t)=>l.default.has(e,t)&&!l.default.isEmpty(l.default.get(e,t)),y=class extends c.RootComponent{constructor(e,t,i,r,o){super(),this.iconRegistry=e,this.sanitizer=t,this.ref=i,this.elementRef=r,this.viewportRuler=o,this.title=p+"_component",this._=l.default,this.has=v,this.log=console.log,this.Stratus=a.Stratus,this.registry=new h.Registry,this.onChange=new s.Subject,this.svgIcons={},this.styled=!1,this.empty=!1,this.libraryDisplay=!1,this.isSelector=!0,this.isGrid=!0,this.enterPredicate=(e,t)=>{if(t===this.placeholder)return!0;if(d.cookie("env")&&console.log("entering predicate..."),t!==this.activeContainer)return!1;const i=this.placeholder.element.nativeElement,r=e.dropContainer.element.nativeElement,s=t.element.nativeElement,o=b(s.parentElement.children,this.sourceList?i:r),n=b(s.parentElement.children,s);return this.sourceList||(this.sourceIndex=o,this.sourceList=e.dropContainer,i.style.width=r.clientWidth+"px",i.style.height=r.clientHeight+"px",r.parentElement.removeChild(r)),this.targetIndex=n,this.targetList=t,d.cookie("env")&&console.log("predicate:",this.sourceIndex,"->",this.targetIndex),i.style.display="",s.parentElement.insertBefore(i,n>o?s.nextSibling:s),this.placeholder._dropListRef.enter(e._dragRef,e.element.nativeElement.offsetLeft,e.element.nativeElement.offsetTop),!1},this.uid=l.default.uniqueId(`sa_${l.default.snakeCase(p)}_component_`),a.Stratus.Instances[this.uid]=this,this.dataSub=new s.Observable(e=>this.dataDefer(e)),this.targetList=null,this.sourceList=null,l.default.forEach({media_selector_add:a.Stratus.BaseUrl+"sitetheorycore/images/icons/actionButtons/add.svg",media_selector_clear:a.Stratus.BaseUrl+"sitetheorycore/images/icons/actionButtons/clear.svg",media_selector_delete:a.Stratus.BaseUrl+"sitetheorycore/images/icons/actionButtons/delete.svg",media_selector_edit:a.Stratus.BaseUrl+"sitetheorycore/images/icons/actionButtons/edit.svg",media_selector_info:a.Stratus.BaseUrl+"sitetheorycore/images/icons/actionButtons/info.svg",media_selector_image:a.Stratus.BaseUrl+"sitetheorymedia/images/mediaTypeIcons/media-icon-image.svg",media_selector_video:a.Stratus.BaseUrl+"sitetheorymedia/images/mediaTypeIcons/media-icon-video.svg",media_selector_audio:a.Stratus.BaseUrl+"sitetheorymedia/images/mediaTypeIcons/media-icon-audio.svg",media_selector_document:a.Stratus.BaseUrl+"sitetheorymedia/images/mediaTypeIcons/media-icon-document.svg"},(i,r)=>e.addSvgIcon(r,t.bypassSecurityTrustResourceUrl(i)).getNamedSvgIcon(r)),a.Stratus.Internals.CssLoader(`${f}${p}/${p}.component${m}.css`).then(()=>{this.styled=!0,this.refresh()}).catch(e=>{console.warn("Issue detected in CSS Loader for Component:",this),console.error(e),this.styled=!0,this.refresh()}),this.hydrate(r,t,["title","uid","target","targetSuffix","id","manifest","decouple","direct","api","urlRoot","type","property","endpoint","_","has","log","Stratus","registry","fetched","data","collection","model","dataSub","onChange","subscriber","eventID","svgIcons","styled","empty","libraryDisplay","isSelector","isGrid","listGroup","placeholder","targetList","targetIndex","sourceList","sourceIndex","activeContainer","iconRegistry","sanitizer","ref","elementRef","viewportRuler","drop","moveModel","goToUrl","remove","fetchData","dataDefer","dataRef","onDataChange","prioritize","getSvg","addSvgIcon","toggleLibrary","showDetails","deleteMedia","removeFromSelected","dragEntered","move","moveItemInGrid","enterPredicate","getPointerPositionOnPage","hydrate","disableRefresh","stagger","reloading","refresh","ngOnDestroy"]),this.eventID=`${this.target}:${this.id}:${this.property}`,this.fetchData().then(e=>{if(!(e&&e instanceof u.EventManager))return void console.warn("Unable to bind data from Registry!");const t=()=>{e.completed&&(this.dataDefer(this.subscriber),this.prioritize(),this.refresh())};e.on("change",t),t()})}drop(e){const t=this.dataRef();if(!t||!t.length)return;d.cookie("env")&&console.log("drop:",e.previousContainer.id,e.container.id),this.isGrid&&this.moveItemInGrid(t)||(this.isGrid&&d.cookie("env")&&console.warn("moving item in grid failed. attempting fallback."),r.moveItemInArray(t,e.previousIndex,e.currentIndex));let i=0;l.default.forEach(t,e=>e.priority=i++),this.model.trigger("change")}moveModel(e,t){const i=this.dataRef();if(!i||!i.length)return;r.moveItemInArray(i,e,t);let s=0;l.default.forEach(i,e=>e.priority=s++),this.model.trigger("change")}goToUrl(e){e&&e.contentType?window.open(e.contentType.editUrl+"?id="+e.id,"_blank"):console.error("unable to execute goToUrl() because a valid model content was not provided.")}remove(e){const t=this.dataRef();if(!t||!t.length)return console.error("unable to remove model from selection:",t),void this.refresh();let i=t.indexOf(e);if(-1===i){const r=t.map(t=>e.id===t.id?t:null).filter(e=>e);l.default.isArray(r)&&r.length&&(i=t.indexOf(l.default.first(r)))}-1!==i?(t.splice(i,1),this.model.trigger("change"),this.removeFromSelected(e.id)):console.error("unable to find model:",e,"in selection:",t)}fetchData(){return this.fetched?this.fetched:this.fetched=this.registry.fetch(a.Stratus.Select(this.elementRef.nativeElement),this)}dataDefer(e){if(this.subscriber=this.subscriber||e,!this.subscriber||!this.model||!this.model.completed)return void setTimeout(()=>{this.dataDefer(e)},500);const t=this.dataRef();this.empty=!t.length,this.subscriber.next(t),this.refresh()}dataRef(){if(!this.model)return[];const e=this.model.get(this.property);return e&&l.default.isArray(e)?e:[]}onDataChange(){this.prioritize(),this.dataDefer(this.subscriber),this.refresh()}prioritize(){const e=this.dataRef();if(!e||!e.length)return;let t=0;l.default.forEach(e,e=>e.priority=t++)}getSvg(e,t){const i=this.addSvgIcon(e,t);return new s.Observable(t=>{this.iconRegistry.getNamedSvgIcon(i).subscribe({error(t){console.error(`getSvg(${e}): ${t}`)},complete(){t.next(i)}})})}addSvgIcon(e,t){if(e in this.svgIcons)return this.svgIcons[e];t||(t={});const i=this.svgIcons[e]=l.default.uniqueId("media_selector_svg");return this.iconRegistry.addSvgIcon(i,this.sanitizer.bypassSecurityTrustResourceUrl(e),t),i}toggleLibrary(){this.libraryDisplay=!this.libraryDisplay,a.Stratus.Environment.trigger(this.eventID,"toggleLibrary"),a.Stratus.Environment.trigger(this.eventID+":toggleLibrary",this.libraryDisplay)}showDetails(e){a.Stratus.Environment.trigger(this.eventID,"showDetails"),a.Stratus.Environment.trigger(this.eventID+":showDetails",e)}deleteMedia(e){a.Stratus.Environment.trigger(this.eventID,"deleteMedia"),a.Stratus.Environment.trigger(this.eventID+":deleteMedia",e)}removeFromSelected(e){a.Stratus.Environment.trigger(this.eventID,"removeFromSelected"),a.Stratus.Environment.trigger(this.eventID+":removeFromSelected",e)}dragEntered(e){const t=this.dataRef();if(!t||!t.length)return;const i=e.item,s=e.container,o=i.data,n=s.data,a=s.element.nativeElement,c=a.querySelector(".cdk-drag-placeholder");a.removeChild(c),a.parentElement.insertBefore(c,a),d.cookie("env")&&console.log("media move:",o,"->",n),r.moveItemInArray(t,o,n);let h=0;l.default.forEach(t,e=>e.priority=h++),this.model.trigger("change")}move(e){const t=this.getPointerPositionOnPage(e.event);!l.default.isUndefined(this.listGroup)&&this.listGroup?l.default.isUndefined(this.listGroup._items)?console.warn("this.listGroup._items does not exist:",this.listGroup):this.listGroup._items.forEach(e=>{(function(e,t,i){const{top:r,bottom:s,left:o,right:n}=e.element.nativeElement.getBoundingClientRect();return i>=r&&i<=s&&t>=o&&t<=n})(e,t.x,t.y)&&(this.activeContainer=e)}):console.warn("this.listGroup does not exist:",this)}moveItemInGrid(e){if(d.cookie("env")&&console.log("moveItemInGrid:",e),!this.targetList)return!1;const t=this.placeholder.element.nativeElement,i=t.parentElement;return t.style.display="none",i.removeChild(t),i.appendChild(t),i.insertBefore(this.sourceList.element.nativeElement,i.children[this.sourceIndex]),this.targetList=null,this.sourceList=null,this.sourceIndex!==this.targetIndex&&(r.moveItemInArray(e,this.sourceIndex,this.targetIndex),!0)}getPointerPositionOnPage(e){const t=function(e){return e.type.startsWith("touch")}(e)?e.touches[0]||e.changedTouches[0]:e,i=this.viewportRuler.getViewportScrollPosition();return{x:t.pageX-i.left,y:t.pageY-i.top}}},I([i.Input(),S("design:type",String)],y.prototype,"target",void 0),I([i.Input(),S("design:type",String)],y.prototype,"targetSuffix",void 0),I([i.Input(),S("design:type",Number)],y.prototype,"id",void 0),I([i.Input(),S("design:type",Boolean)],y.prototype,"manifest",void 0),I([i.Input(),S("design:type",Boolean)],y.prototype,"decouple",void 0),I([i.Input(),S("design:type",Boolean)],y.prototype,"direct",void 0),I([i.Input(),S("design:type",Object)],y.prototype,"api",void 0),I([i.Input(),S("design:type",String)],y.prototype,"urlRoot",void 0),I([i.Input(),S("design:type",String)],y.prototype,"type",void 0),I([i.Input(),S("design:type",String)],y.prototype,"property",void 0),I([i.Input(),S("design:type",String)],y.prototype,"endpoint",void 0),I([i.ViewChild(r.CdkDropListGroup),S("design:type",r.CdkDropListGroup)],y.prototype,"listGroup",void 0),I([i.ViewChild(r.CdkDropList),S("design:type",r.CdkDropList)],y.prototype,"placeholder",void 0),y=I([i.Component({selector:"sa-"+p,templateUrl:`${f}/${p}/${p}.component${m}.html`}),S("design:paramtypes",[n.MatIconRegistry,o.DomSanitizer,i.ChangeDetectorRef,i.ElementRef,g.ViewportRuler])],y),e("MediaSelectorComponent",y)}}});
|
|
1
|
+
System.register(["@angular/core","@angular/cdk/drag-drop","rxjs","@angular/platform-browser","@angular/material/icon","@stratusjs/runtime/stratus","lodash","@stratusjs/core/environment","../core/root.component","@stratusjs/angularjs/services/registry","@stratusjs/core/events/eventManager","@angular/cdk/scrolling"],function(e,t){"use strict";var i,r,s,o,n,a,l,d,c,h,u,g,p,m,f,v,y,I=this&&this.__decorate||function(e,t,i,r){var s,o=arguments.length,n=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},S=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};t&&t.id;function b(e,t){return Array.prototype.indexOf.call(e,t)}return{setters:[function(e){i=e},function(e){r=e},function(e){s=e},function(e){o=e},function(e){n=e},function(e){a=e},function(e){l=e},function(e){d=e},function(e){c=e},function(e){h=e},function(e){u=e},function(e){g=e}],execute:function(){"@stratusjs/angular",p="media-selector",m=d.cookie("env")?"":".min",f=`${a.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"").replace(/\/dist\/$/,"/src/")}`,v=(e,t)=>l.default.has(e,t)&&!l.default.isEmpty(l.default.get(e,t)),y=class extends c.RootComponent{constructor(e,t,i,r,o){super(),this.iconRegistry=e,this.sanitizer=t,this.ref=i,this.elementRef=r,this.viewportRuler=o,this.title=p+"_component",this._=l.default,this.has=v,this.log=console.log,this.Stratus=a.Stratus,this.registry=new h.Registry,this.onChange=new s.Subject,this.svgIcons={},this.styled=!1,this.empty=!1,this.libraryDisplay=!1,this.isSelector=!0,this.isGrid=!0,this.enterPredicate=(e,t)=>{if(t===this.placeholder)return!0;if(d.cookie("env")&&console.log("entering predicate..."),t!==this.activeContainer)return!1;const i=this.placeholder.element.nativeElement,r=e.dropContainer.element.nativeElement,s=t.element.nativeElement,o=b(s.parentElement.children,this.sourceList?i:r),n=b(s.parentElement.children,s);return this.sourceList||(this.sourceIndex=o,this.sourceList=e.dropContainer,i.style.width=`${r.clientWidth}px`,i.style.height=`${r.clientHeight}px`,r.parentElement.removeChild(r)),this.targetIndex=n,this.targetList=t,d.cookie("env")&&console.log("predicate:",this.sourceIndex,"->",this.targetIndex),i.style.display="",s.parentElement.insertBefore(i,n>o?s.nextSibling:s),this.placeholder._dropListRef.enter(e._dragRef,e.element.nativeElement.offsetLeft,e.element.nativeElement.offsetTop),!1},this.uid=l.default.uniqueId(`sa_${l.default.snakeCase(p)}_component_`),a.Stratus.Instances[this.uid]=this,this.dataSub=new s.Observable(e=>this.dataDefer(e)),this.targetList=null,this.sourceList=null,l.default.forEach({media_selector_add:`${a.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/add.svg`,media_selector_clear:`${a.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/clear.svg`,media_selector_delete:`${a.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,media_selector_edit:`${a.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`,media_selector_info:`${a.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/info.svg`,media_selector_image:`${a.Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-image.svg`,media_selector_video:`${a.Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-video.svg`,media_selector_audio:`${a.Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-audio.svg`,media_selector_document:`${a.Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-document.svg`},(i,r)=>e.addSvgIcon(r,t.bypassSecurityTrustResourceUrl(i)).getNamedSvgIcon(r)),a.Stratus.Internals.CssLoader(`${f}${p}/${p}.component${m}.css`).then(()=>{this.styled=!0,this.refresh()}).catch(e=>{console.warn("Issue detected in CSS Loader for Component:",this),console.error(e),this.styled=!0,this.refresh()}),this.hydrate(r,t,["title","uid","target","targetSuffix","id","manifest","decouple","direct","api","urlRoot","type","property","endpoint","_","has","log","Stratus","registry","fetched","data","collection","model","dataSub","onChange","subscriber","eventID","svgIcons","styled","empty","libraryDisplay","isSelector","isGrid","listGroup","placeholder","targetList","targetIndex","sourceList","sourceIndex","activeContainer","iconRegistry","sanitizer","ref","elementRef","viewportRuler","drop","moveModel","goToUrl","remove","fetchData","dataDefer","dataRef","onDataChange","prioritize","getSvg","addSvgIcon","toggleLibrary","showDetails","deleteMedia","removeFromSelected","dragEntered","move","moveItemInGrid","enterPredicate","getPointerPositionOnPage","hydrate","disableRefresh","stagger","reloading","refresh","ngOnDestroy"]),this.eventID=`${this.target}:${this.id}:${this.property}`,this.fetchData().then(e=>{if(!(e&&e instanceof u.EventManager))return void console.warn("Unable to bind data from Registry!");const t=()=>{e.completed&&(this.dataDefer(this.subscriber),this.prioritize(),this.refresh())};e.on("change",t),t()})}drop(e){const t=this.dataRef();if(!t||!t.length)return;d.cookie("env")&&console.log("drop:",e.previousContainer.id,e.container.id),this.isGrid&&this.moveItemInGrid(t)||(this.isGrid&&d.cookie("env")&&console.warn("moving item in grid failed. attempting fallback."),r.moveItemInArray(t,e.previousIndex,e.currentIndex));let i=0;l.default.forEach(t,e=>e.priority=i++),this.model.trigger("change")}moveModel(e,t){const i=this.dataRef();if(!i||!i.length)return;r.moveItemInArray(i,e,t);let s=0;l.default.forEach(i,e=>e.priority=s++),this.model.trigger("change")}goToUrl(e){e&&e.contentType?window.open(e.contentType.editUrl+"?id="+e.id,"_blank"):console.error("unable to execute goToUrl() because a valid model content was not provided.")}remove(e){const t=this.dataRef();if(!t||!t.length)return console.error("unable to remove model from selection:",t),void this.refresh();let i=t.indexOf(e);if(-1===i){const r=t.map(t=>e.id===t.id?t:null).filter(e=>e);l.default.isArray(r)&&r.length&&(i=t.indexOf(l.default.first(r)))}-1!==i?(t.splice(i,1),this.model.trigger("change"),this.removeFromSelected(e.id)):console.error("unable to find model:",e,"in selection:",t)}fetchData(){return this.fetched?this.fetched:this.fetched=this.registry.fetch(a.Stratus.Select(this.elementRef.nativeElement),this)}dataDefer(e){if(this.subscriber=this.subscriber||e,!this.subscriber||!this.model||!this.model.completed)return void setTimeout(()=>{this.dataDefer(e)},500);const t=this.dataRef();this.empty=!t.length,this.subscriber.next(t),this.refresh()}dataRef(){if(!this.model)return[];const e=this.model.get(this.property);return e&&l.default.isArray(e)?e:[]}onDataChange(){this.prioritize(),this.dataDefer(this.subscriber),this.refresh()}prioritize(){const e=this.dataRef();if(!e||!e.length)return;let t=0;l.default.forEach(e,e=>e.priority=t++)}getSvg(e,t){const i=this.addSvgIcon(e,t);return new s.Observable(t=>{this.iconRegistry.getNamedSvgIcon(i).subscribe({error(t){console.error(`getSvg(${e}): ${t}`)},complete(){t.next(i)}})})}addSvgIcon(e,t){if(e in this.svgIcons)return this.svgIcons[e];t||(t={});const i=this.svgIcons[e]=l.default.uniqueId("media_selector_svg");return this.iconRegistry.addSvgIcon(i,this.sanitizer.bypassSecurityTrustResourceUrl(e),t),i}toggleLibrary(){this.libraryDisplay=!this.libraryDisplay,a.Stratus.Environment.trigger(this.eventID,"toggleLibrary"),a.Stratus.Environment.trigger(`${this.eventID}:toggleLibrary`,this.libraryDisplay)}showDetails(e){a.Stratus.Environment.trigger(this.eventID,"showDetails"),a.Stratus.Environment.trigger(`${this.eventID}:showDetails`,e)}deleteMedia(e){a.Stratus.Environment.trigger(this.eventID,"deleteMedia"),a.Stratus.Environment.trigger(`${this.eventID}:deleteMedia`,e)}removeFromSelected(e){a.Stratus.Environment.trigger(this.eventID,"removeFromSelected"),a.Stratus.Environment.trigger(`${this.eventID}:removeFromSelected`,e)}dragEntered(e){const t=this.dataRef();if(!t||!t.length)return;const i=e.item,s=e.container,o=i.data,n=s.data,a=s.element.nativeElement,c=a.querySelector(".cdk-drag-placeholder");a.removeChild(c),a.parentElement.insertBefore(c,a),d.cookie("env")&&console.log("media move:",o,"->",n),r.moveItemInArray(t,o,n);let h=0;l.default.forEach(t,e=>e.priority=h++),this.model.trigger("change")}move(e){const t=this.getPointerPositionOnPage(e.event);!l.default.isUndefined(this.listGroup)&&this.listGroup?l.default.isUndefined(this.listGroup._items)?console.warn("this.listGroup._items does not exist:",this.listGroup):this.listGroup._items.forEach(e=>{(function(e,t,i){const{top:r,bottom:s,left:o,right:n}=e.element.nativeElement.getBoundingClientRect();return i>=r&&i<=s&&t>=o&&t<=n})(e,t.x,t.y)&&(this.activeContainer=e)}):console.warn("this.listGroup does not exist:",this)}moveItemInGrid(e){if(d.cookie("env")&&console.log("moveItemInGrid:",e),!this.targetList)return!1;const t=this.placeholder.element.nativeElement,i=t.parentElement;return t.style.display="none",i.removeChild(t),i.appendChild(t),i.insertBefore(this.sourceList.element.nativeElement,i.children[this.sourceIndex]),this.targetList=null,this.sourceList=null,this.sourceIndex!==this.targetIndex&&(r.moveItemInArray(e,this.sourceIndex,this.targetIndex),!0)}getPointerPositionOnPage(e){const t=function(e){return e.type.startsWith("touch")}(e)?e.touches[0]||e.changedTouches[0]:e,i=this.viewportRuler.getViewportScrollPosition();return{x:t.pageX-i.left,y:t.pageY-i.top}}},I([i.Input(),S("design:type",String)],y.prototype,"target",void 0),I([i.Input(),S("design:type",String)],y.prototype,"targetSuffix",void 0),I([i.Input(),S("design:type",Number)],y.prototype,"id",void 0),I([i.Input(),S("design:type",Boolean)],y.prototype,"manifest",void 0),I([i.Input(),S("design:type",Boolean)],y.prototype,"decouple",void 0),I([i.Input(),S("design:type",Boolean)],y.prototype,"direct",void 0),I([i.Input(),S("design:type",Object)],y.prototype,"api",void 0),I([i.Input(),S("design:type",String)],y.prototype,"urlRoot",void 0),I([i.Input(),S("design:type",String)],y.prototype,"type",void 0),I([i.Input(),S("design:type",String)],y.prototype,"property",void 0),I([i.Input(),S("design:type",String)],y.prototype,"endpoint",void 0),I([i.ViewChild(r.CdkDropListGroup),S("design:type",r.CdkDropListGroup)],y.prototype,"listGroup",void 0),I([i.ViewChild(r.CdkDropList),S("design:type",r.CdkDropList)],y.prototype,"placeholder",void 0),y=I([i.Component({selector:`sa-${p}`,templateUrl:`${f}/${p}/${p}.component${m}.html`}),S("design:paramtypes",[n.MatIconRegistry,o.DomSanitizer,i.ChangeDetectorRef,i.ElementRef,g.ViewportRuler])],y),e("MediaSelectorComponent",y)}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["quill"],function(t,e){"use strict";var n,l,o,i;e&&e.id;function r(t){return document.createElement(t)}function s(t,e,n){return t.setAttribute(e,n)}function c(t,e){const n=t.container.querySelector(".ql-editor").innerHTML,l=r("div"),i=r("div"),c=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',u=e.cancelText||"Cancel",d=e.okText||"Ok";s(i,"class","ql-html-overlayContainer"),s(l,"class","ql-html-popupContainer");const a=r("i");s(a,"class","ql-html-popupTitle"),a.innerText=c;const p=r("div");p.appendChild(a),s(p,"class","ql-html-textContainer");const h=r("textarea");s(h,"class","ql-html-textArea"),h.value=function(t){const e=" ".repeat(2);let
|
|
1
|
+
System.register(["quill"],function(t,e){"use strict";var n,l,o,i;e&&e.id;function r(t){return document.createElement(t)}function s(t,e,n){return t.setAttribute(e,n)}function c(t,e){const n=t.container.querySelector(".ql-editor").innerHTML,l=r("div"),i=r("div"),c=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',u=e.cancelText||"Cancel",d=e.okText||"Ok";s(i,"class","ql-html-overlayContainer"),s(l,"class","ql-html-popupContainer");const a=r("i");s(a,"class","ql-html-popupTitle"),a.innerText=c;const p=r("div");p.appendChild(a),s(p,"class","ql-html-textContainer");const h=r("textarea");s(h,"class","ql-html-textArea"),h.value=function(t){const e=!0,n=!0,l=" ".repeat(2);let i=0;const r="\n";let s=null,c=null,u="";for(let o=0;o<=t.length;o++){s=t.substr(o,1),c=t.substr(o+1,1);const d="<br>"===t.substr(o,4),a="<"===s&&"/"===c&&!d;d&&(u+=r,i--,o+=4),"<"===s&&"/"!==c&&!d?(u+=r+l.repeat(i),i++):a?(--i<0&&(i=0),u+=r+l.repeat(i)):(!0===e&&" "===s&&" "===c||!0===n&&s===r&&""===t.substr(o,t.substr(o).indexOf("<")).trim())&&(s=""),u+=s}return o.log("formatHTML",{before:t,after:u}),u}(n);const b=r("button");b.innerHTML=u,s(b,"class","ql-html-buttonCancel");const m=r("button");m.innerHTML=d;const g=r("div");s(g,"class","ql-html-buttonGroup"),g.appendChild(b),g.appendChild(m),p.appendChild(h),p.appendChild(g),l.appendChild(p),i.appendChild(l),document.body.appendChild(i),b.onclick=()=>{document.body.removeChild(i)},i.onclick=b.onclick,l.onclick=t=>{t.preventDefault(),t.stopPropagation()},m.onclick=()=>{const e=h.value.split(/\r?\n/g).map(t=>t.trim()).join("");t.container.querySelector(".ql-editor").innerHTML=e,document.body.removeChild(i)}}return{setters:[function(t){n=t}],execute:function(){l=!1,o={prefixString:()=>"</> quill-html-edit-button: ",get log(){if(!l)return()=>{};return console.log.bind(console,this.prefixString())}},t("QuillHtmlEditPlugin",i=class{constructor(t,e){l=e&&e.debug,o.log("logging enabled");const n=t.getModule("toolbar");if(!n)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');this.registerDivModule();const i=n.container,u=r("span");s(u,"class","ql-formats");const d=r("button");d.innerHTML=e.buttonHTML||"<>",d.title=e.buttonTitle||"Show HTML source",d.onclick=n=>{n.preventDefault(),c(t,e)},u.appendChild(d),i.appendChild(u)}registerDivModule(){const t=n.default.import("blots/block");class e extends t{}e.tagName="div",e.blotName="div",e.allowedChildren=t.allowedChildren,e.allowedChildren.push(t),n.default.register(e)}}),t("default",i)}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["quill"],function(t,s){"use strict";var e,r,o;s&&s.id;return{setters:[function(t){e=t}],execute:function(){r=e.default.import("formats/image"),o=["alt","height","width","stratus-src","stratusSrc"],
|
|
1
|
+
System.register(["quill"],function(t,s){"use strict";var e,r,o,i;s&&s.id;return{setters:[function(t){e=t}],execute:function(){r=e.default.import("formats/image"),o=["alt","height","width","stratus-src","stratusSrc"],i=class extends r{constructor(){super(...arguments),this.blotName="imageCustom",this.tagName="IMG"}format(t,s){console.log("format:",t,s,this.domNode.getAttribute("src")),-1!==o.indexOf(t)?s?("stratus-src"===t&&console.log("stratus-src:",s),"stratusSrc"===t&&console.log("stratusSrc:",s),this.domNode.setAttribute(t,s)):this.domNode.removeAttribute(t):super.format(t,s)}},t("QuillImageFormatPlugin",i)}}});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
System.register(["reflect-metadata", "lodash", "@angular/core"], function (exports_1, context_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
var lodash_1, core_1, RootComponent;
|
|
4
|
+
var __moduleName = context_1 && context_1.id;
|
|
5
|
+
return {
|
|
6
|
+
setters: [
|
|
7
|
+
function (_1) {
|
|
8
|
+
},
|
|
9
|
+
function (lodash_1_1) {
|
|
10
|
+
lodash_1 = lodash_1_1;
|
|
11
|
+
},
|
|
12
|
+
function (core_1_1) {
|
|
13
|
+
core_1 = core_1_1;
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
execute: function () {
|
|
17
|
+
RootComponent = class RootComponent {
|
|
18
|
+
hydrate(elementRef, sanitizer, attrs) {
|
|
19
|
+
lodash_1.default.forEach(attrs, (attr) => {
|
|
20
|
+
const metaDataKeys = Reflect.getMetadataKeys(this, attr);
|
|
21
|
+
if (!lodash_1.default.includes(metaDataKeys, 'design:type')) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const attrKebab = lodash_1.default.kebabCase(attr);
|
|
25
|
+
const variants = [
|
|
26
|
+
attrKebab,
|
|
27
|
+
'data-' + attrKebab
|
|
28
|
+
];
|
|
29
|
+
const variant = lodash_1.default.find(variants, (v) => elementRef.nativeElement.hasAttribute(v));
|
|
30
|
+
if (lodash_1.default.isEmpty(variant)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const value = sanitizer.sanitize(core_1.SecurityContext.HTML, elementRef.nativeElement.getAttribute(variant));
|
|
34
|
+
lodash_1.default.set(this, attr, value);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports_1("RootComponent", RootComponent);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=root.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["root.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;YAWA,gBAAA,MAAa,aAAa;gBAOZ,OAAO,CAAC,UAAsB,EAAE,SAAoB,EAAE,KAAoB;oBAChF,gBAAC,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE;wBAC9B,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;wBACxD,IAAI,CAAC,gBAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE;4BAC1C,OAAM;yBACT;wBACD,MAAM,SAAS,GAAG,gBAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;wBACnC,MAAM,QAAQ,GAAG;4BACb,SAAS;4BACT,OAAO,GAAG,SAAS;yBACtB,CAAA;wBACD,MAAM,OAAO,GAAG,gBAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;wBACjF,IAAI,gBAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;4BACpB,OAAM;yBACT;wBACD,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,sBAAe,CAAC,IAAI,EAAE,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAA;wBACtG,gBAAC,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;oBAC5B,CAAC,CAAC,CAAA;gBACN,CAAC;aACJ,CAAA;;QACD,CAAC","file":"root.component.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["reflect-metadata","lodash","@angular/core"],function(t,e){"use strict";var n,a;e&&e.id;return{setters:[function(t){},function(t){n=t},function(t){a=t}],execute:function(){t("RootComponent",class{hydrate(t,e,i){n.default.forEach(i,i=>{const s=Reflect.getMetadataKeys(this,i);if(!n.default.includes(s,"design:type"))return;const u=n.default.kebabCase(i),r=[u,"data-"+u],c=n.default.find(r,e=>t.nativeElement.hasAttribute(e));if(n.default.isEmpty(c))return;const f=e.sanitize(a.SecurityContext.HTML,t.nativeElement.getAttribute(c));n.default.set(this,i,f)})}})}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["@angular/core","@angular/forms","@angular/cdk/drag-drop","rxjs","@angular/platform-browser","@angular/material/icon","@stratusjs/runtime/stratus","lodash","@stratusjs/core/environment","../core/root.component","@stratusjs/angularjs/services/registry","@stratusjs/core/events/eventManager","@stratusjs/core/datastore/xhr"],function(t,e){"use strict";var r,s,o,i,n,a,c,
|
|
1
|
+
System.register(["@angular/core","@angular/forms","@angular/cdk/drag-drop","rxjs","@angular/platform-browser","@angular/material/icon","@stratusjs/runtime/stratus","lodash","@stratusjs/core/environment","../core/root.component","@stratusjs/angularjs/services/registry","@stratusjs/core/events/eventManager","@stratusjs/core/datastore/xhr"],function(t,e){"use strict";var r,s,o,i,n,a,c,d,u,l,h,g,f,p,y,m,v,S,b=this&&this.__decorate||function(t,e,r,s){var o,i=arguments.length,n=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(i<3?o(n):i>3?o(e,r,n):o(e,r))||n);return i>3&&n&&Object.defineProperty(e,r,n),n},I=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};e&&e.id;return{setters:[function(t){r=t},function(t){s=t},function(t){o=t},function(t){i=t},function(t){n=t},function(t){a=t},function(t){c=t},function(t){d=t},function(t){u=t},function(t){l=t},function(t){h=t},function(t){g=t},function(t){f=t}],execute:function(){"@stratusjs/angular",p="selector",y=u.cookie("env")?"":".min",m=`${c.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"").replace(/\/dist\/$/,"/src/")}`,v=(t,e)=>d.default.has(t,e)&&!d.default.isEmpty(d.default.get(t,e)),S=class extends l.RootComponent{constructor(t,e,r,o){super(),this.iconRegistry=t,this.sanitizer=e,this.ref=r,this.elementRef=o,this.title=p+"_component",this._=d.default,this.has=v,this.log=console.log,this.Stratus=c.Stratus,this.selectCtrl=new s.FormControl,this.registry=new h.Registry,this.onChange=new i.Subject,this.svgIcons={},this.styled=!1,this.empty=!1,this.uid=d.default.uniqueId(`sa_${d.default.snakeCase(p)}_component_`),c.Stratus.Instances[this.uid]=this,this.dataSub=new i.Observable(t=>this.dataDefer(t)),d.default.forEach({selector_delete:`${c.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,selector_status:`${c.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/visibility.svg`,selector_edit:`${c.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`},(r,s)=>t.addSvgIcon(s,e.bypassSecurityTrustResourceUrl(r)).getNamedSvgIcon(s)),c.Stratus.Internals.CssLoader(`${m}${p}/${p}.component${y}.css`).then(()=>{this.styled=!0,this.refresh()}).catch(t=>{console.warn("Issue detected in CSS Loader for Component:",this),console.error(t),this.styled=!0,this.refresh()}),this.hydrate(o,e,["title","uid","target","targetSuffix","id","manifest","decouple","direct","api","urlRoot","type","property","endpoint","ignorePriority","_","has","log","Stratus","selectCtrl","registry","fetched","data","collection","model","dataSub","onChange","subscriber","svgIcons","styled","empty","iconRegistry","sanitizer","ref","elementRef","drop","goToUrl","toggleStatus","remove","fetchData","dataDefer","dataRef","onDataChange","prioritize","getSvg","addSvgIcon","hydrate","disableRefresh","stagger","reloading","refresh","ngOnDestroy"]),this.fetchData().then(t=>{if(!(t&&t instanceof g.EventManager))return void console.warn("Unable to bind data from Registry!");const e=()=>{t.completed&&(this.dataDefer(this.subscriber),this.prioritize(),this.refresh())};t.on("change",e),e()})}drop(t){const e=this.dataRef();if(e&&e.length){if(o.moveItemInArray(e,t.previousIndex,t.currentIndex),!this.ignorePriority){let t=0;d.default.forEach(e,e=>e.priority=t++)}this.model.trigger("change")}}goToUrl(t){t&&t.contentType?window.open(t.contentType.editUrl+"?id="+t.id,"_blank"):console.error("unable to execute goToUrl() because a valid model content was not provided.")}toggleStatus(t){const e=t.status;t.status=1===e?0:1;new f.XHR({method:"PUT",url:"/Api/Content/"+t.id,data:{route:{},meta:{},payload:{status:t.status}},type:"application/json"}).send().then(r=>{if(!d.default.isObject(r)||"SUCCESS"!==d.default.get(r,"meta.status[0].code"))return console.error("error[toggleStatus]:",r),t.status=e,void this.refresh();console.log("success[toggleStatus]:",r)}).catch(r=>{console.error("error[toggleStatus]:",r),t.status=e,this.refresh()})}remove(t){const e=this.dataRef();if(!e||!e.length)return console.error("unable to remove model from selection:",e),void this.refresh();let r=e.indexOf(t);if(-1===r){const s=e.map(e=>t.id===e.id?e:null).filter(t=>t);d.default.isArray(s)&&s.length&&(r=e.indexOf(d.default.first(s)))}-1!==r?(e.splice(r,1),this.model.trigger("change")):console.error("unable to find model:",t,"in selection:",e)}fetchData(){return this.fetched?this.fetched:this.fetched=this.registry.fetch(c.Stratus.Select(this.elementRef.nativeElement),this)}dataDefer(t){if(this.subscriber=this.subscriber||t,!this.subscriber||!this.model||!this.model.completed)return void setTimeout(()=>{this.dataDefer(t)},500);const e=this.dataRef();this.empty=!e.length,this.subscriber.next(e),this.refresh()}dataRef(){if(!this.model)return[];const t=this.model.get(this.property);return t&&d.default.isArray(t)?t:[]}onDataChange(){this.prioritize(),this.dataDefer(this.subscriber),this.refresh()}prioritize(){const t=this.dataRef();if(t&&t.length&&!this.ignorePriority){let e=0;d.default.forEach(t,t=>t.priority=e++)}}getSvg(t,e){const r=this.addSvgIcon(t,e);return new i.Observable(e=>{this.iconRegistry.getNamedSvgIcon(r).subscribe({error(e){console.error(`getSvg(${t}): ${e}`)},complete(){e.next(r)}})})}addSvgIcon(t,e){if(t in this.svgIcons)return this.svgIcons[t];e||(e={});const r=this.svgIcons[t]=d.default.uniqueId("selector_svg");return this.iconRegistry.addSvgIcon(r,this.sanitizer.bypassSecurityTrustResourceUrl(t),e),r}},b([r.Input(),I("design:type",String)],S.prototype,"target",void 0),b([r.Input(),I("design:type",String)],S.prototype,"targetSuffix",void 0),b([r.Input(),I("design:type",Number)],S.prototype,"id",void 0),b([r.Input(),I("design:type",Boolean)],S.prototype,"manifest",void 0),b([r.Input(),I("design:type",Boolean)],S.prototype,"decouple",void 0),b([r.Input(),I("design:type",Boolean)],S.prototype,"direct",void 0),b([r.Input(),I("design:type",Object)],S.prototype,"api",void 0),b([r.Input(),I("design:type",String)],S.prototype,"urlRoot",void 0),b([r.Input(),I("design:type",String)],S.prototype,"type",void 0),b([r.Input(),I("design:type",String)],S.prototype,"property",void 0),b([r.Input(),I("design:type",String)],S.prototype,"endpoint",void 0),b([r.Input(),I("design:type",Boolean)],S.prototype,"ignorePriority",void 0),S=b([r.Component({selector:`sa-${p}`,templateUrl:`${m}/${p}/${p}.component${y}.html`}),I("design:paramtypes",[a.MatIconRegistry,n.DomSanitizer,r.ChangeDetectorRef,r.ElementRef])],S),t("SelectorComponent",S)}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["@angular/core","@stratusjs/runtime/stratus","lodash"],function(e,t){"use strict";var n,s,i,o,r=this&&this.__decorate||function(e,t,n,s){var i,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,s);else for(var u=e.length-1;u>=0;u--)(i=e[u])&&(r=(o<3?i(r):o>3?i(t,n,r):i(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},
|
|
1
|
+
System.register(["@angular/core","@stratusjs/runtime/stratus","lodash"],function(e,t){"use strict";var n,s,i,o,r,u=this&&this.__decorate||function(e,t,n,s){var i,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,s);else for(var u=e.length-1;u>=0;u--)(i=e[u])&&(r=(o<3?i(r):o>3?i(t,n,r):i(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};t&&t.id;return{setters:[function(e){n=e},function(e){s=e},function(e){i=e}],execute:function(){o="test",r=class{constructor(e){this.el=e,this.uid=i.default.uniqueId(`sa_${o}_directive_`),s.Stratus.Instances[this.uid]=this,console.warn(this.uid,"has been load to",this.el)}onMouseEnter(){this.highlight("yellow")}onMouseLeave(){this.highlight(null)}highlight(e){this.el.nativeElement.style.backgroundColor=e}},u([n.HostListener("mouseenter"),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],r.prototype,"onMouseEnter",null),u([n.HostListener("mouseleave"),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],r.prototype,"onMouseLeave",null),r=u([n.Directive({selector:`[sa-${o}]`}),a("design:paramtypes",[n.ElementRef])],r),e("TestDirective",r)}}});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<mat-form-field>
|
|
2
|
+
<mat-label>Select Timezone</mat-label>
|
|
3
|
+
<input type="text"
|
|
4
|
+
placeholder="Timezone"
|
|
5
|
+
matInput
|
|
6
|
+
[formControl]="inputTimezone"
|
|
7
|
+
[matAutocomplete]="auto">
|
|
8
|
+
<mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" (optionSelected)="timezoneSelected($event.option.value)">
|
|
9
|
+
<mat-option *ngFor="let timezone of filteredTimezones | async" [value]="timezone">{{timezone}}</mat-option>
|
|
10
|
+
</mat-autocomplete>
|
|
11
|
+
</mat-form-field>
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
System.register(["@angular/core", "@angular/platform-browser", "@angular/forms", "rxjs", "rxjs/operators", "toastify-js", "@stratusjs/core/misc", "@stratusjs/runtime/stratus", "@stratusjs/core/environment", "@stratusjs/core/events/eventManager", "../core/root.component", "@stratusjs/angularjs/services/registry"], function (exports_1, context_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8
|
+
};
|
|
9
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11
|
+
};
|
|
12
|
+
var core_1, platform_browser_1, forms_1, rxjs_1, operators_1, toastify_js_1, misc_1, stratus_1, environment_1, eventManager_1, root_component_1, registry_1, systemDir, moduleName, min, localDir, TimezoneSelectorComponent;
|
|
13
|
+
var __moduleName = context_1 && context_1.id;
|
|
14
|
+
return {
|
|
15
|
+
setters: [
|
|
16
|
+
function (core_1_1) {
|
|
17
|
+
core_1 = core_1_1;
|
|
18
|
+
},
|
|
19
|
+
function (platform_browser_1_1) {
|
|
20
|
+
platform_browser_1 = platform_browser_1_1;
|
|
21
|
+
},
|
|
22
|
+
function (forms_1_1) {
|
|
23
|
+
forms_1 = forms_1_1;
|
|
24
|
+
},
|
|
25
|
+
function (rxjs_1_1) {
|
|
26
|
+
rxjs_1 = rxjs_1_1;
|
|
27
|
+
},
|
|
28
|
+
function (operators_1_1) {
|
|
29
|
+
operators_1 = operators_1_1;
|
|
30
|
+
},
|
|
31
|
+
function (toastify_js_1_1) {
|
|
32
|
+
toastify_js_1 = toastify_js_1_1;
|
|
33
|
+
},
|
|
34
|
+
function (misc_1_1) {
|
|
35
|
+
misc_1 = misc_1_1;
|
|
36
|
+
},
|
|
37
|
+
function (stratus_1_1) {
|
|
38
|
+
stratus_1 = stratus_1_1;
|
|
39
|
+
},
|
|
40
|
+
function (environment_1_1) {
|
|
41
|
+
environment_1 = environment_1_1;
|
|
42
|
+
},
|
|
43
|
+
function (eventManager_1_1) {
|
|
44
|
+
eventManager_1 = eventManager_1_1;
|
|
45
|
+
},
|
|
46
|
+
function (root_component_1_1) {
|
|
47
|
+
root_component_1 = root_component_1_1;
|
|
48
|
+
},
|
|
49
|
+
function (registry_1_1) {
|
|
50
|
+
registry_1 = registry_1_1;
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
execute: function () {
|
|
54
|
+
systemDir = '@stratusjs/angular';
|
|
55
|
+
moduleName = 'timezone-selector';
|
|
56
|
+
min = !environment_1.cookie('env') ? '.min' : '';
|
|
57
|
+
localDir = `${stratus_1.Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
|
|
58
|
+
TimezoneSelectorComponent = class TimezoneSelectorComponent extends root_component_1.RootComponent {
|
|
59
|
+
constructor(elementRef, ref, sanitizer) {
|
|
60
|
+
super();
|
|
61
|
+
this.elementRef = elementRef;
|
|
62
|
+
this.ref = ref;
|
|
63
|
+
this.sanitizer = sanitizer;
|
|
64
|
+
this.title = moduleName + '_component';
|
|
65
|
+
this.Stratus = stratus_1.Stratus;
|
|
66
|
+
this.registry = new registry_1.Registry();
|
|
67
|
+
this.onChange = new rxjs_1.Subject();
|
|
68
|
+
this.inputTimezone = new forms_1.FormControl('');
|
|
69
|
+
this.timezoneList = [];
|
|
70
|
+
this.initialized = false;
|
|
71
|
+
this.uid = misc_1.safeUniqueId('sa', moduleName, 'component');
|
|
72
|
+
stratus_1.Stratus.Instances[this.uid] = this;
|
|
73
|
+
this.timezoneList = Intl.supportedValuesOf('timeZone');
|
|
74
|
+
this.hydrate(elementRef, sanitizer, ["title", "uid", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "endpoint", "Stratus", "registry", "fetched", "data", "model", "dataSub", "onChange", "subscriber", "timezone", "inputTimezone", "timezoneList", "filteredTimezones", "initialized", "elementRef", "ref", "sanitizer", "ngOnInit", "_filter", "fetchData", "dataDefer", "dataRef", "valueChanged", "handleObservableError", "timezoneSelected", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
|
|
75
|
+
this.filteredTimezones = this.inputTimezone.valueChanges.pipe(operators_1.startWith(''), operators_1.map(value => this._filter(value || '')));
|
|
76
|
+
this.fetchData()
|
|
77
|
+
.then(data => {
|
|
78
|
+
if (!data || !(data instanceof eventManager_1.EventManager)) {
|
|
79
|
+
console.warn('Unable to bind data from Registry!');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const onDataChange = () => {
|
|
83
|
+
if (!data.completed) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
this.dataDefer(this.subscriber);
|
|
87
|
+
};
|
|
88
|
+
data.on('change', onDataChange);
|
|
89
|
+
onDataChange();
|
|
90
|
+
});
|
|
91
|
+
this.dataSub = new rxjs_1.Observable(subscriber => {
|
|
92
|
+
return this.dataDefer(subscriber);
|
|
93
|
+
});
|
|
94
|
+
this.dataSub.pipe(operators_1.debounce(() => rxjs_1.timer(500)), operators_1.catchError(this.handleObservableError)).subscribe(evt => {
|
|
95
|
+
if (this.inputTimezone.value === evt) {
|
|
96
|
+
if (this.initialized) {
|
|
97
|
+
this.refresh().then();
|
|
98
|
+
}
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
this.timezone = evt;
|
|
102
|
+
this.inputTimezone.setValue(this.timezone);
|
|
103
|
+
this.refresh().then();
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
async ngOnInit() {
|
|
107
|
+
this.inputTimezone.valueChanges.forEach((value) => this.valueChanged(value)).then();
|
|
108
|
+
this.initialized = true;
|
|
109
|
+
}
|
|
110
|
+
_filter(value) {
|
|
111
|
+
const filterValue = value.toLowerCase();
|
|
112
|
+
return this.timezoneList.filter(timezone => timezone.toLowerCase().includes(filterValue));
|
|
113
|
+
}
|
|
114
|
+
fetchData() {
|
|
115
|
+
if (this.fetched) {
|
|
116
|
+
return this.fetched;
|
|
117
|
+
}
|
|
118
|
+
return this.fetched = this.registry.fetch(stratus_1.Stratus.Select(this.elementRef.nativeElement), this);
|
|
119
|
+
}
|
|
120
|
+
dataDefer(subscriber) {
|
|
121
|
+
this.subscriber = this.subscriber || subscriber;
|
|
122
|
+
if (!this.subscriber) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const dataString = this.dataRef();
|
|
126
|
+
this.subscriber.next(dataString);
|
|
127
|
+
}
|
|
128
|
+
dataRef() {
|
|
129
|
+
if (!this.model) {
|
|
130
|
+
return '';
|
|
131
|
+
}
|
|
132
|
+
return this.model.get(this.property);
|
|
133
|
+
}
|
|
134
|
+
valueChanged(value) {
|
|
135
|
+
if (!value) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
this.timezone = value;
|
|
139
|
+
this.inputTimezone.setValue(this.timezone);
|
|
140
|
+
if (!this.model || !this.model.completed) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
this.model.set(this.property, this.timezone);
|
|
144
|
+
}
|
|
145
|
+
handleObservableError(err) {
|
|
146
|
+
console.error(err);
|
|
147
|
+
toastify_js_1.default({
|
|
148
|
+
text: err.toString(),
|
|
149
|
+
duration: 3000,
|
|
150
|
+
close: true,
|
|
151
|
+
stopOnFocus: true,
|
|
152
|
+
style: {
|
|
153
|
+
background: '#E14D45',
|
|
154
|
+
}
|
|
155
|
+
}).showToast();
|
|
156
|
+
return err;
|
|
157
|
+
}
|
|
158
|
+
timezoneSelected(value) {
|
|
159
|
+
if (!value) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.valueChanged(value);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
__decorate([
|
|
166
|
+
core_1.Input(),
|
|
167
|
+
__metadata("design:type", String)
|
|
168
|
+
], TimezoneSelectorComponent.prototype, "target", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
core_1.Input(),
|
|
171
|
+
__metadata("design:type", String)
|
|
172
|
+
], TimezoneSelectorComponent.prototype, "targetSuffix", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
core_1.Input(),
|
|
175
|
+
__metadata("design:type", Number)
|
|
176
|
+
], TimezoneSelectorComponent.prototype, "id", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
core_1.Input(),
|
|
179
|
+
__metadata("design:type", Boolean)
|
|
180
|
+
], TimezoneSelectorComponent.prototype, "manifest", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
core_1.Input(),
|
|
183
|
+
__metadata("design:type", Boolean)
|
|
184
|
+
], TimezoneSelectorComponent.prototype, "decouple", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
core_1.Input(),
|
|
187
|
+
__metadata("design:type", Boolean)
|
|
188
|
+
], TimezoneSelectorComponent.prototype, "direct", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
core_1.Input(),
|
|
191
|
+
__metadata("design:type", Object)
|
|
192
|
+
], TimezoneSelectorComponent.prototype, "api", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
core_1.Input(),
|
|
195
|
+
__metadata("design:type", String)
|
|
196
|
+
], TimezoneSelectorComponent.prototype, "urlRoot", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
core_1.Input(),
|
|
199
|
+
__metadata("design:type", String)
|
|
200
|
+
], TimezoneSelectorComponent.prototype, "type", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
core_1.Input(),
|
|
203
|
+
__metadata("design:type", String)
|
|
204
|
+
], TimezoneSelectorComponent.prototype, "property", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
core_1.Input(),
|
|
207
|
+
__metadata("design:type", String)
|
|
208
|
+
], TimezoneSelectorComponent.prototype, "endpoint", void 0);
|
|
209
|
+
TimezoneSelectorComponent = __decorate([
|
|
210
|
+
core_1.Component({
|
|
211
|
+
selector: `sa-${moduleName}`,
|
|
212
|
+
templateUrl: `${localDir}/${moduleName}/${moduleName}.component${min}.html`,
|
|
213
|
+
changeDetection: core_1.ChangeDetectionStrategy.OnPush
|
|
214
|
+
}),
|
|
215
|
+
__metadata("design:paramtypes", [core_1.ElementRef,
|
|
216
|
+
core_1.ChangeDetectorRef,
|
|
217
|
+
platform_browser_1.DomSanitizer])
|
|
218
|
+
], TimezoneSelectorComponent);
|
|
219
|
+
exports_1("TimezoneSelectorComponent", TimezoneSelectorComponent);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
//# sourceMappingURL=timezone-selector.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["timezone-selector.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE;;uEAAkB;YAC1B;gBAAC,YAAK,EAAE;;qEAAgB;YACxB;gBAAC,YAAK,EAAE;;kEAAY;YACpB;gBAAC,YAAK,EAAE;;sEAAgB;YAIxB;gBAAC,YAAK,EAAE;;mEAAa;YACrB;gBAAC,YAAK,EAAE;;uEAAiB;YACzB;gBAAC,YAAK,EAAE;;uEAAiB;YApBhB,yBAAyB;gBAZrC,gBAAS,CAAC;oBACP,QAAQ,EAAE,MAAM,UAAU,EAAE;oBAE5B,WAAW,EAAE,GAAG,QAAQ,IAAI,UAAU,IAAI,UAAU,aAAa,GAAG,OAAO;oBAM3E,eAAe,EAAE,8BAAuB,CAAC,MAAM;iBAClD,CAAC;iDA0D0B,iBAAU;oBACf,wBAAiB;oBACb,+BAAY;eA1D1B,yBAAyB,CAuMrC;;QACD,CAAC","file":"timezone-selector.component.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<mat-form-field><mat-label>Select Timezone</mat-label><input type="text" placeholder="Timezone" matInput [formControl]="inputTimezone" [matAutocomplete]="auto"><mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" (optionSelected)="timezoneSelected($event.option.value)"><mat-option *ngFor="let timezone of filteredTimezones | async" [value]="timezone">{{timezone}}</mat-option></mat-autocomplete></mat-form-field>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["@angular/core","@angular/platform-browser","@angular/forms","rxjs","rxjs/operators","toastify-js","@stratusjs/core/misc","@stratusjs/runtime/stratus","@stratusjs/core/environment","@stratusjs/core/events/eventManager","../core/root.component","@stratusjs/angularjs/services/registry"],function(e,t){"use strict";var i,n,s,r,o,a,u,h,c,p,d,l,f,m,g,y,b=this&&this.__decorate||function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},v=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};t&&t.id;return{setters:[function(e){i=e},function(e){n=e},function(e){s=e},function(e){r=e},function(e){o=e},function(e){a=e},function(e){u=e},function(e){h=e},function(e){c=e},function(e){p=e},function(e){d=e},function(e){l=e}],execute:function(){"@stratusjs/angular",f="timezone-selector",m=c.cookie("env")?"":".min",g=`${h.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"").replace(/\/dist\/$/,"/src/")}`,y=class extends d.RootComponent{constructor(e,t,i){super(),this.elementRef=e,this.ref=t,this.sanitizer=i,this.title=f+"_component",this.Stratus=h.Stratus,this.registry=new l.Registry,this.onChange=new r.Subject,this.inputTimezone=new s.FormControl(""),this.timezoneList=[],this.initialized=!1,this.uid=u.safeUniqueId("sa",f,"component"),h.Stratus.Instances[this.uid]=this,this.timezoneList=Intl.supportedValuesOf("timeZone"),this.hydrate(e,i,["title","uid","target","targetSuffix","id","manifest","decouple","direct","api","urlRoot","type","property","endpoint","Stratus","registry","fetched","data","model","dataSub","onChange","subscriber","timezone","inputTimezone","timezoneList","filteredTimezones","initialized","elementRef","ref","sanitizer","ngOnInit","_filter","fetchData","dataDefer","dataRef","valueChanged","handleObservableError","timezoneSelected","hydrate","disableRefresh","stagger","reloading","refresh","ngOnDestroy"]),this.filteredTimezones=this.inputTimezone.valueChanges.pipe(o.startWith(""),o.map(e=>this._filter(e||""))),this.fetchData().then(e=>{if(!(e&&e instanceof p.EventManager))return void console.warn("Unable to bind data from Registry!");const t=()=>{e.completed&&this.dataDefer(this.subscriber)};e.on("change",t),t()}),this.dataSub=new r.Observable(e=>this.dataDefer(e)),this.dataSub.pipe(o.debounce(()=>r.timer(500)),o.catchError(this.handleObservableError)).subscribe(e=>{this.inputTimezone.value!==e?(this.timezone=e,this.inputTimezone.setValue(this.timezone),this.refresh().then()):this.initialized&&this.refresh().then()})}async ngOnInit(){this.inputTimezone.valueChanges.forEach(e=>this.valueChanged(e)).then(),this.initialized=!0}_filter(e){const t=e.toLowerCase();return this.timezoneList.filter(e=>e.toLowerCase().includes(t))}fetchData(){return this.fetched?this.fetched:this.fetched=this.registry.fetch(h.Stratus.Select(this.elementRef.nativeElement),this)}dataDefer(e){if(this.subscriber=this.subscriber||e,!this.subscriber)return;const t=this.dataRef();this.subscriber.next(t)}dataRef(){return this.model?this.model.get(this.property):""}valueChanged(e){e&&(this.timezone=e,this.inputTimezone.setValue(this.timezone),this.model&&this.model.completed&&this.model.set(this.property,this.timezone))}handleObservableError(e){return console.error(e),a.default({text:e.toString(),duration:3e3,close:!0,stopOnFocus:!0,style:{background:"#E14D45"}}).showToast(),e}timezoneSelected(e){e&&this.valueChanged(e)}},b([i.Input(),v("design:type",String)],y.prototype,"target",void 0),b([i.Input(),v("design:type",String)],y.prototype,"targetSuffix",void 0),b([i.Input(),v("design:type",Number)],y.prototype,"id",void 0),b([i.Input(),v("design:type",Boolean)],y.prototype,"manifest",void 0),b([i.Input(),v("design:type",Boolean)],y.prototype,"decouple",void 0),b([i.Input(),v("design:type",Boolean)],y.prototype,"direct",void 0),b([i.Input(),v("design:type",Object)],y.prototype,"api",void 0),b([i.Input(),v("design:type",String)],y.prototype,"urlRoot",void 0),b([i.Input(),v("design:type",String)],y.prototype,"type",void 0),b([i.Input(),v("design:type",String)],y.prototype,"property",void 0),b([i.Input(),v("design:type",String)],y.prototype,"endpoint",void 0),y=b([i.Component({selector:`sa-${f}`,templateUrl:`${g}/${f}/${f}.component${m}.html`,changeDetection:i.ChangeDetectionStrategy.OnPush}),v("design:paramtypes",[i.ElementRef,i.ChangeDetectorRef,n.DomSanitizer])],y),e("TimezoneSelectorComponent",y)}}});
|