@taiga-ui/kit 3.15.0 → 3.16.0-dev.main-e7166ca
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-kit-components-accordion.umd.js +3 -3
- package/bundles/taiga-ui-kit-components-accordion.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-avatar.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-avatar.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-badge.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-badge.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-calendar-month.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-calendar-month.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.js +4 -4
- package/bundles/taiga-ui-kit-components-carousel.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.js +2 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-elastic-container.umd.js +131 -0
- package/bundles/taiga-ui-kit-components-elastic-container.umd.js.map +1 -0
- package/bundles/taiga-ui-kit-components-files.umd.js +29 -15
- package/bundles/taiga-ui-kit-components-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-copy.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-copy.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-time.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-date-time.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date.umd.js +8 -0
- package/bundles/taiga-ui-kit-components-input-date.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-phone-international.umd.js +4 -2
- package/bundles/taiga-ui-kit-components-input-phone-international.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.js +3 -3
- package/bundles/taiga-ui-kit-components-input-tag.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-items-with-more.umd.js +3 -3
- package/bundles/taiga-ui-kit-components-items-with-more.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-line-clamp.umd.js +18 -21
- package/bundles/taiga-ui-kit-components-line-clamp.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select-option.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-multi-select-option.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.js +20 -16
- package/bundles/taiga-ui-kit-components-multi-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-push.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-push.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select-option.umd.js +29 -10
- package/bundles/taiga-ui-kit-components-select-option.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-stepper.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-stepper.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tabs.umd.js +15 -5
- package/bundles/taiga-ui-kit-components-tabs.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tree.umd.js +3 -3
- package/bundles/taiga-ui-kit-components-tree.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components.umd.js +10 -4
- package/bundles/taiga-ui-kit-components.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-data-list-dropdown-manager.umd.js +7 -7
- package/bundles/taiga-ui-kit-directives-data-list-dropdown-manager.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-lazy-loading.umd.js +1 -1
- package/bundles/taiga-ui-kit-directives-lazy-loading.umd.js.map +1 -1
- package/components/elastic-container/elastic-container.component.d.ts +6 -0
- package/components/elastic-container/elastic-container.directive.d.ts +12 -0
- package/components/elastic-container/elastic-container.module.d.ts +8 -0
- package/components/elastic-container/index.d.ts +3 -0
- package/components/elastic-container/package.json +10 -0
- package/components/elastic-container/taiga-ui-kit-components-elastic-container.d.ts +5 -0
- package/components/files/file/file-options.d.ts +6 -0
- package/components/files/file/file.component.d.ts +7 -5
- package/components/files/index.d.ts +1 -0
- package/components/index.d.ts +1 -0
- package/components/input-date/input-date.component.d.ts +5 -0
- package/components/items-with-more/items-with-more.service.d.ts +1 -1
- package/components/line-clamp/line-clamp.component.d.ts +3 -2
- package/components/multi-select/multi-select-group/multi-select-group.directive.d.ts +1 -1
- package/components/multi-select/multi-select.component.d.ts +2 -1
- package/components/multi-select-option/multi-select-option.component.d.ts +1 -1
- package/components/select-option/select-option.component.d.ts +9 -5
- package/components/tabs/tabs.directive.d.ts +1 -1
- package/esm2015/components/accordion/accordion-item/accordion-item.component.js +2 -2
- package/esm2015/components/accordion/accordion.component.js +5 -5
- package/esm2015/components/avatar/avatar.component.js +4 -4
- package/esm2015/components/badge/badge.component.js +2 -2
- package/esm2015/components/calendar-month/calendar-month.component.js +2 -2
- package/esm2015/components/carousel/carousel.component.js +4 -4
- package/esm2015/components/carousel/carousel.directive.js +4 -4
- package/esm2015/components/combo-box/combo-box.component.js +3 -2
- package/esm2015/components/elastic-container/elastic-container.component.js +23 -0
- package/esm2015/components/elastic-container/elastic-container.directive.js +58 -0
- package/esm2015/components/elastic-container/elastic-container.module.js +17 -0
- package/esm2015/components/elastic-container/index.js +4 -0
- package/esm2015/components/elastic-container/taiga-ui-kit-components-elastic-container.js +5 -0
- package/esm2015/components/files/file/file-options.js +9 -0
- package/esm2015/components/files/file/file.component.js +13 -10
- package/esm2015/components/files/files.component.js +2 -2
- package/esm2015/components/files/index.js +2 -1
- package/esm2015/components/index.js +2 -1
- package/esm2015/components/input-copy/input-copy.component.js +3 -3
- package/esm2015/components/input-date/input-date.component.js +9 -1
- package/esm2015/components/input-date-time/input-date-time.component.js +3 -3
- package/esm2015/components/input-phone-international/input-phone-international.component.js +3 -2
- package/esm2015/components/input-phone-international/tokens/countries-masks.js +3 -2
- package/esm2015/components/input-slider/input-slider.component.js +1 -1
- package/esm2015/components/input-tag/input-tag.component.js +5 -5
- package/esm2015/components/items-with-more/items-with-more.service.js +4 -4
- package/esm2015/components/line-clamp/line-clamp.component.js +20 -15
- package/esm2015/components/multi-select/multi-select-group/multi-select-group.component.js +6 -6
- package/esm2015/components/multi-select/multi-select.component.js +10 -6
- package/esm2015/components/multi-select-option/multi-select-option.component.js +3 -3
- package/esm2015/components/pdf-viewer/pdf-viewer.component.js +2 -2
- package/esm2015/components/push/push-alert.component.js +2 -2
- package/esm2015/components/push/push.component.js +2 -2
- package/esm2015/components/select-option/select-option.component.js +23 -8
- package/esm2015/components/slider/helpers/slider-readonly.directive.js +4 -4
- package/esm2015/components/slider/slider.component.js +1 -1
- package/esm2015/components/stepper/stepper.component.js +4 -4
- package/esm2015/components/tabs/tab/tab.component.js +11 -2
- package/esm2015/components/tabs/tabs.directive.js +5 -4
- package/esm2015/components/tabs/underline/underline.component.js +3 -3
- package/esm2015/components/tree/components/tree-item/tree-item.component.js +2 -2
- package/esm2015/components/tree/components/tree-item-content/tree-item-content.component.js +2 -2
- package/esm2015/components/tree/misc/tree.service.js +3 -3
- package/esm2015/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.js +7 -7
- package/esm2015/directives/lazy-loading/lazy-loading.service.js +3 -3
- package/fesm2015/taiga-ui-kit-components-accordion.js +5 -5
- package/fesm2015/taiga-ui-kit-components-accordion.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-avatar.js +3 -3
- package/fesm2015/taiga-ui-kit-components-avatar.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-badge.js +1 -1
- package/fesm2015/taiga-ui-kit-components-badge.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-calendar-month.js +1 -1
- package/fesm2015/taiga-ui-kit-components-calendar-month.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-carousel.js +6 -6
- package/fesm2015/taiga-ui-kit-components-carousel.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-combo-box.js +2 -1
- package/fesm2015/taiga-ui-kit-components-combo-box.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-elastic-container.js +98 -0
- package/fesm2015/taiga-ui-kit-components-elastic-container.js.map +1 -0
- package/fesm2015/taiga-ui-kit-components-files.js +24 -13
- package/fesm2015/taiga-ui-kit-components-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-copy.js +2 -2
- package/fesm2015/taiga-ui-kit-components-input-copy.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-time.js +2 -2
- package/fesm2015/taiga-ui-kit-components-input-date-time.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date.js +8 -0
- package/fesm2015/taiga-ui-kit-components-input-date.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone-international.js +4 -2
- package/fesm2015/taiga-ui-kit-components-input-phone-international.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-slider.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-tag.js +4 -4
- package/fesm2015/taiga-ui-kit-components-input-tag.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-items-with-more.js +3 -3
- package/fesm2015/taiga-ui-kit-components-items-with-more.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-line-clamp.js +19 -14
- package/fesm2015/taiga-ui-kit-components-line-clamp.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select-option.js +2 -2
- package/fesm2015/taiga-ui-kit-components-multi-select-option.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select.js +14 -10
- package/fesm2015/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-pdf-viewer.js +1 -1
- package/fesm2015/taiga-ui-kit-components-pdf-viewer.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-push.js +2 -2
- package/fesm2015/taiga-ui-kit-components-push.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-select-option.js +22 -7
- package/fesm2015/taiga-ui-kit-components-select-option.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-slider.js +4 -4
- package/fesm2015/taiga-ui-kit-components-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-stepper.js +3 -3
- package/fesm2015/taiga-ui-kit-components-stepper.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tabs.js +16 -6
- package/fesm2015/taiga-ui-kit-components-tabs.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tree.js +4 -4
- package/fesm2015/taiga-ui-kit-components-tree.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components.js +1 -0
- package/fesm2015/taiga-ui-kit-components.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-data-list-dropdown-manager.js +6 -6
- package/fesm2015/taiga-ui-kit-directives-data-list-dropdown-manager.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-lazy-loading.js +2 -2
- package/fesm2015/taiga-ui-kit-directives-lazy-loading.js.map +1 -1
- package/package.json +5 -5
|
@@ -13,6 +13,7 @@ export * from '@taiga-ui/kit/components/checkbox-block';
|
|
|
13
13
|
export * from '@taiga-ui/kit/components/checkbox-labeled';
|
|
14
14
|
export * from '@taiga-ui/kit/components/combo-box';
|
|
15
15
|
export * from '@taiga-ui/kit/components/data-list-wrapper';
|
|
16
|
+
export * from '@taiga-ui/kit/components/elastic-container';
|
|
16
17
|
export * from '@taiga-ui/kit/components/files';
|
|
17
18
|
export * from '@taiga-ui/kit/components/filter';
|
|
18
19
|
export * from '@taiga-ui/kit/components/input';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components.js","sources":["../../../projects/kit/components/taiga-ui-kit-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components.js","sources":["../../../projects/kit/components/taiga-ui-kit-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG"}
|
|
@@ -2,10 +2,10 @@ import { __decorate } from 'tslib';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { ElementRef, Directive, Self, Inject, ContentChildren, NgModule } from '@angular/core';
|
|
4
4
|
import * as i1 from '@taiga-ui/cdk';
|
|
5
|
-
import { EMPTY_QUERY, tuiTypedFromEvent,
|
|
5
|
+
import { EMPTY_QUERY, tuiTypedFromEvent, tuiQueryListChanges, tuiPreventDefault, tuiGetClosestFocusable, TuiDestroyService, tuiPure } from '@taiga-ui/cdk';
|
|
6
6
|
import { TuiDropdownDirective } from '@taiga-ui/core';
|
|
7
7
|
import { merge, EMPTY } from 'rxjs';
|
|
8
|
-
import { takeUntil, switchMap, take, filter, tap, map, shareReplay,
|
|
8
|
+
import { takeUntil, switchMap, take, filter, tap, map, shareReplay, debounceTime } from 'rxjs/operators';
|
|
9
9
|
|
|
10
10
|
class TuiDataListDropdownManagerDirective {
|
|
11
11
|
constructor(destroy$) {
|
|
@@ -29,7 +29,7 @@ class TuiDataListDropdownManagerDirective {
|
|
|
29
29
|
}
|
|
30
30
|
const { nativeElement } = dropdown.dropdownBoxRef.location;
|
|
31
31
|
const mouseEnter$ = tuiTypedFromEvent(nativeElement, 'mouseenter').pipe(take(1));
|
|
32
|
-
const esc$ = merge(tuiTypedFromEvent(element.nativeElement, 'keydown'), tuiTypedFromEvent(nativeElement, 'keydown')).pipe(filter(({
|
|
32
|
+
const esc$ = merge(tuiTypedFromEvent(element.nativeElement, 'keydown'), tuiTypedFromEvent(nativeElement, 'keydown')).pipe(filter(({ key }) => key === 'Escape'));
|
|
33
33
|
return merge(mouseEnter$, esc$).pipe(tap(event => {
|
|
34
34
|
if (dropdown.dropdownBoxRef) {
|
|
35
35
|
event.stopPropagation();
|
|
@@ -41,13 +41,13 @@ class TuiDataListDropdownManagerDirective {
|
|
|
41
41
|
.subscribe();
|
|
42
42
|
}
|
|
43
43
|
get elements$() {
|
|
44
|
-
return
|
|
44
|
+
return tuiQueryListChanges(this.elements).pipe(map(array => array.map(({ nativeElement }) => nativeElement)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
45
45
|
}
|
|
46
46
|
get right$() {
|
|
47
|
-
return this.elements$.pipe(switchMap(elements => merge(...elements.map((element, index) => tuiTypedFromEvent(element, 'keydown').pipe(filter(({
|
|
47
|
+
return this.elements$.pipe(switchMap(elements => merge(...elements.map((element, index) => tuiTypedFromEvent(element, 'keydown').pipe(filter(({ key }) => key === 'ArrowRight'), tuiPreventDefault(), map(() => index))))));
|
|
48
48
|
}
|
|
49
49
|
get immediate$() {
|
|
50
|
-
return this.elements$.pipe(switchMap(elements => merge(...elements.map((element, index) => tuiTypedFromEvent(element, 'click').pipe(
|
|
50
|
+
return this.elements$.pipe(switchMap(elements => merge(...elements.map((element, index) => tuiTypedFromEvent(element, 'click').pipe(map(() => index))))));
|
|
51
51
|
}
|
|
52
52
|
get debounce$() {
|
|
53
53
|
return this.elements$.pipe(switchMap(elements => merge(...elements.map((element, index) => merge(tuiTypedFromEvent(element, 'focus'), tuiTypedFromEvent(element, 'blur')).pipe(filter(({ relatedTarget }) => this.notInDropdown(relatedTarget, index)), map(({ type }) => (type === 'focus' ? index : NaN)))))), debounceTime(300));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-directives-data-list-dropdown-manager.js","sources":["../../../projects/kit/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.ts","../../../projects/kit/directives/data-list-dropdown-manager/data-list-dropdown-manager.module.ts","../../../projects/kit/directives/data-list-dropdown-manager/taiga-ui-kit-directives-data-list-dropdown-manager.ts"],"sourcesContent":["import {\n AfterViewInit,\n ContentChildren,\n Directive,\n ElementRef,\n Inject,\n QueryList,\n Self,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n TuiDestroyService,\n tuiGetClosestFocusable,\n tuiItemsQueryListObservable,\n tuiPreventDefault,\n tuiPure,\n tuiTypedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core';\nimport {EMPTY, merge, Observable} from 'rxjs';\nimport {\n debounceTime,\n filter,\n map,\n mapTo,\n shareReplay,\n switchMap,\n take,\n takeUntil,\n tap,\n} from 'rxjs/operators';\n\n@Directive({\n selector: 'tui-data-list[tuiDataListDropdownManager]',\n providers: [TuiDestroyService],\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 constructor(\n @Self() @Inject(TuiDestroyService) private readonly destroy$: TuiDestroyService,\n ) {}\n\n ngAfterViewInit(): void {\n this.right$.pipe(takeUntil(this.destroy$)).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.toggle(index === active);\n });\n\n const element = this.elements.get(active);\n const dropdown = this.dropdowns.get(active);\n\n if (!element || !dropdown?.dropdownBoxRef) {\n return EMPTY;\n }\n\n const {nativeElement} = dropdown.dropdownBoxRef.location;\n const mouseEnter$ = tuiTypedFromEvent(\n nativeElement,\n 'mouseenter',\n ).pipe(take(1));\n const esc$ = merge(\n tuiTypedFromEvent(element.nativeElement, 'keydown'),\n tuiTypedFromEvent(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 element.nativeElement.focus();\n dropdown.toggle('offsetX' in event);\n }),\n );\n }),\n takeUntil(this.destroy$),\n )\n .subscribe();\n }\n\n @tuiPure\n private get elements$(): Observable<readonly HTMLElement[]> {\n return tuiItemsQueryListObservable(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 tuiTypedFromEvent(element, 'keydown').pipe(\n filter(({keyCode}) => keyCode === 39),\n tuiPreventDefault(),\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 tuiTypedFromEvent(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 tuiTypedFromEvent(element, 'focus'),\n tuiTypedFromEvent(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 return !this.dropdowns\n .get(index)\n ?.dropdownBoxRef?.location.nativeElement.contains(element);\n }\n\n private tryToFocus(index: number): void {\n const content = this.dropdowns.get(index)?.dropdownBoxRef?.location.nativeElement;\n\n if (!content) {\n return;\n }\n\n // First item is focus trap\n const focusTrap = tuiGetClosestFocusable({initial: content, root: content});\n const item = tuiGetClosestFocusable({\n initial: focusTrap || content,\n root: content,\n });\n\n if (item) {\n item.focus();\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiDataListDropdownManagerDirective} from './data-list-dropdown-manager.directive';\n\n@NgModule({\n declarations: [TuiDataListDropdownManagerDirective],\n exports: [TuiDataListDropdownManagerDirective],\n})\nexport class TuiDataListDropdownManagerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAoCa,mCAAmC,CAAA;AAO5C,IAAA,WAAA,CACwD,QAA2B,EAAA;QAA3B,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAmB;QANlE,IAAS,CAAA,SAAA,GAAoC,WAAW,CAAC;QAGzD,IAAQ,CAAA,QAAA,GAAuC,WAAW,CAAC;KAIxE;IAEJ,eAAe,GAAA;AACX,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,IAAG;AACzD,YAAA,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,SAAC,CAAC,CAAC;QAEH,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC;AACjC,aAAA,IAAI,CACD,SAAS,CAAC,MAAM,IAAG;YACf,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,KAAI;AACvC,gBAAA,QAAQ,CAAC,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;AACtC,aAAC,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAE5C,YAAA,IAAI,CAAC,OAAO,IAAI,EAAC,QAAQ,KAAR,IAAA,IAAA,Q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Ae;uBAAC,oBAAoB,EAAE,EAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAC,CAAA;AAqDhE,aAAA,CAAA,EAAA,SAAS,EAQT,EAAA,EAAA,MAAM,EAiBN,EAAA,EAAA,UAAU,MAaV,SAAS,EAAA,EAAA,EAAA,EAAA,CAAA;;MC3HZ,gCAAgC,CAAA;;8HAAhC,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+HAAhC,gCAAgC,EAAA,YAAA,EAAA,CAH1B,mCAAmC,CAAA,EAAA,OAAA,EAAA,CACxC,mCAAmC,CAAA,EAAA,CAAA,CAAA;+HAEpC,gCAAgC,EAAA,CAAA,CAAA;4FAAhC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAJ5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,mCAAmC,CAAC;oBACnD,OAAO,EAAE,CAAC,mCAAmC,CAAC;AACjD,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-directives-data-list-dropdown-manager.js","sources":["../../../projects/kit/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.ts","../../../projects/kit/directives/data-list-dropdown-manager/data-list-dropdown-manager.module.ts","../../../projects/kit/directives/data-list-dropdown-manager/taiga-ui-kit-directives-data-list-dropdown-manager.ts"],"sourcesContent":["import {\n AfterViewInit,\n ContentChildren,\n Directive,\n ElementRef,\n Inject,\n QueryList,\n Self,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n TuiDestroyService,\n tuiGetClosestFocusable,\n tuiPreventDefault,\n tuiPure,\n tuiQueryListChanges,\n tuiTypedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core';\nimport {EMPTY, merge, Observable} from 'rxjs';\nimport {\n debounceTime,\n filter,\n map,\n shareReplay,\n switchMap,\n take,\n takeUntil,\n tap,\n} from 'rxjs/operators';\n\n@Directive({\n selector: 'tui-data-list[tuiDataListDropdownManager]',\n providers: [TuiDestroyService],\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 constructor(\n @Self() @Inject(TuiDestroyService) private readonly destroy$: TuiDestroyService,\n ) {}\n\n ngAfterViewInit(): void {\n this.right$.pipe(takeUntil(this.destroy$)).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.toggle(index === active);\n });\n\n const element = this.elements.get(active);\n const dropdown = this.dropdowns.get(active);\n\n if (!element || !dropdown?.dropdownBoxRef) {\n return EMPTY;\n }\n\n const {nativeElement} = dropdown.dropdownBoxRef.location;\n const mouseEnter$ = tuiTypedFromEvent(\n nativeElement,\n 'mouseenter',\n ).pipe(take(1));\n const esc$ = merge(\n tuiTypedFromEvent(element.nativeElement, 'keydown'),\n tuiTypedFromEvent(nativeElement, 'keydown'),\n ).pipe(filter(({key}) => key === 'Escape'));\n\n return merge(mouseEnter$, esc$).pipe(\n tap(event => {\n if (dropdown.dropdownBoxRef) {\n event.stopPropagation();\n }\n\n element.nativeElement.focus();\n dropdown.toggle('offsetX' in event);\n }),\n );\n }),\n takeUntil(this.destroy$),\n )\n .subscribe();\n }\n\n @tuiPure\n private get elements$(): Observable<readonly HTMLElement[]> {\n return tuiQueryListChanges(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 tuiTypedFromEvent(element, 'keydown').pipe(\n filter(({key}) => key === 'ArrowRight'),\n tuiPreventDefault(),\n map(() => 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 tuiTypedFromEvent(element, 'click').pipe(map(() => 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 tuiTypedFromEvent(element, 'focus'),\n tuiTypedFromEvent(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 return !this.dropdowns\n .get(index)\n ?.dropdownBoxRef?.location.nativeElement.contains(element);\n }\n\n private tryToFocus(index: number): void {\n const content = this.dropdowns.get(index)?.dropdownBoxRef?.location.nativeElement;\n\n if (!content) {\n return;\n }\n\n // First item is focus trap\n const focusTrap = tuiGetClosestFocusable({initial: content, root: content});\n const item = tuiGetClosestFocusable({\n initial: focusTrap || content,\n root: content,\n });\n\n if (item) {\n item.focus();\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiDataListDropdownManagerDirective} from './data-list-dropdown-manager.directive';\n\n@NgModule({\n declarations: [TuiDataListDropdownManagerDirective],\n exports: [TuiDataListDropdownManagerDirective],\n})\nexport class TuiDataListDropdownManagerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAmCa,mCAAmC,CAAA;AAO5C,IAAA,WAAA,CACwD,QAA2B,EAAA;QAA3B,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAmB;QANlE,IAAS,C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AAA,EAAA,CACxC,mCAAmC,CAAA,EAAA,CAAA,CAAA;+HAEpC,gCAAgC,EAAA,CAAA,CAAA;4FAAhC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAJ5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,mCAAmC,CAAC;oBACnD,OAAO,EAAE,CAAC,mCAAmC,CAAC;AACjD,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -4,12 +4,12 @@ import { IntersectionObserverService } from '@ng-web-apis/intersection-observer'
|
|
|
4
4
|
import { tuiWatch, TuiDestroyService } from '@taiga-ui/cdk';
|
|
5
5
|
import * as i1 from 'rxjs';
|
|
6
6
|
import { Observable, of, Subject } from 'rxjs';
|
|
7
|
-
import { switchMap, filter,
|
|
7
|
+
import { switchMap, filter, map, catchError, take, takeUntil } from 'rxjs/operators';
|
|
8
8
|
|
|
9
9
|
class TuiLazyLoadingService extends Observable {
|
|
10
10
|
constructor(changeDetectorRef, destroy$, intersections$) {
|
|
11
11
|
super(subscriber => this.src$
|
|
12
|
-
.pipe(switchMap(src => intersections$.pipe(filter(([{ isIntersecting }]) => isIntersecting),
|
|
12
|
+
.pipe(switchMap(src => intersections$.pipe(filter(([{ isIntersecting }]) => isIntersecting), map(() => src), catchError(() => of(src)), tuiWatch(changeDetectorRef), take(1))), takeUntil(destroy$))
|
|
13
13
|
.subscribe(subscriber));
|
|
14
14
|
this.src$ = new Subject();
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-directives-lazy-loading.js","sources":["../../../projects/kit/directives/lazy-loading/lazy-loading.service.ts","../../../projects/kit/directives/lazy-loading/lazy-loading.directive.ts","../../../projects/kit/directives/lazy-loading/lazy-loading.module.ts","../../../projects/kit/directives/lazy-loading/taiga-ui-kit-directives-lazy-loading.ts"],"sourcesContent":["import {ChangeDetectorRef, Inject, Injectable, Self} from '@angular/core';\nimport {SafeResourceUrl} from '@angular/platform-browser';\nimport {IntersectionObserverService} from '@ng-web-apis/intersection-observer';\nimport {TuiDestroyService, tuiWatch} from '@taiga-ui/cdk';\nimport {Observable, of, Subject} from 'rxjs';\nimport {catchError, filter,
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-directives-lazy-loading.js","sources":["../../../projects/kit/directives/lazy-loading/lazy-loading.service.ts","../../../projects/kit/directives/lazy-loading/lazy-loading.directive.ts","../../../projects/kit/directives/lazy-loading/lazy-loading.module.ts","../../../projects/kit/directives/lazy-loading/taiga-ui-kit-directives-lazy-loading.ts"],"sourcesContent":["import {ChangeDetectorRef, Inject, Injectable, Self} from '@angular/core';\nimport {SafeResourceUrl} from '@angular/platform-browser';\nimport {IntersectionObserverService} from '@ng-web-apis/intersection-observer';\nimport {TuiDestroyService, tuiWatch} from '@taiga-ui/cdk';\nimport {Observable, of, Subject} from 'rxjs';\nimport {catchError, filter, map, switchMap, take, takeUntil} from 'rxjs/operators';\n\n@Injectable()\nexport class TuiLazyLoadingService extends Observable<SafeResourceUrl | string> {\n private readonly src$ = new Subject<SafeResourceUrl | string>();\n\n constructor(\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Self() @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(IntersectionObserverService)\n intersections$: Observable<IntersectionObserverEntry[]>,\n ) {\n super(subscriber =>\n this.src$\n .pipe(\n switchMap(src =>\n intersections$.pipe(\n filter(([{isIntersecting}]) => isIntersecting),\n map(() => src),\n catchError(() => of(src)),\n tuiWatch(changeDetectorRef),\n take(1),\n ),\n ),\n takeUntil(destroy$),\n )\n .subscribe(subscriber),\n );\n }\n\n next(src: SafeResourceUrl | string): void {\n this.src$.next(src);\n }\n}\n","import {\n Directive,\n ElementRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n} from '@angular/core';\nimport {SafeResourceUrl} from '@angular/platform-browser';\nimport {IntersectionObserverService} from '@ng-web-apis/intersection-observer';\nimport {TuiDestroyService} from '@taiga-ui/cdk';\n\nimport {TuiLazyLoadingService} from './lazy-loading.service';\n\n@Directive({\n selector: 'img[loading=\"lazy\"]',\n providers: [TuiLazyLoadingService, IntersectionObserverService, TuiDestroyService],\n})\nexport class TuiLazyLoadingDirective {\n @Input('src')\n set srcSetter(src: SafeResourceUrl | string) {\n this.src = this.supported ? src : null;\n this.src$.next(src);\n }\n\n @HostBinding('style.animation')\n animation = 'tuiSkeletonVibe ease-in-out 1s infinite alternate';\n\n @HostBinding('style.background')\n background = 'var(--tui-clear-hover)';\n\n @HostBinding('attr.src')\n src: SafeResourceUrl | string | null = null;\n\n constructor(\n @Inject(TuiLazyLoadingService)\n private readonly src$: TuiLazyLoadingService,\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLImageElement>,\n ) {\n if (!this.supported) {\n this.src$.subscribe(src => {\n this.src = src;\n });\n }\n }\n\n private get supported(): boolean {\n return 'loading' in this.elementRef.nativeElement;\n }\n\n @HostListener('load')\n onLoad(): void {\n this.background = '';\n this.animation = '';\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiLazyLoadingDirective} from './lazy-loading.directive';\n\n@NgModule({\n declarations: [TuiLazyLoadingDirective],\n exports: [TuiLazyLoadingDirective],\n})\nexport class TuiLazyLoadingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAQM,MAAO,qBAAsB,SAAQ,UAAoC,CAAA;AAG3E,IAAA,WAAA,CAC+B,iBAAoC,EAC5B,QAA0B,EAE7D,cAAuD,EAAA;AAEvD,QAAA,KAAK,CAAC,UAAU,IACZ,IAAI,CAAC,IAAI;AACJ,aAAA,IAAI,CACD,SAAS,CAAC,GAAG,IACT,cAAc,CAAC,IAAI,CACf,MAAM,CAAC,CAAC,CAAC,EAAC,cAAc,EAAC,CAAC,KAAK,cAAc,CAAC,EAC9C,GAAG,CAAC,MAAM,GAAG,CAAC,EACd,UAAU,CAAC,MAAM,EAA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AA;;0BAkBQ,MAAM;2BAAC,qBAAqB,CAAA;;0BAE5B,MAAM;2BAAC,UAAU,CAAA;4CAjBlB,SAAS,EAAA,CAAA;sBADZ,KAAK;uBAAC,KAAK,CAAA;gBAOZ,SAAS,EAAA,CAAA;sBADR,WAAW;uBAAC,iBAAiB,CAAA;gBAI9B,UAAU,EAAA,CAAA;sBADT,WAAW;uBAAC,kBAAkB,CAAA;gBAI/B,GAAG,EAAA,CAAA;sBADF,WAAW;uBAAC,UAAU,CAAA;gBAqBvB,MAAM,EAAA,CAAA;sBADL,YAAY;uBAAC,MAAM,CAAA;;;MC3CX,oBAAoB,CAAA;;kHAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mHAApB,oBAAoB,EAAA,YAAA,EAAA,CAHd,uBAAuB,CAAA,EAAA,OAAA,EAAA,CAC5B,uBAAuB,CAAA,EAAA,CAAA,CAAA;mHAExB,oBAAoB,EAAA,CAAA,CAAA;4FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;AACrC,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0-dev.main-e7166ca",
|
|
4
4
|
"description": "Taiga UI Angular main components kit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@ng-web-apis/intersection-observer": "^3.0.0",
|
|
17
17
|
"text-mask-core": "^5.1.2",
|
|
18
|
-
"tslib": "
|
|
18
|
+
"tslib": ">=2.0.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@angular/common": ">=12.0.0",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@angular/router": ">=12.0.0",
|
|
25
25
|
"@ng-web-apis/common": ">=2.0.0",
|
|
26
26
|
"@ng-web-apis/mutation-observer": ">=2.0.0",
|
|
27
|
-
"@taiga-ui/cdk": ">=3.
|
|
28
|
-
"@taiga-ui/core": ">=3.
|
|
29
|
-
"@taiga-ui/i18n": ">=3.
|
|
27
|
+
"@taiga-ui/cdk": ">=3.16.0",
|
|
28
|
+
"@taiga-ui/core": ">=3.16.0",
|
|
29
|
+
"@taiga-ui/i18n": ">=3.16.0",
|
|
30
30
|
"@tinkoff/ng-polymorpheus": ">=4.0.0",
|
|
31
31
|
"rxjs": ">=6.0.0"
|
|
32
32
|
},
|