@taiga-ui/kit 4.52.0-canary.ece97e9 → 4.52.0-canary.efbd0d4
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 -2
- 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-range/calendar-range.component.d.ts +0 -1
- package/components/calendar-range/day-range-period.d.ts +2 -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 -11
- 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 +4 -4
- package/components/input-color/input-color.d.ts +5 -0
- package/components/input-date/input-date.d.ts +4 -1
- package/components/input-date/input-date.directive.d.ts +12 -14
- 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 +5 -8
- 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 +6 -6
- package/components/input-date-time/input-date-time.options.d.ts +2 -2
- 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/input-number.d.ts +4 -1
- package/components/input-number/input-number.directive.d.ts +5 -7
- package/components/input-number/input-number.options.d.ts +2 -3
- package/components/input-number/step/input-number-step.component.d.ts +2 -1
- 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 +7 -7
- package/components/input-phone-international/index.d.ts +1 -0
- package/components/input-phone-international/input-phone-international.component.d.ts +9 -8
- package/components/input-phone-international/input-phone-international.d.ts +5 -0
- package/components/input-phone-international/input-phone-international.options.d.ts +1 -3
- package/components/input-pin/index.d.ts +1 -0
- package/components/input-pin/input-pin.component.d.ts +3 -3
- 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 +5 -4
- package/components/input-slider/input-slider.d.ts +4 -1
- package/components/input-slider/input-slider.directive.d.ts +1 -1
- 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 +4 -4
- package/components/input-year/input-year.d.ts +4 -1
- package/components/input-year/input-year.directive.d.ts +5 -5
- package/components/input-year/input-year.options.d.ts +2 -2
- 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/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/pagination/pagination.component.d.ts +22 -52
- package/components/pagination/pagination.options.d.ts +3 -6
- 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 +2 -1
- package/components/preview/preview.component.d.ts +1 -1
- 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 +3 -1
- package/components/progress/progress-bar/progress-bar.component.d.ts +3 -4
- 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.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 +5 -3
- 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 +4 -4
- package/components/select/select.d.ts +4 -1
- package/components/select/select.directive.d.ts +4 -3
- package/components/slider/slider.options.d.ts +1 -6
- package/components/stepper/step.component.d.ts +6 -8
- package/components/stepper/stepper.component.d.ts +6 -11
- package/components/switch/switch.component.d.ts +1 -0
- package/components/tabs/tabs.options.d.ts +1 -6
- package/components/textarea/index.d.ts +2 -1
- package/components/textarea/textarea.component.d.ts +4 -4
- package/components/textarea/textarea.d.ts +6 -0
- package/components/textarea/textarea.directive.d.ts +13 -0
- 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-item-content/tree-item-content.component.d.ts +7 -0
- 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.options.d.ts +1 -3
- package/directives/highlight/highlight.directive.d.ts +4 -4
- package/directives/index.d.ts +1 -1
- 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 +34 -48
- 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 +5 -13
- package/fesm2022/taiga-ui-kit-components-calendar-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +23 -23
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-carousel.mjs +64 -114
- 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-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 +15 -32
- package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs +111 -239
- package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-filter.mjs +20 -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 +24 -13
- 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 +30 -36
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +32 -29
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date.mjs +45 -48
- package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs +3 -3
- 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 +32 -23
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +53 -50
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +50 -42
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs +29 -19
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs +18 -9
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-range.mjs +18 -16
- package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs +15 -10
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-time.mjs +38 -40
- package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-year.mjs +27 -19
- package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +12 -14
- 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 +30 -40
- 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 +6 -8
- package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pagination.mjs +59 -140
- 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 +68 -48
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-progress.mjs +36 -45
- 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 +22 -23
- package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs +8 -8
- 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 +8 -11
- 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 +52 -29
- package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-slider.mjs +23 -33
- 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 +45 -79
- 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 +28 -36
- package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +51 -52
- package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tiles.mjs +14 -15
- 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 +55 -58
- 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-close.mjs +3 -4
- package/fesm2022/taiga-ui-kit-directives-button-close.mjs.map +1 -1
- 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 +18 -10
- 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 +6 -7
- 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 +6 -12
- 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 -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 +12 -25
- 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 +4 -5
- 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 +66 -67
- 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 +2 -2
- package/pipes/flag/flag.pipe.d.ts +14 -0
- package/pipes/flag/index.d.ts +1 -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 +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 +2 -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/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/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-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
|
@@ -2,9 +2,7 @@ import { TuiDayRange, TUI_FIRST_DAY, TUI_LAST_DAY, TuiDay, TuiMonth } from '@tai
|
|
|
2
2
|
import { __decorate } from 'tslib';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { inject, ChangeDetectorRef, EventEmitter, Input, Output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
5
|
import { TUI_FALSE_HANDLER } from '@taiga-ui/cdk/constants';
|
|
7
|
-
import { tuiWatch } from '@taiga-ui/cdk/observables';
|
|
8
6
|
import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
|
|
9
7
|
import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
|
|
10
8
|
import { tuiIsString, tuiNullableSame, tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
@@ -13,7 +11,7 @@ import * as i1 from '@taiga-ui/core/components/data-list';
|
|
|
13
11
|
import { TuiDataList } from '@taiga-ui/core/components/data-list';
|
|
14
12
|
import { TuiIcon } from '@taiga-ui/core/components/icon';
|
|
15
13
|
import { TUI_COMMON_ICONS, tuiAsAuxiliary } from '@taiga-ui/core/tokens';
|
|
16
|
-
import { TUI_OTHER_DATE_TEXT,
|
|
14
|
+
import { TUI_OTHER_DATE_TEXT, TUI_DAY_RANGE_PERIODS } from '@taiga-ui/kit/tokens';
|
|
17
15
|
|
|
18
16
|
const calculateDisabledItemHandler = (disabledItemHandler, value, minLength) => (item) => {
|
|
19
17
|
if (!value || value instanceof TuiDayRange || !minLength) {
|
|
@@ -87,12 +85,6 @@ class TuiCalendarRange {
|
|
|
87
85
|
(max === null || item.range.from.daySameOrBefore(max))),
|
|
88
86
|
otherDateText || '',
|
|
89
87
|
];
|
|
90
|
-
inject(TUI_CALENDAR_DATE_STREAM, { optional: true })
|
|
91
|
-
?.pipe(tuiWatch(), takeUntilDestroyed())
|
|
92
|
-
.subscribe((value) => {
|
|
93
|
-
this.currentValue = value;
|
|
94
|
-
this.initDefaultViewedMonth();
|
|
95
|
-
});
|
|
96
88
|
}
|
|
97
89
|
set valueSetter(value) {
|
|
98
90
|
this.currentValue = value;
|
|
@@ -210,16 +202,16 @@ class TuiCalendarRange {
|
|
|
210
202
|
findItemByDayRange(dayRange) {
|
|
211
203
|
return this.items.find((item) => dayRange.daySame(item.range)) ?? null;
|
|
212
204
|
}
|
|
213
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
214
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
205
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCalendarRange, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
206
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiCalendarRange, isStandalone: true, selector: "tui-calendar-range", inputs: { disabledItemHandler: "disabledItemHandler", markerHandler: "markerHandler", items: "items", min: "min", max: "max", minLength: "minLength", maxLength: "maxLength", item: "item", valueSetter: ["value", "valueSetter"], defaultViewedMonth: "defaultViewedMonth" }, outputs: { valueChange: "valueChange", itemChange: "itemChange" }, host: { listeners: { "document:keydown.capture": "onEsc($event)" }, properties: { "class._mobile": "mobile" } }, providers: [
|
|
215
207
|
tuiAsAuxiliary(TuiCalendarRange),
|
|
216
208
|
tuiCalendarSheetOptionsProvider({ rangeMode: true }),
|
|
217
|
-
], usesOnChanges: true, ngImport: i0, template: "<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n
|
|
209
|
+
], usesOnChanges: true, ngImport: i0, template: "<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n class=\"t-check\"\n [icon]=\"icons.check\"\n />\n }\n </button>\n }\n </tui-data-list>\n }\n}\n", styles: [":host:not(._mobile){display:flex;min-inline-size:30rem}.t-calendar{border-inline-end:1px solid var(--tui-border-normal)}.t-check{font-size:1rem;margin-inline-start:auto}\n"], dependencies: [{ kind: "component", type: TuiCalendar, selector: "tui-calendar", inputs: ["month", "disabledItemHandler", "min", "max", "minViewedMonth", "maxViewedMonth", "hoveredItem", "showAdjacent", "markerHandler", "value", "initialView"], outputs: ["dayClick", "monthChange", "hoveredItemChange"] }, { kind: "component", type: i1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i1.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
218
210
|
}
|
|
219
211
|
__decorate([
|
|
220
212
|
tuiPure
|
|
221
213
|
], TuiCalendarRange.prototype, "calculateDisabledItemHandler", null);
|
|
222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCalendarRange, decorators: [{
|
|
223
215
|
type: Component,
|
|
224
216
|
args: [{ selector: 'tui-calendar-range', imports: [TuiCalendar, TuiDataList, TuiIcon, TuiMapperPipe], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
225
217
|
tuiAsAuxiliary(TuiCalendarRange),
|
|
@@ -227,8 +219,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
227
219
|
], host: {
|
|
228
220
|
'[class._mobile]': 'mobile',
|
|
229
221
|
'(document:keydown.capture)': 'onEsc($event)',
|
|
230
|
-
}, template: "<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n
|
|
231
|
-
}],
|
|
222
|
+
}, template: "<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n class=\"t-check\"\n [icon]=\"icons.check\"\n />\n }\n </button>\n }\n </tui-data-list>\n }\n}\n", styles: [":host:not(._mobile){display:flex;min-inline-size:30rem}.t-calendar{border-inline-end:1px solid var(--tui-border-normal)}.t-check{font-size:1rem;margin-inline-start:auto}\n"] }]
|
|
223
|
+
}], propDecorators: { disabledItemHandler: [{
|
|
232
224
|
type: Input
|
|
233
225
|
}], markerHandler: [{
|
|
234
226
|
type: Input
|
|
@@ -265,14 +257,22 @@ class TuiDayRangePeriod {
|
|
|
265
257
|
return this.name;
|
|
266
258
|
}
|
|
267
259
|
}
|
|
268
|
-
function
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
260
|
+
function getDefaultPeriodTitles() {
|
|
261
|
+
try {
|
|
262
|
+
return inject(TUI_DAY_RANGE_PERIODS)();
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
return [
|
|
266
|
+
'For all the time',
|
|
267
|
+
'Today',
|
|
268
|
+
'Yesterday',
|
|
269
|
+
'Current week',
|
|
270
|
+
'Current month',
|
|
271
|
+
'Previous month',
|
|
272
|
+
];
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function tuiCreateDefaultDayRangePeriods(periodTitles = getDefaultPeriodTitles()) {
|
|
276
276
|
const today = TuiDay.currentLocal();
|
|
277
277
|
const yesterday = today.append({ day: -1 });
|
|
278
278
|
const startOfWeek = today.append({ day: -today.dayOfWeek() });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-calendar-range.mjs","sources":["../../../projects/kit/components/calendar-range/calculate-disabled-item-handler.ts","../../../projects/kit/components/calendar-range/day-caps-mapper.ts","../../../projects/kit/components/calendar-range/calendar-range.component.ts","../../../projects/kit/components/calendar-range/calendar-range.template.html","../../../projects/kit/components/calendar-range/day-range-period.ts","../../../projects/kit/components/calendar-range/taiga-ui-kit-components-calendar-range.ts"],"sourcesContent":["import {type TuiDay, type TuiDayLike, TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {type TuiBooleanHandler} from '@taiga-ui/cdk/types';\n\nexport const calculateDisabledItemHandler: (\n disabledItemHandler: TuiBooleanHandler<TuiDay>,\n value: TuiDay | TuiDayRange | null,\n minLength: TuiDayLike | null,\n) => TuiBooleanHandler<TuiDay> = (disabledItemHandler, value, minLength) => (item) => {\n if (!value || value instanceof TuiDayRange || !minLength) {\n return disabledItemHandler(item);\n }\n\n const negativeMinLength = Object.fromEntries(\n Object.entries(minLength).map(([key, value]) => [key, -value]),\n );\n const disabledBefore = value.append(negativeMinLength).append({day: 1});\n const disabledAfter = value.append(minLength).append({day: -1});\n const inDisabledRange =\n disabledBefore.dayBefore(item) && disabledAfter.dayAfter(item);\n\n return inDisabledRange || disabledItemHandler(item);\n};\n","import {\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiDay,\n type TuiDayLike,\n TuiDayRange,\n} from '@taiga-ui/cdk/date-time';\nimport {type TuiMapper} from '@taiga-ui/cdk/types';\n\nexport const TUI_DAY_CAPS_MAPPER: TuiMapper<\n [TuiDay | null, TuiDay | TuiDayRange | null, TuiDayLike | null, boolean],\n TuiDay\n> = (current, value, maxLength, backwards) => {\n if (\n // TODO(v5): replace with `if (!(value instanceof TuiDay) || !maxLength)` (backward compatibility)\n (value instanceof TuiDayRange && !value.isSingleDay) ||\n !value ||\n !maxLength\n ) {\n return backwards ? current || TUI_FIRST_DAY : current || TUI_LAST_DAY;\n }\n\n const negativeMaxLength = Object.fromEntries(\n Object.entries(maxLength).map(([key, value]) => [key, -value]),\n );\n\n // TODO(v5): `value instanceof TuiDay` always `true`\n const from = value instanceof TuiDay ? value : value.from;\n const dateShift = from\n .append(backwards ? negativeMaxLength : maxLength)\n .append({day: !backwards ? -1 : 1});\n\n if (backwards) {\n return dateShift.dayBefore(current || TUI_FIRST_DAY)\n ? current || TUI_FIRST_DAY\n : dateShift;\n }\n\n if (!current) {\n return dateShift;\n }\n\n return dateShift.dayAfter(current) ? current : dateShift;\n};\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n type OnChanges,\n type OnInit,\n Output,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiDay,\n type TuiDayLike,\n TuiDayRange,\n TuiMonth,\n} from '@taiga-ui/cdk/date-time';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {type TuiBooleanHandler, type TuiMapper} from '@taiga-ui/cdk/types';\nimport {tuiIsString, tuiNullableSame, tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiCalendar,\n tuiCalendarSheetOptionsProvider,\n type TuiMarkerHandler,\n} from '@taiga-ui/core/components/calendar';\nimport {TuiDataList} from '@taiga-ui/core/components/data-list';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TUI_COMMON_ICONS, tuiAsAuxiliary} from '@taiga-ui/core/tokens';\nimport {TUI_CALENDAR_DATE_STREAM, TUI_OTHER_DATE_TEXT} from '@taiga-ui/kit/tokens';\nimport {type Observable} from 'rxjs';\n\nimport {calculateDisabledItemHandler} from './calculate-disabled-item-handler';\nimport {TUI_DAY_CAPS_MAPPER} from './day-caps-mapper';\nimport {type TuiDayRangePeriod} from './day-range-period';\n\n@Component({\n selector: 'tui-calendar-range',\n imports: [TuiCalendar, TuiDataList, TuiIcon, TuiMapperPipe],\n templateUrl: './calendar-range.template.html',\n styleUrl: './calendar-range.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsAuxiliary(TuiCalendarRange),\n tuiCalendarSheetOptionsProvider({rangeMode: true}),\n ],\n host: {\n '[class._mobile]': 'mobile',\n '(document:keydown.capture)': 'onEsc($event)',\n },\n})\nexport class TuiCalendarRange implements OnInit, OnChanges {\n /**\n * @deprecated use `item`\n */\n private selectedPeriod: TuiDayRangePeriod | null = null;\n private readonly cdr = inject(ChangeDetectorRef);\n\n protected currentValue: TuiDay | TuiDayRange | null = null;\n protected previousValue: TuiDay | TuiDayRange | null = null;\n protected hoveredItem: TuiDay | null = null;\n protected month: TuiMonth = TuiMonth.currentLocal();\n\n protected readonly otherDateText = inject(TUI_OTHER_DATE_TEXT);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly capsMapper = TUI_DAY_CAPS_MAPPER;\n protected readonly mobile = inject(TUI_IS_MOBILE);\n\n @Input()\n public disabledItemHandler: TuiBooleanHandler<TuiDay> = TUI_FALSE_HANDLER;\n\n @Input()\n public markerHandler: TuiMarkerHandler | null = null;\n\n @Input()\n public items: readonly TuiDayRangePeriod[] = [];\n\n @Input()\n public min: TuiDay | null = TUI_FIRST_DAY;\n\n @Input()\n public max: TuiDay | null = TUI_LAST_DAY;\n\n @Input()\n public minLength: TuiDayLike | null = null;\n\n @Input()\n public maxLength: TuiDayLike | null = null;\n\n @Input()\n public item: TuiDayRangePeriod | null = null;\n\n @Output()\n public readonly valueChange = new EventEmitter<TuiDayRange | null>();\n\n @Output()\n public readonly itemChange = new EventEmitter<TuiDayRangePeriod | null>();\n\n constructor() {\n inject<Observable<TuiDayRange | null>>(TUI_CALENDAR_DATE_STREAM, {optional: true})\n ?.pipe(tuiWatch(), takeUntilDestroyed())\n .subscribe((value) => {\n this.currentValue = value;\n this.initDefaultViewedMonth();\n });\n }\n\n @Input('value')\n public set valueSetter(value: TuiDayRange | null) {\n this.currentValue = value;\n }\n\n @Input()\n public set defaultViewedMonth(month: TuiMonth) {\n if (!this.currentValue) {\n this.month = month;\n }\n }\n\n public set value(value: TuiDayRange | null) {\n this.cdr.markForCheck();\n this.currentValue = value;\n this.initDefaultViewedMonth();\n }\n\n public get defaultViewedMonth(): TuiMonth {\n return this.month;\n }\n\n /**\n * @deprecated use `item`\n */\n public get selectedActivePeriod(): TuiDayRangePeriod | null {\n return this.selectedPeriod;\n }\n\n /**\n * @deprecated use `item`\n */\n public set selectedActivePeriod(period: TuiDayRangePeriod | null) {\n this.selectedPeriod = period;\n }\n\n public ngOnChanges(): void {\n if (!this.currentValue) {\n this.initDefaultViewedMonth();\n }\n }\n\n public ngOnInit(): void {\n this.initDefaultViewedMonth();\n }\n\n protected get calculatedDisabledItemHandler(): TuiBooleanHandler<TuiDay> {\n return this.calculateDisabledItemHandler(\n this.disabledItemHandler,\n this.currentValue,\n this.minLength,\n );\n }\n\n protected onEsc(event: KeyboardEvent): void {\n if (event.key !== 'Escape' || !(this.currentValue instanceof TuiDay)) {\n return;\n }\n\n event.stopPropagation();\n this.currentValue = this.previousValue;\n }\n\n protected readonly monthOffset: TuiMapper<[TuiMonth, number], TuiMonth> = (\n value,\n month,\n ) => value.append({month});\n\n protected readonly mapper: TuiMapper<\n [\n readonly TuiDayRangePeriod[],\n TuiDay | null,\n TuiDay | null,\n TuiDayLike | null,\n string | null | undefined,\n ],\n ReadonlyArray<TuiDayRangePeriod | string>\n > = (items, min, max, minLength, otherDateText) => [\n ...items.filter(\n (item) =>\n (minLength === null ||\n item.range.from\n .append(minLength)\n .append({day: -1})\n .daySameOrBefore(item.range.to)) &&\n (min === null || item.range.to.daySameOrAfter(min)) &&\n (max === null || item.range.from.daySameOrBefore(max)),\n ),\n otherDateText || '',\n ];\n\n protected isItemActive(item: TuiDayRangePeriod | string): boolean {\n const {activePeriod} = this;\n\n return (\n (tuiIsString(item) && activePeriod === null) ||\n activePeriod === item ||\n activePeriod?.toString() === item.toString()\n );\n }\n\n protected onItemSelect(item: TuiDayRangePeriod | string): void {\n if (!tuiIsString(item)) {\n this.selectedActivePeriod = item;\n this.itemChange.emit(item);\n this.updateValue(item.range.dayLimit(this.min, this.max));\n } else if (this.activePeriod !== null) {\n this.selectedActivePeriod = null;\n this.itemChange.emit(null);\n this.updateValue(null);\n }\n\n this.initDefaultViewedMonth();\n }\n\n protected onMonthChange(month: TuiMonth): void {\n this.month = month;\n }\n\n protected onDayClick(day: TuiDay): void {\n this.previousValue = this.currentValue;\n this.selectedActivePeriod = null;\n\n if (this.currentValue instanceof TuiDay) {\n const range = TuiDayRange.sort(this.currentValue, day);\n\n this.currentValue = range;\n this.itemChange.emit(this.findItemByDayRange(range));\n this.updateValue(range);\n } else {\n this.currentValue = day;\n }\n }\n\n protected updateValue(value: TuiDayRange | null): void {\n this.currentValue = value;\n this.valueChange.emit(value);\n }\n\n private get activePeriod(): TuiDayRangePeriod | null {\n return (\n this.item ??\n this.selectedActivePeriod ??\n (this.items.find((item) =>\n tuiNullableSame<TuiDayRange>(\n this.currentValue instanceof TuiDay\n ? new TuiDayRange(this.currentValue, this.currentValue)\n : this.currentValue,\n item.range,\n (a, b) =>\n a.from.daySame(b.from.dayLimit(this.min, this.max)) &&\n a.to.daySame(b.to.dayLimit(this.min, this.max)),\n ),\n ) ||\n null)\n );\n }\n\n @tuiPure\n private calculateDisabledItemHandler(\n disabledItemHandler: TuiBooleanHandler<TuiDay>,\n value: TuiDay | TuiDayRange | null,\n minLength: TuiDayLike | null,\n ): TuiBooleanHandler<TuiDay> {\n return calculateDisabledItemHandler(disabledItemHandler, value, minLength);\n }\n\n private initDefaultViewedMonth(): void {\n if (this.currentValue instanceof TuiDay) {\n this.month = this.currentValue;\n } else if (this.currentValue) {\n this.month = this.items.length\n ? this.currentValue.to\n : this.currentValue.from;\n } else if (this.max && this.month.monthSameOrAfter(this.max)) {\n this.month = this.items.length ? this.max : this.max.append({month: -1});\n } else if (this.min && this.month.monthSameOrBefore(this.min)) {\n this.month = this.min;\n }\n }\n\n private findItemByDayRange(dayRange: TuiDayRange): TuiDayRangePeriod | null {\n return this.items.find((item) => dayRange.daySame(item.range)) ?? null;\n }\n}\n","<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n [icon]=\"icons.check\"\n [style.font-size.rem]=\"1\"\n />\n }\n </button>\n }\n </tui-data-list>\n }\n}\n","import {TUI_FIRST_DAY, TuiDay, TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport class TuiDayRangePeriod {\n constructor(\n public readonly range: TuiDayRange,\n private readonly name: string,\n public readonly content?: PolymorpheusContent<TuiContext<TuiDayRange>>,\n ) {}\n\n public toString(): string {\n return this.name;\n }\n}\n\nexport function tuiCreateDefaultDayRangePeriods(\n periodTitles: [string, string, string, string, string, string] = [\n 'For all the time',\n 'Today',\n 'Yesterday',\n 'Current week',\n 'Current month',\n 'Previous month',\n ],\n): readonly TuiDayRangePeriod[] {\n const today = TuiDay.currentLocal();\n const yesterday = today.append({day: -1});\n const startOfWeek = today.append({day: -today.dayOfWeek()});\n const endOfWeek = startOfWeek.append({day: 6});\n const startOfMonth = today.append({day: 1 - today.day});\n const endOfMonth = startOfMonth.append({month: 1, day: -1});\n const startOfLastMonth = startOfMonth.append({month: -1});\n\n return [\n new TuiDayRangePeriod(new TuiDayRange(TUI_FIRST_DAY, today), periodTitles[0]),\n new TuiDayRangePeriod(new TuiDayRange(today, today), periodTitles[1]),\n new TuiDayRangePeriod(new TuiDayRange(yesterday, yesterday), periodTitles[2]),\n new TuiDayRangePeriod(new TuiDayRange(startOfWeek, endOfWeek), periodTitles[3]),\n new TuiDayRangePeriod(new TuiDayRange(startOfMonth, endOfMonth), periodTitles[4]),\n new TuiDayRangePeriod(\n new TuiDayRange(startOfLastMonth, startOfMonth.append({day: -1})),\n periodTitles[5],\n ),\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGa,MAAA,4BAA4B,GAIR,CAAC,mBAAmB,EAAE,KAAK,EAAE,SAAS,KAAK,CAAC,IAAI,KAAI;IACjF,IAAI,CAAC,KAAK,IAAI,KAAK,YAAY,WAAW,IAAI,CAAC,SAAS,EAAE;AACtD,QAAA,OAAO,mBAAmB,CAAC,IAAI,CAAC;;AAGpC,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CACxC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK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IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QACjF,IAAI,iBAAiB,CACjB,IAAI,WAAW,CAAC,gBAAgB,EAAE,YAAY,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EACjE,YAAY,CAAC,CAAC,CAAC,CAClB;KACJ;AACL;;AC7CA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-calendar-range.mjs","sources":["../../../projects/kit/components/calendar-range/calculate-disabled-item-handler.ts","../../../projects/kit/components/calendar-range/day-caps-mapper.ts","../../../projects/kit/components/calendar-range/calendar-range.component.ts","../../../projects/kit/components/calendar-range/calendar-range.template.html","../../../projects/kit/components/calendar-range/day-range-period.ts","../../../projects/kit/components/calendar-range/taiga-ui-kit-components-calendar-range.ts"],"sourcesContent":["import {type TuiDay, type TuiDayLike, TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {type TuiBooleanHandler} from '@taiga-ui/cdk/types';\n\nexport const calculateDisabledItemHandler: (\n disabledItemHandler: TuiBooleanHandler<TuiDay>,\n value: TuiDay | TuiDayRange | null,\n minLength: TuiDayLike | null,\n) => TuiBooleanHandler<TuiDay> = (disabledItemHandler, value, minLength) => (item) => {\n if (!value || value instanceof TuiDayRange || !minLength) {\n return disabledItemHandler(item);\n }\n\n const negativeMinLength = Object.fromEntries(\n Object.entries(minLength).map(([key, value]) => [key, -value]),\n );\n const disabledBefore = value.append(negativeMinLength).append({day: 1});\n const disabledAfter = value.append(minLength).append({day: -1});\n const inDisabledRange =\n disabledBefore.dayBefore(item) && disabledAfter.dayAfter(item);\n\n return inDisabledRange || disabledItemHandler(item);\n};\n","import {\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiDay,\n type TuiDayLike,\n TuiDayRange,\n} from '@taiga-ui/cdk/date-time';\nimport {type TuiMapper} from '@taiga-ui/cdk/types';\n\nexport const TUI_DAY_CAPS_MAPPER: TuiMapper<\n [TuiDay | null, TuiDay | TuiDayRange | null, TuiDayLike | null, boolean],\n TuiDay\n> = (current, value, maxLength, backwards) => {\n if (\n // TODO(v5): replace with `if (!(value instanceof TuiDay) || !maxLength)` (backward compatibility)\n (value instanceof TuiDayRange && !value.isSingleDay) ||\n !value ||\n !maxLength\n ) {\n return backwards ? current || TUI_FIRST_DAY : current || TUI_LAST_DAY;\n }\n\n const negativeMaxLength = Object.fromEntries(\n Object.entries(maxLength).map(([key, value]) => [key, -value]),\n );\n\n // TODO(v5): `value instanceof TuiDay` always `true`\n const from = value instanceof TuiDay ? value : value.from;\n const dateShift = from\n .append(backwards ? negativeMaxLength : maxLength)\n .append({day: !backwards ? -1 : 1});\n\n if (backwards) {\n return dateShift.dayBefore(current || TUI_FIRST_DAY)\n ? current || TUI_FIRST_DAY\n : dateShift;\n }\n\n if (!current) {\n return dateShift;\n }\n\n return dateShift.dayAfter(current) ? current : dateShift;\n};\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n type OnChanges,\n type OnInit,\n Output,\n} from '@angular/core';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiDay,\n type TuiDayLike,\n TuiDayRange,\n TuiMonth,\n} from '@taiga-ui/cdk/date-time';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {type TuiBooleanHandler, type TuiMapper} from '@taiga-ui/cdk/types';\nimport {tuiIsString, tuiNullableSame, tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiCalendar,\n tuiCalendarSheetOptionsProvider,\n type TuiMarkerHandler,\n} from '@taiga-ui/core/components/calendar';\nimport {TuiDataList} from '@taiga-ui/core/components/data-list';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TUI_COMMON_ICONS, tuiAsAuxiliary} from '@taiga-ui/core/tokens';\nimport {TUI_OTHER_DATE_TEXT} from '@taiga-ui/kit/tokens';\n\nimport {calculateDisabledItemHandler} from './calculate-disabled-item-handler';\nimport {TUI_DAY_CAPS_MAPPER} from './day-caps-mapper';\nimport {type TuiDayRangePeriod} from './day-range-period';\n\n@Component({\n selector: 'tui-calendar-range',\n imports: [TuiCalendar, TuiDataList, TuiIcon, TuiMapperPipe],\n templateUrl: './calendar-range.template.html',\n styleUrl: './calendar-range.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsAuxiliary(TuiCalendarRange),\n tuiCalendarSheetOptionsProvider({rangeMode: true}),\n ],\n host: {\n '[class._mobile]': 'mobile',\n '(document:keydown.capture)': 'onEsc($event)',\n },\n})\nexport class TuiCalendarRange implements OnInit, OnChanges {\n /**\n * @deprecated use `item`\n */\n private selectedPeriod: TuiDayRangePeriod | null = null;\n private readonly cdr = inject(ChangeDetectorRef);\n\n protected currentValue: TuiDay | TuiDayRange | null = null;\n protected previousValue: TuiDay | TuiDayRange | null = null;\n protected hoveredItem: TuiDay | null = null;\n protected month: TuiMonth = TuiMonth.currentLocal();\n\n protected readonly otherDateText = inject(TUI_OTHER_DATE_TEXT);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly capsMapper = TUI_DAY_CAPS_MAPPER;\n protected readonly mobile = inject(TUI_IS_MOBILE);\n\n @Input()\n public disabledItemHandler: TuiBooleanHandler<TuiDay> = TUI_FALSE_HANDLER;\n\n @Input()\n public markerHandler: TuiMarkerHandler | null = null;\n\n @Input()\n public items: readonly TuiDayRangePeriod[] = [];\n\n @Input()\n public min: TuiDay | null = TUI_FIRST_DAY;\n\n @Input()\n public max: TuiDay | null = TUI_LAST_DAY;\n\n @Input()\n public minLength: TuiDayLike | null = null;\n\n @Input()\n public maxLength: TuiDayLike | null = null;\n\n @Input()\n public item: TuiDayRangePeriod | null = null;\n\n @Output()\n public readonly valueChange = new EventEmitter<TuiDayRange | null>();\n\n @Output()\n public readonly itemChange = new EventEmitter<TuiDayRangePeriod | null>();\n\n @Input('value')\n public set valueSetter(value: TuiDayRange | null) {\n this.currentValue = value;\n }\n\n @Input()\n public set defaultViewedMonth(month: TuiMonth) {\n if (!this.currentValue) {\n this.month = month;\n }\n }\n\n public set value(value: TuiDayRange | null) {\n this.cdr.markForCheck();\n this.currentValue = value;\n this.initDefaultViewedMonth();\n }\n\n public get defaultViewedMonth(): TuiMonth {\n return this.month;\n }\n\n /**\n * @deprecated use `item`\n */\n public get selectedActivePeriod(): TuiDayRangePeriod | null {\n return this.selectedPeriod;\n }\n\n /**\n * @deprecated use `item`\n */\n public set selectedActivePeriod(period: TuiDayRangePeriod | null) {\n this.selectedPeriod = period;\n }\n\n public ngOnChanges(): void {\n if (!this.currentValue) {\n this.initDefaultViewedMonth();\n }\n }\n\n public ngOnInit(): void {\n this.initDefaultViewedMonth();\n }\n\n protected get calculatedDisabledItemHandler(): TuiBooleanHandler<TuiDay> {\n return this.calculateDisabledItemHandler(\n this.disabledItemHandler,\n this.currentValue,\n this.minLength,\n );\n }\n\n protected onEsc(event: KeyboardEvent): void {\n if (event.key !== 'Escape' || !(this.currentValue instanceof TuiDay)) {\n return;\n }\n\n event.stopPropagation();\n this.currentValue = this.previousValue;\n }\n\n protected readonly monthOffset: TuiMapper<[TuiMonth, number], TuiMonth> = (\n value,\n month,\n ) => value.append({month});\n\n protected readonly mapper: TuiMapper<\n [\n readonly TuiDayRangePeriod[],\n TuiDay | null,\n TuiDay | null,\n TuiDayLike | null,\n string | null | undefined,\n ],\n ReadonlyArray<TuiDayRangePeriod | string>\n > = (items, min, max, minLength, otherDateText) => [\n ...items.filter(\n (item) =>\n (minLength === null ||\n item.range.from\n .append(minLength)\n .append({day: -1})\n .daySameOrBefore(item.range.to)) &&\n (min === null || item.range.to.daySameOrAfter(min)) &&\n (max === null || item.range.from.daySameOrBefore(max)),\n ),\n otherDateText || '',\n ];\n\n protected isItemActive(item: TuiDayRangePeriod | string): boolean {\n const {activePeriod} = this;\n\n return (\n (tuiIsString(item) && activePeriod === null) ||\n activePeriod === item ||\n activePeriod?.toString() === item.toString()\n );\n }\n\n protected onItemSelect(item: TuiDayRangePeriod | string): void {\n if (!tuiIsString(item)) {\n this.selectedActivePeriod = item;\n this.itemChange.emit(item);\n this.updateValue(item.range.dayLimit(this.min, this.max));\n } else if (this.activePeriod !== null) {\n this.selectedActivePeriod = null;\n this.itemChange.emit(null);\n this.updateValue(null);\n }\n\n this.initDefaultViewedMonth();\n }\n\n protected onMonthChange(month: TuiMonth): void {\n this.month = month;\n }\n\n protected onDayClick(day: TuiDay): void {\n this.previousValue = this.currentValue;\n this.selectedActivePeriod = null;\n\n if (this.currentValue instanceof TuiDay) {\n const range = TuiDayRange.sort(this.currentValue, day);\n\n this.currentValue = range;\n this.itemChange.emit(this.findItemByDayRange(range));\n this.updateValue(range);\n } else {\n this.currentValue = day;\n }\n }\n\n protected updateValue(value: TuiDayRange | null): void {\n this.currentValue = value;\n this.valueChange.emit(value);\n }\n\n private get activePeriod(): TuiDayRangePeriod | null {\n return (\n this.item ??\n this.selectedActivePeriod ??\n (this.items.find((item) =>\n tuiNullableSame<TuiDayRange>(\n this.currentValue instanceof TuiDay\n ? new TuiDayRange(this.currentValue, this.currentValue)\n : this.currentValue,\n item.range,\n (a, b) =>\n a.from.daySame(b.from.dayLimit(this.min, this.max)) &&\n a.to.daySame(b.to.dayLimit(this.min, this.max)),\n ),\n ) ||\n null)\n );\n }\n\n @tuiPure\n private calculateDisabledItemHandler(\n disabledItemHandler: TuiBooleanHandler<TuiDay>,\n value: TuiDay | TuiDayRange | null,\n minLength: TuiDayLike | null,\n ): TuiBooleanHandler<TuiDay> {\n return calculateDisabledItemHandler(disabledItemHandler, value, minLength);\n }\n\n private initDefaultViewedMonth(): void {\n if (this.currentValue instanceof TuiDay) {\n this.month = this.currentValue;\n } else if (this.currentValue) {\n this.month = this.items.length\n ? this.currentValue.to\n : this.currentValue.from;\n } else if (this.max && this.month.monthSameOrAfter(this.max)) {\n this.month = this.items.length ? this.max : this.max.append({month: -1});\n } else if (this.min && this.month.monthSameOrBefore(this.min)) {\n this.month = this.min;\n }\n }\n\n private findItemByDayRange(dayRange: TuiDayRange): TuiDayRangePeriod | null {\n return this.items.find((item) => dayRange.daySame(item.range)) ?? null;\n }\n}\n","<tui-calendar\n automation-id=\"tui-calendar-range__calendar\"\n [class.t-calendar]=\"!mobile\"\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [maxViewedMonth]=\"items.length || mobile ? null : (defaultViewedMonth | tuiMapper: monthOffset : -1)\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [month]=\"defaultViewedMonth\"\n [showAdjacent]=\"!!items.length || mobile\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event)\"\n/>\n@if (!items.length && !mobile) {\n <tui-calendar\n [disabledItemHandler]=\"calculatedDisabledItemHandler\"\n [markerHandler]=\"markerHandler\"\n [max]=\"max | tuiMapper: capsMapper : currentValue : maxLength : false\"\n [min]=\"min | tuiMapper: capsMapper : currentValue : maxLength : true\"\n [minViewedMonth]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [month]=\"defaultViewedMonth | tuiMapper: monthOffset : 1\"\n [showAdjacent]=\"false\"\n [value]=\"currentValue\"\n [(hoveredItem)]=\"hoveredItem\"\n (dayClick)=\"onDayClick($event)\"\n (monthChange)=\"onMonthChange($event.append({month: -1}))\"\n />\n} @else {\n @if (!mobile) {\n <tui-data-list\n automation-id=\"tui-calendar-range__menu\"\n role=\"menu\"\n [style.flex]=\"1\"\n >\n @for (item of items | tuiMapper: mapper : min : max : minLength : otherDateText(); track item) {\n <button\n automation-id=\"tui-calendar-range__menu__item\"\n role=\"menuitemradio\"\n tuiOption\n type=\"button\"\n [attr.aria-checked]=\"isItemActive(item)\"\n (click)=\"onItemSelect(item)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ item }}\n @if (isItemActive(item)) {\n <tui-icon\n automation-id=\"tui-calendar-range__checkmark\"\n class=\"t-check\"\n [icon]=\"icons.check\"\n />\n }\n </button>\n }\n </tui-data-list>\n }\n}\n","import {inject} from '@angular/core';\nimport {TUI_FIRST_DAY, TuiDay, TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {type TuiLanguageKit} from '@taiga-ui/i18n/types';\nimport {TUI_DAY_RANGE_PERIODS} from '@taiga-ui/kit/tokens';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport class TuiDayRangePeriod {\n constructor(\n public readonly range: TuiDayRange,\n private readonly name: string,\n public readonly content?: PolymorpheusContent<TuiContext<TuiDayRange>>,\n ) {}\n\n public toString(): string {\n return this.name;\n }\n}\n\nfunction getDefaultPeriodTitles(): TuiLanguageKit['dayRangePeriods'] {\n try {\n return inject(TUI_DAY_RANGE_PERIODS)();\n } catch {\n return [\n 'For all the time',\n 'Today',\n 'Yesterday',\n 'Current week',\n 'Current month',\n 'Previous month',\n ];\n }\n}\n\nexport function tuiCreateDefaultDayRangePeriods(\n periodTitles: TuiLanguageKit['dayRangePeriods'] = getDefaultPeriodTitles(),\n): readonly TuiDayRangePeriod[] {\n const today = TuiDay.currentLocal();\n const yesterday = today.append({day: -1});\n const startOfWeek = today.append({day: -today.dayOfWeek()});\n const endOfWeek = startOfWeek.append({day: 6});\n const startOfMonth = today.append({day: 1 - today.day});\n const endOfMonth = startOfMonth.append({month: 1, day: -1});\n const startOfLastMonth = startOfMonth.append({month: -1});\n\n return [\n new TuiDayRangePeriod(new TuiDayRange(TUI_FIRST_DAY, today), periodTitles[0]),\n new TuiDayRangePeriod(new TuiDayRange(today, today), periodTitles[1]),\n new TuiDayRangePeriod(new TuiDayRange(yesterday, yesterday), periodTitles[2]),\n new TuiDayRangePeriod(new TuiDayRange(startOfWeek, endOfWeek), periodTitles[3]),\n new TuiDayRangePeriod(new TuiDayRange(startOfMonth, endOfMonth), periodTitles[4]),\n new TuiDayRangePeriod(\n new TuiDayRange(startOfLastMonth, startOfMonth.append({day: -1})),\n periodTitles[5],\n ),\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGa,MAAA,4BAA4B,GAIR,CAAC,mBAAmB,EAAE,KAAK,EAAE,SAAS,KAAK,CAAC,IAAI,KAAI;IACjF,IAAI,CAAC,KAAK,IAAI,KAAK,YAAY,WAAW,IAAI,CAAC,SAAS,EAAE;AACtD,QAAA,OAAO,mBAAmB,CAAC,IAAI,CAAC;;AAGpC,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CACxC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CACjE;AACD,IAAA,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,CAAC,EAAC,CAAC;AACvE,IAAA,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,CAAC,CAAC,EAAC,CAAC;AAC/D,IAAA,MAAM,eAAe,GACjB,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC;AAElE,IAAA,OAAO,eAAe,IAAI,mBAAmB,CAAC,IAAI,CAAC;AACvD;;ACZO,MAAM,mBAAmB,GAG5B,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,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C3D,IAAA,MAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,EAAC,KAAK,EAAE,CAAC,CAAC,EAAC,CAAC;IAEzD,OAAO;AACH,QAAA,IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAC7E,QAAA,IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AACrE,QAAA,IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAC7E,QAAA,IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAC/E,QAAA,IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QACjF,IAAI,iBAAiB,CACjB,IAAI,WAAW,CAAC,gBAAgB,EAAE,YAAY,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,EACjE,YAAY,CAAC,CAAC,CAAC,CAClB;KACJ;AACL;;ACxDA;;AAEG;;;;"}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { TuiItem } from '@taiga-ui/cdk/directives/item';
|
|
2
|
-
import {
|
|
3
|
-
import { isPlatformServer, AsyncPipe, NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import { isPlatformServer, NgTemplateOutlet } from '@angular/common';
|
|
4
3
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { inject, PLATFORM_ID, NgZone,
|
|
4
|
+
import { inject, PLATFORM_ID, NgZone, input, Directive, Output, signal, computed, contentChildren, TemplateRef, effect, model, output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
5
|
import * as i2 from '@ng-web-apis/intersection-observer';
|
|
7
6
|
import { WaIntersectionObserver } from '@ng-web-apis/intersection-observer';
|
|
8
|
-
import { TUI_FALSE_HANDLER, TUI_TRUE_HANDLER, EMPTY_QUERY } from '@taiga-ui/cdk/constants';
|
|
9
7
|
import { TuiPan } from '@taiga-ui/cdk/directives/pan';
|
|
10
8
|
import { TuiSwipe, TUI_SWIPE_OPTIONS } from '@taiga-ui/cdk/directives/swipe';
|
|
11
9
|
import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
|
|
12
10
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
13
11
|
import { tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
14
|
-
import { tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
15
12
|
import { WA_PAGE_VISIBILITY } from '@ng-web-apis/common';
|
|
13
|
+
import { TUI_FALSE_HANDLER, TUI_TRUE_HANDLER } from '@taiga-ui/cdk/constants';
|
|
16
14
|
import { tuiTypedFromEvent, tuiIfMap, tuiZoneOptimized, tuiZonefreeScheduler } from '@taiga-ui/cdk/observables';
|
|
17
|
-
import { Observable,
|
|
15
|
+
import { Observable, Subject, merge, map, EMPTY, combineLatest, interval, filter, throttleTime, tap } from 'rxjs';
|
|
18
16
|
import { tuiButtonOptionsProvider } from '@taiga-ui/core/components/button';
|
|
19
17
|
|
|
20
18
|
class TuiCarouselDirective extends Observable {
|
|
@@ -24,38 +22,36 @@ class TuiCarouselDirective extends Observable {
|
|
|
24
22
|
this.platform = inject(PLATFORM_ID);
|
|
25
23
|
this.visible$ = inject(WA_PAGE_VISIBILITY);
|
|
26
24
|
this.zone = inject(NgZone);
|
|
27
|
-
this.
|
|
25
|
+
this.trigger$ = new Subject();
|
|
28
26
|
this.running$ = merge(tuiTypedFromEvent(this.el, 'mouseenter').pipe(map(TUI_FALSE_HANDLER)), tuiTypedFromEvent(this.el, 'touchstart').pipe(map(TUI_FALSE_HANDLER)), tuiTypedFromEvent(this.el, 'touchend').pipe(map(TUI_TRUE_HANDLER)), tuiTypedFromEvent(this.el, 'mouseleave').pipe(map(TUI_TRUE_HANDLER)), this.visible$);
|
|
27
|
+
this.duration = input(0);
|
|
29
28
|
this.output$ = isPlatformServer(this.platform)
|
|
30
29
|
? EMPTY
|
|
31
|
-
: combineLatest([
|
|
30
|
+
: combineLatest([
|
|
31
|
+
this.trigger$.pipe(map(() => this.duration())),
|
|
32
|
+
this.running$,
|
|
33
|
+
]).pipe(tuiIfMap(([duration]) => interval(duration).pipe(tuiZoneOptimized(this.zone)), (values) => values.every(Boolean)));
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
+
restart() {
|
|
36
|
+
this.trigger$.next();
|
|
35
37
|
}
|
|
36
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
37
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
39
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiCarouselDirective, isStandalone: true, inputs: { duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
38
40
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
40
|
-
type: Directive
|
|
41
|
-
|
|
42
|
-
standalone: true,
|
|
43
|
-
}]
|
|
44
|
-
}], ctorParameters: () => [], propDecorators: { duration: [{
|
|
45
|
-
type: Input
|
|
46
|
-
}] } });
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselDirective, decorators: [{
|
|
42
|
+
type: Directive
|
|
43
|
+
}], ctorParameters: () => [] });
|
|
47
44
|
|
|
48
45
|
class TuiCarouselAutoscroll {
|
|
49
46
|
constructor() {
|
|
50
47
|
this.tuiCarouselAutoscroll = inject(TuiCarouselDirective);
|
|
51
48
|
}
|
|
52
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
53
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
49
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselAutoscroll, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
50
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiCarouselAutoscroll, isStandalone: true, selector: "[tuiCarouselAutoscroll]", outputs: { tuiCarouselAutoscroll: "tuiCarouselAutoscroll" }, ngImport: i0 }); }
|
|
54
51
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselAutoscroll, decorators: [{
|
|
56
53
|
type: Directive,
|
|
57
54
|
args: [{
|
|
58
|
-
standalone: true,
|
|
59
55
|
selector: '[tuiCarouselAutoscroll]',
|
|
60
56
|
}]
|
|
61
57
|
}], propDecorators: { tuiCarouselAutoscroll: [{
|
|
@@ -70,13 +66,12 @@ class TuiCarouselScroll {
|
|
|
70
66
|
this.el.scrollLeft = 10;
|
|
71
67
|
}));
|
|
72
68
|
}
|
|
73
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
74
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
69
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselScroll, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
70
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiCarouselScroll, isStandalone: true, selector: "[tuiCarouselScroll]", outputs: { tuiCarouselScroll: "tuiCarouselScroll" }, ngImport: i0 }); }
|
|
75
71
|
}
|
|
76
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselScroll, decorators: [{
|
|
77
73
|
type: Directive,
|
|
78
74
|
args: [{
|
|
79
|
-
standalone: true,
|
|
80
75
|
selector: '[tuiCarouselScroll]',
|
|
81
76
|
}]
|
|
82
77
|
}], propDecorators: { tuiCarouselScroll: [{
|
|
@@ -86,73 +81,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
86
81
|
class TuiCarouselComponent {
|
|
87
82
|
constructor() {
|
|
88
83
|
this.el = tuiInjectElement();
|
|
89
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
90
84
|
this.isMobile = inject(TUI_IS_MOBILE);
|
|
91
85
|
this.directive = inject(TuiCarouselDirective);
|
|
92
|
-
this.translate = 0;
|
|
93
|
-
this.
|
|
94
|
-
this.
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
99
|
-
this.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this.
|
|
86
|
+
this.translate = signal(0);
|
|
87
|
+
this.transitioned = signal(true);
|
|
88
|
+
this.transform = computed(() => `translateX(${100 * this.x()}%)`);
|
|
89
|
+
this.items = contentChildren(TuiItem, { read: TemplateRef });
|
|
90
|
+
this.computedDraggable = computed(() => this.isMobile || this.draggable());
|
|
91
|
+
this.computedTranslate = computed(() => -this.index() / this.itemsCount());
|
|
92
|
+
this.x = computed(() => this.transitioned() ? this.computedTranslate() : this.translate());
|
|
93
|
+
this.resetDuration = effect(() => {
|
|
94
|
+
this.index();
|
|
95
|
+
this.directive.restart();
|
|
96
|
+
});
|
|
97
|
+
this.draggable = input(false);
|
|
98
|
+
this.itemsCount = input(1);
|
|
99
|
+
this.index = model(0);
|
|
100
|
+
this.shift = output();
|
|
104
101
|
}
|
|
105
102
|
next() {
|
|
106
|
-
if (this.
|
|
107
|
-
|
|
103
|
+
if (this.index() !== this.items().length - this.itemsCount()) {
|
|
104
|
+
this.updateIndex(this.index() + 1);
|
|
108
105
|
}
|
|
109
|
-
this.updateIndex(this.index + 1);
|
|
110
106
|
}
|
|
111
107
|
prev() {
|
|
112
|
-
this.updateIndex(this.index - 1);
|
|
113
|
-
}
|
|
114
|
-
get transform() {
|
|
115
|
-
return `translateX(${100 * this.x}%)`;
|
|
116
|
-
}
|
|
117
|
-
getStyle(itemsCount) {
|
|
118
|
-
const percent = `${100 / itemsCount}%`;
|
|
119
|
-
return {
|
|
120
|
-
flexBasis: percent,
|
|
121
|
-
minWidth: percent,
|
|
122
|
-
maxWidth: percent,
|
|
123
|
-
};
|
|
108
|
+
this.updateIndex(this.index() - 1);
|
|
124
109
|
}
|
|
125
110
|
onTransitioned(transitioned) {
|
|
126
|
-
this.transitioned
|
|
111
|
+
this.transitioned.set(transitioned);
|
|
127
112
|
if (!transitioned) {
|
|
128
|
-
this.translate
|
|
113
|
+
this.translate.set(this.computedTranslate());
|
|
129
114
|
}
|
|
130
115
|
this.onShift();
|
|
131
116
|
}
|
|
132
117
|
isDisabled(index) {
|
|
133
|
-
return index < this.index || index >= this.index + this.itemsCount;
|
|
118
|
+
return index < this.index() || index >= this.index() + this.itemsCount();
|
|
134
119
|
}
|
|
135
|
-
onIntersection(
|
|
136
|
-
if (
|
|
137
|
-
this.updateIndex(this.index < index ? index - this.itemsCount + 1 : index);
|
|
120
|
+
onIntersection(ratio, index) {
|
|
121
|
+
if (ratio && ratio >= 0.5 && !this.transitioned()) {
|
|
122
|
+
this.updateIndex(this.index() < index ? index - this.itemsCount() + 1 : index);
|
|
138
123
|
}
|
|
139
124
|
}
|
|
140
125
|
onScroll(delta) {
|
|
141
126
|
if (!this.isMobile) {
|
|
142
|
-
|
|
143
|
-
this.next();
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
this.prev();
|
|
147
|
-
}
|
|
127
|
+
this.onSwipe(delta > 0 ? 'left' : 'right');
|
|
148
128
|
}
|
|
149
129
|
}
|
|
150
130
|
onPan(x) {
|
|
151
|
-
if (!this.computedDraggable) {
|
|
131
|
+
if (!this.computedDraggable()) {
|
|
152
132
|
return;
|
|
153
133
|
}
|
|
154
|
-
const min = 1 - this.items.length / this.itemsCount;
|
|
155
|
-
this.translate
|
|
134
|
+
const min = 1 - this.items().length / this.itemsCount();
|
|
135
|
+
this.translate.set(tuiClamp(x / this.el.clientWidth + this.translate(), min, 0));
|
|
156
136
|
this.onShift();
|
|
157
137
|
}
|
|
158
138
|
onSwipe(direction) {
|
|
@@ -164,35 +144,20 @@ class TuiCarouselComponent {
|
|
|
164
144
|
}
|
|
165
145
|
}
|
|
166
146
|
onAutoscroll() {
|
|
167
|
-
this.updateIndex(this.index === this.items.length - 1 ? 0 : this.index + 1);
|
|
147
|
+
this.updateIndex(this.index() === this.items().length - 1 ? 0 : this.index() + 1);
|
|
168
148
|
}
|
|
169
149
|
onShift() {
|
|
170
|
-
this.shift.emit(Math.abs((this.x % 1) + 0.5) * 2);
|
|
171
|
-
}
|
|
172
|
-
get x() {
|
|
173
|
-
return this.transitioned ? this.computedTranslate : this.translate;
|
|
174
|
-
}
|
|
175
|
-
get computedTranslate() {
|
|
176
|
-
return -this.index / this.itemsCount;
|
|
177
|
-
}
|
|
178
|
-
get computedDraggable() {
|
|
179
|
-
return this.isMobile || this.draggable;
|
|
150
|
+
this.shift.emit(Math.abs((this.x() % 1) + 0.5) * 2);
|
|
180
151
|
}
|
|
181
152
|
updateIndex(index) {
|
|
182
|
-
this.index
|
|
183
|
-
this.indexChange.emit(this.index);
|
|
184
|
-
this.cdr.markForCheck();
|
|
153
|
+
this.index.set(tuiClamp(index, 0, this.items().length - 1));
|
|
185
154
|
}
|
|
186
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
187
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
155
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
156
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiCarouselComponent, isStandalone: true, selector: "tui-carousel", inputs: { draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, itemsCount: { classPropertyName: "itemsCount", publicName: "itemsCount", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { index: "indexChange", shift: "shift" }, host: { listeners: { "touchstart": "onTransitioned(false)", "touchend": "onTransitioned(true)", "mousedown": "onTransitioned(false)", "document:mouseup.zoneless": "onTransitioned(true)" }, properties: { "class._transitioned": "transitioned()", "class._draggable": "draggable()" } }, providers: [{ provide: TUI_SWIPE_OPTIONS, useValue: { timeout: 200, threshold: 30 } }], queries: [{ propertyName: "items", predicate: TuiItem, read: TemplateRef, isSignal: true }], hostDirectives: [{ directive: TuiCarouselDirective, inputs: ["duration", "duration"] }], ngImport: i0, template: "<div\n class=\"t-scroller\"\n (tuiCarouselScroll)=\"onScroll($event)\"\n>\n <div\n waIntersectionObserver\n waIntersectionThreshold=\"0.5\"\n class=\"t-wrapper\"\n >\n <div\n class=\"t-items\"\n [style.transform]=\"transform()\"\n (tuiCarouselAutoscroll)=\"onAutoscroll()\"\n (tuiPan)=\"onPan($event[0])\"\n (tuiSwipe)=\"onSwipe($event.direction)\"\n >\n @for (item of items(); track $index) {\n <fieldset\n class=\"t-item\"\n [disabled]=\"isDisabled($index)\"\n [style.flex-basis.%]=\"100 / itemsCount()\"\n [style.max-width.%]=\"100 / itemsCount()\"\n [style.min-width.%]=\"100 / itemsCount()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0].intersectionRatio, $index)\"\n >\n <ng-container [ngTemplateOutlet]=\"item\" />\n </fieldset>\n }\n </div>\n </div>\n</div>\n", styles: [":host{position:relative;display:block;overflow:hidden}:host._draggable{-webkit-user-select:none;user-select:none}:host._draggable:hover{cursor:grab}:host._draggable:active{cursor:grabbing}.t-items{display:flex}:host._transitioned .t-items{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}::ng-deep [tuiCarouselButtons] [tuiIconButton]{border-radius:100%}.t-item{display:flex;flex-direction:column;justify-content:center;padding:var(--tui-carousel-padding, 0 1.25rem);flex:1;min-inline-size:100%;max-inline-size:100%;box-sizing:border-box;border:none;margin:0}.t-wrapper{position:sticky;left:0;right:0;min-inline-size:100%;overflow:hidden}.t-scroller{scrollbar-width:none;-ms-overflow-style:none;display:flex;overflow:auto;overscroll-behavior-x:none;touch-action:pan-y}.t-scroller::-webkit-scrollbar,.t-scroller::-webkit-scrollbar-thumb{display:none}.t-scroller:before,.t-scroller:after{content:\"\";display:block;min-inline-size:1rem}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TuiCarouselAutoscroll, selector: "[tuiCarouselAutoscroll]", outputs: ["tuiCarouselAutoscroll"] }, { kind: "directive", type: TuiCarouselScroll, selector: "[tuiCarouselScroll]", outputs: ["tuiCarouselScroll"] }, { kind: "directive", type: TuiPan, selector: "[tuiPan]", outputs: ["tuiPan"] }, { kind: "directive", type: TuiSwipe, selector: "[tuiSwipe]", outputs: ["tuiSwipe"] }, { kind: "directive", type: i2.WaIntersectionObserverDirective, selector: "[waIntersectionObserver]", inputs: ["waIntersectionRootMargin", "waIntersectionThreshold"], exportAs: ["IntersectionObserver"] }, { kind: "directive", type: i2.WaIntersectionObservee, selector: "[waIntersectionObservee]", outputs: ["waIntersectionObservee"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
188
157
|
}
|
|
189
|
-
|
|
190
|
-
tuiPure
|
|
191
|
-
], TuiCarouselComponent.prototype, "getStyle", null);
|
|
192
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiCarouselComponent, decorators: [{
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselComponent, decorators: [{
|
|
193
159
|
type: Component,
|
|
194
160
|
args: [{ selector: 'tui-carousel', imports: [
|
|
195
|
-
AsyncPipe,
|
|
196
161
|
NgTemplateOutlet,
|
|
197
162
|
TuiCarouselAutoscroll,
|
|
198
163
|
TuiCarouselScroll,
|
|
@@ -205,42 +170,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
205
170
|
inputs: ['duration'],
|
|
206
171
|
},
|
|
207
172
|
], host: {
|
|
208
|
-
'[class._transitioned]': 'transitioned',
|
|
209
|
-
'[class._draggable]': 'draggable',
|
|
173
|
+
'[class._transitioned]': 'transitioned()',
|
|
174
|
+
'[class._draggable]': 'draggable()',
|
|
210
175
|
'(touchstart)': 'onTransitioned(false)',
|
|
211
176
|
'(touchend)': 'onTransitioned(true)',
|
|
212
177
|
'(mousedown)': 'onTransitioned(false)',
|
|
213
178
|
'(document:mouseup.zoneless)': 'onTransitioned(true)',
|
|
214
|
-
}, template: "
|
|
215
|
-
}]
|
|
216
|
-
type: ContentChildren,
|
|
217
|
-
args: [TuiItem, { read: TemplateRef }]
|
|
218
|
-
}], draggable: [{
|
|
219
|
-
type: Input
|
|
220
|
-
}], itemsCount: [{
|
|
221
|
-
type: Input
|
|
222
|
-
}], indexChange: [{
|
|
223
|
-
type: Output
|
|
224
|
-
}], shift: [{
|
|
225
|
-
type: Output
|
|
226
|
-
}], indexSetter: [{
|
|
227
|
-
type: Input,
|
|
228
|
-
args: ['index']
|
|
229
|
-
}], getStyle: [] } });
|
|
179
|
+
}, template: "<div\n class=\"t-scroller\"\n (tuiCarouselScroll)=\"onScroll($event)\"\n>\n <div\n waIntersectionObserver\n waIntersectionThreshold=\"0.5\"\n class=\"t-wrapper\"\n >\n <div\n class=\"t-items\"\n [style.transform]=\"transform()\"\n (tuiCarouselAutoscroll)=\"onAutoscroll()\"\n (tuiPan)=\"onPan($event[0])\"\n (tuiSwipe)=\"onSwipe($event.direction)\"\n >\n @for (item of items(); track $index) {\n <fieldset\n class=\"t-item\"\n [disabled]=\"isDisabled($index)\"\n [style.flex-basis.%]=\"100 / itemsCount()\"\n [style.max-width.%]=\"100 / itemsCount()\"\n [style.min-width.%]=\"100 / itemsCount()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0].intersectionRatio, $index)\"\n >\n <ng-container [ngTemplateOutlet]=\"item\" />\n </fieldset>\n }\n </div>\n </div>\n</div>\n", styles: [":host{position:relative;display:block;overflow:hidden}:host._draggable{-webkit-user-select:none;user-select:none}:host._draggable:hover{cursor:grab}:host._draggable:active{cursor:grabbing}.t-items{display:flex}:host._transitioned .t-items{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}::ng-deep [tuiCarouselButtons] [tuiIconButton]{border-radius:100%}.t-item{display:flex;flex-direction:column;justify-content:center;padding:var(--tui-carousel-padding, 0 1.25rem);flex:1;min-inline-size:100%;max-inline-size:100%;box-sizing:border-box;border:none;margin:0}.t-wrapper{position:sticky;left:0;right:0;min-inline-size:100%;overflow:hidden}.t-scroller{scrollbar-width:none;-ms-overflow-style:none;display:flex;overflow:auto;overscroll-behavior-x:none;touch-action:pan-y}.t-scroller::-webkit-scrollbar,.t-scroller::-webkit-scrollbar-thumb{display:none}.t-scroller:before,.t-scroller:after{content:\"\";display:block;min-inline-size:1rem}\n"] }]
|
|
180
|
+
}] });
|
|
230
181
|
|
|
231
182
|
class TuiCarouselButtons {
|
|
232
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
233
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
183
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselButtons, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
184
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiCarouselButtons, isStandalone: true, selector: "[tuiCarouselButtons]", providers: [
|
|
234
185
|
tuiButtonOptionsProvider({
|
|
235
186
|
appearance: 'secondary',
|
|
236
187
|
size: 'm',
|
|
237
188
|
}),
|
|
238
189
|
], ngImport: i0 }); }
|
|
239
190
|
}
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiCarouselButtons, decorators: [{
|
|
241
192
|
type: Directive,
|
|
242
193
|
args: [{
|
|
243
|
-
standalone: true,
|
|
244
194
|
selector: '[tuiCarouselButtons]',
|
|
245
195
|
providers: [
|
|
246
196
|
tuiButtonOptionsProvider({
|