@taiga-ui/kit 4.52.0-canary.763e67d → 4.52.0-canary.7c53ccc
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/components/avatar/avatar-labeled.component.d.ts +1 -1
- package/components/badged-content/badged-content.directive.d.ts +1 -2
- package/components/breadcrumbs/breadcrumbs.component.d.ts +2 -2
- package/components/calendar-range/calendar-range.component.d.ts +0 -1
- package/components/carousel/carousel-autoscroll.directive.d.ts +1 -2
- package/components/carousel/carousel-scroll.directive.d.ts +1 -1
- package/components/carousel/carousel.component.d.ts +5 -8
- package/components/carousel/carousel.directive.d.ts +2 -1
- package/components/copy/copy.component.d.ts +0 -1
- package/components/files/file/file.component.d.ts +4 -16
- package/components/files/files/files.component.d.ts +1 -3
- package/components/files/input-files/input-files.component.d.ts +2 -2
- package/components/files/input-files/input-files.content.d.ts +7 -8
- package/components/files/input-files/input-files.directive.d.ts +1 -2
- package/components/filter/filter.component.d.ts +6 -7
- package/components/fullscreen/fullscreen.component.d.ts +2 -2
- package/components/input-color/input-color.component.d.ts +5 -9
- package/components/input-date/input-date.component.d.ts +2 -2
- package/components/input-date/input-date.directive.d.ts +12 -11
- package/components/input-date-multi/input-date-multi.directive.d.ts +1 -1
- package/components/input-date-range/input-date-range.directive.d.ts +5 -3
- package/components/input-date-time/input-date-time.directive.d.ts +9 -9
- package/components/input-inline/input-inline.component.d.ts +3 -2
- package/components/input-month/input-month.component.d.ts +3 -5
- package/components/input-number/input-number.directive.d.ts +4 -6
- package/components/input-number/input-number.options.d.ts +2 -3
- package/components/input-number/step/input-number-step.component.d.ts +3 -3
- package/components/input-phone/input-phone.directive.d.ts +6 -8
- package/components/input-phone-international/input-phone-international.component.d.ts +8 -10
- package/components/input-phone-international/input-phone-international.options.d.ts +1 -0
- package/components/input-pin/input-pin.component.d.ts +3 -4
- package/components/input-range/input-range.component.d.ts +21 -51
- package/components/input-time/input-time.directive.d.ts +1 -1
- package/components/input-year/input-year.directive.d.ts +4 -6
- package/components/items-with-more/items-with-more.component.d.ts +6 -6
- package/components/items-with-more/items-with-more.directive.d.ts +6 -6
- package/components/multi-select/multi-select-native/multi-select-native.component.d.ts +5 -4
- package/components/pager/pager.component.d.ts +12 -12
- package/components/preview/pagination/preview-pagination.component.d.ts +4 -9
- package/components/preview/preview.component.d.ts +5 -5
- package/components/preview/zoom/preview-zoom.component.d.ts +8 -16
- package/components/progress/progress-circle/progress-circle.component.d.ts +7 -11
- package/components/push/push.component.d.ts +6 -7
- package/components/radio-list/radio-list.component.d.ts +9 -9
- package/components/range/range.component.d.ts +3 -4
- package/components/slider/helpers/slider-key-steps.directive.d.ts +6 -5
- package/components/slider/helpers/slider-readonly.directive.d.ts +2 -4
- package/components/slider/helpers/slider-thumb-label.component.d.ts +2 -4
- package/components/slider/slider.component.d.ts +4 -7
- package/components/stepper/step.component.d.ts +9 -2
- package/components/stepper/stepper.component.d.ts +1 -3
- package/components/tabs/tabs-horizontal.directive.d.ts +3 -4
- package/components/tabs/tabs-vertical.directive.d.ts +2 -2
- package/components/tabs/tabs-with-more.component.d.ts +12 -16
- package/components/tabs/tabs.directive.d.ts +5 -7
- package/components/textarea/textarea.component.d.ts +7 -8
- package/components/tiles/tile.component.d.ts +7 -10
- package/components/tiles/tile.service.d.ts +1 -1
- package/components/tiles/tiles.component.d.ts +4 -7
- package/components/tree/components/tree/tree.component.d.ts +7 -7
- package/components/tree/components/tree-item/tree-item.component.d.ts +1 -1
- package/components/tree/directives/tree-children.directive.d.ts +2 -2
- package/components/tree/directives/tree-controller.directive.d.ts +4 -5
- package/components/tree/directives/tree-item-controller.directive.d.ts +2 -2
- package/components/tree/directives/tree-node.directive.d.ts +5 -4
- package/directives/appearance-proxy/appearance-proxy.directive.d.ts +10 -0
- package/directives/appearance-proxy/index.d.ts +1 -0
- package/directives/highlight/highlight.directive.d.ts +6 -5
- package/directives/index.d.ts +1 -0
- package/directives/present/present.directive.d.ts +2 -3
- package/fesm2022/taiga-ui-kit-components-accordion.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-action-bar.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-avatar.mjs +9 -19
- package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-badge.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-badged-content.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-block.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +6 -11
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-button-loading.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-calendar-month.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +2 -10
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-carousel.mjs +31 -52
- package/fesm2022/taiga-ui-kit-components-carousel.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-chip.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-comment.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-confirm.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-copy.mjs +3 -8
- package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-drawer.mjs +3 -13
- package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs +72 -154
- package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-filter.mjs +13 -12
- package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-fullscreen.mjs +5 -6
- package/fesm2022/taiga-ui-kit-components-fullscreen.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs +1 -10
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-color.mjs +5 -17
- package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +9 -3
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +10 -29
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date.mjs +14 -24
- package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs +8 -10
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month.mjs +8 -24
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +21 -27
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +28 -44
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs +10 -25
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs +7 -14
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-range.mjs +34 -59
- package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-year.mjs +5 -19
- package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +39 -59
- package/fesm2022/taiga-ui-kit-components-items-with-more.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-message.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs +14 -19
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-pager.mjs +27 -39
- package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pagination.mjs +10 -14
- package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pin.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-preview.mjs +39 -119
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-progress.mjs +17 -32
- package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pulse.mjs +1 -3
- package/fesm2022/taiga-ui-kit-components-pulse.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-push.mjs +9 -21
- package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs +19 -31
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-range.mjs +14 -24
- package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-segmented.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-slider.mjs +37 -55
- package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-stepper.mjs +32 -25
- package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-switch.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tabs.mjs +56 -111
- package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +13 -25
- package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tiles.mjs +26 -58
- package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-toast.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tree.mjs +41 -72
- package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs +27 -0
- package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-directives-button-group.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-connected.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-highlight.mjs +17 -13
- package/fesm2022/taiga-ui-kit-directives-highlight.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-present.mjs +7 -10
- package/fesm2022/taiga-ui-kit-directives-present.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives.mjs +1 -0
- package/fesm2022/taiga-ui-kit-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-flag.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-tokens.mjs +2 -26
- package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
- package/package.json +26 -22
- package/pipes/flag/flag.pipe.d.ts +1 -2
- package/styles/components/avatar.less +14 -14
- package/styles/components/badge.less +3 -3
- package/styles/components/block.less +4 -4
- package/styles/components/chip.less +3 -3
- package/styles/components/comment.less +1 -1
- package/styles/components/message.less +1 -1
- package/styles/components/pin.less +3 -3
- package/styles/components/switch.less +1 -0
- package/styles/components/toast.less +1 -1
- package/tokens/index.d.ts +0 -1
- package/utils/maskito.binding.d.ts +1 -1
- package/tokens/calendar-date-stream.d.ts +0 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { signal,
|
|
3
|
+
import { viewChildren, signal, computed, inject, input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { MutationObserverService, WA_MUTATION_OBSERVER_INIT } from '@ng-web-apis/mutation-observer';
|
|
6
6
|
import { tuiWatch } from '@taiga-ui/cdk/observables';
|
|
@@ -8,14 +8,17 @@ import { delay, map } from 'rxjs';
|
|
|
8
8
|
|
|
9
9
|
class TuiPager {
|
|
10
10
|
constructor() {
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
11
|
+
this.items = viewChildren('item');
|
|
12
|
+
this.start = signal(0);
|
|
13
|
+
this.end = signal(0);
|
|
13
14
|
this.left = signal(0);
|
|
15
|
+
this.gap = computed(() => (this.size() === 'm' ? 9 : 7));
|
|
14
16
|
this.maxWidth = toSignal(inject(MutationObserverService, { self: true }).pipe(delay(0), map(() => this.visibleWidth), tuiWatch(), takeUntilDestroyed()), { initialValue: 0 });
|
|
15
|
-
this.max = 6;
|
|
16
|
-
this.count =
|
|
17
|
-
this.size = 'm';
|
|
18
|
-
this.
|
|
17
|
+
this.max = input(6);
|
|
18
|
+
this.count = input(6);
|
|
19
|
+
this.size = input('m');
|
|
20
|
+
this.valueContent = input();
|
|
21
|
+
this.index = input(0);
|
|
19
22
|
}
|
|
20
23
|
ngOnChanges() {
|
|
21
24
|
this.move();
|
|
@@ -23,31 +26,29 @@ class TuiPager {
|
|
|
23
26
|
ngAfterViewInit() {
|
|
24
27
|
this.move();
|
|
25
28
|
}
|
|
26
|
-
get gap() {
|
|
27
|
-
return this.size === 'm' ? 9 : 7;
|
|
28
|
-
}
|
|
29
29
|
get visibleRange() {
|
|
30
|
-
const max = this.max > this.count ? this.count : this.max;
|
|
31
|
-
const start = Math.min(Math.max(this.index - Math.floor(max / 2), 0), this.count - max);
|
|
30
|
+
const max = this.max() > this.count() ? this.count() : this.max();
|
|
31
|
+
const start = Math.min(Math.max(this.index() - Math.floor(max / 2), 0), this.count() - max);
|
|
32
32
|
return [start, start + (max - 1)];
|
|
33
33
|
}
|
|
34
34
|
get visibleWidth() {
|
|
35
|
-
return (
|
|
36
|
-
.
|
|
37
|
-
.
|
|
35
|
+
return (this.items()
|
|
36
|
+
.map((item) => item.nativeElement.offsetWidth)
|
|
37
|
+
.slice(this.start(), this.end() + 1)
|
|
38
|
+
.reduce((sum, item) => sum + item + this.gap(), 0) - this.gap());
|
|
38
39
|
}
|
|
39
40
|
move() {
|
|
40
41
|
const [start, end] = this.visibleRange;
|
|
41
|
-
this.start
|
|
42
|
-
this.end
|
|
43
|
-
let left = this.start * this.gap;
|
|
44
|
-
for (let i = 0; i < this.start; i++) {
|
|
45
|
-
left += this.items
|
|
42
|
+
this.start.set(start);
|
|
43
|
+
this.end.set(end);
|
|
44
|
+
let left = this.start() * this.gap();
|
|
45
|
+
for (let i = 0; i < this.start(); i++) {
|
|
46
|
+
left += this.items()[i]?.nativeElement.offsetWidth ?? 0;
|
|
46
47
|
}
|
|
47
48
|
this.left.set(-1 * left);
|
|
48
49
|
}
|
|
49
50
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPager, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
50
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiPager, isStandalone: true, selector: "tui-pager", inputs: { max: "max", count: "count", size: "size", valueContent: "valueContent", index: "index" }, host: { properties: { "attr.data-size": "size", "style.--t-gap.px": "gap", "style.max-width.px": "maxWidth()" } }, providers: [
|
|
51
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiPager, isStandalone: true, selector: "tui-pager", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, valueContent: { classPropertyName: "valueContent", publicName: "valueContent", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-size": "size()", "style.--t-gap.px": "gap()", "style.max-width.px": "maxWidth()" } }, providers: [
|
|
51
52
|
MutationObserverService,
|
|
52
53
|
{
|
|
53
54
|
provide: WA_MUTATION_OBSERVER_INIT,
|
|
@@ -58,7 +59,7 @@ class TuiPager {
|
|
|
58
59
|
subtree: true,
|
|
59
60
|
},
|
|
60
61
|
},
|
|
61
|
-
], viewQueries: [{ propertyName: "items", predicate: ["item"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"t-items\"\n [style.transform]=\"`translateX(calc(var(--tui-inline) * ${left()}px))`\"\n>\n @for (_ of '-'.repeat(count); track $index) {\n <div\n #item\n class=\"t-item\"\n [attr.data-index]=\"$index\"\n [class._active]=\"$index === index\"\n [class._last]=\"$index === count - 1\"\n [class._post-active]=\"$index === index + 1\"\n [class._pre-active]=\"$index === index - 1\"\n [class._pre-last]=\"$index === count - 2\"\n [class._visible]=\"$index >= start && $index <= end\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent || null; context: {$implicit: $index}\" />\n </div>\n }\n</div>\n", styles: [":host{display:flex;align-items:center;overflow:hidden}:host[data-size=m]{--t-size: .5rem;--t-small-dot: scale(.75);--t-super-small-dot: scale(.5);--t-icon-size: 1rem;min-block-size:1.25rem}:host-context(tui-root._mobile) :host[data-size=m]{--t-icon-size: .875rem}:host[data-size=s]{--t-size: .375rem;--t-small-dot: scale(.666);--t-super-small-dot: scale(.333);--t-icon-size: .75rem;min-block-size:1rem}:host-context(tui-root._mobile) :host[data-size=s]{--t-icon-size: .6875rem}.t-items{display:flex;gap:var(--t-gap);transition:transform var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}.t-item{display:flex;align-self:center;align-items:center;justify-content:center;color:var(--tui-background-neutral-2)}.t-item._active{color:var(--tui-background-accent-1)}.t-item:empty:before{content:\"\";display:flex;min-inline-size:var(--t-size);min-block-size:var(--t-size);border-radius:100%;background:currentColor;transition:inherit}.t-item:empty:not(._visible):before,.t-item:empty:not(._visible)+.t-item:not(._active):not(._pre-active):empty:before,.t-item:empty:not(._last):not(._post-active):not(._active):nth-last-child(1 of._visible):before{transform:var(--t-super-small-dot)!important}.t-item:empty:not(._last)._post-active:nth-last-child(1 of._visible):before,.t-item:empty:not(._visible)+.t-item._pre-active:empty:before,.t-item:empty:not(._visible)+.t-item:empty+.t-item:not(._active):empty:before,.t-item:empty:not(._pre-last):nth-last-child(2 of._visible):not(._active):before{transform:var(--t-small-dot)}.t-item:empty+.t-item:not(:empty)._pre-last{transform:scale(.64)}.t-item:empty+.t-item:not(:empty)._pre-last:nth-last-child(2 of._visible){transform:scale(1)}.t-item::ng-deep>tui-icon{inline-size:var(--t-icon-size);block-size:var(--t-icon-size)}.t-item,.t-item::ng-deep>tui-icon{transition:all var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
62
|
+
], viewQueries: [{ propertyName: "items", predicate: ["item"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"t-items\"\n [style.transform]=\"`translateX(calc(var(--tui-inline) * ${left()}px))`\"\n>\n @for (_ of '-'.repeat(count()); track $index) {\n <div\n #item\n class=\"t-item\"\n [attr.data-index]=\"$index\"\n [class._active]=\"$index === index()\"\n [class._last]=\"$index === count() - 1\"\n [class._post-active]=\"$index === index() + 1\"\n [class._pre-active]=\"$index === index() - 1\"\n [class._pre-last]=\"$index === count() - 2\"\n [class._visible]=\"$index >= start() && $index <= end()\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent() || null; context: {$implicit: $index}\" />\n </div>\n }\n</div>\n", styles: [":host{display:flex;align-items:center;overflow:hidden}:host[data-size=m]{--t-size: .5rem;--t-small-dot: scale(.75);--t-super-small-dot: scale(.5);--t-icon-size: 1rem;min-block-size:1.25rem}:host-context(tui-root._mobile) :host[data-size=m]{--t-icon-size: .875rem}:host[data-size=s]{--t-size: .375rem;--t-small-dot: scale(.666);--t-super-small-dot: scale(.333);--t-icon-size: .75rem;min-block-size:1rem}:host-context(tui-root._mobile) :host[data-size=s]{--t-icon-size: .6875rem}.t-items{display:flex;gap:var(--t-gap);transition:transform var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}.t-item{display:flex;align-self:center;align-items:center;justify-content:center;color:var(--tui-background-neutral-2)}.t-item._active{color:var(--tui-background-accent-1)}.t-item:empty:before{content:\"\";display:flex;min-inline-size:var(--t-size);min-block-size:var(--t-size);border-radius:100%;background:currentColor;transition:inherit}.t-item:empty:not(._visible):before,.t-item:empty:not(._visible)+.t-item:not(._active):not(._pre-active):empty:before,.t-item:empty:not(._last):not(._post-active):not(._active):nth-last-child(1 of._visible):before{transform:var(--t-super-small-dot)!important}.t-item:empty:not(._last)._post-active:nth-last-child(1 of._visible):before,.t-item:empty:not(._visible)+.t-item._pre-active:empty:before,.t-item:empty:not(._visible)+.t-item:empty+.t-item:not(._active):empty:before,.t-item:empty:not(._pre-last):nth-last-child(2 of._visible):not(._active):before{transform:var(--t-small-dot)}.t-item:empty+.t-item:not(:empty)._pre-last{transform:scale(.64)}.t-item:empty+.t-item:not(:empty)._pre-last:nth-last-child(2 of._visible){transform:scale(1)}.t-item::ng-deep>tui-icon{inline-size:var(--t-icon-size);block-size:var(--t-icon-size)}.t-item,.t-item::ng-deep>tui-icon{transition:all var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
62
63
|
}
|
|
63
64
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPager, decorators: [{
|
|
64
65
|
type: Component,
|
|
@@ -74,24 +75,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
74
75
|
},
|
|
75
76
|
},
|
|
76
77
|
], host: {
|
|
77
|
-
'[attr.data-size]': 'size',
|
|
78
|
-
'[style.--t-gap.px]': 'gap',
|
|
78
|
+
'[attr.data-size]': 'size()',
|
|
79
|
+
'[style.--t-gap.px]': 'gap()',
|
|
79
80
|
'[style.max-width.px]': 'maxWidth()',
|
|
80
|
-
}, template: "<div\n class=\"t-items\"\n [style.transform]=\"`translateX(calc(var(--tui-inline) * ${left()}px))`\"\n>\n @for (_ of '-'.repeat(count); track $index) {\n <div\n #item\n class=\"t-item\"\n [attr.data-index]=\"$index\"\n [class._active]=\"$index === index\"\n [class._last]=\"$index === count - 1\"\n [class._post-active]=\"$index === index + 1\"\n [class._pre-active]=\"$index === index - 1\"\n [class._pre-last]=\"$index === count - 2\"\n [class._visible]=\"$index >= start && $index <= end\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent || null; context: {$implicit: $index}\" />\n </div>\n }\n</div>\n", styles: [":host{display:flex;align-items:center;overflow:hidden}:host[data-size=m]{--t-size: .5rem;--t-small-dot: scale(.75);--t-super-small-dot: scale(.5);--t-icon-size: 1rem;min-block-size:1.25rem}:host-context(tui-root._mobile) :host[data-size=m]{--t-icon-size: .875rem}:host[data-size=s]{--t-size: .375rem;--t-small-dot: scale(.666);--t-super-small-dot: scale(.333);--t-icon-size: .75rem;min-block-size:1rem}:host-context(tui-root._mobile) :host[data-size=s]{--t-icon-size: .6875rem}.t-items{display:flex;gap:var(--t-gap);transition:transform var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}.t-item{display:flex;align-self:center;align-items:center;justify-content:center;color:var(--tui-background-neutral-2)}.t-item._active{color:var(--tui-background-accent-1)}.t-item:empty:before{content:\"\";display:flex;min-inline-size:var(--t-size);min-block-size:var(--t-size);border-radius:100%;background:currentColor;transition:inherit}.t-item:empty:not(._visible):before,.t-item:empty:not(._visible)+.t-item:not(._active):not(._pre-active):empty:before,.t-item:empty:not(._last):not(._post-active):not(._active):nth-last-child(1 of._visible):before{transform:var(--t-super-small-dot)!important}.t-item:empty:not(._last)._post-active:nth-last-child(1 of._visible):before,.t-item:empty:not(._visible)+.t-item._pre-active:empty:before,.t-item:empty:not(._visible)+.t-item:empty+.t-item:not(._active):empty:before,.t-item:empty:not(._pre-last):nth-last-child(2 of._visible):not(._active):before{transform:var(--t-small-dot)}.t-item:empty+.t-item:not(:empty)._pre-last{transform:scale(.64)}.t-item:empty+.t-item:not(:empty)._pre-last:nth-last-child(2 of._visible){transform:scale(1)}.t-item::ng-deep>tui-icon{inline-size:var(--t-icon-size);block-size:var(--t-icon-size)}.t-item,.t-item::ng-deep>tui-icon{transition:all var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}\n"] }]
|
|
81
|
-
}]
|
|
82
|
-
type: ViewChildren,
|
|
83
|
-
args: ['item']
|
|
84
|
-
}], max: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], count: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}], size: [{
|
|
89
|
-
type: Input
|
|
90
|
-
}], valueContent: [{
|
|
91
|
-
type: Input
|
|
92
|
-
}], index: [{
|
|
93
|
-
type: Input
|
|
94
|
-
}] } });
|
|
81
|
+
}, template: "<div\n class=\"t-items\"\n [style.transform]=\"`translateX(calc(var(--tui-inline) * ${left()}px))`\"\n>\n @for (_ of '-'.repeat(count()); track $index) {\n <div\n #item\n class=\"t-item\"\n [attr.data-index]=\"$index\"\n [class._active]=\"$index === index()\"\n [class._last]=\"$index === count() - 1\"\n [class._post-active]=\"$index === index() + 1\"\n [class._pre-active]=\"$index === index() - 1\"\n [class._pre-last]=\"$index === count() - 2\"\n [class._visible]=\"$index >= start() && $index <= end()\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent() || null; context: {$implicit: $index}\" />\n </div>\n }\n</div>\n", styles: [":host{display:flex;align-items:center;overflow:hidden}:host[data-size=m]{--t-size: .5rem;--t-small-dot: scale(.75);--t-super-small-dot: scale(.5);--t-icon-size: 1rem;min-block-size:1.25rem}:host-context(tui-root._mobile) :host[data-size=m]{--t-icon-size: .875rem}:host[data-size=s]{--t-size: .375rem;--t-small-dot: scale(.666);--t-super-small-dot: scale(.333);--t-icon-size: .75rem;min-block-size:1rem}:host-context(tui-root._mobile) :host[data-size=s]{--t-icon-size: .6875rem}.t-items{display:flex;gap:var(--t-gap);transition:transform var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}.t-item{display:flex;align-self:center;align-items:center;justify-content:center;color:var(--tui-background-neutral-2)}.t-item._active{color:var(--tui-background-accent-1)}.t-item:empty:before{content:\"\";display:flex;min-inline-size:var(--t-size);min-block-size:var(--t-size);border-radius:100%;background:currentColor;transition:inherit}.t-item:empty:not(._visible):before,.t-item:empty:not(._visible)+.t-item:not(._active):not(._pre-active):empty:before,.t-item:empty:not(._last):not(._post-active):not(._active):nth-last-child(1 of._visible):before{transform:var(--t-super-small-dot)!important}.t-item:empty:not(._last)._post-active:nth-last-child(1 of._visible):before,.t-item:empty:not(._visible)+.t-item._pre-active:empty:before,.t-item:empty:not(._visible)+.t-item:empty+.t-item:not(._active):empty:before,.t-item:empty:not(._pre-last):nth-last-child(2 of._visible):not(._active):before{transform:var(--t-small-dot)}.t-item:empty+.t-item:not(:empty)._pre-last{transform:scale(.64)}.t-item:empty+.t-item:not(:empty)._pre-last:nth-last-child(2 of._visible){transform:scale(1)}.t-item::ng-deep>tui-icon{inline-size:var(--t-icon-size);block-size:var(--t-icon-size)}.t-item,.t-item::ng-deep>tui-icon{transition:all var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}\n"] }]
|
|
82
|
+
}] });
|
|
95
83
|
|
|
96
84
|
/**
|
|
97
85
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-pager.mjs","sources":["../../../projects/kit/components/pager/pager.component.ts","../../../projects/kit/components/pager/pager.component.html","../../../projects/kit/components/pager/taiga-ui-kit-components-pager.ts"],"sourcesContent":["import {NgTemplateOutlet} from '@angular/common';\nimport {\n type AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n inject,\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-pager.mjs","sources":["../../../projects/kit/components/pager/pager.component.ts","../../../projects/kit/components/pager/pager.component.html","../../../projects/kit/components/pager/taiga-ui-kit-components-pager.ts"],"sourcesContent":["import {NgTemplateOutlet} from '@angular/common';\nimport {\n type AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n type ElementRef,\n inject,\n input,\n type OnChanges,\n signal,\n type TemplateRef,\n viewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed, toSignal} from '@angular/core/rxjs-interop';\nimport {\n MutationObserverService,\n WA_MUTATION_OBSERVER_INIT,\n} from '@ng-web-apis/mutation-observer';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\nimport {delay, map} from 'rxjs';\n\n@Component({\n selector: 'tui-pager',\n imports: [NgTemplateOutlet],\n templateUrl: './pager.component.html',\n styleUrl: './pager.styles.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n MutationObserverService,\n {\n provide: WA_MUTATION_OBSERVER_INIT,\n useValue: {\n attributeOldValue: true,\n characterData: true,\n childList: true,\n subtree: true,\n },\n },\n ],\n host: {\n '[attr.data-size]': 'size()',\n '[style.--t-gap.px]': 'gap()',\n '[style.max-width.px]': 'maxWidth()',\n },\n})\nexport class TuiPager implements OnChanges, AfterViewInit {\n protected readonly items = viewChildren<ElementRef<HTMLElement>>('item');\n protected readonly start = signal(0);\n protected readonly end = signal(0);\n protected readonly left = signal(0);\n protected readonly gap = computed(() => (this.size() === 'm' ? 9 : 7));\n protected readonly maxWidth = toSignal(\n inject(MutationObserverService, {self: true}).pipe(\n delay(0),\n map(() => this.visibleWidth),\n tuiWatch(),\n takeUntilDestroyed(),\n ),\n {initialValue: 0},\n );\n\n public readonly max = input(6);\n public readonly count = input(6);\n public readonly size = input<TuiSizeS>('m');\n public readonly valueContent = input<TemplateRef<unknown>>();\n public readonly index = input(0);\n\n public ngOnChanges(): void {\n this.move();\n }\n\n public ngAfterViewInit(): void {\n this.move();\n }\n\n private get visibleRange(): [start: number, end: number] {\n const max = this.max() > this.count() ? this.count() : this.max();\n const start = Math.min(\n Math.max(this.index() - Math.floor(max / 2), 0),\n this.count() - max,\n );\n\n return [start, start + (max - 1)];\n }\n\n private get visibleWidth(): number {\n return (\n this.items()\n .map((item) => item.nativeElement.offsetWidth)\n .slice(this.start(), this.end() + 1)\n .reduce((sum, item) => sum + item + this.gap(), 0) - this.gap()\n );\n }\n\n private move(): void {\n const [start, end] = this.visibleRange;\n\n this.start.set(start);\n this.end.set(end);\n\n let left = this.start() * this.gap();\n\n for (let i = 0; i < this.start(); i++) {\n left += this.items()[i]?.nativeElement.offsetWidth ?? 0;\n }\n\n this.left.set(-1 * left);\n }\n}\n","<div\n class=\"t-items\"\n [style.transform]=\"`translateX(calc(var(--tui-inline) * ${left()}px))`\"\n>\n @for (_ of '-'.repeat(count()); track $index) {\n <div\n #item\n class=\"t-item\"\n [attr.data-index]=\"$index\"\n [class._active]=\"$index === index()\"\n [class._last]=\"$index === count() - 1\"\n [class._post-active]=\"$index === index() + 1\"\n [class._pre-active]=\"$index === index() - 1\"\n [class._pre-last]=\"$index === count() - 2\"\n [class._visible]=\"$index >= start() && $index <= end()\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent() || null; context: {$implicit: $index}\" />\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MA+Ca,QAAQ,CAAA;AAxBrB,IAAA,WAAA,GAAA;AAyBuB,QAAA,IAAA,CAAA,KAAK,GAAG,YAAY,CAA0B,MAAM,CAAC;AACrD,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;AACjB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC;AACf,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;QAChB,IAAG,CAAA,GAAA,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CA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,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,swBAoBA,09DDKc,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAsBjB,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAxBpB,SAAS;+BACI,WAAW,EAAA,OAAA,EACZ,CAAC,gBAAgB,CAAC,mBAGV,uBAAuB,CAAC,MAAM,EACpC,SAAA,EAAA;wBACP,uBAAuB;AACvB,wBAAA;AACI,4BAAA,OAAO,EAAE,yBAAyB;AAClC,4BAAA,QAAQ,EAAE;AACN,gCAAA,iBAAiB,EAAE,IAAI;AACvB,gCAAA,aAAa,EAAE,IAAI;AACnB,gCAAA,SAAS,EAAE,IAAI;AACf,gCAAA,OAAO,EAAE,IAAI;AAChB,6BAAA;AACJ,yBAAA;qBACJ,EACK,IAAA,EAAA;AACF,wBAAA,kBAAkB,EAAE,QAAQ;AAC5B,wBAAA,oBAAoB,EAAE,OAAO;AAC7B,wBAAA,sBAAsB,EAAE,YAAY;AACvC,qBAAA,EAAA,QAAA,EAAA,swBAAA,EAAA,MAAA,EAAA,CAAA,k6DAAA,CAAA,EAAA;;;AE7CL;;AAEG;;;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { computed, inject, input, model,
|
|
3
|
-
import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
|
|
2
|
+
import { viewChildren, ElementRef, computed, inject, input, model, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
3
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
5
4
|
import { tuiIsFocusedIn } from '@taiga-ui/cdk/utils/focus';
|
|
6
5
|
import { tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
@@ -19,7 +18,7 @@ const ELLIPSIS_ITEM_LENGTH = 1;
|
|
|
19
18
|
const ACTIVE_ITEM_LENGTH = 1;
|
|
20
19
|
class TuiPagination {
|
|
21
20
|
constructor() {
|
|
22
|
-
this.els =
|
|
21
|
+
this.els = viewChildren('element', { read: ElementRef });
|
|
23
22
|
this.el = tuiInjectElement();
|
|
24
23
|
this.maxHalfLength = computed(() => this.sidePadding() + ELLIPSIS_ITEM_LENGTH + this.activePadding());
|
|
25
24
|
this.maxElementsLength = computed(() => this.maxHalfLength() * 2 + ACTIVE_ITEM_LENGTH);
|
|
@@ -56,7 +55,7 @@ class TuiPagination {
|
|
|
56
55
|
break;
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
return (this.els.find((_, index) => index === activeElementIndex)?.nativeElement ??
|
|
58
|
+
return (this.els().find((_, index) => index === activeElementIndex)?.nativeElement ??
|
|
60
59
|
null);
|
|
61
60
|
});
|
|
62
61
|
}
|
|
@@ -96,17 +95,17 @@ class TuiPagination {
|
|
|
96
95
|
this.updateIndex(index);
|
|
97
96
|
}
|
|
98
97
|
onElementKeyDownArrowLeft(element) {
|
|
99
|
-
if (element === this.els
|
|
98
|
+
if (element === this.els()[0]?.nativeElement) {
|
|
100
99
|
return;
|
|
101
100
|
}
|
|
102
|
-
const previous = this.els.find((_, index, array) => array[index + 1]?.nativeElement === element);
|
|
101
|
+
const previous = this.els().find((_, index, array) => array[index + 1]?.nativeElement === element);
|
|
103
102
|
previous?.nativeElement.focus();
|
|
104
103
|
}
|
|
105
104
|
onElementKeyDownArrowRight(element) {
|
|
106
|
-
if (element === this.els.
|
|
105
|
+
if (element === this.els()[this.els().length - 1]?.nativeElement) {
|
|
107
106
|
return;
|
|
108
107
|
}
|
|
109
|
-
const next = this.els.find((_, index, array) => array[index - 1]?.nativeElement === element);
|
|
108
|
+
const next = this.els().find((_, index, array) => array[index - 1]?.nativeElement === element);
|
|
110
109
|
next?.nativeElement.focus();
|
|
111
110
|
}
|
|
112
111
|
onArrowClick(direction) {
|
|
@@ -130,15 +129,12 @@ class TuiPagination {
|
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
131
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPagination, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
133
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiPagination, isStandalone: true, selector: "tui-pagination", inputs: { length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, focusable: { classPropertyName: "focusable", publicName: "focusable", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, activePadding: { classPropertyName: "activePadding", publicName: "activePadding", isSignal: true, isRequired: false, transformFunction: null }, sidePadding: { classPropertyName: "sidePadding", publicName: "sidePadding", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { index: "indexChange" }, viewQueries: [{ propertyName: "els", predicate: ["element"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"t-content\">\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledLeft()\"\n [iconStart]=\"icons.decrement\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('left')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[0] }}\n </button>\n @for (_ of '-'.repeat(elementsLength()); track $index) {\n @let index = getItemIndexByElementIndex($index);\n @if (index !== null) {\n <button\n #element\n automation-id=\"tui-pagination__element\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode(index)\"\n [disabled]=\"disabled()\"\n [size]=\"buttonSize()\"\n [tabIndex]=\"elementIsFocusable(index) ? 0 : -1\"\n (click)=\"onElementClick(index)\"\n (keydown.arrowLeft.prevent)=\"onElementKeyDownArrowLeft(element)\"\n (keydown.arrowRight.prevent)=\"onElementKeyDownArrowRight(element)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || index + 1 as text; context: {$implicit: index}\">\n {{ text }}\n </ng-container>\n </button>\n } @else {\n <div\n automation-id=\"tui-pagination__element\"\n class=\"t-ellipsis\"\n [class.t-ellipsis_small]=\"size() === 'm'\"\n ></div>\n }\n }\n\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledRight()\"\n [iconStart]=\"icons.increment\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('right')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[1] }}\n </button>\n</div>\n", styles: [":host{display:block;font:var(--tui-font-
|
|
132
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiPagination, isStandalone: true, selector: "tui-pagination", inputs: { length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, focusable: { classPropertyName: "focusable", publicName: "focusable", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, activePadding: { classPropertyName: "activePadding", publicName: "activePadding", isSignal: true, isRequired: false, transformFunction: null }, sidePadding: { classPropertyName: "sidePadding", publicName: "sidePadding", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { index: "indexChange" }, viewQueries: [{ propertyName: "els", predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div class=\"t-content\">\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledLeft()\"\n [iconStart]=\"icons.decrement\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('left')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[0] }}\n </button>\n @for (_ of '-'.repeat(elementsLength()); track $index) {\n @let index = getItemIndexByElementIndex($index);\n @if (index !== null) {\n <button\n #element\n automation-id=\"tui-pagination__element\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode(index)\"\n [disabled]=\"disabled()\"\n [size]=\"buttonSize()\"\n [tabIndex]=\"elementIsFocusable(index) ? 0 : -1\"\n (click)=\"onElementClick(index)\"\n (keydown.arrowLeft.prevent)=\"onElementKeyDownArrowLeft(element)\"\n (keydown.arrowRight.prevent)=\"onElementKeyDownArrowRight(element)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || index + 1 as text; context: {$implicit: index}\">\n {{ text }}\n </ng-container>\n </button>\n } @else {\n <div\n automation-id=\"tui-pagination__element\"\n class=\"t-ellipsis\"\n [class.t-ellipsis_small]=\"size() === 'm'\"\n ></div>\n }\n }\n\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledRight()\"\n [iconStart]=\"icons.increment\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('right')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[1] }}\n </button>\n</div>\n", styles: [":host{display:block;font:var(--tui-font-body-s);color:var(--tui-text-primary);text-align:center}.t-content{display:flex;justify-content:center}.t-button{margin:0 .125rem;flex-shrink:0}.t-button[tuiButton]:not(.t-button_small){min-inline-size:var(--tui-height-s);padding:0 .5rem}.t-button[tuiButton]:not(.t-button_small)[data-size=xs]{min-inline-size:var(--tui-height-xs);padding:0 .375rem}.t-button:first-child{transform:scaleX(var(--tui-inline));margin-inline-start:0}.t-button:last-child{transform:scaleX(var(--tui-inline));margin-inline-end:0}.t-ellipsis{inline-size:var(--tui-height-s);block-size:var(--tui-height-s);line-height:var(--tui-height-s);margin:0 .125rem;flex-shrink:0;color:var(--tui-text-action);text-align:center;cursor:default}.t-ellipsis_small{inline-size:var(--tui-height-xs);block-size:var(--tui-height-xs);line-height:var(--tui-height-xs)}.t-ellipsis:before{content:\"\\2026\"}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
134
133
|
}
|
|
135
134
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPagination, decorators: [{
|
|
136
135
|
type: Component,
|
|
137
|
-
args: [{ selector: 'tui-pagination', imports: [PolymorpheusOutlet, TuiButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"t-content\">\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledLeft()\"\n [iconStart]=\"icons.decrement\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('left')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[0] }}\n </button>\n @for (_ of '-'.repeat(elementsLength()); track $index) {\n @let index = getItemIndexByElementIndex($index);\n @if (index !== null) {\n <button\n #element\n automation-id=\"tui-pagination__element\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode(index)\"\n [disabled]=\"disabled()\"\n [size]=\"buttonSize()\"\n [tabIndex]=\"elementIsFocusable(index) ? 0 : -1\"\n (click)=\"onElementClick(index)\"\n (keydown.arrowLeft.prevent)=\"onElementKeyDownArrowLeft(element)\"\n (keydown.arrowRight.prevent)=\"onElementKeyDownArrowRight(element)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || index + 1 as text; context: {$implicit: index}\">\n {{ text }}\n </ng-container>\n </button>\n } @else {\n <div\n automation-id=\"tui-pagination__element\"\n class=\"t-ellipsis\"\n [class.t-ellipsis_small]=\"size() === 'm'\"\n ></div>\n }\n }\n\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledRight()\"\n [iconStart]=\"icons.increment\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('right')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[1] }}\n </button>\n</div>\n", styles: [":host{display:block;font:var(--tui-font-
|
|
138
|
-
}]
|
|
139
|
-
type: ViewChildren,
|
|
140
|
-
args: ['element', { read: ElementRef }]
|
|
141
|
-
}] } });
|
|
136
|
+
args: [{ selector: 'tui-pagination', imports: [PolymorpheusOutlet, TuiButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"t-content\">\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledLeft()\"\n [iconStart]=\"icons.decrement\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('left')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[0] }}\n </button>\n @for (_ of '-'.repeat(elementsLength()); track $index) {\n @let index = getItemIndexByElementIndex($index);\n @if (index !== null) {\n <button\n #element\n automation-id=\"tui-pagination__element\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode(index)\"\n [disabled]=\"disabled()\"\n [size]=\"buttonSize()\"\n [tabIndex]=\"elementIsFocusable(index) ? 0 : -1\"\n (click)=\"onElementClick(index)\"\n (keydown.arrowLeft.prevent)=\"onElementKeyDownArrowLeft(element)\"\n (keydown.arrowRight.prevent)=\"onElementKeyDownArrowRight(element)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || index + 1 as text; context: {$implicit: index}\">\n {{ text }}\n </ng-container>\n </button>\n } @else {\n <div\n automation-id=\"tui-pagination__element\"\n class=\"t-ellipsis\"\n [class.t-ellipsis_small]=\"size() === 'm'\"\n ></div>\n }\n }\n\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledRight()\"\n [iconStart]=\"icons.increment\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('right')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[1] }}\n </button>\n</div>\n", styles: [":host{display:block;font:var(--tui-font-body-s);color:var(--tui-text-primary);text-align:center}.t-content{display:flex;justify-content:center}.t-button{margin:0 .125rem;flex-shrink:0}.t-button[tuiButton]:not(.t-button_small){min-inline-size:var(--tui-height-s);padding:0 .5rem}.t-button[tuiButton]:not(.t-button_small)[data-size=xs]{min-inline-size:var(--tui-height-xs);padding:0 .375rem}.t-button:first-child{transform:scaleX(var(--tui-inline));margin-inline-start:0}.t-button:last-child{transform:scaleX(var(--tui-inline));margin-inline-end:0}.t-ellipsis{inline-size:var(--tui-height-s);block-size:var(--tui-height-s);line-height:var(--tui-height-s);margin:0 .125rem;flex-shrink:0;color:var(--tui-text-action);text-align:center;cursor:default}.t-ellipsis_small{inline-size:var(--tui-height-xs);block-size:var(--tui-height-xs);line-height:var(--tui-height-xs)}.t-ellipsis:before{content:\"\\2026\"}\n"] }]
|
|
137
|
+
}] });
|
|
142
138
|
|
|
143
139
|
/**
|
|
144
140
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-pagination.mjs","sources":["../../../projects/kit/components/pagination/pagination.options.ts","../../../projects/kit/components/pagination/pagination.component.ts","../../../projects/kit/components/pagination/pagination.template.html","../../../projects/kit/components/pagination/taiga-ui-kit-components-pagination.ts"],"sourcesContent":["import {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiSizeL} from '@taiga-ui/core/types';\n\nexport interface TuiPaginationOptions {\n readonly size: TuiSizeL;\n readonly appearance: TuiStringHandler<boolean>;\n}\n\nexport const [TUI_PAGINATION_OPTIONS, tuiPaginationOptionsProvider] =\n tuiCreateOptions<TuiPaginationOptions>({\n size: 'l',\n appearance: (isActive) => (isActive ? 'primary' : 'flat'),\n });\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n model,\n type QueryList,\n ViewChildren,\n} from '@angular/core';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsFocusedIn} from '@taiga-ui/cdk/utils/focus';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TUI_COMMON_ICONS} from '@taiga-ui/core/tokens';\nimport {type TuiHorizontalDirection} from '@taiga-ui/core/types';\nimport {TUI_PAGINATION_TEXTS} from '@taiga-ui/kit/tokens';\nimport {type PolymorpheusContent, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TUI_PAGINATION_OPTIONS} from './pagination.options';\n\nconst ELLIPSIS_ITEM_LENGTH = 1;\nconst ACTIVE_ITEM_LENGTH = 1;\n\n@Component({\n selector: 'tui-pagination',\n imports: [PolymorpheusOutlet, TuiButton],\n templateUrl: './pagination.template.html',\n styleUrl: './pagination.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiPagination {\n @ViewChildren('element', {read: ElementRef})\n private readonly els: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n private readonly el = tuiInjectElement();\n\n private readonly maxHalfLength = computed(\n () => this.sidePadding() + ELLIPSIS_ITEM_LENGTH + this.activePadding(),\n );\n\n private readonly maxElementsLength = computed(\n () => this.maxHalfLength() * 2 + ACTIVE_ITEM_LENGTH,\n );\n\n private readonly lastElementIndex = computed(() => this.elementsLength() - 1);\n private readonly itemsFit = computed(() => this.length() <= this.maxElementsLength());\n private readonly lastIndex = computed(() => this.length() - 1);\n\n private readonly reverseIndex = computed(\n (): number => this.lastIndex() - this.index(),\n );\n\n protected readonly texts = inject(TUI_PAGINATION_TEXTS);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly options = inject(TUI_PAGINATION_OPTIONS);\n\n protected readonly buttonSize = computed(() => (this.size() === 'm' ? 'xs' : 's'));\n\n protected readonly elementsLength = computed(() =>\n this.itemsFit() ? this.length() : this.maxElementsLength(),\n );\n\n public readonly length = input(1);\n public readonly focusable = input(true);\n public readonly size = input(this.options.size);\n public readonly disabled = input(false);\n public readonly activePadding = input(1);\n public readonly sidePadding = input(1);\n public readonly content = input<PolymorpheusContent<TuiContext<number>>>();\n public readonly index = model(0);\n public readonly arrowIsDisabledRight = computed(() => this.reverseIndex() === 0);\n public readonly arrowIsDisabledLeft = computed(() => this.index() === 0);\n public readonly nativeFocusableElement = computed((): HTMLElement | null => {\n if (this.disabled()) {\n return null;\n }\n\n let activeElementIndex = 0;\n\n for (let i = 0; i < this.elementsLength(); i++) {\n const itemIndex = this.getItemIndexByElementIndex(i);\n\n if (itemIndex) {\n activeElementIndex++;\n }\n\n if (itemIndex === this.index()) {\n break;\n }\n }\n\n return (\n this.els.find((_, index) => index === activeElementIndex)?.nativeElement ??\n null\n );\n });\n\n public get focused(): boolean {\n return tuiIsFocusedIn(this.el);\n }\n\n protected elementIsFocusable(index: number): boolean {\n return this.index() === index && !this.focused;\n }\n\n /**\n * Get index by element index\n * @param elementIndex\n * @returns index or null (for '…')\n */\n protected getItemIndexByElementIndex(elementIndex: number): number | null {\n const reverseElementIndex = this.lastElementIndex() - elementIndex;\n\n if (elementIndex < this.sidePadding()) {\n return elementIndex;\n }\n\n if (reverseElementIndex < this.sidePadding()) {\n return this.lastIndex() - reverseElementIndex;\n }\n\n if (elementIndex === this.sidePadding() && this.hasCollapsedItems(this.index())) {\n return null;\n }\n\n if (\n reverseElementIndex === this.sidePadding() &&\n this.hasCollapsedItems(this.reverseIndex())\n ) {\n return null;\n }\n\n const computedIndex = this.index() - this.maxHalfLength() + elementIndex;\n\n return tuiClamp(\n computedIndex,\n elementIndex,\n this.lastIndex() - reverseElementIndex,\n );\n }\n\n protected getElementMode(index = -1): string {\n return this.options.appearance(this.index() === index);\n }\n\n protected onElementClick(index: number): void {\n this.updateIndex(index);\n }\n\n protected onElementKeyDownArrowLeft(element: HTMLElement): void {\n if (element === this.els.first.nativeElement) {\n return;\n }\n\n const previous = this.els.find(\n (_, index, array) => array[index + 1]?.nativeElement === element,\n );\n\n previous?.nativeElement.focus();\n }\n\n protected onElementKeyDownArrowRight(element: HTMLElement): void {\n if (element === this.els.last.nativeElement) {\n return;\n }\n\n const next = this.els.find(\n (_, index, array) => array[index - 1]?.nativeElement === element,\n );\n\n next?.nativeElement.focus();\n }\n\n protected onArrowClick(direction: TuiHorizontalDirection): void {\n this.tryChangeTo(direction);\n this.nativeFocusableElement()?.focus();\n }\n\n /**\n * Are there collapsed items at that index\n * @param index\n * @returns there are collapsed items\n */\n private hasCollapsedItems(index: number): boolean {\n return !this.itemsFit() && index > this.maxHalfLength();\n }\n\n private tryChangeTo(direction: TuiHorizontalDirection): void {\n this.updateIndex(\n tuiClamp(\n this.index() + (direction === 'right' ? 1 : -1),\n 0,\n this.lastIndex(),\n ),\n );\n }\n\n private updateIndex(index: number): void {\n if (this.index() !== index) {\n this.index.set(index);\n }\n }\n}\n","<div class=\"t-content\">\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledLeft()\"\n [iconStart]=\"icons.decrement\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('left')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[0] }}\n </button>\n @for (_ of '-'.repeat(elementsLength()); track $index) {\n @let index = getItemIndexByElementIndex($index);\n @if (index !== null) {\n <button\n #element\n automation-id=\"tui-pagination__element\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode(index)\"\n [disabled]=\"disabled()\"\n [size]=\"buttonSize()\"\n [tabIndex]=\"elementIsFocusable(index) ? 0 : -1\"\n (click)=\"onElementClick(index)\"\n (keydown.arrowLeft.prevent)=\"onElementKeyDownArrowLeft(element)\"\n (keydown.arrowRight.prevent)=\"onElementKeyDownArrowRight(element)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || index + 1 as text; context: {$implicit: index}\">\n {{ text }}\n </ng-container>\n </button>\n } @else {\n <div\n automation-id=\"tui-pagination__element\"\n class=\"t-ellipsis\"\n [class.t-ellipsis_small]=\"size() === 'm'\"\n ></div>\n }\n }\n\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledRight()\"\n [iconStart]=\"icons.increment\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('right')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[1] }}\n </button>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MASa,CAAC,sBAAsB,EAAE,4BAA4B,CAAC,GAC/D,gBAAgB,CAAuB;AACnC,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,UAAU,EAAE,CAAC,QAAQ,MAAM,QAAQ,GAAG,SA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GAAG,EAAA,CAAA;sBADnB,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,SAAS,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC;;;AEnC/C;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-pagination.mjs","sources":["../../../projects/kit/components/pagination/pagination.options.ts","../../../projects/kit/components/pagination/pagination.component.ts","../../../projects/kit/components/pagination/pagination.template.html","../../../projects/kit/components/pagination/taiga-ui-kit-components-pagination.ts"],"sourcesContent":["import {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiSizeL} from '@taiga-ui/core/types';\n\nexport interface TuiPaginationOptions {\n readonly size: TuiSizeL;\n readonly appearance: TuiStringHandler<boolean>;\n}\n\nexport const [TUI_PAGINATION_OPTIONS, tuiPaginationOptionsProvider] =\n tuiCreateOptions<TuiPaginationOptions>({\n size: 'l',\n appearance: (isActive) => (isActive ? 'primary' : 'flat'),\n });\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n model,\n viewChildren,\n} from '@angular/core';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsFocusedIn} from '@taiga-ui/cdk/utils/focus';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TUI_COMMON_ICONS} from '@taiga-ui/core/tokens';\nimport {type TuiHorizontalDirection} from '@taiga-ui/core/types';\nimport {TUI_PAGINATION_TEXTS} from '@taiga-ui/kit/tokens';\nimport {type PolymorpheusContent, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TUI_PAGINATION_OPTIONS} from './pagination.options';\n\nconst ELLIPSIS_ITEM_LENGTH = 1;\nconst ACTIVE_ITEM_LENGTH = 1;\n\n@Component({\n selector: 'tui-pagination',\n imports: [PolymorpheusOutlet, TuiButton],\n templateUrl: './pagination.template.html',\n styleUrl: './pagination.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiPagination {\n private readonly els = viewChildren('element', {read: ElementRef});\n private readonly el = tuiInjectElement();\n private readonly maxHalfLength = computed(\n () => this.sidePadding() + ELLIPSIS_ITEM_LENGTH + this.activePadding(),\n );\n\n private readonly maxElementsLength = computed(\n () => this.maxHalfLength() * 2 + ACTIVE_ITEM_LENGTH,\n );\n\n private readonly lastElementIndex = computed(() => this.elementsLength() - 1);\n private readonly itemsFit = computed(() => this.length() <= this.maxElementsLength());\n private readonly lastIndex = computed(() => this.length() - 1);\n private readonly reverseIndex = computed(\n (): number => this.lastIndex() - this.index(),\n );\n\n protected readonly texts = inject(TUI_PAGINATION_TEXTS);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly options = inject(TUI_PAGINATION_OPTIONS);\n protected readonly buttonSize = computed(() => (this.size() === 'm' ? 'xs' : 's'));\n protected readonly elementsLength = computed(() =>\n this.itemsFit() ? this.length() : this.maxElementsLength(),\n );\n\n public readonly length = input(1);\n public readonly focusable = input(true);\n public readonly size = input(this.options.size);\n public readonly disabled = input(false);\n public readonly activePadding = input(1);\n public readonly sidePadding = input(1);\n public readonly content = input<PolymorpheusContent<TuiContext<number>>>();\n public readonly index = model(0);\n public readonly arrowIsDisabledRight = computed(() => this.reverseIndex() === 0);\n public readonly arrowIsDisabledLeft = computed(() => this.index() === 0);\n public readonly nativeFocusableElement = computed((): HTMLElement | null => {\n if (this.disabled()) {\n return null;\n }\n\n let activeElementIndex = 0;\n\n for (let i = 0; i < this.elementsLength(); i++) {\n const itemIndex = this.getItemIndexByElementIndex(i);\n\n if (itemIndex) {\n activeElementIndex++;\n }\n\n if (itemIndex === this.index()) {\n break;\n }\n }\n\n return (\n this.els().find((_, index) => index === activeElementIndex)?.nativeElement ??\n null\n );\n });\n\n public get focused(): boolean {\n return tuiIsFocusedIn(this.el);\n }\n\n protected elementIsFocusable(index: number): boolean {\n return this.index() === index && !this.focused;\n }\n\n /**\n * Get index by element index\n * @param elementIndex\n * @returns index or null (for '…')\n */\n protected getItemIndexByElementIndex(elementIndex: number): number | null {\n const reverseElementIndex = this.lastElementIndex() - elementIndex;\n\n if (elementIndex < this.sidePadding()) {\n return elementIndex;\n }\n\n if (reverseElementIndex < this.sidePadding()) {\n return this.lastIndex() - reverseElementIndex;\n }\n\n if (elementIndex === this.sidePadding() && this.hasCollapsedItems(this.index())) {\n return null;\n }\n\n if (\n reverseElementIndex === this.sidePadding() &&\n this.hasCollapsedItems(this.reverseIndex())\n ) {\n return null;\n }\n\n const computedIndex = this.index() - this.maxHalfLength() + elementIndex;\n\n return tuiClamp(\n computedIndex,\n elementIndex,\n this.lastIndex() - reverseElementIndex,\n );\n }\n\n protected getElementMode(index = -1): string {\n return this.options.appearance(this.index() === index);\n }\n\n protected onElementClick(index: number): void {\n this.updateIndex(index);\n }\n\n protected onElementKeyDownArrowLeft(element: HTMLElement): void {\n if (element === this.els()[0]?.nativeElement) {\n return;\n }\n\n const previous = this.els().find(\n (_, index, array) => array[index + 1]?.nativeElement === element,\n );\n\n previous?.nativeElement.focus();\n }\n\n protected onElementKeyDownArrowRight(element: HTMLElement): void {\n if (element === this.els()[this.els().length - 1]?.nativeElement) {\n return;\n }\n\n const next = this.els().find(\n (_, index, array) => array[index - 1]?.nativeElement === element,\n );\n\n next?.nativeElement.focus();\n }\n\n protected onArrowClick(direction: TuiHorizontalDirection): void {\n this.tryChangeTo(direction);\n this.nativeFocusableElement()?.focus();\n }\n\n /**\n * Are there collapsed items at that index\n * @param index\n * @returns there are collapsed items\n */\n private hasCollapsedItems(index: number): boolean {\n return !this.itemsFit() && index > this.maxHalfLength();\n }\n\n private tryChangeTo(direction: TuiHorizontalDirection): void {\n this.updateIndex(\n tuiClamp(\n this.index() + (direction === 'right' ? 1 : -1),\n 0,\n this.lastIndex(),\n ),\n );\n }\n\n private updateIndex(index: number): void {\n if (this.index() !== index) {\n this.index.set(index);\n }\n }\n}\n","<div class=\"t-content\">\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledLeft()\"\n [iconStart]=\"icons.decrement\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('left')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[0] }}\n </button>\n @for (_ of '-'.repeat(elementsLength()); track $index) {\n @let index = getItemIndexByElementIndex($index);\n @if (index !== null) {\n <button\n #element\n automation-id=\"tui-pagination__element\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode(index)\"\n [disabled]=\"disabled()\"\n [size]=\"buttonSize()\"\n [tabIndex]=\"elementIsFocusable(index) ? 0 : -1\"\n (click)=\"onElementClick(index)\"\n (keydown.arrowLeft.prevent)=\"onElementKeyDownArrowLeft(element)\"\n (keydown.arrowRight.prevent)=\"onElementKeyDownArrowRight(element)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || index + 1 as text; context: {$implicit: index}\">\n {{ text }}\n </ng-container>\n </button>\n } @else {\n <div\n automation-id=\"tui-pagination__element\"\n class=\"t-ellipsis\"\n [class.t-ellipsis_small]=\"size() === 'm'\"\n ></div>\n }\n }\n\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"getElementMode()\"\n [disabled]=\"arrowIsDisabledRight()\"\n [iconStart]=\"icons.increment\"\n [size]=\"buttonSize()\"\n (click)=\"onArrowClick('right')\"\n (mousedown.zoneless.prevent)=\"(0)\"\n >\n {{ texts()[1] }}\n </button>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MASa,CAAC,sBAAsB,EAAE,4BAA4B,CAAC,GAC/D,gBAAgB,CAAuB;AACnC,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,UAAU,EAAE,C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AAA;kBAPzB,SAAS;+BACI,gBAAgB,EAAA,OAAA,EACjB,CAAC,kBAAkB,EAAE,SAAS,CAAC,EAAA,eAAA,EAGvB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,sjEAAA,EAAA,MAAA,EAAA,CAAA,w4BAAA,CAAA,EAAA;;;AE9BnD;;AAEG;;;;"}
|
|
@@ -4,11 +4,11 @@ import { tuiWithStyles } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
|
4
4
|
|
|
5
5
|
class Styles {
|
|
6
6
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: Styles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: Styles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-pin" }, ngImport: i0, template: '', isInline: true, styles: ["[tuiPin]{--t-size: 2rem;transition-property:width,height,border,margin;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;position:relative;display:flex;inline-size:var(--t-size);block-size:var(--t-size);align-items:stretch;flex-direction:column;justify-content:center;text-align:center;border-radius:100%;font:var(--tui-font-
|
|
7
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: Styles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-pin" }, ngImport: i0, template: '', isInline: true, styles: ["[tuiPin]{--t-size: 2rem;transition-property:width,height,border,margin;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;position:relative;display:flex;inline-size:var(--t-size);block-size:var(--t-size);align-items:stretch;flex-direction:column;justify-content:center;text-align:center;border-radius:100%;font:var(--tui-font-body-s);font-weight:700;box-sizing:border-box;color:var(--tui-text-primary-on-accent-2);background:var(--tui-background-accent-2);box-shadow:0 0 0 .125rem var(--tui-background-elevation-2);border:0 solid var(--tui-background-accent-2);transform:translate(-50%,-50%)}[tuiPin]:is(a,button,select,textarea,input,label,.tui-interactive):not(:disabled){cursor:pointer}[tuiPin]:empty{--t-size: .75rem}[tuiPin]:empty:before{display:none}[tuiPin]>input{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;-webkit-appearance:none;appearance:none;border-radius:100%}[tuiPin]>img{max-block-size:100%;box-sizing:border-box;border-radius:100%;background:var(--tui-background-base)}[tuiPin]>tui-icon{transition-property:width,height;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;font-size:1.25rem;align-self:center}[tuiPin]:has(:checked){--t-size: 3.5rem;font:var(--tui-font-body-m);font-weight:700;border-width:0;margin-block-start:-2.75rem}[tuiPin]:has(:checked)>img{padding:.125rem}[tuiPin]:has(:checked)>tui-icon{font-size:2.125rem}[tuiPin]:has(:checked):before{transform:scale(.99) translate(-1.875rem,-1.875rem);opacity:1}[tuiPin]:has(:checked):after{top:4.5rem;opacity:1}[tuiPin]._open{--t-size: 3.5rem;font:var(--tui-font-body-m);font-weight:700;border-width:0;margin-block-start:-2.75rem}[tuiPin]._open>img{padding:.125rem}[tuiPin]._open>tui-icon{font-size:2.125rem}[tuiPin]._open:before{transform:scale(.99) translate(-1.875rem,-1.875rem);opacity:1}[tuiPin]._open:after{top:4.5rem;opacity:1}[tuiPin]:before{transition-property:transform,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:50%;left:50%;right:-.25rem;bottom:-.625rem;box-sizing:border-box;border-width:2.2rem 2rem;border-style:solid;border-color:inherit;opacity:0;transform:scale(.57) translate(-1.875rem,-1.875rem);transform-origin:top left;pointer-events:none;mask:url('data:image/svg+xml,<svg width=\"60\" height=\"66\" viewBox=\"0 0 60 66\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M0 30.0917C0 13.4726 13.4313 0 30.0002 0C46.5687 0 60 13.4726 60 30.0917C60 44.2105 50.4927 56.0529 37.4162 59.2986C32.5552 60.5551 31.0408 65.275 31.0408 65.275C30.8892 65.697 30.4909 66 30.0183 66C29.5453 66 29.147 65.697 28.9938 65.275C28.9938 65.275 27.481 60.5551 22.6199 59.2986C9.46433 56.0206 0 43.5901 0 30.0917ZM30 57.75C45.3259 57.75 57.75 45.3259 57.75 30C57.75 14.6741 45.3259 2.25 30 2.25C14.6741 2.25 2.25 14.6741 2.25 30C2.25 45.3259 14.6741 57.75 30 57.75Z\" /></svg>') no-repeat}[tuiPin]:after{transition-property:top,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:50%;left:50%;border:.1875rem solid currentColor;border-color:inherit;border-radius:100%;box-sizing:border-box;box-shadow:inherit;transform:translate(-50%,-50%);opacity:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
8
8
|
}
|
|
9
9
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: Styles, decorators: [{
|
|
10
10
|
type: Component,
|
|
11
|
-
args: [{ template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'tui-pin' }, styles: ["[tuiPin]{--t-size: 2rem;transition-property:width,height,border,margin;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;position:relative;display:flex;inline-size:var(--t-size);block-size:var(--t-size);align-items:stretch;flex-direction:column;justify-content:center;text-align:center;border-radius:100%;font:var(--tui-font-
|
|
11
|
+
args: [{ template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'tui-pin' }, styles: ["[tuiPin]{--t-size: 2rem;transition-property:width,height,border,margin;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;position:relative;display:flex;inline-size:var(--t-size);block-size:var(--t-size);align-items:stretch;flex-direction:column;justify-content:center;text-align:center;border-radius:100%;font:var(--tui-font-body-s);font-weight:700;box-sizing:border-box;color:var(--tui-text-primary-on-accent-2);background:var(--tui-background-accent-2);box-shadow:0 0 0 .125rem var(--tui-background-elevation-2);border:0 solid var(--tui-background-accent-2);transform:translate(-50%,-50%)}[tuiPin]:is(a,button,select,textarea,input,label,.tui-interactive):not(:disabled){cursor:pointer}[tuiPin]:empty{--t-size: .75rem}[tuiPin]:empty:before{display:none}[tuiPin]>input{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;-webkit-appearance:none;appearance:none;border-radius:100%}[tuiPin]>img{max-block-size:100%;box-sizing:border-box;border-radius:100%;background:var(--tui-background-base)}[tuiPin]>tui-icon{transition-property:width,height;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;font-size:1.25rem;align-self:center}[tuiPin]:has(:checked){--t-size: 3.5rem;font:var(--tui-font-body-m);font-weight:700;border-width:0;margin-block-start:-2.75rem}[tuiPin]:has(:checked)>img{padding:.125rem}[tuiPin]:has(:checked)>tui-icon{font-size:2.125rem}[tuiPin]:has(:checked):before{transform:scale(.99) translate(-1.875rem,-1.875rem);opacity:1}[tuiPin]:has(:checked):after{top:4.5rem;opacity:1}[tuiPin]._open{--t-size: 3.5rem;font:var(--tui-font-body-m);font-weight:700;border-width:0;margin-block-start:-2.75rem}[tuiPin]._open>img{padding:.125rem}[tuiPin]._open>tui-icon{font-size:2.125rem}[tuiPin]._open:before{transform:scale(.99) translate(-1.875rem,-1.875rem);opacity:1}[tuiPin]._open:after{top:4.5rem;opacity:1}[tuiPin]:before{transition-property:transform,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:50%;left:50%;right:-.25rem;bottom:-.625rem;box-sizing:border-box;border-width:2.2rem 2rem;border-style:solid;border-color:inherit;opacity:0;transform:scale(.57) translate(-1.875rem,-1.875rem);transform-origin:top left;pointer-events:none;mask:url('data:image/svg+xml,<svg width=\"60\" height=\"66\" viewBox=\"0 0 60 66\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M0 30.0917C0 13.4726 13.4313 0 30.0002 0C46.5687 0 60 13.4726 60 30.0917C60 44.2105 50.4927 56.0529 37.4162 59.2986C32.5552 60.5551 31.0408 65.275 31.0408 65.275C30.8892 65.697 30.4909 66 30.0183 66C29.5453 66 29.147 65.697 28.9938 65.275C28.9938 65.275 27.481 60.5551 22.6199 59.2986C9.46433 56.0206 0 43.5901 0 30.0917ZM30 57.75C45.3259 57.75 57.75 45.3259 57.75 30C57.75 14.6741 45.3259 2.25 30 2.25C14.6741 2.25 2.25 14.6741 2.25 30C2.25 45.3259 14.6741 57.75 30 57.75Z\" /></svg>') no-repeat}[tuiPin]:after{transition-property:top,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:50%;left:50%;border:.1875rem solid currentColor;border-color:inherit;border-radius:100%;box-sizing:border-box;box-shadow:inherit;transform:translate(-50%,-50%);opacity:0}\n"] }]
|
|
12
12
|
}] });
|
|
13
13
|
class TuiPin {
|
|
14
14
|
constructor() {
|