UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

87 lines 12.9 kB
/** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ import { Directive, Input } from '@angular/core'; import * as i0 from "@angular/core"; export class NzFlexDirective { constructor() { this.nzVertical = false; this.nzJustify = 'normal'; this.nzAlign = 'normal'; this.nzGap = 0; this.nzWrap = 'nowrap'; this.nzFlex = 'unset'; } get gap() { switch (this.nzGap) { case 'small': return '8px'; case 'middle': return '16px'; case 'large': return '24px'; default: if (typeof this.nzGap === 'number') { return `${this.nzGap}px`; } return this.nzGap; } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzFlexDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: NzFlexDirective, isStandalone: true, selector: "[nz-flex],nz-flex", inputs: { nzVertical: "nzVertical", nzJustify: "nzJustify", nzAlign: "nzAlign", nzGap: "nzGap", nzWrap: "nzWrap", nzFlex: "nzFlex" }, host: { properties: { "class.ant-flex-vertical": "nzVertical", "class.ant-flex-justify-flex-start": "nzJustify === 'flex-start'", "class.ant-flex-justify-center": "nzJustify === 'center'", "class.ant-flex-justify-flex-end": "nzJustify === 'flex-end'", "class.ant-flex-justify-space-between": "nzJustify === 'space-between'", "class.ant-flex-justify-space-around": "nzJustify === 'space-around'", "class.ant-flex-justify-space-evenly": "nzJustify === 'space-evenly'", "class.ant-flex-justify-start": "nzJustify === 'start'", "class.ant-flex-justify-end": "nzJustify === 'end'", "class.ant-flex-justify-right": "nzJustify === 'right'", "class.ant-flex-justify-left": "nzJustify === 'left'", "class.ant-flex-justify-stretch": "nzJustify === 'stretch'", "class.ant-flex-justify-normal": "nzJustify === 'normal'", "class.ant-flex-align-flex-start": "nzAlign === 'flex-start'", "class.ant-flex-align-center": "nzAlign === 'center'", "class.ant-flex-align-flex-end": "nzAlign === 'flex-end'", "class.ant-flex-align-space-between": "nzAlign === 'space-between'", "class.ant-flex-align-space-around": "nzAlign === 'space-around'", "class.ant-flex-align-space-evenly": "nzAlign === 'space-evenly'", "class.ant-flex-align-start": "nzAlign === 'start'", "class.ant-flex-align-end": "nzAlign === 'end'", "class.ant-flex-align-right": "nzAlign === 'right'", "class.ant-flex-align-left": "nzAlign === 'left'", "class.ant-flex-align-stretch": "nzAlign === 'stretch'", "class.ant-flex-align-normal": "nzAlign === 'normal'", "class.ant-flex-wrap-wrap": "nzWrap === 'wrap'", "class.ant-flex-wrap-wrap-reverse": "nzWrap === 'wrap-reverse'", "class.ant-flex-wrap-nowrap": "nzWrap === 'nowrap'", "style.gap": "gap", "style.flex": "nzFlex" }, classAttribute: "ant-flex" }, exportAs: ["nzFlex"], ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzFlexDirective, decorators: [{ type: Directive, args: [{ selector: '[nz-flex],nz-flex', exportAs: 'nzFlex', standalone: true, host: { class: 'ant-flex', '[class.ant-flex-vertical]': `nzVertical`, '[class.ant-flex-justify-flex-start]': `nzJustify === 'flex-start'`, '[class.ant-flex-justify-center]': `nzJustify === 'center'`, '[class.ant-flex-justify-flex-end]': `nzJustify === 'flex-end'`, '[class.ant-flex-justify-space-between]': `nzJustify === 'space-between'`, '[class.ant-flex-justify-space-around]': `nzJustify === 'space-around'`, '[class.ant-flex-justify-space-evenly]': `nzJustify === 'space-evenly'`, '[class.ant-flex-justify-start]': `nzJustify === 'start'`, '[class.ant-flex-justify-end]': `nzJustify === 'end'`, '[class.ant-flex-justify-right]': `nzJustify === 'right'`, '[class.ant-flex-justify-left]': `nzJustify === 'left'`, '[class.ant-flex-justify-stretch]': `nzJustify === 'stretch'`, '[class.ant-flex-justify-normal]': `nzJustify === 'normal'`, '[class.ant-flex-align-flex-start]': `nzAlign === 'flex-start'`, '[class.ant-flex-align-center]': `nzAlign === 'center'`, '[class.ant-flex-align-flex-end]': `nzAlign === 'flex-end'`, '[class.ant-flex-align-space-between]': `nzAlign === 'space-between'`, '[class.ant-flex-align-space-around]': `nzAlign === 'space-around'`, '[class.ant-flex-align-space-evenly]': `nzAlign === 'space-evenly'`, '[class.ant-flex-align-start]': `nzAlign === 'start'`, '[class.ant-flex-align-end]': `nzAlign === 'end'`, '[class.ant-flex-align-right]': `nzAlign === 'right'`, '[class.ant-flex-align-left]': `nzAlign === 'left'`, '[class.ant-flex-align-stretch]': `nzAlign === 'stretch'`, '[class.ant-flex-align-normal]': `nzAlign === 'normal'`, '[class.ant-flex-wrap-wrap]': `nzWrap === 'wrap'`, '[class.ant-flex-wrap-wrap-reverse]': `nzWrap === 'wrap-reverse'`, '[class.ant-flex-wrap-nowrap]': `nzWrap === 'nowrap'`, '[style.gap]': `gap`, '[style.flex]': `nzFlex` } }] }], propDecorators: { nzVertical: [{ type: Input }], nzJustify: [{ type: Input }], nzAlign: [{ type: Input }], nzGap: [{ type: Input }], nzWrap: [{ type: Input }], nzFlex: [{ type: Input }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotZmxleC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9jb21wb25lbnRzL2ZsZXgvbnotZmxleC5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztHQUdHO0FBRUgsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBMENqRCxNQUFNLE9BQU8sZUFBZTtJQXRDNUI7UUF1Q1csZUFBVSxHQUFZLEtBQUssQ0FBQztRQUM1QixjQUFTLEdBQWMsUUFBUSxDQUFDO1FBQ2hDLFlBQU8sR0FBWSxRQUFRLENBQUM7UUFDNUIsVUFBSyxHQUFVL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