@duoduo-oba/ng-devui
Version:
DevUI components based on Angular
2 lines • 11.3 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ng-devui/popover")):"function"==typeof define&&define.amd?define("ng-devui/form",["exports","@angular/core","@angular/common","@angular/forms","ng-devui/popover"],t):t(((e=e||self)["ng-devui"]=e["ng-devui"]||{},e["ng-devui"].form={}),e.ng.core,e.ng.common,e.ng.forms,e["ng-devui"].popover)}(this,(function(e,t,n,i,o){"use strict";var r=function(){function e(e,t){t.addClass(e.nativeElement,"devui-form-item")}return e.prototype.ngOnInit=function(){},e.decorators=[{type:t.Component,args:[{selector:"d-form-item",template:"\n <ng-content></ng-content>\n ",styles:[".mr-content-spacing{margin-right:4px}.padding-element-spacing{padding:16px!important}.ml-element-spacing{margin-left:16px}.mr-element-spacing{margin-right:16px}.mt-element-spacing{margin-top:16px}.mb-element-spacing{margin-bottom:16px}.mlr-element-spacing{margin-left:16px;margin-right:16px}.mtb-element-spacing{margin-top:16px;margin-bottom:16px}.m-element-spacing{margin:16px}.grid{letter-spacing:-.31em;word-spacing:-.43em}.u,.u-1,.u-1-12,.u-1-2,.u-1-24,.u-1-3,.u-1-4,.u-1-5,.u-1-6,.u-1-8,.u-11-12,.u-11-24,.u-13-24,.u-17-24,.u-19-24,.u-2-3,.u-2-5,.u-23-24,.u-3-4,.u-3-5,.u-3-8,.u-4-5,.u-5-12,.u-5-24,.u-5-6,.u-5-8,.u-7-12,.u-7-24,.u-7-8{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top}.u-1{display:block}.u-1-2{width:49.99999%}.u-1-3{width:33.33333%}.u-2-3{width:66.66666%}.u-1-4{width:24.99999%}.u-3-4{width:74.99999%}.u-1-5{width:19.99999%}.u-2-5{width:39.99999%}.u-3-5{width:59.99999%}.u-4-5{width:79.99999%}.u-1-6{width:16.64999%}.u-5-6{width:83.33333%}.u-1-8{width:12.49999%}.u-3-8{width:37.49999%}.u-5-8{width:62.49999%}.u-7-8{width:87.49999%}.u-1-12{width:8.33333%}.u-5-12{width:41.66666%}.u-7-12{width:58.33333%}.u-11-12{width:91.66666%}.u-1-24{width:4.16666%}.u-5-24{width:20.83333%}.u-7-24{width:29.16666%}.u-11-24{width:45.83333%}.u-13-24{width:54.16666%}.u-17-24{width:70.83333%}.u-19-24{width:79.16666%}.u-23-24{width:95.83333%}.u-content{padding:0 0 10px 10px}.devui-form-horizontal :host.devui-form-item{margin-bottom:16px;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.devui-form-vertical :host.devui-form-item{display:-webkit-box;display:flex;margin-bottom:16px;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.devui-form-columns :host.devui-form-item{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;margin-right:10px;padding:8px 0}"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e}(),u=function(){function e(e,t){this.required=!1,this.hasHelp=!1,this.helpTips="",t.addClass(e.nativeElement,"devui-form-label")}return e.decorators=[{type:t.Component,args:[{selector:"d-form-label",template:'<span class="devui-form-span" [ngClass]="{ \'devui-required\': required }">\r\n <ng-content></ng-content>\r\n</span>\r\n<svg\r\n *ngIf="hasHelp"\r\n dPopover\r\n [content]="helpTips"\r\n [popType]="\'info\'"\r\n [content]="\'info!\'"\r\n [position]="\'top\'"\r\n [controlled]="true"\r\n [showAnimate]="true"\r\n [appendToBody]="true"\r\n trigger="hover"\r\n class="devui-helping"\r\n width="16px"\r\n height="16px"\r\n viewBox="0 0 16 16"\r\n version="1.1"\r\n xmlns="http://www.w3.org/2000/svg"\r\n xmlns:xlink="http://www.w3.org/1999/xlink"\r\n>\r\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\r\n <g>\r\n <path\r\n d="M8.5,8.95852078 L8.5,11 L7.5,11 L7.5,8.5 C7.5,8.22385763 7.72385763,8 8,8 C9.1045695,8 10,7.1045695 10,6 C10,4.8954305 9.1045695,4 8,4 C6.8954305,4 6,4.8954305 6,6 L5,6 C5,4.34314575 6.34314575,3 8,3 C9.65685425,3 11,4.34314575 11,6 C11,7.48649814 9.91885667,8.72048173 8.5,8.95852078 L8.5,8.95852078 Z M8,16 C3.581722,16 0,12.418278 0,8 C0,3.581722 3.581722,0 8,0 C12.418278,0 16,3.581722 16,8 C16,12.418278 12.418278,16 8,16 Z M8,15 C11.8659932,15 15,11.8659932 15,8 C15,4.13400675 11.8659932,1 8,1 C4.13400675,1 1,4.13400675 1,8 C1,11.8659932 4.13400675,15 8,15 Z M7.5,12 L8.5,12 L8.5,13 L7.5,13 L7.5,12 Z"\r\n id="Combined-Shape"\r\n fill="#293040"\r\n fill-rule="nonzero"\r\n ></path>\r\n </g>\r\n </g>\r\n</svg>\r\n',preserveWhitespaces:!1,styles:[".mr-content-spacing{margin-right:4px}.padding-element-spacing{padding:16px!important}.ml-element-spacing{margin-left:16px}.mr-element-spacing{margin-right:16px}.mt-element-spacing{margin-top:16px}.mb-element-spacing{margin-bottom:16px}.mlr-element-spacing{margin-left:16px;margin-right:16px}.mtb-element-spacing{margin-top:16px;margin-bottom:16px}.m-element-spacing{margin:16px}.grid{letter-spacing:-.31em;word-spacing:-.43em}.u,.u-1,.u-1-12,.u-1-2,.u-1-24,.u-1-3,.u-1-4,.u-1-5,.u-1-6,.u-1-8,.u-11-12,.u-11-24,.u-13-24,.u-17-24,.u-19-24,.u-2-3,.u-2-5,.u-23-24,.u-3-4,.u-3-5,.u-3-8,.u-4-5,.u-5-12,.u-5-24,.u-5-6,.u-5-8,.u-7-12,.u-7-24,.u-7-8{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top}.u-1{display:block}.u-1-2{width:49.99999%}.u-1-3{width:33.33333%}.u-2-3{width:66.66666%}.u-1-4{width:24.99999%}.u-3-4{width:74.99999%}.u-1-5{width:19.99999%}.u-2-5{width:39.99999%}.u-3-5{width:59.99999%}.u-4-5{width:79.99999%}.u-1-6{width:16.64999%}.u-5-6{width:83.33333%}.u-1-8{width:12.49999%}.u-3-8{width:37.49999%}.u-5-8{width:62.49999%}.u-7-8{width:87.49999%}.u-1-12{width:8.33333%}.u-5-12{width:41.66666%}.u-7-12{width:58.33333%}.u-11-12{width:91.66666%}.u-1-24{width:4.16666%}.u-5-24{width:20.83333%}.u-7-24{width:29.16666%}.u-11-24{width:45.83333%}.u-13-24{width:54.16666%}.u-17-24{width:70.83333%}.u-19-24{width:79.16666%}.u-23-24{width:95.83333%}.u-content{padding:0 0 10px 10px}.devui-form-span{position:relative;color:#252b3a}.devui-form-span.devui-required:before{content:'*';color:red;display:inline-block;vertical-align:middle;line-height:1px;margin-right:4px}:host-context(.devui-form-item:hover) .svg-close{display:inline-block;cursor:pointer}.devui-helping{position:relative;left:4px;top:3px}.devui-form-lg.devui-form-horizontal :host.devui-form-label{-webkit-box-flex:0;flex:0 0 150px;-webkit-box-pack:end;justify-content:flex-end;text-align:right;align-self:flex-start}.devui-form-sm.devui-form-horizontal :host.devui-form-label{-webkit-box-flex:0;flex:0 0 80px;-webkit-box-pack:end;justify-content:flex-end;text-align:right;align-self:flex-start}.devui-form-horizontal :host.devui-form-label{-webkit-box-flex:0;flex:0 0 100px;-webkit-box-pack:end;justify-content:flex-end;text-align:right;align-self:flex-start}.devui-form-vertical :host.devui-form-label{-webkit-box-flex:1;flex:1 1 0;-moz-box-flex:1;text-align:left;padding-bottom:8px;-webkit-box-pack:start;justify-content:flex-start;align-self:flex-start}.devui-form-columns :host.devui-form-label{-webkit-box-flex:0;flex:0 0 100px;text-align:right;-webkit-box-pack:end;justify-content:flex-end;align-self:flex-start}.devui-form-lg.devui-form-columns :host.devui-form-label{-webkit-box-flex:0;flex:0 0 150px;-webkit-box-pack:end;justify-content:flex-end;text-align:right;align-self:flex-start}.devui-form-sm.devui-form-columns :host.devui-form-label{-webkit-box-flex:0;flex:0 0 80px;-webkit-box-pack:end;justify-content:flex-end;text-align:right;align-self:flex-start}"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={required:[{type:t.Input}],hasHelp:[{type:t.Input}],helpTips:[{type:t.Input}]},e}();var l=function(){function e(e,t){t.addClass(e.nativeElement,"devui-form-controls")}return e.prototype.ngOnInit=function(){},e.decorators=[{type:t.Component,args:[{selector:"d-form-control",template:"<ng-content></ng-content>\r\n",styles:[".mr-content-spacing{margin-right:4px}.padding-element-spacing{padding:16px!important}.ml-element-spacing{margin-left:16px}.mr-element-spacing{margin-right:16px}.mt-element-spacing{margin-top:16px}.mb-element-spacing{margin-bottom:16px}.mlr-element-spacing{margin-left:16px;margin-right:16px}.mtb-element-spacing{margin-top:16px;margin-bottom:16px}.m-element-spacing{margin:16px}.grid{letter-spacing:-.31em;word-spacing:-.43em}.u,.u-1,.u-1-12,.u-1-2,.u-1-24,.u-1-3,.u-1-4,.u-1-5,.u-1-6,.u-1-8,.u-11-12,.u-11-24,.u-13-24,.u-17-24,.u-19-24,.u-2-3,.u-2-5,.u-23-24,.u-3-4,.u-3-5,.u-3-8,.u-4-5,.u-5-12,.u-5-24,.u-5-6,.u-5-8,.u-7-12,.u-7-24,.u-7-8{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top}.u-1{display:block}.u-1-2{width:49.99999%}.u-1-3{width:33.33333%}.u-2-3{width:66.66666%}.u-1-4{width:24.99999%}.u-3-4{width:74.99999%}.u-1-5{width:19.99999%}.u-2-5{width:39.99999%}.u-3-5{width:59.99999%}.u-4-5{width:79.99999%}.u-1-6{width:16.64999%}.u-5-6{width:83.33333%}.u-1-8{width:12.49999%}.u-3-8{width:37.49999%}.u-5-8{width:62.49999%}.u-7-8{width:87.49999%}.u-1-12{width:8.33333%}.u-5-12{width:41.66666%}.u-7-12{width:58.33333%}.u-11-12{width:91.66666%}.u-1-24{width:4.16666%}.u-5-24{width:20.83333%}.u-7-24{width:29.16666%}.u-11-24{width:45.83333%}.u-13-24{width:54.16666%}.u-17-24{width:70.83333%}.u-19-24{width:79.16666%}.u-23-24{width:95.83333%}.u-content{padding:0 0 10px 10px}.devui-form-horizontal :host.devui-form-controls{-webkit-box-flex:1;flex:1 1 0;margin-left:16px}.devui-form-vertical :host.devui-form-controls{-webkit-box-flex:1;flex:1 1 0}.devui-form-columns :host.devui-form-controls{-webkit-box-flex:1;flex:1 1 0;margin-left:16px;margin-right:24px}"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e}(),a=function(){function e(e,t){t.addClass(e.nativeElement,"devui-form-operation")}return e.prototype.ngOnInit=function(){},e.decorators=[{type:t.Component,args:[{selector:"d-form-operation",template:"<ng-content></ng-content>",styles:["\n .devui-form-horizontal :host.devui-form-operation {\n display:block;\n margin-left:96px;\n }\n .devui-form-vertical :host.devui-form-operation {\n display:block;\n }\n .devui-form-columns :host.devui-form-operation {\n display:block;\n padding:8px 0;\n margin-left:112px;\n }\n "]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e}(),d="horizontal",p=function(){function e(e,t){this.elementRef=e,this.renderer=t,this.layout=d,this.labelSize=""}return e.prototype.ngOnInit=function(){this.renderer.addClass(this.elementRef.nativeElement,"devui-form-"+this.layout),this.labelSize&&this.renderer.addClass(this.elementRef.nativeElement,"devui-form-"+this.labelSize)},e.decorators=[{type:t.Directive,args:[{selector:"[dForm]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={layout:[{type:t.Input}],labelSize:[{type:t.Input}]},e}();var m=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.ReactiveFormsModule,i.FormsModule,o.PopoverModule],exports:[r,u,l,a,p],declarations:[r,u,l,a,p],providers:[]}]}],e}();e.FormControlComponent=l,e.FormDirective=p,e.FormItemComponent=r,e.FormLabelComponent=u,e.FormModule=m,e.FormOperationComponent=a,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-devui-form.umd.min.js.map