UNPKG

@duoduo-oba/ng-devui

Version:

DevUI components based on Angular

239 lines (229 loc) 16.4 kB
import { Component, ElementRef, Renderer2, Input, Directive, NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ReactiveFormsModule, FormsModule } from '@angular/forms'; import { PopoverModule } from '@duoduo-oba/ng-devui/popover'; /** * @fileoverview added by tsickle * Generated from: form-item.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var FormItemComponent = /** @class */ (function () { function FormItemComponent(elementRef, renderer) { renderer.addClass(elementRef.nativeElement, 'devui-form-item'); } /** * @return {?} */ FormItemComponent.prototype.ngOnInit = /** * @return {?} */ function () { }; FormItemComponent.decorators = [ { type: 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}"] }] } ]; /** @nocollapse */ FormItemComponent.ctorParameters = function () { return [ { type: ElementRef }, { type: Renderer2 } ]; }; return FormItemComponent; }()); /** * @fileoverview added by tsickle * Generated from: form-label.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var FormLabelComponent = /** @class */ (function () { function FormLabelComponent(elementRef, renderer) { this.required = false; this.hasHelp = false; this.helpTips = ''; renderer.addClass(elementRef.nativeElement, 'devui-form-label'); } FormLabelComponent.decorators = [ { type: 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: false, 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}"] }] } ]; /** @nocollapse */ FormLabelComponent.ctorParameters = function () { return [ { type: ElementRef }, { type: Renderer2 } ]; }; FormLabelComponent.propDecorators = { required: [{ type: Input }], hasHelp: [{ type: Input }], helpTips: [{ type: Input }] }; return FormLabelComponent; }()); if (false) { /** @type {?} */ FormLabelComponent.prototype.required; /** @type {?} */ FormLabelComponent.prototype.hasHelp; /** @type {?} */ FormLabelComponent.prototype.helpTips; } /** * @fileoverview added by tsickle * Generated from: form-control.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var FormControlComponent = /** @class */ (function () { function FormControlComponent(elementRef, renderer) { renderer.addClass(elementRef.nativeElement, 'devui-form-controls'); } /** * @return {?} */ FormControlComponent.prototype.ngOnInit = /** * @return {?} */ function () { }; FormControlComponent.decorators = [ { type: 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}"] }] } ]; /** @nocollapse */ FormControlComponent.ctorParameters = function () { return [ { type: ElementRef }, { type: Renderer2 } ]; }; return FormControlComponent; }()); /** * @fileoverview added by tsickle * Generated from: form-operation.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var FormOperationComponent = /** @class */ (function () { function FormOperationComponent(elementRef, renderer) { renderer.addClass(elementRef.nativeElement, 'devui-form-operation'); } /** * @return {?} */ FormOperationComponent.prototype.ngOnInit = /** * @return {?} */ function () { }; FormOperationComponent.decorators = [ { type: 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 "] }] } ]; /** @nocollapse */ FormOperationComponent.ctorParameters = function () { return [ { type: ElementRef }, { type: Renderer2 } ]; }; return FormOperationComponent; }()); /** * @fileoverview added by tsickle * Generated from: form.directive.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @enum {string} */ var FormLayout = { Horizontal: "horizontal", Vertical: "vertical", columns: "columns", }; var FormDirective = /** @class */ (function () { function FormDirective(elementRef, renderer) { this.elementRef = elementRef; this.renderer = renderer; this.layout = FormLayout.Horizontal; this.labelSize = ''; } /** * @return {?} */ FormDirective.prototype.ngOnInit = /** * @return {?} */ function () { this.renderer.addClass(this.elementRef.nativeElement, 'devui-form-' + this.layout); if (this.labelSize) { this.renderer.addClass(this.elementRef.nativeElement, 'devui-form-' + this.labelSize); } }; FormDirective.decorators = [ { type: Directive, args: [{ selector: '[dForm]', },] } ]; /** @nocollapse */ FormDirective.ctorParameters = function () { return [ { type: ElementRef }, { type: Renderer2 } ]; }; FormDirective.propDecorators = { layout: [{ type: Input }], labelSize: [{ type: Input }] }; return FormDirective; }()); if (false) { /** @type {?} */ FormDirective.prototype.layout; /** @type {?} */ FormDirective.prototype.labelSize; /** * @type {?} * @private */ FormDirective.prototype.elementRef; /** * @type {?} * @private */ FormDirective.prototype.renderer; } /** * @fileoverview added by tsickle * Generated from: form.module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var FormModule = /** @class */ (function () { function FormModule() { } FormModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule, ReactiveFormsModule, FormsModule, PopoverModule], exports: [FormItemComponent, FormLabelComponent, FormControlComponent, FormOperationComponent, FormDirective], declarations: [FormItemComponent, FormLabelComponent, FormControlComponent, FormOperationComponent, FormDirective], providers: [], },] } ]; return FormModule; }()); /** * @fileoverview added by tsickle * Generated from: public-api.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: ng-devui-form.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { FormControlComponent, FormDirective, FormItemComponent, FormLabelComponent, FormModule, FormOperationComponent }; //# sourceMappingURL=ng-devui-form.js.map