UNPKG

ng-zorro-antd

Version:

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

10 lines 27.3 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/keycodes"),require("@angular/cdk/overlay"),require("@angular/core"),require("@angular/forms"),require("rxjs"),require("rxjs/operators"),require("ng-zorro-antd/core"),require("ng-zorro-antd/i18n"),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/cdk/keycodes","@angular/cdk/overlay","@angular/core","@angular/forms","rxjs","rxjs/operators","ng-zorro-antd/core","ng-zorro-antd/i18n","@angular/common","ng-zorro-antd/empty","ng-zorro-antd/icon","ng-zorro-antd/input"],t):t(((e=e||self)["ng-zorro-antd"]=e["ng-zorro-antd"]||{},e["ng-zorro-antd"].cascader={}),e.ng.cdk.keycodes,e.ng.cdk.overlay,e.ng.core,e.ng.forms,e.rxjs,e.rxjs.operators,e["ng-zorro-antd"].core,e["ng-zorro-antd"].i18n,e.ng.common,e["ng-zorro-antd"].empty,e["ng-zorro-antd"].icon,e["ng-zorro-antd"].input)}(this,function(e,t,n,i,o,a,r,s,c,l,p,u,d){"use strict";function h(e,t,n,i){var o,a=arguments.length,r=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(r=(a<3?o(r):a>3?o(t,n,r):o(t,n))||r);return a>3&&r&&Object.defineProperty(t,n,r),r}function g(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function f(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 v(e){return e.isLeaf||!e.children||!e.children.length}function O(e){return!!e.children&&!!e.children.length&&!e.isLeaf}var S=function(){function e(e,t,n){this.cdr=e,this.optionTemplate=null,this.activated=!1,this.nzLabelProperty="label",n.addClass(t.nativeElement,"ant-cascader-menu-item")}return Object.defineProperty(e.prototype,"optionLabel",{get:function(){return this.option[this.nzLabelProperty]},enumerable:!0,configurable:!0}),e.prototype.markForCheck=function(){this.cdr.markForCheck()},e.decorators=[{type:i.Component,args:[{changeDetection:i.ChangeDetectionStrategy.OnPush,encapsulation:i.ViewEncapsulation.None,selector:"[nz-cascader-option]",exportAs:"nzCascaderOption",template:'<ng-container *ngIf="optionTemplate; else defaultOptionTemplate">\n <ng-template [ngTemplateOutlet]="optionTemplate"\n [ngTemplateOutletContext]="{ $implicit: option, index: columnIndex }"></ng-template>\n</ng-container>\n<ng-template #defaultOptionTemplate>\n <span [innerHTML]="optionLabel | nzHighlight: highlightText: \'g\': \'ant-cascader-menu-item-keyword\'"></span>\n</ng-template>\n<span *ngIf="!option.isLeaf || option.children?.length || option.loading"\n class="ant-cascader-menu-item-expand-icon">\n <i nz-icon\n [nzType]="option.loading ? \'loading\' : \'right\'"></i>\n</span>\n',host:{"[attr.title]":"option.title || optionLabel","[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:i.ChangeDetectorRef},{type:i.ElementRef},{type:i.Renderer2}]},e.propDecorators={optionTemplate:[{type:i.Input}],option:[{type:i.Input}],activated:[{type:i.Input}],highlightText:[{type:i.Input}],nzLabelProperty:[{type:i.Input}],columnIndex:[{type:i.Input}]},e}();var b=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 t=this;void 0===e&&(e=!1);var n=this.values,i=n&&n.length,o=n.length-1,a=function(e){var i=function(){var i,r=n[e];if(s.isNotNil(r)){var c=t.findOptionWithValue(e,n[e])||("object"==typeof r?r:((i={})[""+t.cascaderComponent.nzValueProperty]=r,i[""+t.cascaderComponent.nzLabelProperty]=r,i));t.setOptionActivated(c,e,!1,!1),e<o?a(e+1):(t.dropBehindColumns(e),t.selectedOptions=y(t.activatedOptions),t.$redraw.next())}else t.$redraw.next()};if(t.isLoaded(e)||!t.cascaderComponent.nzLoadData)i();else{var r=t.activatedOptions[e-1]||{};t.loadChildren(r,e-1,i)}};this.activatedOptions=[],this.selectedOptions=[],e&&this.cascaderComponent.nzLoadData&&!i?this.$redraw.next():a(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),O(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.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=y(this.activatedOptions),this.prepareEmitValue(),this.$redraw.next(),this.$optionSelected.next({option:e,index:t}))},e.prototype.setOptionDeactivatedSinceColumn=function(e){this.dropBehindActivatedOptions(e-1),this.dropBehindColumns(e),this.$redraw.next()},e.prototype.setSearchOptionSelected=function(e){var t=this;this.activatedOptions=[e],this.selectedOptions=y(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=y(t.columnsSnapshot),t.activatedOptions=y(t.selectedOptions)},200)},e.prototype.prepareSearchOptions=function(e){var t=this,n=[],i=[],o=this.cascaderComponent.nzShowSearch,a=f(o)&&o.filter?o.filter:function(e,n){return n.some(function(n){var i=t.getOptionLabel(n);return!!i&&-1!==i.indexOf(e)})},r=f(o)&&o.sorter?o.sorter:null,s=function(o,r){var s;void 0===r&&(r=!1),i.push(o);var c=Array.from(i);if(a(e,c)){var l=((s={disabled:r||o.disabled,isLeaf:!0,path:c})[t.cascaderComponent.nzLabelProperty]=c.map(function(e){return t.getOptionLabel(e)}).join(" / "),s);n.push(l)}i.pop()},c=function(e,t){void 0===t&&(t=!1);var n=t||e.disabled;i.push(e),e.children.forEach(function(t){t.parent||(t.parent=e),t.isLeaf||c(t,n),!t.isLeaf&&t.children&&t.children.length||s(t,n)}),i.pop()};this.columnsSnapshot.length?(this.columnsSnapshot[0].forEach(function(e){return v(e)?s(e):c(e)}),r&&n.sort(function(t,n){return r(t.path,n.path,e)}),this.columns=[n]):this.columns=[[]]},e.prototype.toggleSearchingMode=function(e){this.inSearchingMode=e,e?(this.activatedOptionsSnapshot=y(this.activatedOptions),this.activatedOptions=[],this.selectedOptions=[],this.$redraw.next()):(this.activatedOptions=y(this.activatedOptionsSnapshot),this.selectedOptions=y(this.activatedOptions),this.columns=y(this.columnsSnapshot),this.syncOptions(),this.$redraw.next())},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;t>=0;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,a=this.cascaderComponent.nzLoadData;a&&(this.$loading.next(t<0),"object"==typeof e&&(e.loading=!0),a(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]&&this.columns[e].length>0},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 e=this;this.values=this.selectedOptions.map(function(t){return e.getOptionValue(t)})},e.decorators=[{type:i.Injectable}],e}();var z=function(e){return e.join(" / ")},C=function(){function e(e,t,n,o,r,c,l){this.cascaderService=e,this.i18nService=t,this.nzConfigService=n,this.cdr=o,this.noAnimation=l,this.nzOptionRender=null,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.nzMouseEnterDelay=150,this.nzMouseLeaveDelay=150,this.nzTriggerAction=["click"],this.nzVisibleChange=new i.EventEmitter,this.nzSelectionChange=new i.EventEmitter,this.nzSelect=new i.EventEmitter,this.nzClear=new i.EventEmitter,this.dropDownPosition="bottom",this.menuVisible=!1,this.isLoading=!1,this.labelRenderContext={},this.onChange=Function.prototype,this.onTouched=Function.prototype,this.positions=y(s.DEFAULT_DROPDOWN_POSITIONS),this.isFocused=!1,this.$destroy=new a.Subject,this.inputString="",this.isOpening=!1,this.el=r.nativeElement,this.cascaderService.withComponent(this),c.addClass(r.nativeElement,"ant-cascader"),c.addClass(r.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&&this.cascaderService.values.length>0},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 e=this,t=this.cascaderService;t.$redraw.pipe(r.takeUntil(this.$destroy)).subscribe(function(){e.checkChildren(),e.buildDisplayLabel(),e.reposition(),e.cdr.markForCheck()}),t.$loading.pipe(r.takeUntil(this.$destroy)).subscribe(function(t){e.isLoading=t}),t.$optionSelected.pipe(r.takeUntil(this.$destroy)).subscribe(function(t){if(t){var n=t.option,i=t.index;n.isLeaf&&e.delaySetMenuVisible(!1),e.onChange(e.cascaderService.values),e.nzSelectionChange.emit(e.cascaderService.selectedOptions),e.nzSelect.emit({option:n,index:i}),e.cdr.markForCheck()}else e.onChange([]),e.nzSelect.emit(null),e.nzSelectionChange.emit([])}),t.$quitSearching.pipe(r.takeUntil(this.$destroy)).subscribe(function(){e.inputString="",e.dropdownWidthStyle=""}),this.i18nService.localeChange.pipe(r.startWith(),r.takeUntil(this.$destroy)).subscribe(function(){e.setLocale()}),this.nzConfigService.getConfigChangeEventForComponent(s.trimComponentName(this.constructor.name)).pipe(r.takeUntil(this.$destroy)).subscribe(function(){e.cdr.markForCheck()}),this.nzSelect.observers.length>0&&s.warnDeprecation("nzSelect is deprecated and will be removed in 9.0.0. Please use 'nzSelectionChange' instead.")},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 e=this;return this.cascaderService.selectedOptions.map(function(t){return e.cascaderService.getOptionValue(t)})},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 n=e.keyCode;if(n===t.DOWN_ARROW||n===t.UP_ARROW||n===t.LEFT_ARROW||n===t.RIGHT_ARROW||n===t.ENTER||n===t.BACKSPACE||n===t.ESCAPE)return this.menuVisible||n===t.BACKSPACE||n===t.ESCAPE?void((!this.inSearchingMode||n!==t.BACKSPACE&&n!==t.LEFT_ARROW&&n!==t.RIGHT_ARROW)&&this.menuVisible&&(e.preventDefault(),n===t.DOWN_ARROW?this.moveUpOrDown(!1):n===t.UP_ARROW?this.moveUpOrDown(!0):n===t.LEFT_ARROW?this.moveLeft():n===t.RIGHT_ARROW?this.moveRight():n===t.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&&this.menuVisible&&!this.isOpening&&this.isActionTrigger("hover")){var t=e.relatedTarget,n=this.el,i=this.menu&&this.menu.nativeElement;n.contains(t)||i&&i.contains(t)||this.delaySetMenuVisible(!1,this.nzMouseLeaveDelay)}else e.preventDefault()},e.prototype.onOptionMouseEnter=function(e,t,n){n.preventDefault(),"hover"===this.nzExpandTrigger&&(e.isLeaf?this.cascaderService.setOptionDeactivatedSinceColumn(t):this.delaySetOptionActivated(e,t,!1))},e.prototype.onOptionMouseLeave=function(e,t,n){n.preventDefault(),"hover"!==this.nzExpandTrigger||e.isLeaf||this.clearDelaySelectTimer()},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.isActionTrigger=function(e){return"string"==typeof this.nzTriggerAction?this.nzTriggerAction===e:-1!==this.nzTriggerAction.indexOf(e)},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,a=-1;for(a=n?i.indexOf(n):e?o:-1;!((a=e?a-1:a+1)<0||a>=o);){var r=i[a];if(r&&!r.disabled){this.cascaderService.setOptionActivated(r,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.clearDelaySelectTimer=function(){this.delaySelectTimer&&(clearTimeout(this.delaySelectTimer),this.delaySelectTimer=null)},e.prototype.delaySetOptionActivated=function(e,t,n){var i=this;this.clearDelaySelectTimer(),this.delaySelectTimer=setTimeout(function(){i.cascaderService.setOptionActivated(e,t,n),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 e=this,t=this.cascaderService.selectedOptions,n=t.map(function(t){return e.cascaderService.getOptionLabel(t)});this.isLabelRenderTemplate?this.labelRenderContext={labels:n,selectedOptions:t}:this.labelRenderText=z.call(this,n,t)},e.prototype.setLocale=function(){this.locale=this.i18nService.getLocaleData("global"),this.cdr.markForCheck()},e.decorators=[{type:i.Component,args:[{changeDetection:i.ChangeDetectionStrategy.OnPush,encapsulation:i.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 || locale?.placeholder ) : 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 nzType="close-circle"\n nzTheme="fill"\n class="ant-cascader-picker-clear"\n (click)="clearSelection($event)"></i>\n <i *ngIf="nzShowArrow && !isLoading"\n nz-icon\n nzType="down"\n class="ant-cascader-picker-arrow"\n [class.ant-cascader-picker-arrow-expand]="menuVisible">\n </i>\n <i *ngIf="isLoading" nz-icon nzType="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 [@.disabled]="noAnimation?.nzNoAnimation"\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 [columnIndex]="i"\n [nzLabelProperty]="nzLabelProperty"\n [optionTemplate]="nzOptionRender"\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:i.forwardRef(function(){return e}),multi:!0},b],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:b},{type:c.NzI18nService},{type:s.NzConfigService},{type:i.ChangeDetectorRef},{type:i.ElementRef},{type:i.Renderer2},{type:s.NzNoAnimationDirective,decorators:[{type:i.Host},{type:i.Optional}]}]},e.propDecorators={input:[{type:i.ViewChild,args:["input",{static:!1}]}],menu:[{type:i.ViewChild,args:["menu",{static:!1}]}],overlay:[{type:i.ViewChild,args:[n.CdkConnectedOverlay,{static:!1}]}],cascaderItems:[{type:i.ViewChildren,args:[S]}],nzOptionRender:[{type:i.Input}],nzShowInput:[{type:i.Input}],nzShowArrow:[{type:i.Input}],nzAllowClear:[{type:i.Input}],nzAutoFocus:[{type:i.Input}],nzChangeOnSelect:[{type:i.Input}],nzDisabled:[{type:i.Input}],nzColumnClassName:[{type:i.Input}],nzExpandTrigger:[{type:i.Input}],nzValueProperty:[{type:i.Input}],nzLabelRender:[{type:i.Input}],nzLabelProperty:[{type:i.Input}],nzNotFoundContent:[{type:i.Input}],nzSize:[{type:i.Input}],nzShowSearch:[{type:i.Input}],nzPlaceHolder:[{type:i.Input}],nzMenuClassName:[{type:i.Input}],nzMenuStyle:[{type:i.Input}],nzMouseEnterDelay:[{type:i.Input}],nzMouseLeaveDelay:[{type:i.Input}],nzTriggerAction:[{type:i.Input}],nzChangeOn:[{type:i.Input}],nzLoadData:[{type:i.Input}],nzOptions:[{type:i.Input}],nzVisibleChange:[{type:i.Output}],nzSelectionChange:[{type:i.Output}],nzSelect:[{type:i.Output}],nzClear:[{type:i.Output}],onKeyDown:[{type:i.HostListener,args:["keydown",["$event"]]}],onTriggerClick:[{type:i.HostListener,args:["click"]}],onTriggerMouseEnter:[{type:i.HostListener,args:["mouseenter"]}],onTriggerMouseLeave:[{type:i.HostListener,args:["mouseleave",["$event"]]}]},h([s.InputBoolean(),g("design:type",Object)],e.prototype,"nzShowInput",void 0),h([s.InputBoolean(),g("design:type",Object)],e.prototype,"nzShowArrow",void 0),h([s.InputBoolean(),g("design:type",Object)],e.prototype,"nzAllowClear",void 0),h([s.InputBoolean(),g("design:type",Object)],e.prototype,"nzAutoFocus",void 0),h([s.InputBoolean(),g("design:type",Object)],e.prototype,"nzChangeOnSelect",void 0),h([s.InputBoolean(),g("design:type",Object)],e.prototype,"nzDisabled",void 0),h([s.WithConfig("default"),g("design:type",String)],e.prototype,"nzSize",void 0),e}();var w=function(){function e(){}return e.decorators=[{type:i.NgModule,args:[{imports:[l.CommonModule,o.FormsModule,n.OverlayModule,s.NzAddOnModule,p.NzEmptyModule,s.NzHighlightModule,u.NzIconModule,d.NzInputModule,s.NzNoAnimationModule,s.NzOverlayModule],declarations:[C,S],exports:[C]}]}],e}();e.NzCascaderComponent=C,e.NzCascaderModule=w,e.NzCascaderOptionComponent=S,e.NzCascaderService=b,e.isChildOption=v,e.isParentOption=O,e.isShowSearchObject=f,Object.defineProperty(e,"__esModule",{value:!0})}); //# sourceMappingURL=ng-zorro-antd-cascader.umd.min.js.map