-
Notifications
You must be signed in to change notification settings - Fork 11
/
chunk-DG3ROCAE.js
1 lines (1 loc) · 16.2 KB
/
chunk-DG3ROCAE.js
1
import{g as Re}from"./chunk-RKL5WCT5.js";import{$ as Ce,Eb as B,Fa as Ae,Gb as _e,Hb as De,K as ye,Ua as be,hc as Ee,ia as $,jb as Oe,kb as j,nb as Se,yb as Ie}from"./chunk-YWVGY2C2.js";import{$a as ee,Ac as y,Ba as G,Bc as h,C as R,Ca as K,Cc as m,E as b,Gc as P,Ha as J,Hc as k,Hd as ze,Ib as O,Ic as de,Jb as ne,Jc as fe,Kb as oe,La as d,Ma as N,Ob as T,P as Q,Pb as p,Pc as ge,Qa as x,Vb as se,Wb as g,Yb as V,Zb as re,_b as ae,_c as M,a as C,aa as w,ba as c,c as H,da as Z,ed as F,f as A,gc as le,ha as U,hc as ce,ic as u,id as D,ja as Y,jc as v,la as X,lc as pe,mc as ue,oa as a,oc as he,rb as f,rc as S,sb as r,tc as z,td as ve,ub as te,uc as I,vc as _,x as E,ya as q,yb as ie,zc as me}from"./chunk-GBKJFEQZ.js";var we=new X("nz-after-next-render",{providedIn:"root",factory:()=>{let n=a(J);return new H(s=>{let e=ee(()=>{s.next(),s.complete()},{injector:n});return()=>e.destroy()})}});var Pe=[[["nz-auto-option"]]],ke=["nz-auto-option"];function Me(n,s){if(n&1&&(pe(0),k(1),ue()),n&2){let e=z();f(),de(e.nzLabel)}}var Ne=["*"],Fe=["panel"],$e=["content"],je=(n,s)=>s.value;function Be(n,s){}function We(n,s){n&1&&p(0,Be,0,0,"ng-template")}function Le(n,s){n&1&&_(0)}function He(n,s){if(n&1&&(u(0,"nz-auto-option",7),k(1),v()),n&2){let e=s.$implicit;g("nzValue",e.value)("nzLabel",e.label),f(),fe(" ",e.label," ")}}function Qe(n,s){if(n&1&&le(0,He,2,3,"nz-auto-option",7,je),n&2){let e=z(2);ce(e.normalizedDataSource)}}function Ze(n,s){if(n&1){let e=he();u(0,"div",3,0),S("@slideMotion.done",function(i){G(e);let o=z();return K(o.onAnimationEvent(i))}),u(2,"div",4)(3,"div",5),p(4,We,1,0,null,6),v()()(),p(5,Le,1,0,"ng-template",null,1,M)(7,Qe,2,0,"ng-template",null,2,M)}if(n&2){let e=P(6),t=P(8),i=z();re(i.nzOverlayStyle),ae(i.nzOverlayClassName),V("ant-select-dropdown-hidden",!i.showPanel)("ant-select-dropdown-rtl",i.dir==="rtl"),g("nzNoAnimation",i.noAnimation==null?null:i.noAnimation.nzNoAnimation)("@slideMotion",void 0)("@.disabled",!!(i.noAnimation!=null&&i.noAnimation.nzNoAnimation)),f(4),g("ngTemplateOutlet",i.nzDataSource?t:e)}}var xe=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["nz-auto-optgroup"]],inputs:{nzLabel:"nzLabel"},exportAs:["nzAutoOptgroup"],ngContentSelectors:ke,decls:3,vars:1,consts:[[1,"ant-select-item","ant-select-item-group"],[4,"nzStringTemplateOutlet"]],template:function(t,i){t&1&&(I(Pe),u(0,"div",0),p(1,Me,2,1,"ng-container",1),v(),_(2)),t&2&&(f(),g("nzStringTemplateOutlet",i.nzLabel))},dependencies:[De,_e],encapsulation:2,changeDetection:0})}}return n})(),L=class{constructor(s,e=!1){this.source=s,this.isUserInput=e}},W=(()=>{class n{constructor(e,t,i){this.ngZone=e,this.changeDetectorRef=t,this.element=i,this.nzDisabled=!1,this.selectionChange=new d,this.mouseEntered=new d,this.active=!1,this.selected=!1,this.nzAutocompleteOptgroupComponent=a(xe,{optional:!0}),this.destroy$=new A}ngOnInit(){$(this.element.nativeElement,"mouseenter").pipe(b(()=>this.mouseEntered.observers.length>0),c(this.destroy$)).subscribe(()=>{this.ngZone.run(()=>this.mouseEntered.emit(this))}),$(this.element.nativeElement,"mousedown").pipe(c(this.destroy$)).subscribe(e=>e.preventDefault())}ngOnDestroy(){this.destroy$.next()}select(e=!0){this.selected=!0,this.changeDetectorRef.markForCheck(),e&&this.emitSelectionChangeEvent()}deselect(){this.selected=!1,this.changeDetectorRef.markForCheck(),this.emitSelectionChangeEvent()}getLabel(){return this.nzLabel||this.nzValue.toString()}setActiveStyles(){this.active||(this.active=!0,this.changeDetectorRef.markForCheck())}setInactiveStyles(){this.active&&(this.active=!1,this.changeDetectorRef.markForCheck())}scrollIntoViewIfNeeded(){Ce(this.element.nativeElement)}selectViaInteraction(){this.nzDisabled||(this.selected=!this.selected,this.selected?this.setActiveStyles():this.setInactiveStyles(),this.emitSelectionChangeEvent(!0),this.changeDetectorRef.markForCheck())}emitSelectionChangeEvent(e=!1){this.selectionChange.emit(new L(this,e))}static{this.\u0275fac=function(t){return new(t||n)(r(N),r(F),r(x))}}static{this.\u0275cmp=O({type:n,selectors:[["nz-auto-option"]],hostAttrs:["role","menuitem",1,"ant-select-item","ant-select-item-option"],hostVars:10,hostBindings:function(t,i){t&1&&S("click",function(){return i.selectViaInteraction()}),t&2&&(se("aria-selected",i.selected.toString())("aria-disabled",i.nzDisabled.toString()),V("ant-select-item-option-grouped",i.nzAutocompleteOptgroupComponent)("ant-select-item-option-selected",i.selected)("ant-select-item-option-active",i.active)("ant-select-item-option-disabled",i.nzDisabled))},inputs:{nzValue:"nzValue",nzLabel:"nzLabel",nzDisabled:[2,"nzDisabled","nzDisabled",D]},outputs:{selectionChange:"selectionChange",mouseEntered:"mouseEntered"},exportAs:["nzAutoOption"],features:[T],ngContentSelectors:Ne,decls:2,vars:0,consts:[[1,"ant-select-item-option-content"]],template:function(t,i){t&1&&(I(),u(0,"div",0),_(1),v())},encapsulation:2,changeDetection:0})}}return n})(),Ue={provide:Ee,useExisting:U(()=>Xe),multi:!0};function Ye(){return Error("Attempting to open an undefined instance of `nz-autocomplete`. Make sure that the id passed to the `nzAutocomplete` is correct and that you're attempting to open it after the ngAfterContentInit hook.")}var Xe=(()=>{class n{get activeOption(){return this.nzAutocomplete&&this.nzAutocomplete.options.length?this.nzAutocomplete.activeItem:null}constructor(e,t,i,o){this.ngZone=e,this.elementRef=t,this.overlay=i,this.viewContainerRef=o,this.onChange=()=>{},this.onTouched=()=>{},this.panelOpen=!1,this.destroy$=new A,this.overlayRef=null,this.portal=null,this.previousValue=null,this.document=a(ve),this.nzInputGroupWhitSuffixOrPrefixDirective=a(Re,{optional:!0})}ngAfterViewInit(){this.nzAutocomplete&&this.nzAutocomplete.animationStateChange.pipe(c(this.destroy$)).subscribe(e=>{e.toState==="void"&&this.overlayRef&&(this.overlayRef.dispose(),this.overlayRef=null)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.destroyPanel()}writeValue(e){this.ngZone.runOutsideAngular(()=>Promise.resolve(null).then(()=>this.setTriggerValue(e)))}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){let t=this.elementRef.nativeElement;t.disabled=e,this.closePanel()}openPanel(){this.previousValue=this.elementRef.nativeElement.value,this.attachOverlay(),this.updateStatus()}closePanel(){this.panelOpen&&(this.nzAutocomplete.isOpen=this.panelOpen=!1,this.overlayRef&&this.overlayRef.hasAttached()&&(this.overlayRef.detach(),this.selectionChangeSubscription.unsubscribe(),this.overlayOutsideClickSubscription.unsubscribe(),this.optionsChangeSubscription.unsubscribe(),this.portal=null))}handleKeydown(e){let t=e.keyCode,i=t===38||t===40;t===27&&e.preventDefault(),this.panelOpen&&(t===27||t===9)?(this.activeOption&&this.activeOption.getLabel()!==this.previousValue&&this.setTriggerValue(this.previousValue),this.closePanel()):this.panelOpen&&t===13?this.nzAutocomplete.showPanel&&(e.preventDefault(),this.activeOption?this.activeOption.selectViaInteraction():this.closePanel()):this.panelOpen&&i&&this.nzAutocomplete.showPanel&&(e.stopPropagation(),e.preventDefault(),t===38?this.nzAutocomplete.setPreviousItemActive():this.nzAutocomplete.setNextItemActive(),this.activeOption&&this.activeOption.scrollIntoViewIfNeeded(),this.doBackfill())}handleInput(e){let t=e.target,i=this.document,o=t.value;t.type==="number"&&(o=o===""?null:parseFloat(o)),this.previousValue!==o&&(this.previousValue=o,this.onChange(o),this.canOpen()&&i.activeElement===e.target&&this.openPanel())}handleFocus(){this.canOpen()&&this.openPanel()}handleBlur(){this.onTouched()}subscribeOptionsChange(){return this.nzAutocomplete.options.changes.pipe(Z(()=>this.positionStrategy.reapplyLastPosition()),Q(0)).subscribe(()=>{this.resetActiveItem(),this.panelOpen&&this.overlayRef.updatePosition()})}subscribeSelectionChange(){return this.nzAutocomplete.selectionChange.subscribe(e=>{this.setValueAndClose(e)})}subscribeOverlayOutsideClick(){return this.overlayRef.outsidePointerEvents().pipe(b(e=>!this.elementRef.nativeElement.contains(e.target))).subscribe(()=>{this.closePanel()})}attachOverlay(){if(!this.nzAutocomplete)throw Ye();!this.portal&&this.nzAutocomplete.template&&(this.portal=new be(this.nzAutocomplete.template,this.viewContainerRef)),this.overlayRef||(this.overlayRef=this.overlay.create(this.getOverlayConfig())),this.overlayRef&&!this.overlayRef.hasAttached()&&(this.overlayRef.attach(this.portal),this.selectionChangeSubscription=this.subscribeSelectionChange(),this.optionsChangeSubscription=this.subscribeOptionsChange(),this.overlayOutsideClickSubscription=this.subscribeOverlayOutsideClick(),this.overlayRef.detachments().pipe(c(this.destroy$)).subscribe(()=>{this.closePanel()})),this.nzAutocomplete.isOpen=this.panelOpen=!0}updateStatus(){this.overlayRef&&this.overlayRef.updateSize({width:this.nzAutocomplete.nzWidth||this.getHostWidth()}),this.nzAutocomplete.setVisibility(),this.resetActiveItem(),this.activeOption&&this.activeOption.scrollIntoViewIfNeeded()}destroyPanel(){this.overlayRef&&this.closePanel()}getOverlayConfig(){return new Oe({positionStrategy:this.getOverlayPosition(),disposeOnNavigation:!0,scrollStrategy:this.overlay.scrollStrategies.reposition(),width:this.nzAutocomplete.nzWidth||this.getHostWidth()})}getConnectedElement(){return this.nzInputGroupWhitSuffixOrPrefixDirective?this.nzInputGroupWhitSuffixOrPrefixDirective.elementRef:this.elementRef}getHostWidth(){return this.getConnectedElement().nativeElement.getBoundingClientRect().width}getOverlayPosition(){let e=[new j({originX:"start",originY:"bottom"},{overlayX:"start",overlayY:"top"}),new j({originX:"start",originY:"top"},{overlayX:"start",overlayY:"bottom"})];return this.positionStrategy=this.overlay.position().flexibleConnectedTo(this.getConnectedElement()).withFlexibleDimensions(!1).withPush(!1).withPositions(e).withTransformOriginOn(".ant-select-dropdown"),this.positionStrategy}resetActiveItem(){let e=this.nzAutocomplete.getOptionIndex(this.previousValue);this.nzAutocomplete.clearSelectedOptions(null,!0),e!==-1?(this.nzAutocomplete.setActiveItem(e),this.nzAutocomplete.activeItem.select(!1)):this.nzAutocomplete.setActiveItem(this.nzAutocomplete.nzDefaultActiveFirstOption?0:-1)}setValueAndClose(e){let t=e.nzValue;this.setTriggerValue(e.getLabel()),this.onChange(t),this.elementRef.nativeElement.focus(),this.closePanel()}setTriggerValue(e){let t=this.nzAutocomplete.getOption(e),i=t?t.getLabel():e;this.elementRef.nativeElement.value=i??"",this.nzAutocomplete.nzBackfill||(this.previousValue=i)}doBackfill(){this.nzAutocomplete.nzBackfill&&this.nzAutocomplete.activeItem&&this.setTriggerValue(this.nzAutocomplete.activeItem.getLabel())}canOpen(){let e=this.elementRef.nativeElement;return!e.readOnly&&!e.disabled}static{this.\u0275fac=function(t){return new(t||n)(r(N),r(x),r(Se),r(ie))}}static{this.\u0275dir=oe({type:n,selectors:[["input","nzAutocomplete",""],["textarea","nzAutocomplete",""]],hostAttrs:["autocomplete","off","aria-autocomplete","list"],hostBindings:function(t,i){t&1&&S("focusin",function(){return i.handleFocus()})("blur",function(){return i.handleBlur()})("input",function(l){return i.handleInput(l)})("keydown",function(l){return i.handleKeydown(l)})},inputs:{nzAutocomplete:"nzAutocomplete"},exportAs:["nzAutocompleteTrigger"],features:[ge([Ue])]})}}return n})();function qe(n){return n?.map(s=>typeof s=="number"||typeof s=="string"?{label:s.toString(),value:s.toString()}:s)}var wt=(()=>{class n{get options(){return this.nzDataSource?this.fromDataSourceOptions:this.fromContentOptions}constructor(e,t){this.changeDetectorRef=e,this.directionality=t,this.nzOverlayClassName="",this.nzOverlayStyle={},this.nzDefaultActiveFirstOption=!0,this.nzBackfill=!1,this.compareWith=(i,o)=>i===o,this.selectionChange=new d,this.showPanel=!0,this.isOpen=!1,this.activeItem=null,this.dir="ltr",this.normalizedDataSource=[],this.destroy$=new A,this.animationStateChange=new d,this.activeItemIndex=-1,this.selectionChangeSubscription=C.EMPTY,this.optionMouseEnterSubscription=C.EMPTY,this.dataSourceChangeSubscription=C.EMPTY,this.optionSelectionChanges=E(()=>this.options?R(...this.options.map(i=>i.selectionChange)):this.afterNextRender$.pipe(w(()=>this.optionSelectionChanges))),this.optionMouseEnter=E(()=>this.options?R(...this.options.map(i=>i.mouseEntered)):this.afterNextRender$.pipe(w(()=>this.optionMouseEnter))),this.afterNextRender$=a(we),this.noAnimation=a(B,{host:!0,optional:!0})}ngOnInit(){this.directionality.change?.pipe(c(this.destroy$)).subscribe(e=>{this.dir=e,this.changeDetectorRef.detectChanges()}),this.dir=this.directionality.value}ngOnChanges(e){let{nzDataSource:t}=e;t&&(this.normalizedDataSource=qe(t.currentValue))}onAnimationEvent(e){this.animationStateChange.emit(e)}ngAfterContentInit(){this.nzDataSource||this.optionsInit()}ngAfterViewInit(){this.nzDataSource&&this.optionsInit()}ngOnDestroy(){this.dataSourceChangeSubscription.unsubscribe(),this.selectionChangeSubscription.unsubscribe(),this.optionMouseEnterSubscription.unsubscribe(),this.dataSourceChangeSubscription=this.selectionChangeSubscription=this.optionMouseEnterSubscription=null,this.destroy$.next(),this.destroy$.complete()}setVisibility(){this.showPanel=!!this.options.length,this.changeDetectorRef.markForCheck()}setActiveItem(e){let t=this.options.get(e);t&&!t.active?(this.activeItem=t,this.activeItemIndex=e,this.clearSelectedOptions(this.activeItem),this.activeItem.setActiveStyles()):(this.activeItem=null,this.activeItemIndex=-1,this.clearSelectedOptions()),this.changeDetectorRef.markForCheck()}setNextItemActive(){let e=this.activeItemIndex+1<=this.options.length-1?this.activeItemIndex+1:0;this.setActiveItem(e)}setPreviousItemActive(){let e=this.activeItemIndex-1<0?this.options.length-1:this.activeItemIndex-1;this.setActiveItem(e)}getOptionIndex(e){return this.options.reduce((t,i,o)=>t===-1?this.compareWith(e,i.nzValue)?o:-1:t,-1)}getOption(e){return this.options.find(t=>this.compareWith(e,t.nzValue))||null}optionsInit(){this.setVisibility(),this.subscribeOptionChanges();let e=this.nzDataSource?this.fromDataSourceOptions.changes:this.fromContentOptions.changes;this.dataSourceChangeSubscription=e.subscribe(t=>{!t.dirty&&this.isOpen&&setTimeout(()=>this.setVisibility()),this.subscribeOptionChanges()})}clearSelectedOptions(e,t=!1){this.options.forEach(i=>{i!==e&&(t&&i.deselect(),i.setInactiveStyles())})}subscribeOptionChanges(){this.selectionChangeSubscription.unsubscribe(),this.selectionChangeSubscription=this.optionSelectionChanges.pipe(b(e=>e.isUserInput)).subscribe(e=>{e.source.select(),e.source.setActiveStyles(),this.activeItem=e.source,this.activeItemIndex=this.getOptionIndex(this.activeItem.nzValue),this.clearSelectedOptions(e.source,!0),this.selectionChange.emit(e.source)}),this.optionMouseEnterSubscription.unsubscribe(),this.optionMouseEnterSubscription=this.optionMouseEnter.subscribe(e=>{e.setActiveStyles(),this.activeItem=e,this.activeItemIndex=this.getOptionIndex(this.activeItem.nzValue),this.clearSelectedOptions(e)})}static{this.\u0275fac=function(t){return new(t||n)(r(F),r(Ae))}}static{this.\u0275cmp=O({type:n,selectors:[["nz-autocomplete"]],contentQueries:function(t,i,o){if(t&1&&me(o,W,5),t&2){let l;h(l=m())&&(i.fromContentOptions=l)}},viewQuery:function(t,i){if(t&1&&(y(te,5),y(Fe,5),y($e,5),y(W,5)),t&2){let o;h(o=m())&&(i.template=o.first),h(o=m())&&(i.panel=o.first),h(o=m())&&(i.content=o.first),h(o=m())&&(i.fromDataSourceOptions=o)}},inputs:{nzWidth:[2,"nzWidth","nzWidth",ye],nzOverlayClassName:"nzOverlayClassName",nzOverlayStyle:"nzOverlayStyle",nzDefaultActiveFirstOption:[2,"nzDefaultActiveFirstOption","nzDefaultActiveFirstOption",D],nzBackfill:[2,"nzBackfill","nzBackfill",D],compareWith:"compareWith",nzDataSource:"nzDataSource"},outputs:{selectionChange:"selectionChange"},exportAs:["nzAutocomplete"],features:[T,q],ngContentSelectors:Ne,decls:1,vars:0,consts:[["panel",""],["contentTemplate",""],["optionsTemplate",""],[1,"ant-select-dropdown","ant-select-dropdown-placement-bottomLeft",3,"nzNoAnimation"],[1,"ant-select-dropdown-content-wrapper"],[1,"ant-select-dropdown-content"],[4,"ngTemplateOutlet"],[3,"nzValue","nzLabel"]],template:function(t,i){t&1&&(I(),p(0,Ze,9,12,"ng-template"))},dependencies:[ze,W,B],encapsulation:2,data:{animation:[Ie]},changeDetection:0})}}return n})(),Nt=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=ne({type:n})}static{this.\u0275inj=Y({imports:[xe]})}}return n})();export{xe as a,W as b,Xe as c,wt as d,Nt as e};