@taiga-ui/kit 4.48.0 → 4.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/accordion-item.component.d.ts +1 -1
- package/components/accordion/accordion.directive.d.ts +1 -1
- package/components/action-bar/action-bar.component.d.ts +2 -2
- package/components/avatar/avatar-stack.component.d.ts +1 -1
- package/components/avatar/avatar.component.d.ts +1 -1
- package/components/avatar/avatar.options.d.ts +3 -4
- package/components/badge/badge.options.d.ts +3 -4
- package/components/badge-notification/badge-notification.component.d.ts +1 -1
- package/components/badge-notification/badge-notification.options.d.ts +2 -3
- package/components/badged-content/badged-content.directive.d.ts +1 -1
- package/components/block/block.directive.d.ts +1 -1
- package/components/block/block.options.d.ts +3 -4
- package/components/breadcrumbs/breadcrumbs.component.d.ts +2 -3
- package/components/breadcrumbs/breadcrumbs.options.d.ts +2 -3
- package/components/button-loading/button-loading.component.d.ts +1 -1
- package/components/calendar-month/calendar-month.component.d.ts +1 -1
- package/components/calendar-range/calculate-disabled-item-handler.d.ts +2 -3
- package/components/calendar-range/calendar-range.component.d.ts +6 -8
- package/components/calendar-range/day-caps-mapper.d.ts +2 -3
- package/components/calendar-range/day-range-period.d.ts +2 -2
- package/components/carousel/carousel.component.d.ts +2 -3
- package/components/checkbox/checkbox.component.d.ts +2 -2
- package/components/checkbox/checkbox.options.d.ts +3 -4
- package/components/chip/chip.directive.d.ts +1 -1
- package/components/chip/chip.options.d.ts +3 -4
- package/components/combo-box/combo-box.directive.d.ts +2 -2
- package/components/comment/comment.directive.d.ts +1 -1
- package/components/confirm/confirm.component.d.ts +2 -3
- package/components/confirm/confirm.service.d.ts +3 -3
- package/components/data-list-wrapper/data-list-wrapper.component.d.ts +5 -7
- package/components/drawer/drawer.component.d.ts +1 -1
- package/components/files/file/file.component.d.ts +6 -6
- package/components/files/file/file.options.d.ts +5 -5
- package/components/files/files/files.component.d.ts +1 -2
- package/components/files/files.types.d.ts +1 -1
- package/components/files/files.utils.d.ts +1 -1
- package/components/files/files.validators.d.ts +1 -1
- package/components/files/input-files/input-files-validator.directive.d.ts +1 -1
- package/components/files/input-files/input-files.component.d.ts +1 -1
- package/components/files/input-files/input-files.content.d.ts +1 -1
- package/components/files/input-files/input-files.directive.d.ts +2 -2
- package/components/files/input-files/input-files.options.d.ts +2 -3
- package/components/files/pipes/file-rejected.pipe.d.ts +3 -3
- package/components/filter/filter.component.d.ts +3 -3
- package/components/index.d.ts +1 -0
- package/components/input-chip/input-chip.component.d.ts +1 -1
- package/components/input-chip/input-chip.directive.d.ts +2 -3
- package/components/input-color/input-color.component.d.ts +2 -2
- package/components/input-color/input-color.options.d.ts +1 -1
- package/components/input-date/date-filler.d.ts +1 -1
- package/components/input-date/input-date.directive.d.ts +4 -5
- package/components/input-date/input-date.options.d.ts +4 -4
- package/components/input-date-range/input-date-range.directive.d.ts +2 -3
- package/components/input-date-range/input-date-range.options.d.ts +4 -5
- package/components/input-date-time/input-date-time.directive.d.ts +4 -4
- package/components/input-date-time/input-date-time.options.d.ts +5 -6
- package/components/input-month/input-month.directive.d.ts +1 -1
- package/components/input-month/input-month.options.d.ts +5 -6
- package/components/input-month-range/input-month-range.options.d.ts +5 -6
- package/components/input-number/index.d.ts +1 -0
- package/components/input-number/input-number.d.ts +2 -1
- package/components/input-number/input-number.directive.d.ts +1 -2
- package/components/input-number/input-number.options.d.ts +1 -1
- package/components/input-number/quantum.directive.d.ts +14 -0
- package/components/input-number/step/input-number-step.component.d.ts +1 -1
- package/components/input-password/input-password.options.d.ts +3 -4
- package/components/input-phone/index.d.ts +2 -0
- package/components/input-phone/input-phone.directive.d.ts +27 -0
- package/components/input-phone/input-phone.options.d.ts +8 -0
- package/components/input-phone/utils/complete-phone-insertion-preprocessor.d.ts +9 -0
- package/components/input-phone/utils/create-phone-mask-expression.d.ts +7 -0
- package/components/input-phone-international/input-phone-international.component.d.ts +4 -4
- package/components/input-phone-international/input-phone-international.options.d.ts +4 -5
- package/components/input-pin/input-pin.component.d.ts +1 -1
- package/components/input-slider/input-slider.directive.d.ts +4 -4
- package/components/input-time/input-time.component.d.ts +2 -3
- package/components/input-time/input-time.directive.d.ts +3 -3
- package/components/input-time/input-time.options.d.ts +5 -5
- package/components/input-year/input-year.options.d.ts +3 -4
- package/components/items-with-more/items-with-more.component.d.ts +2 -3
- package/components/items-with-more/items-with-more.directive.d.ts +1 -1
- package/components/items-with-more/more.directive.d.ts +1 -1
- package/components/like/like.component.d.ts +3 -3
- package/components/like/like.options.d.ts +3 -3
- package/components/line-clamp/line-clamp-position.directive.d.ts +1 -1
- package/components/line-clamp/line-clamp.component.d.ts +3 -3
- package/components/line-clamp/line-clamp.options.d.ts +1 -2
- package/components/multi-select/multi-select-group/multi-select-group.component.d.ts +1 -1
- package/components/multi-select/multi-select-native/multi-select-native.component.d.ts +1 -1
- package/components/multi-select/multi-select-option/multi-select-option.component.d.ts +1 -1
- package/components/pager/pager.component.d.ts +2 -2
- package/components/pagination/pagination.component.d.ts +3 -3
- package/components/pdf-viewer/pdf-viewer.component.d.ts +2 -2
- package/components/pdf-viewer/pdf-viewer.directive.d.ts +1 -1
- package/components/pdf-viewer/pdf-viewer.options.d.ts +2 -3
- package/components/pdf-viewer/pdf-viewer.service.d.ts +5 -6
- package/components/preview/dialog/preview-dialog.component.d.ts +1 -1
- package/components/preview/preview.component.d.ts +1 -1
- package/components/progress/progress-bar/progress-bar.component.d.ts +1 -1
- package/components/progress/progress-circle/progress-circle.component.d.ts +2 -2
- package/components/progress/progress.options.d.ts +2 -3
- package/components/push/push-alert.component.d.ts +2 -2
- package/components/push/push.options.d.ts +1 -2
- package/components/push/push.service.d.ts +1 -1
- package/components/radio/radio.component.d.ts +2 -2
- package/components/radio/radio.directive.d.ts +1 -1
- package/components/radio/radio.options.d.ts +3 -4
- package/components/radio-list/radio-list.component.d.ts +4 -4
- 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 +3 -4
- package/components/routable-dialog/generate-dialogable-route.d.ts +3 -3
- package/components/segmented/segmented.component.d.ts +2 -3
- package/components/segmented/segmented.directive.d.ts +1 -1
- package/components/select/native-select/native-select.component.d.ts +2 -2
- package/components/select/select.directive.d.ts +1 -1
- package/components/slider/helpers/key-steps.d.ts +2 -2
- package/components/slider/helpers/slider-key-steps.directive.d.ts +2 -3
- package/components/slider/helpers/slider-readonly.directive.d.ts +1 -1
- package/components/slider/helpers/slider-thumb-label.component.d.ts +2 -2
- package/components/slider/slider.component.d.ts +1 -1
- package/components/slider/slider.options.d.ts +2 -3
- package/components/stepper/stepper.component.d.ts +3 -4
- package/components/switch/switch.component.d.ts +2 -2
- package/components/switch/switch.options.d.ts +3 -4
- package/components/tabs/tab.directive.d.ts +1 -1
- package/components/tabs/tabs-horizontal.directive.d.ts +1 -1
- package/components/tabs/tabs-vertical.directive.d.ts +1 -1
- package/components/tabs/tabs-with-more.component.d.ts +5 -6
- package/components/tabs/tabs.directive.d.ts +2 -3
- package/components/tabs/tabs.options.d.ts +2 -3
- package/components/tabs/tabs.providers.d.ts +2 -3
- package/components/textarea/textarea-limit.directive.d.ts +3 -3
- package/components/textarea/textarea.component.d.ts +2 -3
- package/components/textarea/textarea.options.d.ts +2 -2
- package/components/tiles/tile.component.d.ts +1 -1
- package/components/tiles/tile.service.d.ts +1 -1
- package/components/tree/components/tree/tree.component.d.ts +3 -3
- package/components/tree/components/tree-item/tree-item.component.d.ts +3 -3
- package/components/tree/components/tree-item-content/tree-item-content.component.d.ts +2 -2
- package/components/tree/directives/tree-children.directive.d.ts +1 -1
- package/components/tree/directives/tree-controller.directive.d.ts +2 -2
- package/components/tree/directives/tree-item-controller.directive.d.ts +2 -2
- package/components/tree/directives/tree-node.directive.d.ts +1 -1
- package/components/tree/misc/tree.constants.d.ts +1 -1
- package/components/tree/misc/tree.interfaces.d.ts +4 -4
- package/components/tree/misc/tree.tokens.d.ts +2 -2
- package/directives/button-select/button-select.directive.d.ts +1 -1
- package/directives/copy/copy.component.d.ts +1 -1
- package/directives/copy/copy.options.d.ts +2 -2
- package/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.d.ts +1 -1
- package/directives/fade/fade.directive.d.ts +1 -1
- package/directives/fluid-typography/fluid-typography.directive.d.ts +1 -1
- package/directives/fluid-typography/fluid-typography.options.d.ts +1 -2
- package/directives/highlight/highlight.directive.d.ts +1 -1
- package/directives/lazy-loading/lazy-loading.directive.d.ts +1 -1
- package/directives/lazy-loading/lazy-loading.service.d.ts +1 -1
- package/directives/password/password.options.d.ts +2 -2
- package/directives/present/present.directive.d.ts +1 -1
- package/directives/shimmer/shimmer.directive.d.ts +1 -1
- package/directives/skeleton/skeleton.directive.d.ts +1 -1
- package/directives/tooltip/tooltip.directive.d.ts +2 -2
- package/directives/unfinished-validator/unfinished-validator.directive.d.ts +1 -1
- package/directives/unfinished-validator/unfinished.validator.d.ts +2 -2
- package/directives/unmask-handler/unmask-handler.directive.d.ts +2 -2
- package/esm2022/components/accordion/accordion-item.component.mjs +1 -1
- package/esm2022/components/accordion/accordion.directive.mjs +2 -2
- package/esm2022/components/action-bar/action-bar.component.mjs +2 -2
- package/esm2022/components/avatar/avatar-stack.component.mjs +1 -1
- package/esm2022/components/avatar/avatar.component.mjs +1 -1
- package/esm2022/components/avatar/avatar.options.mjs +1 -1
- package/esm2022/components/badge/badge.options.mjs +1 -1
- package/esm2022/components/badge-notification/badge-notification.component.mjs +1 -1
- package/esm2022/components/badge-notification/badge-notification.options.mjs +1 -1
- package/esm2022/components/badged-content/badged-content.directive.mjs +1 -1
- package/esm2022/components/block/block.directive.mjs +1 -1
- package/esm2022/components/block/block.options.mjs +1 -1
- package/esm2022/components/breadcrumbs/breadcrumbs.component.mjs +1 -1
- package/esm2022/components/breadcrumbs/breadcrumbs.options.mjs +1 -1
- package/esm2022/components/button-loading/button-loading.component.mjs +1 -1
- package/esm2022/components/calendar-month/calendar-month.component.mjs +1 -1
- package/esm2022/components/calendar-range/calculate-disabled-item-handler.mjs +1 -1
- package/esm2022/components/calendar-range/calendar-range.component.mjs +1 -1
- package/esm2022/components/calendar-range/day-caps-mapper.mjs +2 -2
- package/esm2022/components/calendar-range/day-range-period.mjs +1 -1
- package/esm2022/components/carousel/carousel.component.mjs +2 -2
- package/esm2022/components/checkbox/checkbox.component.mjs +1 -1
- package/esm2022/components/checkbox/checkbox.options.mjs +1 -1
- package/esm2022/components/chip/chip.directive.mjs +1 -1
- package/esm2022/components/chip/chip.options.mjs +1 -1
- package/esm2022/components/combo-box/combo-box.directive.mjs +3 -3
- package/esm2022/components/comment/comment.directive.mjs +1 -1
- package/esm2022/components/confirm/confirm.component.mjs +1 -1
- package/esm2022/components/confirm/confirm.service.mjs +1 -1
- package/esm2022/components/data-list-wrapper/data-list-wrapper.component.mjs +3 -3
- package/esm2022/components/drawer/drawer.component.mjs +1 -1
- package/esm2022/components/files/file/file.component.mjs +1 -1
- package/esm2022/components/files/file/file.options.mjs +1 -1
- package/esm2022/components/files/files/files.component.mjs +1 -1
- package/esm2022/components/files/files.types.mjs +1 -1
- package/esm2022/components/files/files.utils.mjs +1 -1
- package/esm2022/components/files/files.validators.mjs +1 -1
- package/esm2022/components/files/input-files/input-files-validator.directive.mjs +1 -1
- package/esm2022/components/files/input-files/input-files.component.mjs +1 -1
- package/esm2022/components/files/input-files/input-files.content.mjs +1 -1
- package/esm2022/components/files/input-files/input-files.directive.mjs +1 -1
- package/esm2022/components/files/input-files/input-files.options.mjs +1 -1
- package/esm2022/components/files/pipes/file-rejected.pipe.mjs +1 -1
- package/esm2022/components/filter/filter.component.mjs +2 -2
- package/esm2022/components/index.mjs +2 -1
- package/esm2022/components/input-chip/input-chip.component.mjs +2 -2
- package/esm2022/components/input-chip/input-chip.directive.mjs +2 -2
- package/esm2022/components/input-color/input-color.component.mjs +1 -1
- package/esm2022/components/input-color/input-color.options.mjs +1 -1
- package/esm2022/components/input-date/date-filler.mjs +1 -1
- package/esm2022/components/input-date/input-date.directive.mjs +3 -3
- package/esm2022/components/input-date/input-date.options.mjs +2 -2
- package/esm2022/components/input-date-range/input-date-range.directive.mjs +2 -2
- package/esm2022/components/input-date-range/input-date-range.options.mjs +2 -2
- package/esm2022/components/input-date-time/input-date-time.directive.mjs +1 -1
- package/esm2022/components/input-date-time/input-date-time.options.mjs +2 -2
- package/esm2022/components/input-month/input-month.directive.mjs +1 -1
- package/esm2022/components/input-month/input-month.options.mjs +2 -2
- package/esm2022/components/input-month-range/input-month-range.directive.mjs +2 -2
- package/esm2022/components/input-month-range/input-month-range.options.mjs +2 -2
- package/esm2022/components/input-number/index.mjs +2 -1
- package/esm2022/components/input-number/input-number.directive.mjs +3 -9
- package/esm2022/components/input-number/input-number.mjs +7 -2
- package/esm2022/components/input-number/input-number.options.mjs +1 -1
- package/esm2022/components/input-number/quantum.directive.mjs +56 -0
- package/esm2022/components/input-number/step/input-number-step.component.mjs +2 -2
- package/esm2022/components/input-password/input-password.options.mjs +1 -1
- package/esm2022/components/input-phone/index.mjs +3 -0
- package/esm2022/components/input-phone/input-phone.directive.mjs +137 -0
- package/esm2022/components/input-phone/input-phone.options.mjs +9 -0
- package/esm2022/components/input-phone/taiga-ui-kit-components-input-phone.mjs +5 -0
- package/esm2022/components/input-phone/utils/complete-phone-insertion-preprocessor.mjs +41 -0
- package/esm2022/components/input-phone/utils/create-phone-mask-expression.mjs +17 -0
- package/esm2022/components/input-phone-international/input-phone-international.component.mjs +2 -2
- package/esm2022/components/input-phone-international/input-phone-international.options.mjs +1 -1
- package/esm2022/components/input-pin/input-pin.component.mjs +1 -1
- package/esm2022/components/input-slider/input-slider.directive.mjs +8 -12
- package/esm2022/components/input-time/input-time.component.mjs +1 -1
- package/esm2022/components/input-time/input-time.directive.mjs +1 -1
- package/esm2022/components/input-time/input-time.options.mjs +1 -1
- package/esm2022/components/input-year/input-year.options.mjs +2 -2
- package/esm2022/components/items-with-more/items-with-more.component.mjs +1 -1
- package/esm2022/components/items-with-more/items-with-more.directive.mjs +1 -1
- package/esm2022/components/items-with-more/more.directive.mjs +1 -1
- package/esm2022/components/like/like.component.mjs +1 -1
- package/esm2022/components/like/like.options.mjs +1 -1
- package/esm2022/components/line-clamp/line-clamp-position.directive.mjs +2 -2
- package/esm2022/components/line-clamp/line-clamp.component.mjs +1 -1
- package/esm2022/components/line-clamp/line-clamp.options.mjs +1 -1
- package/esm2022/components/multi-select/multi-select-group/multi-select-group.component.mjs +2 -2
- package/esm2022/components/multi-select/multi-select-native/multi-select-native.component.mjs +2 -2
- package/esm2022/components/multi-select/multi-select-option/multi-select-option.component.mjs +2 -2
- package/esm2022/components/pager/pager.component.mjs +1 -1
- package/esm2022/components/pagination/pagination.component.mjs +1 -1
- package/esm2022/components/pdf-viewer/pdf-viewer.component.mjs +1 -1
- package/esm2022/components/pdf-viewer/pdf-viewer.directive.mjs +1 -1
- package/esm2022/components/pdf-viewer/pdf-viewer.options.mjs +1 -1
- package/esm2022/components/pdf-viewer/pdf-viewer.service.mjs +1 -1
- package/esm2022/components/preview/dialog/preview-dialog.component.mjs +1 -1
- package/esm2022/components/preview/preview.component.mjs +1 -1
- package/esm2022/components/progress/progress-bar/progress-bar.component.mjs +1 -1
- package/esm2022/components/progress/progress-circle/progress-circle.component.mjs +1 -1
- package/esm2022/components/progress/progress.options.mjs +1 -1
- package/esm2022/components/push/push-alert.component.mjs +1 -1
- package/esm2022/components/push/push.options.mjs +1 -1
- package/esm2022/components/push/push.service.mjs +1 -1
- package/esm2022/components/radio/radio.component.mjs +1 -1
- package/esm2022/components/radio/radio.directive.mjs +1 -1
- package/esm2022/components/radio/radio.options.mjs +1 -1
- package/esm2022/components/radio-list/radio-list.component.mjs +2 -2
- package/esm2022/components/range/range.component.mjs +3 -3
- package/esm2022/components/rating/rating.component.mjs +1 -1
- package/esm2022/components/rating/rating.options.mjs +1 -1
- package/esm2022/components/routable-dialog/generate-dialogable-route.mjs +1 -1
- package/esm2022/components/routable-dialog/routable-dialog.component.mjs +2 -2
- package/esm2022/components/segmented/segmented.component.mjs +1 -1
- package/esm2022/components/segmented/segmented.directive.mjs +2 -2
- package/esm2022/components/select/native-select/native-select.component.mjs +2 -2
- package/esm2022/components/select/select-option/select-option.component.mjs +2 -2
- package/esm2022/components/select/select.directive.mjs +2 -2
- package/esm2022/components/slider/helpers/key-steps.mjs +1 -1
- package/esm2022/components/slider/helpers/slider-key-steps.directive.mjs +1 -1
- package/esm2022/components/slider/helpers/slider-readonly.directive.mjs +1 -1
- package/esm2022/components/slider/helpers/slider-thumb-label.component.mjs +2 -2
- package/esm2022/components/slider/slider.component.mjs +3 -3
- package/esm2022/components/slider/slider.options.mjs +1 -1
- package/esm2022/components/stepper/stepper.component.mjs +1 -1
- package/esm2022/components/switch/switch.component.mjs +1 -1
- package/esm2022/components/switch/switch.options.mjs +1 -1
- package/esm2022/components/tabs/tab.directive.mjs +1 -1
- package/esm2022/components/tabs/tabs-horizontal.directive.mjs +2 -2
- package/esm2022/components/tabs/tabs-vertical.directive.mjs +1 -1
- package/esm2022/components/tabs/tabs-with-more.component.mjs +1 -1
- package/esm2022/components/tabs/tabs.directive.mjs +1 -1
- package/esm2022/components/tabs/tabs.options.mjs +1 -1
- package/esm2022/components/tabs/tabs.providers.mjs +2 -2
- package/esm2022/components/textarea/textarea-limit.directive.mjs +2 -2
- package/esm2022/components/textarea/textarea.component.mjs +3 -3
- package/esm2022/components/textarea/textarea.options.mjs +1 -1
- package/esm2022/components/tiles/tile.component.mjs +1 -1
- package/esm2022/components/tiles/tile.service.mjs +1 -1
- package/esm2022/components/tree/components/tree/tree.component.mjs +1 -1
- package/esm2022/components/tree/components/tree-item/tree-item.component.mjs +1 -1
- package/esm2022/components/tree/components/tree-item-content/tree-item-content.component.mjs +2 -2
- package/esm2022/components/tree/directives/tree-children.directive.mjs +1 -1
- package/esm2022/components/tree/directives/tree-controller.directive.mjs +1 -1
- package/esm2022/components/tree/directives/tree-item-controller.directive.mjs +1 -1
- package/esm2022/components/tree/directives/tree-node.directive.mjs +1 -1
- package/esm2022/components/tree/misc/tree.constants.mjs +1 -1
- package/esm2022/components/tree/misc/tree.interfaces.mjs +1 -1
- package/esm2022/components/tree/misc/tree.service.mjs +1 -1
- package/esm2022/components/tree/misc/tree.tokens.mjs +1 -1
- package/esm2022/directives/button-select/button-select.directive.mjs +2 -2
- package/esm2022/directives/copy/copy.component.mjs +1 -1
- package/esm2022/directives/copy/copy.options.mjs +1 -1
- package/esm2022/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.mjs +2 -2
- package/esm2022/directives/fade/fade.directive.mjs +1 -1
- package/esm2022/directives/fluid-typography/fluid-typography.directive.mjs +1 -1
- package/esm2022/directives/fluid-typography/fluid-typography.options.mjs +1 -1
- package/esm2022/directives/highlight/highlight.directive.mjs +1 -1
- package/esm2022/directives/lazy-loading/lazy-loading.directive.mjs +1 -1
- package/esm2022/directives/lazy-loading/lazy-loading.service.mjs +1 -1
- package/esm2022/directives/password/password.options.mjs +1 -1
- package/esm2022/directives/present/present.directive.mjs +1 -1
- package/esm2022/directives/shimmer/shimmer.directive.mjs +1 -1
- package/esm2022/directives/skeleton/skeleton.directive.mjs +1 -1
- package/esm2022/directives/tooltip/tooltip.directive.mjs +1 -1
- package/esm2022/directives/unfinished-validator/unfinished-validator.directive.mjs +1 -1
- package/esm2022/directives/unfinished-validator/unfinished.validator.mjs +1 -1
- package/esm2022/directives/unmask-handler/unmask-handler.directive.mjs +2 -2
- package/esm2022/pipes/emails/emails.pipe.mjs +1 -1
- package/esm2022/pipes/field-error/field-error-content-pipe.mjs +2 -2
- package/esm2022/pipes/field-error/field-error-pipe.mjs +2 -2
- package/esm2022/pipes/filter-by-input/filter-by-input.pipe.mjs +2 -2
- package/esm2022/pipes/hide-selected/hide-selected.pipe.mjs +1 -1
- package/esm2022/pipes/sort-countries/sort-countries.pipe.mjs +1 -1
- package/esm2022/pipes/stringify/stringify.pipe.mjs +1 -1
- package/esm2022/pipes/stringify-content/stringify-content.pipe.mjs +1 -1
- package/esm2022/tokens/calendar-date-stream.mjs +1 -1
- package/esm2022/tokens/date-inputs-value-transformers.mjs +2 -2
- package/esm2022/tokens/i18n.mjs +1 -1
- package/esm2022/tokens/input-date-options.mjs +1 -1
- package/esm2022/tokens/items-handlers.mjs +1 -1
- package/esm2022/tokens/mobile-calendar.mjs +1 -1
- package/esm2022/tokens/month-formatter.mjs +1 -1
- package/esm2022/tokens/preview-icons.mjs +1 -1
- package/esm2022/tokens/validation-errors.mjs +1 -1
- package/esm2022/utils/inject-value.mjs +1 -1
- package/esm2022/utils/maskito.binding.mjs +1 -1
- package/esm2022/utils/phone.mjs +1 -1
- package/esm2022/utils/toggle-day.mjs +1 -1
- package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-action-bar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badged-content.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-button-loading.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-calendar-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-carousel.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-checkbox.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-comment.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +59 -13
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-password.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs +206 -0
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs +7 -11
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-items-with-more.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-like.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-radio.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-range.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-rating.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-segmented.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-slider.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components.mjs +1 -0
- package/fesm2022/taiga-ui-kit-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-button-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-copy.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-highlight.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-password.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-present.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-shimmer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-skeleton.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-emails.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-field-error.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-stringify.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
- package/package.json +14 -8
- package/pipes/emails/emails.pipe.d.ts +1 -1
- package/pipes/field-error/field-error-content-pipe.d.ts +2 -2
- package/pipes/field-error/field-error-pipe.d.ts +2 -2
- package/pipes/filter-by-input/filter-by-input.pipe.d.ts +2 -2
- package/pipes/hide-selected/hide-selected.pipe.d.ts +1 -1
- package/pipes/sort-countries/sort-countries.pipe.d.ts +3 -3
- package/pipes/stringify/stringify.pipe.d.ts +2 -2
- package/pipes/stringify-content/stringify-content.pipe.d.ts +3 -3
- package/tokens/calendar-date-stream.d.ts +4 -5
- package/tokens/date-inputs-value-transformers.d.ts +2 -2
- package/tokens/i18n.d.ts +3 -3
- package/tokens/input-date-options.d.ts +4 -4
- package/tokens/items-handlers.d.ts +2 -3
- package/tokens/mobile-calendar.d.ts +1 -2
- package/tokens/month-formatter.d.ts +3 -3
- package/tokens/preview-icons.d.ts +1 -2
- package/tokens/validation-errors.d.ts +3 -4
- package/utils/inject-value.d.ts +1 -1
- package/utils/maskito.binding.d.ts +2 -2
- package/utils/phone.d.ts +2 -2
- package/utils/toggle-day.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-number.mjs","sources":["../../../projects/kit/components/input-number/input-number.options.ts","../../../projects/kit/components/input-number/input-number.directive.ts","../../../projects/kit/components/input-number/step/input-number-step.component.ts","../../../projects/kit/components/input-number/step/input-number-step.template.html","../../../projects/kit/components/input-number/input-number.ts","../../../projects/kit/components/input-number/taiga-ui-kit-components-input-number.ts"],"sourcesContent":["import type {TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\n\nexport interface TuiInputNumberOptions {\n readonly max: number;\n readonly min: number;\n readonly prefix: string;\n readonly postfix: string;\n readonly step: number;\n readonly icons: Readonly<{\n decrease: string;\n increase: string;\n }>;\n readonly valueTransformer: TuiValueTransformer<number | null, any> | null;\n}\n\nexport const TUI_INPUT_NUMBER_DEFAULT_OPTIONS: TuiInputNumberOptions = {\n min: Number.MIN_SAFE_INTEGER,\n max: Number.MAX_SAFE_INTEGER,\n prefix: '',\n postfix: '',\n step: 0,\n icons: {\n increase: '@tui.plus',\n decrease: '@tui.minus',\n },\n valueTransformer: null,\n};\n\nexport const [TUI_INPUT_NUMBER_OPTIONS, tuiInputNumberOptionsProvider] = tuiCreateOptions(\n TUI_INPUT_NUMBER_DEFAULT_OPTIONS,\n);\n","import {computed, Directive, effect, inject, Input, signal} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {MaskitoDirective} from '@maskito/angular';\nimport type {MaskitoOptions} from '@maskito/core';\nimport {maskitoInitialCalibrationPlugin} from '@maskito/core';\nimport type {MaskitoNumberParams} from '@maskito/kit';\nimport {\n maskitoCaretGuard,\n maskitoNumberOptionsGenerator,\n maskitoParseNumber,\n} from '@maskito/kit';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {CHAR_HYPHEN, CHAR_MINUS, TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsSafeToRound} from '@taiga-ui/cdk/utils/math';\nimport {\n TuiTextfieldDirective,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {TUI_DEFAULT_NUMBER_FORMAT, TUI_NUMBER_FORMAT} from '@taiga-ui/core/tokens';\nimport {tuiFormatNumber} from '@taiga-ui/core/utils/format';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {TUI_INPUT_NUMBER_OPTIONS} from './input-number.options';\n\nconst DEFAULT_MAX_LENGTH = 18;\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputNumber]',\n providers: [\n tuiAsControl(TuiInputNumberDirective),\n tuiValueTransformerFrom(TUI_INPUT_NUMBER_OPTIONS),\n ],\n hostDirectives: [TuiWithTextfield, MaskitoDirective],\n host: {\n '[disabled]': 'disabled()',\n '[attr.inputMode]': 'inputMode()',\n '[attr.maxLength]':\n 'element.maxLength > 0 ? element.maxLength : defaultMaxLength()',\n '(blur)': 'onBlur()',\n '(focus)': 'onFocus()',\n },\n})\nexport class TuiInputNumberDirective extends TuiControl<number | null> {\n private readonly textfield = inject(TuiTextfieldDirective);\n private readonly isIOS = inject(TUI_IS_IOS);\n private readonly numberFormat = toSignal(inject(TUI_NUMBER_FORMAT), {\n initialValue: TUI_DEFAULT_NUMBER_FORMAT,\n });\n\n private readonly formatted = computed(() =>\n maskitoParseNumber(this.textfield.value(), this.numberFormat()),\n );\n\n private readonly precision = computed(() =>\n Number.isNaN(this.numberFormat().precision) ? 2 : this.numberFormat().precision,\n );\n\n private readonly unfinished = computed((value = this.formatted()) =>\n value < 0 ? value > this.max() : value < this.min(),\n );\n\n protected readonly onChangeEffect = effect(() => {\n const value = this.formatted();\n\n if (Number.isNaN(value)) {\n this.onChange(null);\n\n return;\n }\n\n if (\n this.unfinished() ||\n value < this.min() ||\n value > this.max() ||\n this.value() === value\n ) {\n return;\n }\n\n this.onChange(value);\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly options = inject(TUI_INPUT_NUMBER_OPTIONS);\n protected readonly element = tuiInjectElement<HTMLInputElement>();\n\n protected readonly inputMode = computed(() => {\n if (this.isIOS) {\n return this.min() < 0\n ? 'text' // iPhone does not have minus sign if inputMode equals to 'numeric' / 'decimal'\n : 'decimal';\n }\n\n /**\n * Samsung Keyboard does not minus sign for `inputmode=decimal`\n * @see https://github.com/taiga-family/taiga-ui/issues/11061#issuecomment-2939103792\n */\n return 'numeric';\n });\n\n protected readonly defaultMaxLength = computed(() => {\n const {decimalSeparator, thousandSeparator} = this.numberFormat();\n const decimalPart =\n !!this.precision() && this.textfield.value().includes(decimalSeparator);\n const precision = decimalPart ? Math.min(this.precision() + 1, 20) : 0;\n const takeThousand = thousandSeparator.repeat(5).length;\n\n return DEFAULT_MAX_LENGTH + precision + takeThousand;\n });\n\n protected readonly mask = tuiMaskito(\n computed(\n (\n {decimalMode, ...numberFormat} = this.numberFormat(),\n maximumFractionDigits = this.precision(),\n ) =>\n this.computeMask({\n ...numberFormat,\n maximumFractionDigits,\n min: this.min(),\n max: this.max(),\n prefix: this.prefix(),\n postfix: this.postfix(),\n minimumFractionDigits:\n decimalMode === 'always' ? maximumFractionDigits : 0,\n }),\n ),\n );\n\n public readonly min = signal(this.options.min);\n public readonly max = signal(this.options.max);\n public readonly prefix = signal(this.options.prefix);\n public readonly postfix = signal(this.options.postfix);\n\n @Input('min')\n public set minSetter(x: number | null) {\n this.updateMinMaxLimits(x, this.max());\n }\n\n @Input('max')\n public set maxSetter(x: number | null) {\n this.updateMinMaxLimits(this.min(), x);\n }\n\n // TODO(v5): replace with signal input\n @Input('prefix')\n public set prefixSetter(x: string) {\n this.prefix.set(x);\n }\n\n // TODO(v5): replace with signal input\n @Input('postfix')\n public set postfixSetter(x: string) {\n this.postfix.set(x);\n }\n\n public override writeValue(value: number | null): void {\n super.writeValue(value);\n this.setValue(this.value());\n }\n\n public setValue(value: number | null): void {\n this.textfield.value.set(this.formatNumber(value));\n }\n\n protected onBlur(): void {\n this.onTouched();\n\n if (!this.unfinished()) {\n this.setValue(this.value());\n }\n }\n\n protected onFocus(): void {\n if (Number.isNaN(this.formatted()) && !this.readOnly()) {\n this.textfield.value.set(this.prefix() + this.postfix());\n }\n }\n\n private formatNumber(value: number | null): string {\n if (value === null || Number.isNaN(value)) {\n return '';\n }\n\n return (\n (this.prefix() !== CHAR_MINUS ? this.prefix() : '') +\n tuiFormatNumber(value, {\n ...this.numberFormat(),\n /**\n * Number can satisfy interval [Number.MIN_SAFE_INTEGER; Number.MAX_SAFE_INTEGER]\n * but its rounding can violate it.\n * Before BigInt support there is no perfect solution – only trade off.\n * No rounding is better than lose precision and incorrect mutation of already valid value.\n */\n precision: tuiIsSafeToRound(value, this.precision())\n ? this.precision()\n : Infinity,\n }).replace(CHAR_HYPHEN, CHAR_MINUS) +\n this.postfix()\n );\n }\n\n private updateMinMaxLimits(\n nullableMin: number | null,\n nullableMax: number | null,\n ): void {\n const min = this.transformer.fromControlValue(nullableMin) ?? this.options.min;\n const max = this.transformer.fromControlValue(nullableMax) ?? this.options.max;\n\n this.min.set(Math.min(min, max));\n this.max.set(Math.max(min, max));\n }\n\n private computeMask(params: MaskitoNumberParams): MaskitoOptions {\n const {prefix = '', postfix = ''} = params;\n const {plugins, ...options} = maskitoNumberOptionsGenerator(params);\n const initialCalibrationPlugin = maskitoInitialCalibrationPlugin(\n maskitoNumberOptionsGenerator({\n ...params,\n min: Number.MIN_SAFE_INTEGER,\n max: Number.MAX_SAFE_INTEGER,\n }),\n );\n\n return {\n ...options,\n plugins: [\n ...plugins,\n initialCalibrationPlugin,\n maskitoCaretGuard((value) => [\n prefix.length,\n value.length - postfix.length,\n ]),\n ],\n };\n }\n}\n","import {DOCUMENT, NgIf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {\n TUI_TEXTFIELD_OPTIONS,\n TuiTextfieldContent,\n} from '@taiga-ui/core/components/textfield';\nimport {expand, fromEvent, map, merge, Subject, switchMap, takeUntil, timer} from 'rxjs';\n\nimport {TuiInputNumberDirective} from '../input-number.directive';\nimport type {TuiInputNumberOptions} from '../input-number.options';\nimport {TUI_INPUT_NUMBER_OPTIONS} from '../input-number.options';\n\nconst INITIAL_DELAY = 300;\nconst DELAY_DECREMENT = 15;\nconst MIN_DELAY = 100;\n\n@Component({\n standalone: true,\n selector: 'input[tuiInputNumber][step]',\n imports: [NgIf, TuiButton, TuiTextfieldContent],\n templateUrl: './input-number-step.template.html',\n styleUrls: ['./input-number-step.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n ngSkipHydration: 'true',\n '(keydown.arrowDown.prevent)': 'onStep(-step())',\n '(keydown.arrowUp.prevent)': 'onStep(step())',\n '[class._with-buttons]': 'step()',\n },\n})\nexport class TuiInputNumberStep {\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly appearance = inject(TUI_TEXTFIELD_OPTIONS).appearance;\n protected readonly options = inject<TuiInputNumberOptions>(TUI_INPUT_NUMBER_OPTIONS);\n protected readonly input = inject(TuiInputNumberDirective, {self: true});\n protected readonly step = signal(this.options.step);\n protected readonly value = computed(() => this.input.value() ?? NaN);\n protected readonly step$ = new Subject<number>();\n protected readonly doc = inject(DOCUMENT);\n\n protected readonly stop$ = merge(\n fromEvent(this.doc, 'pointerup'),\n fromEvent(this.doc, 'pointerleave'),\n fromEvent(this.doc, 'pointercancel'),\n );\n\n protected readonly stepping = this.step$\n .pipe(\n switchMap((value) =>\n timer(INITIAL_DELAY).pipe(\n expand((_, index) => timer(getDelay(index))),\n map(() => value),\n takeUntil(this.stop$),\n ),\n ),\n takeUntilDestroyed(),\n )\n .subscribe((value) => this.onStep(value));\n\n // TODO(v5): replace with signal input\n @Input('step')\n public set stepSetter(x: number) {\n this.step.set(x);\n }\n\n protected onStep(step: number): void {\n const current = this.input.value() ?? 0;\n\n this.input.setValue(tuiClamp(current + step, this.input.min(), this.input.max()));\n this.el.setSelectionRange(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);\n }\n}\n\nfunction getDelay(index: number): number {\n return Math.max(INITIAL_DELAY - index * DELAY_DECREMENT, MIN_DELAY);\n}\n","<ng-container *tuiTextfieldContent>\n <section\n *ngIf=\"step()\"\n class=\"t-input-number-buttons\"\n >\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() >= input.max()\"\n [iconStart]=\"options.icons.increase\"\n (click.prevent)=\"onStep(step())\"\n (pointerdown.prevent)=\"step$.next(step())\"\n >\n +\n </button>\n\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() <= input.min()\"\n [iconStart]=\"options.icons.decrease\"\n (click.prevent)=\"onStep(-step())\"\n (pointerdown.prevent)=\"step$.next(-step())\"\n >\n -\n </button>\n </section>\n</ng-container>\n","import {TuiInputNumberDirective} from './input-number.directive';\nimport {TuiInputNumberStep} from './step/input-number-step.component';\n\nexport const TuiInputNumber = [TuiInputNumberDirective, TuiInputNumberStep] as const;\n","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AAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,SAAS,oIAAE,mBAAmB,EAAA,QAAA,EAAA,kCAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;4FAYrC,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAf9B,SAAS;AACM,YAAA,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,YACN,6BAA6B,EAAA,OAAA,EAC9B,CAAC,IAAI,EAAE,SAAS,EAAE,mBAAmB,CAAC,EAAA,aAAA,EAGhC,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,eAAe,EAAE,MAAM;AACvB,wBAAA,6BAA6B,EAAE,iBAAiB;AAChD,wBAAA,2BAA2B,EAAE,gBAAgB;AAC7C,wBAAA,uBAAuB,EAAE,QAAQ;AACpC,qBAAA,EAAA,QAAA,EAAA,mmCAAA,EAAA,MAAA,EAAA,CAAA,09DAAA,CAAA,EAAA,CAAA;8BAiCU,UAAU,EAAA,CAAA;sBADpB,KAAK;uBAAC,MAAM,CAAA;;AAajB,SAAS,QAAQ,CAAC,KAAa,EAAA;AAC3B,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,GAAG,KAAK,GAAG,eAAe,EAAE,SAAS,CAAC,CAAC;AACxE;;MErFa,cAAc,GAAG,CAAC,uBAAuB,EAAE,kBAAkB;;ACH1E;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-number.mjs","sources":["../../../projects/kit/components/input-number/input-number.options.ts","../../../projects/kit/components/input-number/input-number.directive.ts","../../../projects/kit/components/input-number/quantum.directive.ts","../../../projects/kit/components/input-number/step/input-number-step.component.ts","../../../projects/kit/components/input-number/step/input-number-step.template.html","../../../projects/kit/components/input-number/input-number.ts","../../../projects/kit/components/input-number/taiga-ui-kit-components-input-number.ts"],"sourcesContent":["import {type TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\n\nexport interface TuiInputNumberOptions {\n readonly max: number;\n readonly min: number;\n readonly prefix: string;\n readonly postfix: string;\n readonly step: number;\n readonly icons: Readonly<{\n decrease: string;\n increase: string;\n }>;\n readonly valueTransformer: TuiValueTransformer<number | null, any> | null;\n}\n\nexport const TUI_INPUT_NUMBER_DEFAULT_OPTIONS: TuiInputNumberOptions = {\n min: Number.MIN_SAFE_INTEGER,\n max: Number.MAX_SAFE_INTEGER,\n prefix: '',\n postfix: '',\n step: 0,\n icons: {\n increase: '@tui.plus',\n decrease: '@tui.minus',\n },\n valueTransformer: null,\n};\n\nexport const [TUI_INPUT_NUMBER_OPTIONS, tuiInputNumberOptionsProvider] = tuiCreateOptions(\n TUI_INPUT_NUMBER_DEFAULT_OPTIONS,\n);\n","import {computed, Directive, effect, inject, Input, signal} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {maskitoInitialCalibrationPlugin, type MaskitoOptions} from '@maskito/core';\nimport {\n maskitoCaretGuard,\n maskitoNumberOptionsGenerator,\n type MaskitoNumberParams,\n maskitoParseNumber,\n} from '@maskito/kit';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {CHAR_HYPHEN, CHAR_MINUS, TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsSafeToRound} from '@taiga-ui/cdk/utils/math';\nimport {\n TuiTextfieldDirective,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {TUI_DEFAULT_NUMBER_FORMAT, TUI_NUMBER_FORMAT} from '@taiga-ui/core/tokens';\nimport {tuiFormatNumber} from '@taiga-ui/core/utils/format';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {TUI_INPUT_NUMBER_OPTIONS} from './input-number.options';\n\nconst DEFAULT_MAX_LENGTH = 18;\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputNumber]',\n providers: [\n tuiAsControl(TuiInputNumberDirective),\n tuiValueTransformerFrom(TUI_INPUT_NUMBER_OPTIONS),\n ],\n hostDirectives: [TuiWithTextfield, MaskitoDirective],\n host: {\n '[disabled]': 'disabled()',\n '[attr.inputMode]': 'inputMode()',\n '[attr.maxLength]':\n 'element.maxLength > 0 ? element.maxLength : defaultMaxLength()',\n '(blur)': 'setValue(transformer.fromControlValue(control.value))',\n '(focus)': 'onFocus()',\n },\n})\nexport class TuiInputNumberDirective extends TuiControl<number | null> {\n private readonly textfield = inject(TuiTextfieldDirective);\n private readonly isIOS = inject(TUI_IS_IOS);\n private readonly numberFormat = toSignal(inject(TUI_NUMBER_FORMAT), {\n initialValue: TUI_DEFAULT_NUMBER_FORMAT,\n });\n\n private readonly formatted = computed(() =>\n maskitoParseNumber(this.textfield.value(), this.numberFormat()),\n );\n\n private readonly precision = computed(() =>\n Number.isNaN(this.numberFormat().precision) ? 2 : this.numberFormat().precision,\n );\n\n private readonly unfinished = computed((value = this.formatted()) =>\n value < 0 ? value > this.max() : value < this.min(),\n );\n\n protected readonly onChangeEffect = effect(() => {\n const value = this.formatted();\n\n if (Number.isNaN(value)) {\n this.onChange(null);\n\n return;\n }\n\n if (\n this.unfinished() ||\n value < this.min() ||\n value > this.max() ||\n this.value() === value\n ) {\n return;\n }\n\n this.onChange(value);\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly options = inject(TUI_INPUT_NUMBER_OPTIONS);\n protected readonly element = tuiInjectElement<HTMLInputElement>();\n\n protected readonly inputMode = computed(() => {\n if (this.isIOS) {\n return this.min() < 0\n ? 'text' // iPhone does not have minus sign if inputMode equals to 'numeric' / 'decimal'\n : 'decimal';\n }\n\n /**\n * Samsung Keyboard does not minus sign for `inputmode=decimal`\n * @see https://github.com/taiga-family/taiga-ui/issues/11061#issuecomment-2939103792\n */\n return 'numeric';\n });\n\n protected readonly defaultMaxLength = computed(() => {\n const {decimalSeparator, thousandSeparator} = this.numberFormat();\n const decimalPart =\n !!this.precision() && this.textfield.value().includes(decimalSeparator);\n const precision = decimalPart ? Math.min(this.precision() + 1, 20) : 0;\n const takeThousand = thousandSeparator.repeat(5).length;\n\n return DEFAULT_MAX_LENGTH + precision + takeThousand;\n });\n\n protected readonly mask = tuiMaskito(\n computed(\n (\n {decimalMode, ...numberFormat} = this.numberFormat(),\n maximumFractionDigits = this.precision(),\n ) =>\n this.computeMask({\n ...numberFormat,\n maximumFractionDigits,\n min: this.min(),\n max: this.max(),\n prefix: this.prefix(),\n postfix: this.postfix(),\n minimumFractionDigits:\n decimalMode === 'always' ? maximumFractionDigits : 0,\n }),\n ),\n );\n\n public readonly min = signal(this.options.min);\n public readonly max = signal(this.options.max);\n public readonly prefix = signal(this.options.prefix);\n public readonly postfix = signal(this.options.postfix);\n\n @Input('min')\n public set minSetter(x: number | null) {\n this.updateMinMaxLimits(x, this.max());\n }\n\n @Input('max')\n public set maxSetter(x: number | null) {\n this.updateMinMaxLimits(this.min(), x);\n }\n\n // TODO(v5): replace with signal input\n @Input('prefix')\n public set prefixSetter(x: string) {\n this.prefix.set(x);\n }\n\n // TODO(v5): replace with signal input\n @Input('postfix')\n public set postfixSetter(x: string) {\n this.postfix.set(x);\n }\n\n public override writeValue(value: number | null): void {\n super.writeValue(value);\n this.setValue(this.value());\n }\n\n public setValue(value: number | null): void {\n this.textfield.value.set(this.formatNumber(value));\n }\n\n protected onFocus(): void {\n if (Number.isNaN(this.formatted()) && !this.readOnly()) {\n this.textfield.value.set(this.prefix() + this.postfix());\n }\n }\n\n private formatNumber(value: number | null): string {\n if (value === null || Number.isNaN(value)) {\n return '';\n }\n\n return (\n (this.prefix() !== CHAR_MINUS ? this.prefix() : '') +\n tuiFormatNumber(value, {\n ...this.numberFormat(),\n /**\n * Number can satisfy interval [Number.MIN_SAFE_INTEGER; Number.MAX_SAFE_INTEGER]\n * but its rounding can violate it.\n * Before BigInt support there is no perfect solution – only trade off.\n * No rounding is better than lose precision and incorrect mutation of already valid value.\n */\n precision: tuiIsSafeToRound(value, this.precision())\n ? this.precision()\n : Infinity,\n }).replace(CHAR_HYPHEN, CHAR_MINUS) +\n this.postfix()\n );\n }\n\n private updateMinMaxLimits(\n nullableMin: number | null,\n nullableMax: number | null,\n ): void {\n const min = this.transformer.fromControlValue(nullableMin) ?? this.options.min;\n const max = this.transformer.fromControlValue(nullableMax) ?? this.options.max;\n\n this.min.set(Math.min(min, max));\n this.max.set(Math.max(min, max));\n }\n\n private computeMask(params: MaskitoNumberParams): MaskitoOptions {\n const {prefix = '', postfix = ''} = params;\n const {plugins, ...options} = maskitoNumberOptionsGenerator(params);\n const initialCalibrationPlugin = maskitoInitialCalibrationPlugin(\n maskitoNumberOptionsGenerator({\n ...params,\n min: Number.MIN_SAFE_INTEGER,\n max: Number.MAX_SAFE_INTEGER,\n }),\n );\n\n return {\n ...options,\n plugins: [\n ...plugins,\n initialCalibrationPlugin,\n maskitoCaretGuard((value) => [\n prefix.length,\n value.length - postfix.length,\n ]),\n ],\n };\n }\n}\n","import {Directive, inject, Input} from '@angular/core';\nimport {TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {tuiIsSafeToRound, tuiRound} from '@taiga-ui/cdk/utils/math';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {tuiGetFractionPartPadded} from '@taiga-ui/core/utils/format';\nimport {TUI_FLOATING_PRECISION} from '@taiga-ui/kit/components/slider';\n\nimport {TUI_INPUT_NUMBER_OPTIONS} from './input-number.options';\n\n@Directive({\n standalone: true,\n selector: '[tuiInputNumber][quantum], [tuiInputSlider][quantum]',\n providers: [tuiProvide(TuiValueTransformer, TuiQuantumValueTransformer)],\n})\nexport class TuiQuantumValueTransformer extends TuiValueTransformer<\n number | null,\n number | null\n> {\n private readonly parent = inject(TUI_INPUT_NUMBER_OPTIONS).valueTransformer;\n\n @Input()\n public quantum = 1;\n\n public override fromControlValue(controlValue: number | null): number | null {\n return this.parent?.fromControlValue(controlValue) ?? controlValue;\n }\n\n public toControlValue(internalValue: number | null): number | null {\n const value = this.parent?.toControlValue(internalValue) ?? internalValue;\n\n return value != null &&\n tuiIsSafeToRound(value, tuiGetFractionPartPadded(this.quantum).length)\n ? tuiRound(\n Math.round(value / this.quantum) * this.quantum,\n TUI_FLOATING_PRECISION,\n )\n : value;\n }\n}\n\n@Directive({\n standalone: true,\n hostDirectives: [\n {\n directive: TuiQuantumValueTransformer,\n inputs: ['quantum'],\n },\n ],\n})\nexport class TuiWithQuantumValueTransformer {}\n","import {DOCUMENT, NgIf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {\n TUI_TEXTFIELD_OPTIONS,\n TuiTextfieldContent,\n} from '@taiga-ui/core/components/textfield';\nimport {expand, fromEvent, map, merge, Subject, switchMap, takeUntil, timer} from 'rxjs';\n\nimport {TuiInputNumberDirective} from '../input-number.directive';\nimport {\n TUI_INPUT_NUMBER_OPTIONS,\n type TuiInputNumberOptions,\n} from '../input-number.options';\n\nconst INITIAL_DELAY = 300;\nconst DELAY_DECREMENT = 15;\nconst MIN_DELAY = 100;\n\n@Component({\n standalone: true,\n selector: 'input[tuiInputNumber][step]',\n imports: [NgIf, TuiButton, TuiTextfieldContent],\n templateUrl: './input-number-step.template.html',\n styleUrls: ['./input-number-step.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n ngSkipHydration: 'true',\n '(keydown.arrowDown.prevent)': 'onStep(-step())',\n '(keydown.arrowUp.prevent)': 'onStep(step())',\n '[class._with-buttons]': 'step()',\n },\n})\nexport class TuiInputNumberStep {\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly appearance = inject(TUI_TEXTFIELD_OPTIONS).appearance;\n protected readonly options = inject<TuiInputNumberOptions>(TUI_INPUT_NUMBER_OPTIONS);\n protected readonly input = inject(TuiInputNumberDirective, {self: true});\n protected readonly step = signal(this.options.step);\n protected readonly value = computed(() => this.input.value() ?? NaN);\n protected readonly step$ = new Subject<number>();\n protected readonly doc = inject(DOCUMENT);\n\n protected readonly stop$ = merge(\n fromEvent(this.doc, 'pointerup'),\n fromEvent(this.doc, 'pointerleave'),\n fromEvent(this.doc, 'pointercancel'),\n );\n\n protected readonly stepping = this.step$\n .pipe(\n switchMap((value) =>\n timer(INITIAL_DELAY).pipe(\n expand((_, index) => timer(getDelay(index))),\n map(() => value),\n takeUntil(this.stop$),\n ),\n ),\n takeUntilDestroyed(),\n )\n .subscribe((value) => this.onStep(value));\n\n // TODO(v5): replace with signal input\n @Input('step')\n public set stepSetter(x: number) {\n this.step.set(x);\n }\n\n protected onStep(step: number): void {\n const current = this.input.value() ?? 0;\n\n this.input.setValue(tuiClamp(current + step, this.input.min(), this.input.max()));\n this.el.setSelectionRange(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);\n }\n}\n\nfunction getDelay(index: number): number {\n return Math.max(INITIAL_DELAY - index * DELAY_DECREMENT, MIN_DELAY);\n}\n","<ng-container *tuiTextfieldContent>\n <section\n *ngIf=\"step()\"\n class=\"t-input-number-buttons\"\n >\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() >= input.max()\"\n [iconStart]=\"options.icons.increase\"\n (click.prevent)=\"onStep(step())\"\n (pointerdown.prevent)=\"step$.next(step())\"\n >\n +\n </button>\n\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() <= input.min()\"\n [iconStart]=\"options.icons.decrease\"\n (click.prevent)=\"onStep(-step())\"\n (pointerdown.prevent)=\"step$.next(-step())\"\n >\n -\n </button>\n </section>\n</ng-container>\n","import {TuiInputNumberDirective} from './input-number.directive';\nimport {TuiQuantumValueTransformer} from './quantum.directive';\nimport {TuiInputNumberStep} from './step/input-number-step.component';\n\nexport const TuiInputNumber = [\n TuiInputNumberDirective,\n TuiInputNumberStep,\n TuiQuantumValueTransformer,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgBa,MAAA,gCAAgC,GAA0B;IACnE,GAAG,EAAE,MAAM,CAAC,gBAAgB;IAC5B,GAAG,EAAE,MAAM,CAAC,gBAAgB;AAC5B,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,EAAE;AACH,QAAA,QAAQ,EAAE,WAAW;AACrB,QAAA,QAAQ,EAAE,YAAY;AACzB,KAAA;AACD,IAAA,gBAAgB,EAAE,IAAI;EACxB;AAEK,MAAM,CAAC,wBAAwB,EAAE,6BAA6B,CAAC,GAAG,gBAAgB,CACrF,gCAAgC;;ACLpC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,MAiBa,uBAAwB,SAAQ,UAAyB,CAAA;AAjBtE,IAAA,WAAA,GAAA;;AAkBqB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC1C,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAC3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,EAAA,QAAA,EAAA,kCAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;4FAYrC,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAf9B,SAAS;AACM,YAAA,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,YACN,6BAA6B,EAAA,OAAA,EAC9B,CAAC,IAAI,EAAE,SAAS,EAAE,mBAAmB,CAAC,EAAA,aAAA,EAGhC,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,eAAe,EAAE,MAAM;AACvB,wBAAA,6BAA6B,EAAE,iBAAiB;AAChD,wBAAA,2BAA2B,EAAE,gBAAgB;AAC7C,wBAAA,uBAAuB,EAAE,QAAQ;AACpC,qBAAA,EAAA,QAAA,EAAA,mmCAAA,EAAA,MAAA,EAAA,CAAA,09DAAA,CAAA,EAAA,CAAA;8BAiCU,UAAU,EAAA,CAAA;sBADpB,KAAK;uBAAC,MAAM,CAAA;;AAajB,SAAS,QAAQ,CAAC,KAAa,EAAA;AAC3B,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,GAAG,KAAK,GAAG,eAAe,EAAE,SAAS,CAAC,CAAC;AACxE;;AEtFa,MAAA,cAAc,GAAG;IAC1B,uBAAuB;IACvB,kBAAkB;IAClB,0BAA0B;;;ACP9B;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-password.mjs","sources":["../../../projects/kit/components/input-password/input-password.options.ts","../../../projects/kit/components/input-password/input-password.component.ts","../../../projects/kit/components/input-password/taiga-ui-kit-components-input-password.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-password.mjs","sources":["../../../projects/kit/components/input-password/input-password.options.ts","../../../projects/kit/components/input-password/input-password.component.ts","../../../projects/kit/components/input-password/taiga-ui-kit-components-input-password.ts"],"sourcesContent":["import {InjectionToken, type Provider} from '@angular/core';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\n\n/**\n * @deprecated use {@link TuiPassword} with {@link TuiTextfield}\n */\nexport interface TuiInputPasswordOptions {\n readonly icons: Readonly<{\n hide: TuiStringHandler<TuiSizeL | TuiSizeS> | string;\n show: TuiStringHandler<TuiSizeL | TuiSizeS> | string;\n }>;\n}\n\n/**\n * @deprecated use {@link TuiPassword} with {@link TuiTextfield}\n */\nexport const TUI_INPUT_PASSWORD_DEFAULT_OPTIONS: TuiInputPasswordOptions = {\n icons: {\n hide: '@tui.eye-off',\n show: '@tui.eye',\n },\n};\n\n/**\n * @deprecated use {@link TuiPassword} with {@link TuiTextfield}\n */\nexport const TUI_INPUT_PASSWORD_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_INPUT_PASSWORD_OPTIONS' : '',\n {\n factory: () => TUI_INPUT_PASSWORD_DEFAULT_OPTIONS,\n },\n);\n\n/**\n * @deprecated use {@link TuiPassword} with {@link TuiTextfield}\n */\nexport function tuiInputPasswordOptionsProvider(\n options: Partial<TuiInputPasswordOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_INPUT_PASSWORD_OPTIONS,\n options,\n TUI_INPUT_PASSWORD_DEFAULT_OPTIONS,\n );\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n signal,\n} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {\n TUI_TEXTFIELD_OPTIONS,\n TuiTextfieldContent,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiTooltip} from '@taiga-ui/kit/directives';\nimport {TUI_PASSWORD_TEXTS} from '@taiga-ui/kit/tokens';\n\nimport {TUI_INPUT_PASSWORD_OPTIONS} from './input-password.options';\n\n/**\n * @deprecated use {@link TuiPassword} with {@link TuiTextfield}\n */\n@Component({\n standalone: true,\n selector: 'input[tuiInputPassword]',\n imports: [TuiIcon, TuiTextfieldContent, TuiTooltip],\n template: `\n <tui-icon\n *tuiTextfieldContent\n [icon]=\"icon()\"\n [style.border]=\"size() === 's' ? null : 'none'\"\n [tuiTooltip]=\"text()\"\n (click)=\"hidden.set(!hidden())\"\n (mousedown.capture.prevent.stop)=\"el.focus()\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiFallbackValueProvider('')],\n hostDirectives: [TuiWithTextfield],\n host: {\n ngSkipHydration: 'true',\n '[type]': 'hidden() ? \"password\" : \"text\"',\n },\n})\nexport class TuiInputPassword {\n private readonly options = inject(TUI_INPUT_PASSWORD_OPTIONS);\n private readonly texts = toSignal(inject(TUI_PASSWORD_TEXTS), {\n initialValue: ['', ''] as const,\n });\n\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly size = inject(TUI_TEXTFIELD_OPTIONS).size;\n protected readonly hidden = signal(true);\n protected readonly text = computed(() =>\n this.hidden() ? this.texts()[0] : this.texts()[1],\n );\n\n protected readonly icon = computed((size = this.size()) => {\n const icon = this.hidden() ? this.options.icons.show : this.options.icons.hide;\n\n return tuiIsString(icon) ? icon : icon(size);\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAeA;;AAEG;AACU,MAAA,kCAAkC,GAA4B;AACvE,IAAA,KAAK,EAAE;AACH,QAAA,IAAI,EAAE,cAAc;AACpB,QAAA,IAAI,EAAE,UAAU;AACnB,KAAA;EACH;A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EAAE,UAAU,CAAC;AACnD,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;AAST,IAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,SAAS,EAAE,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;oBACzC,cAAc,EAAE,CAAC,gBAAgB,CAAC;AAClC,oBAAA,IAAI,EAAE;AACF,wBAAA,eAAe,EAAE,MAAM;AACvB,wBAAA,QAAQ,EAAE,gCAAgC;AAC7C,qBAAA;AACJ,iBAAA,CAAA;;;AC9CD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-phone-international.mjs","sources":["../../../projects/kit/components/input-phone-international/input-phone-international.options.ts","../../../projects/kit/components/input-phone-international/input-phone-international.component.ts","../../../projects/kit/components/input-phone-international/input-phone-international.template.html","../../../projects/kit/components/input-phone-international/taiga-ui-kit-components-input-phone-international.ts"],"sourcesContent":["import type {Provider} from '@angular/core';\nimport {InjectionToken} from '@angular/core';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {TuiCountryIsoCode} from '@taiga-ui/i18n/types';\nimport type {MetadataJson} from 'libphonenumber-js/core';\nimport type {Observable} from 'rxjs';\nimport {of} from 'rxjs';\n\nexport interface TuiInputPhoneInternationalOptions {\n readonly countries: readonly TuiCountryIsoCode[];\n readonly countryIsoCode: TuiCountryIsoCode;\n readonly metadata: Observable<MetadataJson> | Promise<MetadataJson>;\n readonly separator: string;\n}\n\nexport const TUI_INPUT_PHONE_INTERNATIONAL_DEFAULT_OPTIONS: TuiInputPhoneInternationalOptions =\n {\n countries: [],\n countryIsoCode: 'RU',\n metadata: of({countries: {}, country_calling_codes: {}}),\n separator: '-',\n };\n\n/**\n * Default parameters for input phone international component\n */\nexport const TUI_INPUT_PHONE_INTERNATIONAL_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_INPUT_PHONE_INTERNATIONAL_OPTIONS' : '',\n {\n factory: () => TUI_INPUT_PHONE_INTERNATIONAL_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiInputPhoneInternationalOptionsProvider(\n options: Partial<TuiInputPhoneInternationalOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_INPUT_PHONE_INTERNATIONAL_OPTIONS,\n options,\n TUI_INPUT_PHONE_INTERNATIONAL_DEFAULT_OPTIONS,\n );\n}\n","import {CommonModule} from '@angular/common';\nimport type {QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n forwardRef,\n inject,\n Input,\n Output,\n signal,\n TemplateRef,\n ViewChild,\n ViewChildren,\n} from '@angular/core';\nimport {toObservable, toSignal} from '@angular/core/rxjs-interop';\nimport {FormsModule} from '@angular/forms';\nimport {MaskitoDirective} from '@maskito/angular';\nimport type {MaskitoOptions} from '@maskito/core';\nimport {maskitoInitialCalibrationPlugin, maskitoTransform} from '@maskito/core';\nimport {maskitoRemoveOnBlurPlugin} from '@maskito/kit';\nimport {maskitoGetCountryFromNumber, maskitoPhoneOptionsGenerator} from '@maskito/phone';\nimport {tuiAsControl, TuiControl} from '@taiga-ui/cdk/classes';\nimport {CHAR_PLUS, TUI_DEFAULT_MATCHER} from '@taiga-ui/cdk/constants';\nimport {\n TuiAutoFocus,\n tuiAutoFocusOptionsProvider,\n} from '@taiga-ui/cdk/directives/auto-focus';\nimport {TUI_IS_IOS, tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiIsInputEvent} from '@taiga-ui/cdk/utils/dom';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiDataList, TuiOption} from '@taiga-ui/core/components/data-list';\nimport {\n TUI_TEXTFIELD_OPTIONS,\n TuiTextfield,\n TuiTextfieldDropdownDirective,\n tuiTextfieldOptionsProvider,\n} from '@taiga-ui/core/components/textfield';\nimport {\n tuiDropdown,\n TuiDropdownDirective,\n TuiDropdownOpen,\n tuiDropdownOpen,\n tuiDropdownOptionsProvider,\n TuiWithDropdownOpen,\n} from '@taiga-ui/core/directives/dropdown';\nimport {TuiGroup} from '@taiga-ui/core/directives/group';\nimport {TuiFlagPipe} from '@taiga-ui/core/pipes/flag';\nimport {TUI_COMMON_ICONS} from '@taiga-ui/core/tokens';\nimport {tuiIsEditingKey} from '@taiga-ui/core/utils/miscellaneous';\nimport type {TuiCountryIsoCode} from '@taiga-ui/i18n/types';\nimport {TuiChevron} from '@taiga-ui/kit/directives';\nimport {TUI_COUNTRIES, TUI_INTERNATIONAL_SEARCH} from '@taiga-ui/kit/tokens';\nimport {tuiGetCallingCode} from '@taiga-ui/kit/utils';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {validatePhoneNumberLength} from 'libphonenumber-js';\nimport type {MetadataJson} from 'libphonenumber-js/core';\nimport {getCountryCallingCode} from 'libphonenumber-js/core';\nimport {from, skip} from 'rxjs';\n\nimport {TUI_INPUT_PHONE_INTERNATIONAL_OPTIONS} from './input-phone-international.options';\n\nconst NOT_FORM_CONTROL_SYMBOLS = /[^+\\d]/g;\n\n/** @deprecated use version from experimental package instead */\n@Component({\n standalone: true,\n selector: 'tui-input-phone-international',\n imports: [\n CommonModule,\n FormsModule,\n MaskitoDirective,\n TuiAutoFocus,\n TuiChevron,\n TuiDataList,\n TuiFlagPipe,\n TuiTextfield,\n ],\n templateUrl: './input-phone-international.template.html',\n styleUrls: ['./input-phone-international.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsControl(TuiInputPhoneInternational),\n tuiFallbackValueProvider(''),\n tuiAutoFocusOptionsProvider({preventScroll: true}),\n tuiTextfieldOptionsProvider({cleaner: signal(false)}),\n tuiDropdownOptionsProvider({\n limitWidth: 'fixed',\n align: 'right',\n }),\n ],\n hostDirectives: [TuiGroup, TuiDropdownDirective, TuiWithDropdownOpen],\n host: {\n '[attr.data-size]': 'size()',\n },\n})\nexport class TuiInputPhoneInternational extends TuiControl<string> {\n @ViewChild(MaskitoDirective, {read: ElementRef})\n private readonly input?: ElementRef<HTMLInputElement>;\n\n @ViewChild(TuiAutoFocus, {read: ElementRef})\n private readonly filter?: ElementRef<HTMLInputElement>;\n\n @ViewChildren(TuiOption, {read: ElementRef})\n private readonly listOptions?: QueryList<ElementRef<HTMLButtonElement>>;\n\n protected readonly isIos = inject(TUI_IS_IOS);\n protected readonly dropdown = tuiDropdown(null);\n protected readonly options = inject(TUI_INPUT_PHONE_INTERNATIONAL_OPTIONS);\n protected readonly size = inject(TUI_TEXTFIELD_OPTIONS).size;\n protected readonly open = tuiDropdownOpen();\n protected readonly names = toSignal(inject(TUI_COUNTRIES));\n protected readonly metadata = toSignal(from(this.options.metadata));\n protected readonly countries = signal(this.options.countries);\n protected readonly countryIsoCode = signal(this.options.countryIsoCode);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly label = toSignal(inject(TUI_INTERNATIONAL_SEARCH));\n protected readonly search = signal<string>('');\n protected readonly separator = signal(this.options.separator);\n\n protected readonly filtered = computed(() =>\n this.countries()\n .map((iso) => ({\n iso,\n name: this.names()?.[iso] || '',\n code: tuiGetCallingCode(iso, this.metadata()),\n }))\n .filter(({name, code}) => TUI_DEFAULT_MATCHER(name + code, this.search())),\n );\n\n protected readonly mask = computed(() =>\n this.computeMask(this.countryIsoCode(), this.metadata(), this.separator()),\n );\n\n protected readonly $ = tuiDirectiveBinding(\n TuiDropdownOpen,\n 'tuiDropdownEnabled',\n this.interactive,\n );\n\n protected textfieldValue = '';\n\n @Input()\n public countrySearch = false;\n\n @Output()\n public readonly countryIsoCodeChange = toObservable(this.countryIsoCode).pipe(\n skip(1),\n );\n\n @Input('countries')\n public set countriesValue(value: readonly TuiCountryIsoCode[]) {\n this.countries.set(value);\n }\n\n @Input('countryIsoCode')\n public set isoCode(code: TuiCountryIsoCode) {\n this.countryIsoCode.set(code);\n }\n\n public focusFirstItem(): void {\n this.listOptions?.get(0)?.nativeElement.focus();\n }\n\n public onPaste(event: Event): void {\n const phonesMetadata = this.metadata();\n\n if (\n !tuiIsInputEvent(event) ||\n !phonesMetadata ||\n (!event.inputType.includes('Drop') && !event.inputType.includes('Paste'))\n ) {\n return;\n }\n\n const newValue = event.data || '';\n const prefixedValue = newValue.startsWith(CHAR_PLUS)\n ? newValue\n : CHAR_PLUS + newValue;\n\n if (validatePhoneNumberLength(prefixedValue) === 'TOO_SHORT') {\n return;\n }\n\n const countryIsoCode = maskitoGetCountryFromNumber(prefixedValue, phonesMetadata);\n\n if (countryIsoCode) {\n this.countryIsoCode.set(countryIsoCode);\n }\n }\n\n public onItemClick(isoCode: TuiCountryIsoCode): void {\n this.open.set(false);\n this.countryIsoCode.set(isoCode);\n this.input?.nativeElement.focus();\n }\n\n public override writeValue(unmaskedValue: string): void {\n super.writeValue(unmaskedValue);\n\n const maskOptions = this.mask();\n\n this.textfieldValue = maskOptions\n ? maskitoTransform(this.value(), maskOptions)\n : this.value(); // it will be calibrated later when mask is ready (by maskitoInitialCalibrationPlugin)\n this.cdr.detectChanges();\n }\n\n @ViewChild(forwardRef(() => TuiTextfieldDropdownDirective), {read: TemplateRef})\n protected set template(template: PolymorpheusContent) {\n this.dropdown.set(template);\n }\n\n protected onFocus(): void {\n const phoneMetadata = this.metadata();\n\n if (!this.textfieldValue && phoneMetadata) {\n this.textfieldValue = `${CHAR_PLUS + getCountryCallingCode(this.countryIsoCode(), phoneMetadata)} `;\n }\n }\n\n protected onValueChange(maskedValue: string): void {\n const unmaskedValue = maskedValue.replaceAll(NOT_FORM_CONTROL_SYMBOLS, '');\n const phonesMetadata = this.metadata();\n const countryCallingCode = phonesMetadata\n ? CHAR_PLUS + getCountryCallingCode(this.countryIsoCode(), phonesMetadata)\n : '';\n\n this.onChange(unmaskedValue === countryCallingCode ? '' : unmaskedValue);\n }\n\n protected onKeyDown({key}: KeyboardEvent): void {\n if (tuiIsEditingKey(key)) {\n this.filter?.nativeElement.focus({preventScroll: true});\n }\n }\n\n private computeMask(\n countryIsoCode: TuiCountryIsoCode,\n metadata?: MetadataJson,\n separator?: string,\n ): MaskitoOptions | null {\n if (!metadata) {\n return null;\n }\n\n const {plugins, ...restOptions} = maskitoPhoneOptionsGenerator({\n countryIsoCode,\n metadata,\n separator,\n });\n\n return {\n ...restOptions,\n plugins: [\n ...plugins,\n maskitoRemoveOnBlurPlugin(\n `${CHAR_PLUS}${getCountryCallingCode(countryIsoCode, metadata)} `,\n ),\n maskitoInitialCalibrationPlugin(),\n ],\n };\n }\n}\n","<tui-textfield\n class=\"t-select\"\n [content]=\"flag\"\n [tuiChevron]=\"open()\"\n>\n <select\n aria-label=\"Country\"\n ngModel=\"\"\n tuiTextfield\n [attr.data-mode]=\"mode()\"\n [disabled]=\"disabled()\"\n [focused]=\"open()\"\n [ngModelOptions]=\"{standalone: true}\"\n ></select>\n\n <ng-template #flag>\n <img\n class=\"t-flag\"\n [alt]=\"names()?.[countryIsoCode()]\"\n [src]=\"countryIsoCode() | tuiFlag\"\n />\n </ng-template>\n</tui-textfield>\n\n<tui-textfield>\n <!--TODO: Replace attribute bindings with inputs after Angular updated and signal bindings properly update-->\n <input\n autocomplete=\"new-password\"\n tuiTextfield\n [attr.data-mode]=\"mode()\"\n [attr.readonly]=\"readOnly() || null\"\n [disabled]=\"disabled()\"\n [maskito]=\"mask()\"\n [ngModelOptions]=\"{standalone: true}\"\n [(ngModel)]=\"textfieldValue\"\n (beforeinput.capture)=\"onPaste($event)\"\n (blur)=\"onTouched()\"\n (focus)=\"!readOnly() && onFocus()\"\n (ngModelChange)=\"onValueChange($event)\"\n />\n\n <!--\n TODO: get rid of built-in input and label and just externalize everything in 5.0\n <tui-input-phone-international>\n <label tuiLabel>My label</label>\n <input tuiTextfield placeholder=\"My placeholder\" [(ngModel)]=\"value\" />\n <tui-icon icon=\"@tui.phone\" />\n </tui-input-phone-international>\n -->\n <ng-content select=\"tui-icon, img\" />\n\n <label tuiLabel>\n <ng-content />\n </label>\n</tui-textfield>\n\n<ng-container *tuiTextfieldDropdown>\n <tui-textfield\n *ngIf=\"countrySearch\"\n tuiTextfieldSize=\"m\"\n class=\"t-search\"\n [iconStart]=\"icons.search\"\n >\n <input\n tuiTextfield\n [focused]=\"true\"\n [ngModel]=\"search()\"\n [placeholder]=\"label()\"\n [tuiAutoFocus]=\"!isIos\"\n (keydown.arrowDown)=\"focusFirstItem()\"\n (ngModelChange)=\"search.set($event)\"\n />\n </tui-textfield>\n\n <tui-data-list (keydown)=\"onKeyDown($event)\">\n <button\n *ngFor=\"let item of filtered()\"\n tuiOption\n type=\"button\"\n (click)=\"onItemClick(item.iso)\"\n >\n <img\n alt=\"\"\n class=\"t-flag\"\n [src]=\"item.iso | tuiFlag\"\n />\n <span class=\"t-name\">{{ item.name }}</span>\n <span class=\"t-code\">{{ item.code }}</span>\n </button>\n </tui-data-list>\n</ng-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAea,MAAA,6CAA6C,GACtD;AACI,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,cAAc,EAAE,IAAI;AACpB,IAAA,QAAQ,EAAE,EAAE,CAAC,EAAC,SAAS,EAAE,EAAE,EAAE,qBAAqB,EAAE,EAAE,EAAC,CAAC;AACxD,IAAA,SAAS,EAAE,GAAG;EAChB;AAEN;;AAEG;AACU,MAAA,qCAAqC,GAAG,IAAI,cAAc,CACnE,SAAS,GAAG,uCAAuC,GAAG,EAAE,EACxD;AACI,IAAA,OAAO,EAAE,MAAM,6CAA6C;AAC/D,CAAA,EACH;AAEI,SAAU,yCAAyC,CACrD,OAAmD,EAAA;IAEnD,OAAO,iBAAiB,CACpB,qCAAqC,EACrC,OAAO,EACP,6CAA6C,CAChD,CAAC;AACN;;ACsBA,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAE3C;AACA,MA+Ba,0BAA2B,SAAQ,UAAkB,CAAA;AA/BlE,IAAA,WAAA,G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
|
+
{"version":3,"file":"taiga-ui-kit-components-input-phone-international.mjs","sources":["../../../projects/kit/components/input-phone-international/input-phone-international.options.ts","../../../projects/kit/components/input-phone-international/input-phone-international.component.ts","../../../projects/kit/components/input-phone-international/input-phone-international.template.html","../../../projects/kit/components/input-phone-international/taiga-ui-kit-components-input-phone-international.ts"],"sourcesContent":["import {InjectionToken, type Provider} from '@angular/core';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiCountryIsoCode} from '@taiga-ui/i18n/types';\nimport {type MetadataJson} from 'libphonenumber-js/core';\nimport {type Observable, of} from 'rxjs';\n\nexport interface TuiInputPhoneInternationalOptions {\n readonly countries: readonly TuiCountryIsoCode[];\n readonly countryIsoCode: TuiCountryIsoCode;\n readonly metadata: Observable<MetadataJson> | Promise<MetadataJson>;\n readonly separator: string;\n}\n\nexport const TUI_INPUT_PHONE_INTERNATIONAL_DEFAULT_OPTIONS: TuiInputPhoneInternationalOptions =\n {\n countries: [],\n countryIsoCode: 'RU',\n metadata: of({countries: {}, country_calling_codes: {}}),\n separator: '-',\n };\n\n/**\n * Default parameters for input phone international component\n */\nexport const TUI_INPUT_PHONE_INTERNATIONAL_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_INPUT_PHONE_INTERNATIONAL_OPTIONS' : '',\n {\n factory: () => TUI_INPUT_PHONE_INTERNATIONAL_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiInputPhoneInternationalOptionsProvider(\n options: Partial<TuiInputPhoneInternationalOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_INPUT_PHONE_INTERNATIONAL_OPTIONS,\n options,\n TUI_INPUT_PHONE_INTERNATIONAL_DEFAULT_OPTIONS,\n );\n}\n","import {CommonModule} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n forwardRef,\n inject,\n Input,\n Output,\n type QueryList,\n signal,\n TemplateRef,\n ViewChild,\n ViewChildren,\n} from '@angular/core';\nimport {toObservable, toSignal} from '@angular/core/rxjs-interop';\nimport {FormsModule} from '@angular/forms';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {\n maskitoInitialCalibrationPlugin,\n type MaskitoOptions,\n maskitoTransform,\n} from '@maskito/core';\nimport {maskitoRemoveOnBlurPlugin} from '@maskito/kit';\nimport {maskitoGetCountryFromNumber, maskitoPhoneOptionsGenerator} from '@maskito/phone';\nimport {tuiAsControl, TuiControl} from '@taiga-ui/cdk/classes';\nimport {CHAR_PLUS, TUI_DEFAULT_MATCHER} from '@taiga-ui/cdk/constants';\nimport {\n TuiAutoFocus,\n tuiAutoFocusOptionsProvider,\n} from '@taiga-ui/cdk/directives/auto-focus';\nimport {TUI_IS_IOS, tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiIsInputEvent} from '@taiga-ui/cdk/utils/dom';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiDataList, TuiOption} from '@taiga-ui/core/components/data-list';\nimport {\n TUI_TEXTFIELD_OPTIONS,\n TuiTextfield,\n TuiTextfieldDropdownDirective,\n tuiTextfieldOptionsProvider,\n} from '@taiga-ui/core/components/textfield';\nimport {\n tuiDropdown,\n TuiDropdownDirective,\n TuiDropdownOpen,\n tuiDropdownOpen,\n tuiDropdownOptionsProvider,\n TuiWithDropdownOpen,\n} from '@taiga-ui/core/directives/dropdown';\nimport {TuiGroup} from '@taiga-ui/core/directives/group';\nimport {TuiFlagPipe} from '@taiga-ui/core/pipes/flag';\nimport {TUI_COMMON_ICONS} from '@taiga-ui/core/tokens';\nimport {tuiIsEditingKey} from '@taiga-ui/core/utils/miscellaneous';\nimport {type TuiCountryIsoCode} from '@taiga-ui/i18n/types';\nimport {TuiChevron} from '@taiga-ui/kit/directives';\nimport {TUI_COUNTRIES, TUI_INTERNATIONAL_SEARCH} from '@taiga-ui/kit/tokens';\nimport {tuiGetCallingCode} from '@taiga-ui/kit/utils';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {validatePhoneNumberLength} from 'libphonenumber-js';\nimport {getCountryCallingCode, type MetadataJson} from 'libphonenumber-js/core';\nimport {from, skip} from 'rxjs';\n\nimport {TUI_INPUT_PHONE_INTERNATIONAL_OPTIONS} from './input-phone-international.options';\n\nconst NOT_FORM_CONTROL_SYMBOLS = /[^+\\d]/g;\n\n/** @deprecated use version from experimental package instead */\n@Component({\n standalone: true,\n selector: 'tui-input-phone-international',\n imports: [\n CommonModule,\n FormsModule,\n MaskitoDirective,\n TuiAutoFocus,\n TuiChevron,\n TuiDataList,\n TuiFlagPipe,\n TuiTextfield,\n ],\n templateUrl: './input-phone-international.template.html',\n styleUrls: ['./input-phone-international.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsControl(TuiInputPhoneInternational),\n tuiFallbackValueProvider(''),\n tuiAutoFocusOptionsProvider({preventScroll: true}),\n tuiTextfieldOptionsProvider({cleaner: signal(false)}),\n tuiDropdownOptionsProvider({\n limitWidth: 'fixed',\n align: 'right',\n }),\n ],\n hostDirectives: [TuiGroup, TuiDropdownDirective, TuiWithDropdownOpen],\n host: {\n '[attr.data-size]': 'size()',\n },\n})\nexport class TuiInputPhoneInternational extends TuiControl<string> {\n @ViewChild(MaskitoDirective, {read: ElementRef})\n private readonly input?: ElementRef<HTMLInputElement>;\n\n @ViewChild(TuiAutoFocus, {read: ElementRef})\n private readonly filter?: ElementRef<HTMLInputElement>;\n\n @ViewChildren(TuiOption, {read: ElementRef})\n private readonly listOptions?: QueryList<ElementRef<HTMLButtonElement>>;\n\n protected readonly isIos = inject(TUI_IS_IOS);\n protected readonly dropdown = tuiDropdown(null);\n protected readonly options = inject(TUI_INPUT_PHONE_INTERNATIONAL_OPTIONS);\n protected readonly size = inject(TUI_TEXTFIELD_OPTIONS).size;\n protected readonly open = tuiDropdownOpen();\n protected readonly names = toSignal(inject(TUI_COUNTRIES));\n protected readonly metadata = toSignal(from(this.options.metadata));\n protected readonly countries = signal(this.options.countries);\n protected readonly countryIsoCode = signal(this.options.countryIsoCode);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly label = toSignal(inject(TUI_INTERNATIONAL_SEARCH));\n protected readonly search = signal<string>('');\n protected readonly separator = signal(this.options.separator);\n\n protected readonly filtered = computed(() =>\n this.countries()\n .map((iso) => ({\n iso,\n name: this.names()?.[iso] || '',\n code: tuiGetCallingCode(iso, this.metadata()),\n }))\n .filter(({name, code}) => TUI_DEFAULT_MATCHER(name + code, this.search())),\n );\n\n protected readonly mask = computed(() =>\n this.computeMask(this.countryIsoCode(), this.metadata(), this.separator()),\n );\n\n protected readonly $ = tuiDirectiveBinding(\n TuiDropdownOpen,\n 'tuiDropdownEnabled',\n this.interactive,\n );\n\n protected textfieldValue = '';\n\n @Input()\n public countrySearch = false;\n\n @Output()\n public readonly countryIsoCodeChange = toObservable(this.countryIsoCode).pipe(\n skip(1),\n );\n\n @Input('countries')\n public set countriesValue(value: readonly TuiCountryIsoCode[]) {\n this.countries.set(value);\n }\n\n @Input('countryIsoCode')\n public set isoCode(code: TuiCountryIsoCode) {\n this.countryIsoCode.set(code);\n }\n\n public focusFirstItem(): void {\n this.listOptions?.get(0)?.nativeElement.focus();\n }\n\n public onPaste(event: Event): void {\n const phonesMetadata = this.metadata();\n\n if (\n !tuiIsInputEvent(event) ||\n !phonesMetadata ||\n (!event.inputType.includes('Drop') && !event.inputType.includes('Paste'))\n ) {\n return;\n }\n\n const newValue = event.data || '';\n const prefixedValue = newValue.startsWith(CHAR_PLUS)\n ? newValue\n : CHAR_PLUS + newValue;\n\n if (validatePhoneNumberLength(prefixedValue) === 'TOO_SHORT') {\n return;\n }\n\n const countryIsoCode = maskitoGetCountryFromNumber(prefixedValue, phonesMetadata);\n\n if (countryIsoCode) {\n this.countryIsoCode.set(countryIsoCode);\n }\n }\n\n public onItemClick(isoCode: TuiCountryIsoCode): void {\n this.open.set(false);\n this.countryIsoCode.set(isoCode);\n this.input?.nativeElement.focus();\n }\n\n public override writeValue(unmaskedValue: string): void {\n super.writeValue(unmaskedValue);\n\n const maskOptions = this.mask();\n\n this.textfieldValue = maskOptions\n ? maskitoTransform(this.value(), maskOptions)\n : this.value(); // it will be calibrated later when mask is ready (by maskitoInitialCalibrationPlugin)\n this.cdr.detectChanges();\n }\n\n @ViewChild(forwardRef(() => TuiTextfieldDropdownDirective), {read: TemplateRef})\n protected set template(template: PolymorpheusContent) {\n this.dropdown.set(template);\n }\n\n protected onFocus(): void {\n const phoneMetadata = this.metadata();\n\n if (!this.textfieldValue && phoneMetadata) {\n this.textfieldValue = `${CHAR_PLUS + getCountryCallingCode(this.countryIsoCode(), phoneMetadata)} `;\n }\n }\n\n protected onValueChange(maskedValue: string): void {\n const unmaskedValue = maskedValue.replaceAll(NOT_FORM_CONTROL_SYMBOLS, '');\n const phonesMetadata = this.metadata();\n const countryCallingCode = phonesMetadata\n ? CHAR_PLUS + getCountryCallingCode(this.countryIsoCode(), phonesMetadata)\n : '';\n\n this.onChange(unmaskedValue === countryCallingCode ? '' : unmaskedValue);\n }\n\n protected onKeyDown({key}: KeyboardEvent): void {\n if (tuiIsEditingKey(key)) {\n this.filter?.nativeElement.focus({preventScroll: true});\n }\n }\n\n private computeMask(\n countryIsoCode: TuiCountryIsoCode,\n metadata?: MetadataJson,\n separator?: string,\n ): MaskitoOptions | null {\n if (!metadata) {\n return null;\n }\n\n const {plugins, ...restOptions} = maskitoPhoneOptionsGenerator({\n countryIsoCode,\n metadata,\n separator,\n });\n\n return {\n ...restOptions,\n plugins: [\n ...plugins,\n maskitoRemoveOnBlurPlugin(\n `${CHAR_PLUS}${getCountryCallingCode(countryIsoCode, metadata)} `,\n ),\n maskitoInitialCalibrationPlugin(),\n ],\n };\n }\n}\n","<tui-textfield\n class=\"t-select\"\n [content]=\"flag\"\n [tuiChevron]=\"open()\"\n>\n <select\n aria-label=\"Country\"\n ngModel=\"\"\n tuiTextfield\n [attr.data-mode]=\"mode()\"\n [disabled]=\"disabled()\"\n [focused]=\"open()\"\n [ngModelOptions]=\"{standalone: true}\"\n ></select>\n\n <ng-template #flag>\n <img\n class=\"t-flag\"\n [alt]=\"names()?.[countryIsoCode()]\"\n [src]=\"countryIsoCode() | tuiFlag\"\n />\n </ng-template>\n</tui-textfield>\n\n<tui-textfield>\n <!--TODO: Replace attribute bindings with inputs after Angular updated and signal bindings properly update-->\n <input\n autocomplete=\"new-password\"\n tuiTextfield\n [attr.data-mode]=\"mode()\"\n [attr.readonly]=\"readOnly() || null\"\n [disabled]=\"disabled()\"\n [maskito]=\"mask()\"\n [ngModelOptions]=\"{standalone: true}\"\n [(ngModel)]=\"textfieldValue\"\n (beforeinput.capture)=\"onPaste($event)\"\n (blur)=\"onTouched()\"\n (focus)=\"!readOnly() && onFocus()\"\n (ngModelChange)=\"onValueChange($event)\"\n />\n\n <!--\n TODO: get rid of built-in input and label and just externalize everything in 5.0\n <tui-input-phone-international>\n <label tuiLabel>My label</label>\n <input tuiTextfield placeholder=\"My placeholder\" [(ngModel)]=\"value\" />\n <tui-icon icon=\"@tui.phone\" />\n </tui-input-phone-international>\n -->\n <ng-content select=\"tui-icon, img\" />\n\n <label tuiLabel>\n <ng-content />\n </label>\n</tui-textfield>\n\n<ng-container *tuiTextfieldDropdown>\n <tui-textfield\n *ngIf=\"countrySearch\"\n tuiTextfieldSize=\"m\"\n class=\"t-search\"\n [iconStart]=\"icons.search\"\n >\n <input\n tuiTextfield\n [focused]=\"true\"\n [ngModel]=\"search()\"\n [placeholder]=\"label()\"\n [tuiAutoFocus]=\"!isIos\"\n (keydown.arrowDown)=\"focusFirstItem()\"\n (ngModelChange)=\"search.set($event)\"\n />\n </tui-textfield>\n\n <tui-data-list (keydown)=\"onKeyDown($event)\">\n <button\n *ngFor=\"let item of filtered()\"\n tuiOption\n type=\"button\"\n (click)=\"onItemClick(item.iso)\"\n >\n <img\n alt=\"\"\n class=\"t-flag\"\n [src]=\"item.iso | tuiFlag\"\n />\n <span class=\"t-name\">{{ item.name }}</span>\n <span class=\"t-code\">{{ item.code }}</span>\n </button>\n </tui-data-list>\n</ng-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaa,MAAA,6CAA6C,GACtD;AACI,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,cAAc,EAAE,IAAI;AACpB,IAAA,QAAQ,EAAE,EAAE,CAAC,EAAC,SAAS,EAAE,EAAE,EAAE,qBAAqB,EAAE,EAAE,EAAC,CAAC;AACxD,IAAA,SAAS,EAAE,GAAG;EAChB;AAEN;;AAEG;AACU,MAAA,qCAAqC,GAAG,IAAI,cAAc,CACnE,SAAS,GAAG,uCAAuC,GAAG,EAAE,EACxD;AACI,IAAA,OAAO,EAAE,MAAM,6CAA6C;AAC/D,CAAA,EACH;AAEI,SAAU,yCAAyC,CACrD,OAAmD,EAAA;IAEnD,OAAO,iBAAiB,CACpB,qCAAqC,EACrC,OAAO,EACP,6CAA6C,CAChD,CAAC;AACN;;AC0BA,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAE3C;AACA,MA+Ba,0BAA2B,SAAQ,UAAkB,CAAA;AA/BlE,IAAA,WAAA,GAAA;;AAyCuB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAC3B,QAAA,IAAA,CAAA,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AAC7B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,qCAAqC,CAAC,CAAC;AACxD,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC;QAC1C,IAAI,CAAA,IAAA,GAAG,eAAe,EAAE,CAAC;QACzB,IAAK,CAAA,KAAA,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;AACxC,QAAA,IAAA,CAAA,QAAQ,GAAG,QAAQ,C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EAAA,MAAA,EAAA,CAAA,gcAAA,CAAA,EAAA,CAAA;8BAIgB,KAAK,EAAA,CAAA;sBADrB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,gBAAgB,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAA;gBAI9B,MAAM,EAAA,CAAA;sBADtB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,YAAY,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAA;gBAI1B,WAAW,EAAA,CAAA;sBAD3B,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,SAAS,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAA;gBAwCpC,aAAa,EAAA,CAAA;sBADnB,KAAK;gBAIU,oBAAoB,EAAA,CAAA;sBADnC,MAAM;gBAMI,cAAc,EAAA,CAAA;sBADxB,KAAK;uBAAC,WAAW,CAAA;gBAMP,OAAO,EAAA,CAAA;sBADjB,KAAK;uBAAC,gBAAgB,CAAA;gBAsDT,QAAQ,EAAA,CAAA;sBADrB,SAAS;uBAAC,UAAU,CAAC,MAAM,6BAA6B,CAAC,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC,CAAA;;;AEnNnF;;AAEG;;;;"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, computed, effect, untracked, signal, Directive, Input } from '@angular/core';
|
|
3
|
+
import * as i2 from '@maskito/angular';
|
|
4
|
+
import { MaskitoDirective } from '@maskito/angular';
|
|
5
|
+
import { maskitoTransform, MASKITO_DEFAULT_OPTIONS } from '@maskito/core';
|
|
6
|
+
import { maskitoPrefixPostprocessorGenerator, maskitoCaretGuard } from '@maskito/kit';
|
|
7
|
+
import { TUI_IDENTITY_VALUE_TRANSFORMER, TuiControl, tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
|
|
8
|
+
import { TUI_ALLOW_SIGNAL_WRITES } from '@taiga-ui/cdk/constants';
|
|
9
|
+
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
10
|
+
import * as i1 from '@taiga-ui/core/components/textfield';
|
|
11
|
+
import { TuiTextfieldDirective, TuiTextfieldComponent, TuiWithTextfield } from '@taiga-ui/core/components/textfield';
|
|
12
|
+
import { tuiMaskito } from '@taiga-ui/kit/utils';
|
|
13
|
+
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
14
|
+
|
|
15
|
+
const TUI_INPUT_PHONE_DEFAULT_OPTIONS = {
|
|
16
|
+
mask: '+1 ### ###-####',
|
|
17
|
+
allowText: false,
|
|
18
|
+
valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,
|
|
19
|
+
};
|
|
20
|
+
const [TUI_INPUT_PHONE_OPTIONS, tuiInputPhoneOptionsProvider] = tuiCreateOptions(TUI_INPUT_PHONE_DEFAULT_OPTIONS);
|
|
21
|
+
|
|
22
|
+
const countDigits = (value) => value.replaceAll(/\D/g, '').length;
|
|
23
|
+
/**
|
|
24
|
+
* `InputPhone` component sets country code as non-removable prefix.
|
|
25
|
+
* This prefix appears on focus and cannot be erased.
|
|
26
|
+
* But users sometimes can copy complete phone number (from any different source)
|
|
27
|
+
* and try to insert the whole string inside our `InputPhone` textfield.
|
|
28
|
+
* This preprocessor helps to avoid country prefix duplication on paste/drop/autofill events.
|
|
29
|
+
*/
|
|
30
|
+
function tuiCreateCompletePhoneInsertionPreprocessor(countryCode, phoneMaskAfterCountryCode) {
|
|
31
|
+
const completePhoneLength = (countryCode + phoneMaskAfterCountryCode).replaceAll(/[^#\d]+/g, '').length;
|
|
32
|
+
const trimCountryPrefix = (value) => countryCode === '+7'
|
|
33
|
+
? value.replace(/^(\+?\s*7?\s?8?)\s?/, '')
|
|
34
|
+
: value.replace(new RegExp(`^(\\+?\\s*${countryCode.replace('+', '')}?)\\s?`), '');
|
|
35
|
+
return ({ elementState, data }) => {
|
|
36
|
+
const { value, selection } = elementState;
|
|
37
|
+
return {
|
|
38
|
+
elementState: {
|
|
39
|
+
selection,
|
|
40
|
+
value:
|
|
41
|
+
/**
|
|
42
|
+
* The only possible case when `value` includes digits more
|
|
43
|
+
* than mask expression allows – browser autofill.
|
|
44
|
+
* It means that we are inside `input`-event
|
|
45
|
+
* and mask are ready to reject "extra" characters.
|
|
46
|
+
* We should cut leading country prefix to save trailing characters!
|
|
47
|
+
*/
|
|
48
|
+
countDigits(value) > completePhoneLength
|
|
49
|
+
? trimCountryPrefix(value)
|
|
50
|
+
: value,
|
|
51
|
+
},
|
|
52
|
+
data: countDigits(data) >= completePhoneLength || data.startsWith(countryCode)
|
|
53
|
+
? /**
|
|
54
|
+
* User tries to insert/drop the complete phone number (with country prefix).
|
|
55
|
+
* We should drop already existing non-removable prefix.
|
|
56
|
+
*/
|
|
57
|
+
trimCountryPrefix(data)
|
|
58
|
+
: data,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Create {@link https://maskito.dev/core-concepts/mask-expression pattern mask expression} for phone number
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* tuiCreatePhoneMaskExpression('+1', '(###) ###-####');
|
|
68
|
+
*/
|
|
69
|
+
function tuiCreatePhoneMaskExpression(countryCode, phoneMaskAfterCountryCode) {
|
|
70
|
+
return [
|
|
71
|
+
...countryCode.split(''),
|
|
72
|
+
' ',
|
|
73
|
+
...phoneMaskAfterCountryCode
|
|
74
|
+
.replaceAll(/[^#\- ()]+/g, '')
|
|
75
|
+
.split('')
|
|
76
|
+
.map((item) => (item === '#' ? /\d/ : item)),
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const MASK_SYMBOLS = /[ \-_()]/g;
|
|
81
|
+
function isText(value) {
|
|
82
|
+
return Number.isNaN(parseInt(value.replaceAll(MASK_SYMBOLS, ''), 10));
|
|
83
|
+
}
|
|
84
|
+
class TuiInputPhone extends TuiControl {
|
|
85
|
+
constructor() {
|
|
86
|
+
super(...arguments);
|
|
87
|
+
this.textfield = inject(TuiTextfieldDirective);
|
|
88
|
+
this.host = inject(TuiTextfieldComponent);
|
|
89
|
+
this.nonRemovablePrefix = computed(() => `${this.countryCode()} `);
|
|
90
|
+
this.inputMode = computed(() => (this.allowText() ? 'text' : 'numeric'));
|
|
91
|
+
this.valueEffect = effect(() => {
|
|
92
|
+
const value = this.value() ?? '';
|
|
93
|
+
if (!value) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
this.textfield.value.set(maskitoTransform(value, this.mask()));
|
|
97
|
+
}, TUI_ALLOW_SIGNAL_WRITES);
|
|
98
|
+
this.blurEffect = effect(() => {
|
|
99
|
+
const incomplete = untracked(() => !this.value());
|
|
100
|
+
if (!this.host.focused() && incomplete) {
|
|
101
|
+
this.textfield.value.set('');
|
|
102
|
+
}
|
|
103
|
+
if (this.host.focused() && incomplete && !this.allowText()) {
|
|
104
|
+
this.textfield.value.set(this.nonRemovablePrefix());
|
|
105
|
+
}
|
|
106
|
+
}, TUI_ALLOW_SIGNAL_WRITES);
|
|
107
|
+
this.options = inject(TUI_INPUT_PHONE_OPTIONS);
|
|
108
|
+
this.el = tuiInjectElement();
|
|
109
|
+
this.mask = computed(() => this.calculateMask(this.countryCode(), this.phoneMask(), this.nonRemovablePrefix(), this.allowText()));
|
|
110
|
+
this.maskito = tuiMaskito(computed(() => this.mask()));
|
|
111
|
+
this.countryCode = signal(extractCountryCode(this.options.mask));
|
|
112
|
+
this.allowText = signal(this.options.allowText);
|
|
113
|
+
this.phoneMask = signal(extractMask(this.options.mask));
|
|
114
|
+
}
|
|
115
|
+
// TODO(v5): replace with signal input
|
|
116
|
+
set allowTextSetter(allow) {
|
|
117
|
+
this.allowText.set(allow);
|
|
118
|
+
}
|
|
119
|
+
// TODO(v5): replace with signal input
|
|
120
|
+
set maskSetter(mask) {
|
|
121
|
+
this.countryCode.set(extractCountryCode(mask));
|
|
122
|
+
this.phoneMask.set(extractMask(mask));
|
|
123
|
+
}
|
|
124
|
+
onInput(value) {
|
|
125
|
+
if (!value && !this.allowText()) {
|
|
126
|
+
this.textfield.value.set(this.nonRemovablePrefix());
|
|
127
|
+
}
|
|
128
|
+
const parsed = isText(value)
|
|
129
|
+
? value
|
|
130
|
+
: value.replaceAll(MASK_SYMBOLS, '').slice(0, this.maxPhoneLength);
|
|
131
|
+
this.onChange(parsed === this.countryCode() || isText(parsed) ? '' : parsed);
|
|
132
|
+
}
|
|
133
|
+
get maxPhoneLength() {
|
|
134
|
+
return (this.countryCode().length + this.phoneMask().replaceAll(/[^#]+/g, '').length);
|
|
135
|
+
}
|
|
136
|
+
calculateMask(countryCode, phoneMaskAfterCountryCode, nonRemovablePrefix, allowText) {
|
|
137
|
+
const mask = tuiCreatePhoneMaskExpression(countryCode, phoneMaskAfterCountryCode);
|
|
138
|
+
const preprocessors = [
|
|
139
|
+
tuiCreateCompletePhoneInsertionPreprocessor(countryCode, phoneMaskAfterCountryCode),
|
|
140
|
+
];
|
|
141
|
+
return allowText
|
|
142
|
+
? {
|
|
143
|
+
mask: ({ value }) => isText(value) && value !== '+'
|
|
144
|
+
? MASKITO_DEFAULT_OPTIONS.mask
|
|
145
|
+
: mask,
|
|
146
|
+
preprocessors,
|
|
147
|
+
}
|
|
148
|
+
: {
|
|
149
|
+
mask,
|
|
150
|
+
preprocessors,
|
|
151
|
+
postprocessors: [
|
|
152
|
+
maskitoPrefixPostprocessorGenerator(nonRemovablePrefix),
|
|
153
|
+
],
|
|
154
|
+
plugins: [
|
|
155
|
+
maskitoCaretGuard((value, [from, to]) => [
|
|
156
|
+
from === to ? nonRemovablePrefix.length : 0,
|
|
157
|
+
value.length,
|
|
158
|
+
]),
|
|
159
|
+
],
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputPhone, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
163
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputPhone, isStandalone: true, selector: "input[tuiInputPhone]", inputs: { allowTextSetter: ["allowText", "allowTextSetter"], maskSetter: ["mask", "maskSetter"] }, host: { attributes: { "type": "tel" }, listeners: { "input": "onInput($event.target.value)" }, properties: { "inputMode": "inputMode()", "disabled": "disabled()" } }, providers: [
|
|
164
|
+
tuiAsControl(TuiInputPhone),
|
|
165
|
+
tuiValueTransformerFrom(TUI_INPUT_PHONE_OPTIONS),
|
|
166
|
+
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithTextfield }, { directive: i2.MaskitoDirective }], ngImport: i0 }); }
|
|
167
|
+
}
|
|
168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputPhone, decorators: [{
|
|
169
|
+
type: Directive,
|
|
170
|
+
args: [{
|
|
171
|
+
standalone: true,
|
|
172
|
+
selector: 'input[tuiInputPhone]',
|
|
173
|
+
providers: [
|
|
174
|
+
tuiAsControl(TuiInputPhone),
|
|
175
|
+
tuiValueTransformerFrom(TUI_INPUT_PHONE_OPTIONS),
|
|
176
|
+
],
|
|
177
|
+
hostDirectives: [TuiWithTextfield, MaskitoDirective],
|
|
178
|
+
host: {
|
|
179
|
+
type: 'tel',
|
|
180
|
+
'[inputMode]': 'inputMode()',
|
|
181
|
+
'[disabled]': 'disabled()',
|
|
182
|
+
'(input)': 'onInput($event.target.value)',
|
|
183
|
+
},
|
|
184
|
+
}]
|
|
185
|
+
}], propDecorators: { allowTextSetter: [{
|
|
186
|
+
type: Input,
|
|
187
|
+
args: ['allowText']
|
|
188
|
+
}], maskSetter: [{
|
|
189
|
+
type: Input,
|
|
190
|
+
args: ['mask']
|
|
191
|
+
}] } });
|
|
192
|
+
function extractCountryCode(mask) {
|
|
193
|
+
const match = /^(\+\d+)/.exec(mask);
|
|
194
|
+
return match?.[1] || '';
|
|
195
|
+
}
|
|
196
|
+
function extractMask(mask) {
|
|
197
|
+
const match = /^\+\d+(.*)$/.exec(mask);
|
|
198
|
+
return match?.[1]?.trim() || '';
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Generated bundle index. Do not edit.
|
|
203
|
+
*/
|
|
204
|
+
|
|
205
|
+
export { TUI_INPUT_PHONE_DEFAULT_OPTIONS, TUI_INPUT_PHONE_OPTIONS, TuiInputPhone, tuiInputPhoneOptionsProvider };
|
|
206
|
+
//# sourceMappingURL=taiga-ui-kit-components-input-phone.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-phone.mjs","sources":["../../../projects/kit/components/input-phone/input-phone.options.ts","../../../projects/kit/components/input-phone/utils/complete-phone-insertion-preprocessor.ts","../../../projects/kit/components/input-phone/utils/create-phone-mask-expression.ts","../../../projects/kit/components/input-phone/input-phone.directive.ts","../../../projects/kit/components/input-phone/taiga-ui-kit-components-input-phone.ts"],"sourcesContent":["import {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\n\nexport interface TuiInputPhoneOptions {\n readonly allowText: boolean;\n readonly mask: string;\n readonly valueTransformer: TuiValueTransformer<string | null, any>;\n}\n\nexport const TUI_INPUT_PHONE_DEFAULT_OPTIONS: TuiInputPhoneOptions = {\n mask: '+1 ### ###-####',\n allowText: false,\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n};\n\nexport const [TUI_INPUT_PHONE_OPTIONS, tuiInputPhoneOptionsProvider] = tuiCreateOptions(\n TUI_INPUT_PHONE_DEFAULT_OPTIONS,\n);\n","import {type MaskitoPreprocessor} from '@maskito/core';\n\nconst countDigits = (value: string): number => value.replaceAll(/\\D/g, '').length;\n\n/**\n * `InputPhone` component sets country code as non-removable prefix.\n * This prefix appears on focus and cannot be erased.\n * But users sometimes can copy complete phone number (from any different source)\n * and try to insert the whole string inside our `InputPhone` textfield.\n * This preprocessor helps to avoid country prefix duplication on paste/drop/autofill events.\n */\nexport function tuiCreateCompletePhoneInsertionPreprocessor(\n countryCode: string,\n phoneMaskAfterCountryCode: string,\n): MaskitoPreprocessor {\n const completePhoneLength = (countryCode + phoneMaskAfterCountryCode).replaceAll(\n /[^#\\d]+/g,\n '',\n ).length;\n\n const trimCountryPrefix = (value: string): string =>\n countryCode === '+7'\n ? value.replace(/^(\\+?\\s*7?\\s?8?)\\s?/, '')\n : value.replace(\n new RegExp(`^(\\\\+?\\\\s*${countryCode.replace('+', '')}?)\\\\s?`),\n '',\n );\n\n return ({elementState, data}) => {\n const {value, selection} = elementState;\n\n return {\n elementState: {\n selection,\n value:\n /**\n * The only possible case when `value` includes digits more\n * than mask expression allows – browser autofill.\n * It means that we are inside `input`-event\n * and mask are ready to reject \"extra\" characters.\n * We should cut leading country prefix to save trailing characters!\n */\n countDigits(value) > completePhoneLength\n ? trimCountryPrefix(value)\n : value,\n },\n data:\n countDigits(data) >= completePhoneLength || data.startsWith(countryCode)\n ? /**\n * User tries to insert/drop the complete phone number (with country prefix).\n * We should drop already existing non-removable prefix.\n */\n trimCountryPrefix(data)\n : data,\n };\n };\n}\n","/**\n * Create {@link https://maskito.dev/core-concepts/mask-expression pattern mask expression} for phone number\n *\n * @example\n * tuiCreatePhoneMaskExpression('+1', '(###) ###-####');\n */\nexport function tuiCreatePhoneMaskExpression(\n countryCode: string,\n phoneMaskAfterCountryCode: string,\n): Array<RegExp | string> {\n return [\n ...countryCode.split(''),\n ' ',\n ...phoneMaskAfterCountryCode\n .replaceAll(/[^#\\- ()]+/g, '')\n .split('')\n .map((item) => (item === '#' ? /\\d/ : item)),\n ];\n}\n","import {\n computed,\n Directive,\n effect,\n inject,\n Input,\n signal,\n untracked,\n} from '@angular/core';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {\n MASKITO_DEFAULT_OPTIONS,\n type MaskitoOptions,\n maskitoTransform,\n} from '@maskito/core';\nimport {maskitoCaretGuard, maskitoPrefixPostprocessorGenerator} from '@maskito/kit';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n TuiTextfieldComponent,\n TuiTextfieldDirective,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {TUI_INPUT_PHONE_OPTIONS} from './input-phone.options';\nimport {tuiCreateCompletePhoneInsertionPreprocessor} from './utils/complete-phone-insertion-preprocessor';\nimport {tuiCreatePhoneMaskExpression} from './utils/create-phone-mask-expression';\n\nconst MASK_SYMBOLS = /[ \\-_()]/g;\n\nfunction isText(value: string): boolean {\n return Number.isNaN(parseInt(value.replaceAll(MASK_SYMBOLS, ''), 10));\n}\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputPhone]',\n providers: [\n tuiAsControl(TuiInputPhone),\n tuiValueTransformerFrom(TUI_INPUT_PHONE_OPTIONS),\n ],\n hostDirectives: [TuiWithTextfield, MaskitoDirective],\n host: {\n type: 'tel',\n '[inputMode]': 'inputMode()',\n '[disabled]': 'disabled()',\n '(input)': 'onInput($event.target.value)',\n },\n})\nexport class TuiInputPhone extends TuiControl<string | null> {\n private readonly textfield = inject(TuiTextfieldDirective);\n private readonly host: TuiTextfieldComponent<string> = inject(TuiTextfieldComponent);\n\n protected readonly nonRemovablePrefix = computed(() => `${this.countryCode()} `);\n protected inputMode = computed(() => (this.allowText() ? 'text' : 'numeric'));\n\n protected readonly valueEffect = effect(() => {\n const value = this.value() ?? '';\n\n if (!value) {\n return;\n }\n\n this.textfield.value.set(maskitoTransform(value, this.mask()));\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly blurEffect = effect(() => {\n const incomplete = untracked(() => !this.value());\n\n if (!this.host.focused() && incomplete) {\n this.textfield.value.set('');\n }\n\n if (this.host.focused() && incomplete && !this.allowText()) {\n this.textfield.value.set(this.nonRemovablePrefix());\n }\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly options = inject(TUI_INPUT_PHONE_OPTIONS);\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n\n protected readonly mask = computed(() =>\n this.calculateMask(\n this.countryCode(),\n this.phoneMask(),\n this.nonRemovablePrefix(),\n this.allowText(),\n ),\n );\n\n protected readonly maskito = tuiMaskito(computed(() => this.mask()));\n\n public readonly countryCode = signal(extractCountryCode(this.options.mask));\n public readonly allowText = signal(this.options.allowText);\n public readonly phoneMask = signal(extractMask(this.options.mask));\n\n // TODO(v5): replace with signal input\n @Input('allowText')\n public set allowTextSetter(allow: boolean) {\n this.allowText.set(allow);\n }\n\n // TODO(v5): replace with signal input\n @Input('mask')\n public set maskSetter(mask: string) {\n this.countryCode.set(extractCountryCode(mask));\n this.phoneMask.set(extractMask(mask));\n }\n\n protected onInput(value: string): void {\n if (!value && !this.allowText()) {\n this.textfield.value.set(this.nonRemovablePrefix());\n }\n\n const parsed = isText(value)\n ? value\n : value.replaceAll(MASK_SYMBOLS, '').slice(0, this.maxPhoneLength);\n\n this.onChange(parsed === this.countryCode() || isText(parsed) ? '' : parsed);\n }\n\n private get maxPhoneLength(): number {\n return (\n this.countryCode().length + this.phoneMask().replaceAll(/[^#]+/g, '').length\n );\n }\n\n private calculateMask(\n countryCode: string,\n phoneMaskAfterCountryCode: string,\n nonRemovablePrefix: string,\n allowText: boolean,\n ): MaskitoOptions {\n const mask = tuiCreatePhoneMaskExpression(countryCode, phoneMaskAfterCountryCode);\n const preprocessors = [\n tuiCreateCompletePhoneInsertionPreprocessor(\n countryCode,\n phoneMaskAfterCountryCode,\n ),\n ];\n\n return allowText\n ? {\n mask: ({value}) =>\n isText(value) && value !== '+'\n ? (MASKITO_DEFAULT_OPTIONS.mask as RegExp)\n : mask,\n preprocessors,\n }\n : {\n mask,\n preprocessors,\n postprocessors: [\n maskitoPrefixPostprocessorGenerator(nonRemovablePrefix),\n ],\n plugins: [\n maskitoCaretGuard((value, [from, to]) => [\n from === to ? nonRemovablePrefix.length : 0,\n value.length,\n ]),\n ],\n };\n }\n}\n\nfunction extractCountryCode(mask: string): string {\n const match = /^(\\+\\d+)/.exec(mask);\n\n return match?.[1] || '';\n}\n\nfunction extractMask(mask: string): string {\n const match = /^\\+\\d+(.*)$/.exec(mask);\n\n return match?.[1]?.trim() || '';\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAYa,MAAA,+BAA+B,GAAyB;AACjE,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,gBAAgB,EAAE,8BAA8B;EAClD;AAEK,MAAM,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,GAAG,gBAAgB,CACnF,+BAA+B;;ACjBnC,MAAM,WAAW,GAAG,CAAC,KAAa,KAAa,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;AAElF;;;;;;AAMG;AACa,SAAA,2CAA2C,CACvD,WAAmB,EACnB,yBAAiC,EAAA;AAEjC,IAAA,MAAM,mBAAmB,GAAG,CAAC,WAAW,GAAG,yBAAyB,EAAE,UAAU,CAC5E,UAAU,EACV,EAAE,CACL,CAAC,MAAM,CAAC;IAET,MAAM,iBAAiB,GAAG,CAAC,KAAa,KACpC,WAAW,KAAK,IAAI;UACd,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC;UACxC,KAAK,CAAC,OAAO,CACT,IAAI,MAAM,CAAC,CAAA,UAAA,EAAa,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,EAC7D,EAAE,CACL,CAAC;AAEZ,IAAA,OAAO,CAAC,EAAC,YAAY,EAAE,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AACnD,qBAAA;AACD,oBAAA,cAAc,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;AACpD,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,KAAK;AACX,wBAAA,aAAa,EAAE,aAAa;AAC5B,wBAAA,YAAY,EAAE,YAAY;AAC1B,wBAAA,SAAS,EAAE,8BAA8B;AAC5C,qBAAA;AACJ,iBAAA,CAAA;8BAkDc,eAAe,EAAA,CAAA;sBADzB,KAAK;uBAAC,WAAW,CAAA;gBAOP,UAAU,EAAA,CAAA;sBADpB,KAAK;uBAAC,MAAM,CAAA;;AA8DjB,SAAS,kBAAkB,CAAC,IAAY,EAAA;IACpC,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEpC,IAAA,OAAO,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5B,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAA;IAC7B,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEvC,OAAO,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACpC;;ACjLA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-pin.mjs","sources":["../../../projects/kit/components/input-pin/input-pin.component.ts","../../../projects/kit/components/input-pin/input-pin.template.html","../../../projects/kit/components/input-pin/taiga-ui-kit-components-input-pin.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n Input,\n signal,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {MaskitoDirective} from '@maskito/angular';\nimport type
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-pin.mjs","sources":["../../../projects/kit/components/input-pin/input-pin.component.ts","../../../projects/kit/components/input-pin/input-pin.template.html","../../../projects/kit/components/input-pin/taiga-ui-kit-components-input-pin.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n Input,\n signal,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {type MaskitoMask} from '@maskito/core';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsNativeFocused} from '@taiga-ui/cdk/utils/focus';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TUI_TEXTFIELD_OPTIONS,\n TuiTextfieldContent,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiAppearance} from '@taiga-ui/core/directives/appearance';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\n@Component({\n standalone: true,\n selector: 'input[tuiInputPin]',\n imports: [TuiAppearance, TuiRepeatTimes, TuiTextfieldContent],\n templateUrl: './input-pin.template.html',\n styleUrls: ['./input-pin.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [MaskitoDirective],\n host: {\n ngSkipHydration: 'true',\n inputmode: 'numeric',\n spellcheck: 'false',\n '(selectionchange)': 'onSelection()',\n '(keydown.arrowLeft)': 'onArrow()',\n },\n})\nexport class TuiInputPin {\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly mask = signal<MaskitoMask>(/^\\d+$/);\n protected readonly appearance = inject(TUI_TEXTFIELD_OPTIONS).appearance;\n protected readonly control = inject(NgControl);\n\n protected readonly maskito = tuiMaskito(\n computed(() => ({\n mask: this.mask(),\n overwriteMode: 'replace',\n })),\n );\n\n @Input('mask')\n public set maskSetter(mask: MaskitoMask | string) {\n this.mask.set(tuiIsString(mask) ? new RegExp(mask) : mask);\n }\n\n public onClick(index: number): void {\n this.el.focus();\n this.el.setSelectionRange(index, index + 1);\n }\n\n public onSelection(): void {\n if (this.el.selectionStart === this.el.maxLength) {\n this.el.setSelectionRange(this.el.maxLength - 1, this.el.maxLength);\n }\n }\n\n public onArrow(): void {\n if (\n this.el.selectionStart === this.el.maxLength - 1 &&\n this.el.selectionEnd === this.el.maxLength\n ) {\n this.el.setSelectionRange(this.el.maxLength - 2, this.el.maxLength - 2);\n }\n }\n\n public isFocused(index: number): boolean {\n return (\n tuiIsNativeFocused(this.el) &&\n (this.el.selectionStart === index ||\n (this.el.selectionStart === this.el.maxLength &&\n index === this.el.maxLength - 1))\n );\n }\n}\n","<div\n *tuiTextfieldContent\n class=\"t-wrapper\"\n>\n <label\n *tuiRepeatTimes=\"let index of el.maxLength\"\n class=\"t-item\"\n [tuiAppearance]=\"appearance()\"\n [tuiAppearanceFocus]=\"isFocused(index)\"\n [tuiAppearanceMode]=\"control.invalid && control.touched ? 'invalid' : null\"\n (pointerdown.prevent)=\"onClick(index)\"\n >\n <span\n class=\"t-value\"\n [class.t-value_filled]=\"el.value[index]\"\n [textContent]=\"el.value[index] || el.placeholder[index]\"\n ></span>\n </label>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAsBA,MAgBa,WAAW,CAAA;AAhBxB,IAAA,WAAA,GAAA;QAiBuB,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAoB,CAAC;AAC1C,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAc,OAAO,CAAC,CAAC;AACpC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,UAAU,CAAC;AACtD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;QAE5B,IAAO,CAAA,OAAA,GAAG,UAAU,CACnC,QAAQ,CAAC,OAAO;AACZ,YAAA,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;AACjB,YAAA,aAAa,EAAE,SAAS;SAC3B,CAAC,CAAC,CACN,CAAC;AAmCL,KAAA;IAjCG,IACW,UAAU,CAAC,IAA0B,EAAA;QAC5C,I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