@odilo/button
Version:
Share buttons components for Angular and Ionic.
2 lines • 4.62 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@fortawesome/angular-fontawesome"),require("@angular/core"),require("@odilo/core")):"function"==typeof define&&define.amd?define("@odilo/button",["exports","@angular/common","@fortawesome/angular-fontawesome","@angular/core","@odilo/core"],t):t((e.odilo=e.odilo||{},e.odilo.button={}),e.ng.common,e.angularFontawesome,e.ng.core,e.core$1)}(this,function(e,t,n,o,s){"use strict";var r=(Object.defineProperty(i.prototype,"createButton",{set:function(e){this.shareCount=0,this.button=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"setUrl",{set:function(e){this.shareCount=0,this.url=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"buttonClass",{get:function(){return"sb-button sb-"+this.theme},enumerable:!0,configurable:!0}),i.prototype.onCount=function(e){this.shareCount=e,this.count.emit(e)},i.decorators=[{type:o.Component,args:[{selector:"share-button",template:'<button class="sb-wrapper"\n [shareButton]="button"\n [url]="url"\n [image]="image"\n [title]="title"\n [description]="description"\n [tags]="tags"\n [autoSetMeta]="autoSetMeta"\n [getCount]="showCount"\n (count)="onCount($event)"\n (opened)="opened.emit($event)"\n (closed)="closed.emit($event)"\n [class.sb-show-icon]="showIcon"\n [class.sb-show-text]="showText"\n [class.sb-show-count]="showCount && shareCount"\n [style.fontSize.px]="(1 + size/20) * 14">\n\n <div class="sb-inner">\n\n <div class="sb-content">\n\n <div *ngIf="showIcon && ref.shareButton" class="sb-icon">\n <fa-icon [icon]="icon || ref.shareButton.icon" [fixedWidth]="true"></fa-icon>\n </div>\n\n <div *ngIf="showText && ref.shareButton" class="sb-text">\n {{ text || ref.shareButton.text }}\n </div>\n\n </div>\n\n <div *ngIf="showCount && shareCount" class="sb-count">\n <span>{{ shareCount | shareCount }}</span>\n </div>\n\n </div>\n</button>\n',changeDetection:o.ChangeDetectionStrategy.OnPush,styles:["::ng-deep .sb-button,::ng-deep .sb-group{display:inline-flex;align-items:flex-start}::ng-deep .sb-group{flex-wrap:wrap}::ng-deep .sb-button{margin:.3125em}::ng-deep .sb-wrapper{font-size:inherit;cursor:pointer;position:relative;outline:0;min-width:4.125em;height:2.5em;border:none;border-radius:1px;padding:0;line-height:2.571em;background-color:transparent}::ng-deep .sb-wrapper .sb-count,::ng-deep .sb-wrapper .sb-icon,::ng-deep .sb-wrapper .sb-text{display:flex;align-items:center;justify-content:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}::ng-deep .sb-wrapper .sb-inner{display:flex;flex:1;width:100%;height:100%}::ng-deep .sb-wrapper .sb-content{display:flex;height:100%;width:100%}::ng-deep .sb-wrapper .sb-text{padding:0 .7em;flex:1;height:100%;white-space:nowrap}::ng-deep .sb-wrapper .sb-icon{text-align:center;width:100%;height:100%;font-size:1.2em;min-width:2em}::ng-deep .sb-wrapper .sb-count{font-size:.9em;padding:0 .7em}::ng-deep .sb-wrapper .sb-count,::ng-deep .sb-wrapper .sb-text{font-weight:700}::ng-deep .sb-show-text .sb-icon{width:2em}::ng-deep .sb-show-count{min-width:5.333em}"]}]}],i.ctorParameters=function(){return[{type:s.ShareService}]},i.propDecorators={createButton:[{type:o.Input,args:["button"]}],setUrl:[{type:o.Input,args:["url"]}],title:[{type:o.Input}],description:[{type:o.Input}],image:[{type:o.Input}],tags:[{type:o.Input}],autoSetMeta:[{type:o.Input}],showIcon:[{type:o.Input}],showText:[{type:o.Input}],showCount:[{type:o.Input}],text:[{type:o.Input}],icon:[{type:o.Input}],size:[{type:o.Input}],theme:[{type:o.Input}],count:[{type:o.Output}],opened:[{type:o.Output}],closed:[{type:o.Output}],buttonClass:[{type:o.HostBinding,args:["class"]}],ref:[{type:o.ViewChild,args:[s.ShareDirective]}]},i);function i(e){this._share=e,this.showIcon=!0,this.showText=!1,this.showCount=!1,this.size=this._share.config.size,this.theme=this._share.config.theme,this.count=new o.EventEmitter,this.opened=new o.EventEmitter,this.closed=new o.EventEmitter}var p=(u.withConfig=function(e){return{ngModule:u,providers:[{provide:s.SHARE_BUTTONS_CONFIG,useValue:e}]}},u.decorators=[{type:o.NgModule,args:[{declarations:[r],imports:[s.ShareModule,n.FontAwesomeModule,t.CommonModule],exports:[s.ShareModule,n.FontAwesomeModule,r]}]}],u);function u(){}e.ShareButtonModule=p,e.ShareButton=r,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=odilo-button.umd.min.js.map