| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066 |
- import * as i0 from '@angular/core';
- import { inject, ElementRef, input, effect, Directive, TemplateRef, Injectable, Renderer2, NgZone, booleanAttribute, output, viewChild, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, signal, afterNextRender, InjectionToken, HostAttributeToken, ChangeDetectorRef, numberAttribute, model, contentChild, forwardRef, contentChildren, HostListener, NgModule } from '@angular/core';
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
- import { animationFrameScheduler, asapScheduler, Subject, fromEvent, merge } from 'rxjs';
- import { takeUntil, auditTime, tap, startWith, switchMap, debounceTime, filter, map } from 'rxjs/operators';
- import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
- import { toObservable } from '@angular/core/rxjs-interop';
- const unescapedHTMLExp = /[&<>"']/g;
- const hasUnescapedHTMLExp = RegExp(unescapedHTMLExp.source);
- const htmlEscapes = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- };
- function escapeHTML(value) {
- return value && hasUnescapedHTMLExp.test(value) ? value.replace(unescapedHTMLExp, (chr) => htmlEscapes[chr]) : value;
- }
- function isDefined(value) {
- return value !== undefined && value !== null;
- }
- function isObject(value) {
- return typeof value === 'object' && isDefined(value);
- }
- function isPromise(value) {
- return value instanceof Promise;
- }
- function isFunction(value) {
- return value instanceof Function;
- }
- class NgItemLabelDirective {
- constructor() {
- this.element = inject(ElementRef);
- this.ngItemLabel = input();
- this.escape = input(true);
- effect(() => {
- this.element.nativeElement.innerHTML = this.escape()
- ? escapeHTML(this.ngItemLabel())
- : this.ngItemLabel();
- });
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgItemLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0", type: NgItemLabelDirective, isStandalone: true, selector: "[ngItemLabel]", inputs: { ngItemLabel: { classPropertyName: "ngItemLabel", publicName: "ngItemLabel", isSignal: true, isRequired: false, transformFunction: null }, escape: { classPropertyName: "escape", publicName: "escape", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgItemLabelDirective, decorators: [{
- type: Directive,
- args: [{
- selector: '[ngItemLabel]',
- standalone: true,
- }]
- }], ctorParameters: () => [] });
- class NgOptionTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgOptionTemplateDirective, isStandalone: true, selector: "[ng-option-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-option-tmp]',
- standalone: true,
- }]
- }] });
- class NgOptgroupTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptgroupTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgOptgroupTemplateDirective, isStandalone: true, selector: "[ng-optgroup-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptgroupTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-optgroup-tmp]',
- standalone: true,
- }]
- }] });
- class NgLabelTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLabelTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgLabelTemplateDirective, isStandalone: true, selector: "[ng-label-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLabelTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-label-tmp]',
- standalone: true,
- }]
- }] });
- class NgMultiLabelTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgMultiLabelTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgMultiLabelTemplateDirective, isStandalone: true, selector: "[ng-multi-label-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgMultiLabelTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-multi-label-tmp]',
- standalone: true,
- }]
- }] });
- class NgHeaderTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgHeaderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgHeaderTemplateDirective, isStandalone: true, selector: "[ng-header-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgHeaderTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-header-tmp]',
- standalone: true,
- }]
- }] });
- class NgFooterTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgFooterTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgFooterTemplateDirective, isStandalone: true, selector: "[ng-footer-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgFooterTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-footer-tmp]',
- standalone: true,
- }]
- }] });
- class NgNotFoundTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgNotFoundTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgNotFoundTemplateDirective, isStandalone: true, selector: "[ng-notfound-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgNotFoundTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-notfound-tmp]',
- standalone: true,
- }]
- }] });
- class NgPlaceholderTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgPlaceholderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgPlaceholderTemplateDirective, isStandalone: true, selector: "[ng-placeholder-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgPlaceholderTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-placeholder-tmp]',
- standalone: true,
- }]
- }] });
- class NgTypeToSearchTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTypeToSearchTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgTypeToSearchTemplateDirective, isStandalone: true, selector: "[ng-typetosearch-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTypeToSearchTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-typetosearch-tmp]',
- standalone: true,
- }]
- }] });
- class NgLoadingTextTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingTextTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgLoadingTextTemplateDirective, isStandalone: true, selector: "[ng-loadingtext-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingTextTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-loadingtext-tmp]',
- standalone: true,
- }]
- }] });
- class NgTagTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTagTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgTagTemplateDirective, isStandalone: true, selector: "[ng-tag-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgTagTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-tag-tmp]',
- standalone: true,
- }]
- }] });
- class NgLoadingSpinnerTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingSpinnerTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgLoadingSpinnerTemplateDirective, isStandalone: true, selector: "[ng-loadingspinner-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgLoadingSpinnerTemplateDirective, decorators: [{
- type: Directive,
- args: [{
- // eslint-disable-next-line @angular-eslint/directive-selector
- selector: '[ng-loadingspinner-tmp]',
- standalone: true,
- }]
- }] });
- // eslint-disable-next-line @angular-eslint/directive-selector
- class NgClearButtonTemplateDirective {
- constructor() {
- this.template = inject((TemplateRef));
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgClearButtonTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: NgClearButtonTemplateDirective, isStandalone: true, selector: "[ng-clearbutton-tmp]", ngImport: i0 }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgClearButtonTemplateDirective, decorators: [{
- type: Directive,
- args: [{ selector: '[ng-clearbutton-tmp]', standalone: true }]
- }] });
- class NgSelectConfig {
- constructor() {
- this.fixedPlaceholder = true;
- this.notFoundText = 'No items found';
- this.typeToSearchText = 'Type to search';
- this.addTagText = 'Add item';
- this.loadingText = 'Loading...';
- this.clearAllText = 'Clear all';
- this.disableVirtualScroll = true;
- this.openOnEnter = true;
- this.appearance = 'underline';
- this.tabFocusOnClear = true;
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, providedIn: 'root' }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectConfig, decorators: [{
- type: Injectable,
- args: [{ providedIn: 'root' }]
- }] });
- class ConsoleService {
- warn(message) {
- console.warn(message);
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, providedIn: 'root' }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ConsoleService, decorators: [{
- type: Injectable,
- args: [{ providedIn: 'root' }]
- }] });
- function newId() {
- // First character is an 'a', it's good practice to tag id to begin with a letter
- return 'axxxxxxxxxxx'.replace(/[x]/g, () => {
- // eslint-disable-next-line no-bitwise
- const val = (Math.random() * 16) | 0;
- return val.toString(16);
- });
- }
- const diacritics = {
- '\u24B6': 'A',
- '\uFF21': 'A',
- '\u00C0': 'A',
- '\u00C1': 'A',
- '\u00C2': 'A',
- '\u1EA6': 'A',
- '\u1EA4': 'A',
- '\u1EAA': 'A',
- '\u1EA8': 'A',
- '\u00C3': 'A',
- '\u0100': 'A',
- '\u0102': 'A',
- '\u1EB0': 'A',
- '\u1EAE': 'A',
- '\u1EB4': 'A',
- '\u1EB2': 'A',
- '\u0226': 'A',
- '\u01E0': 'A',
- '\u00C4': 'A',
- '\u01DE': 'A',
- '\u1EA2': 'A',
- '\u00C5': 'A',
- '\u01FA': 'A',
- '\u01CD': 'A',
- '\u0200': 'A',
- '\u0202': 'A',
- '\u1EA0': 'A',
- '\u1EAC': 'A',
- '\u1EB6': 'A',
- '\u1E00': 'A',
- '\u0104': 'A',
- '\u023A': 'A',
- '\u2C6F': 'A',
- '\uA732': 'AA',
- '\u00C6': 'AE',
- '\u01FC': 'AE',
- '\u01E2': 'AE',
- '\uA734': 'AO',
- '\uA736': 'AU',
- '\uA738': 'AV',
- '\uA73A': 'AV',
- '\uA73C': 'AY',
- '\u24B7': 'B',
- '\uFF22': 'B',
- '\u1E02': 'B',
- '\u1E04': 'B',
- '\u1E06': 'B',
- '\u0243': 'B',
- '\u0182': 'B',
- '\u0181': 'B',
- '\u24B8': 'C',
- '\uFF23': 'C',
- '\u0106': 'C',
- '\u0108': 'C',
- '\u010A': 'C',
- '\u010C': 'C',
- '\u00C7': 'C',
- '\u1E08': 'C',
- '\u0187': 'C',
- '\u023B': 'C',
- '\uA73E': 'C',
- '\u24B9': 'D',
- '\uFF24': 'D',
- '\u1E0A': 'D',
- '\u010E': 'D',
- '\u1E0C': 'D',
- '\u1E10': 'D',
- '\u1E12': 'D',
- '\u1E0E': 'D',
- '\u0110': 'D',
- '\u018B': 'D',
- '\u018A': 'D',
- '\u0189': 'D',
- '\uA779': 'D',
- '\u01F1': 'DZ',
- '\u01C4': 'DZ',
- '\u01F2': 'Dz',
- '\u01C5': 'Dz',
- '\u24BA': 'E',
- '\uFF25': 'E',
- '\u00C8': 'E',
- '\u00C9': 'E',
- '\u00CA': 'E',
- '\u1EC0': 'E',
- '\u1EBE': 'E',
- '\u1EC4': 'E',
- '\u1EC2': 'E',
- '\u1EBC': 'E',
- '\u0112': 'E',
- '\u1E14': 'E',
- '\u1E16': 'E',
- '\u0114': 'E',
- '\u0116': 'E',
- '\u00CB': 'E',
- '\u1EBA': 'E',
- '\u011A': 'E',
- '\u0204': 'E',
- '\u0206': 'E',
- '\u1EB8': 'E',
- '\u1EC6': 'E',
- '\u0228': 'E',
- '\u1E1C': 'E',
- '\u0118': 'E',
- '\u1E18': 'E',
- '\u1E1A': 'E',
- '\u0190': 'E',
- '\u018E': 'E',
- '\u24BB': 'F',
- '\uFF26': 'F',
- '\u1E1E': 'F',
- '\u0191': 'F',
- '\uA77B': 'F',
- '\u24BC': 'G',
- '\uFF27': 'G',
- '\u01F4': 'G',
- '\u011C': 'G',
- '\u1E20': 'G',
- '\u011E': 'G',
- '\u0120': 'G',
- '\u01E6': 'G',
- '\u0122': 'G',
- '\u01E4': 'G',
- '\u0193': 'G',
- '\uA7A0': 'G',
- '\uA77D': 'G',
- '\uA77E': 'G',
- '\u24BD': 'H',
- '\uFF28': 'H',
- '\u0124': 'H',
- '\u1E22': 'H',
- '\u1E26': 'H',
- '\u021E': 'H',
- '\u1E24': 'H',
- '\u1E28': 'H',
- '\u1E2A': 'H',
- '\u0126': 'H',
- '\u2C67': 'H',
- '\u2C75': 'H',
- '\uA78D': 'H',
- '\u24BE': 'I',
- '\uFF29': 'I',
- '\u00CC': 'I',
- '\u00CD': 'I',
- '\u00CE': 'I',
- '\u0128': 'I',
- '\u012A': 'I',
- '\u012C': 'I',
- '\u0130': 'I',
- '\u00CF': 'I',
- '\u1E2E': 'I',
- '\u1EC8': 'I',
- '\u01CF': 'I',
- '\u0208': 'I',
- '\u020A': 'I',
- '\u1ECA': 'I',
- '\u012E': 'I',
- '\u1E2C': 'I',
- '\u0197': 'I',
- '\u24BF': 'J',
- '\uFF2A': 'J',
- '\u0134': 'J',
- '\u0248': 'J',
- '\u24C0': 'K',
- '\uFF2B': 'K',
- '\u1E30': 'K',
- '\u01E8': 'K',
- '\u1E32': 'K',
- '\u0136': 'K',
- '\u1E34': 'K',
- '\u0198': 'K',
- '\u2C69': 'K',
- '\uA740': 'K',
- '\uA742': 'K',
- '\uA744': 'K',
- '\uA7A2': 'K',
- '\u24C1': 'L',
- '\uFF2C': 'L',
- '\u013F': 'L',
- '\u0139': 'L',
- '\u013D': 'L',
- '\u1E36': 'L',
- '\u1E38': 'L',
- '\u013B': 'L',
- '\u1E3C': 'L',
- '\u1E3A': 'L',
- '\u0141': 'L',
- '\u023D': 'L',
- '\u2C62': 'L',
- '\u2C60': 'L',
- '\uA748': 'L',
- '\uA746': 'L',
- '\uA780': 'L',
- '\u01C7': 'LJ',
- '\u01C8': 'Lj',
- '\u24C2': 'M',
- '\uFF2D': 'M',
- '\u1E3E': 'M',
- '\u1E40': 'M',
- '\u1E42': 'M',
- '\u2C6E': 'M',
- '\u019C': 'M',
- '\u24C3': 'N',
- '\uFF2E': 'N',
- '\u01F8': 'N',
- '\u0143': 'N',
- '\u00D1': 'N',
- '\u1E44': 'N',
- '\u0147': 'N',
- '\u1E46': 'N',
- '\u0145': 'N',
- '\u1E4A': 'N',
- '\u1E48': 'N',
- '\u0220': 'N',
- '\u019D': 'N',
- '\uA790': 'N',
- '\uA7A4': 'N',
- '\u01CA': 'NJ',
- '\u01CB': 'Nj',
- '\u24C4': 'O',
- '\uFF2F': 'O',
- '\u00D2': 'O',
- '\u00D3': 'O',
- '\u00D4': 'O',
- '\u1ED2': 'O',
- '\u1ED0': 'O',
- '\u1ED6': 'O',
- '\u1ED4': 'O',
- '\u00D5': 'O',
- '\u1E4C': 'O',
- '\u022C': 'O',
- '\u1E4E': 'O',
- '\u014C': 'O',
- '\u1E50': 'O',
- '\u1E52': 'O',
- '\u014E': 'O',
- '\u022E': 'O',
- '\u0230': 'O',
- '\u00D6': 'O',
- '\u022A': 'O',
- '\u1ECE': 'O',
- '\u0150': 'O',
- '\u01D1': 'O',
- '\u020C': 'O',
- '\u020E': 'O',
- '\u01A0': 'O',
- '\u1EDC': 'O',
- '\u1EDA': 'O',
- '\u1EE0': 'O',
- '\u1EDE': 'O',
- '\u1EE2': 'O',
- '\u1ECC': 'O',
- '\u1ED8': 'O',
- '\u01EA': 'O',
- '\u01EC': 'O',
- '\u00D8': 'O',
- '\u01FE': 'O',
- '\u0186': 'O',
- '\u019F': 'O',
- '\uA74A': 'O',
- '\uA74C': 'O',
- '\u01A2': 'OI',
- '\uA74E': 'OO',
- '\u0222': 'OU',
- '\u24C5': 'P',
- '\uFF30': 'P',
- '\u1E54': 'P',
- '\u1E56': 'P',
- '\u01A4': 'P',
- '\u2C63': 'P',
- '\uA750': 'P',
- '\uA752': 'P',
- '\uA754': 'P',
- '\u24C6': 'Q',
- '\uFF31': 'Q',
- '\uA756': 'Q',
- '\uA758': 'Q',
- '\u024A': 'Q',
- '\u24C7': 'R',
- '\uFF32': 'R',
- '\u0154': 'R',
- '\u1E58': 'R',
- '\u0158': 'R',
- '\u0210': 'R',
- '\u0212': 'R',
- '\u1E5A': 'R',
- '\u1E5C': 'R',
- '\u0156': 'R',
- '\u1E5E': 'R',
- '\u024C': 'R',
- '\u2C64': 'R',
- '\uA75A': 'R',
- '\uA7A6': 'R',
- '\uA782': 'R',
- '\u24C8': 'S',
- '\uFF33': 'S',
- '\u1E9E': 'S',
- '\u015A': 'S',
- '\u1E64': 'S',
- '\u015C': 'S',
- '\u1E60': 'S',
- '\u0160': 'S',
- '\u1E66': 'S',
- '\u1E62': 'S',
- '\u1E68': 'S',
- '\u0218': 'S',
- '\u015E': 'S',
- '\u2C7E': 'S',
- '\uA7A8': 'S',
- '\uA784': 'S',
- '\u24C9': 'T',
- '\uFF34': 'T',
- '\u1E6A': 'T',
- '\u0164': 'T',
- '\u1E6C': 'T',
- '\u021A': 'T',
- '\u0162': 'T',
- '\u1E70': 'T',
- '\u1E6E': 'T',
- '\u0166': 'T',
- '\u01AC': 'T',
- '\u01AE': 'T',
- '\u023E': 'T',
- '\uA786': 'T',
- '\uA728': 'TZ',
- '\u24CA': 'U',
- '\uFF35': 'U',
- '\u00D9': 'U',
- '\u00DA': 'U',
- '\u00DB': 'U',
- '\u0168': 'U',
- '\u1E78': 'U',
- '\u016A': 'U',
- '\u1E7A': 'U',
- '\u016C': 'U',
- '\u00DC': 'U',
- '\u01DB': 'U',
- '\u01D7': 'U',
- '\u01D5': 'U',
- '\u01D9': 'U',
- '\u1EE6': 'U',
- '\u016E': 'U',
- '\u0170': 'U',
- '\u01D3': 'U',
- '\u0214': 'U',
- '\u0216': 'U',
- '\u01AF': 'U',
- '\u1EEA': 'U',
- '\u1EE8': 'U',
- '\u1EEE': 'U',
- '\u1EEC': 'U',
- '\u1EF0': 'U',
- '\u1EE4': 'U',
- '\u1E72': 'U',
- '\u0172': 'U',
- '\u1E76': 'U',
- '\u1E74': 'U',
- '\u0244': 'U',
- '\u24CB': 'V',
- '\uFF36': 'V',
- '\u1E7C': 'V',
- '\u1E7E': 'V',
- '\u01B2': 'V',
- '\uA75E': 'V',
- '\u0245': 'V',
- '\uA760': 'VY',
- '\u24CC': 'W',
- '\uFF37': 'W',
- '\u1E80': 'W',
- '\u1E82': 'W',
- '\u0174': 'W',
- '\u1E86': 'W',
- '\u1E84': 'W',
- '\u1E88': 'W',
- '\u2C72': 'W',
- '\u24CD': 'X',
- '\uFF38': 'X',
- '\u1E8A': 'X',
- '\u1E8C': 'X',
- '\u24CE': 'Y',
- '\uFF39': 'Y',
- '\u1EF2': 'Y',
- '\u00DD': 'Y',
- '\u0176': 'Y',
- '\u1EF8': 'Y',
- '\u0232': 'Y',
- '\u1E8E': 'Y',
- '\u0178': 'Y',
- '\u1EF6': 'Y',
- '\u1EF4': 'Y',
- '\u01B3': 'Y',
- '\u024E': 'Y',
- '\u1EFE': 'Y',
- '\u24CF': 'Z',
- '\uFF3A': 'Z',
- '\u0179': 'Z',
- '\u1E90': 'Z',
- '\u017B': 'Z',
- '\u017D': 'Z',
- '\u1E92': 'Z',
- '\u1E94': 'Z',
- '\u01B5': 'Z',
- '\u0224': 'Z',
- '\u2C7F': 'Z',
- '\u2C6B': 'Z',
- '\uA762': 'Z',
- '\u24D0': 'a',
- '\uFF41': 'a',
- '\u1E9A': 'a',
- '\u00E0': 'a',
- '\u00E1': 'a',
- '\u00E2': 'a',
- '\u1EA7': 'a',
- '\u1EA5': 'a',
- '\u1EAB': 'a',
- '\u1EA9': 'a',
- '\u00E3': 'a',
- '\u0101': 'a',
- '\u0103': 'a',
- '\u1EB1': 'a',
- '\u1EAF': 'a',
- '\u1EB5': 'a',
- '\u1EB3': 'a',
- '\u0227': 'a',
- '\u01E1': 'a',
- '\u00E4': 'a',
- '\u01DF': 'a',
- '\u1EA3': 'a',
- '\u00E5': 'a',
- '\u01FB': 'a',
- '\u01CE': 'a',
- '\u0201': 'a',
- '\u0203': 'a',
- '\u1EA1': 'a',
- '\u1EAD': 'a',
- '\u1EB7': 'a',
- '\u1E01': 'a',
- '\u0105': 'a',
- '\u2C65': 'a',
- '\u0250': 'a',
- '\uA733': 'aa',
- '\u00E6': 'ae',
- '\u01FD': 'ae',
- '\u01E3': 'ae',
- '\uA735': 'ao',
- '\uA737': 'au',
- '\uA739': 'av',
- '\uA73B': 'av',
- '\uA73D': 'ay',
- '\u24D1': 'b',
- '\uFF42': 'b',
- '\u1E03': 'b',
- '\u1E05': 'b',
- '\u1E07': 'b',
- '\u0180': 'b',
- '\u0183': 'b',
- '\u0253': 'b',
- '\u24D2': 'c',
- '\uFF43': 'c',
- '\u0107': 'c',
- '\u0109': 'c',
- '\u010B': 'c',
- '\u010D': 'c',
- '\u00E7': 'c',
- '\u1E09': 'c',
- '\u0188': 'c',
- '\u023C': 'c',
- '\uA73F': 'c',
- '\u2184': 'c',
- '\u24D3': 'd',
- '\uFF44': 'd',
- '\u1E0B': 'd',
- '\u010F': 'd',
- '\u1E0D': 'd',
- '\u1E11': 'd',
- '\u1E13': 'd',
- '\u1E0F': 'd',
- '\u0111': 'd',
- '\u018C': 'd',
- '\u0256': 'd',
- '\u0257': 'd',
- '\uA77A': 'd',
- '\u01F3': 'dz',
- '\u01C6': 'dz',
- '\u24D4': 'e',
- '\uFF45': 'e',
- '\u00E8': 'e',
- '\u00E9': 'e',
- '\u00EA': 'e',
- '\u1EC1': 'e',
- '\u1EBF': 'e',
- '\u1EC5': 'e',
- '\u1EC3': 'e',
- '\u1EBD': 'e',
- '\u0113': 'e',
- '\u1E15': 'e',
- '\u1E17': 'e',
- '\u0115': 'e',
- '\u0117': 'e',
- '\u00EB': 'e',
- '\u1EBB': 'e',
- '\u011B': 'e',
- '\u0205': 'e',
- '\u0207': 'e',
- '\u1EB9': 'e',
- '\u1EC7': 'e',
- '\u0229': 'e',
- '\u1E1D': 'e',
- '\u0119': 'e',
- '\u1E19': 'e',
- '\u1E1B': 'e',
- '\u0247': 'e',
- '\u025B': 'e',
- '\u01DD': 'e',
- '\u24D5': 'f',
- '\uFF46': 'f',
- '\u1E1F': 'f',
- '\u0192': 'f',
- '\uA77C': 'f',
- '\u24D6': 'g',
- '\uFF47': 'g',
- '\u01F5': 'g',
- '\u011D': 'g',
- '\u1E21': 'g',
- '\u011F': 'g',
- '\u0121': 'g',
- '\u01E7': 'g',
- '\u0123': 'g',
- '\u01E5': 'g',
- '\u0260': 'g',
- '\uA7A1': 'g',
- '\u1D79': 'g',
- '\uA77F': 'g',
- '\u24D7': 'h',
- '\uFF48': 'h',
- '\u0125': 'h',
- '\u1E23': 'h',
- '\u1E27': 'h',
- '\u021F': 'h',
- '\u1E25': 'h',
- '\u1E29': 'h',
- '\u1E2B': 'h',
- '\u1E96': 'h',
- '\u0127': 'h',
- '\u2C68': 'h',
- '\u2C76': 'h',
- '\u0265': 'h',
- '\u0195': 'hv',
- '\u24D8': 'i',
- '\uFF49': 'i',
- '\u00EC': 'i',
- '\u00ED': 'i',
- '\u00EE': 'i',
- '\u0129': 'i',
- '\u012B': 'i',
- '\u012D': 'i',
- '\u00EF': 'i',
- '\u1E2F': 'i',
- '\u1EC9': 'i',
- '\u01D0': 'i',
- '\u0209': 'i',
- '\u020B': 'i',
- '\u1ECB': 'i',
- '\u012F': 'i',
- '\u1E2D': 'i',
- '\u0268': 'i',
- '\u0131': 'i',
- '\u24D9': 'j',
- '\uFF4A': 'j',
- '\u0135': 'j',
- '\u01F0': 'j',
- '\u0249': 'j',
- '\u24DA': 'k',
- '\uFF4B': 'k',
- '\u1E31': 'k',
- '\u01E9': 'k',
- '\u1E33': 'k',
- '\u0137': 'k',
- '\u1E35': 'k',
- '\u0199': 'k',
- '\u2C6A': 'k',
- '\uA741': 'k',
- '\uA743': 'k',
- '\uA745': 'k',
- '\uA7A3': 'k',
- '\u24DB': 'l',
- '\uFF4C': 'l',
- '\u0140': 'l',
- '\u013A': 'l',
- '\u013E': 'l',
- '\u1E37': 'l',
- '\u1E39': 'l',
- '\u013C': 'l',
- '\u1E3D': 'l',
- '\u1E3B': 'l',
- '\u017F': 'l',
- '\u0142': 'l',
- '\u019A': 'l',
- '\u026B': 'l',
- '\u2C61': 'l',
- '\uA749': 'l',
- '\uA781': 'l',
- '\uA747': 'l',
- '\u01C9': 'lj',
- '\u24DC': 'm',
- '\uFF4D': 'm',
- '\u1E3F': 'm',
- '\u1E41': 'm',
- '\u1E43': 'm',
- '\u0271': 'm',
- '\u026F': 'm',
- '\u24DD': 'n',
- '\uFF4E': 'n',
- '\u01F9': 'n',
- '\u0144': 'n',
- '\u00F1': 'n',
- '\u1E45': 'n',
- '\u0148': 'n',
- '\u1E47': 'n',
- '\u0146': 'n',
- '\u1E4B': 'n',
- '\u1E49': 'n',
- '\u019E': 'n',
- '\u0272': 'n',
- '\u0149': 'n',
- '\uA791': 'n',
- '\uA7A5': 'n',
- '\u01CC': 'nj',
- '\u24DE': 'o',
- '\uFF4F': 'o',
- '\u00F2': 'o',
- '\u00F3': 'o',
- '\u00F4': 'o',
- '\u1ED3': 'o',
- '\u1ED1': 'o',
- '\u1ED7': 'o',
- '\u1ED5': 'o',
- '\u00F5': 'o',
- '\u1E4D': 'o',
- '\u022D': 'o',
- '\u1E4F': 'o',
- '\u014D': 'o',
- '\u1E51': 'o',
- '\u1E53': 'o',
- '\u014F': 'o',
- '\u022F': 'o',
- '\u0231': 'o',
- '\u00F6': 'o',
- '\u022B': 'o',
- '\u1ECF': 'o',
- '\u0151': 'o',
- '\u01D2': 'o',
- '\u020D': 'o',
- '\u020F': 'o',
- '\u01A1': 'o',
- '\u1EDD': 'o',
- '\u1EDB': 'o',
- '\u1EE1': 'o',
- '\u1EDF': 'o',
- '\u1EE3': 'o',
- '\u1ECD': 'o',
- '\u1ED9': 'o',
- '\u01EB': 'o',
- '\u01ED': 'o',
- '\u00F8': 'o',
- '\u01FF': 'o',
- '\u0254': 'o',
- '\uA74B': 'o',
- '\uA74D': 'o',
- '\u0275': 'o',
- '\u01A3': 'oi',
- '\u0223': 'ou',
- '\uA74F': 'oo',
- '\u24DF': 'p',
- '\uFF50': 'p',
- '\u1E55': 'p',
- '\u1E57': 'p',
- '\u01A5': 'p',
- '\u1D7D': 'p',
- '\uA751': 'p',
- '\uA753': 'p',
- '\uA755': 'p',
- '\u24E0': 'q',
- '\uFF51': 'q',
- '\u024B': 'q',
- '\uA757': 'q',
- '\uA759': 'q',
- '\u24E1': 'r',
- '\uFF52': 'r',
- '\u0155': 'r',
- '\u1E59': 'r',
- '\u0159': 'r',
- '\u0211': 'r',
- '\u0213': 'r',
- '\u1E5B': 'r',
- '\u1E5D': 'r',
- '\u0157': 'r',
- '\u1E5F': 'r',
- '\u024D': 'r',
- '\u027D': 'r',
- '\uA75B': 'r',
- '\uA7A7': 'r',
- '\uA783': 'r',
- '\u24E2': 's',
- '\uFF53': 's',
- '\u00DF': 's',
- '\u015B': 's',
- '\u1E65': 's',
- '\u015D': 's',
- '\u1E61': 's',
- '\u0161': 's',
- '\u1E67': 's',
- '\u1E63': 's',
- '\u1E69': 's',
- '\u0219': 's',
- '\u015F': 's',
- '\u023F': 's',
- '\uA7A9': 's',
- '\uA785': 's',
- '\u1E9B': 's',
- '\u24E3': 't',
- '\uFF54': 't',
- '\u1E6B': 't',
- '\u1E97': 't',
- '\u0165': 't',
- '\u1E6D': 't',
- '\u021B': 't',
- '\u0163': 't',
- '\u1E71': 't',
- '\u1E6F': 't',
- '\u0167': 't',
- '\u01AD': 't',
- '\u0288': 't',
- '\u2C66': 't',
- '\uA787': 't',
- '\uA729': 'tz',
- '\u24E4': 'u',
- '\uFF55': 'u',
- '\u00F9': 'u',
- '\u00FA': 'u',
- '\u00FB': 'u',
- '\u0169': 'u',
- '\u1E79': 'u',
- '\u016B': 'u',
- '\u1E7B': 'u',
- '\u016D': 'u',
- '\u00FC': 'u',
- '\u01DC': 'u',
- '\u01D8': 'u',
- '\u01D6': 'u',
- '\u01DA': 'u',
- '\u1EE7': 'u',
- '\u016F': 'u',
- '\u0171': 'u',
- '\u01D4': 'u',
- '\u0215': 'u',
- '\u0217': 'u',
- '\u01B0': 'u',
- '\u1EEB': 'u',
- '\u1EE9': 'u',
- '\u1EEF': 'u',
- '\u1EED': 'u',
- '\u1EF1': 'u',
- '\u1EE5': 'u',
- '\u1E73': 'u',
- '\u0173': 'u',
- '\u1E77': 'u',
- '\u1E75': 'u',
- '\u0289': 'u',
- '\u24E5': 'v',
- '\uFF56': 'v',
- '\u1E7D': 'v',
- '\u1E7F': 'v',
- '\u028B': 'v',
- '\uA75F': 'v',
- '\u028C': 'v',
- '\uA761': 'vy',
- '\u24E6': 'w',
- '\uFF57': 'w',
- '\u1E81': 'w',
- '\u1E83': 'w',
- '\u0175': 'w',
- '\u1E87': 'w',
- '\u1E85': 'w',
- '\u1E98': 'w',
- '\u1E89': 'w',
- '\u2C73': 'w',
- '\u24E7': 'x',
- '\uFF58': 'x',
- '\u1E8B': 'x',
- '\u1E8D': 'x',
- '\u24E8': 'y',
- '\uFF59': 'y',
- '\u1EF3': 'y',
- '\u00FD': 'y',
- '\u0177': 'y',
- '\u1EF9': 'y',
- '\u0233': 'y',
- '\u1E8F': 'y',
- '\u00FF': 'y',
- '\u1EF7': 'y',
- '\u1E99': 'y',
- '\u1EF5': 'y',
- '\u01B4': 'y',
- '\u024F': 'y',
- '\u1EFF': 'y',
- '\u24E9': 'z',
- '\uFF5A': 'z',
- '\u017A': 'z',
- '\u1E91': 'z',
- '\u017C': 'z',
- '\u017E': 'z',
- '\u1E93': 'z',
- '\u1E95': 'z',
- '\u01B6': 'z',
- '\u0225': 'z',
- '\u0240': 'z',
- '\u2C6C': 'z',
- '\uA763': 'z',
- '\u0386': '\u0391',
- '\u0388': '\u0395',
- '\u0389': '\u0397',
- '\u038A': '\u0399',
- '\u03AA': '\u0399',
- '\u038C': '\u039F',
- '\u038E': '\u03A5',
- '\u03AB': '\u03A5',
- '\u038F': '\u03A9',
- '\u03AC': '\u03B1',
- '\u03AD': '\u03B5',
- '\u03AE': '\u03B7',
- '\u03AF': '\u03B9',
- '\u03CA': '\u03B9',
- '\u0390': '\u03B9',
- '\u03CC': '\u03BF',
- '\u03CD': '\u03C5',
- '\u03CB': '\u03C5',
- '\u03B0': '\u03C5',
- '\u03C9': '\u03C9',
- '\u03C2': '\u03C3',
- };
- function stripSpecialChars(text) {
- const match = (a) => diacritics[a] || a;
- return text.replace(/[^\u0000-\u007E]/g, match);
- }
- class ItemsList {
- constructor(_ngSelect, _selectionModel) {
- this._ngSelect = _ngSelect;
- this._selectionModel = _selectionModel;
- this._items = [];
- this._filteredItems = [];
- this._markedIndex = -1;
- }
- get items() {
- return this._items;
- }
- get filteredItems() {
- return this._filteredItems;
- }
- get markedIndex() {
- return this._markedIndex;
- }
- get selectedItems() {
- return this._selectionModel.value;
- }
- get markedItem() {
- return this._filteredItems[this._markedIndex];
- }
- get noItemsToSelect() {
- return this._ngSelect.hideSelected() && this._items.length === this.selectedItems.length;
- }
- get maxItemsSelected() {
- return this._ngSelect.multiple() && this._ngSelect.maxSelectedItems() <= this.selectedItems.length;
- }
- get lastSelectedItem() {
- let i = this.selectedItems.length - 1;
- for (; i >= 0; i--) {
- const item = this.selectedItems[i];
- if (!item.disabled) {
- return item;
- }
- }
- return null;
- }
- setItems(items) {
- this._items = items.map((item, index) => this.mapItem(item, index));
- const groupBy = this._ngSelect.groupBy();
- if (groupBy) {
- this._groups = this._groupBy(this._items, groupBy);
- this._items = this._flatten(this._groups);
- }
- else {
- this._groups = new Map();
- this._groups.set(undefined, this._items);
- }
- this._filteredItems = [...this._items];
- }
- select(item) {
- if (item.selected || this.maxItemsSelected) {
- return;
- }
- const multiple = this._ngSelect.multiple();
- if (!multiple) {
- this.clearSelected();
- }
- this._selectionModel.select(item, multiple, this._ngSelect.selectableGroupAsModel());
- if (this._ngSelect.hideSelected()) {
- this._hideSelected(item);
- }
- }
- unselect(item) {
- if (!item.selected) {
- return;
- }
- const multiple = this._ngSelect.multiple();
- this._selectionModel.unselect(item, multiple);
- if (this._ngSelect.hideSelected() && isDefined(item.index) && multiple) {
- this._showSelected(item);
- }
- }
- findItem(value) {
- let findBy;
- if (this._ngSelect.compareWith()) {
- findBy = (item) => this._ngSelect.compareWith()(item.value, value);
- }
- else if (this._ngSelect.bindValue()) {
- findBy = (item) => !item.children && this.resolveNested(item.value, this._ngSelect.bindValue()) === value;
- }
- else {
- findBy = (item) => item.value === value || (!item.children && item.label && item.label === this.resolveNested(value, this._ngSelect.bindLabel()));
- }
- return this._items.find((item) => findBy(item));
- }
- addItem(item) {
- const option = this.mapItem(item, this._items.length);
- this._items.push(option);
- this._filteredItems.push(option);
- return option;
- }
- clearSelected(keepDisabled = false) {
- this._selectionModel.clear(keepDisabled);
- this._items.forEach((item) => {
- item.selected = keepDisabled && item.selected && item.disabled;
- item.marked = false;
- });
- if (this._ngSelect.hideSelected()) {
- this.resetFilteredItems();
- }
- }
- findByLabel(term) {
- term = stripSpecialChars(term).toLocaleLowerCase();
- return this.filteredItems.find((item) => {
- const label = stripSpecialChars(item.label).toLocaleLowerCase();
- return label.substr(0, term.length) === term;
- });
- }
- filter(term) {
- if (!term) {
- this.resetFilteredItems();
- return;
- }
- this._filteredItems = [];
- term = this._ngSelect.searchFn() ? term : stripSpecialChars(term).toLocaleLowerCase();
- const match = this._ngSelect.searchFn() || this._defaultSearchFn;
- const hideSelected = this._ngSelect.hideSelected();
- for (const key of Array.from(this._groups.keys())) {
- const matchedItems = [];
- for (const item of this._groups.get(key)) {
- if (hideSelected && ((item.parent && item.parent.selected) || item.selected)) {
- continue;
- }
- const searchItem = this._ngSelect.searchFn() ? item.value : item;
- if (match(term, searchItem)) {
- matchedItems.push(item);
- }
- }
- if (matchedItems.length > 0) {
- const [last] = matchedItems.slice(-1);
- if (last.parent) {
- const head = this._items.find((x) => x === last.parent);
- this._filteredItems.push(head);
- }
- this._filteredItems.push(...matchedItems);
- }
- }
- }
- resetFilteredItems() {
- if (this._filteredItems.length === this._items.length) {
- return;
- }
- if (this._ngSelect.hideSelected() && this.selectedItems.length > 0) {
- this._filteredItems = this._items.filter((x) => !x.selected);
- }
- else {
- this._filteredItems = this._items;
- }
- }
- unmarkItem() {
- this._markedIndex = -1;
- }
- markNextItem() {
- this._stepToItem(+1);
- }
- markPreviousItem() {
- this._stepToItem(-1);
- }
- markItem(item) {
- this._markedIndex = this._filteredItems.indexOf(item);
- }
- markSelectedOrDefault(markDefault) {
- if (this._filteredItems.length === 0) {
- return;
- }
- const lastMarkedIndex = this._getLastMarkedIndex();
- if (lastMarkedIndex > -1) {
- this._markedIndex = lastMarkedIndex;
- }
- else {
- this._markedIndex = markDefault ? this.filteredItems.findIndex((x) => !x.disabled) : -1;
- }
- }
- resolveNested(option, key) {
- if (!isObject(option)) {
- return option;
- }
- if (key.indexOf('.') === -1) {
- return option[key];
- }
- else {
- const keys = key.split('.');
- let value = option;
- for (let i = 0, len = keys.length; i < len; ++i) {
- if (value == null) {
- return null;
- }
- value = value[keys[i]];
- }
- return value;
- }
- }
- mapItem(item, index) {
- const label = isDefined(item.$ngOptionLabel) ? item.$ngOptionLabel : this.resolveNested(item, this._ngSelect.bindLabel());
- const value = isDefined(item.$ngOptionValue) ? item.$ngOptionValue : item;
- return {
- index,
- label: isDefined(label) ? label.toString() : '',
- value,
- disabled: item.disabled,
- htmlId: `${this._ngSelect.dropdownId}-${index}`,
- };
- }
- mapSelectedItems() {
- const multiple = this._ngSelect.multiple();
- for (const selected of this.selectedItems) {
- const bindValue = this._ngSelect.bindValue();
- let item = null;
- // When compareWith is used, we need to find the item using the original selected value rather than the extracted bindValue, since compareWith expects to compare against the original value
- if (this._ngSelect.compareWith()) {
- item = this._items.find((item) => this._ngSelect.compareWith()(item.value, selected.value));
- }
- else {
- const value = bindValue ? this.resolveNested(selected.value, bindValue) : selected.value;
- item = isDefined(value) ? this.findItem(value) : null;
- }
- this._selectionModel.unselect(selected, multiple);
- this._selectionModel.select(item || selected, multiple, this._ngSelect.selectableGroupAsModel());
- }
- if (this._ngSelect.hideSelected()) {
- this._filteredItems = this.filteredItems.filter((x) => this.selectedItems.indexOf(x) === -1);
- }
- }
- _showSelected(item) {
- this._filteredItems.push(item);
- if (item.parent) {
- const parent = item.parent;
- const parentExists = this._filteredItems.find((x) => x === parent);
- if (!parentExists) {
- this._filteredItems.push(parent);
- }
- }
- else if (item.children) {
- for (const child of item.children) {
- child.selected = false;
- this._filteredItems.push(child);
- }
- }
- this._filteredItems = [...this._filteredItems.sort((a, b) => a.index - b.index)];
- }
- _hideSelected(item) {
- this._filteredItems = this._filteredItems.filter((x) => x !== item);
- if (item.parent) {
- const children = item.parent.children;
- if (children.every((x) => x.selected)) {
- this._filteredItems = this._filteredItems.filter((x) => x !== item.parent);
- }
- }
- else if (item.children) {
- this._filteredItems = this.filteredItems.filter((x) => x.parent !== item);
- }
- }
- _defaultSearchFn(search, opt) {
- const label = stripSpecialChars(opt.label).toLocaleLowerCase();
- return label.indexOf(search) > -1;
- }
- _getNextItemIndex(steps) {
- if (steps > 0) {
- return this._markedIndex >= this._filteredItems.length - 1 ? 0 : this._markedIndex + 1;
- }
- return this._markedIndex <= 0 ? this._filteredItems.length - 1 : this._markedIndex - 1;
- }
- _stepToItem(steps) {
- if (this._filteredItems.length === 0 || this._filteredItems.every((x) => x.disabled)) {
- return;
- }
- this._markedIndex = this._getNextItemIndex(steps);
- if (this.markedItem.disabled) {
- this._stepToItem(steps);
- }
- }
- _getLastMarkedIndex() {
- if (this._ngSelect.hideSelected()) {
- return -1;
- }
- if (this._markedIndex > -1 && this.markedItem === undefined) {
- return -1;
- }
- const selectedIndex = this._filteredItems.indexOf(this.lastSelectedItem);
- if (this.lastSelectedItem && selectedIndex < 0) {
- return -1;
- }
- return Math.max(this.markedIndex, selectedIndex);
- }
- _groupBy(items, prop) {
- const groups = new Map();
- if (items.length === 0) {
- return groups;
- }
- // Check if items are already grouped by given key.
- if (Array.isArray(items[0].value[prop])) {
- for (const item of items) {
- const children = (item.value[prop] || []).map((x, index) => this.mapItem(x, index));
- groups.set(item, children);
- }
- return groups;
- }
- const isFnKey = isFunction(this._ngSelect.groupBy());
- const keyFn = (item) => {
- const key = isFnKey ? prop(item.value) : item.value[prop];
- return isDefined(key) ? key : undefined;
- };
- // Group items by key.
- for (const item of items) {
- const key = keyFn(item);
- const group = groups.get(key);
- if (group) {
- group.push(item);
- }
- else {
- groups.set(key, [item]);
- }
- }
- return groups;
- }
- _flatten(groups) {
- const isGroupByFn = isFunction(this._ngSelect.groupBy());
- const items = [];
- for (const key of Array.from(groups.keys())) {
- let i = items.length;
- if (key === undefined) {
- const withoutGroup = groups.get(undefined) || [];
- items.push(...withoutGroup.map((x) => {
- x.index = i++;
- return x;
- }));
- continue;
- }
- const isObjectKey = isObject(key);
- const parent = {
- label: isObjectKey ? '' : String(key),
- children: undefined,
- parent: null,
- index: i++,
- disabled: !this._ngSelect.selectableGroup(),
- htmlId: newId(),
- };
- const groupKey = isGroupByFn ? this._ngSelect.bindLabel() : this._ngSelect.groupBy();
- const groupValue = this._ngSelect.groupValue() ||
- (() => {
- if (isObjectKey) {
- return key.value;
- }
- return { [groupKey]: key };
- });
- const children = groups.get(key).map((x) => {
- x.parent = parent;
- x.children = undefined;
- x.index = i++;
- return x;
- });
- parent.children = children;
- parent.value = groupValue(key, children.map((x) => x.value));
- items.push(parent);
- items.push(...children);
- }
- return items;
- }
- }
- class NgDropdownPanelService {
- constructor() {
- this._dimensions = {
- itemHeight: 0,
- panelHeight: 0,
- itemsPerViewport: 0,
- };
- }
- get dimensions() {
- return this._dimensions;
- }
- calculateItems(scrollPos, itemsLength, buffer) {
- const d = this._dimensions;
- const scrollHeight = d.itemHeight * itemsLength;
- const scrollTop = Math.max(0, scrollPos);
- const indexByScrollTop = (scrollTop / scrollHeight) * itemsLength;
- let end = Math.min(itemsLength, Math.ceil(indexByScrollTop) + (d.itemsPerViewport + 1));
- const maxStartEnd = end;
- const maxStart = Math.max(0, maxStartEnd - d.itemsPerViewport);
- let start = Math.min(maxStart, Math.floor(indexByScrollTop));
- let topPadding = d.itemHeight * Math.ceil(start) - d.itemHeight * Math.min(start, buffer);
- topPadding = !isNaN(topPadding) ? topPadding : 0;
- start = !isNaN(start) ? start : -1;
- end = !isNaN(end) ? end : -1;
- start -= buffer;
- start = Math.max(0, start);
- end += buffer;
- end = Math.min(itemsLength, end);
- return {
- topPadding,
- scrollHeight,
- start,
- end,
- };
- }
- setDimensions(itemHeight, panelHeight) {
- const itemsPerViewport = Math.max(1, Math.floor(panelHeight / itemHeight));
- this._dimensions = {
- itemHeight,
- panelHeight,
- itemsPerViewport,
- };
- }
- getScrollTo(itemTop, itemHeight, lastScroll) {
- const { panelHeight } = this.dimensions;
- const itemBottom = itemTop + itemHeight;
- const top = lastScroll;
- const bottom = top + panelHeight;
- if (panelHeight >= itemBottom && lastScroll === itemTop) {
- return null;
- }
- if (itemBottom > bottom) {
- return top + itemBottom - bottom;
- }
- else if (itemTop <= top) {
- return itemTop;
- }
- return null;
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgDropdownPanelService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgDropdownPanelService }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgDropdownPanelService, decorators: [{
- type: Injectable
- }] });
- const CSS_POSITIONS = ['top', 'right', 'bottom', 'left'];
- const SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;
- class NgDropdownPanelComponent {
- constructor() {
- this._renderer = inject(Renderer2);
- this._zone = inject(NgZone);
- this._panelService = inject(NgDropdownPanelService);
- this._document = inject(DOCUMENT, { optional: true });
- this._dropdown = inject((ElementRef)).nativeElement;
- this.items = input([]);
- this.markedItem = input(undefined);
- this.position = input('auto');
- this.appendTo = input(undefined);
- this.bufferAmount = input(undefined);
- this.virtualScroll = input(false, { transform: booleanAttribute });
- this.headerTemplate = input(undefined);
- this.footerTemplate = input(undefined);
- this.filterValue = input(null);
- this.ariaLabelDropdown = input(null);
- this.update = output();
- this.scroll = output();
- this.scrollToEnd = output();
- this.outsideClick = output();
- this.contentElementRef = viewChild('content', { read: ElementRef });
- this.scrollElementRef = viewChild('scroll', { read: ElementRef });
- this.paddingElementRef = viewChild('padding', { read: ElementRef });
- this._destroy$ = new Subject();
- this._virtualPadding = computed(() => this.paddingElementRef()?.nativeElement);
- this._scrollablePanel = computed(() => this.scrollElementRef()?.nativeElement);
- this._contentPanel = computed(() => this.contentElementRef()?.nativeElement);
- this._scrollToEndFired = false;
- this._updateScrollHeight = false;
- this._lastScrollPosition = 0;
- }
- get currentPosition() {
- return this._currentPosition;
- }
- get itemsLength() {
- return this._itemsLength;
- }
- set itemsLength(value) {
- if (value !== this._itemsLength) {
- this._itemsLength = value;
- this._onItemsLengthChanged();
- }
- }
- get _startOffset() {
- if (this.markedItem()) {
- const { itemHeight, panelHeight } = this._panelService.dimensions;
- const offset = this.markedItem().index * itemHeight;
- return panelHeight > offset ? 0 : offset;
- }
- return 0;
- }
- ngOnInit() {
- this._select = this._dropdown.parentElement;
- this._handleScroll();
- this._handleOutsideClick();
- this._appendDropdown();
- this._setupMousedownListener();
- }
- ngOnChanges(changes) {
- if (changes.items) {
- const change = changes.items;
- this._onItemsChange(change.currentValue, change.firstChange);
- }
- }
- ngOnDestroy() {
- this._destroy$.next();
- this._destroy$.complete();
- this._destroy$.unsubscribe();
- if (this.appendTo()) {
- this._renderer.removeChild(this._dropdown.parentNode, this._dropdown);
- }
- }
- scrollTo(option, startFromOption = false) {
- if (!option) {
- return;
- }
- const index = this.items().indexOf(option);
- if (index < 0 || index >= this.itemsLength) {
- return;
- }
- let scrollTo;
- if (this.virtualScroll()) {
- const itemHeight = this._panelService.dimensions.itemHeight;
- scrollTo = this._panelService.getScrollTo(index * itemHeight, itemHeight, this._lastScrollPosition);
- }
- else {
- const item = this._dropdown.querySelector(`#${option.htmlId}`);
- const lastScroll = startFromOption ? item.offsetTop : this._lastScrollPosition;
- scrollTo = this._panelService.getScrollTo(item.offsetTop, item.clientHeight, lastScroll);
- }
- if (isDefined(scrollTo)) {
- this._scrollablePanel().scrollTop = scrollTo;
- }
- }
- scrollToTag() {
- const panel = this._scrollablePanel();
- panel.scrollTop = panel.scrollHeight - panel.clientHeight;
- }
- adjustPosition() {
- this._updateYPosition();
- }
- _handleDropdownPosition() {
- this._currentPosition = this._calculateCurrentPosition(this._dropdown);
- if (CSS_POSITIONS.includes(this._currentPosition)) {
- this._updateDropdownClass(this._currentPosition);
- }
- else {
- this._updateDropdownClass('bottom');
- }
- if (this.appendTo()) {
- this._updateYPosition();
- }
- this._dropdown.style.opacity = '1';
- }
- _updateDropdownClass(currentPosition) {
- CSS_POSITIONS.forEach((position) => {
- const REMOVE_CSS_CLASS = `ng-select-${position}`;
- this._renderer.removeClass(this._dropdown, REMOVE_CSS_CLASS);
- this._renderer.removeClass(this._select, REMOVE_CSS_CLASS);
- });
- const ADD_CSS_CLASS = `ng-select-${currentPosition}`;
- this._renderer.addClass(this._dropdown, ADD_CSS_CLASS);
- this._renderer.addClass(this._select, ADD_CSS_CLASS);
- }
- _handleScroll() {
- this._zone.runOutsideAngular(() => {
- if (!this._scrollablePanel()) {
- return;
- }
- fromEvent(this._scrollablePanel(), 'scroll')
- .pipe(takeUntil(this._destroy$), auditTime(0, SCROLL_SCHEDULER))
- .subscribe((e) => {
- const path = e.path || (e.composedPath && e.composedPath());
- if (!path || (path.length === 0 && !e.target)) {
- return;
- }
- const scrollTop = !path || path.length === 0 ? e.target.scrollTop : path[0].scrollTop;
- this._onContentScrolled(scrollTop);
- });
- });
- }
- _handleOutsideClick() {
- if (!this._document) {
- return;
- }
- this._zone.runOutsideAngular(() => {
- merge(fromEvent(this._document, 'touchstart', { capture: true }), fromEvent(this._document, 'click', { capture: true }))
- .pipe(takeUntil(this._destroy$))
- .subscribe(($event) => this._checkToClose($event));
- });
- }
- _checkToClose($event) {
- if (this._select.contains($event.target) || this._dropdown.contains($event.target)) {
- return;
- }
- const path = $event.path || ($event.composedPath && $event.composedPath());
- if ($event.target && $event.target.shadowRoot && path && path[0] && this._select.contains(path[0])) {
- return;
- }
- this._zone.run(() => this.outsideClick.emit());
- }
- _onItemsChange(items = [], firstChange) {
- this._scrollToEndFired = false;
- this.itemsLength = items.length;
- if (this.virtualScroll()) {
- this._updateItemsRange(firstChange);
- }
- else {
- this._setVirtualHeight();
- this._updateItems(firstChange);
- }
- }
- _updateItems(firstChange) {
- this.update.emit(this.items());
- if (firstChange === false) {
- return;
- }
- this._zone.runOutsideAngular(() => {
- Promise.resolve().then(() => {
- const panelHeight = this._scrollablePanel().clientHeight;
- this._panelService.setDimensions(0, panelHeight);
- this._handleDropdownPosition();
- this.scrollTo(this.markedItem(), firstChange);
- });
- });
- }
- _updateItemsRange(firstChange) {
- this._zone.runOutsideAngular(() => {
- this._measureDimensions().then(() => {
- if (firstChange) {
- this._renderItemsRange(this._startOffset);
- this._handleDropdownPosition();
- }
- else {
- this._renderItemsRange();
- }
- });
- });
- }
- _onContentScrolled(scrollTop) {
- if (this.virtualScroll()) {
- this._renderItemsRange(scrollTop);
- }
- this._lastScrollPosition = scrollTop;
- this._fireScrollToEnd(scrollTop);
- }
- _updateVirtualHeight(height) {
- if (this._updateScrollHeight) {
- this._virtualPadding().style.height = `${height}px`;
- this._updateScrollHeight = false;
- }
- }
- _setVirtualHeight() {
- if (!this._virtualPadding()) {
- return;
- }
- this._virtualPadding().style.height = `0px`;
- }
- _onItemsLengthChanged() {
- this._updateScrollHeight = true;
- }
- _renderItemsRange(scrollTop = null) {
- if (scrollTop && this._lastScrollPosition === scrollTop) {
- return;
- }
- scrollTop = scrollTop || this._scrollablePanel().scrollTop;
- const range = this._panelService.calculateItems(scrollTop, this.itemsLength, this.bufferAmount());
- this._updateVirtualHeight(range.scrollHeight);
- this._contentPanel().style.transform = `translateY(${range.topPadding}px)`;
- this._zone.run(() => {
- this.update.emit(this.items().slice(range.start, range.end));
- this.scroll.emit({ start: range.start, end: range.end });
- });
- if (isDefined(scrollTop) && this._lastScrollPosition === 0) {
- this._scrollablePanel().scrollTop = scrollTop;
- this._lastScrollPosition = scrollTop;
- }
- }
- _measureDimensions() {
- if (this._panelService.dimensions.itemHeight > 0 || this.itemsLength === 0) {
- return Promise.resolve(this._panelService.dimensions);
- }
- const [first] = this.items();
- this.update.emit([first]);
- return Promise.resolve().then(() => {
- const option = this._dropdown.querySelector(`#${first.htmlId}`);
- const optionHeight = option.clientHeight;
- this._virtualPadding().style.height = `${optionHeight * this.itemsLength}px`;
- const panelHeight = this._scrollablePanel().clientHeight;
- this._panelService.setDimensions(optionHeight, panelHeight);
- return this._panelService.dimensions;
- });
- }
- _fireScrollToEnd(scrollTop) {
- if (this._scrollToEndFired || scrollTop === 0) {
- return;
- }
- const padding = this.virtualScroll() ? this._virtualPadding() : this._contentPanel();
- if (scrollTop + this._dropdown.clientHeight >= padding.clientHeight - 1) {
- this._zone.run(() => this.scrollToEnd.emit());
- this._scrollToEndFired = true;
- }
- }
- _calculateCurrentPosition(dropdownEl) {
- const position = this.position();
- if (position !== 'auto') {
- return position;
- }
- const selectRect = this._select.getBoundingClientRect();
- const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
- const offsetTop = selectRect.top + window.pageYOffset;
- const height = selectRect.height;
- const dropdownHeight = dropdownEl.getBoundingClientRect().height;
- if (offsetTop + height + dropdownHeight > scrollTop + document.documentElement.clientHeight) {
- return 'top';
- }
- else {
- return 'bottom';
- }
- }
- _appendDropdown() {
- if (!this.appendTo()) {
- return;
- }
- this._parent = this._dropdown.shadowRoot
- ? this._dropdown.shadowRoot.querySelector(this.appendTo())
- : document.querySelector(this.appendTo());
- if (!this._parent) {
- throw new Error(`appendTo selector ${this.appendTo()} did not found any parent element`);
- }
- this._updateXPosition();
- this._parent.appendChild(this._dropdown);
- }
- _updateXPosition() {
- const select = this._select.getBoundingClientRect();
- const parent = this._parent.getBoundingClientRect();
- const isRTL = document.documentElement.dir === 'rtl';
- const offsetLeft = select.left - parent.left;
- if (isRTL) {
- const offsetRight = parent.right - select.right;
- this._dropdown.style.right = offsetRight + 'px';
- this._dropdown.style.left = 'auto';
- }
- else {
- this._dropdown.style.left = offsetLeft + 'px';
- this._dropdown.style.right = 'auto';
- }
- this._dropdown.style.width = select.width + 'px';
- this._dropdown.style.minWidth = select.width + 'px';
- }
- _updateYPosition() {
- const select = this._select.getBoundingClientRect();
- const parent = this._parent.getBoundingClientRect();
- const delta = select.height;
- if (this._currentPosition === 'top') {
- const offsetBottom = parent.bottom - select.bottom;
- this._dropdown.style.bottom = offsetBottom + delta + 'px';
- this._dropdown.style.top = 'auto';
- }
- else if (this._currentPosition === 'bottom') {
- const offsetTop = select.top - parent.top;
- this._dropdown.style.top = offsetTop + delta + 'px';
- this._dropdown.style.bottom = 'auto';
- }
- }
- _setupMousedownListener() {
- this._zone.runOutsideAngular(() => {
- fromEvent(this._dropdown, 'mousedown')
- .pipe(takeUntil(this._destroy$))
- .subscribe((event) => {
- const target = event.target;
- if (target.tagName === 'INPUT') {
- return;
- }
- event.preventDefault();
- });
- });
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgDropdownPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: NgDropdownPanelComponent, isStandalone: true, selector: "ng-dropdown-panel", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, markedItem: { classPropertyName: "markedItem", publicName: "markedItem", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, bufferAmount: { classPropertyName: "bufferAmount", publicName: "bufferAmount", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: false, transformFunction: null }, footerTemplate: { classPropertyName: "footerTemplate", publicName: "footerTemplate", isSignal: true, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelDropdown: { classPropertyName: "ariaLabelDropdown", publicName: "ariaLabelDropdown", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { update: "update", scroll: "scroll", scrollToEnd: "scrollToEnd", outsideClick: "outsideClick" }, viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "scrollElementRef", first: true, predicate: ["scroll"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "paddingElementRef", first: true, predicate: ["padding"], descendants: true, read: ElementRef, isSignal: true }], usesOnChanges: true, ngImport: i0, template: `
- @if (headerTemplate()) {
- <div class="ng-dropdown-header">
- <ng-container [ngTemplateOutlet]="headerTemplate()" [ngTemplateOutletContext]="{ searchTerm: filterValue() }" />
- </div>
- }
- <div #scroll role="listbox" class="ng-dropdown-panel-items scroll-host" [attr.aria-label]="ariaLabelDropdown()">
- <div #padding [class.total-padding]="virtualScroll()"></div>
- <div #content [class.scrollable-content]="virtualScroll() && items().length">
- <ng-content />
- </div>
- </div>
- @if (footerTemplate()) {
- <div class="ng-dropdown-footer">
- <ng-container [ngTemplateOutlet]="footerTemplate()" [ngTemplateOutletContext]="{ searchTerm: filterValue() }" />
- </div>
- }
- `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgDropdownPanelComponent, decorators: [{
- type: Component,
- args: [{
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- selector: 'ng-dropdown-panel',
- template: `
- @if (headerTemplate()) {
- <div class="ng-dropdown-header">
- <ng-container [ngTemplateOutlet]="headerTemplate()" [ngTemplateOutletContext]="{ searchTerm: filterValue() }" />
- </div>
- }
- <div #scroll role="listbox" class="ng-dropdown-panel-items scroll-host" [attr.aria-label]="ariaLabelDropdown()">
- <div #padding [class.total-padding]="virtualScroll()"></div>
- <div #content [class.scrollable-content]="virtualScroll() && items().length">
- <ng-content />
- </div>
- </div>
- @if (footerTemplate()) {
- <div class="ng-dropdown-footer">
- <ng-container [ngTemplateOutlet]="footerTemplate()" [ngTemplateOutletContext]="{ searchTerm: filterValue() }" />
- </div>
- }
- `,
- imports: [NgTemplateOutlet]
- }]
- }] });
- class NgOptionComponent {
- constructor() {
- this.value = input();
- this.disabled = input(false, {
- transform: booleanAttribute,
- });
- this.elementRef = inject((ElementRef));
- this.label = signal('');
- this.stateChange = computed(() => ({
- value: this.value(),
- disabled: this.disabled(),
- label: this.label(),
- }));
- this.stateChange$ = toObservable(this.stateChange);
- afterNextRender(() => {
- if (this._label !== this.label()) {
- this.label.set(this._label);
- }
- });
- }
- get _label() {
- return (this.elementRef.nativeElement.innerHTML || '').trim();
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.0", type: NgOptionComponent, isStandalone: true, selector: "ng-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgOptionComponent, decorators: [{
- type: Component,
- args: [{
- selector: 'ng-option',
- standalone: true,
- changeDetection: ChangeDetectionStrategy.OnPush,
- template: `<ng-content />`,
- }]
- }], ctorParameters: () => [] });
- var KeyCode;
- (function (KeyCode) {
- KeyCode["Tab"] = "Tab";
- KeyCode["Enter"] = "Enter";
- KeyCode["Esc"] = "Escape";
- KeyCode["Space"] = " ";
- KeyCode["ArrowUp"] = "ArrowUp";
- KeyCode["ArrowDown"] = "ArrowDown";
- KeyCode["Backspace"] = "Backspace";
- })(KeyCode || (KeyCode = {}));
- function DefaultSelectionModelFactory() {
- return new DefaultSelectionModel();
- }
- class DefaultSelectionModel {
- constructor() {
- this._selected = [];
- }
- get value() {
- return this._selected;
- }
- select(item, multiple, groupAsModel) {
- item.selected = true;
- if (!item.children || (!multiple && groupAsModel)) {
- this._selected.push(item);
- }
- if (multiple) {
- if (item.parent) {
- const childrenCount = item.parent.children.length;
- const selectedCount = item.parent.children.filter((x) => x.selected).length;
- item.parent.selected = childrenCount === selectedCount;
- }
- else if (item.children) {
- this._setChildrenSelectedState(item.children, true);
- this._removeChildren(item);
- if (groupAsModel && this._activeChildren(item)) {
- this._selected = [...this._selected.filter((x) => x.parent !== item), item];
- }
- else {
- this._selected = [...this._selected, ...item.children.filter((x) => !x.disabled)];
- }
- }
- }
- }
- unselect(item, multiple) {
- this._selected = this._selected.filter((x) => x !== item);
- item.selected = false;
- if (multiple) {
- if (item.parent && item.parent.selected) {
- const children = item.parent.children;
- this._removeParent(item.parent);
- this._removeChildren(item.parent);
- this._selected.push(...children.filter((x) => x !== item && !x.disabled));
- item.parent.selected = false;
- }
- else if (item.children) {
- this._setChildrenSelectedState(item.children, false);
- this._removeChildren(item);
- }
- }
- }
- clear(keepDisabled) {
- this._selected = keepDisabled ? this._selected.filter((x) => x.disabled) : [];
- }
- _setChildrenSelectedState(children, selected) {
- for (const child of children) {
- if (child.disabled) {
- continue;
- }
- child.selected = selected;
- }
- }
- _removeChildren(parent) {
- this._selected = [
- ...this._selected.filter((x) => x.parent !== parent),
- ...parent.children.filter((x) => x.parent === parent && x.disabled && x.selected),
- ];
- }
- _removeParent(parent) {
- this._selected = this._selected.filter((x) => x !== parent);
- }
- _activeChildren(item) {
- return item.children.every((x) => !x.disabled || x.selected);
- }
- }
- const SELECTION_MODEL_FACTORY = new InjectionToken('ng-select-selection-model');
- class NgSelectComponent {
- constructor() {
- this.classes = inject(new HostAttributeToken('class'), { optional: true });
- this.autoFocus = inject(new HostAttributeToken('autofocus'), { optional: true });
- this.config = inject(NgSelectConfig);
- this._cd = inject(ChangeDetectorRef);
- this._console = inject(ConsoleService);
- // signals
- this._disabled = signal(false);
- // inputs
- this.ariaLabelDropdown = input('Options List');
- this.ariaLabel = input(undefined);
- this.markFirst = input(true, { transform: booleanAttribute });
- this.placeholder = input(this.config.placeholder);
- this.fixedPlaceholder = input(true);
- this.notFoundText = input(undefined);
- this.typeToSearchText = input(undefined);
- this.preventToggleOnRightClick = input(false);
- this.addTagText = input(undefined);
- this.loadingText = input(undefined);
- this.clearAllText = input(undefined);
- this.dropdownPosition = input('auto');
- this.appendTo = input(undefined);
- this.loading = input(false, { transform: booleanAttribute });
- this.closeOnSelect = input(true, { transform: booleanAttribute });
- this.hideSelected = input(false, { transform: booleanAttribute });
- this.selectOnTab = input(false, { transform: booleanAttribute });
- this.openOnEnter = input(undefined, { transform: booleanAttribute });
- this.maxSelectedItems = input(undefined, { transform: numberAttribute });
- this.groupBy = input(undefined);
- this.groupValue = input(undefined);
- this.bufferAmount = input(4, { transform: numberAttribute });
- this.virtualScroll = input(undefined, { transform: booleanAttribute });
- this.selectableGroup = input(false, { transform: booleanAttribute });
- this.tabFocusOnClearButton = input();
- this.selectableGroupAsModel = input(true, { transform: booleanAttribute });
- this.searchFn = input(null);
- this.trackByFn = input(null);
- this.clearOnBackspace = input(true, { transform: booleanAttribute });
- this.labelForId = input(null);
- this.inputAttrs = input({});
- this.tabIndex = input(undefined, { transform: numberAttribute });
- this.readonly = input(false, { transform: booleanAttribute });
- this.searchWhileComposing = input(true, { transform: booleanAttribute });
- this.minTermLength = input(0, { transform: numberAttribute });
- this.editableSearchTerm = input(false, { transform: booleanAttribute });
- this.ngClass = input(null);
- this.typeahead = input(undefined);
- this.multiple = input(false, { transform: booleanAttribute });
- this.addTag = input(false);
- this.searchable = input(true, { transform: booleanAttribute });
- this.clearable = input(true, { transform: booleanAttribute });
- this.deselectOnClick = input();
- this.clearSearchOnAdd = input(undefined);
- this.compareWith = input(undefined, {
- transform: (fn) => {
- if (fn !== undefined && fn !== null && !isFunction(fn)) {
- throw Error('`compareWith` must be a function.');
- }
- return fn;
- },
- });
- // models
- this.bindLabel = model(undefined);
- this.bindValue = model(undefined);
- this.appearance = model(undefined);
- this.isOpen = model(false);
- this.items = model([]);
- // output events
- this.blurEvent = output({ alias: 'blur' });
- this.focusEvent = output({ alias: 'focus' });
- this.changeEvent = output({ alias: 'change' });
- this.openEvent = output({ alias: 'open' });
- this.closeEvent = output({ alias: 'close' });
- this.searchEvent = output({ alias: 'search' });
- this.clearEvent = output({ alias: 'clear' });
- this.addEvent = output({ alias: 'add' });
- this.removeEvent = output({ alias: 'remove' });
- this.scroll = output({ alias: 'scroll' });
- this.scrollToEnd = output({ alias: 'scrollToEnd' });
- // computed
- this.disabled = computed(() => this.readonly() || this._disabled());
- this.clearSearchOnAddValue = computed(() => {
- if (isDefined(this.clearSearchOnAdd())) {
- return this.clearSearchOnAdd();
- }
- if (isDefined(this.config.clearSearchOnAdd)) {
- return this.config.clearSearchOnAdd;
- }
- return this.closeOnSelect();
- });
- this.deselectOnClickValue = computed(() => {
- if (isDefined(this.deselectOnClick())) {
- return this.deselectOnClick();
- }
- if (isDefined(this.config.deselectOnClick)) {
- return this.config.deselectOnClick;
- }
- return this.multiple();
- });
- // content child queries
- this.optionTemplate = contentChild(NgOptionTemplateDirective, { read: TemplateRef });
- this.optgroupTemplate = contentChild(NgOptgroupTemplateDirective, { read: TemplateRef });
- this.labelTemplate = contentChild(NgLabelTemplateDirective, { read: TemplateRef });
- this.multiLabelTemplate = contentChild(NgMultiLabelTemplateDirective, { read: TemplateRef });
- this.headerTemplate = contentChild(NgHeaderTemplateDirective, { read: TemplateRef });
- this.footerTemplate = contentChild(NgFooterTemplateDirective, { read: TemplateRef });
- this.notFoundTemplate = contentChild(NgNotFoundTemplateDirective, { read: TemplateRef });
- this.placeholderTemplate = contentChild(NgPlaceholderTemplateDirective, { read: TemplateRef });
- this.typeToSearchTemplate = contentChild(NgTypeToSearchTemplateDirective, { read: TemplateRef });
- this.loadingTextTemplate = contentChild(NgLoadingTextTemplateDirective, { read: TemplateRef });
- this.tagTemplate = contentChild(NgTagTemplateDirective, { read: TemplateRef });
- this.loadingSpinnerTemplate = contentChild(NgLoadingSpinnerTemplateDirective, { read: TemplateRef });
- this.clearButtonTemplate = contentChild(NgClearButtonTemplateDirective, { read: TemplateRef });
- // view children queries
- this.dropdownPanel = viewChild(forwardRef(() => NgDropdownPanelComponent));
- this.searchInput = viewChild('searchInput');
- this.clearButton = viewChild('clearButton');
- // public variables
- this.ngOptions = contentChildren(NgOptionComponent, { descendants: true });
- this.ngOptionsObservable = toObservable(this.ngOptions);
- this.viewPortItems = [];
- this.searchTerm = null;
- this.dropdownId = newId();
- this.escapeHTML = true;
- this.tabFocusOnClear = signal(true);
- this._defaultLabel = 'label';
- this._pressedKeys = [];
- this._isComposing = false;
- this._destroy$ = new Subject();
- this._keyPress$ = new Subject();
- this.keyDownFn = input((_) => true);
- this.clearItem = (item) => {
- const option = this.selectedItems.find((x) => x.value === item);
- this.unselect(option);
- };
- this.trackByOption = (_, item) => {
- if (this.trackByFn()) {
- return this.trackByFn()(item.value);
- }
- return item;
- };
- this._onChange = (_) => { };
- this._onTouched = () => { };
- const config = this.config;
- const newSelectionModel = inject(SELECTION_MODEL_FACTORY, { optional: true });
- const _elementRef = inject(ElementRef);
- this._mergeGlobalConfig(config);
- this.itemsList = new ItemsList(this, newSelectionModel ? newSelectionModel() : DefaultSelectionModelFactory());
- this.element = _elementRef.nativeElement;
- }
- get filtered() {
- return (!!this.searchTerm && this.searchable()) || this._isComposing;
- }
- get selectedItems() {
- return this.itemsList.selectedItems;
- }
- get selectedValues() {
- return this.selectedItems.map((x) => x.value);
- }
- get hasValue() {
- return this.selectedItems.length > 0;
- }
- get currentPanelPosition() {
- if (this.dropdownPanel()) {
- return this.dropdownPanel().currentPosition;
- }
- return undefined;
- }
- get showAddTag() {
- if (!this._validTerm) {
- return false;
- }
- const term = this.searchTerm.toLowerCase().trim();
- return (this.addTag() &&
- !this.itemsList.filteredItems.some((x) => x.label.toLowerCase() === term) &&
- ((!this.hideSelected() && this.isOpen()) || !this.selectedItems.some((x) => x.label.toLowerCase() === term)) &&
- !this.loading());
- }
- get _editableSearchTerm() {
- return this.editableSearchTerm() && !this.multiple();
- }
- get _isTypeahead() {
- return this.typeahead() && this.typeahead().observed;
- }
- get _validTerm() {
- const term = this.searchTerm?.trim();
- return term && term.length >= this.minTermLength();
- }
- ngOnInit() {
- this._handleKeyPresses();
- this._setInputAttributes();
- }
- ngOnChanges(changes) {
- if (changes.multiple) {
- this.itemsList.clearSelected();
- }
- if (changes.items) {
- this._itemsAreUsed = true;
- this._setItems(changes.items.currentValue || []);
- }
- if (changes.isOpen) {
- this._manualOpen = isDefined(changes.isOpen.currentValue);
- }
- if (changes.groupBy) {
- if (!changes.items) {
- this._setItems([...this.items()]);
- }
- }
- if (changes.inputAttrs) {
- this._setInputAttributes();
- }
- this._setTabFocusOnClear();
- }
- ngAfterViewInit() {
- if (!this._itemsAreUsed) {
- this.escapeHTML = false;
- this._setItemsFromNgOptions();
- }
- if (isDefined(this.autoFocus)) {
- this.focus();
- }
- }
- ngOnDestroy() {
- this._destroy$.next();
- this._destroy$.complete();
- }
- handleKeyDown($event) {
- const keyName = $event.key;
- if (Object.values(KeyCode).includes(keyName)) {
- if (this.keyDownFn()($event) === false) {
- return;
- }
- this.handleKeyCode($event);
- }
- else if (keyName && keyName.length === 1) {
- this._keyPress$.next(keyName.toLocaleLowerCase());
- }
- }
- handleKeyCode($event) {
- const target = $event.target;
- if (this.clearButton() && this.clearButton().nativeElement === target) {
- this.handleKeyCodeClear($event);
- }
- else {
- this.handleKeyCodeInput($event);
- }
- }
- handleKeyCodeInput($event) {
- switch ($event.key) {
- case KeyCode.ArrowDown:
- this._handleArrowDown($event);
- break;
- case KeyCode.ArrowUp:
- this._handleArrowUp($event);
- break;
- case KeyCode.Space:
- this._handleSpace($event);
- break;
- case KeyCode.Enter:
- this._handleEnter($event);
- break;
- case KeyCode.Tab:
- this._handleTab($event);
- break;
- case KeyCode.Esc:
- this.close();
- $event.preventDefault();
- break;
- case KeyCode.Backspace:
- this._handleBackspace();
- break;
- }
- }
- handleKeyCodeClear($event) {
- switch ($event.key) {
- case KeyCode.Enter:
- this.handleClearClick();
- $event.preventDefault();
- break;
- }
- }
- handleMousedown($event) {
- if (this.disabled()) {
- return;
- }
- if (this.preventToggleOnRightClick() && $event.button === 2) {
- return false;
- }
- const target = $event.target;
- if (target.tagName !== 'INPUT') {
- $event.preventDefault();
- }
- if (target.classList.contains('ng-clear-wrapper')) {
- // Don't handle clear on mousedown - let click event handle it
- return;
- }
- if (target.classList.contains('ng-arrow-wrapper')) {
- this.handleArrowClick();
- return;
- }
- if (target.classList.contains('ng-value-icon')) {
- return;
- }
- if (!this.focused) {
- this.focus();
- }
- if (this.searchable()) {
- this.open();
- }
- else {
- this.toggle();
- }
- }
- handleArrowClick() {
- if (this.isOpen()) {
- this.close();
- }
- else {
- this.open();
- }
- }
- handleClearClick(_event) {
- if (this.hasValue) {
- this.itemsList.clearSelected(true);
- this._updateNgModel();
- }
- this._clearSearch();
- this.focus();
- this.clearEvent.emit();
- this._onSelectionChanged();
- }
- clearModel() {
- if (!this.clearable()) {
- return;
- }
- this.itemsList.clearSelected();
- this._updateNgModel();
- }
- writeValue(value) {
- this.itemsList.clearSelected();
- this._handleWriteValue(value);
- if (this._editableSearchTerm) {
- this._setSearchTermFromItems();
- }
- this._cd.markForCheck();
- }
- registerOnChange(fn) {
- this._onChange = fn;
- }
- registerOnTouched(fn) {
- this._onTouched = fn;
- }
- setDisabledState(state) {
- this._disabled.set(state);
- this._cd.markForCheck();
- }
- toggle() {
- if (!this.isOpen()) {
- this.open();
- }
- else {
- this.close();
- }
- }
- open() {
- if (this.disabled() || this.isOpen() || this._manualOpen) {
- return;
- }
- if (!this._isTypeahead && !this.addTag() && this.itemsList.noItemsToSelect) {
- return;
- }
- this.isOpen.set(true);
- this.itemsList.markSelectedOrDefault(this.markFirst());
- this.openEvent.emit();
- if (!this.searchTerm) {
- this.focus();
- }
- this.detectChanges();
- }
- close() {
- if (!this.isOpen() || this._manualOpen) {
- return;
- }
- this.isOpen.set(false);
- this._isComposing = false;
- if (!this._editableSearchTerm) {
- this._clearSearch();
- }
- else {
- this.itemsList.resetFilteredItems();
- }
- this.itemsList.unmarkItem();
- this._onTouched();
- this.closeEvent.emit();
- this._cd.markForCheck();
- }
- toggleItem(item) {
- if (!item || item.disabled || this.disabled()) {
- return;
- }
- if (this.deselectOnClickValue() && item.selected) {
- this.unselect(item);
- }
- else {
- this.select(item);
- }
- if (this._editableSearchTerm) {
- this._setSearchTermFromItems();
- }
- }
- select(item) {
- if (!item.selected) {
- this.itemsList.select(item);
- if (this.clearSearchOnAddValue() && !this._editableSearchTerm) {
- this._clearSearch();
- }
- this._updateNgModel();
- if (this.multiple()) {
- this.addEvent.emit(item.value);
- }
- }
- if (this.closeOnSelect() || this.itemsList.noItemsToSelect) {
- this.close();
- }
- this._onSelectionChanged();
- }
- focus() {
- this.searchInput().nativeElement.focus();
- }
- blur() {
- this.searchInput().nativeElement.blur();
- }
- unselect(item) {
- if (!item) {
- return;
- }
- this.itemsList.unselect(item);
- this.focus();
- this._updateNgModel();
- this.removeEvent.emit(item.value);
- this._onSelectionChanged();
- }
- selectTag() {
- let tag;
- if (isFunction(this.addTag())) {
- tag = this.addTag()(this.searchTerm);
- }
- else {
- tag = this._primitive ? this.searchTerm : { [this.bindLabel()]: this.searchTerm };
- }
- const handleTag = (item) => (this._isTypeahead || !this.isOpen() ? this.itemsList.mapItem(item, null) : this.itemsList.addItem(item));
- if (isPromise(tag)) {
- tag.then((item) => this.select(handleTag(item))).catch(() => { });
- }
- else if (tag) {
- this.select(handleTag(tag));
- }
- }
- showClear() {
- return this.clearable() && (this.hasValue || this.searchTerm) && !this.disabled();
- }
- focusOnClear() {
- this.blur();
- if (this.clearButton()) {
- this.clearButton().nativeElement.focus();
- }
- }
- showNoItemsFound() {
- const empty = this.itemsList.filteredItems.length === 0;
- return (((empty && !this._isTypeahead && !this.loading()) || (empty && this._isTypeahead && this._validTerm && !this.loading())) &&
- !this.showAddTag);
- }
- showTypeToSearch() {
- const empty = this.itemsList.filteredItems.length === 0;
- return empty && this._isTypeahead && !this._validTerm && !this.loading();
- }
- onCompositionStart() {
- this._isComposing = true;
- }
- onCompositionEnd(term) {
- this._isComposing = false;
- if (this.searchWhileComposing()) {
- return;
- }
- this.filter(term);
- }
- filter(term) {
- if (this._isComposing && !this.searchWhileComposing()) {
- return;
- }
- this.searchTerm = term;
- if (this._isTypeahead && (this._validTerm || this.minTermLength() === 0)) {
- this.typeahead().next(term);
- }
- if (!this._isTypeahead) {
- this.itemsList.filter(this.searchTerm);
- if (this.isOpen()) {
- this.itemsList.markSelectedOrDefault(this.markFirst());
- }
- }
- this.searchEvent.emit({ term, items: this.itemsList.filteredItems.map((x) => x.value) });
- this.open();
- }
- onInputFocus($event) {
- if (this.focused) {
- return;
- }
- if (this._editableSearchTerm) {
- this._setSearchTermFromItems();
- }
- this.element.classList.add('ng-select-focused');
- this.focusEvent.emit($event);
- this.focused = true;
- }
- onInputBlur($event) {
- this.element.classList.remove('ng-select-focused');
- this.blurEvent.emit($event);
- if (!this.isOpen() && !this.disabled()) {
- this._onTouched();
- }
- if (this._editableSearchTerm) {
- this._setSearchTermFromItems();
- }
- this.focused = false;
- }
- onItemHover(item) {
- if (item.disabled) {
- return;
- }
- this.itemsList.markItem(item);
- }
- detectChanges() {
- if (!this._cd.destroyed) {
- this._cd.detectChanges();
- }
- }
- _setSearchTermFromItems() {
- const selected = this.selectedItems?.[0];
- this.searchTerm = selected?.label ?? null;
- }
- _setItems(items) {
- const firstItem = items[0];
- this.bindLabel.set(this.bindLabel() || this._defaultLabel);
- this._primitive = isDefined(firstItem) ? !isObject(firstItem) : this._primitive || this.bindLabel() === this._defaultLabel;
- this.itemsList.setItems(items);
- if (items.length > 0 && this.hasValue) {
- this.itemsList.mapSelectedItems();
- }
- if (this.isOpen() && isDefined(this.searchTerm) && !this._isTypeahead) {
- this.itemsList.filter(this.searchTerm);
- }
- if (this._isTypeahead || this.isOpen()) {
- this.itemsList.markSelectedOrDefault(this.markFirst());
- }
- }
- _setItemsFromNgOptions() {
- const mapNgOptions = (options) => {
- const items = options.map((option) => ({
- $ngOptionValue: option.value(),
- $ngOptionLabel: option.elementRef.nativeElement.innerHTML,
- disabled: option.disabled(),
- })) ?? [];
- this.items.set(items);
- this.itemsList.setItems(items);
- if (this.hasValue) {
- this.itemsList.mapSelectedItems();
- }
- };
- const handleOptionChange = (options) => {
- return merge(...options.map((option) => option.stateChange$)).pipe(tap((option) => {
- const item = this.itemsList.findItem(option.value);
- if (item) {
- item.disabled = option.disabled;
- item.label = option.label || item.label;
- }
- }));
- };
- this.ngOptionsObservable
- .pipe(startWith(this.ngOptions()), takeUntil(this._destroy$), tap((options) => {
- this.bindLabel.set(this._defaultLabel);
- mapNgOptions(options);
- this._cd.detectChanges();
- }), switchMap((options) => handleOptionChange(options)))
- .subscribe();
- }
- _isValidWriteValue(value) {
- if (!isDefined(value) || (this.multiple() && value === '') || (Array.isArray(value) && value.length === 0)) {
- return false;
- }
- const validateBinding = (item) => {
- if (!isDefined(this.compareWith()) && isObject(item) && this.bindValue()) {
- this._console.warn(`Setting object(${JSON.stringify(item)}) as your model with bindValue is not allowed unless [compareWith] is used.`);
- return false;
- }
- return true;
- };
- if (this.multiple()) {
- if (!Array.isArray(value)) {
- this._console.warn('Multiple select ngModel should be array.');
- return false;
- }
- return value.every((item) => validateBinding(item));
- }
- else {
- return validateBinding(value);
- }
- }
- _handleWriteValue(ngModel) {
- if (!this._isValidWriteValue(ngModel)) {
- return;
- }
- const select = (val) => {
- let item = this.itemsList.findItem(val);
- if (item) {
- this.itemsList.select(item);
- }
- else {
- const isValObject = isObject(val);
- const isPrimitive = !isValObject && !this.bindValue();
- if (isValObject || isPrimitive) {
- this.itemsList.select(this.itemsList.mapItem(val, null));
- }
- else if (this.bindValue()) {
- item = {
- [this.bindLabel()]: null,
- [this.bindValue()]: val,
- };
- this.itemsList.select(this.itemsList.mapItem(item, null));
- }
- }
- };
- if (this.multiple()) {
- ngModel.forEach((item) => select(item));
- }
- else {
- select(ngModel);
- }
- }
- _handleKeyPresses() {
- if (this.searchable()) {
- return;
- }
- this._keyPress$
- .pipe(takeUntil(this._destroy$), tap((letter) => this._pressedKeys.push(letter)), debounceTime(200), filter(() => this._pressedKeys.length > 0), map(() => this._pressedKeys.join('')))
- .subscribe((term) => {
- const item = this.itemsList.findByLabel(term);
- if (item) {
- if (this.isOpen()) {
- this.itemsList.markItem(item);
- this._scrollToMarked();
- this._cd.markForCheck();
- }
- else {
- this.select(item);
- }
- }
- this._pressedKeys = [];
- });
- }
- _setInputAttributes() {
- const input = this.searchInput().nativeElement;
- const attributes = {
- type: 'text',
- autocorrect: 'off',
- autocapitalize: 'off',
- autocomplete: 'off',
- 'aria-controls': this.dropdownId,
- ...this.inputAttrs(),
- };
- for (const key of Object.keys(attributes)) {
- input.setAttribute(key, attributes[key]);
- }
- }
- _setTabFocusOnClear() {
- this.tabFocusOnClear.set(isDefined(this.tabFocusOnClearButton()) ? !!this.tabFocusOnClearButton() : this.config.tabFocusOnClear);
- }
- _updateNgModel() {
- const model = [];
- for (const item of this.selectedItems) {
- if (this.bindValue()) {
- let value = null;
- if (item.children) {
- const groupKey = this.groupValue() ? this.bindValue() : this.groupBy();
- value = item.value[groupKey || this.groupBy()];
- }
- else {
- value = this.itemsList.resolveNested(item.value, this.bindValue());
- }
- model.push(value);
- }
- else {
- model.push(item.value);
- }
- }
- const selected = this.selectedItems.map((x) => x.value);
- if (this.multiple()) {
- this._onChange(model);
- this.changeEvent.emit(selected);
- }
- else {
- this._onChange(isDefined(model[0]) ? model[0] : null);
- this.changeEvent.emit(selected[0]);
- }
- this._cd.markForCheck();
- }
- _clearSearch() {
- if (!this.searchTerm) {
- return;
- }
- this._changeSearch(null);
- this.itemsList.resetFilteredItems();
- }
- _changeSearch(searchTerm) {
- this.searchTerm = searchTerm;
- if (this._isTypeahead) {
- this.typeahead().next(searchTerm);
- }
- }
- _scrollToMarked() {
- if (!this.isOpen() || !this.dropdownPanel()) {
- return;
- }
- this.dropdownPanel().scrollTo(this.itemsList.markedItem);
- }
- _scrollToTag() {
- if (!this.isOpen() || !this.dropdownPanel()) {
- return;
- }
- this.dropdownPanel().scrollToTag();
- }
- _onSelectionChanged() {
- const appendTo = this.appendTo() ?? this.config.appendTo;
- if (this.isOpen() && this.deselectOnClickValue() && appendTo) {
- // Make sure items are rendered.
- this._cd.detectChanges();
- this.dropdownPanel().adjustPosition();
- }
- }
- _handleTab($event) {
- if (this.isOpen() === false) {
- if (this.showClear() && !$event.shiftKey && this.tabFocusOnClear()) {
- this.focusOnClear();
- $event.preventDefault();
- }
- else if (!this.addTag()) {
- return;
- }
- }
- if (this.selectOnTab()) {
- if (this.itemsList.markedItem) {
- this.toggleItem(this.itemsList.markedItem);
- $event.preventDefault();
- }
- else if (this.showAddTag) {
- this.selectTag();
- $event.preventDefault();
- }
- else {
- this.close();
- }
- }
- else {
- this.close();
- }
- }
- _handleEnter($event) {
- const openOnEnter = this.openOnEnter() ?? this.config.openOnEnter;
- if (this.isOpen() || this._manualOpen) {
- if (this.itemsList.markedItem) {
- this.toggleItem(this.itemsList.markedItem);
- }
- else if (this.showAddTag) {
- this.selectTag();
- }
- }
- else if (openOnEnter) {
- this.open();
- }
- else {
- return;
- }
- $event.preventDefault();
- }
- _handleSpace($event) {
- if (this.isOpen() || this._manualOpen) {
- return;
- }
- this.open();
- $event.preventDefault();
- }
- _handleArrowDown($event) {
- if (this._nextItemIsTag(+1)) {
- this.itemsList.unmarkItem();
- this._scrollToTag();
- }
- else {
- this.itemsList.markNextItem();
- this._scrollToMarked();
- }
- this.open();
- $event.preventDefault();
- }
- _handleArrowUp($event) {
- if (!this.isOpen()) {
- return;
- }
- if (this._nextItemIsTag(-1)) {
- this.itemsList.unmarkItem();
- this._scrollToTag();
- }
- else {
- this.itemsList.markPreviousItem();
- this._scrollToMarked();
- }
- $event.preventDefault();
- }
- _nextItemIsTag(nextStep) {
- const nextIndex = this.itemsList.markedIndex + nextStep;
- return (this.addTag() && this.searchTerm && this.itemsList.markedItem && (nextIndex < 0 || nextIndex === this.itemsList.filteredItems.length));
- }
- _handleBackspace() {
- if (this.searchTerm || !this.clearable() || !this.clearOnBackspace() || !this.hasValue) {
- return;
- }
- if (this.multiple()) {
- this.unselect(this.itemsList.lastSelectedItem);
- }
- else {
- this.clearModel();
- }
- }
- _mergeGlobalConfig(config) {
- this.bindValue.set(this.bindValue() || config.bindValue);
- this.bindLabel.set(this.bindLabel() || config.bindLabel);
- this.appearance.set(this.appearance() || config.appearance);
- this._setTabFocusOnClear();
- }
- /**
- * Gets virtual scroll value from input or from config
- *
- * @param config NgSelectConfig object
- *
- * @returns `true` if virtual scroll is enabled, `false` otherwise
- */
- getVirtualScroll(config) {
- return isDefined(this.virtualScroll) ? this.virtualScroll() : this.isVirtualScrollDisabled(config);
- }
- /**
- * Gets disableVirtualScroll value from input or from config
- *
- * @param config NgSelectConfig object
- *
- * @returns `true` if disableVirtualScroll is enabled, `false` otherwise
- */
- isVirtualScrollDisabled(config) {
- return isDefined(config.disableVirtualScroll) ? !config.disableVirtualScroll : false;
- }
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: NgSelectComponent, isStandalone: true, selector: "ng-select", inputs: { ariaLabelDropdown: { classPropertyName: "ariaLabelDropdown", publicName: "ariaLabelDropdown", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, markFirst: { classPropertyName: "markFirst", publicName: "markFirst", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, fixedPlaceholder: { classPropertyName: "fixedPlaceholder", publicName: "fixedPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, notFoundText: { classPropertyName: "notFoundText", publicName: "notFoundText", isSignal: true, isRequired: false, transformFunction: null }, typeToSearchText: { classPropertyName: "typeToSearchText", publicName: "typeToSearchText", isSignal: true, isRequired: false, transformFunction: null }, preventToggleOnRightClick: { classPropertyName: "preventToggleOnRightClick", publicName: "preventToggleOnRightClick", isSignal: true, isRequired: false, transformFunction: null }, addTagText: { classPropertyName: "addTagText", publicName: "addTagText", isSignal: true, isRequired: false, transformFunction: null }, loadingText: { classPropertyName: "loadingText", publicName: "loadingText", isSignal: true, isRequired: false, transformFunction: null }, clearAllText: { classPropertyName: "clearAllText", publicName: "clearAllText", isSignal: true, isRequired: false, transformFunction: null }, dropdownPosition: { classPropertyName: "dropdownPosition", publicName: "dropdownPosition", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, hideSelected: { classPropertyName: "hideSelected", publicName: "hideSelected", isSignal: true, isRequired: false, transformFunction: null }, selectOnTab: { classPropertyName: "selectOnTab", publicName: "selectOnTab", isSignal: true, isRequired: false, transformFunction: null }, openOnEnter: { classPropertyName: "openOnEnter", publicName: "openOnEnter", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedItems: { classPropertyName: "maxSelectedItems", publicName: "maxSelectedItems", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, groupValue: { classPropertyName: "groupValue", publicName: "groupValue", isSignal: true, isRequired: false, transformFunction: null }, bufferAmount: { classPropertyName: "bufferAmount", publicName: "bufferAmount", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, selectableGroup: { classPropertyName: "selectableGroup", publicName: "selectableGroup", isSignal: true, isRequired: false, transformFunction: null }, tabFocusOnClearButton: { classPropertyName: "tabFocusOnClearButton", publicName: "tabFocusOnClearButton", isSignal: true, isRequired: false, transformFunction: null }, selectableGroupAsModel: { classPropertyName: "selectableGroupAsModel", publicName: "selectableGroupAsModel", isSignal: true, isRequired: false, transformFunction: null }, searchFn: { classPropertyName: "searchFn", publicName: "searchFn", isSignal: true, isRequired: false, transformFunction: null }, trackByFn: { classPropertyName: "trackByFn", publicName: "trackByFn", isSignal: true, isRequired: false, transformFunction: null }, clearOnBackspace: { classPropertyName: "clearOnBackspace", publicName: "clearOnBackspace", isSignal: true, isRequired: false, transformFunction: null }, labelForId: { classPropertyName: "labelForId", publicName: "labelForId", isSignal: true, isRequired: false, transformFunction: null }, inputAttrs: { classPropertyName: "inputAttrs", publicName: "inputAttrs", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, searchWhileComposing: { classPropertyName: "searchWhileComposing", publicName: "searchWhileComposing", isSignal: true, isRequired: false, transformFunction: null }, minTermLength: { classPropertyName: "minTermLength", publicName: "minTermLength", isSignal: true, isRequired: false, transformFunction: null }, editableSearchTerm: { classPropertyName: "editableSearchTerm", publicName: "editableSearchTerm", isSignal: true, isRequired: false, transformFunction: null }, ngClass: { classPropertyName: "ngClass", publicName: "ngClass", isSignal: true, isRequired: false, transformFunction: null }, typeahead: { classPropertyName: "typeahead", publicName: "typeahead", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, addTag: { classPropertyName: "addTag", publicName: "addTag", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, deselectOnClick: { classPropertyName: "deselectOnClick", publicName: "deselectOnClick", isSignal: true, isRequired: false, transformFunction: null }, clearSearchOnAdd: { classPropertyName: "clearSearchOnAdd", publicName: "clearSearchOnAdd", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, keyDownFn: { classPropertyName: "keyDownFn", publicName: "keyDownFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { bindLabel: "bindLabelChange", bindValue: "bindValueChange", appearance: "appearanceChange", isOpen: "isOpenChange", items: "itemsChange", blurEvent: "blur", focusEvent: "focus", changeEvent: "change", openEvent: "open", closeEvent: "close", searchEvent: "search", clearEvent: "clear", addEvent: "add", removeEvent: "remove", scroll: "scroll", scrollToEnd: "scrollToEnd" }, host: { listeners: { "keydown": "handleKeyDown($event)" }, properties: { "class.ng-select": "true", "class.ng-select-single": "!multiple()", "class.ng-select-typeahead": "typeahead()", "class.ng-select-multiple": "multiple()", "class.ng-select-taggable": "addTag()", "class.ng-select-searchable": "searchable()", "class.ng-select-clearable": "clearable()", "class.ng-select-opened": "isOpen()", "class.ng-select-filtered": "filtered", "class.ng-select-disabled": "disabled()" } }, providers: [
- {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef(() => NgSelectComponent),
- multi: true,
- },
- NgDropdownPanelService,
- ], queries: [{ propertyName: "optionTemplate", first: true, predicate: NgOptionTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "optgroupTemplate", first: true, predicate: NgOptgroupTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "labelTemplate", first: true, predicate: NgLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "multiLabelTemplate", first: true, predicate: NgMultiLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: NgHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: NgFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "notFoundTemplate", first: true, predicate: NgNotFoundTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "placeholderTemplate", first: true, predicate: NgPlaceholderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "typeToSearchTemplate", first: true, predicate: NgTypeToSearchTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "loadingTextTemplate", first: true, predicate: NgLoadingTextTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "tagTemplate", first: true, predicate: NgTagTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "loadingSpinnerTemplate", first: true, predicate: NgLoadingSpinnerTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "clearButtonTemplate", first: true, predicate: NgClearButtonTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "ngOptions", predicate: NgOptionComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "dropdownPanel", first: true, predicate: i0.forwardRef(() => NgDropdownPanelComponent), descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "clearButton", first: true, predicate: ["clearButton"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div\n\t(mousedown)=\"handleMousedown($event)\"\n\t[class.ng-appearance-outline]=\"appearance() === 'outline'\"\n\t[class.ng-has-value]=\"hasValue\"\n\tclass=\"ng-select-container\">\n\t<div class=\"ng-value-container\">\n\t\t@if ((selectedItems.length === 0 && !searchTerm) || (fixedPlaceholder() ?? config.fixedPlaceholder )) {\n\t\t\t<ng-template #defaultPlaceholderTemplate>\n\t\t\t\t<div class=\"ng-placeholder\">{{ placeholder() ?? config.placeholder }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"placeholderTemplate() || defaultPlaceholderTemplate\"> </ng-template>\n\t\t}\n\n\t\t@if ((!multiLabelTemplate() || !multiple()) && selectedItems.length > 0) {\n\t\t\t@for (item of selectedItems; track trackByOption($index, item)) {\n\t\t\t\t<div [class.ng-value-disabled]=\"item.disabled\" class=\"ng-value\">\n\t\t\t\t\t<ng-template #defaultLabelTemplate>\n\t\t\t\t\t\t<span class=\"ng-value-icon left\" (click)=\"unselect(item)\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t\t\t\t<span class=\"ng-value-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"labelTemplate() || defaultLabelTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, clear: clearItem, label: item.label }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t}\n\n\t\t@if (multiple() && multiLabelTemplate() && selectedValues.length > 0) {\n\t\t\t<ng-template [ngTemplateOutlet]=\"multiLabelTemplate()\" [ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\">\n\t\t\t</ng-template>\n\t\t}\n\n\t\t<div class=\"ng-input\">\n\t\t\t<input\n\t\t\t\t#searchInput\n\t\t\t\t(blur)=\"onInputBlur($event)\"\n\t\t\t\t(change)=\"$event.stopPropagation()\"\n\t\t\t\t(compositionend)=\"onCompositionEnd(searchInput.value)\"\n\t\t\t\t(compositionstart)=\"onCompositionStart()\"\n\t\t\t\t(focus)=\"onInputFocus($event)\"\n\t\t\t\t(input)=\"filter(searchInput.value)\"\n\t\t\t\t[attr.aria-activedescendant]=\"isOpen() ? itemsList?.markedItem?.htmlId : null\"\n\t\t\t\t[attr.aria-controls]=\"isOpen() ? dropdownId : null\"\n\t\t\t\t[attr.aria-expanded]=\"isOpen()\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel()\"\n\t\t\t\t[attr.id]=\"labelForId()\"\n\t\t\t\t[attr.tabindex]=\"tabIndex()\"\n\t\t\t\t[disabled]=\"disabled()\"\n\t\t\t\t[readOnly]=\"!searchable() || itemsList.maxItemsSelected\"\n\t\t\t\t[value]=\"searchTerm ?? ''\"\n\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\trole=\"combobox\" />\n\t\t</div>\n\t</div>\n\n\t@if (loading()) {\n\t\t<ng-template #defaultLoadingSpinnerTemplate>\n\t\t\t<div class=\"ng-spinner-loader\"></div>\n\t\t</ng-template>\n\t\t<ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate() || defaultLoadingSpinnerTemplate\"></ng-template>\n\t}\n\n\t@if (showClear()) {\n\t\t@if (clearButtonTemplate()) {\n\t\t\t<ng-container [ngTemplateOutlet]=\"clearButtonTemplate()\"></ng-container>\n\t\t} @else {\n\t\t\t<span\n\t\t\t\tclass=\"ng-clear-wrapper\"\n\t\t\t\trole=\"button\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[attr.tabindex]=\"tabFocusOnClear() ? 0 : -1\"\n\t\t\t\ttitle=\"{{ clearAllText() || config.clearAllText }}\"\n\t\t\t\t#clearButton\n\t\t\t\t(click)=\"handleClearClick($event)\">\n\t\t\t\t<span class=\"ng-clear\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t</span>\n\t\t}\n\t}\n\n\t<span class=\"ng-arrow-wrapper\">\n\t\t<span class=\"ng-arrow\"></span>\n\t</span>\n</div>\n\n@if (isOpen()) {\n\t@let appendToValue = appendTo() || config.appendTo;\n\t<ng-dropdown-panel\n\t\tclass=\"ng-dropdown-panel\"\n\t\t[virtualScroll]=\"virtualScroll() ?? !config.disableVirtualScroll ?? false\"\n\t\t[bufferAmount]=\"bufferAmount()\"\n\t\t[appendTo]=\"appendToValue\"\n\t\t[position]=\"dropdownPosition()\"\n\t\t[headerTemplate]=\"headerTemplate()\"\n\t\t[footerTemplate]=\"footerTemplate()\"\n\t\t[filterValue]=\"searchTerm\"\n\t\t[items]=\"itemsList.filteredItems\"\n\t\t[markedItem]=\"itemsList.markedItem\"\n\t\t(update)=\"viewPortItems = $event\"\n\t\t(scroll)=\"scroll.emit($event)\"\n\t\t(scrollToEnd)=\"scrollToEnd.emit($event)\"\n\t\t(outsideClick)=\"close()\"\n\t\t[class.ng-select-multiple]=\"multiple()\"\n\t\t[class]=\"appendToValue ? (ngClass() ? ngClass() : classes) : null\"\n\t\t[id]=\"dropdownId\"\n\t\t[ariaLabelDropdown]=\"ariaLabelDropdown()\">\n\t\t<ng-container>\n\t\t\t@for (item of viewPortItems; track trackByOption($index, item)) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[attr.role]=\"item.children ? 'group' : 'option'\"\n\t\t\t\t\t(click)=\"toggleItem(item)\"\n\t\t\t\t\t(mouseover)=\"onItemHover(item)\"\n\t\t\t\t\t[class.ng-option-disabled]=\"item.disabled\"\n\t\t\t\t\t[class.ng-option-selected]=\"item.selected\"\n\t\t\t\t\t[class.ng-optgroup]=\"item.children\"\n\t\t\t\t\t[class.ng-option]=\"!item.children\"\n\t\t\t\t\t[class.ng-option-child]=\"!!item.parent\"\n\t\t\t\t\t[class.ng-option-marked]=\"item === itemsList.markedItem\"\n\t\t\t\t\t[attr.aria-selected]=\"item.selected\"\n\t\t\t\t\t[attr.id]=\"item?.htmlId\"\n\t\t\t\t\t[attr.aria-setsize]=\"itemsList.filteredItems.length\"\n\t\t\t\t\t[attr.aria-posinset]=\"item.index + 1\">\n\t\t\t\t\t<ng-template #defaultOptionTemplate>\n\t\t\t\t\t\t<span class=\"ng-option-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"\n\t\t\t\t\t\t\titem.children ? optgroupTemplate() || defaultOptionTemplate : optionTemplate() || defaultOptionTemplate\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, item$: item, index: item.index, searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (showAddTag) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[class.ng-option-marked]=\"!itemsList.markedItem\"\n\t\t\t\t\t(mouseover)=\"itemsList.unmarkItem()\"\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\t(click)=\"selectTag()\">\n\t\t\t\t\t<ng-template #defaultTagTemplate>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t><span class=\"ng-tag-label\">{{ addTagText() || config.addTagText }}</span\n\t\t\t\t\t\t\t>\"{{ searchTerm }}\"</span\n\t\t\t\t\t\t>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"tagTemplate() || defaultTagTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</ng-container>\n\t\t@if (showNoItemsFound()) {\n\t\t\t<ng-template #defaultNotFoundTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ notFoundText() ?? config.notFoundText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"notFoundTemplate() || defaultNotFoundTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t\t@if (showTypeToSearch()) {\n\t\t\t<ng-template #defaultTypeToSearchTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ typeToSearchText() || config.typeToSearchText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"typeToSearchTemplate() || defaultTypeToSearchTemplate\"></ng-template>\n\t\t}\n\t\t@if (loading() && itemsList.filteredItems.length === 0) {\n\t\t\t<ng-template #defaultLoadingTextTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ loadingText() || config.loadingText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"loadingTextTemplate() || defaultLoadingTextTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t</ng-dropdown-panel>\n}\n\n<!-- Always present aria-live region -->\n<div aria-atomic=\"true\" aria-live=\"polite\" class=\"ng-visually-hidden\" role=\"status\">\n\t@if (isOpen && showNoItemsFound()) {\n\t\t{{ notFoundText }}\n\t}\n</div>\n", styles: ["@charset \"UTF-8\";.ng-select{position:relative;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-value{-webkit-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder{display:none}.ng-select .ng-select-container{cursor:default;display:flex;outline:none;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:unset;user-select:unset;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;transform:translateZ(0);animation:load8 .8s infinite linear}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-option-label:empty:before{content:\"\\200b\"}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}.ng-visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0;white-space:nowrap}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgItemLabelDirective, selector: "[ngItemLabel]", inputs: ["ngItemLabel", "escape"] }, { kind: "component", type: NgDropdownPanelComponent, selector: "ng-dropdown-panel", inputs: ["items", "markedItem", "position", "appendTo", "bufferAmount", "virtualScroll", "headerTemplate", "footerTemplate", "filterValue", "ariaLabelDropdown"], outputs: ["update", "scroll", "scrollToEnd", "outsideClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectComponent, decorators: [{
- type: Component,
- args: [{ selector: 'ng-select', providers: [
- {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef(() => NgSelectComponent),
- multi: true,
- },
- NgDropdownPanelService,
- ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, NgItemLabelDirective, NgDropdownPanelComponent], host: {
- '[class.ng-select]': 'true',
- '[class.ng-select-single]': '!multiple()',
- '[class.ng-select-typeahead]': 'typeahead()',
- '[class.ng-select-multiple]': 'multiple()',
- '[class.ng-select-taggable]': 'addTag()',
- '[class.ng-select-searchable]': 'searchable()',
- '[class.ng-select-clearable]': 'clearable()',
- '[class.ng-select-opened]': 'isOpen()',
- '[class.ng-select-filtered]': 'filtered',
- '[class.ng-select-disabled]': 'disabled()',
- }, template: "<div\n\t(mousedown)=\"handleMousedown($event)\"\n\t[class.ng-appearance-outline]=\"appearance() === 'outline'\"\n\t[class.ng-has-value]=\"hasValue\"\n\tclass=\"ng-select-container\">\n\t<div class=\"ng-value-container\">\n\t\t@if ((selectedItems.length === 0 && !searchTerm) || (fixedPlaceholder() ?? config.fixedPlaceholder )) {\n\t\t\t<ng-template #defaultPlaceholderTemplate>\n\t\t\t\t<div class=\"ng-placeholder\">{{ placeholder() ?? config.placeholder }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"placeholderTemplate() || defaultPlaceholderTemplate\"> </ng-template>\n\t\t}\n\n\t\t@if ((!multiLabelTemplate() || !multiple()) && selectedItems.length > 0) {\n\t\t\t@for (item of selectedItems; track trackByOption($index, item)) {\n\t\t\t\t<div [class.ng-value-disabled]=\"item.disabled\" class=\"ng-value\">\n\t\t\t\t\t<ng-template #defaultLabelTemplate>\n\t\t\t\t\t\t<span class=\"ng-value-icon left\" (click)=\"unselect(item)\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t\t\t\t<span class=\"ng-value-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"labelTemplate() || defaultLabelTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, clear: clearItem, label: item.label }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t}\n\n\t\t@if (multiple() && multiLabelTemplate() && selectedValues.length > 0) {\n\t\t\t<ng-template [ngTemplateOutlet]=\"multiLabelTemplate()\" [ngTemplateOutletContext]=\"{ items: selectedValues, clear: clearItem }\">\n\t\t\t</ng-template>\n\t\t}\n\n\t\t<div class=\"ng-input\">\n\t\t\t<input\n\t\t\t\t#searchInput\n\t\t\t\t(blur)=\"onInputBlur($event)\"\n\t\t\t\t(change)=\"$event.stopPropagation()\"\n\t\t\t\t(compositionend)=\"onCompositionEnd(searchInput.value)\"\n\t\t\t\t(compositionstart)=\"onCompositionStart()\"\n\t\t\t\t(focus)=\"onInputFocus($event)\"\n\t\t\t\t(input)=\"filter(searchInput.value)\"\n\t\t\t\t[attr.aria-activedescendant]=\"isOpen() ? itemsList?.markedItem?.htmlId : null\"\n\t\t\t\t[attr.aria-controls]=\"isOpen() ? dropdownId : null\"\n\t\t\t\t[attr.aria-expanded]=\"isOpen()\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel()\"\n\t\t\t\t[attr.id]=\"labelForId()\"\n\t\t\t\t[attr.tabindex]=\"tabIndex()\"\n\t\t\t\t[disabled]=\"disabled()\"\n\t\t\t\t[readOnly]=\"!searchable() || itemsList.maxItemsSelected\"\n\t\t\t\t[value]=\"searchTerm ?? ''\"\n\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\trole=\"combobox\" />\n\t\t</div>\n\t</div>\n\n\t@if (loading()) {\n\t\t<ng-template #defaultLoadingSpinnerTemplate>\n\t\t\t<div class=\"ng-spinner-loader\"></div>\n\t\t</ng-template>\n\t\t<ng-template [ngTemplateOutlet]=\"loadingSpinnerTemplate() || defaultLoadingSpinnerTemplate\"></ng-template>\n\t}\n\n\t@if (showClear()) {\n\t\t@if (clearButtonTemplate()) {\n\t\t\t<ng-container [ngTemplateOutlet]=\"clearButtonTemplate()\"></ng-container>\n\t\t} @else {\n\t\t\t<span\n\t\t\t\tclass=\"ng-clear-wrapper\"\n\t\t\t\trole=\"button\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[attr.tabindex]=\"tabFocusOnClear() ? 0 : -1\"\n\t\t\t\ttitle=\"{{ clearAllText() || config.clearAllText }}\"\n\t\t\t\t#clearButton\n\t\t\t\t(click)=\"handleClearClick($event)\">\n\t\t\t\t<span class=\"ng-clear\" aria-hidden=\"true\">\u00D7</span>\n\t\t\t</span>\n\t\t}\n\t}\n\n\t<span class=\"ng-arrow-wrapper\">\n\t\t<span class=\"ng-arrow\"></span>\n\t</span>\n</div>\n\n@if (isOpen()) {\n\t@let appendToValue = appendTo() || config.appendTo;\n\t<ng-dropdown-panel\n\t\tclass=\"ng-dropdown-panel\"\n\t\t[virtualScroll]=\"virtualScroll() ?? !config.disableVirtualScroll ?? false\"\n\t\t[bufferAmount]=\"bufferAmount()\"\n\t\t[appendTo]=\"appendToValue\"\n\t\t[position]=\"dropdownPosition()\"\n\t\t[headerTemplate]=\"headerTemplate()\"\n\t\t[footerTemplate]=\"footerTemplate()\"\n\t\t[filterValue]=\"searchTerm\"\n\t\t[items]=\"itemsList.filteredItems\"\n\t\t[markedItem]=\"itemsList.markedItem\"\n\t\t(update)=\"viewPortItems = $event\"\n\t\t(scroll)=\"scroll.emit($event)\"\n\t\t(scrollToEnd)=\"scrollToEnd.emit($event)\"\n\t\t(outsideClick)=\"close()\"\n\t\t[class.ng-select-multiple]=\"multiple()\"\n\t\t[class]=\"appendToValue ? (ngClass() ? ngClass() : classes) : null\"\n\t\t[id]=\"dropdownId\"\n\t\t[ariaLabelDropdown]=\"ariaLabelDropdown()\">\n\t\t<ng-container>\n\t\t\t@for (item of viewPortItems; track trackByOption($index, item)) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[attr.role]=\"item.children ? 'group' : 'option'\"\n\t\t\t\t\t(click)=\"toggleItem(item)\"\n\t\t\t\t\t(mouseover)=\"onItemHover(item)\"\n\t\t\t\t\t[class.ng-option-disabled]=\"item.disabled\"\n\t\t\t\t\t[class.ng-option-selected]=\"item.selected\"\n\t\t\t\t\t[class.ng-optgroup]=\"item.children\"\n\t\t\t\t\t[class.ng-option]=\"!item.children\"\n\t\t\t\t\t[class.ng-option-child]=\"!!item.parent\"\n\t\t\t\t\t[class.ng-option-marked]=\"item === itemsList.markedItem\"\n\t\t\t\t\t[attr.aria-selected]=\"item.selected\"\n\t\t\t\t\t[attr.id]=\"item?.htmlId\"\n\t\t\t\t\t[attr.aria-setsize]=\"itemsList.filteredItems.length\"\n\t\t\t\t\t[attr.aria-posinset]=\"item.index + 1\">\n\t\t\t\t\t<ng-template #defaultOptionTemplate>\n\t\t\t\t\t\t<span class=\"ng-option-label\" [ngItemLabel]=\"item.label\" [escape]=\"escapeHTML\"></span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"\n\t\t\t\t\t\t\titem.children ? optgroupTemplate() || defaultOptionTemplate : optionTemplate() || defaultOptionTemplate\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ item: item.value, item$: item, index: item.index, searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (showAddTag) {\n\t\t\t\t<div\n\t\t\t\t\tclass=\"ng-option\"\n\t\t\t\t\t[class.ng-option-marked]=\"!itemsList.markedItem\"\n\t\t\t\t\t(mouseover)=\"itemsList.unmarkItem()\"\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\t(click)=\"selectTag()\">\n\t\t\t\t\t<ng-template #defaultTagTemplate>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t><span class=\"ng-tag-label\">{{ addTagText() || config.addTagText }}</span\n\t\t\t\t\t\t\t>\"{{ searchTerm }}\"</span\n\t\t\t\t\t\t>\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t[ngTemplateOutlet]=\"tagTemplate() || defaultTagTemplate\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</ng-container>\n\t\t@if (showNoItemsFound()) {\n\t\t\t<ng-template #defaultNotFoundTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ notFoundText() ?? config.notFoundText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"notFoundTemplate() || defaultNotFoundTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t\t@if (showTypeToSearch()) {\n\t\t\t<ng-template #defaultTypeToSearchTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ typeToSearchText() || config.typeToSearchText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template [ngTemplateOutlet]=\"typeToSearchTemplate() || defaultTypeToSearchTemplate\"></ng-template>\n\t\t}\n\t\t@if (loading() && itemsList.filteredItems.length === 0) {\n\t\t\t<ng-template #defaultLoadingTextTemplate>\n\t\t\t\t<div class=\"ng-option ng-option-disabled\">{{ loadingText() || config.loadingText }}</div>\n\t\t\t</ng-template>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"loadingTextTemplate() || defaultLoadingTextTemplate\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ searchTerm: searchTerm }\">\n\t\t\t</ng-template>\n\t\t}\n\t</ng-dropdown-panel>\n}\n\n<!-- Always present aria-live region -->\n<div aria-atomic=\"true\" aria-live=\"polite\" class=\"ng-visually-hidden\" role=\"status\">\n\t@if (isOpen && showNoItemsFound()) {\n\t\t{{ notFoundText }}\n\t}\n</div>\n", styles: ["@charset \"UTF-8\";.ng-select{position:relative;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-value{-webkit-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder{display:none}.ng-select .ng-select-container{cursor:default;display:flex;outline:none;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:unset;user-select:unset;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;transform:translateZ(0);animation:load8 .8s infinite linear}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-option-label:empty:before{content:\"\\200b\"}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}.ng-visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0;white-space:nowrap}\n"] }]
- }], ctorParameters: () => [], propDecorators: { handleKeyDown: [{
- type: HostListener,
- args: ['keydown', ['$event']]
- }] } });
- class NgSelectModule {
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, imports: [NgDropdownPanelComponent,
- NgOptionComponent,
- NgSelectComponent,
- NgOptgroupTemplateDirective,
- NgOptionTemplateDirective,
- NgLabelTemplateDirective,
- NgMultiLabelTemplateDirective,
- NgHeaderTemplateDirective,
- NgFooterTemplateDirective,
- NgPlaceholderTemplateDirective,
- NgClearButtonTemplateDirective,
- NgNotFoundTemplateDirective,
- NgTypeToSearchTemplateDirective,
- NgLoadingTextTemplateDirective,
- NgTagTemplateDirective,
- NgLoadingSpinnerTemplateDirective,
- NgItemLabelDirective], exports: [NgSelectComponent,
- NgOptionComponent,
- NgOptgroupTemplateDirective,
- NgOptionTemplateDirective,
- NgLabelTemplateDirective,
- NgMultiLabelTemplateDirective,
- NgHeaderTemplateDirective,
- NgFooterTemplateDirective,
- NgPlaceholderTemplateDirective,
- NgNotFoundTemplateDirective,
- NgTypeToSearchTemplateDirective,
- NgLoadingTextTemplateDirective,
- NgTagTemplateDirective,
- NgLoadingSpinnerTemplateDirective,
- NgClearButtonTemplateDirective] }); }
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, providers: provideNgSelect() }); }
- }
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgSelectModule, decorators: [{
- type: NgModule,
- args: [{
- imports: [
- NgDropdownPanelComponent,
- NgOptionComponent,
- NgSelectComponent,
- NgOptgroupTemplateDirective,
- NgOptionTemplateDirective,
- NgLabelTemplateDirective,
- NgMultiLabelTemplateDirective,
- NgHeaderTemplateDirective,
- NgFooterTemplateDirective,
- NgPlaceholderTemplateDirective,
- NgClearButtonTemplateDirective,
- NgNotFoundTemplateDirective,
- NgTypeToSearchTemplateDirective,
- NgLoadingTextTemplateDirective,
- NgTagTemplateDirective,
- NgLoadingSpinnerTemplateDirective,
- NgItemLabelDirective,
- ],
- exports: [
- NgSelectComponent,
- NgOptionComponent,
- NgOptgroupTemplateDirective,
- NgOptionTemplateDirective,
- NgLabelTemplateDirective,
- NgMultiLabelTemplateDirective,
- NgHeaderTemplateDirective,
- NgFooterTemplateDirective,
- NgPlaceholderTemplateDirective,
- NgNotFoundTemplateDirective,
- NgTypeToSearchTemplateDirective,
- NgLoadingTextTemplateDirective,
- NgTagTemplateDirective,
- NgLoadingSpinnerTemplateDirective,
- NgClearButtonTemplateDirective
- ],
- providers: provideNgSelect(),
- }]
- }] });
- function provideNgSelect() {
- return [
- {
- provide: SELECTION_MODEL_FACTORY,
- useValue: DefaultSelectionModelFactory,
- },
- ];
- }
- /*
- * Public API Surface of ng-select
- */
- /**
- * Generated bundle index. Do not edit.
- */
- export { ConsoleService, DefaultSelectionModel, DefaultSelectionModelFactory, NgClearButtonTemplateDirective, NgDropdownPanelComponent, NgDropdownPanelService, NgFooterTemplateDirective, NgHeaderTemplateDirective, NgItemLabelDirective, NgLabelTemplateDirective, NgLoadingSpinnerTemplateDirective, NgLoadingTextTemplateDirective, NgMultiLabelTemplateDirective, NgNotFoundTemplateDirective, NgOptgroupTemplateDirective, NgOptionComponent, NgOptionTemplateDirective, NgPlaceholderTemplateDirective, NgSelectComponent, NgSelectConfig, NgSelectModule, NgTagTemplateDirective, NgTypeToSearchTemplateDirective, SELECTION_MODEL_FACTORY };
- //# sourceMappingURL=ng-select-ng-select.mjs.map
|