UNPKG

ng-zorro-antd

Version:

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

9 lines 26.1 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/platform-browser"),require("rxjs"),require("ng-zorro-antd/core"),require("@angular/cdk/keycodes"),require("@angular/cdk/overlay"),require("@angular/forms"),require("rxjs/operators"),require("@angular/common"),require("ng-zorro-antd/empty"),require("ng-zorro-antd/icon"),require("ng-zorro-antd/input")):"function"==typeof define&&define.amd?define("ng-zorro-antd/cascader",["exports","@angular/core","@angular/platform-browser","rxjs","ng-zorro-antd/core","@angular/cdk/keycodes","@angular/cdk/overlay","@angular/forms","rxjs/operators","@angular/common","ng-zorro-antd/empty","ng-zorro-antd/icon","ng-zorro-antd/input"],t):t((e["ng-zorro-antd"]=e["ng-zorro-antd"]||{},e["ng-zorro-antd"].cascader={}),e.ng.core,e.ng.platformBrowser,e.rxjs,e["ng-zorro-antd"].core,e.ng.cdk.keycodes,e.ng.cdk.overlay,e.ng.forms,e.rxjs.operators,e.ng.common,e["ng-zorro-antd"].empty,e["ng-zorro-antd"].icon,e["ng-zorro-antd"].input)}(this,function(e,r,t,a,s,n,i,o,c,l,p,u,d){"use strict";function h(e){return"boolean"!=typeof e} /** * @license * Copyright Alibaba.com All Rights Reserved. * * 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 */function g(e){return e.isLeaf||!e.children||!e.children.length}function y(e){return!!e.children&&!!e.children.length&&!e.isLeaf}function f(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;0<=s;s--)(o=e[s])&&(a=(r<3?o(a):3<r?o(t,n,a):o(t,n))||a);return 3<r&&a&&Object.defineProperty(t,n,a),a}function m(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(o)throw o.error}}return a}function O(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}var b=function(){function e(e,t,n,i){this.sanitizer=e,this.cdr=t,this.activated=!1,this.nzLabelProperty="label",i.addClass(n.nativeElement,"ant-cascader-menu-item")}return e.prototype.getOptionLabel=function(){return this.option?this.option[this.nzLabelProperty]:""},e.prototype.renderHighlightString=function(e){var t=e.replace(new RegExp(this.highlightText,"g"),'<span class="ant-cascader-menu-item-keyword">'+this.highlightText+"</span>");return this.sanitizer.bypassSecurityTrustHtml(t)},e.prototype.markForCheck=function(){this.cdr.markForCheck()},e.decorators=[{type:r.Component,args:[{changeDetection:r.ChangeDetectionStrategy.OnPush,encapsulation:r.ViewEncapsulation.None,selector:"[nz-cascader-option]",exportAs:"nzCascaderOption",template:'<ng-container *ngIf="highlightText">\n <span [innerHTML]="renderHighlightString(getOptionLabel())"></span>\n</ng-container>\n<ng-container *ngIf="!highlightText">{{ getOptionLabel() }}</ng-container>\n<span\n *ngIf="!option.isLeaf || option.children && option.children.length || option.loading"\n class="ant-cascader-menu-item-expand-icon">\n <i nz-icon [type]="option.loading ? \'loading\' : \'right\'"></i>\n</span>\n',host:{"[attr.title]":"option.title || getOptionLabel()","[class.ant-cascader-menu-item-active]":"activated","[class.ant-cascader-menu-item-expand]":"!option.isLeaf","[class.ant-cascader-menu-item-disabled]":"option.disabled"}}]}],e.ctorParameters=function(){return[{type:t.DomSanitizer},{type:r.ChangeDetectorRef},{type:r.ElementRef},{type:r.Renderer2}]},e.propDecorators={option:[{type:r.Input}],activated:[{type:r.Input}],highlightText:[{type:r.Input}],nzLabelProperty:[{type:r.Input}]},e}(),S=function(){function e(){this.activatedOptions=[],this.columns=[[]],this.inSearchingMode=!1,this.selectedOptions=[],this.values=[],this.$loading=new a.BehaviorSubject(!1),this.$redraw=new a.Subject,this.$optionSelected=new a.Subject,this.$quitSearching=new a.Subject,this.columnsSnapshot=[[]],this.activatedOptionsSnapshot=[]}return Object.defineProperty(e.prototype,"nzOptions",{get:function(){return this.columns[0]},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.$redraw.complete(),this.$quitSearching.complete(),this.$optionSelected.complete(),this.$loading.complete()},e.prototype.syncOptions=function(e){var o=this;void 0===e&&(e=!1);var r=this.values,t=r&&r.length,a=r.length-1,s=function(i){var e=function(){var e,t=r[i];if(t){var n=o.findOptionWithValue(i,r[i])||("object"==typeof t?t:((e={})[""+o.cascaderComponent.nzValueProperty]=t,e[""+o.cascaderComponent.nzLabelProperty]=t,e));o.setOptionActivated(n,i,!1,!1),i<a?s(i+1):(o.dropBehindColumns(i),o.selectedOptions=O(o.activatedOptions),o.$redraw.next())}else o.$redraw.next()};if(o.isLoaded(i)||!o.cascaderComponent.nzLoadData)e();else{var t=o.activatedOptions[i-1]||{};o.loadChildren(t,i-1,e)}};this.activatedOptions=[],this.selectedOptions=[],e&&this.cascaderComponent.nzLoadData&&!t||s(0)},e.prototype.withComponent=function(e){this.cascaderComponent=e},e.prototype.withOptions=function(e){this.columnsSnapshot=this.columns=e&&e.length?[e]:[],this.inSearchingMode?this.prepareSearchOptions(this.cascaderComponent.inputValue):this.columns.length&&this.syncOptions()},e.prototype.setOptionActivated=function(e,t,n,i){(void 0===n&&(n=!1),void 0===i&&(i=!0),e.disabled)||(this.activatedOptions[t]=e,this.trackAncestorActivatedOptions(t),this.dropBehindActivatedOptions(t),y(e)?this.setColumnData(e.children,t+1,e):!e.isLeaf&&i?this.loadChildren(e,t):e.isLeaf&&this.dropBehindColumns(t),n&&this.setOptionSelected(e,t),this.$redraw.next())},e.prototype.setSearchOptionSelected=function(e){var t=this;this.activatedOptions=[e],this.selectedOptions=O(e.path),this.prepareEmitValue(),this.$redraw.next(),this.$optionSelected.next({option:e,index:0}),setTimeout(function(){t.$quitSearching.next(),t.$redraw.next(),t.inSearchingMode=!1,t.columns=O(t.columnsSnapshot),t.activatedOptions=O(t.selectedOptions)},200)},e.prototype.prepareSearchOptions=function(r){var a=this,s=[],c=[],e=this.cascaderComponent.nzShowSearch,l=h(e)&&e.filter?e.filter:function(n,e){return e.some(function(e){var t=a.getOptionLabel(e);return!!t&&-1!==t.indexOf(n)})},n=h(e)&&e.sorter?e.sorter:null,i=function(e,t){var n;void 0===t&&(t=!1),c.push(e);var i=Array.from(c);if(l(r,i)){var o=((n={disabled:t||e.disabled,isLeaf:!0,path:i})[a.cascaderComponent.nzLabelProperty]=i.map(function(e){return a.getOptionLabel(e)}).join(" / "),n);s.push(o)}c.pop()},o=function(t,e){void 0===e&&(e=!1);var n=e||t.disabled;c.push(t),t.children.forEach(function(e){e.parent||(e.parent=t),e.isLeaf||o(e,n),!e.isLeaf&&e.children&&e.children.length||i(e,n)}),c.pop()};this.columnsSnapshot.length?(this.columnsSnapshot[0].forEach(function(e){return g(e)?i(e):o(e)}),n&&s.sort(function(e,t){return n(e.path,t.path,r)}),this.columns=[s]):this.columns=[[]]},e.prototype.toggleSearchingMode=function(e){(this.inSearchingMode=e)?(this.activatedOptionsSnapshot=O(this.activatedOptions),this.activatedOptions=[],this.selectedOptions=[]):(this.activatedOptions=O(this.activatedOptionsSnapshot),this.selectedOptions=O(this.activatedOptions),this.columns=O(this.columnsSnapshot),this.syncOptions()),this.$redraw.next()},e.prototype.setOptionSelected=function(e,t){var n,i,o=this.cascaderComponent.nzChangeOn;(e.isLeaf||this.cascaderComponent.nzChangeOnSelect||(n=e,i=t,"function"==typeof o&&o(n,i)))&&(this.selectedOptions=O(this.activatedOptions),this.prepareEmitValue(),this.$redraw.next(),this.$optionSelected.next({option:e,index:t}))},e.prototype.clear=function(){this.values=[],this.selectedOptions=[],this.activatedOptions=[],this.dropBehindColumns(0),this.prepareEmitValue(),this.$redraw.next(),this.$optionSelected.next(null)},e.prototype.getOptionLabel=function(e){return e[this.cascaderComponent.nzLabelProperty||"label"]},e.prototype.getOptionValue=function(e){return e[this.cascaderComponent.nzValueProperty||"value"]},e.prototype.setColumnData=function(e,t,n){var i=this.columns[t];s.arraysEqual(i,e)||(e.forEach(function(e){return e.parent=n}),this.columns[t]=e,this.dropBehindColumns(t))},e.prototype.trackAncestorActivatedOptions=function(e){for(var t=e-1;0<=t;t--)this.activatedOptions[t]||(this.activatedOptions[t]=this.activatedOptions[t+1].parent)},e.prototype.dropBehindActivatedOptions=function(e){this.activatedOptions=this.activatedOptions.splice(0,e+1)},e.prototype.dropBehindColumns=function(e){e<this.columns.length-1&&(this.columns=this.columns.slice(0,e+1))},e.prototype.loadChildren=function(e,t,n,i){var o=this,r=this.cascaderComponent.nzLoadData;r&&(this.$loading.next(t<0),"object"==typeof e&&(e.loading=!0),r(e,t).then(function(){e.loading=!1,e.children&&o.setColumnData(e.children,t+1,e),n&&n(),o.$loading.next(!1),o.$redraw.next()},function(){e.loading=!1,e.isLeaf=!0,i&&i(),o.$redraw.next()}))},e.prototype.isLoaded=function(e){return this.columns[e]&&0<this.columns[e].length},e.prototype.findOptionWithValue=function(e,t){var n=this,i=this.columns[e];if(i){var o="object"==typeof t?this.getOptionValue(t):t;return i.find(function(e){return o===n.getOptionValue(e)})}return null},e.prototype.prepareEmitValue=function(){var t=this;this.values=this.selectedOptions.map(function(e){return t.getOptionValue(e)})},e.decorators=[{type:r.Injectable}],e}(),z=function(){function e(e,t,n,i,o){this.cascaderService=e,this.cdr=t,this.noAnimation=o,this.nzShowInput=!0,this.nzShowArrow=!0,this.nzAllowClear=!0,this.nzAutoFocus=!1,this.nzChangeOnSelect=!1,this.nzDisabled=!1,this.nzExpandTrigger="click",this.nzValueProperty="value",this.nzLabelProperty="label",this.nzSize="default",this.nzPlaceHolder="Please select",this.nzMouseEnterDelay=150,this.nzMouseLeaveDelay=150,this.nzTriggerAction=["click"],this.nzSelectionChange=new r.EventEmitter,this.nzSelect=new r.EventEmitter,this.nzClear=new r.EventEmitter,this.nzVisibleChange=new r.EventEmitter,this.nzChange=new r.EventEmitter,this.dropDownPosition="bottom",this.menuVisible=!1,this.isLoading=!1,this.labelRenderContext={},this.onChange=Function.prototype,this.onTouched=Function.prototype,this.positions=O(s.DEFAULT_DROPDOWN_POSITIONS),this.isFocused=!1,this.$destroy=new a.Subject,this.inputString="",this.isOpening=!1,this.el=n.nativeElement,this.cascaderService.withComponent(this),i.addClass(n.nativeElement,"ant-cascader"),i.addClass(n.nativeElement,"ant-cascader-picker")}return Object.defineProperty(e.prototype,"nzOptions",{get:function(){return this.cascaderService.nzOptions},set:function(e){this.cascaderService.withOptions(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inSearchingMode",{get:function(){return this.cascaderService.inSearchingMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputValue",{get:function(){return this.inputString},set:function(e){this.inputString=e,this.toggleSearchingMode(!!e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menuCls",{get:function(){var e;return(e={})[""+this.nzMenuClassName]=!!this.nzMenuClassName,e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menuColumnCls",{get:function(){var e;return(e={})[""+this.nzColumnClassName]=!!this.nzColumnClassName,e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasInput",{get:function(){return!!this.inputValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasValue",{get:function(){return this.cascaderService.values&&0<this.cascaderService.values.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showPlaceholder",{get:function(){return!(this.hasInput||this.hasValue)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearIconVisible",{get:function(){return this.nzAllowClear&&!this.nzDisabled&&(this.hasValue||this.hasInput)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLabelRenderTemplate",{get:function(){return!!this.nzLabelRender},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var i=this,e=this.cascaderService;e.$redraw.pipe(c.takeUntil(this.$destroy)).subscribe(function(){i.checkChildren(),i.buildDisplayLabel(),i.reposition(),i.cdr.markForCheck()}),e.$loading.pipe(c.takeUntil(this.$destroy)).subscribe(function(e){i.isLoading=e}),e.$optionSelected.pipe(c.takeUntil(this.$destroy)).subscribe(function(e){if(e){var t=e.option,n=e.index;t.isLeaf&&i.delaySetMenuVisible(!1),i.onChange(i.cascaderService.values),i.nzSelectionChange.emit(i.cascaderService.selectedOptions),i.nzSelect.emit({option:t,index:n}),i.cdr.markForCheck()}else i.onChange([]),i.nzSelect.emit(null)}),e.$quitSearching.pipe(c.takeUntil(this.$destroy)).subscribe(function(){i.inputString="",i.dropdownWidthStyle=""})},e.prototype.ngOnDestroy=function(){this.$destroy.next(),this.$destroy.complete(),this.clearDelayMenuTimer(),this.clearDelaySelectTimer()},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.writeValue=function(e){this.cascaderService.values=s.toArray(e),this.cascaderService.syncOptions(!0)},e.prototype.delaySetMenuVisible=function(e,t,n){var i=this;void 0===t&&(t=100),void 0===n&&(n=!1),this.clearDelayMenuTimer(),t?(e&&n&&(this.isOpening=!0),this.delayMenuTimer=setTimeout(function(){i.setMenuVisible(e),i.cdr.detectChanges(),i.clearDelayMenuTimer(),e&&setTimeout(function(){i.isOpening=!1},100)},t)):this.setMenuVisible(e)},e.prototype.setMenuVisible=function(e){this.nzDisabled||this.menuVisible===e||(e&&this.cascaderService.syncOptions(),this.menuVisible=e,this.nzVisibleChange.emit(e),this.cdr.detectChanges())},e.prototype.clearDelayMenuTimer=function(){this.delayMenuTimer&&(clearTimeout(this.delayMenuTimer),this.delayMenuTimer=null)},e.prototype.clearSelection=function(e){e&&(e.preventDefault(),e.stopPropagation()),this.labelRenderText="",this.labelRenderContext={},this.inputValue="",this.setMenuVisible(!1),this.cascaderService.clear()},e.prototype.getSubmitValue=function(){var t=this;return this.cascaderService.selectedOptions.map(function(e){return t.cascaderService.getOptionValue(e)})},e.prototype.focus=function(){this.isFocused||((this.input?this.input.nativeElement:this.el).focus(),this.isFocused=!0)},e.prototype.blur=function(){this.isFocused&&((this.input?this.input.nativeElement:this.el).blur(),this.isFocused=!1)},e.prototype.handleInputBlur=function(){this.menuVisible?this.focus():this.blur()},e.prototype.handleInputFocus=function(){this.focus()},e.prototype.onKeyDown=function(e){var t=e.keyCode;if(t===n.DOWN_ARROW||t===n.UP_ARROW||t===n.LEFT_ARROW||t===n.RIGHT_ARROW||t===n.ENTER||t===n.BACKSPACE||t===n.ESCAPE)return this.menuVisible||t===n.BACKSPACE||t===n.ESCAPE?void((!this.inSearchingMode||t!==n.BACKSPACE&&t!==n.LEFT_ARROW&&t!==n.RIGHT_ARROW)&&this.menuVisible&&(e.preventDefault(),t===n.DOWN_ARROW?this.moveUpOrDown(!1):t===n.UP_ARROW?this.moveUpOrDown(!0):t===n.LEFT_ARROW?this.moveLeft():t===n.RIGHT_ARROW?this.moveRight():t===n.ENTER&&this.onEnter())):this.setMenuVisible(!0)},e.prototype.onTriggerClick=function(){this.nzDisabled||(this.nzShowSearch&&this.focus(),this.isActionTrigger("click")&&this.delaySetMenuVisible(!this.menuVisible,100),this.onTouched())},e.prototype.onTriggerMouseEnter=function(){this.nzDisabled||this.isActionTrigger("hover")&&this.delaySetMenuVisible(!0,this.nzMouseEnterDelay,!0)},e.prototype.onTriggerMouseLeave=function(e){if(!this.nzDisabled)if(this.menuVisible&&!this.isOpening){if(this.isActionTrigger("hover")){var t=e.relatedTarget,n=this.el,i=this.menu&&this.menu.nativeElement;if(n.contains(t)||i&&i.contains(t))return;this.delaySetMenuVisible(!1,this.nzMouseLeaveDelay)}}else e.preventDefault()},e.prototype.isActionTrigger=function(e){return"string"==typeof this.nzTriggerAction?this.nzTriggerAction===e:-1!==this.nzTriggerAction.indexOf(e)},e.prototype.onOptionClick=function(e,t,n){n&&n.preventDefault(),e&&e.disabled||(this.el.focus(),this.inSearchingMode?this.cascaderService.setSearchOptionSelected(e):this.cascaderService.setOptionActivated(e,t,!0))},e.prototype.onEnter=function(){var e=Math.max(this.cascaderService.activatedOptions.length-1,0),t=this.cascaderService.activatedOptions[e];t&&!t.disabled&&(this.inSearchingMode?this.cascaderService.setSearchOptionSelected(t):this.cascaderService.setOptionActivated(t,e,!0))},e.prototype.moveUpOrDown=function(e){var t=Math.max(this.cascaderService.activatedOptions.length-1,0),n=this.cascaderService.activatedOptions[t],i=this.cascaderService.columns[t]||[],o=i.length,r=-1;for(r=n?i.indexOf(n):e?o:-1;!((r=e?r-1:r+1)<0||o<=r);){var a=i[r];if(a&&!a.disabled){this.cascaderService.setOptionActivated(a,t);break}}},e.prototype.moveLeft=function(){var e=this.cascaderService.activatedOptions;e.length&&e.pop()},e.prototype.moveRight=function(){var e=this.cascaderService.activatedOptions.length,t=this.cascaderService.columns[e];if(t&&t.length){var n=t.find(function(e){return!e.disabled});n&&this.cascaderService.setOptionActivated(n,e)}},e.prototype.onOptionMouseEnter=function(e,t,n){n.preventDefault(),"hover"!==this.nzExpandTrigger||e.isLeaf||this.delaySelectOption(e,t,!0)},e.prototype.onOptionMouseLeave=function(e,t,n){n.preventDefault(),"hover"!==this.nzExpandTrigger||e.isLeaf||this.delaySelectOption(e,t,!1)},e.prototype.clearDelaySelectTimer=function(){this.delaySelectTimer&&(clearTimeout(this.delaySelectTimer),this.delaySelectTimer=null)},e.prototype.delaySelectOption=function(e,t,n){var i=this;this.clearDelaySelectTimer(),n&&(this.delaySelectTimer=setTimeout(function(){i.cascaderService.setOptionActivated(e,t),i.delaySelectTimer=null},150))},e.prototype.toggleSearchingMode=function(e){this.inSearchingMode!==e&&(this.cascaderService.toggleSearchingMode(e),this.dropdownWidthStyle=e?this.input.nativeElement.offsetWidth+"px":""),this.inSearchingMode&&this.cascaderService.prepareSearchOptions(this.inputValue)},e.prototype.isOptionActivated=function(e,t){return this.cascaderService.activatedOptions[t]===e},e.prototype.setDisabledState=function(e){e&&this.closeMenu(),this.nzDisabled=e},e.prototype.closeMenu=function(){this.blur(),this.clearDelayMenuTimer(),this.setMenuVisible(!1)},e.prototype.onPositionChange=function(e){var t="bottom"===e.connectionPair.originY?"bottom":"top";this.dropDownPosition!==t&&(this.dropDownPosition=t,this.cdr.detectChanges())},e.prototype.reposition=function(){var e=this;this.overlay&&this.overlay.overlayRef&&this.menuVisible&&Promise.resolve().then(function(){e.overlay.overlayRef.updatePosition()})},e.prototype.checkChildren=function(){this.cascaderItems&&this.cascaderItems.forEach(function(e){return e.markForCheck()})},e.prototype.buildDisplayLabel=function(){var t=this,e=this.cascaderService.selectedOptions,n=e.map(function(e){return t.cascaderService.getOptionLabel(e)});this.isLabelRenderTemplate?this.labelRenderContext={labels:n,selectedOptions:e}:this.labelRenderText=function(e){return e.join(" / ")}.call(this,n,e)},e.decorators=[{type:r.Component,args:[{changeDetection:r.ChangeDetectionStrategy.OnPush,encapsulation:r.ViewEncapsulation.None,selector:"nz-cascader,[nz-cascader]",exportAs:"nzCascader",preserveWhitespaces:!1,template:'<div\n cdkOverlayOrigin\n #origin="cdkOverlayOrigin"\n #trigger>\n <div *ngIf="nzShowInput">\n <input\n #input\n nz-input\n class="ant-cascader-input"\n [class.ant-cascader-input-disabled]="nzDisabled"\n [class.ant-cascader-input-lg]="nzSize === \'large\'"\n [class.ant-cascader-input-sm]="nzSize === \'small\'"\n [attr.autoComplete]="\'off\'"\n [attr.placeholder]="showPlaceholder ? nzPlaceHolder : null"\n [attr.autofocus]="nzAutoFocus ? \'autofocus\' : null"\n [readonly]="!nzShowSearch"\n [disabled]="nzDisabled"\n [nzSize]="nzSize"\n [(ngModel)]="inputValue"\n (blur)="handleInputBlur()"\n (focus)="handleInputFocus()"\n (change)="$event.stopPropagation()">\n <i *ngIf="clearIconVisible"\n nz-icon\n type="close-circle"\n theme="fill"\n class="ant-cascader-picker-clear"\n (click)="clearSelection($event)"></i>\n <i *ngIf="nzShowArrow && !isLoading"\n nz-icon\n type="down"\n class="ant-cascader-picker-arrow"\n [class.ant-cascader-picker-arrow-expand]="menuVisible">\n </i>\n <i *ngIf="isLoading" nz-icon type="loading" class="ant-cascader-picker-arrow"></i>\n <span\n class="ant-cascader-picker-label"\n [class.ant-cascader-show-search]="!!nzShowSearch"\n [class.ant-focusd]="!!nzShowSearch && isFocused && !inputValue">\n <ng-container *ngIf="!isLabelRenderTemplate; else labelTemplate">{{ labelRenderText }}</ng-container>\n <ng-template #labelTemplate>\n <ng-template [ngTemplateOutlet]="nzLabelRender" [ngTemplateOutletContext]="labelRenderContext"></ng-template>\n </ng-template>\n </span>\n </div>\n <ng-content></ng-content>\n</div>\n<ng-template\n cdkConnectedOverlay\n nzConnectedOverlay\n cdkConnectedOverlayHasBackdrop\n [cdkConnectedOverlayOrigin]="origin"\n [cdkConnectedOverlayPositions]="positions"\n (backdropClick)="closeMenu()"\n (detach)="closeMenu()"\n (positionChange)="onPositionChange($event)"\n [cdkConnectedOverlayOpen]="menuVisible">\n <div\n #menu\n class="ant-cascader-menus"\n *ngIf="nzOptions && nzOptions.length || inSearchingMode"\n [class.ant-cascader-menus-hidden]="!menuVisible"\n [ngClass]="menuCls"\n [ngStyle]="nzMenuStyle"\n [nzNoAnimation]="noAnimation?.nzNoAnimation"\n [@slideMotion]="dropDownPosition"\n (mouseleave)="onTriggerMouseLeave($event)">\n <ul *ngFor="let options of cascaderService.columns; let i = index;" class="ant-cascader-menu"\n [ngClass]="menuColumnCls"\n [style.height]="inSearchingMode && !cascaderService.columns[0].length ? \'auto\': \'\'"\n [style.width]="dropdownWidthStyle">\n <li\n nz-cascader-option\n *ngFor="let option of options"\n [nzLabelProperty]="nzLabelProperty"\n [activated]="isOptionActivated(option, i)"\n [highlightText]="inSearchingMode ? inputValue : \'\'"\n [option]="option"\n (mouseenter)="onOptionMouseEnter(option, i, $event)"\n (mouseleave)="onOptionMouseLeave(option, i, $event)"\n (click)="onOptionClick(option, i, $event)">\n </li>\n <li *ngIf="inSearchingMode && !cascaderService.columns[0].length"\n class="ant-cascader-menu-item ant-cascader-menu-item-expanded ant-cascader-menu-item-disabled">\n <nz-embed-empty [nzComponentName]="\'cascader\'" [specificContent]="nzNotFoundContent"></nz-embed-empty>\n </li>\n </ul>\n </div>\n</ng-template>\n',animations:[s.slideMotion],providers:[{provide:o.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return e}),multi:!0},S],host:{"[attr.tabIndex]":'"0"',"[class.ant-cascader-lg]":'nzSize === "large"',"[class.ant-cascader-sm]":'nzSize === "small"',"[class.ant-cascader-picker-disabled]":"nzDisabled","[class.ant-cascader-picker-open]":"menuVisible","[class.ant-cascader-picker-with-value]":"!!inputValue","[class.ant-cascader-focused]":"isFocused"},styles:["\n .ant-cascader-menus {\n margin-top: 4px;\n margin-bottom: 4px;\n top: 100%;\n left: 0;\n position: relative;\n width: 100%;\n }\n "]}]}],e.ctorParameters=function(){return[{type:S},{type:r.ChangeDetectorRef},{type:r.ElementRef},{type:r.Renderer2},{type:s.NzNoAnimationDirective,decorators:[{type:r.Host},{type:r.Optional}]}]},e.propDecorators={input:[{type:r.ViewChild,args:["input"]}],menu:[{type:r.ViewChild,args:["menu"]}],overlay:[{type:r.ViewChild,args:[i.CdkConnectedOverlay]}],cascaderItems:[{type:r.ViewChildren,args:[b]}],nzShowInput:[{type:r.Input}],nzShowArrow:[{type:r.Input}],nzAllowClear:[{type:r.Input}],nzAutoFocus:[{type:r.Input}],nzChangeOnSelect:[{type:r.Input}],nzDisabled:[{type:r.Input}],nzColumnClassName:[{type:r.Input}],nzExpandTrigger:[{type:r.Input}],nzValueProperty:[{type:r.Input}],nzLabelRender:[{type:r.Input}],nzLabelProperty:[{type:r.Input}],nzNotFoundContent:[{type:r.Input}],nzSize:[{type:r.Input}],nzShowSearch:[{type:r.Input}],nzPlaceHolder:[{type:r.Input}],nzMenuClassName:[{type:r.Input}],nzMenuStyle:[{type:r.Input}],nzMouseEnterDelay:[{type:r.Input}],nzMouseLeaveDelay:[{type:r.Input}],nzTriggerAction:[{type:r.Input}],nzChangeOn:[{type:r.Input}],nzLoadData:[{type:r.Input}],nzOptions:[{type:r.Input}],nzSelectionChange:[{type:r.Output}],nzSelect:[{type:r.Output}],nzClear:[{type:r.Output}],nzVisibleChange:[{type:r.Output}],nzChange:[{type:r.Output}],onKeyDown:[{type:r.HostListener,args:["keydown",["$event"]]}],onTriggerClick:[{type:r.HostListener,args:["click"]}],onTriggerMouseEnter:[{type:r.HostListener,args:["mouseenter"]}],onTriggerMouseLeave:[{type:r.HostListener,args:["mouseleave",["$event"]]}]},f([s.InputBoolean(),m("design:type",Object)],e.prototype,"nzShowInput",void 0),f([s.InputBoolean(),m("design:type",Object)],e.prototype,"nzShowArrow",void 0),f([s.InputBoolean(),m("design:type",Object)],e.prototype,"nzAllowClear",void 0),f([s.InputBoolean(),m("design:type",Object)],e.prototype,"nzAutoFocus",void 0),f([s.InputBoolean(),m("design:type",Object)],e.prototype,"nzChangeOnSelect",void 0),f([s.InputBoolean(),m("design:type",Object)],e.prototype,"nzDisabled",void 0),e}(),C=function(){function e(){}return e.decorators=[{type:r.NgModule,args:[{imports:[l.CommonModule,o.FormsModule,i.OverlayModule,d.NzInputModule,u.NzIconModule,p.NzEmptyModule,s.NzOverlayModule,s.NzNoAnimationModule],declarations:[z,b],exports:[z]}]}],e}();e.isShowSearchObject=h,e.isChildOption=g,e.isParentOption=y,e.NzCascaderComponent=z,e.NzCascaderModule=C,e.NzCascaderService=S,e.NzCascaderOptionComponent=b,Object.defineProperty(e,"__esModule",{value:!0})}); //# sourceMappingURL=ng-zorro-antd-cascader.umd.min.js.map