@taiga-ui/core 2.64.0 → 2.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/taiga-ui-core-components-data-list.umd.js +1 -1
- package/bundles/taiga-ui-core-components-data-list.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-data-list.umd.min.js.map +1 -1
- package/components/data-list/taiga-ui-core-components-data-list.metadata.json +1 -1
- package/constants/version.d.ts +1 -1
- package/esm2015/components/data-list/data-list.component.js +1 -1
- package/esm5/components/data-list/data-list.component.js +1 -1
- package/fesm2015/taiga-ui-core-components-data-list.js +1 -1
- package/fesm5/taiga-ui-core-components-data-list.js +1 -1
- package/package.json +4 -4
- package/styles/basic/main.less +13 -0
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
useExisting: core.forwardRef(function () { return TuiDataListComponent_1; }),
|
|
465
465
|
},
|
|
466
466
|
],
|
|
467
|
-
styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02)}tui-opt-group:not(:empty)~tui-opt-group:before{padding
|
|
467
|
+
styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02);line-height:1rem;white-space:normal}tui-opt-group:not(:empty)~tui-opt-group:before{padding:1.5rem 1rem .5rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.5rem;height:1px;background:var(--tui-base-03)}"]
|
|
468
468
|
}),
|
|
469
469
|
__param(0, core.Inject(core.ElementRef)),
|
|
470
470
|
__param(1, core.Inject(tokens.TUI_NOTHING_FOUND_MESSAGE))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@taiga-ui/cdk"),require("@taiga-ui/core/tokens"),require("rxjs"),require("rxjs/operators"),require("@taiga-ui/core/directives/dropdown"),require("@tinkoff/ng-event-plugins"),require("@angular/common"),require("@taiga-ui/core/components/svg"),require("@tinkoff/ng-polymorpheus")):"function"==typeof define&&define.amd?define("@taiga-ui/core/components/data-list",["exports","@angular/core","@taiga-ui/cdk","@taiga-ui/core/tokens","rxjs","rxjs/operators","@taiga-ui/core/directives/dropdown","@tinkoff/ng-event-plugins","@angular/common","@taiga-ui/core/components/svg","@tinkoff/ng-polymorpheus"],t):t(((e=e||self)["taiga-ui"]=e["taiga-ui"]||{},e["taiga-ui"].core=e["taiga-ui"].core||{},e["taiga-ui"].core.components=e["taiga-ui"].core.components||{},e["taiga-ui"].core.components["data-list"]={}),e.ng.core,e.cdk,e["taiga-ui"].core.tokens,e.rxjs,e.rxjs.operators,e["taiga-ui"].core.directives.dropdown,e.ngEventPlugins,e.ng.common,e["taiga-ui"].core.components.svg,e.ngPolymorpheus)}(this,(function(e,t,n,o,r,i,a,u,s,p,c){"use strict";function l(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function d(e,t){return function(n,o){t(n,o,e)}}Object.create;function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}Object.create;function g(e){var t=e.currentTarget;return!n.isNativeFocused(t)}var y=function(){function e(e,t,n,o,r){this.content=e,this.dataList=t,this.elementRef=n,this.host=o,this.dropdown=r,this.size="m",this.role="option",this.disabled=!1}return Object.defineProperty(e.prototype,"active",{get:function(){return!!this.dropdown&&!!this.dropdown.dropdownBoxRef},enumerable:!0,configurable:!0}),e.prototype.onClick=function(){this.host&&void 0!==this.value&&this.host.handleOption(this.value)},e.prototype.onMouseMove=function(e){var t=e.currentTarget;n.setNativeFocused(t,!0,!0)},e.prototype.ngOnDestroy=function(){this.dataList.handleFocusLossIfNecessary(this.elementRef.nativeElement)},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[o.TUI_OPTION_CONTENT]}]},{type:v,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return v}))]}]},{type:t.ElementRef,decorators:[{type:t.Inject,args:[t.ElementRef]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[o.TUI_DATA_LIST_HOST]}]},{type:a.TuiDropdownDirective,decorators:[{type:t.Optional},{type:t.Self},{type:t.Inject,args:[a.TuiDropdownDirective]}]}]},l([t.Input(),t.HostBinding("attr.data-size"),n.tuiDefaultProp()],e.prototype,"size",void 0),l([t.Input(),t.HostBinding("attr.role"),n.tuiDefaultProp()],e.prototype,"role",void 0),l([t.Input(),n.tuiDefaultProp()],e.prototype,"disabled",void 0),l([t.Input()],e.prototype,"value",void 0),l([t.HostBinding("class._with-dropdown")],e.prototype,"active",null),l([t.HostListener("click")],e.prototype,"onClick",null),l([u.shouldCall(g),t.HostListener("mousemove.init",["$event"]),t.HostListener("mousemove.silent",["$event"])],e.prototype,"onMouseMove",null),e=l([t.Component({selector:"button[tuiOption], a[tuiOption]",template:'<span\n *ngIf="content; else base"\n polymorpheus-outlet\n class="t-content"\n [content]="content"\n [context]="{$implicit: base}"\n></span>\n<ng-template #base>\n <ng-content></ng-content>\n <tui-svg\n *ngIf="dropdown"\n src="tuiIconChevronRight"\n class="t-arrow"\n ></tui-svg>\n</ng-template>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,host:{tabIndex:"-1",type:"button","[attr.disabled]":"disabled || null"},styles:[":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:padding-box;font-size:inherit;line-height:inherit;transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;font:var(--tui-font-text-m);width:100%;align-items:center;justify-content:space-between;text-align:left;box-sizing:border-box;color:var(--tui-text-01);outline:0;text-decoration:none;cursor:pointer}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:default}:host._with-dropdown,:host:focus{background-color:var(--tui-base-02)}:host[data-size=xs]{font:var(--tui-font-text-s);min-height:2rem;padding:.3125rem .75rem}:host[data-size='s']{min-height:2rem;padding:.3125rem .75rem}:host[data-size='m']{min-height:2.75rem;padding:.375rem 1rem}:host[data-size='l']{min-height:3.5rem;padding:.75rem 1rem}.t-content{display:flex;flex:1;max-width:100%}.t-arrow{margin:0 -.5rem 0 .75rem}"]}),d(0,t.Optional()),d(0,t.Inject(o.TUI_OPTION_CONTENT)),d(1,t.Inject(t.forwardRef((function(){return v})))),d(2,t.Inject(t.ElementRef)),d(3,t.Optional()),d(3,t.Inject(o.TUI_DATA_LIST_HOST)),d(4,t.Optional()),d(4,t.Self()),d(4,t.Inject(a.TuiDropdownDirective))],e)}(),v=function(){function e(e,t){this.elementRef=e,this.defaultEmptyContent$=t,this.options=n.EMPTY_QUERY,this.role="listbox",this.emptyContent=""}var a;return a=e,Object.defineProperty(e.prototype,"empty$",{get:function(){return n.itemsQueryListObservable(this.options).pipe(i.map((function(e){return!e.length})))},enumerable:!0,configurable:!0}),e.prototype.onFocusIn=function(e,t){t.contains(e)||this.origin||(this.origin=e)},e.prototype.noop=function(){},e.prototype.onKeyDownArrow=function(e,t){var o=this.elements;n.moveFocus(o.indexOf(e),o,t)},e.prototype.handleFocusLossIfNecessary=function(e){void 0===e&&(e=this.elementRef.nativeElement),this.origin&&n.isNativeFocusedIn(e)&&n.setNativeMouseFocused(this.origin,!0,!0)},e.prototype.getOptions=function(e){return void 0===e&&(e=!1),this.options.toArray().filter((function(t){var n=t.disabled;return e||!n})).map((function(e){return e.value})).filter(n.isPresent)},e.prototype.onFocus=function(e,t){var o=e.target;n.tuiAssertIsHTMLElement(o);var r=this.elements;n.moveFocus(t?-1:r.length,r,t?1:-1),this.handleFocusLossIfNecessary(o)},Object.defineProperty(e.prototype,"elements",{get:function(){return Array.from(this.elementRef.nativeElement.querySelectorAll("[tuiOption]"))},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:t.ElementRef,decorators:[{type:t.Inject,args:[t.ElementRef]}]},{type:r.Observable,decorators:[{type:t.Inject,args:[o.TUI_NOTHING_FOUND_MESSAGE]}]}]},l([t.ContentChildren(t.forwardRef((function(){return y})),{descendants:!0})],e.prototype,"options",void 0),l([t.Input(),t.HostBinding("attr.role"),n.tuiDefaultProp()],e.prototype,"role",void 0),l([t.Input(),n.tuiDefaultProp()],e.prototype,"emptyContent",void 0),l([n.tuiPure],e.prototype,"empty$",null),l([t.HostListener("focusin",["$event.relatedTarget","$event.currentTarget"])],e.prototype,"onFocusIn",null),l([t.HostListener("mousedown.prevent")],e.prototype,"noop",null),l([t.HostListener("keydown.arrowDown.prevent",["$event.target","1"]),t.HostListener("keydown.arrowUp.prevent",["$event.target","-1"])],e.prototype,"onKeyDownArrow",null),l([t.HostListener("wheel.silent.passive"),t.HostListener("mouseleave",["$event.target"])],e.prototype,"handleFocusLossIfNecessary",null),e=a=l([t.Component({selector:"tui-data-list",template:'<div\n tabindex="0"\n class="t-trap"\n (focusin)="onFocus($event, true)"\n></div>\n<ng-content></ng-content>\n<div\n *ngIf="empty$ | async"\n polymorpheus-outlet\n class="t-empty"\n [content]="emptyContent || (defaultEmptyContent$ | async)"\n></div>\n<div\n tabindex="0"\n class="t-trap"\n (focusin)="onFocus($event, false)"\n></div>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,providers:[{provide:o.TUI_DATA_LIST_ACCESSOR,useExisting:t.forwardRef((function(){return a}))}],styles:["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-top:1rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.5rem;height:1px;background:var(--tui-base-03)}"]}),d(0,t.Inject(t.ElementRef)),d(1,t.Inject(o.TUI_NOTHING_FOUND_MESSAGE))],e)}(),h=function(){function e(){}return e=l([t.Directive({selector:"ng-template[tuiDataList]"})],e)}(),b=function(){function e(){this.dropdowns=n.EMPTY_QUERY,this.elements=n.EMPTY_QUERY}return e.prototype.ngAfterViewInit=function(){var e=this;this.right$.subscribe((function(t){e.tryToFocus(t)})),r.merge(this.immediate$,this.debounce$).pipe(i.switchMap((function(t){e.dropdowns.forEach((function(e,n){e.open=n===t}));var o=e.elements.toArray()[t],a=e.dropdowns.toArray()[t];if(!o||!a||!a.dropdownBoxRef)return r.EMPTY;var u=a.dropdownBoxRef.location.nativeElement,s=n.typedFromEvent(u,"mouseenter").pipe(i.take(1)),p=r.merge(n.typedFromEvent(o.nativeElement,"keydown"),n.typedFromEvent(u,"keydown")).pipe(i.filter((function(e){return 27===e.keyCode})));return r.merge(s,p).pipe(i.tap((function(e){a.dropdownBoxRef&&e.stopPropagation(),n.setNativeFocused(o.nativeElement),a.open=e instanceof MouseEvent})))}))).subscribe()},Object.defineProperty(e.prototype,"elements$",{get:function(){return n.itemsQueryListObservable(this.elements).pipe(i.map((function(e){return e.map((function(e){return e.nativeElement}))})),i.shareReplay({bufferSize:1,refCount:!0}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right$",{get:function(){return this.elements$.pipe(i.switchMap((function(e){return r.merge.apply(void 0,m(e.map((function(e,t){return n.typedFromEvent(e,"keydown").pipe(i.filter((function(e){return 39===e.keyCode})),n.preventDefault(),i.mapTo(t))}))))})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"immediate$",{get:function(){return this.elements$.pipe(i.switchMap((function(e){return r.merge.apply(void 0,m(e.map((function(e,t){return n.typedFromEvent(e,"click").pipe(i.mapTo(t))}))))})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"debounce$",{get:function(){var e=this;return this.elements$.pipe(i.switchMap((function(t){return r.merge.apply(void 0,m(t.map((function(t,o){return r.merge(n.typedFromEvent(t,"focus"),n.typedFromEvent(t,"blur")).pipe(i.filter((function(t){var n=t.relatedTarget;return e.notInDropdown(n,o)})),i.map((function(e){return"focus"===e.type?o:NaN})))}))))})),i.debounceTime(300))},enumerable:!0,configurable:!0}),e.prototype.notInDropdown=function(e,t){var n=this.dropdowns.toArray()[t];return!n||!n.dropdownBoxRef||!n.dropdownBoxRef.location.nativeElement.contains(e)},e.prototype.tryToFocus=function(e){var t,o=this.dropdowns.toArray()[e],r=null===(t=null==o?void 0:o.dropdownBoxRef)||void 0===t?void 0:t.instance.contentElementRef;if(r){var i=n.getClosestKeyboardFocusable(r.nativeElement,!1,r.nativeElement);i&&n.setNativeFocused(i)}},l([t.ContentChildren(a.TuiDropdownDirective,{descendants:!0})],e.prototype,"dropdowns",void 0),l([t.ContentChildren(a.TuiDropdownDirective,{read:t.ElementRef,descendants:!0})],e.prototype,"elements",void 0),l([n.tuiPure],e.prototype,"elements$",null),l([n.tuiPure],e.prototype,"right$",null),l([n.tuiPure],e.prototype,"immediate$",null),l([n.tuiPure],e.prototype,"debounce$",null),e=l([t.Directive({selector:"tui-data-list[tuiDataListDropdownManager]"})],e)}(),w=function(){function e(){this.label=""}return l([t.Input(),t.HostBinding("attr.data-label"),n.tuiDefaultProp()],e.prototype,"label",void 0),e=l([t.Directive({selector:"tui-opt-group",host:{role:"group"}})],e)}(),I=function(){function e(){}return e=l([t.NgModule({imports:[s.CommonModule,p.TuiSvgModule,c.PolymorpheusModule],declarations:[v,y,w,h,b],exports:[v,y,w,h,b]})],e)}();e.TuiDataListComponent=v,e.TuiDataListDirective=h,e.TuiDataListDropdownManagerDirective=b,e.TuiDataListModule=I,e.TuiOptGroupDirective=w,e.TuiOptionComponent=y,e.shouldFocus=g,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@taiga-ui/cdk"),require("@taiga-ui/core/tokens"),require("rxjs"),require("rxjs/operators"),require("@taiga-ui/core/directives/dropdown"),require("@tinkoff/ng-event-plugins"),require("@angular/common"),require("@taiga-ui/core/components/svg"),require("@tinkoff/ng-polymorpheus")):"function"==typeof define&&define.amd?define("@taiga-ui/core/components/data-list",["exports","@angular/core","@taiga-ui/cdk","@taiga-ui/core/tokens","rxjs","rxjs/operators","@taiga-ui/core/directives/dropdown","@tinkoff/ng-event-plugins","@angular/common","@taiga-ui/core/components/svg","@tinkoff/ng-polymorpheus"],t):t(((e=e||self)["taiga-ui"]=e["taiga-ui"]||{},e["taiga-ui"].core=e["taiga-ui"].core||{},e["taiga-ui"].core.components=e["taiga-ui"].core.components||{},e["taiga-ui"].core.components["data-list"]={}),e.ng.core,e.cdk,e["taiga-ui"].core.tokens,e.rxjs,e.rxjs.operators,e["taiga-ui"].core.directives.dropdown,e.ngEventPlugins,e.ng.common,e["taiga-ui"].core.components.svg,e.ngPolymorpheus)}(this,(function(e,t,n,o,r,i,a,s,u,p,c){"use strict";function l(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function d(e,t){return function(n,o){t(n,o,e)}}Object.create;function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}Object.create;function g(e){var t=e.currentTarget;return!n.isNativeFocused(t)}var y=function(){function e(e,t,n,o,r){this.content=e,this.dataList=t,this.elementRef=n,this.host=o,this.dropdown=r,this.size="m",this.role="option",this.disabled=!1}return Object.defineProperty(e.prototype,"active",{get:function(){return!!this.dropdown&&!!this.dropdown.dropdownBoxRef},enumerable:!0,configurable:!0}),e.prototype.onClick=function(){this.host&&void 0!==this.value&&this.host.handleOption(this.value)},e.prototype.onMouseMove=function(e){var t=e.currentTarget;n.setNativeFocused(t,!0,!0)},e.prototype.ngOnDestroy=function(){this.dataList.handleFocusLossIfNecessary(this.elementRef.nativeElement)},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[o.TUI_OPTION_CONTENT]}]},{type:v,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return v}))]}]},{type:t.ElementRef,decorators:[{type:t.Inject,args:[t.ElementRef]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[o.TUI_DATA_LIST_HOST]}]},{type:a.TuiDropdownDirective,decorators:[{type:t.Optional},{type:t.Self},{type:t.Inject,args:[a.TuiDropdownDirective]}]}]},l([t.Input(),t.HostBinding("attr.data-size"),n.tuiDefaultProp()],e.prototype,"size",void 0),l([t.Input(),t.HostBinding("attr.role"),n.tuiDefaultProp()],e.prototype,"role",void 0),l([t.Input(),n.tuiDefaultProp()],e.prototype,"disabled",void 0),l([t.Input()],e.prototype,"value",void 0),l([t.HostBinding("class._with-dropdown")],e.prototype,"active",null),l([t.HostListener("click")],e.prototype,"onClick",null),l([s.shouldCall(g),t.HostListener("mousemove.init",["$event"]),t.HostListener("mousemove.silent",["$event"])],e.prototype,"onMouseMove",null),e=l([t.Component({selector:"button[tuiOption], a[tuiOption]",template:'<span\n *ngIf="content; else base"\n polymorpheus-outlet\n class="t-content"\n [content]="content"\n [context]="{$implicit: base}"\n></span>\n<ng-template #base>\n <ng-content></ng-content>\n <tui-svg\n *ngIf="dropdown"\n src="tuiIconChevronRight"\n class="t-arrow"\n ></tui-svg>\n</ng-template>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,host:{tabIndex:"-1",type:"button","[attr.disabled]":"disabled || null"},styles:[":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:padding-box;font-size:inherit;line-height:inherit;transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;font:var(--tui-font-text-m);width:100%;align-items:center;justify-content:space-between;text-align:left;box-sizing:border-box;color:var(--tui-text-01);outline:0;text-decoration:none;cursor:pointer}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:default}:host._with-dropdown,:host:focus{background-color:var(--tui-base-02)}:host[data-size=xs]{font:var(--tui-font-text-s);min-height:2rem;padding:.3125rem .75rem}:host[data-size='s']{min-height:2rem;padding:.3125rem .75rem}:host[data-size='m']{min-height:2.75rem;padding:.375rem 1rem}:host[data-size='l']{min-height:3.5rem;padding:.75rem 1rem}.t-content{display:flex;flex:1;max-width:100%}.t-arrow{margin:0 -.5rem 0 .75rem}"]}),d(0,t.Optional()),d(0,t.Inject(o.TUI_OPTION_CONTENT)),d(1,t.Inject(t.forwardRef((function(){return v})))),d(2,t.Inject(t.ElementRef)),d(3,t.Optional()),d(3,t.Inject(o.TUI_DATA_LIST_HOST)),d(4,t.Optional()),d(4,t.Self()),d(4,t.Inject(a.TuiDropdownDirective))],e)}(),v=function(){function e(e,t){this.elementRef=e,this.defaultEmptyContent$=t,this.options=n.EMPTY_QUERY,this.role="listbox",this.emptyContent=""}var a;return a=e,Object.defineProperty(e.prototype,"empty$",{get:function(){return n.itemsQueryListObservable(this.options).pipe(i.map((function(e){return!e.length})))},enumerable:!0,configurable:!0}),e.prototype.onFocusIn=function(e,t){t.contains(e)||this.origin||(this.origin=e)},e.prototype.noop=function(){},e.prototype.onKeyDownArrow=function(e,t){var o=this.elements;n.moveFocus(o.indexOf(e),o,t)},e.prototype.handleFocusLossIfNecessary=function(e){void 0===e&&(e=this.elementRef.nativeElement),this.origin&&n.isNativeFocusedIn(e)&&n.setNativeMouseFocused(this.origin,!0,!0)},e.prototype.getOptions=function(e){return void 0===e&&(e=!1),this.options.toArray().filter((function(t){var n=t.disabled;return e||!n})).map((function(e){return e.value})).filter(n.isPresent)},e.prototype.onFocus=function(e,t){var o=e.target;n.tuiAssertIsHTMLElement(o);var r=this.elements;n.moveFocus(t?-1:r.length,r,t?1:-1),this.handleFocusLossIfNecessary(o)},Object.defineProperty(e.prototype,"elements",{get:function(){return Array.from(this.elementRef.nativeElement.querySelectorAll("[tuiOption]"))},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:t.ElementRef,decorators:[{type:t.Inject,args:[t.ElementRef]}]},{type:r.Observable,decorators:[{type:t.Inject,args:[o.TUI_NOTHING_FOUND_MESSAGE]}]}]},l([t.ContentChildren(t.forwardRef((function(){return y})),{descendants:!0})],e.prototype,"options",void 0),l([t.Input(),t.HostBinding("attr.role"),n.tuiDefaultProp()],e.prototype,"role",void 0),l([t.Input(),n.tuiDefaultProp()],e.prototype,"emptyContent",void 0),l([n.tuiPure],e.prototype,"empty$",null),l([t.HostListener("focusin",["$event.relatedTarget","$event.currentTarget"])],e.prototype,"onFocusIn",null),l([t.HostListener("mousedown.prevent")],e.prototype,"noop",null),l([t.HostListener("keydown.arrowDown.prevent",["$event.target","1"]),t.HostListener("keydown.arrowUp.prevent",["$event.target","-1"])],e.prototype,"onKeyDownArrow",null),l([t.HostListener("wheel.silent.passive"),t.HostListener("mouseleave",["$event.target"])],e.prototype,"handleFocusLossIfNecessary",null),e=a=l([t.Component({selector:"tui-data-list",template:'<div\n tabindex="0"\n class="t-trap"\n (focusin)="onFocus($event, true)"\n></div>\n<ng-content></ng-content>\n<div\n *ngIf="empty$ | async"\n polymorpheus-outlet\n class="t-empty"\n [content]="emptyContent || (defaultEmptyContent$ | async)"\n></div>\n<div\n tabindex="0"\n class="t-trap"\n (focusin)="onFocus($event, false)"\n></div>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,providers:[{provide:o.TUI_DATA_LIST_ACCESSOR,useExisting:t.forwardRef((function(){return a}))}],styles:["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02);line-height:1rem;white-space:normal}tui-opt-group:not(:empty)~tui-opt-group:before{padding:1.5rem 1rem .5rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.5rem;height:1px;background:var(--tui-base-03)}"]}),d(0,t.Inject(t.ElementRef)),d(1,t.Inject(o.TUI_NOTHING_FOUND_MESSAGE))],e)}(),h=function(){function e(){}return e=l([t.Directive({selector:"ng-template[tuiDataList]"})],e)}(),b=function(){function e(){this.dropdowns=n.EMPTY_QUERY,this.elements=n.EMPTY_QUERY}return e.prototype.ngAfterViewInit=function(){var e=this;this.right$.subscribe((function(t){e.tryToFocus(t)})),r.merge(this.immediate$,this.debounce$).pipe(i.switchMap((function(t){e.dropdowns.forEach((function(e,n){e.open=n===t}));var o=e.elements.toArray()[t],a=e.dropdowns.toArray()[t];if(!o||!a||!a.dropdownBoxRef)return r.EMPTY;var s=a.dropdownBoxRef.location.nativeElement,u=n.typedFromEvent(s,"mouseenter").pipe(i.take(1)),p=r.merge(n.typedFromEvent(o.nativeElement,"keydown"),n.typedFromEvent(s,"keydown")).pipe(i.filter((function(e){return 27===e.keyCode})));return r.merge(u,p).pipe(i.tap((function(e){a.dropdownBoxRef&&e.stopPropagation(),n.setNativeFocused(o.nativeElement),a.open=e instanceof MouseEvent})))}))).subscribe()},Object.defineProperty(e.prototype,"elements$",{get:function(){return n.itemsQueryListObservable(this.elements).pipe(i.map((function(e){return e.map((function(e){return e.nativeElement}))})),i.shareReplay({bufferSize:1,refCount:!0}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right$",{get:function(){return this.elements$.pipe(i.switchMap((function(e){return r.merge.apply(void 0,m(e.map((function(e,t){return n.typedFromEvent(e,"keydown").pipe(i.filter((function(e){return 39===e.keyCode})),n.preventDefault(),i.mapTo(t))}))))})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"immediate$",{get:function(){return this.elements$.pipe(i.switchMap((function(e){return r.merge.apply(void 0,m(e.map((function(e,t){return n.typedFromEvent(e,"click").pipe(i.mapTo(t))}))))})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"debounce$",{get:function(){var e=this;return this.elements$.pipe(i.switchMap((function(t){return r.merge.apply(void 0,m(t.map((function(t,o){return r.merge(n.typedFromEvent(t,"focus"),n.typedFromEvent(t,"blur")).pipe(i.filter((function(t){var n=t.relatedTarget;return e.notInDropdown(n,o)})),i.map((function(e){return"focus"===e.type?o:NaN})))}))))})),i.debounceTime(300))},enumerable:!0,configurable:!0}),e.prototype.notInDropdown=function(e,t){var n=this.dropdowns.toArray()[t];return!n||!n.dropdownBoxRef||!n.dropdownBoxRef.location.nativeElement.contains(e)},e.prototype.tryToFocus=function(e){var t,o=this.dropdowns.toArray()[e],r=null===(t=null==o?void 0:o.dropdownBoxRef)||void 0===t?void 0:t.instance.contentElementRef;if(r){var i=n.getClosestKeyboardFocusable(r.nativeElement,!1,r.nativeElement);i&&n.setNativeFocused(i)}},l([t.ContentChildren(a.TuiDropdownDirective,{descendants:!0})],e.prototype,"dropdowns",void 0),l([t.ContentChildren(a.TuiDropdownDirective,{read:t.ElementRef,descendants:!0})],e.prototype,"elements",void 0),l([n.tuiPure],e.prototype,"elements$",null),l([n.tuiPure],e.prototype,"right$",null),l([n.tuiPure],e.prototype,"immediate$",null),l([n.tuiPure],e.prototype,"debounce$",null),e=l([t.Directive({selector:"tui-data-list[tuiDataListDropdownManager]"})],e)}(),w=function(){function e(){this.label=""}return l([t.Input(),t.HostBinding("attr.data-label"),n.tuiDefaultProp()],e.prototype,"label",void 0),e=l([t.Directive({selector:"tui-opt-group",host:{role:"group"}})],e)}(),I=function(){function e(){}return e=l([t.NgModule({imports:[u.CommonModule,p.TuiSvgModule,c.PolymorpheusModule],declarations:[v,y,w,h,b],exports:[v,y,w,h,b]})],e)}();e.TuiDataListComponent=v,e.TuiDataListDirective=h,e.TuiDataListDropdownManagerDirective=b,e.TuiDataListModule=I,e.TuiOptGroupDirective=w,e.TuiOptionComponent=y,e.shouldFocus=g,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=taiga-ui-core-components-data-list.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/tslib/tslib.es6.js","ng://@taiga-ui/core/components/data-list/option/option.component.ts","ng://@taiga-ui/core/components/data-list/data-list.component.ts","ng://@taiga-ui/core/components/data-list/data-list.directive.ts","ng://@taiga-ui/core/components/data-list/data-list-dropdown-manager.directive.ts","ng://@taiga-ui/core/components/data-list/opt-group.directive.ts","ng://@taiga-ui/core/components/data-list/data-list.module.ts"],"names":["__decorate","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","__param","paramIndex","decorator","create","__read","o","n","m","Symbol","iterator","e","call","ar","next","done","push","value","error","__spread","concat","shouldFocus","_a","currentTarget","isNativeFocused","TuiOptionComponent","content","dataList","elementRef","host","dropdown","this","size","role","disabled","prototype","dropdownBoxRef","onClick","undefined","handleOption","onMouseMove","setNativeFocused","ngOnDestroy","handleFocusLossIfNecessary","nativeElement","Optional","type","Inject","args","TUI_OPTION_CONTENT","TuiDataListComponent","forwardRef","ElementRef","TUI_DATA_LIST_HOST","TuiDropdownDirective","Self","Input","HostBinding","tuiDefaultProp","HostListener","shouldCall","Component","selector","template","changeDetection","ChangeDetectionStrategy","OnPush","tabIndex","[attr.disabled]","defaultEmptyContent$","options","EMPTY_QUERY","emptyContent","itemsQueryListObservable","pipe","map","onFocusIn","relatedTarget","contains","origin","noop","onKeyDownArrow","current","step","elements","moveFocus","indexOf","element","isNativeFocusedIn","setNativeMouseFocused","getOptions","includeDisabled","toArray","filter","isPresent","onFocus","top","tuiAssertIsHTMLElement","Array","from","querySelectorAll","Observable","TUI_NOTHING_FOUND_MESSAGE","ContentChildren","descendants","tuiPure","TuiDataListComponent_1","encapsulation","ViewEncapsulation","None","providers","provide","TUI_DATA_LIST_ACCESSOR","useExisting","TuiDataListDirective","Directive","TuiDataListDropdownManagerDirective","dropdowns","ngAfterViewInit","_this","right$","subscribe","index","tryToFocus","merge","immediate$","debounce$","switchMap","active","forEach","open","EMPTY","location","mouseEnter$","typedFromEvent","take","esc$","keyCode","tap","event","stopPropagation","MouseEvent","array","shareReplay","bufferSize","refCount","elements$","apply","preventDefault","mapTo","notInDropdown","NaN","debounceTime","instance","contentElementRef","item","getClosestKeyboardFocusable","read","TuiOptGroupDirective","label","TuiDataListModule","NgModule","imports","CommonModule","TuiSvgModule","PolymorpheusModule","declarations","exports"],"mappings":"2nCAsDO,SAASA,EAAWC,EAAYC,EAAQC,EAAKC,GAChD,IAA2HC,EAAvHC,EAAIC,UAAUC,OAAQC,EAAIH,EAAI,EAAIJ,EAAkB,OAATE,EAAgBA,EAAOM,OAAOC,yBAAyBT,EAAQC,GAAOC,EACrH,GAAuB,iBAAZQ,SAAoD,mBAArBA,QAAQC,SAAyBJ,EAAIG,QAAQC,SAASZ,EAAYC,EAAQC,EAAKC,QACpH,IAAK,IAAIU,EAAIb,EAAWO,OAAS,EAAGM,GAAK,EAAGA,KAAST,EAAIJ,EAAWa,MAAIL,GAAKH,EAAI,EAAID,EAAEI,GAAKH,EAAI,EAAID,EAAEH,EAAQC,EAAKM,GAAKJ,EAAEH,EAAQC,KAASM,GAChJ,OAAOH,EAAI,GAAKG,GAAKC,OAAOK,eAAeb,EAAQC,EAAKM,GAAIA,EAGzD,SAASO,EAAQC,EAAYC,GAChC,OAAO,SAAUhB,EAAQC,GAAOe,EAAUhB,EAAQC,EAAKc,IA6C9BP,OAAOS,OA4B7B,SAASC,EAAOC,EAAGC,GACtB,IAAIC,EAAsB,mBAAXC,QAAyBH,EAAEG,OAAOC,UACjD,IAAKF,EAAG,OAAOF,EACf,IAAmBZ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AASM,iBACTN,EAASM,eAAegG,SAASxF,cAAckC,SAASS,IAIzD6B,EAAAjF,UAAAwF,WAAR,SAAmBD,SACT5F,EAAWC,KAAKsF,UAAUzB,UAAU8B,GACpChG,EAAkC,QAA3BJ,EAAGQ,MAAAA,OAAQ,EAARA,EAAUM,sBAAc,IAAAd,OAAA,EAAAA,EAAEmI,SAASC,kBAEnD,GAAKhI,EAAL,CAIA,IAAMiI,EAAOC,EAAAA,4BACTlI,EAAQkB,eACR,EACAlB,EAAQkB,eAGR+G,GACAlH,EAAAA,iBAAiBkH,KAtIzB1K,EAAA,CADCsH,EAAAA,gBAAgBjD,EAAAA,qBAAsB,CAACkD,aAAa,qCAIrDvH,EAAA,CADCsH,EAAAA,gBAAgBjD,EAAAA,qBAAsB,CAACuG,KAAMzG,EAAAA,WAAYoD,aAAa,oCAgDvEvH,EAAA,CADCwH,EAAAA,uCASDxH,EAAA,CADCwH,EAAAA,oCAkBDxH,EAAA,CADCwH,EAAAA,wCAcDxH,EAAA,CADCwH,EAAAA,uCAzFQW,EAAmCnI,EAAA,CAH/CkI,EAAAA,UAAU,CACPrD,SAAU,+CAEDsD,mBCxBb,SAAA0C,IAII/H,KAAAgI,MAAQ,GACZ,OADI9K,EAAA,CAHCuE,EAAAA,QACAC,EAAAA,YAAY,mBACZC,EAAAA,8CAHQoG,EAAoB7K,EAAA,CANhCkI,EAAAA,UAAU,CACPrD,SAAU,gBACVjC,KAAM,CACFI,KAAM,YAGD6H,mBCmBb,SAAAE,KAAgC,OAAnBA,EAAiB/K,EAAA,CAjB7BgL,EAAAA,SAAS,CACNC,QAAS,CAACC,EAAAA,aAAcC,EAAAA,aAAcC,EAAAA,oBACtCC,aAAc,CACVpH,EACAzB,EACAqI,EACA5C,EACAE,GAEJmD,QAAS,CACLrH,EACAzB,EACAqI,EACA5C,EACAE,MAGK4C","sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n OnDestroy,\n Optional,\n Self,\n TemplateRef,\n} from '@angular/core';\nimport {\n isNativeFocused,\n setNativeFocused,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiEventWith,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {TuiDataListHost} from '@taiga-ui/core/interfaces';\nimport {TUI_DATA_LIST_HOST, TUI_OPTION_CONTENT} from '@taiga-ui/core/tokens';\nimport {TuiOptionRole, TuiSizeL, TuiSizeXS} from '@taiga-ui/core/types';\nimport {shouldCall} from '@tinkoff/ng-event-plugins';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDataListComponent} from '../data-list.component';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function shouldFocus({\n currentTarget,\n}: TuiEventWith<MouseEvent, HTMLElement>): boolean {\n return !isNativeFocused(currentTarget);\n}\n\n// TODO: Consider all use cases for aria roles\n@Component({\n selector: `button[tuiOption], a[tuiOption]`,\n templateUrl: `./option.template.html`,\n styleUrls: [`./option.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n tabIndex: `-1`,\n type: `button`,\n '[attr.disabled]': `disabled || null`,\n },\n})\nexport class TuiOptionComponent<T = unknown> implements OnDestroy {\n @Input()\n @HostBinding(`attr.data-size`)\n @tuiDefaultProp()\n size: TuiSizeXS | TuiSizeL = `m`;\n\n @Input()\n @HostBinding(`attr.role`)\n @tuiDefaultProp()\n role: TuiOptionRole = `option`;\n\n @Input()\n @tuiDefaultProp()\n disabled = false;\n\n @Input()\n value?: T;\n\n // TODO: 3.0 Fix dataList type when updated to Ivy and compilation drops metadata\n constructor(\n @Optional()\n @Inject(TUI_OPTION_CONTENT)\n readonly content: PolymorpheusContent<\n TuiContextWithImplicit<TemplateRef<Record<string, unknown>>>\n > | null,\n @Inject(forwardRef(() => TuiDataListComponent))\n private readonly dataList: TuiDataListComponent<T>,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Optional()\n @Inject(TUI_DATA_LIST_HOST)\n private readonly host: TuiDataListHost<T> | null,\n @Optional()\n @Self()\n @Inject(TuiDropdownDirective)\n readonly dropdown: TuiDropdownDirective | null,\n ) {}\n\n @HostBinding(`class._with-dropdown`)\n get active(): boolean {\n return !!this.dropdown && !!this.dropdown.dropdownBoxRef;\n }\n\n @HostListener(`click`)\n onClick(): void {\n if (this.host && this.value !== undefined) {\n this.host.handleOption(this.value);\n }\n }\n\n // @bad TODO: Consider aria-activedescendant for proper accessibility implementation\n @shouldCall(shouldFocus)\n @HostListener(`mousemove.init`, [`$event`])\n @HostListener(`mousemove.silent`, [`$event`])\n onMouseMove({currentTarget}: TuiEventWith<MouseEvent, HTMLElement>): void {\n setNativeFocused(currentTarget, true, true);\n }\n\n // Preventing focus loss upon focused option removal\n ngOnDestroy(): void {\n this.dataList.handleFocusLossIfNecessary(this.elementRef.nativeElement);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n isNativeFocusedIn,\n isPresent,\n itemsQueryListObservable,\n moveFocus,\n setNativeMouseFocused,\n tuiAssertIsHTMLElement,\n tuiDefaultProp,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {TuiDataListAccessor} from '@taiga-ui/core/interfaces';\nimport {TUI_DATA_LIST_ACCESSOR, TUI_NOTHING_FOUND_MESSAGE} from '@taiga-ui/core/tokens';\nimport {TuiDataListRole} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {TuiOptionComponent} from './option/option.component';\n\n// TODO: Consider aria-activedescendant for proper accessibility implementation\n// @dynamic\n@Component({\n selector: `tui-data-list`,\n templateUrl: `./data-list.template.html`,\n styleUrls: [`./data-list.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: TUI_DATA_LIST_ACCESSOR,\n useExisting: forwardRef(() => TuiDataListComponent),\n },\n ],\n})\nexport class TuiDataListComponent<T> implements TuiDataListAccessor<T> {\n @ContentChildren(forwardRef(() => TuiOptionComponent), {descendants: true})\n private readonly options: QueryList<TuiOptionComponent<T>> = EMPTY_QUERY;\n\n private origin?: HTMLElement;\n\n @Input()\n @HostBinding(`attr.role`)\n @tuiDefaultProp()\n role: TuiDataListRole = `listbox`;\n\n @Input()\n @tuiDefaultProp()\n emptyContent: PolymorpheusContent = ``;\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TUI_NOTHING_FOUND_MESSAGE)\n readonly defaultEmptyContent$: Observable<string>,\n ) {}\n\n @tuiPure\n get empty$(): Observable<boolean> {\n return itemsQueryListObservable(this.options).pipe(map(({length}) => !length));\n }\n\n @HostListener(`focusin`, [`$event.relatedTarget`, `$event.currentTarget`])\n onFocusIn(relatedTarget: HTMLElement, currentTarget: HTMLElement): void {\n if (!currentTarget.contains(relatedTarget) && !this.origin) {\n this.origin = relatedTarget;\n }\n }\n\n @HostListener(`mousedown.prevent`)\n noop(): void {}\n\n @HostListener(`keydown.arrowDown.prevent`, [`$event.target`, `1`])\n @HostListener(`keydown.arrowUp.prevent`, [`$event.target`, `-1`])\n onKeyDownArrow(current: HTMLElement, step: number): void {\n const {elements} = this;\n\n moveFocus(elements.indexOf(current), elements, step);\n }\n\n // TODO: Consider aria-activedescendant for proper accessibility implementation\n @HostListener(`wheel.silent.passive`)\n @HostListener(`mouseleave`, [`$event.target`])\n handleFocusLossIfNecessary(\n element: HTMLElement = this.elementRef.nativeElement,\n ): void {\n if (this.origin && isNativeFocusedIn(element)) {\n setNativeMouseFocused(this.origin, true, true);\n }\n }\n\n getOptions(includeDisabled: boolean = false): readonly T[] {\n return this.options\n .toArray()\n .filter(({disabled}) => includeDisabled || !disabled)\n .map(({value}) => value)\n .filter(isPresent);\n }\n\n onFocus({target}: Event, top: boolean): void {\n tuiAssertIsHTMLElement(target);\n\n const {elements} = this;\n\n moveFocus(top ? -1 : elements.length, elements, top ? 1 : -1);\n this.handleFocusLossIfNecessary(target);\n }\n\n private get elements(): readonly HTMLElement[] {\n return Array.from(this.elementRef.nativeElement.querySelectorAll(`[tuiOption]`));\n }\n}\n","import {Directive} from '@angular/core';\n\n@Directive({\n selector: `ng-template[tuiDataList]`,\n})\nexport class TuiDataListDirective {}\n","import {\n AfterViewInit,\n ContentChildren,\n Directive,\n ElementRef,\n QueryList,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n getClosestKeyboardFocusable,\n itemsQueryListObservable,\n preventDefault,\n setNativeFocused,\n tuiPure,\n typedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {EMPTY, merge, Observable} from 'rxjs';\nimport {\n debounceTime,\n filter,\n map,\n mapTo,\n shareReplay,\n switchMap,\n take,\n tap,\n} from 'rxjs/operators';\n\n// TODO: 3.0 Move into separate module\n@Directive({\n selector: `tui-data-list[tuiDataListDropdownManager]`,\n})\nexport class TuiDataListDropdownManagerDirective implements AfterViewInit {\n @ContentChildren(TuiDropdownDirective, {descendants: true})\n private readonly dropdowns: QueryList<TuiDropdownDirective> = EMPTY_QUERY;\n\n @ContentChildren(TuiDropdownDirective, {read: ElementRef, descendants: true})\n private readonly elements: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n ngAfterViewInit(): void {\n this.right$.subscribe(index => {\n this.tryToFocus(index);\n });\n\n merge(this.immediate$, this.debounce$)\n .pipe(\n switchMap(active => {\n this.dropdowns.forEach((dropdown, index) => {\n dropdown.open = index === active;\n });\n\n const element = this.elements.toArray()[active];\n const dropdown = this.dropdowns.toArray()[active];\n\n if (!element || !dropdown || !dropdown.dropdownBoxRef) {\n return EMPTY;\n }\n\n const {nativeElement} = dropdown.dropdownBoxRef.location;\n const mouseEnter$ = typedFromEvent(nativeElement, `mouseenter`).pipe(\n take(1),\n );\n const esc$ = merge(\n typedFromEvent(element.nativeElement, `keydown`),\n typedFromEvent(nativeElement, `keydown`),\n ).pipe(filter(({keyCode}) => keyCode === 27));\n\n return merge(mouseEnter$, esc$).pipe(\n tap(event => {\n if (dropdown.dropdownBoxRef) {\n event.stopPropagation();\n }\n\n setNativeFocused(element.nativeElement);\n // TODO: iframe warning\n dropdown.open = event instanceof MouseEvent;\n }),\n );\n }),\n )\n .subscribe();\n }\n\n @tuiPure\n private get elements$(): Observable<readonly HTMLElement[]> {\n return itemsQueryListObservable(this.elements).pipe(\n map(array => array.map(({nativeElement}) => nativeElement)),\n shareReplay({bufferSize: 1, refCount: true}),\n );\n }\n\n @tuiPure\n private get right$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n typedFromEvent(element, `keydown`).pipe(\n filter(({keyCode}) => keyCode === 39),\n preventDefault(),\n mapTo(index),\n ),\n ),\n ),\n ),\n );\n }\n\n @tuiPure\n private get immediate$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n typedFromEvent(element, `click`).pipe(mapTo(index)),\n ),\n ),\n ),\n );\n }\n\n @tuiPure\n private get debounce$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n merge(\n typedFromEvent(element, `focus`),\n typedFromEvent(element, `blur`),\n ).pipe(\n filter(({relatedTarget}) =>\n this.notInDropdown(relatedTarget, index),\n ),\n map(({type}) => (type === `focus` ? index : NaN)),\n ),\n ),\n ),\n ),\n debounceTime(300),\n );\n }\n\n private notInDropdown(element: EventTarget | null, index: number): boolean {\n const dropdown = this.dropdowns.toArray()[index];\n\n return (\n !dropdown ||\n !dropdown.dropdownBoxRef ||\n !dropdown.dropdownBoxRef.location.nativeElement.contains(element)\n );\n }\n\n private tryToFocus(index: number): void {\n const dropdown = this.dropdowns.toArray()[index];\n const content = dropdown?.dropdownBoxRef?.instance.contentElementRef;\n\n if (!content) {\n return;\n }\n\n const item = getClosestKeyboardFocusable(\n content.nativeElement,\n false,\n content.nativeElement,\n );\n\n if (item) {\n setNativeFocused(item);\n }\n }\n}\n","import {Directive, HostBinding, Input} from '@angular/core';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\n\n@Directive({\n selector: `tui-opt-group`,\n host: {\n role: `group`,\n },\n})\nexport class TuiOptGroupDirective {\n @Input()\n @HostBinding(`attr.data-label`)\n @tuiDefaultProp()\n label = ``;\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDataListComponent} from './data-list.component';\nimport {TuiDataListDirective} from './data-list.directive';\nimport {TuiDataListDropdownManagerDirective} from './data-list-dropdown-manager.directive';\nimport {TuiOptGroupDirective} from './opt-group.directive';\nimport {TuiOptionComponent} from './option/option.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule, PolymorpheusModule],\n declarations: [\n TuiDataListComponent,\n TuiOptionComponent,\n TuiOptGroupDirective,\n TuiDataListDirective,\n TuiDataListDropdownManagerDirective,\n ],\n exports: [\n TuiDataListComponent,\n TuiOptionComponent,\n TuiOptGroupDirective,\n TuiDataListDirective,\n TuiDataListDropdownManagerDirective,\n ],\n})\nexport class TuiDataListModule {}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/tslib/tslib.es6.js","ng://@taiga-ui/core/components/data-list/option/option.component.ts","ng://@taiga-ui/core/components/data-list/data-list.component.ts","ng://@taiga-ui/core/components/data-list/data-list.directive.ts","ng://@taiga-ui/core/components/data-list/data-list-dropdown-manager.directive.ts","ng://@taiga-ui/core/components/data-list/opt-group.directive.ts","ng://@taiga-ui/core/components/data-list/data-list.module.ts"],"names":["__decorate","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","__param","paramIndex","decorator","create","__read","o","n","m","Symbol","iterator","e","call","ar","next","done","push","value","error","__spread","concat","shouldFocus","_a","currentTarget","isNativeFocused","TuiOptionComponent","content","dataList","elementRef","host","dropdown","this","size","role","disabled","prototype","dropdownBoxRef","onClick","undefined","handleOption","onMouseMove","setNativeFocused","ngOnDestroy","handleFocusLossIfNecessary","nativeElement","Optional","type","Inject","args","TUI_OPTION_CONTENT","TuiDataListComponent","forwardRef","ElementRef","TUI_DATA_LIST_HOST","TuiDropdownDirective","Self","Input","HostBinding","tuiDefaultProp","HostListener","shouldCall","Component","selector","template","changeDetection","ChangeDetectionStrategy","OnPush","tabIndex","[attr.disabled]","defaultEmptyContent$","options","EMPTY_QUERY","emptyContent","itemsQueryListObservable","pipe","map","onFocusIn","relatedTarget","contains","origin","noop","onKeyDownArrow","current","step","elements","moveFocus","indexOf","element","isNativeFocusedIn","setNativeMouseFocused","getOptions","includeDisabled","toArray","filter","isPresent","onFocus","top","tuiAssertIsHTMLElement","Array","from","querySelectorAll","Observable","TUI_NOTHING_FOUND_MESSAGE","ContentChildren","descendants","tuiPure","TuiDataListComponent_1","encapsulation","ViewEncapsulation","None","providers","provide","TUI_DATA_LIST_ACCESSOR","useExisting","TuiDataListDirective","Directive","TuiDataListDropdownManagerDirective","dropdowns","ngAfterViewInit","_this","right$","subscribe","index","tryToFocus","merge","immediate$","debounce$","switchMap","active","forEach","open","EMPTY","location","mouseEnter$","typedFromEvent","take","esc$","keyCode","tap","event","stopPropagation","MouseEvent","array","shareReplay","bufferSize","refCount","elements$","apply","preventDefault","mapTo","notInDropdown","NaN","debounceTime","instance","contentElementRef","item","getClosestKeyboardFocusable","read","TuiOptGroupDirective","label","TuiDataListModule","NgModule","imports","CommonModule","TuiSvgModule","PolymorpheusModule","declarations","exports"],"mappings":"2nCAsDO,SAASA,EAAWC,EAAYC,EAAQC,EAAKC,GAChD,IAA2HC,EAAvHC,EAAIC,UAAUC,OAAQC,EAAIH,EAAI,EAAIJ,EAAkB,OAATE,EAAgBA,EAAOM,OAAOC,yBAAyBT,EAAQC,GAAOC,EACrH,GAAuB,iBAAZQ,SAAoD,mBAArBA,QAAQC,SAAyBJ,EAAIG,QAAQC,SAASZ,EAAYC,EAAQC,EAAKC,QACpH,IAAK,IAAIU,EAAIb,EAAW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,QACAC,EAAAA,YAAY,mBACZC,EAAAA,8CAHQoG,EAAoB7K,EAAA,CANhCkI,EAAAA,UAAU,CACPrD,SAAU,gBACVjC,KAAM,CACFI,KAAM,YAGD6H,mBCmBb,SAAAE,KAAgC,OAAnBA,EAAiB/K,EAAA,CAjB7BgL,EAAAA,SAAS,CACNC,QAAS,CAACC,EAAAA,aAAcC,EAAAA,aAAcC,EAAAA,oBACtCC,aAAc,CACVpH,EACAzB,EACAqI,EACA5C,EACAE,GAEJmD,QAAS,CACLrH,EACAzB,EACAqI,EACA5C,EACAE,MAGK4C","sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n OnDestroy,\n Optional,\n Self,\n TemplateRef,\n} from '@angular/core';\nimport {\n isNativeFocused,\n setNativeFocused,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiEventWith,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {TuiDataListHost} from '@taiga-ui/core/interfaces';\nimport {TUI_DATA_LIST_HOST, TUI_OPTION_CONTENT} from '@taiga-ui/core/tokens';\nimport {TuiOptionRole, TuiSizeL, TuiSizeXS} from '@taiga-ui/core/types';\nimport {shouldCall} from '@tinkoff/ng-event-plugins';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDataListComponent} from '../data-list.component';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function shouldFocus({\n currentTarget,\n}: TuiEventWith<MouseEvent, HTMLElement>): boolean {\n return !isNativeFocused(currentTarget);\n}\n\n// TODO: Consider all use cases for aria roles\n@Component({\n selector: `button[tuiOption], a[tuiOption]`,\n templateUrl: `./option.template.html`,\n styleUrls: [`./option.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n tabIndex: `-1`,\n type: `button`,\n '[attr.disabled]': `disabled || null`,\n },\n})\nexport class TuiOptionComponent<T = unknown> implements OnDestroy {\n @Input()\n @HostBinding(`attr.data-size`)\n @tuiDefaultProp()\n size: TuiSizeXS | TuiSizeL = `m`;\n\n @Input()\n @HostBinding(`attr.role`)\n @tuiDefaultProp()\n role: TuiOptionRole = `option`;\n\n @Input()\n @tuiDefaultProp()\n disabled = false;\n\n @Input()\n value?: T;\n\n // TODO: 3.0 Fix dataList type when updated to Ivy and compilation drops metadata\n constructor(\n @Optional()\n @Inject(TUI_OPTION_CONTENT)\n readonly content: PolymorpheusContent<\n TuiContextWithImplicit<TemplateRef<Record<string, unknown>>>\n > | null,\n @Inject(forwardRef(() => TuiDataListComponent))\n private readonly dataList: TuiDataListComponent<T>,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Optional()\n @Inject(TUI_DATA_LIST_HOST)\n private readonly host: TuiDataListHost<T> | null,\n @Optional()\n @Self()\n @Inject(TuiDropdownDirective)\n readonly dropdown: TuiDropdownDirective | null,\n ) {}\n\n @HostBinding(`class._with-dropdown`)\n get active(): boolean {\n return !!this.dropdown && !!this.dropdown.dropdownBoxRef;\n }\n\n @HostListener(`click`)\n onClick(): void {\n if (this.host && this.value !== undefined) {\n this.host.handleOption(this.value);\n }\n }\n\n // @bad TODO: Consider aria-activedescendant for proper accessibility implementation\n @shouldCall(shouldFocus)\n @HostListener(`mousemove.init`, [`$event`])\n @HostListener(`mousemove.silent`, [`$event`])\n onMouseMove({currentTarget}: TuiEventWith<MouseEvent, HTMLElement>): void {\n setNativeFocused(currentTarget, true, true);\n }\n\n // Preventing focus loss upon focused option removal\n ngOnDestroy(): void {\n this.dataList.handleFocusLossIfNecessary(this.elementRef.nativeElement);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n isNativeFocusedIn,\n isPresent,\n itemsQueryListObservable,\n moveFocus,\n setNativeMouseFocused,\n tuiAssertIsHTMLElement,\n tuiDefaultProp,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {TuiDataListAccessor} from '@taiga-ui/core/interfaces';\nimport {TUI_DATA_LIST_ACCESSOR, TUI_NOTHING_FOUND_MESSAGE} from '@taiga-ui/core/tokens';\nimport {TuiDataListRole} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {TuiOptionComponent} from './option/option.component';\n\n// TODO: Consider aria-activedescendant for proper accessibility implementation\n// @dynamic\n@Component({\n selector: `tui-data-list`,\n templateUrl: `./data-list.template.html`,\n styleUrls: [`./data-list.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: TUI_DATA_LIST_ACCESSOR,\n useExisting: forwardRef(() => TuiDataListComponent),\n },\n ],\n})\nexport class TuiDataListComponent<T> implements TuiDataListAccessor<T> {\n @ContentChildren(forwardRef(() => TuiOptionComponent), {descendants: true})\n private readonly options: QueryList<TuiOptionComponent<T>> = EMPTY_QUERY;\n\n private origin?: HTMLElement;\n\n @Input()\n @HostBinding(`attr.role`)\n @tuiDefaultProp()\n role: TuiDataListRole = `listbox`;\n\n @Input()\n @tuiDefaultProp()\n emptyContent: PolymorpheusContent = ``;\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TUI_NOTHING_FOUND_MESSAGE)\n readonly defaultEmptyContent$: Observable<string>,\n ) {}\n\n @tuiPure\n get empty$(): Observable<boolean> {\n return itemsQueryListObservable(this.options).pipe(map(({length}) => !length));\n }\n\n @HostListener(`focusin`, [`$event.relatedTarget`, `$event.currentTarget`])\n onFocusIn(relatedTarget: HTMLElement, currentTarget: HTMLElement): void {\n if (!currentTarget.contains(relatedTarget) && !this.origin) {\n this.origin = relatedTarget;\n }\n }\n\n @HostListener(`mousedown.prevent`)\n noop(): void {}\n\n @HostListener(`keydown.arrowDown.prevent`, [`$event.target`, `1`])\n @HostListener(`keydown.arrowUp.prevent`, [`$event.target`, `-1`])\n onKeyDownArrow(current: HTMLElement, step: number): void {\n const {elements} = this;\n\n moveFocus(elements.indexOf(current), elements, step);\n }\n\n // TODO: Consider aria-activedescendant for proper accessibility implementation\n @HostListener(`wheel.silent.passive`)\n @HostListener(`mouseleave`, [`$event.target`])\n handleFocusLossIfNecessary(\n element: HTMLElement = this.elementRef.nativeElement,\n ): void {\n if (this.origin && isNativeFocusedIn(element)) {\n setNativeMouseFocused(this.origin, true, true);\n }\n }\n\n getOptions(includeDisabled: boolean = false): readonly T[] {\n return this.options\n .toArray()\n .filter(({disabled}) => includeDisabled || !disabled)\n .map(({value}) => value)\n .filter(isPresent);\n }\n\n onFocus({target}: Event, top: boolean): void {\n tuiAssertIsHTMLElement(target);\n\n const {elements} = this;\n\n moveFocus(top ? -1 : elements.length, elements, top ? 1 : -1);\n this.handleFocusLossIfNecessary(target);\n }\n\n private get elements(): readonly HTMLElement[] {\n return Array.from(this.elementRef.nativeElement.querySelectorAll(`[tuiOption]`));\n }\n}\n","import {Directive} from '@angular/core';\n\n@Directive({\n selector: `ng-template[tuiDataList]`,\n})\nexport class TuiDataListDirective {}\n","import {\n AfterViewInit,\n ContentChildren,\n Directive,\n ElementRef,\n QueryList,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n getClosestKeyboardFocusable,\n itemsQueryListObservable,\n preventDefault,\n setNativeFocused,\n tuiPure,\n typedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {EMPTY, merge, Observable} from 'rxjs';\nimport {\n debounceTime,\n filter,\n map,\n mapTo,\n shareReplay,\n switchMap,\n take,\n tap,\n} from 'rxjs/operators';\n\n// TODO: 3.0 Move into separate module\n@Directive({\n selector: `tui-data-list[tuiDataListDropdownManager]`,\n})\nexport class TuiDataListDropdownManagerDirective implements AfterViewInit {\n @ContentChildren(TuiDropdownDirective, {descendants: true})\n private readonly dropdowns: QueryList<TuiDropdownDirective> = EMPTY_QUERY;\n\n @ContentChildren(TuiDropdownDirective, {read: ElementRef, descendants: true})\n private readonly elements: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n ngAfterViewInit(): void {\n this.right$.subscribe(index => {\n this.tryToFocus(index);\n });\n\n merge(this.immediate$, this.debounce$)\n .pipe(\n switchMap(active => {\n this.dropdowns.forEach((dropdown, index) => {\n dropdown.open = index === active;\n });\n\n const element = this.elements.toArray()[active];\n const dropdown = this.dropdowns.toArray()[active];\n\n if (!element || !dropdown || !dropdown.dropdownBoxRef) {\n return EMPTY;\n }\n\n const {nativeElement} = dropdown.dropdownBoxRef.location;\n const mouseEnter$ = typedFromEvent(nativeElement, `mouseenter`).pipe(\n take(1),\n );\n const esc$ = merge(\n typedFromEvent(element.nativeElement, `keydown`),\n typedFromEvent(nativeElement, `keydown`),\n ).pipe(filter(({keyCode}) => keyCode === 27));\n\n return merge(mouseEnter$, esc$).pipe(\n tap(event => {\n if (dropdown.dropdownBoxRef) {\n event.stopPropagation();\n }\n\n setNativeFocused(element.nativeElement);\n // TODO: iframe warning\n dropdown.open = event instanceof MouseEvent;\n }),\n );\n }),\n )\n .subscribe();\n }\n\n @tuiPure\n private get elements$(): Observable<readonly HTMLElement[]> {\n return itemsQueryListObservable(this.elements).pipe(\n map(array => array.map(({nativeElement}) => nativeElement)),\n shareReplay({bufferSize: 1, refCount: true}),\n );\n }\n\n @tuiPure\n private get right$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n typedFromEvent(element, `keydown`).pipe(\n filter(({keyCode}) => keyCode === 39),\n preventDefault(),\n mapTo(index),\n ),\n ),\n ),\n ),\n );\n }\n\n @tuiPure\n private get immediate$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n typedFromEvent(element, `click`).pipe(mapTo(index)),\n ),\n ),\n ),\n );\n }\n\n @tuiPure\n private get debounce$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n merge(\n typedFromEvent(element, `focus`),\n typedFromEvent(element, `blur`),\n ).pipe(\n filter(({relatedTarget}) =>\n this.notInDropdown(relatedTarget, index),\n ),\n map(({type}) => (type === `focus` ? index : NaN)),\n ),\n ),\n ),\n ),\n debounceTime(300),\n );\n }\n\n private notInDropdown(element: EventTarget | null, index: number): boolean {\n const dropdown = this.dropdowns.toArray()[index];\n\n return (\n !dropdown ||\n !dropdown.dropdownBoxRef ||\n !dropdown.dropdownBoxRef.location.nativeElement.contains(element)\n );\n }\n\n private tryToFocus(index: number): void {\n const dropdown = this.dropdowns.toArray()[index];\n const content = dropdown?.dropdownBoxRef?.instance.contentElementRef;\n\n if (!content) {\n return;\n }\n\n const item = getClosestKeyboardFocusable(\n content.nativeElement,\n false,\n content.nativeElement,\n );\n\n if (item) {\n setNativeFocused(item);\n }\n }\n}\n","import {Directive, HostBinding, Input} from '@angular/core';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\n\n@Directive({\n selector: `tui-opt-group`,\n host: {\n role: `group`,\n },\n})\nexport class TuiOptGroupDirective {\n @Input()\n @HostBinding(`attr.data-label`)\n @tuiDefaultProp()\n label = ``;\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDataListComponent} from './data-list.component';\nimport {TuiDataListDirective} from './data-list.directive';\nimport {TuiDataListDropdownManagerDirective} from './data-list-dropdown-manager.directive';\nimport {TuiOptGroupDirective} from './opt-group.directive';\nimport {TuiOptionComponent} from './option/option.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule, PolymorpheusModule],\n declarations: [\n TuiDataListComponent,\n TuiOptionComponent,\n TuiOptGroupDirective,\n TuiDataListDirective,\n TuiDataListDropdownManagerDirective,\n ],\n exports: [\n TuiDataListComponent,\n TuiOptionComponent,\n TuiOptGroupDirective,\n TuiDataListDirective,\n TuiDataListDropdownManagerDirective,\n ],\n})\nexport class TuiDataListModule {}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"TuiDataListComponent":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":35,"character":1},"arguments":[{"selector":"tui-data-list","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":39,"character":21},"member":"OnPush"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":40,"character":19},"member":"None"},"providers":[{"provide":{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_DATA_LIST_ACCESSOR","line":43,"character":21},"useExisting":{"__symbolic":"reference","name":"TuiDataListComponent"}}],"template":"<div\n tabindex=\"0\"\n class=\"t-trap\"\n (focusin)=\"onFocus($event, true)\"\n></div>\n<ng-content></ng-content>\n<div\n *ngIf=\"empty$ | async\"\n polymorpheus-outlet\n class=\"t-empty\"\n [content]=\"emptyContent || (defaultEmptyContent$ | async)\"\n></div>\n<div\n tabindex=\"0\"\n class=\"t-trap\"\n (focusin)=\"onFocus($event, false)\"\n></div>\n","styles":["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-top:1rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.5rem;height:1px;background:var(--tui-base-03)}"]}]}],"members":{"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":49,"character":5},"arguments":[{"__symbolic":"reference","name":"TuiOptionComponent"},{"descendants":true}]}]}],"role":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":54,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":55,"character":5},"arguments":["attr.role"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":56,"character":5}}]}],"emptyContent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":60,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":64,"character":9},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":64,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":65,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_NOTHING_FOUND_MESSAGE","line":65,"character":16}]}]],"parameters":[{"__symbolic":"reference","name":"ElementRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":64,"character":68,"context":{"typeName":"HTMLElement"},"module":"./data-list.component"}]},{"__symbolic":"reference","name":"Observable","module":"rxjs","arguments":[{"__symbolic":"reference","name":"string"}]}]}],"empty$":[{"__symbolic":"property","decorators":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiPure","line":69,"character":5}]}],"onFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":74,"character":5},"arguments":["focusin",["$event.relatedTarget","$event.currentTarget"]]}]}],"noop":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":81,"character":5},"arguments":["mousedown.prevent"]}]}],"onKeyDownArrow":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":84,"character":5},"arguments":["keydown.arrowDown.prevent",["$event.target","1"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":85,"character":5},"arguments":["keydown.arrowUp.prevent",["$event.target","-1"]]}]}],"handleFocusLossIfNecessary":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":93,"character":5},"arguments":["wheel.silent.passive"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":94,"character":5},"arguments":["mouseleave",["$event.target"]]}]}],"getOptions":[{"__symbolic":"method"}],"onFocus":[{"__symbolic":"method"}]}},"TuiDataListDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"ng-template[tuiDataList]"}]}],"members":{}},"TuiDataListModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":12,"character":14},{"__symbolic":"reference","module":"@taiga-ui/core/components/svg","name":"TuiSvgModule","line":12,"character":28},{"__symbolic":"reference","module":"@tinkoff/ng-polymorpheus","name":"PolymorpheusModule","line":12,"character":42}],"declarations":[{"__symbolic":"reference","name":"TuiDataListComponent"},{"__symbolic":"reference","name":"TuiOptionComponent"},{"__symbolic":"reference","name":"TuiOptGroupDirective"},{"__symbolic":"reference","name":"TuiDataListDirective"},{"__symbolic":"reference","name":"TuiDataListDropdownManagerDirective"}],"exports":[{"__symbolic":"reference","name":"TuiDataListComponent"},{"__symbolic":"reference","name":"TuiOptionComponent"},{"__symbolic":"reference","name":"TuiOptGroupDirective"},{"__symbolic":"reference","name":"TuiDataListDirective"},{"__symbolic":"reference","name":"TuiDataListDropdownManagerDirective"}]}]}],"members":{}},"TuiDataListDropdownManagerDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":30,"character":1},"arguments":[{"selector":"tui-data-list[tuiDataListDropdownManager]"}]}],"members":{"dropdowns":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":34,"character":5},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/directives/dropdown","name":"TuiDropdownDirective","line":34,"character":21},{"descendants":true}]}]}],"elements":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":37,"character":5},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/directives/dropdown","name":"TuiDropdownDirective","line":37,"character":21},{"read":{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":37,"character":50},"descendants":true}]}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"elements$":[{"__symbolic":"property","decorators":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiPure","line":84,"character":5}]}],"right$":[{"__symbolic":"property","decorators":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiPure","line":92,"character":5}]}],"immediate$":[{"__symbolic":"property","decorators":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiPure","line":109,"character":5}]}],"debounce$":[{"__symbolic":"property","decorators":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiPure","line":122,"character":5}]}],"notInDropdown":[{"__symbolic":"method"}],"tryToFocus":[{"__symbolic":"method"}]}},"TuiOptGroupDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":3,"character":1},"arguments":[{"selector":"tui-opt-group","host":{"role":"group"}}]}],"members":{"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":11,"character":5},"arguments":["attr.data-label"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":12,"character":5}}]}]}},"shouldFocus":{"__symbolic":"function","parameters":["currentTarget"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"isNativeFocused","line":34,"character":12},"arguments":[{"__symbolic":"reference","name":"currentTarget"}]}}},"TuiOptionComponent":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":38,"character":1},"arguments":[{"selector":"button[tuiOption], a[tuiOption]","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":42,"character":21},"member":"OnPush"},"host":{"tabIndex":"-1","type":"button","[attr.disabled]":"disabled || null","$quoted$":["[attr.disabled]"]},"template":"<span\n *ngIf=\"content; else base\"\n polymorpheus-outlet\n class=\"t-content\"\n [content]=\"content\"\n [context]=\"{$implicit: base}\"\n></span>\n<ng-template #base>\n <ng-content></ng-content>\n <tui-svg\n *ngIf=\"dropdown\"\n src=\"tuiIconChevronRight\"\n class=\"t-arrow\"\n ></tui-svg>\n</ng-template>\n","styles":[":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:padding-box;font-size:inherit;line-height:inherit;transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;font:var(--tui-font-text-m);width:100%;align-items:center;justify-content:space-between;text-align:left;box-sizing:border-box;color:var(--tui-text-01);outline:0;text-decoration:none;cursor:pointer}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:default}:host._with-dropdown,:host:focus{background-color:var(--tui-base-02)}:host[data-size=xs]{font:var(--tui-font-text-s);min-height:2rem;padding:.3125rem .75rem}:host[data-size='s']{min-height:2rem;padding:.3125rem .75rem}:host[data-size='m']{min-height:2.75rem;padding:.375rem 1rem}:host[data-size='l']{min-height:3.5rem;padding:.75rem 1rem}.t-content{display:flex;flex:1;max-width:100%}.t-arrow{margin:0 -.5rem 0 .75rem}"]}]}],"members":{"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":51,"character":5},"arguments":["attr.data-size"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":52,"character":5}}]}],"role":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":56,"character":5},"arguments":["attr.role"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":57,"character":5}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":60,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":61,"character":5}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":69,"character":9}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":70,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_OPTION_CONTENT","line":70,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":74,"character":9},"arguments":[{"__symbolic":"reference","name":"TuiDataListComponent"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":76,"character":9},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":76,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":77,"character":9}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":78,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_DATA_LIST_HOST","line":78,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":80,"character":9}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":81,"character":9}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":82,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/directives/dropdown","name":"TuiDropdownDirective","line":82,"character":16}]}]],"parameters":[{"__symbolic":"reference","name":"PolymorpheusContent","module":"@tinkoff/ng-polymorpheus","arguments":[{"__symbolic":"reference","name":"TuiContextWithImplicit","module":"@taiga-ui/cdk","arguments":[{"__symbolic":"reference","name":"TemplateRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":72,"character":47,"context":{"typeName":"Record"},"module":"./option/option.component"}]}]}]},{"__symbolic":"reference","name":"TuiDataListComponent"},{"__symbolic":"reference","name":"ElementRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":76,"character":68,"context":{"typeName":"HTMLElement"},"module":"./option/option.component"}]},{"__symbolic":"reference","name":"TuiDataListHost","module":"@taiga-ui/core/interfaces","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":79,"character":47,"context":{"typeName":"T"},"module":"./option/option.component"}]},{"__symbolic":"reference","module":"@taiga-ui/core/directives/dropdown","name":"TuiDropdownDirective","line":83,"character":27}]}],"active":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":86,"character":5},"arguments":["class._with-dropdown"]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":91,"character":5},"arguments":["click"]}]}],"onMouseMove":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@tinkoff/ng-event-plugins","name":"shouldCall","line":99,"character":5},"arguments":[{"__symbolic":"reference","name":"shouldFocus"}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":100,"character":5},"arguments":["mousemove.init",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":101,"character":5},"arguments":["mousemove.silent",["$event"]]}]}],"ngOnDestroy":[{"__symbolic":"method"}]}}},"origins":{"TuiDataListComponent":"./data-list.component","TuiDataListDirective":"./data-list.directive","TuiDataListModule":"./data-list.module","TuiDataListDropdownManagerDirective":"./data-list-dropdown-manager.directive","TuiOptGroupDirective":"./opt-group.directive","shouldFocus":"./option/option.component","TuiOptionComponent":"./option/option.component"},"importAs":"@taiga-ui/core/components/data-list"}
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"TuiDataListComponent":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":35,"character":1},"arguments":[{"selector":"tui-data-list","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":39,"character":21},"member":"OnPush"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":40,"character":19},"member":"None"},"providers":[{"provide":{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_DATA_LIST_ACCESSOR","line":43,"character":21},"useExisting":{"__symbolic":"reference","name":"TuiDataListComponent"}}],"template":"<div\n tabindex=\"0\"\n class=\"t-trap\"\n (focusin)=\"onFocus($event, true)\"\n></div>\n<ng-content></ng-content>\n<div\n *ngIf=\"empty$ | async\"\n polymorpheus-outlet\n class=\"t-empty\"\n [content]=\"emptyContent || (defaultEmptyContent$ | async)\"\n></div>\n<div\n tabindex=\"0\"\n class=\"t-trap\"\n (focusin)=\"onFocus($event, false)\"\n></div>\n","styles":["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02);line-height:1rem;white-space:normal}tui-opt-group:not(:empty)~tui-opt-group:before{padding:1.5rem 1rem .5rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.5rem;height:1px;background:var(--tui-base-03)}"]}]}],"members":{"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":49,"character":5},"arguments":[{"__symbolic":"reference","name":"TuiOptionComponent"},{"descendants":true}]}]}],"role":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":54,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":55,"character":5},"arguments":["attr.role"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":56,"character":5}}]}],"emptyContent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":60,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":64,"character":9},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":64,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":65,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_NOTHING_FOUND_MESSAGE","line":65,"character":16}]}]],"parameters":[{"__symbolic":"reference","name":"ElementRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":64,"character":68,"context":{"typeName":"HTMLElement"},"module":"./data-list.component"}]},{"__symbolic":"reference","name":"Observable","module":"rxjs","arguments":[{"__symbolic":"reference","name":"string"}]}]}],"empty$":[{"__symbolic":"property","decorators":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiPure","line":69,"character":5}]}],"onFocusIn":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":74,"character":5},"arguments":["focusin",["$event.relatedTarget","$event.currentTarget"]]}]}],"noop":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":81,"character":5},"arguments":["mousedown.prevent"]}]}],"onKeyDownArrow":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":84,"character":5},"arguments":["keydown.arrowDown.prevent",["$event.target","1"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":85,"character":5},"arguments":["keydown.arrowUp.prevent",["$event.target","-1"]]}]}],"handleFocusLossIfNecessary":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":93,"character":5},"arguments":["wheel.silent.passive"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":94,"character":5},"arguments":["mouseleave",["$event.target"]]}]}],"getOptions":[{"__symbolic":"method"}],"onFocus":[{"__symbolic":"method"}]}},"TuiDataListDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"ng-template[tuiDataList]"}]}],"members":{}},"TuiDataListModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":12,"character":14},{"__symbolic":"reference","module":"@taiga-ui/core/components/svg","name":"TuiSvgModule","line":12,"character":28},{"__symbolic":"reference","module":"@tinkoff/ng-polymorpheus","name":"PolymorpheusModule","line":12,"character":42}],"declarations":[{"__symbolic":"reference","name":"TuiDataListComponent"},{"__symbolic":"reference","name":"TuiOptionComponent"},{"__symbolic":"reference","name":"TuiOptGroupDirective"},{"__symbolic":"reference","name":"TuiDataListDirective"},{"__symbolic":"reference","name":"TuiDataListDropdownManagerDirective"}],"exports":[{"__symbolic":"reference","name":"TuiDataListComponent"},{"__symbolic":"reference","name":"TuiOptionComponent"},{"__symbolic":"reference","name":"TuiOptGroupDirective"},{"__symbolic":"reference","name":"TuiDataListDirective"},{"__symbolic":"reference","name":"TuiDataListDropdownManagerDirective"}]}]}],"members":{}},"TuiDataListDropdownManagerDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":30,"character":1},"arguments":[{"selector":"tui-data-list[tuiDataListDropdownManager]"}]}],"members":{"dropdowns":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":34,"character":5},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/directives/dropdown","name":"TuiDropdownDirective","line":34,"character":21},{"descendants":true}]}]}],"elements":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":37,"character":5},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/directives/dropdown","name":"TuiDropdownDirective","line":37,"character":21},{"read":{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":37,"character":50},"descendants":true}]}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"elements$":[{"__symbolic":"property","decorators":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiPure","line":84,"character":5}]}],"right$":[{"__symbolic":"property","decorators":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiPure","line":92,"character":5}]}],"immediate$":[{"__symbolic":"property","decorators":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiPure","line":109,"character":5}]}],"debounce$":[{"__symbolic":"property","decorators":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiPure","line":122,"character":5}]}],"notInDropdown":[{"__symbolic":"method"}],"tryToFocus":[{"__symbolic":"method"}]}},"TuiOptGroupDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":3,"character":1},"arguments":[{"selector":"tui-opt-group","host":{"role":"group"}}]}],"members":{"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":11,"character":5},"arguments":["attr.data-label"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":12,"character":5}}]}]}},"shouldFocus":{"__symbolic":"function","parameters":["currentTarget"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"isNativeFocused","line":34,"character":12},"arguments":[{"__symbolic":"reference","name":"currentTarget"}]}}},"TuiOptionComponent":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":38,"character":1},"arguments":[{"selector":"button[tuiOption], a[tuiOption]","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":42,"character":21},"member":"OnPush"},"host":{"tabIndex":"-1","type":"button","[attr.disabled]":"disabled || null","$quoted$":["[attr.disabled]"]},"template":"<span\n *ngIf=\"content; else base\"\n polymorpheus-outlet\n class=\"t-content\"\n [content]=\"content\"\n [context]=\"{$implicit: base}\"\n></span>\n<ng-template #base>\n <ng-content></ng-content>\n <tui-svg\n *ngIf=\"dropdown\"\n src=\"tuiIconChevronRight\"\n class=\"t-arrow\"\n ></tui-svg>\n</ng-template>\n","styles":[":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:padding-box;font-size:inherit;line-height:inherit;transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;font:var(--tui-font-text-m);width:100%;align-items:center;justify-content:space-between;text-align:left;box-sizing:border-box;color:var(--tui-text-01);outline:0;text-decoration:none;cursor:pointer}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:default}:host._with-dropdown,:host:focus{background-color:var(--tui-base-02)}:host[data-size=xs]{font:var(--tui-font-text-s);min-height:2rem;padding:.3125rem .75rem}:host[data-size='s']{min-height:2rem;padding:.3125rem .75rem}:host[data-size='m']{min-height:2.75rem;padding:.375rem 1rem}:host[data-size='l']{min-height:3.5rem;padding:.75rem 1rem}.t-content{display:flex;flex:1;max-width:100%}.t-arrow{margin:0 -.5rem 0 .75rem}"]}]}],"members":{"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":51,"character":5},"arguments":["attr.data-size"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":52,"character":5}}]}],"role":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":56,"character":5},"arguments":["attr.role"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":57,"character":5}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":60,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiDefaultProp","line":61,"character":5}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":69,"character":9}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":70,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_OPTION_CONTENT","line":70,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":74,"character":9},"arguments":[{"__symbolic":"reference","name":"TuiDataListComponent"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":76,"character":9},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":76,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":77,"character":9}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":78,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_DATA_LIST_HOST","line":78,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":80,"character":9}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":81,"character":9}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":82,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/directives/dropdown","name":"TuiDropdownDirective","line":82,"character":16}]}]],"parameters":[{"__symbolic":"reference","name":"PolymorpheusContent","module":"@tinkoff/ng-polymorpheus","arguments":[{"__symbolic":"reference","name":"TuiContextWithImplicit","module":"@taiga-ui/cdk","arguments":[{"__symbolic":"reference","name":"TemplateRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":72,"character":47,"context":{"typeName":"Record"},"module":"./option/option.component"}]}]}]},{"__symbolic":"reference","name":"TuiDataListComponent"},{"__symbolic":"reference","name":"ElementRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":76,"character":68,"context":{"typeName":"HTMLElement"},"module":"./option/option.component"}]},{"__symbolic":"reference","name":"TuiDataListHost","module":"@taiga-ui/core/interfaces","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":79,"character":47,"context":{"typeName":"T"},"module":"./option/option.component"}]},{"__symbolic":"reference","module":"@taiga-ui/core/directives/dropdown","name":"TuiDropdownDirective","line":83,"character":27}]}],"active":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":86,"character":5},"arguments":["class._with-dropdown"]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":91,"character":5},"arguments":["click"]}]}],"onMouseMove":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@tinkoff/ng-event-plugins","name":"shouldCall","line":99,"character":5},"arguments":[{"__symbolic":"reference","name":"shouldFocus"}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":100,"character":5},"arguments":["mousemove.init",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":101,"character":5},"arguments":["mousemove.silent",["$event"]]}]}],"ngOnDestroy":[{"__symbolic":"method"}]}}},"origins":{"TuiDataListComponent":"./data-list.component","TuiDataListDirective":"./data-list.directive","TuiDataListModule":"./data-list.module","TuiDataListDropdownManagerDirective":"./data-list-dropdown-manager.directive","TuiOptGroupDirective":"./opt-group.directive","shouldFocus":"./option/option.component","TuiOptionComponent":"./option/option.component"},"importAs":"@taiga-ui/core/components/data-list"}
|
package/constants/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.65.0";
|
|
@@ -97,7 +97,7 @@ TuiDataListComponent = TuiDataListComponent_1 = __decorate([
|
|
|
97
97
|
useExisting: forwardRef(() => TuiDataListComponent_1),
|
|
98
98
|
},
|
|
99
99
|
],
|
|
100
|
-
styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02)}tui-opt-group:not(:empty)~tui-opt-group:before{padding
|
|
100
|
+
styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02);line-height:1rem;white-space:normal}tui-opt-group:not(:empty)~tui-opt-group:before{padding:1.5rem 1rem .5rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.5rem;height:1px;background:var(--tui-base-03)}"]
|
|
101
101
|
}),
|
|
102
102
|
__param(0, Inject(ElementRef)),
|
|
103
103
|
__param(1, Inject(TUI_NOTHING_FOUND_MESSAGE))
|
|
@@ -117,7 +117,7 @@ var TuiDataListComponent = /** @class */ (function () {
|
|
|
117
117
|
useExisting: forwardRef(function () { return TuiDataListComponent_1; }),
|
|
118
118
|
},
|
|
119
119
|
],
|
|
120
|
-
styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02)}tui-opt-group:not(:empty)~tui-opt-group:before{padding
|
|
120
|
+
styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02);line-height:1rem;white-space:normal}tui-opt-group:not(:empty)~tui-opt-group:before{padding:1.5rem 1rem .5rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.5rem;height:1px;background:var(--tui-base-03)}"]
|
|
121
121
|
}),
|
|
122
122
|
__param(0, Inject(ElementRef)),
|
|
123
123
|
__param(1, Inject(TUI_NOTHING_FOUND_MESSAGE))
|
|
@@ -194,7 +194,7 @@ TuiDataListComponent = TuiDataListComponent_1 = __decorate([
|
|
|
194
194
|
useExisting: forwardRef(() => TuiDataListComponent_1),
|
|
195
195
|
},
|
|
196
196
|
],
|
|
197
|
-
styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02)}tui-opt-group:not(:empty)~tui-opt-group:before{padding
|
|
197
|
+
styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02);line-height:1rem;white-space:normal}tui-opt-group:not(:empty)~tui-opt-group:before{padding:1.5rem 1rem .5rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.5rem;height:1px;background:var(--tui-base-03)}"]
|
|
198
198
|
}),
|
|
199
199
|
__param(0, Inject(ElementRef)),
|
|
200
200
|
__param(1, Inject(TUI_NOTHING_FOUND_MESSAGE))
|
|
@@ -221,7 +221,7 @@ var TuiDataListComponent = /** @class */ (function () {
|
|
|
221
221
|
useExisting: forwardRef(function () { return TuiDataListComponent_1; }),
|
|
222
222
|
},
|
|
223
223
|
],
|
|
224
|
-
styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02)}tui-opt-group:not(:empty)~tui-opt-group:before{padding
|
|
224
|
+
styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02);line-height:1rem;white-space:normal}tui-opt-group:not(:empty)~tui-opt-group:before{padding:1.5rem 1rem .5rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.5rem;height:1px;background:var(--tui-base-03)}"]
|
|
225
225
|
}),
|
|
226
226
|
__param(0, Inject(ElementRef)),
|
|
227
227
|
__param(1, Inject(TUI_NOTHING_FOUND_MESSAGE))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.65.0",
|
|
4
4
|
"description": "Core library for creating Angular components and applications using Taiga UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"repository": "https://github.com/tinkoff/taiga-ui",
|
|
16
16
|
"license": "Apache-2.0",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@taiga-ui/i18n": "^2.
|
|
18
|
+
"@taiga-ui/i18n": "^2.65.0",
|
|
19
19
|
"tslib": "^1.10.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"@angular/router": ">=9.0.0",
|
|
28
28
|
"@ng-web-apis/common": ">=1.12.1 < 2",
|
|
29
29
|
"@ng-web-apis/mutation-observer": ">=1.1.0 < 2",
|
|
30
|
-
"@taiga-ui/cdk": ">=2.
|
|
31
|
-
"@taiga-ui/i18n": ">=2.
|
|
30
|
+
"@taiga-ui/cdk": ">=2.65.0",
|
|
31
|
+
"@taiga-ui/i18n": ">=2.65.0",
|
|
32
32
|
"@tinkoff/ng-event-plugins": ">=2.3.2",
|
|
33
33
|
"@tinkoff/ng-polymorpheus": ">=3.1.12 < 4",
|
|
34
34
|
"rxjs": ">=6.0.0"
|
package/styles/basic/main.less
CHANGED
|
@@ -71,3 +71,16 @@ html,
|
|
|
71
71
|
::-ms-reveal {
|
|
72
72
|
display: none;
|
|
73
73
|
}
|
|
74
|
+
|
|
75
|
+
// @note: only safari 16+
|
|
76
|
+
@supports (-webkit-hyphens: none) and (text-align-last: right) {
|
|
77
|
+
/**
|
|
78
|
+
* @descriptions:
|
|
79
|
+
* Safari 16 has bug when for some reason,
|
|
80
|
+
* the ::after blocks aren't removed
|
|
81
|
+
* after the destruction of the parent class
|
|
82
|
+
*/
|
|
83
|
+
:after {
|
|
84
|
+
content: none;
|
|
85
|
+
}
|
|
86
|
+
}
|