@taiga-ui/kit 4.52.0-canary.bf9131e → 4.52.0-canary.c8448e0
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/README.md +1 -1
- package/components/avatar/avatar-labeled.component.d.ts +3 -3
- package/components/avatar/avatar-stack.component.d.ts +2 -2
- package/components/badge/badge.options.d.ts +1 -3
- package/components/badge-notification/badge-notification.component.d.ts +2 -3
- package/components/badge-notification/badge-notification.options.d.ts +1 -3
- package/components/badged-content/badged-content.directive.d.ts +2 -3
- package/components/block/block.options.d.ts +1 -3
- package/components/breadcrumbs/breadcrumbs.component.d.ts +6 -7
- package/components/breadcrumbs/breadcrumbs.options.d.ts +1 -3
- package/components/button-loading/button-loading.component.d.ts +5 -5
- package/components/calendar-month/calendar-month.component.d.ts +5 -5
- package/components/calendar-range/calendar-range.component.d.ts +1 -3
- package/components/calendar-range/day-range-period.d.ts +2 -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 +15 -18
- package/components/carousel/carousel.directive.d.ts +5 -4
- package/components/chip/chip.options.d.ts +1 -3
- package/components/combo-box/combo-box.d.ts +5 -0
- package/components/combo-box/combo-box.directive.d.ts +7 -9
- package/components/combo-box/index.d.ts +1 -0
- package/components/compass/compass.component.d.ts +2 -2
- package/components/confirm/confirm.component.d.ts +4 -3
- package/components/confirm/confirm.service.d.ts +1 -1
- package/components/copy/copy.component.d.ts +3 -4
- package/components/copy/copy.directive.d.ts +2 -4
- package/components/data-list-wrapper/data-list-group-wrapper.component.d.ts +2 -2
- package/components/data-list-wrapper/data-list-wrapper.component.d.ts +14 -22
- package/components/data-list-wrapper/{data-list-wrapper.module.d.ts → data-list-wrapper.d.ts} +1 -2
- package/components/data-list-wrapper/index.d.ts +1 -1
- package/components/drawer/drawer.component.d.ts +3 -4
- package/components/files/file/file.component.d.ts +16 -29
- package/components/files/file/file.options.d.ts +1 -1
- package/components/files/files/files.component.d.ts +5 -8
- 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 +2 -2
- package/components/files/input-files/input-files.options.d.ts +1 -3
- package/components/filter/filter.component.d.ts +9 -12
- package/components/fullscreen/fullscreen.component.d.ts +5 -8
- package/components/index.d.ts +0 -3
- package/components/input-chip/input-chip.component.d.ts +9 -8
- package/components/input-chip/input-chip.d.ts +5 -1
- package/components/input-chip/input-chip.directive.d.ts +7 -12
- package/components/input-color/index.d.ts +1 -0
- package/components/input-color/input-color.component.d.ts +9 -13
- package/components/input-color/input-color.d.ts +5 -0
- package/components/input-date/input-date.component.d.ts +2 -2
- package/components/input-date/input-date.d.ts +4 -1
- package/components/input-date/input-date.directive.d.ts +21 -22
- package/components/input-date/input-date.options.d.ts +3 -3
- package/components/input-date-multi/input-date-multi.d.ts +1 -2
- package/components/input-date-multi/input-date-multi.directive.d.ts +10 -14
- package/components/input-date-range/input-date-range.d.ts +4 -1
- package/components/input-date-range/input-date-range.directive.d.ts +9 -10
- package/components/input-date-range/input-date-range.options.d.ts +2 -2
- package/components/input-date-time/input-date-time.d.ts +4 -1
- package/components/input-date-time/input-date-time.directive.d.ts +14 -14
- package/components/input-date-time/input-date-time.options.d.ts +2 -2
- 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-month/input-month.d.ts +4 -1
- package/components/input-month/input-month.directive.d.ts +6 -5
- package/components/input-month-range/input-month-range.d.ts +4 -1
- package/components/input-month-range/input-month-range.directive.d.ts +6 -5
- package/components/input-number/index.d.ts +3 -0
- package/components/input-number/input-number.d.ts +7 -2
- package/components/input-number/input-number.directive.d.ts +11 -28
- package/components/input-number/input-number.options.d.ts +4 -7
- package/components/input-number/number-mask.directive.d.ts +42 -0
- package/components/input-number/quantum.directive.d.ts +10 -8
- package/components/input-number/step/input-number-step.component.d.ts +10 -9
- package/components/input-number/transformers/bigint.value-transformer.d.ts +11 -0
- package/components/input-number/transformers/number.value-transformer.d.ts +11 -0
- package/components/input-phone/index.d.ts +1 -0
- package/components/input-phone/input-phone.d.ts +5 -0
- package/components/input-phone/input-phone.directive.d.ts +12 -14
- package/components/input-phone-international/index.d.ts +1 -0
- package/components/input-phone-international/input-phone-international.component.d.ts +14 -16
- package/components/input-phone-international/input-phone-international.d.ts +5 -0
- package/components/input-phone-international/input-phone-international.options.d.ts +2 -3
- package/components/input-pin/index.d.ts +1 -0
- package/components/input-pin/input-pin.component.d.ts +5 -6
- package/components/input-pin/input-pin.d.ts +5 -0
- package/components/input-range/index.d.ts +0 -1
- package/components/input-range/input-range.component.d.ts +23 -53
- package/components/input-slider/input-slider.d.ts +4 -1
- package/components/input-slider/input-slider.directive.d.ts +4 -3
- package/components/input-time/input-time.component.d.ts +1 -3
- package/components/input-time/input-time.d.ts +4 -1
- package/components/input-time/input-time.directive.d.ts +5 -5
- package/components/input-year/input-year.d.ts +4 -1
- package/components/input-year/input-year.directive.d.ts +8 -10
- package/components/input-year/input-year.options.d.ts +2 -2
- 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/like/like.options.d.ts +1 -1
- package/components/line-clamp/line-clamp-box.component.d.ts +1 -1
- package/components/line-clamp/line-clamp.options.d.ts +1 -3
- package/components/multi-select/multi-select-group/multi-select-group.component.d.ts +4 -6
- package/components/multi-select/multi-select-native/multi-select-native.component.d.ts +5 -4
- package/components/notification-middle/notification-middle.component.d.ts +2 -2
- package/components/notification-middle/notification-middle.directive.d.ts +4 -3
- package/components/notification-middle/notification-middle.service.d.ts +7 -3
- package/components/pager/pager.component.d.ts +12 -12
- package/components/pagination/index.d.ts +1 -0
- package/components/pagination/pagination.component.d.ts +24 -54
- package/components/pagination/pagination.options.d.ts +7 -0
- package/components/preview/dialog/preview-dialog.component.d.ts +2 -2
- package/components/preview/dialog/preview-dialog.directive.d.ts +3 -3
- package/components/preview/dialog/preview-dialog.service.d.ts +5 -2
- package/components/preview/index.d.ts +1 -0
- package/components/preview/pagination/preview-pagination.component.d.ts +6 -10
- package/components/preview/preview.component.d.ts +6 -6
- package/components/preview/preview.d.ts +2 -1
- package/{tokens/preview-icons.d.ts → components/preview/preview.options.d.ts} +1 -3
- package/components/preview/zoom/preview-zoom.component.d.ts +11 -17
- package/components/progress/progress-bar/progress-bar.component.d.ts +3 -4
- package/components/progress/progress-bar/progress-color-segments.directive.d.ts +4 -4
- package/components/progress/progress-circle/progress-circle.component.d.ts +7 -11
- package/components/progress/progress.options.d.ts +1 -3
- package/components/pulse/pulse.component.d.ts +2 -2
- package/components/push/push-alert.component.d.ts +2 -2
- package/components/push/push.component.d.ts +6 -7
- package/components/push/push.options.d.ts +4 -3
- package/components/push/push.service.d.ts +2 -2
- package/components/radio/radio.component.d.ts +1 -1
- package/components/radio-list/radio-list.component.d.ts +11 -9
- package/components/range/range.component.d.ts +3 -4
- package/components/rating/rating.component.d.ts +1 -1
- package/components/rating/rating.options.d.ts +1 -3
- package/components/routable-dialog/generate-dialogable-route.d.ts +1 -1
- package/components/segmented/segmented.component.d.ts +4 -6
- package/components/segmented/segmented.directive.d.ts +6 -7
- package/components/select/native-select/native-select.component.d.ts +7 -8
- package/components/select/select.d.ts +4 -1
- package/components/select/select.directive.d.ts +4 -3
- package/components/slider/helpers/slider-key-steps.directive.d.ts +10 -7
- 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/slider/slider.options.d.ts +1 -6
- package/components/stepper/step.component.d.ts +14 -9
- package/components/stepper/stepper.component.d.ts +5 -12
- package/components/switch/switch.component.d.ts +1 -0
- package/components/tabs/tabs-horizontal.directive.d.ts +4 -5
- 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/tabs/tabs.options.d.ts +1 -6
- package/components/textarea/index.d.ts +2 -1
- package/components/textarea/textarea.component.d.ts +10 -11
- package/components/textarea/textarea.d.ts +6 -0
- package/components/textarea/textarea.directive.d.ts +13 -0
- package/components/tiles/tile-handle.directive.d.ts +2 -1
- 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/toast/toast.component.d.ts +4 -4
- package/components/toast/toast.options.d.ts +4 -3
- package/components/toast/toast.service.d.ts +2 -2
- 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/components/tree-item-content/tree-item-content.component.d.ts +7 -0
- 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/components/tree/misc/tree.constants.d.ts +0 -3
- package/components/tree/misc/tree.tokens.d.ts +1 -6
- package/directives/appearance-proxy/appearance-proxy.directive.d.ts +10 -0
- package/directives/appearance-proxy/index.d.ts +1 -0
- package/directives/button-select/button-select.directive.d.ts +3 -2
- package/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.d.ts +5 -5
- package/directives/fade/fade.directive.d.ts +5 -6
- package/directives/fluid-typography/fluid-typography.directive.d.ts +3 -6
- package/directives/fluid-typography/fluid-typography.options.d.ts +1 -3
- package/directives/highlight/highlight.directive.d.ts +4 -4
- package/directives/index.d.ts +1 -2
- package/directives/password/password.directive.d.ts +1 -1
- package/directives/present/present.directive.d.ts +2 -4
- package/directives/tooltip/tooltip.directive.d.ts +1 -1
- package/directives/unfinished-validator/unfinished-validator.directive.d.ts +2 -2
- package/directives/unmask-handler/unmask-handler.directive.d.ts +3 -3
- package/fesm2022/taiga-ui-kit-components-accordion.mjs +8 -9
- package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-action-bar.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-action-bar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-avatar.mjs +35 -49
- package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +11 -18
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge.mjs +11 -15
- package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badged-content.mjs +9 -12
- package/fesm2022/taiga-ui-kit-components-badged-content.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-block.mjs +11 -15
- package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +18 -37
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-button-loading.mjs +18 -26
- package/fesm2022/taiga-ui-kit-components-button-loading.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-calendar-month.mjs +13 -35
- package/fesm2022/taiga-ui-kit-components-calendar-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +26 -35
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-carousel.mjs +70 -123
- package/fesm2022/taiga-ui-kit-components-carousel.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-checkbox.mjs +5 -6
- package/fesm2022/taiga-ui-kit-components-checkbox.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-chip.mjs +11 -15
- package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs +40 -45
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-comment.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-comment.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-compass.mjs +9 -11
- package/fesm2022/taiga-ui-kit-components-compass.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-confirm.mjs +10 -12
- package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-copy.mjs +19 -33
- package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs +24 -85
- package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-drawer.mjs +11 -32
- package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs +112 -240
- package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-filter.mjs +21 -34
- package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-fullscreen.mjs +23 -42
- package/fesm2022/taiga-ui-kit-components-fullscreen.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs +63 -77
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-color.mjs +31 -32
- package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs +35 -51
- package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +37 -37
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +41 -57
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date.mjs +55 -68
- package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs +10 -13
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +26 -23
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month.mjs +39 -46
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +266 -211
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +64 -74
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs +38 -43
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs +24 -22
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-range.mjs +42 -69
- package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs +27 -17
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-time.mjs +39 -41
- package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-year.mjs +31 -37
- package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +50 -72
- package/fesm2022/taiga-ui-kit-components-items-with-more.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-like.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-like.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +18 -23
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-message.mjs +7 -8
- package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs +38 -53
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +37 -26
- package/fesm2022/taiga-ui-kit-components-notification-middle.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pager.mjs +30 -44
- package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pagination.mjs +75 -149
- package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pin.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-preview.mjs +97 -157
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-progress.mjs +81 -92
- package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pulse.mjs +7 -11
- package/fesm2022/taiga-ui-kit-components-pulse.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-push.mjs +27 -40
- package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs +23 -35
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-radio.mjs +8 -9
- package/fesm2022/taiga-ui-kit-components-radio.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-range.mjs +20 -33
- package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-rating.mjs +7 -12
- package/fesm2022/taiga-ui-kit-components-rating.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs +11 -7
- package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-segmented.mjs +32 -59
- package/fesm2022/taiga-ui-kit-components-segmented.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-select.mjs +57 -45
- package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-slider.mjs +56 -88
- package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-status.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-stepper.mjs +61 -88
- package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-switch.mjs +10 -6
- package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tabs.mjs +90 -157
- package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +60 -73
- package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tiles.mjs +54 -99
- package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-toast.mjs +27 -28
- package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tree.mjs +90 -125
- package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components.mjs +0 -3
- package/fesm2022/taiga-ui-kit-components.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 +7 -7
- package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-button-select.mjs +20 -12
- package/fesm2022/taiga-ui-kit-directives-button-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs +10 -9
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-connected.mjs +7 -8
- package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs +25 -53
- package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-fade.mjs +25 -34
- package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs +14 -27
- package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-highlight.mjs +16 -21
- package/fesm2022/taiga-ui-kit-directives-highlight.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-password.mjs +10 -9
- package/fesm2022/taiga-ui-kit-directives-password.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-present.mjs +10 -18
- package/fesm2022/taiga-ui-kit-directives-present.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-sensitive.mjs +6 -6
- package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +6 -6
- package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +7 -6
- package/fesm2022/taiga-ui-kit-directives-skeleton.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +9 -9
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs +8 -11
- package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs +10 -15
- package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives.mjs +1 -2
- package/fesm2022/taiga-ui-kit-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs +43 -0
- package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-pipes-emails.mjs +3 -4
- package/fesm2022/taiga-ui-kit-pipes-emails.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs +22 -36
- package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-flag.mjs +30 -0
- package/fesm2022/taiga-ui-kit-pipes-flag.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs +23 -27
- package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-initials.mjs +28 -0
- package/fesm2022/taiga-ui-kit-pipes-initials.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs +10 -9
- package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs +3 -4
- package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-stringify.mjs +3 -4
- package/fesm2022/taiga-ui-kit-pipes-stringify.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes.mjs +3 -0
- package/fesm2022/taiga-ui-kit-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-tokens.mjs +4 -123
- package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-utils.mjs +3 -15
- package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
- package/package.json +75 -80
- package/pipes/auto-color/auto-color.pipe.d.ts +13 -0
- package/pipes/auto-color/index.d.ts +1 -0
- package/pipes/filter-by-input/filter-by-input.pipe.d.ts +5 -2
- package/pipes/flag/flag.pipe.d.ts +13 -0
- package/pipes/flag/index.d.ts +1 -0
- package/pipes/hide-selected/hide-selected.pipe.d.ts +2 -0
- package/pipes/index.d.ts +3 -0
- package/pipes/initials/index.d.ts +1 -0
- package/pipes/initials/initials.pipe.d.ts +7 -0
- package/pipes/sort-countries/sort-countries.pipe.d.ts +4 -3
- package/pipes/stringify-content/stringify-content.pipe.d.ts +2 -3
- 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 +4 -4
- package/styles/components/comment.less +15 -17
- package/styles/components/message.less +1 -1
- package/styles/components/pin.less +3 -3
- package/styles/components/switch.less +3 -2
- package/styles/components/toast.less +1 -1
- package/tokens/i18n.d.ts +1 -0
- package/tokens/index.d.ts +0 -7
- package/utils/index.d.ts +0 -2
- package/utils/maskito.binding.d.ts +1 -1
- package/components/elastic-container/elastic-container.component.d.ts +0 -8
- package/components/elastic-container/elastic-container.directive.d.ts +0 -7
- package/components/elastic-container/index.d.ts +0 -2
- package/components/floating-container/floating-container.directive.d.ts +0 -7
- package/components/floating-container/index.d.ts +0 -1
- package/components/input-range/input-range.d.ts +0 -3
- package/components/slides/index.d.ts +0 -1
- package/components/slides/slides.directive.d.ts +0 -11
- package/components/textarea/textarea-limit.directive.d.ts +0 -26
- package/directives/button-close/button-close.directive.d.ts +0 -5
- package/directives/button-close/index.d.ts +0 -1
- package/directives/lazy-loading/index.d.ts +0 -2
- package/directives/lazy-loading/lazy-loading.directive.d.ts +0 -18
- package/directives/lazy-loading/lazy-loading.service.d.ts +0 -12
- package/fesm2022/taiga-ui-kit-components-elastic-container.mjs +0 -78
- package/fesm2022/taiga-ui-kit-components-elastic-container.mjs.map +0 -1
- package/fesm2022/taiga-ui-kit-components-floating-container.mjs +0 -37
- package/fesm2022/taiga-ui-kit-components-floating-container.mjs.map +0 -1
- package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs +0 -64
- package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs.map +0 -1
- package/fesm2022/taiga-ui-kit-components-slides.mjs +0 -49
- package/fesm2022/taiga-ui-kit-components-slides.mjs.map +0 -1
- package/fesm2022/taiga-ui-kit-directives-button-close.mjs +0 -39
- package/fesm2022/taiga-ui-kit-directives-button-close.mjs.map +0 -1
- package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs +0 -81
- package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs.map +0 -1
- package/tokens/calendar-date-stream.d.ts +0 -10
- package/tokens/date-inputs-value-transformers.d.ts +0 -19
- package/tokens/input-date-options.d.ts +0 -15
- package/tokens/items-handlers.d.ts +0 -26
- package/tokens/mobile-calendar.d.ts +0 -6
- package/tokens/month-formatter.d.ts +0 -5
- package/utils/phone.d.ts +0 -3
- package/utils/toggle-day.d.ts +0 -2
|
@@ -1,23 +1,24 @@
|
|
|
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
|
-
import { FormsModule } from '@angular/forms';
|
|
6
5
|
import { MutationObserverService, WA_MUTATION_OBSERVER_INIT } from '@ng-web-apis/mutation-observer';
|
|
7
|
-
import { TuiRepeatTimes } from '@taiga-ui/cdk/directives/repeat-times';
|
|
8
6
|
import { tuiWatch } from '@taiga-ui/cdk/observables';
|
|
9
7
|
import { delay, map } from 'rxjs';
|
|
10
8
|
|
|
11
9
|
class TuiPager {
|
|
12
10
|
constructor() {
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
11
|
+
this.items = viewChildren('item');
|
|
12
|
+
this.start = signal(0);
|
|
13
|
+
this.end = signal(0);
|
|
15
14
|
this.left = signal(0);
|
|
15
|
+
this.gap = computed(() => (this.size() === 'm' ? 9 : 7));
|
|
16
16
|
this.maxWidth = toSignal(inject(MutationObserverService, { self: true }).pipe(delay(0), map(() => this.visibleWidth), tuiWatch(), takeUntilDestroyed()), { initialValue: 0 });
|
|
17
|
-
this.max = 6;
|
|
18
|
-
this.count =
|
|
19
|
-
this.size = 'm';
|
|
20
|
-
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);
|
|
21
22
|
}
|
|
22
23
|
ngOnChanges() {
|
|
23
24
|
this.move();
|
|
@@ -25,31 +26,29 @@ class TuiPager {
|
|
|
25
26
|
ngAfterViewInit() {
|
|
26
27
|
this.move();
|
|
27
28
|
}
|
|
28
|
-
get gap() {
|
|
29
|
-
return this.size === 'm' ? 9 : 7;
|
|
30
|
-
}
|
|
31
29
|
get visibleRange() {
|
|
32
|
-
const max = this.max > this.count ? this.count : this.max;
|
|
33
|
-
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);
|
|
34
32
|
return [start, start + (max - 1)];
|
|
35
33
|
}
|
|
36
34
|
get visibleWidth() {
|
|
37
|
-
return (
|
|
38
|
-
.
|
|
39
|
-
.
|
|
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());
|
|
40
39
|
}
|
|
41
40
|
move() {
|
|
42
41
|
const [start, end] = this.visibleRange;
|
|
43
|
-
this.start
|
|
44
|
-
this.end
|
|
45
|
-
let left = this.start * this.gap;
|
|
46
|
-
for (let i = 0; i < this.start; i++) {
|
|
47
|
-
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;
|
|
48
47
|
}
|
|
49
48
|
this.left.set(-1 * left);
|
|
50
49
|
}
|
|
51
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
52
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPager, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
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: [
|
|
53
52
|
MutationObserverService,
|
|
54
53
|
{
|
|
55
54
|
provide: WA_MUTATION_OBSERVER_INIT,
|
|
@@ -60,11 +59,11 @@ class TuiPager {
|
|
|
60
59
|
subtree: true,
|
|
61
60
|
},
|
|
62
61
|
},
|
|
63
|
-
], 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
|
|
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 }); }
|
|
64
63
|
}
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPager, decorators: [{
|
|
66
65
|
type: Component,
|
|
67
|
-
args: [{ selector: 'tui-pager', imports: [
|
|
66
|
+
args: [{ selector: 'tui-pager', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
68
67
|
MutationObserverService,
|
|
69
68
|
{
|
|
70
69
|
provide: WA_MUTATION_OBSERVER_INIT,
|
|
@@ -76,24 +75,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
76
75
|
},
|
|
77
76
|
},
|
|
78
77
|
], host: {
|
|
79
|
-
'[attr.data-size]': 'size',
|
|
80
|
-
'[style.--t-gap.px]': 'gap',
|
|
78
|
+
'[attr.data-size]': 'size()',
|
|
79
|
+
'[style.--t-gap.px]': 'gap()',
|
|
81
80
|
'[style.max-width.px]': 'maxWidth()',
|
|
82
|
-
}, template: "<div\n class=\"t-items\"\n [style.transform]=\"`translateX(calc(var(--tui-inline) * ${left()}px))`\"\n>\n
|
|
83
|
-
}]
|
|
84
|
-
type: ViewChildren,
|
|
85
|
-
args: ['item']
|
|
86
|
-
}], max: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}], count: [{
|
|
89
|
-
type: Input
|
|
90
|
-
}], size: [{
|
|
91
|
-
type: Input
|
|
92
|
-
}], valueContent: [{
|
|
93
|
-
type: Input
|
|
94
|
-
}], index: [{
|
|
95
|
-
type: Input
|
|
96
|
-
}] } });
|
|
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
|
+
}] });
|
|
97
83
|
|
|
98
84
|
/**
|
|
99
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":"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"}
|
|
@@ -1,80 +1,69 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
|
|
4
|
-
import { TuiLet } from '@taiga-ui/cdk/directives/let';
|
|
5
|
-
import { TuiRepeatTimes } from '@taiga-ui/cdk/directives/repeat-times';
|
|
2
|
+
import { viewChildren, ElementRef, computed, inject, input, model, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
3
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
7
4
|
import { tuiIsFocusedIn } from '@taiga-ui/cdk/utils/focus';
|
|
8
5
|
import { tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
9
6
|
import { TuiButton } from '@taiga-ui/core/components/button';
|
|
10
|
-
import {
|
|
7
|
+
import { TUI_COMMON_ICONS } from '@taiga-ui/core/tokens';
|
|
11
8
|
import { TUI_PAGINATION_TEXTS } from '@taiga-ui/kit/tokens';
|
|
12
9
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
10
|
+
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
13
11
|
|
|
14
|
-
const
|
|
12
|
+
const [TUI_PAGINATION_OPTIONS, tuiPaginationOptionsProvider] = tuiCreateOptions({
|
|
13
|
+
size: 'l',
|
|
14
|
+
appearance: (isActive) => (isActive ? 'primary' : 'flat'),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const ELLIPSIS_ITEM_LENGTH = 1;
|
|
15
18
|
const ACTIVE_ITEM_LENGTH = 1;
|
|
16
19
|
class TuiPagination {
|
|
17
20
|
constructor() {
|
|
18
|
-
this.els =
|
|
21
|
+
this.els = viewChildren('element', { read: ElementRef });
|
|
19
22
|
this.el = tuiInjectElement();
|
|
23
|
+
this.maxHalfLength = computed(() => this.sidePadding() + ELLIPSIS_ITEM_LENGTH + this.activePadding());
|
|
24
|
+
this.maxElementsLength = computed(() => this.maxHalfLength() * 2 + ACTIVE_ITEM_LENGTH);
|
|
25
|
+
this.lastElementIndex = computed(() => this.elementsLength() - 1);
|
|
26
|
+
this.itemsFit = computed(() => this.length() <= this.maxElementsLength());
|
|
27
|
+
this.lastIndex = computed(() => this.length() - 1);
|
|
28
|
+
this.reverseIndex = computed(() => this.lastIndex() - this.index());
|
|
20
29
|
this.texts = inject(TUI_PAGINATION_TEXTS);
|
|
21
|
-
this.icons = inject(
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.activePadding = 1;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this.indexChange = new EventEmitter();
|
|
39
|
-
}
|
|
40
|
-
get nativeFocusableElement() {
|
|
41
|
-
if (this.disabled) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
let activeElementIndex = 0;
|
|
45
|
-
const { elementsLength } = this;
|
|
46
|
-
for (let i = 0; i < elementsLength; i++) {
|
|
47
|
-
const itemIndex = this.getItemIndexByElementIndex(i);
|
|
48
|
-
if (itemIndex) {
|
|
49
|
-
activeElementIndex++;
|
|
30
|
+
this.icons = inject(TUI_COMMON_ICONS);
|
|
31
|
+
this.options = inject(TUI_PAGINATION_OPTIONS);
|
|
32
|
+
this.buttonSize = computed(() => (this.size() === 'm' ? 'xs' : 's'));
|
|
33
|
+
this.elementsLength = computed(() => this.itemsFit() ? this.length() : this.maxElementsLength());
|
|
34
|
+
this.length = input(1);
|
|
35
|
+
this.focusable = input(true);
|
|
36
|
+
this.size = input(this.options.size);
|
|
37
|
+
this.disabled = input(false);
|
|
38
|
+
this.activePadding = input(1);
|
|
39
|
+
this.sidePadding = input(1);
|
|
40
|
+
this.content = input();
|
|
41
|
+
this.index = model(0);
|
|
42
|
+
this.arrowIsDisabledRight = computed(() => this.reverseIndex() === 0);
|
|
43
|
+
this.arrowIsDisabledLeft = computed(() => this.index() === 0);
|
|
44
|
+
this.nativeFocusableElement = computed(() => {
|
|
45
|
+
if (this.disabled()) {
|
|
46
|
+
return null;
|
|
50
47
|
}
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
let activeElementIndex = 0;
|
|
49
|
+
for (let i = 0; i < this.elementsLength(); i++) {
|
|
50
|
+
const itemIndex = this.getItemIndexByElementIndex(i);
|
|
51
|
+
if (itemIndex) {
|
|
52
|
+
activeElementIndex++;
|
|
53
|
+
}
|
|
54
|
+
if (itemIndex === this.index()) {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
53
57
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
return (this.els().find((_, index) => index === activeElementIndex)?.nativeElement ??
|
|
59
|
+
null);
|
|
60
|
+
});
|
|
57
61
|
}
|
|
58
62
|
get focused() {
|
|
59
63
|
return tuiIsFocusedIn(this.el);
|
|
60
64
|
}
|
|
61
|
-
get arrowIsDisabledLeft() {
|
|
62
|
-
return this.index === 0;
|
|
63
|
-
}
|
|
64
|
-
get arrowIsDisabledRight() {
|
|
65
|
-
return this.reverseIndex === 0;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Number of items in a container.
|
|
69
|
-
*/
|
|
70
|
-
get elementsLength() {
|
|
71
|
-
return this.itemsFit ? this.length : this.maxElementsLength;
|
|
72
|
-
}
|
|
73
|
-
get buttonSize() {
|
|
74
|
-
return this.size === 'm' ? 'xs' : 's';
|
|
75
|
-
}
|
|
76
65
|
elementIsFocusable(index) {
|
|
77
|
-
return this.index === index && !this.focused;
|
|
66
|
+
return this.index() === index && !this.focused;
|
|
78
67
|
}
|
|
79
68
|
/**
|
|
80
69
|
* Get index by element index
|
|
@@ -82,80 +71,46 @@ class TuiPagination {
|
|
|
82
71
|
* @returns index or null (for '…')
|
|
83
72
|
*/
|
|
84
73
|
getItemIndexByElementIndex(elementIndex) {
|
|
85
|
-
|
|
74
|
+
const reverseElementIndex = this.lastElementIndex() - elementIndex;
|
|
75
|
+
if (elementIndex < this.sidePadding()) {
|
|
86
76
|
return elementIndex;
|
|
87
77
|
}
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
78
|
+
if (reverseElementIndex < this.sidePadding()) {
|
|
79
|
+
return this.lastIndex() - reverseElementIndex;
|
|
90
80
|
}
|
|
91
|
-
if (elementIndex === this.sidePadding && this.hasCollapsedItems(this.index)) {
|
|
81
|
+
if (elementIndex === this.sidePadding() && this.hasCollapsedItems(this.index())) {
|
|
92
82
|
return null;
|
|
93
83
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this.hasCollapsedItems(this.reverseIndex)) {
|
|
84
|
+
if (reverseElementIndex === this.sidePadding() &&
|
|
85
|
+
this.hasCollapsedItems(this.reverseIndex())) {
|
|
97
86
|
return null;
|
|
98
87
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
const computedIndex = this.index - this.maxHalfLength + elementIndex;
|
|
103
|
-
return tuiClamp(computedIndex, elementIndex, this.lastIndex - reverseElementIndex);
|
|
88
|
+
const computedIndex = this.index() - this.maxHalfLength() + elementIndex;
|
|
89
|
+
return tuiClamp(computedIndex, elementIndex, this.lastIndex() - reverseElementIndex);
|
|
104
90
|
}
|
|
105
|
-
getElementMode(index) {
|
|
106
|
-
|
|
107
|
-
return this.index === index ? 'primary' : fallback;
|
|
91
|
+
getElementMode(index = -1) {
|
|
92
|
+
return this.options.appearance(this.index() === index);
|
|
108
93
|
}
|
|
109
94
|
onElementClick(index) {
|
|
110
95
|
this.updateIndex(index);
|
|
111
96
|
}
|
|
112
97
|
onElementKeyDownArrowLeft(element) {
|
|
113
|
-
if (element === this.els
|
|
98
|
+
if (element === this.els()[0]?.nativeElement) {
|
|
114
99
|
return;
|
|
115
100
|
}
|
|
116
|
-
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);
|
|
117
102
|
previous?.nativeElement.focus();
|
|
118
103
|
}
|
|
119
104
|
onElementKeyDownArrowRight(element) {
|
|
120
|
-
if (element === this.els.
|
|
105
|
+
if (element === this.els()[this.els().length - 1]?.nativeElement) {
|
|
121
106
|
return;
|
|
122
107
|
}
|
|
123
|
-
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);
|
|
124
109
|
next?.nativeElement.focus();
|
|
125
110
|
}
|
|
126
|
-
onArrowClick(
|
|
127
|
-
this.tryChangeTo(
|
|
128
|
-
this.
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Active index from the end
|
|
132
|
-
*/
|
|
133
|
-
get reverseIndex() {
|
|
134
|
-
return this.lastIndex - this.index;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Max number of elements in half (not counting the middle one).
|
|
138
|
-
*/
|
|
139
|
-
get maxHalfLength() {
|
|
140
|
-
return this.sidePadding + DOTS_LENGTH + this.activePadding;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Is there '...' anywhere
|
|
144
|
-
*/
|
|
145
|
-
get itemsFit() {
|
|
146
|
-
return this.length <= this.maxElementsLength;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Max number of elements
|
|
150
|
-
*/
|
|
151
|
-
get maxElementsLength() {
|
|
152
|
-
return this.maxHalfLength * 2 + ACTIVE_ITEM_LENGTH;
|
|
153
|
-
}
|
|
154
|
-
get lastIndex() {
|
|
155
|
-
return this.length - 1;
|
|
156
|
-
}
|
|
157
|
-
get lastElementIndex() {
|
|
158
|
-
return this.elementsLength - 1;
|
|
111
|
+
onArrowClick(step) {
|
|
112
|
+
this.tryChangeTo(step);
|
|
113
|
+
this.nativeFocusableElement()?.focus();
|
|
159
114
|
}
|
|
160
115
|
/**
|
|
161
116
|
* Are there collapsed items at that index
|
|
@@ -163,56 +118,27 @@ class TuiPagination {
|
|
|
163
118
|
* @returns there are collapsed items
|
|
164
119
|
*/
|
|
165
120
|
hasCollapsedItems(index) {
|
|
166
|
-
return !this.itemsFit && index > this.maxHalfLength;
|
|
121
|
+
return !this.itemsFit() && index > this.maxHalfLength();
|
|
167
122
|
}
|
|
168
|
-
tryChangeTo(
|
|
169
|
-
this.updateIndex(tuiClamp(this.index +
|
|
170
|
-
}
|
|
171
|
-
focusActive() {
|
|
172
|
-
const { nativeFocusableElement } = this;
|
|
173
|
-
if (nativeFocusableElement) {
|
|
174
|
-
nativeFocusableElement.focus();
|
|
175
|
-
}
|
|
123
|
+
tryChangeTo(step) {
|
|
124
|
+
this.updateIndex(tuiClamp(this.index() + step, 0, this.lastIndex()));
|
|
176
125
|
}
|
|
177
126
|
updateIndex(index) {
|
|
178
|
-
if (this.index
|
|
179
|
-
|
|
127
|
+
if (this.index() !== index) {
|
|
128
|
+
this.index.set(index);
|
|
180
129
|
}
|
|
181
|
-
this.index = index;
|
|
182
|
-
this.indexChange.emit(index);
|
|
183
130
|
}
|
|
184
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
185
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
131
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPagination, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
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(-1)\"\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(1)\"\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 }); }
|
|
186
133
|
}
|
|
187
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPagination, decorators: [{
|
|
188
135
|
type: Component,
|
|
189
|
-
args: [{ selector: 'tui-pagination', imports: [PolymorpheusOutlet, TuiButton
|
|
190
|
-
}]
|
|
191
|
-
type: ViewChildren,
|
|
192
|
-
args: ['element', { read: ElementRef }]
|
|
193
|
-
}], length: [{
|
|
194
|
-
type: Input
|
|
195
|
-
}], focusable: [{
|
|
196
|
-
type: Input
|
|
197
|
-
}], size: [{
|
|
198
|
-
type: Input
|
|
199
|
-
}], disabled: [{
|
|
200
|
-
type: Input
|
|
201
|
-
}], activePadding: [{
|
|
202
|
-
type: Input
|
|
203
|
-
}], sidePadding: [{
|
|
204
|
-
type: Input
|
|
205
|
-
}], content: [{
|
|
206
|
-
type: Input
|
|
207
|
-
}], index: [{
|
|
208
|
-
type: Input
|
|
209
|
-
}], indexChange: [{
|
|
210
|
-
type: Output
|
|
211
|
-
}] } });
|
|
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(-1)\"\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(1)\"\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
|
+
}] });
|
|
212
138
|
|
|
213
139
|
/**
|
|
214
140
|
* Generated bundle index. Do not edit.
|
|
215
141
|
*/
|
|
216
142
|
|
|
217
|
-
export { TuiPagination };
|
|
143
|
+
export { TUI_PAGINATION_OPTIONS, TuiPagination, tuiPaginationOptionsProvider };
|
|
218
144
|
//# sourceMappingURL=taiga-ui-kit-components-pagination.mjs.map
|