@taiga-ui/kit 3.0.0-rc.0 → 3.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/taiga-ui-kit-components-accordion.umd.js +5 -17
- package/bundles/taiga-ui-kit-components-accordion.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.js +3 -9
- package/bundles/taiga-ui-kit-components-action.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-arrow.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-arrow.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-avatar.umd.js +3 -3
- package/bundles/taiga-ui-kit-components-avatar.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-badge.umd.js +3 -3
- package/bundles/taiga-ui-kit-components-badge.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-badged-content.umd.js +3 -6
- package/bundles/taiga-ui-kit-components-badged-content.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-breadcrumbs.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-breadcrumbs.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-calendar-month.umd.js +0 -1
- package/bundles/taiga-ui-kit-components-calendar-month.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-calendar-range.umd.js +12 -8
- package/bundles/taiga-ui-kit-components-calendar-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.js +4 -5
- package/bundles/taiga-ui-kit-components-carousel.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-block.umd.js +7 -10
- package/bundles/taiga-ui-kit-components-checkbox-block.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-labeled.umd.js +5 -9
- package/bundles/taiga-ui-kit-components-checkbox-labeled.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox.umd.js +5 -9
- package/bundles/taiga-ui-kit-components-checkbox.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.js +21 -41
- package/bundles/taiga-ui-kit-components-combo-box.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.js +5 -26
- package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.js +1 -2
- package/bundles/taiga-ui-kit-components-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-filter.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-filter.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-copy.umd.js +21 -36
- package/bundles/taiga-ui-kit-components-input-copy.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-count.umd.js +12 -35
- package/bundles/taiga-ui-kit-components-input-count.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-range.umd.js +19 -42
- package/bundles/taiga-ui-kit-components-input-date-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-time.umd.js +18 -42
- package/bundles/taiga-ui-kit-components-input-date-time.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date.umd.js +17 -41
- package/bundles/taiga-ui-kit-components-input-date.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-files.umd.js +4 -17
- package/bundles/taiga-ui-kit-components-input-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-inline.umd.js +2 -8
- package/bundles/taiga-ui-kit-components-input-inline.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.js +19 -37
- package/bundles/taiga-ui-kit-components-input-month-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month.umd.js +19 -37
- package/bundles/taiga-ui-kit-components-input-month.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.js +14 -37
- package/bundles/taiga-ui-kit-components-input-number.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-password.umd.js +29 -56
- package/bundles/taiga-ui-kit-components-input-password.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-phone-international.umd.js +38 -51
- package/bundles/taiga-ui-kit-components-input-phone-international.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-phone.umd.js +30 -57
- package/bundles/taiga-ui-kit-components-input-phone.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.js +17 -13
- package/bundles/taiga-ui-kit-components-input-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.js +14 -12
- package/bundles/taiga-ui-kit-components-input-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.js +33 -50
- package/bundles/taiga-ui-kit-components-input-tag.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-time.umd.js +8 -15
- package/bundles/taiga-ui-kit-components-input-time.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input.umd.js +16 -33
- package/bundles/taiga-ui-kit-components-input.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-line-clamp.umd.js +108 -18
- package/bundles/taiga-ui-kit-components-line-clamp.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-marker-icon.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-marker-icon.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select-option.umd.js +3 -3
- package/bundles/taiga-ui-kit-components-multi-select-option.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.js +34 -69
- package/bundles/taiga-ui-kit-components-multi-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pagination.umd.js +10 -23
- package/bundles/taiga-ui-kit-components-pagination.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.js +2 -15
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-progress.umd.js +5 -15
- package/bundles/taiga-ui-kit-components-progress.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-block.umd.js +7 -10
- package/bundles/taiga-ui-kit-components-radio-block.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-labeled.umd.js +5 -9
- package/bundles/taiga-ui-kit-components-radio-labeled.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-list.umd.js +5 -9
- package/bundles/taiga-ui-kit-components-radio-list.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.js +5 -10
- package/bundles/taiga-ui-kit-components-radio.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-range.umd.js +40 -86
- package/bundles/taiga-ui-kit-components-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-rating.umd.js +4 -8
- package/bundles/taiga-ui-kit-components-rating.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select-option.umd.js +5 -5
- package/bundles/taiga-ui-kit-components-select-option.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.js +20 -40
- package/bundles/taiga-ui-kit-components-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.js +40 -38
- package/bundles/taiga-ui-kit-components-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-stepper.umd.js +9 -7
- package/bundles/taiga-ui-kit-components-stepper.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tabs.umd.js +40 -40
- package/bundles/taiga-ui-kit-components-tabs.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tag.umd.js +6 -17
- package/bundles/taiga-ui-kit-components-tag.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-text-area.umd.js +18 -31
- package/bundles/taiga-ui-kit-components-text-area.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-toggle.umd.js +5 -9
- package/bundles/taiga-ui-kit-components-toggle.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tree.umd.js +2 -8
- package/bundles/taiga-ui-kit-components-tree.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-constants.umd.js +334 -3
- package/bundles/taiga-ui-kit-constants.umd.js.map +1 -1
- package/bundles/{taiga-ui-kit-directives-dropdown-context.umd.js → taiga-ui-kit-directives-data-list-dropdown-manager.umd.js} +117 -141
- package/bundles/taiga-ui-kit-directives-data-list-dropdown-manager.umd.js.map +1 -0
- package/bundles/taiga-ui-kit-directives-highlight.umd.js +0 -1
- package/bundles/taiga-ui-kit-directives-highlight.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-lazy-loading.umd.js +2 -2
- package/bundles/taiga-ui-kit-directives-lazy-loading.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-present.umd.js +2 -2
- package/bundles/taiga-ui-kit-directives-present.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-project-class.umd.js +0 -3
- package/bundles/taiga-ui-kit-directives-project-class.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives.umd.js +6 -18
- package/bundles/taiga-ui-kit-directives.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.js +4 -4
- package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-pipes-field-error.umd.js +0 -2
- package/bundles/taiga-ui-kit-pipes-field-error.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-pipes-filter-by-input.umd.js +3 -3
- package/bundles/taiga-ui-kit-pipes-filter-by-input.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-providers.umd.js +11 -42
- package/bundles/taiga-ui-kit-providers.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-tokens.umd.js +17 -12
- package/bundles/taiga-ui-kit-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-files.umd.js +3 -15
- package/bundles/taiga-ui-kit-utils-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-format.umd.js +1 -5
- package/bundles/taiga-ui-kit-utils-format.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-mask.umd.js +3 -9
- package/bundles/taiga-ui-kit-utils-mask.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-math.umd.js +1 -1
- package/bundles/taiga-ui-kit-utils-math.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-miscellaneous.umd.js +1 -5
- package/bundles/taiga-ui-kit-utils-miscellaneous.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils.umd.js +4 -10
- package/bundles/taiga-ui-kit-utils.umd.js.map +1 -1
- package/components/badge/badge.component.d.ts +2 -2
- package/components/badged-content/badged-content.component.d.ts +2 -2
- package/components/combo-box/index.d.ts +0 -1
- package/components/filter/filter.component.d.ts +1 -1
- package/components/input/index.d.ts +0 -1
- package/components/input-copy/index.d.ts +0 -1
- package/components/input-copy/input-copy.component.d.ts +4 -4
- package/components/input-date/index.d.ts +0 -1
- package/components/input-date-range/index.d.ts +0 -1
- package/components/input-date-time/index.d.ts +0 -1
- package/components/input-month/index.d.ts +0 -1
- package/components/input-month-range/index.d.ts +0 -1
- package/components/input-password/input-password.component.d.ts +2 -2
- package/components/input-password/input-password.module.d.ts +2 -3
- package/components/input-phone/index.d.ts +0 -1
- package/components/input-phone/input-phone.component.d.ts +2 -2
- package/components/input-phone-international/utils/extract-value-from-event.d.ts +1 -5
- package/components/input-range/input-range.component.d.ts +1 -0
- package/components/input-slider/input-slider.component.d.ts +1 -0
- package/components/input-tag/input-tag-options.d.ts +4 -1
- package/components/input-tag/input-tag.component.d.ts +3 -5
- package/components/line-clamp/index.d.ts +1 -0
- package/components/line-clamp/line-clamp-box.component.d.ts +7 -0
- package/components/line-clamp/line-clamp-position.directive.d.ts +9 -0
- package/components/line-clamp/line-clamp.module.d.ts +7 -5
- package/components/multi-select/multi-select-group/multi-select-group.directive.d.ts +0 -3
- package/components/pagination/pagination.component.d.ts +0 -1
- package/components/progress/progress-segmented/progress-segmented.component.d.ts +0 -2
- package/components/range/range.component.d.ts +7 -23
- package/components/select/index.d.ts +0 -1
- package/components/slider/helpers/slider-key-steps.directive.d.ts +1 -3
- package/components/slider/slider.component.d.ts +5 -3
- package/components/stepper/step/step.component.d.ts +2 -2
- package/components/tabs/tab/tab.providers.d.ts +1 -4
- package/components/tabs/tabs-with-more/tabs-with-more.component.d.ts +2 -1
- package/components/tabs/tabs-with-more/tabs-with-more.providers.d.ts +3 -4
- package/components/tag/tag.component.d.ts +1 -3
- package/components/text-area/index.d.ts +0 -1
- package/components/tree/components/tree-item/tree-item.providers.d.ts +0 -1
- package/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.d.ts +15 -0
- package/directives/data-list-dropdown-manager/data-list-dropdown-manager.module.d.ts +7 -0
- package/directives/data-list-dropdown-manager/index.d.ts +2 -0
- package/directives/data-list-dropdown-manager/package.json +10 -0
- package/directives/data-list-dropdown-manager/taiga-ui-kit-directives-data-list-dropdown-manager.d.ts +5 -0
- package/directives/index.d.ts +1 -3
- package/esm2015/components/accordion/accordion-item/accordion-item.component.js +5 -17
- package/esm2015/components/accordion/accordion.component.js +5 -5
- package/esm2015/components/action/action.component.js +6 -12
- package/esm2015/components/arrow/arrow.component.js +3 -3
- package/esm2015/components/avatar/avatar.component.js +6 -6
- package/esm2015/components/badge/badge.component.js +6 -6
- package/esm2015/components/badged-content/badged-content.component.js +4 -7
- package/esm2015/components/breadcrumbs/breadcrumbs.component.js +2 -2
- package/esm2015/components/calendar-month/calendar-month.component.js +1 -2
- package/esm2015/components/calendar-range/calendar-range.component.js +12 -11
- package/esm2015/components/carousel/carousel-scroll.directive.js +3 -3
- package/esm2015/components/carousel/carousel.component.js +4 -5
- package/esm2015/components/carousel/carousel.directive.js +3 -3
- package/esm2015/components/checkbox/checkbox.component.js +8 -12
- package/esm2015/components/checkbox-block/checkbox-block.component.js +10 -13
- package/esm2015/components/checkbox-labeled/checkbox-labeled.component.js +8 -12
- package/esm2015/components/combo-box/combo-box.component.js +20 -8
- package/esm2015/components/combo-box/combo-box.directive.js +5 -15
- package/esm2015/components/combo-box/index.js +1 -2
- package/esm2015/components/data-list-wrapper/data-list-group-wrapper.component.js +5 -15
- package/esm2015/components/data-list-wrapper/data-list-wrapper.component.js +5 -15
- package/esm2015/components/data-list-wrapper/data-list-wrapper.js +3 -4
- package/esm2015/components/files/file/file.component.js +3 -4
- package/esm2015/components/filter/filter.component.js +2 -2
- package/esm2015/components/input/index.js +1 -2
- package/esm2015/components/input/input.component.js +18 -7
- package/esm2015/components/input/input.directive.js +5 -15
- package/esm2015/components/input-copy/index.js +1 -2
- package/esm2015/components/input-copy/input-copy.component.js +18 -10
- package/esm2015/components/input-copy/input-copy.directive.js +5 -15
- package/esm2015/components/input-count/input-count.component.js +14 -27
- package/esm2015/components/input-count/input-count.directive.js +5 -15
- package/esm2015/components/input-date/index.js +1 -2
- package/esm2015/components/input-date/input-date.component.js +15 -9
- package/esm2015/components/input-date/input-date.directive.js +5 -15
- package/esm2015/components/input-date-range/index.js +1 -2
- package/esm2015/components/input-date-range/input-date-range.component.js +18 -11
- package/esm2015/components/input-date-range/input-date-range.directive.js +5 -15
- package/esm2015/components/input-date-time/index.js +1 -2
- package/esm2015/components/input-date-time/input-date-time.component.js +16 -10
- package/esm2015/components/input-date-time/input-date-time.directive.js +5 -15
- package/esm2015/components/input-files/input-files.component.js +8 -21
- package/esm2015/components/input-inline/input-inline.component.js +5 -11
- package/esm2015/components/input-month/index.js +1 -2
- package/esm2015/components/input-month/input-month.component.js +17 -8
- package/esm2015/components/input-month/input-month.directive.js +5 -17
- package/esm2015/components/input-month-range/index.js +1 -2
- package/esm2015/components/input-month-range/input-month-range.component.js +17 -8
- package/esm2015/components/input-month-range/input-month-range.directive.js +5 -17
- package/esm2015/components/input-number/input-number.component.js +16 -29
- package/esm2015/components/input-number/input-number.directive.js +5 -15
- package/esm2015/components/input-password/input-password.component.js +18 -32
- package/esm2015/components/input-password/input-password.directive.js +5 -15
- package/esm2015/components/input-password/input-password.module.js +1 -5
- package/esm2015/components/input-phone/index.js +1 -2
- package/esm2015/components/input-phone/input-phone.component.js +28 -14
- package/esm2015/components/input-phone/input-phone.directive.js +5 -15
- package/esm2015/components/input-phone-international/input-phone-international.component.js +16 -22
- package/esm2015/components/input-phone-international/utils/extract-value-from-event.js +5 -11
- package/esm2015/components/input-range/input-range.component.js +20 -16
- package/esm2015/components/input-slider/input-slider.component.js +13 -15
- package/esm2015/components/input-tag/input-tag-options.js +8 -1
- package/esm2015/components/input-tag/input-tag.component.js +24 -54
- package/esm2015/components/input-time/input-time.component.js +11 -18
- package/esm2015/components/line-clamp/index.js +2 -1
- package/esm2015/components/line-clamp/line-clamp-box.component.js +32 -0
- package/esm2015/components/line-clamp/line-clamp-position.directive.js +26 -0
- package/esm2015/components/line-clamp/line-clamp.component.js +22 -9
- package/esm2015/components/line-clamp/line-clamp.module.js +30 -6
- package/esm2015/components/marker-icon/marker-icon.component.js +2 -2
- package/esm2015/components/multi-select/multi-select-group/multi-select-group.component.js +11 -21
- package/esm2015/components/multi-select/multi-select-group/multi-select-group.directive.js +17 -28
- package/esm2015/components/multi-select/multi-select.component.js +15 -30
- package/esm2015/components/multi-select-option/multi-select-option.component.js +6 -6
- package/esm2015/components/pagination/pagination.component.js +13 -25
- package/esm2015/components/pdf-viewer/pdf-viewer.module.js +4 -17
- package/esm2015/components/progress/progress-bar/progress-color-segments.directive.js +4 -4
- package/esm2015/components/progress/progress-circle/progress-circle.component.js +2 -2
- package/esm2015/components/progress/progress-segmented/progress-segmented.component.js +3 -11
- package/esm2015/components/radio/radio.component.js +8 -13
- package/esm2015/components/radio-block/radio-block.component.js +10 -13
- package/esm2015/components/radio-labeled/radio-labeled.component.js +8 -12
- package/esm2015/components/radio-list/radio-list.component.js +8 -12
- package/esm2015/components/range/range-change.directive.js +10 -9
- package/esm2015/components/range/range.component.js +27 -79
- package/esm2015/components/rating/rating.component.js +7 -11
- package/esm2015/components/select/index.js +1 -2
- package/esm2015/components/select/select.component.js +19 -7
- package/esm2015/components/select/select.directive.js +5 -15
- package/esm2015/components/select-option/select-option.component.js +7 -7
- package/esm2015/components/slider/helpers/slider-key-steps.directive.js +14 -22
- package/esm2015/components/slider/helpers/slider-readonly.directive.js +5 -6
- package/esm2015/components/slider/slider.component.js +21 -10
- package/esm2015/components/stepper/step/step.component.js +5 -5
- package/esm2015/components/stepper/stepper.component.js +7 -5
- package/esm2015/components/tabs/tab/tab.providers.js +10 -10
- package/esm2015/components/tabs/tabs/tabs.component.js +1 -2
- package/esm2015/components/tabs/tabs-with-more/tabs-with-more.component.js +18 -17
- package/esm2015/components/tabs/tabs-with-more/tabs-with-more.providers.js +9 -11
- package/esm2015/components/tag/tag.component.js +10 -20
- package/esm2015/components/text-area/index.js +1 -2
- package/esm2015/components/text-area/text-area.component.js +19 -8
- package/esm2015/components/text-area/text-area.directive.js +5 -15
- package/esm2015/components/toggle/toggle.component.js +8 -12
- package/esm2015/components/tree/components/tree-item/tree-item.providers.js +2 -6
- package/esm2015/components/tree/directives/tree-controller.directive.js +3 -3
- package/esm2015/components/tree/misc/tree.service.js +1 -2
- package/esm2015/constants/max-day-range-length-mapper.js +5 -4
- package/esm2015/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.js +100 -0
- package/esm2015/directives/data-list-dropdown-manager/data-list-dropdown-manager.module.js +16 -0
- package/esm2015/directives/data-list-dropdown-manager/index.js +3 -0
- package/esm2015/directives/data-list-dropdown-manager/taiga-ui-kit-directives-data-list-dropdown-manager.js +5 -0
- package/esm2015/directives/highlight/highlight.directive.js +1 -2
- package/esm2015/directives/index.js +2 -4
- package/esm2015/directives/lazy-loading/lazy-loading.directive.js +2 -2
- package/esm2015/directives/lazy-loading/lazy-loading.service.js +3 -3
- package/esm2015/directives/present/present.directive.js +4 -4
- package/esm2015/directives/project-class/project-class.directive.js +1 -4
- package/esm2015/interfaces/index.js +1 -2
- package/esm2015/internal/primitive-calendar-range/primitive-calendar-range.component.js +7 -7
- package/esm2015/pipes/field-error/field-error-content-pipe.js +1 -2
- package/esm2015/pipes/field-error/field-error-pipe.js +1 -2
- package/esm2015/pipes/filter-by-input/filter-by-input.base.js +5 -5
- package/esm2015/providers/month-formatter.provider.js +8 -13
- package/esm2015/providers/specific-dropdown-controllers.js +6 -29
- package/esm2015/tokens/calendar-date-stream.js +15 -0
- package/esm2015/tokens/index.js +2 -3
- package/esm2015/utils/files/format-size.js +4 -9
- package/esm2015/utils/files/get-accept-array.js +2 -7
- package/esm2015/utils/format/string-hash-to-hsl.js +2 -5
- package/esm2015/utils/index.js +1 -2
- package/esm2015/utils/mask/create-auto-corrected-date-pipe.js +3 -8
- package/esm2015/utils/mask/create-auto-corrected-date-time-pipe.js +3 -3
- package/esm2015/utils/math/key-steps.js +3 -3
- package/esm2015/utils/miscellaneous/get-precision.js +2 -5
- package/fesm2015/taiga-ui-kit-components-accordion.js +7 -19
- package/fesm2015/taiga-ui-kit-components-accordion.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-action.js +5 -11
- package/fesm2015/taiga-ui-kit-components-action.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-arrow.js +2 -2
- package/fesm2015/taiga-ui-kit-components-arrow.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-avatar.js +5 -5
- package/fesm2015/taiga-ui-kit-components-avatar.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-badge.js +4 -4
- package/fesm2015/taiga-ui-kit-components-badge.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-badged-content.js +3 -6
- package/fesm2015/taiga-ui-kit-components-badged-content.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-breadcrumbs.js +1 -1
- package/fesm2015/taiga-ui-kit-components-breadcrumbs.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-calendar-month.js +0 -1
- package/fesm2015/taiga-ui-kit-components-calendar-month.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-calendar-range.js +12 -11
- package/fesm2015/taiga-ui-kit-components-calendar-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-carousel.js +5 -6
- package/fesm2015/taiga-ui-kit-components-carousel.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox-block.js +9 -12
- package/fesm2015/taiga-ui-kit-components-checkbox-block.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox-labeled.js +7 -11
- package/fesm2015/taiga-ui-kit-components-checkbox-labeled.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox.js +7 -11
- package/fesm2015/taiga-ui-kit-components-checkbox.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-combo-box.js +22 -41
- package/fesm2015/taiga-ui-kit-components-combo-box.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-data-list-wrapper.js +7 -28
- package/fesm2015/taiga-ui-kit-components-data-list-wrapper.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-files.js +2 -3
- package/fesm2015/taiga-ui-kit-components-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-filter.js +1 -1
- package/fesm2015/taiga-ui-kit-components-filter.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-copy.js +22 -36
- package/fesm2015/taiga-ui-kit-components-input-copy.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-count.js +15 -38
- package/fesm2015/taiga-ui-kit-components-input-count.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-range.js +20 -44
- package/fesm2015/taiga-ui-kit-components-input-date-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-time.js +19 -44
- package/fesm2015/taiga-ui-kit-components-input-date-time.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date.js +18 -43
- package/fesm2015/taiga-ui-kit-components-input-date.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-files.js +7 -20
- package/fesm2015/taiga-ui-kit-components-input-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-inline.js +4 -10
- package/fesm2015/taiga-ui-kit-components-input-inline.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month-range.js +20 -37
- package/fesm2015/taiga-ui-kit-components-input-month-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month.js +20 -37
- package/fesm2015/taiga-ui-kit-components-input-month.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-number.js +17 -40
- package/fesm2015/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-password.js +20 -47
- package/fesm2015/taiga-ui-kit-components-input-password.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone-international.js +18 -30
- package/fesm2015/taiga-ui-kit-components-input-phone-international.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone.js +31 -57
- package/fesm2015/taiga-ui-kit-components-input-phone.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-range.js +19 -15
- package/fesm2015/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-slider.js +12 -14
- package/fesm2015/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-tag.js +33 -55
- package/fesm2015/taiga-ui-kit-components-input-tag.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-time.js +10 -17
- package/fesm2015/taiga-ui-kit-components-input-time.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input.js +20 -36
- package/fesm2015/taiga-ui-kit-components-input.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-line-clamp.js +96 -14
- package/fesm2015/taiga-ui-kit-components-line-clamp.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-marker-icon.js +1 -1
- package/fesm2015/taiga-ui-kit-components-marker-icon.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select-option.js +5 -5
- package/fesm2015/taiga-ui-kit-components-multi-select-option.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select.js +37 -73
- package/fesm2015/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-pagination.js +13 -25
- package/fesm2015/taiga-ui-kit-components-pagination.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-pdf-viewer.js +3 -16
- package/fesm2015/taiga-ui-kit-components-pdf-viewer.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-progress.js +7 -15
- package/fesm2015/taiga-ui-kit-components-progress.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio-block.js +9 -12
- package/fesm2015/taiga-ui-kit-components-radio-block.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio-labeled.js +7 -11
- package/fesm2015/taiga-ui-kit-components-radio-labeled.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio-list.js +7 -11
- package/fesm2015/taiga-ui-kit-components-radio-list.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio.js +7 -12
- package/fesm2015/taiga-ui-kit-components-radio.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-range.js +38 -86
- package/fesm2015/taiga-ui-kit-components-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-rating.js +6 -10
- package/fesm2015/taiga-ui-kit-components-rating.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-select-option.js +6 -6
- package/fesm2015/taiga-ui-kit-components-select-option.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-select.js +21 -40
- package/fesm2015/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-slider.js +34 -32
- package/fesm2015/taiga-ui-kit-components-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-stepper.js +10 -8
- package/fesm2015/taiga-ui-kit-components-stepper.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tabs.js +33 -35
- package/fesm2015/taiga-ui-kit-components-tabs.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tag.js +10 -20
- package/fesm2015/taiga-ui-kit-components-tag.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-text-area.js +22 -34
- package/fesm2015/taiga-ui-kit-components-text-area.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-toggle.js +7 -11
- package/fesm2015/taiga-ui-kit-components-toggle.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tree.js +4 -9
- package/fesm2015/taiga-ui-kit-components-tree.js.map +1 -1
- package/fesm2015/taiga-ui-kit-constants.js +4 -3
- package/fesm2015/taiga-ui-kit-constants.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-data-list-dropdown-manager.js +120 -0
- package/fesm2015/taiga-ui-kit-directives-data-list-dropdown-manager.js.map +1 -0
- package/fesm2015/taiga-ui-kit-directives-highlight.js +0 -1
- package/fesm2015/taiga-ui-kit-directives-highlight.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-lazy-loading.js +3 -3
- package/fesm2015/taiga-ui-kit-directives-lazy-loading.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-present.js +3 -3
- package/fesm2015/taiga-ui-kit-directives-present.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-project-class.js +0 -3
- package/fesm2015/taiga-ui-kit-directives-project-class.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives.js +1 -3
- package/fesm2015/taiga-ui-kit-directives.js.map +1 -1
- package/fesm2015/taiga-ui-kit-internal-primitive-calendar-range.js +6 -6
- package/fesm2015/taiga-ui-kit-internal-primitive-calendar-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-pipes-field-error.js +0 -2
- package/fesm2015/taiga-ui-kit-pipes-field-error.js.map +1 -1
- package/fesm2015/taiga-ui-kit-pipes-filter-by-input.js +4 -4
- package/fesm2015/taiga-ui-kit-pipes-filter-by-input.js.map +1 -1
- package/fesm2015/taiga-ui-kit-providers.js +13 -40
- package/fesm2015/taiga-ui-kit-providers.js.map +1 -1
- package/fesm2015/taiga-ui-kit-tokens.js +15 -8
- package/fesm2015/taiga-ui-kit-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-files.js +5 -15
- package/fesm2015/taiga-ui-kit-utils-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-format.js +2 -5
- package/fesm2015/taiga-ui-kit-utils-format.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-mask.js +4 -9
- package/fesm2015/taiga-ui-kit-utils-mask.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-math.js +2 -2
- package/fesm2015/taiga-ui-kit-utils-math.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-miscellaneous.js +2 -5
- package/fesm2015/taiga-ui-kit-utils-miscellaneous.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils.js +0 -1
- package/fesm2015/taiga-ui-kit-utils.js.map +1 -1
- package/interfaces/index.d.ts +0 -1
- package/package.json +5 -5
- package/providers/month-formatter.provider.d.ts +0 -7
- package/providers/specific-dropdown-controllers.d.ts +1 -6
- package/tokens/calendar-date-stream.d.ts +5 -0
- package/tokens/index.d.ts +1 -2
- package/tokens/validation-errors.d.ts +1 -1
- package/utils/files/format-size.d.ts +1 -5
- package/utils/files/get-accept-array.d.ts +1 -5
- package/utils/format/string-hash-to-hsl.d.ts +1 -3
- package/utils/index.d.ts +0 -1
- package/utils/mask/create-auto-corrected-date-pipe.d.ts +1 -5
- package/utils/miscellaneous/get-precision.d.ts +1 -3
- package/abstract/index.d.ts +0 -1
- package/abstract/package.json +0 -10
- package/abstract/slider/slider.d.ts +0 -69
- package/abstract/taiga-ui-kit-abstract.d.ts +0 -5
- package/bundles/taiga-ui-kit-abstract.umd.js +0 -651
- package/bundles/taiga-ui-kit-abstract.umd.js.map +0 -1
- package/bundles/taiga-ui-kit-directives-dropdown-context.umd.js.map +0 -1
- package/bundles/taiga-ui-kit-directives-dropdown-hover.umd.js +0 -107
- package/bundles/taiga-ui-kit-directives-dropdown-hover.umd.js.map +0 -1
- package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.js +0 -643
- package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.js.map +0 -1
- package/bundles/taiga-ui-kit-utils-dom.umd.js +0 -124
- package/bundles/taiga-ui-kit-utils-dom.umd.js.map +0 -1
- package/components/combo-box/combo-box.providers.d.ts +0 -1
- package/components/input/input.providers.d.ts +0 -1
- package/components/input-copy/input-copy.providers.d.ts +0 -2
- package/components/input-date/input-date.providers.d.ts +0 -1
- package/components/input-date-range/input-date-range.providers.d.ts +0 -1
- package/components/input-date-time/input-date-time.providers.d.ts +0 -1
- package/components/input-month/input-month.providers.d.ts +0 -2
- package/components/input-month-range/input-month-range.providers.d.ts +0 -2
- package/components/input-phone/input-phone.providers.d.ts +0 -5
- package/components/select/select.providers.d.ts +0 -1
- package/components/text-area/text-area.providers.d.ts +0 -2
- package/directives/dropdown-context/dropdown-context.directive.d.ts +0 -30
- package/directives/dropdown-context/dropdown-context.module.d.ts +0 -8
- package/directives/dropdown-context/index.d.ts +0 -2
- package/directives/dropdown-context/package.json +0 -10
- package/directives/dropdown-context/taiga-ui-kit-directives-dropdown-context.d.ts +0 -5
- package/directives/dropdown-hover/dropdown-hover.directive.d.ts +0 -11
- package/directives/dropdown-hover/dropdown-hover.module.d.ts +0 -7
- package/directives/dropdown-hover/index.d.ts +0 -2
- package/directives/dropdown-hover/package.json +0 -10
- package/directives/dropdown-hover/taiga-ui-kit-directives-dropdown-hover.d.ts +0 -5
- package/directives/dropdown-selection/dropdown-selection.directive.d.ts +0 -46
- package/directives/dropdown-selection/dropdown-selection.module.d.ts +0 -8
- package/directives/dropdown-selection/index.d.ts +0 -2
- package/directives/dropdown-selection/package.json +0 -10
- package/directives/dropdown-selection/taiga-ui-kit-directives-dropdown-selection.d.ts +0 -5
- package/esm2015/abstract/index.js +0 -2
- package/esm2015/abstract/slider/slider.js +0 -264
- package/esm2015/abstract/taiga-ui-kit-abstract.js +0 -5
- package/esm2015/components/combo-box/combo-box.providers.js +0 -26
- package/esm2015/components/input/input.providers.js +0 -22
- package/esm2015/components/input-copy/input-copy.providers.js +0 -16
- package/esm2015/components/input-date/input-date.providers.js +0 -27
- package/esm2015/components/input-date-range/input-date-range.providers.js +0 -27
- package/esm2015/components/input-date-time/input-date-time.providers.js +0 -27
- package/esm2015/components/input-month/input-month.providers.js +0 -19
- package/esm2015/components/input-month-range/input-month-range.providers.js +0 -19
- package/esm2015/components/input-phone/input-phone.providers.js +0 -35
- package/esm2015/components/select/select.providers.js +0 -26
- package/esm2015/components/text-area/text-area.providers.js +0 -18
- package/esm2015/directives/dropdown-context/dropdown-context.directive.js +0 -141
- package/esm2015/directives/dropdown-context/dropdown-context.module.js +0 -18
- package/esm2015/directives/dropdown-context/index.js +0 -3
- package/esm2015/directives/dropdown-context/taiga-ui-kit-directives-dropdown-context.js +0 -5
- package/esm2015/directives/dropdown-hover/dropdown-hover.directive.js +0 -56
- package/esm2015/directives/dropdown-hover/dropdown-hover.module.js +0 -16
- package/esm2015/directives/dropdown-hover/index.js +0 -3
- package/esm2015/directives/dropdown-hover/taiga-ui-kit-directives-dropdown-hover.js +0 -5
- package/esm2015/directives/dropdown-selection/dropdown-selection.directive.js +0 -252
- package/esm2015/directives/dropdown-selection/dropdown-selection.module.js +0 -18
- package/esm2015/directives/dropdown-selection/index.js +0 -3
- package/esm2015/directives/dropdown-selection/taiga-ui-kit-directives-dropdown-selection.js +0 -5
- package/esm2015/interfaces/bread-crumbs-item.js +0 -2
- package/esm2015/tokens/calendar-data-stream.js +0 -3
- package/esm2015/tokens/tag-status.js +0 -6
- package/esm2015/utils/dom/get-word-range.js +0 -53
- package/esm2015/utils/dom/index.js +0 -4
- package/esm2015/utils/dom/scroll-to-element.js +0 -23
- package/esm2015/utils/dom/set-range-offset.js +0 -29
- package/esm2015/utils/dom/taiga-ui-kit-utils-dom.js +0 -5
- package/fesm2015/taiga-ui-kit-abstract.js +0 -271
- package/fesm2015/taiga-ui-kit-abstract.js.map +0 -1
- package/fesm2015/taiga-ui-kit-directives-dropdown-context.js +0 -162
- package/fesm2015/taiga-ui-kit-directives-dropdown-context.js.map +0 -1
- package/fesm2015/taiga-ui-kit-directives-dropdown-hover.js +0 -76
- package/fesm2015/taiga-ui-kit-directives-dropdown-hover.js.map +0 -1
- package/fesm2015/taiga-ui-kit-directives-dropdown-selection.js +0 -273
- package/fesm2015/taiga-ui-kit-directives-dropdown-selection.js.map +0 -1
- package/fesm2015/taiga-ui-kit-utils-dom.js +0 -111
- package/fesm2015/taiga-ui-kit-utils-dom.js.map +0 -1
- package/interfaces/bread-crumbs-item.d.ts +0 -6
- package/tokens/calendar-data-stream.d.ts +0 -4
- package/tokens/tag-status.d.ts +0 -3
- package/utils/dom/get-word-range.d.ts +0 -9
- package/utils/dom/index.d.ts +0 -3
- package/utils/dom/package.json +0 -10
- package/utils/dom/scroll-to-element.d.ts +0 -5
- package/utils/dom/set-range-offset.d.ts +0 -6
- package/utils/dom/taiga-ui-kit-utils-dom.d.ts +0 -5
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { ElementRef, Component, ChangeDetectionStrategy, Inject, NgModule } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/forms';
|
|
4
4
|
import { NgControl } from '@angular/forms';
|
|
5
|
-
import {
|
|
5
|
+
import { tuiTypedFromEvent, TUI_DEFAULT_IDENTITY_MATCHER, tuiIsPresent } from '@taiga-ui/cdk';
|
|
6
6
|
import * as i1 from '@taiga-ui/core';
|
|
7
7
|
import { TUI_DATA_LIST_HOST, TuiOptionComponent, TuiSvgModule, TuiScrollIntoViewModule } from '@taiga-ui/core';
|
|
8
8
|
import { POLYMORPHEUS_CONTEXT, PolymorpheusComponent } from '@tinkoff/ng-polymorpheus';
|
|
@@ -18,7 +18,7 @@ class TuiSelectOptionComponent {
|
|
|
18
18
|
this.elementRef = elementRef;
|
|
19
19
|
this.option = option;
|
|
20
20
|
this.control = control;
|
|
21
|
-
this.selected$ = merge(this.control.valueChanges || EMPTY,
|
|
21
|
+
this.selected$ = merge(this.control.valueChanges || EMPTY, tuiTypedFromEvent(this.elementRef.nativeElement, `animationstart`)).pipe(startWith(null), map(() => this.selected), distinctUntilChanged());
|
|
22
22
|
}
|
|
23
23
|
get matcher() {
|
|
24
24
|
return this.host.identityMatcher || TUI_DEFAULT_IDENTITY_MATCHER;
|
|
@@ -32,19 +32,19 @@ class TuiSelectOptionComponent {
|
|
|
32
32
|
*/
|
|
33
33
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
34
34
|
Promise.resolve().then(() => {
|
|
35
|
-
if (
|
|
35
|
+
if (tuiIsPresent(this.option.value) && this.host.checkOption) {
|
|
36
36
|
this.host.checkOption(this.option.value);
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
get selected() {
|
|
41
|
-
return (
|
|
42
|
-
|
|
41
|
+
return (tuiIsPresent(this.option.value) &&
|
|
42
|
+
tuiIsPresent(this.control.value) &&
|
|
43
43
|
this.matcher(this.control.value, this.option.value));
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
TuiSelectOptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSelectOptionComponent, deps: [{ token: POLYMORPHEUS_CONTEXT }, { token: TUI_DATA_LIST_HOST }, { token: ElementRef }, { token: TuiOptionComponent }, { token: NgControl }], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
-
TuiSelectOptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiSelectOptionComponent, selector: "tui-select-option", ngImport: i0, template: "<ng-container [ngTemplateOutlet]=\"context.$implicit\"></ng-container>\n<tui-svg\n *ngIf=\"selected$ | async; else dummy\"\n automation-id=\"tui-select-option__checkmark\"\n src=\"tuiIconCheckLarge\"\n class=\"checkmark\"\n [tuiScrollIntoView]=\"true\"\n></tui-svg>\n<ng-template #dummy>\n <span class=\"dummy\"></span>\n</ng-template>\n", styles: ["@-webkit-keyframes retrigger{0%{left:1px}to{left:2px}}@keyframes retrigger{0%{left:1px}to{left:2px}}:host{display:flex;flex:1;align-items:center;max-width:100%;-webkit-animation:retrigger 1s;animation:retrigger 1s}.checkmark{margin:0 -.375rem 0 auto;border-left:5px solid transparent}.dummy{width:1.5rem}\n"], components: [{ type: i1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.TuiScrollIntoViewDirective, selector: "[tuiScrollIntoView]", inputs: ["tuiScrollIntoView"] }], pipes: { "async": i2.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
47
|
+
TuiSelectOptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiSelectOptionComponent, selector: "tui-select-option", ngImport: i0, template: "<ng-container [ngTemplateOutlet]=\"context.$implicit\"></ng-container>\n<tui-svg\n *ngIf=\"selected$ | async; else dummy\"\n automation-id=\"tui-select-option__checkmark\"\n src=\"tuiIconCheckLarge\"\n class=\"t-checkmark\"\n [tuiScrollIntoView]=\"true\"\n></tui-svg>\n<ng-template #dummy>\n <span class=\"t-dummy\"></span>\n</ng-template>\n", styles: ["@-webkit-keyframes retrigger{0%{left:1px}to{left:2px}}@keyframes retrigger{0%{left:1px}to{left:2px}}:host{display:flex;flex:1;align-items:center;max-width:100%;-webkit-animation:retrigger 1s;animation:retrigger 1s}.t-checkmark{margin:0 -.375rem 0 auto;border-left:5px solid transparent}.t-dummy{width:1.5rem}\n"], components: [{ type: i1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.TuiScrollIntoViewDirective, selector: "[tuiScrollIntoView]", inputs: ["tuiScrollIntoView"] }], pipes: { "async": i2.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
48
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSelectOptionComponent, decorators: [{
|
|
49
49
|
type: Component,
|
|
50
50
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-select-option.js","sources":["../../../projects/kit/components/select-option/select-option.component.ts","../../../projects/kit/components/select-option/select-option.template.html","../../../projects/kit/components/select-option/select-option.module.ts","../../../projects/kit/components/select-option/taiga-ui-kit-components-select-option.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n OnInit,\n TemplateRef,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-select-option.js","sources":["../../../projects/kit/components/select-option/select-option.component.ts","../../../projects/kit/components/select-option/select-option.template.html","../../../projects/kit/components/select-option/select-option.module.ts","../../../projects/kit/components/select-option/taiga-ui-kit-components-select-option.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n OnInit,\n TemplateRef,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n TUI_DEFAULT_IDENTITY_MATCHER,\n TuiContextWithImplicit,\n TuiIdentityMatcher,\n tuiIsPresent,\n tuiTypedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TUI_DATA_LIST_HOST, TuiDataListHost, TuiOptionComponent} from '@taiga-ui/core';\nimport {POLYMORPHEUS_CONTEXT, PolymorpheusComponent} from '@tinkoff/ng-polymorpheus';\nimport {EMPTY, merge} from 'rxjs';\nimport {distinctUntilChanged, map, startWith} from 'rxjs/operators';\n\n@Component({\n selector: `tui-select-option`,\n templateUrl: `./select-option.template.html`,\n styleUrls: [`./select-option.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiSelectOptionComponent<T> implements OnInit {\n readonly selected$ = merge(\n this.control.valueChanges || EMPTY,\n tuiTypedFromEvent(this.elementRef.nativeElement, `animationstart`),\n ).pipe(\n startWith(null),\n map(() => this.selected),\n distinctUntilChanged(),\n );\n\n constructor(\n @Inject(POLYMORPHEUS_CONTEXT)\n readonly context: TuiContextWithImplicit<TemplateRef<Record<string, unknown>>>,\n @Inject(TUI_DATA_LIST_HOST)\n private readonly host: TuiDataListHost<T>,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiOptionComponent) protected readonly option: TuiOptionComponent<T>,\n @Inject(NgControl) protected readonly control: NgControl,\n ) {}\n\n get matcher(): TuiIdentityMatcher<T> {\n return this.host.identityMatcher || TUI_DEFAULT_IDENTITY_MATCHER;\n }\n\n ngOnInit(): void {\n /**\n * This would cause changes inside already checked parent component (during the same change detection cycle),\n * and it might cause ExpressionChanged error due to potential HostBinding\n * (for example, inside {@link https://github.com/angular/angular/blob/main/packages/forms/src/directives/ng_control_status.ts#L99 NgControlStatus}).\n * Microtask keeps it in the same frame but allows change detection to run.\n */\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Promise.resolve().then(() => {\n if (tuiIsPresent(this.option.value) && this.host.checkOption) {\n this.host.checkOption(this.option.value);\n }\n });\n }\n\n protected get selected(): boolean {\n return (\n tuiIsPresent(this.option.value) &&\n tuiIsPresent(this.control.value) &&\n this.matcher(this.control.value, this.option.value)\n );\n }\n}\n\nexport const TUI_SELECT_OPTION = new PolymorpheusComponent(TuiSelectOptionComponent);\n","<ng-container [ngTemplateOutlet]=\"context.$implicit\"></ng-container>\n<tui-svg\n *ngIf=\"selected$ | async; else dummy\"\n automation-id=\"tui-select-option__checkmark\"\n src=\"tuiIconCheckLarge\"\n class=\"t-checkmark\"\n [tuiScrollIntoView]=\"true\"\n></tui-svg>\n<ng-template #dummy>\n <span class=\"t-dummy\"></span>\n</ng-template>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiScrollIntoViewModule, TuiSvgModule} from '@taiga-ui/core';\n\nimport {TuiSelectOptionComponent} from './select-option.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule, TuiScrollIntoViewModule],\n declarations: [TuiSelectOptionComponent],\n exports: [TuiSelectOptionComponent],\n entryComponents: [TuiSelectOptionComponent],\n})\nexport class TuiSelectOptionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;MA2Ba,wBAAwB,CAAA;IAUjC,WAEa,CAAA,OAAqE,EAE7D,IAAwB,EACJ,UAAmC,EACzB,MAA6B,EACtC,OAAkB,EAAA;QAL/C,IAAO,CAAA,OAAA,GAAP,OAAO,CAA8D;QAE7D,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAoB;QACJ,IAAU,CAAA,UAAA,GAAV,UAAU,CAAyB;QACzB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAuB;QACtC,IAAO,CAAA,OAAA,GAAP,OAAO,CAAW;AAhBnD,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CACtB,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,KAAK,EAClC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAgB,cAAA,CAAA,CAAC,CACrE,CAAC,IAAI,CACF,SAAS,CAAC,IAAI,CAAC,EACf,GAAG,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,EACxB,oBAAoB,EAAE,CACzB,CAAC;KAUE;AAEJ,IAAA,IAAI,OAAO,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,4BAA4B,CAAC;KACpE;IAED,QAAQ,GAAA;AACJ;;;;;AAKG;;AAEH,QAAA,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAK;AACxB,YAAA,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;gBAC1D,IAAI,CAAC,IAAI,CAAC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,YALrB,CAAC,YAAY,EAAE,YAAY,EAAE,uBAAuB,CAAC,CAAA,EAAA,CAAA,CAAA;4FAKrD,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,uBAAuB,CAAC;oBAC9D,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,eAAe,EAAE,CAAC,wBAAwB,CAAC;AAC9C,iBAAA,CAAA;;;ACXD;;AAEG;;;;"}
|
|
@@ -1,41 +1,21 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { InjectionToken, ChangeDetectorRef, TemplateRef, Component, ChangeDetectionStrategy, Optional, Self, Inject, ViewChild, Input, ContentChild, Directive, NgModule } from '@angular/core';
|
|
4
4
|
import * as i5 from '@angular/forms';
|
|
5
5
|
import { NgControl } from '@angular/forms';
|
|
6
6
|
import * as i2 from '@taiga-ui/cdk';
|
|
7
|
-
import {
|
|
7
|
+
import { AbstractTuiNullableControl, tuiIsNativeFocused, tuiAsFocusableItemAccessor, tuiAsControl, tuiDefaultProp, TuiActiveZoneModule } from '@taiga-ui/cdk';
|
|
8
8
|
import * as i1 from '@taiga-ui/core';
|
|
9
|
-
import {
|
|
9
|
+
import { TUI_TEXTFIELD_CLEANER, tuiAsDataListHost, tuiAsOptionContent, TuiDataListDirective, TuiPrimitiveTextfieldComponent, TuiHostedDropdownComponent, TuiAbstractTextfieldHost, tuiAsTextfieldHost, TuiPrimitiveTextfieldModule, TuiHostedDropdownModule, TuiTextfieldControllerModule, TuiTextfieldComponent } from '@taiga-ui/core';
|
|
10
10
|
import { TUI_ARROW_MODE, TuiArrowModule } from '@taiga-ui/kit/components/arrow';
|
|
11
|
-
import { TUI_ITEMS_HANDLERS } from '@taiga-ui/kit/tokens';
|
|
12
11
|
import { TUI_SELECT_OPTION, TuiSelectOptionModule } from '@taiga-ui/kit/components/select-option';
|
|
13
12
|
import { FIXED_DROPDOWN_CONTROLLER_PROVIDER } from '@taiga-ui/kit/providers';
|
|
13
|
+
import { TUI_ITEMS_HANDLERS } from '@taiga-ui/kit/tokens';
|
|
14
14
|
import * as i3 from '@angular/common';
|
|
15
15
|
import { CommonModule } from '@angular/common';
|
|
16
16
|
import * as i4 from '@tinkoff/ng-polymorpheus';
|
|
17
17
|
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
18
18
|
|
|
19
|
-
const TUI_SELECT_PROVIDERS = [
|
|
20
|
-
{
|
|
21
|
-
provide: AbstractTuiControl,
|
|
22
|
-
useExisting: forwardRef(() => TuiSelectComponent),
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
|
|
26
|
-
useExisting: forwardRef(() => TuiSelectComponent),
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
provide: TUI_DATA_LIST_HOST,
|
|
30
|
-
useExisting: forwardRef(() => TuiSelectComponent),
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
provide: TUI_OPTION_CONTENT,
|
|
34
|
-
useValue: TUI_SELECT_OPTION,
|
|
35
|
-
},
|
|
36
|
-
FIXED_DROPDOWN_CONTROLLER_PROVIDER,
|
|
37
|
-
];
|
|
38
|
-
|
|
39
19
|
const TUI_SELECT_DEFAULT_OPTIONS = {
|
|
40
20
|
valueContent: ``,
|
|
41
21
|
};
|
|
@@ -96,12 +76,17 @@ class TuiSelectComponent extends AbstractTuiNullableControl {
|
|
|
96
76
|
}
|
|
97
77
|
focusInput(preventScroll = false) {
|
|
98
78
|
if (this.nativeFocusableElement) {
|
|
99
|
-
|
|
79
|
+
this.nativeFocusableElement.focus({ preventScroll });
|
|
100
80
|
}
|
|
101
81
|
}
|
|
102
82
|
}
|
|
103
83
|
TuiSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSelectComponent, deps: [{ token: NgControl, optional: true, self: true }, { token: ChangeDetectorRef }, { token: TUI_TEXTFIELD_CLEANER }, { token: TUI_ARROW_MODE }, { token: TUI_ITEMS_HANDLERS }, { token: TUI_SELECT_OPTIONS }], target: i0.ɵɵFactoryTarget.Component });
|
|
104
|
-
TuiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiSelectComponent, selector: "tui-select", inputs: { stringify: "stringify", identityMatcher: "identityMatcher", valueContent: "valueContent" }, providers:
|
|
84
|
+
TuiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiSelectComponent, selector: "tui-select", inputs: { stringify: "stringify", identityMatcher: "identityMatcher", valueContent: "valueContent" }, providers: [
|
|
85
|
+
tuiAsFocusableItemAccessor(TuiSelectComponent),
|
|
86
|
+
tuiAsControl(TuiSelectComponent),
|
|
87
|
+
tuiAsDataListHost(TuiSelectComponent),
|
|
88
|
+
tuiAsOptionContent(TUI_SELECT_OPTION),
|
|
89
|
+
], queries: [{ propertyName: "datalist", first: true, predicate: TuiDataListDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "textfield", first: true, predicate: TuiPrimitiveTextfieldComponent, descendants: true }, { propertyName: "hostedDropdown", first: true, predicate: TuiHostedDropdownComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<tui-hosted-dropdown\n class=\"t-hosted\"\n [canOpen]=\"interactive\"\n [content]=\"datalist || ''\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-primitive-textfield\n automation-id=\"tui-select__textfield\"\n class=\"t-textfield\"\n [tuiTextfieldIcon]=\"arrow\"\n [editable]=\"false\"\n [pseudoFocus]=\"computedFocused\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoActive]=\"pseudoActive\"\n [invalid]=\"computedInvalid\"\n [nativeId]=\"nativeId\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [focusable]=\"computedFocusable\"\n [value]=\"computedValue\"\n (valueChange)=\"onValueChange($event)\"\n (keydown.delete.prevent)=\"onKeyDownDelete()\"\n (keydown.backspace.prevent)=\"onKeyDownDelete()\"\n >\n <ng-content></ng-content>\n <ng-content\n select=\"input\"\n ngProjectAs=\"input\"\n ></ng-content>\n <div\n *ngIf=\"value !== null\"\n ngProjectAs=\"tuiContent\"\n automation-id=\"tui-select__value\"\n class=\"t-value\"\n >\n <div\n *polymorpheusOutlet=\"computedContent as text; context: {$implicit: value, active: computedFocused}\"\n class=\"t-primitive-value\"\n [textContent]=\"text\"\n ></div>\n </div>\n </tui-primitive-textfield>\n</tui-hosted-dropdown>\n", styles: [":host{display:block;border-radius:var(--tui-radius-m);text-align:left}:host:not(._readonly) ::ng-deep input:not(:disabled){cursor:pointer}:host._readonly ::ng-deep input{cursor:default}.t-hosted{display:block;border-radius:inherit}.t-textfield{border-radius:inherit;text-align:inherit}.t-value{display:flex;width:100%;align-items:center}.t-primitive-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], components: [{ type: i1.TuiHostedDropdownComponent, selector: "tui-hosted-dropdown", inputs: ["content", "canOpen", "open"], outputs: ["openChange", "focusedChange"] }, { type: i1.TuiPrimitiveTextfieldComponent, selector: "tui-primitive-textfield", inputs: ["editable", "filler", "iconCleaner", "readOnly", "invalid", "disabled", "prefix", "postfix", "value"], outputs: ["valueChange"] }], directives: [{ type: i2.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i1.TuiPrimitiveTextfieldDirective, selector: "tui-primitive-textfield" }, { type: i1.TuiTextfieldIconDirective, selector: "[tuiTextfieldIcon]", inputs: ["tuiTextfieldIcon"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
105
90
|
__decorate([
|
|
106
91
|
tuiDefaultProp()
|
|
107
92
|
], TuiSelectComponent.prototype, "stringify", void 0);
|
|
@@ -118,7 +103,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
118
103
|
templateUrl: `./select.template.html`,
|
|
119
104
|
styleUrls: [`./select.style.less`],
|
|
120
105
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
121
|
-
providers:
|
|
106
|
+
providers: [
|
|
107
|
+
tuiAsFocusableItemAccessor(TuiSelectComponent),
|
|
108
|
+
tuiAsControl(TuiSelectComponent),
|
|
109
|
+
tuiAsDataListHost(TuiSelectComponent),
|
|
110
|
+
tuiAsOptionContent(TUI_SELECT_OPTION),
|
|
111
|
+
],
|
|
112
|
+
viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER],
|
|
122
113
|
}]
|
|
123
114
|
}], ctorParameters: function () { return [{ type: i5.NgControl, decorators: [{
|
|
124
115
|
type: Optional
|
|
@@ -171,22 +162,12 @@ class TuiSelectDirective extends TuiAbstractTextfieldHost {
|
|
|
171
162
|
}
|
|
172
163
|
}
|
|
173
164
|
TuiSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSelectDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
174
|
-
TuiSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiSelectDirective, selector: "tui-select", providers: [
|
|
175
|
-
{
|
|
176
|
-
provide: TUI_TEXTFIELD_HOST,
|
|
177
|
-
useExisting: forwardRef(() => TuiSelectDirective),
|
|
178
|
-
},
|
|
179
|
-
], usesInheritance: true, ngImport: i0 });
|
|
165
|
+
TuiSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiSelectDirective, selector: "tui-select", providers: [tuiAsTextfieldHost(TuiSelectDirective)], usesInheritance: true, ngImport: i0 });
|
|
180
166
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSelectDirective, decorators: [{
|
|
181
167
|
type: Directive,
|
|
182
168
|
args: [{
|
|
183
169
|
selector: `tui-select`,
|
|
184
|
-
providers: [
|
|
185
|
-
{
|
|
186
|
-
provide: TUI_TEXTFIELD_HOST,
|
|
187
|
-
useExisting: forwardRef(() => TuiSelectDirective),
|
|
188
|
-
},
|
|
189
|
-
],
|
|
170
|
+
providers: [tuiAsTextfieldHost(TuiSelectDirective)],
|
|
190
171
|
}]
|
|
191
172
|
}] });
|
|
192
173
|
|
|
@@ -233,5 +214,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
233
214
|
* Generated bundle index. Do not edit.
|
|
234
215
|
*/
|
|
235
216
|
|
|
236
|
-
export { TUI_SELECT_DEFAULT_OPTIONS, TUI_SELECT_OPTIONS,
|
|
217
|
+
export { TUI_SELECT_DEFAULT_OPTIONS, TUI_SELECT_OPTIONS, TuiSelectComponent, TuiSelectDirective, TuiSelectModule, tuiSelectOptionsProvider };
|
|
237
218
|
//# sourceMappingURL=taiga-ui-kit-components-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-select.js","sources":["../../../projects/kit/components/select/select.providers.ts","../../../projects/kit/components/select/select-options.ts","../../../projects/kit/components/select/select.component.ts","../../../projects/kit/components/select/select.template.html","../../../projects/kit/components/select/select.directive.ts","../../../projects/kit/components/select/select.module.ts","../../../projects/kit/components/select/taiga-ui-kit-components-select.ts"],"sourcesContent":["import {forwardRef} from '@angular/core';\nimport {AbstractTuiControl, TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk';\nimport {TUI_DATA_LIST_HOST, TUI_OPTION_CONTENT} from '@taiga-ui/core';\nimport {TUI_SELECT_OPTION} from '@taiga-ui/kit/components/select-option';\nimport {FIXED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit/providers';\n\nimport {TuiSelectComponent} from './select.component';\n\nexport const TUI_SELECT_PROVIDERS = [\n {\n provide: AbstractTuiControl,\n useExisting: forwardRef(() => TuiSelectComponent),\n },\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiSelectComponent),\n },\n {\n provide: TUI_DATA_LIST_HOST,\n useExisting: forwardRef(() => TuiSelectComponent),\n },\n {\n provide: TUI_OPTION_CONTENT,\n useValue: TUI_SELECT_OPTION,\n },\n FIXED_DROPDOWN_CONTROLLER_PROVIDER,\n];\n","import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiValueContentContext} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport interface TuiSelectOptions<T> {\n readonly valueContent: PolymorpheusContent<TuiValueContentContext<T>>;\n}\n\nexport const TUI_SELECT_DEFAULT_OPTIONS: TuiSelectOptions<unknown> = {\n valueContent: ``,\n};\n\nexport const TUI_SELECT_OPTIONS = new InjectionToken<TuiSelectOptions<unknown>>(\n `Default parameters for select component`,\n {\n factory: () => TUI_SELECT_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiSelectOptionsProvider: <T>(\n options: Partial<TuiSelectOptions<T>>,\n) => ValueProvider = <T>(options: Partial<TuiSelectOptions<T>>) => ({\n provide: TUI_SELECT_OPTIONS,\n useValue: {...TUI_SELECT_DEFAULT_OPTIONS, ...options},\n});\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n Inject,\n Input,\n Optional,\n Self,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiNullableControl,\n setNativeFocused,\n TuiActiveZoneDirective,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n tuiIsNativeFocused,\n} from '@taiga-ui/cdk';\nimport {\n TUI_TEXTFIELD_CLEANER,\n TuiDataListDirective,\n TuiDataListHost,\n TuiHostedDropdownComponent,\n TuiPrimitiveTextfieldComponent,\n TuiSizeL,\n TuiSizeM,\n TuiSizeS,\n TuiTextfieldCleanerDirective,\n TuiValueContentContext,\n} from '@taiga-ui/core';\nimport {TUI_ARROW_MODE, TuiArrowMode} from '@taiga-ui/kit/components/arrow';\nimport {TUI_ITEMS_HANDLERS, TuiItemsHandlers} from '@taiga-ui/kit/tokens';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TUI_SELECT_PROVIDERS} from './select.providers';\nimport {TUI_SELECT_OPTIONS, TuiSelectOptions} from './select-options';\n\n@Component({\n selector: `tui-select`,\n templateUrl: `./select.template.html`,\n styleUrls: [`./select.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: TUI_SELECT_PROVIDERS,\n})\nexport class TuiSelectComponent<T>\n extends AbstractTuiNullableControl<T>\n implements TuiFocusableElementAccessor, TuiDataListHost<T>\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly textfield?: TuiPrimitiveTextfieldComponent;\n\n @ViewChild(TuiHostedDropdownComponent)\n private readonly hostedDropdown?: TuiHostedDropdownComponent;\n\n @Input()\n @tuiDefaultProp()\n stringify: TuiItemsHandlers<T>['stringify'] = this.itemsHandlers.stringify;\n\n @Input()\n @tuiDefaultProp()\n identityMatcher: TuiItemsHandlers<T>['identityMatcher'] =\n this.itemsHandlers.identityMatcher;\n\n @Input()\n @tuiDefaultProp()\n valueContent: TuiSelectOptions<T>['valueContent'] = this.options.valueContent;\n\n @ContentChild(TuiDataListDirective, {read: TemplateRef})\n readonly datalist: PolymorpheusContent<\n TuiContextWithImplicit<TuiActiveZoneDirective>\n > = ``;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_CLEANER)\n private readonly textfieldCleaner: TuiTextfieldCleanerDirective,\n @Inject(TUI_ARROW_MODE)\n private readonly arrowMode: TuiArrowMode,\n @Inject(TUI_ITEMS_HANDLERS)\n private readonly itemsHandlers: TuiItemsHandlers<T>,\n @Inject(TUI_SELECT_OPTIONS)\n private readonly options: TuiSelectOptions<T>,\n ) {\n super(control, changeDetectorRef);\n }\n\n get arrow(): PolymorpheusContent<\n TuiContextWithImplicit<TuiSizeS | TuiSizeM | TuiSizeL>\n > {\n return !this.interactive ? this.arrowMode.disabled : this.arrowMode.interactive;\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.textfield ? this.textfield.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return (\n tuiIsNativeFocused(this.nativeFocusableElement) ||\n (!!this.hostedDropdown && this.hostedDropdown.focused)\n );\n }\n\n get computedValue(): string {\n return this.value === null ? `` : this.stringify(this.value) || ` `;\n }\n\n get computedContent(): PolymorpheusContent<TuiValueContentContext<T>> {\n return this.valueContent || this.computedValue;\n }\n\n onValueChange(value: string): void {\n if (!value) {\n this.updateValue(null);\n }\n }\n\n onActiveZone(active: boolean): void {\n this.updateFocused(active);\n }\n\n onKeyDownDelete(): void {\n if (this.textfieldCleaner.cleaner) {\n this.updateValue(null);\n }\n }\n\n handleOption(option: T): void {\n this.focusInput();\n this.updateValue(option);\n this.hostedDropdown?.updateOpen(false);\n }\n\n private focusInput(preventScroll: boolean = false): void {\n if (this.nativeFocusableElement) {\n setNativeFocused(this.nativeFocusableElement, true, preventScroll);\n }\n }\n}\n","<tui-hosted-dropdown\n class=\"t-hosted\"\n [canOpen]=\"interactive\"\n [content]=\"datalist || ''\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-primitive-textfield\n automation-id=\"tui-select__textfield\"\n class=\"t-textfield\"\n [tuiTextfieldIcon]=\"arrow\"\n [editable]=\"false\"\n [pseudoFocus]=\"computedFocused\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoActive]=\"pseudoActive\"\n [invalid]=\"computedInvalid\"\n [nativeId]=\"nativeId\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [focusable]=\"computedFocusable\"\n [value]=\"computedValue\"\n (valueChange)=\"onValueChange($event)\"\n (keydown.delete.prevent)=\"onKeyDownDelete()\"\n (keydown.backspace.prevent)=\"onKeyDownDelete()\"\n >\n <ng-content></ng-content>\n <ng-content\n select=\"input\"\n ngProjectAs=\"input\"\n ></ng-content>\n <div\n *ngIf=\"value !== null\"\n ngProjectAs=\"tuiContent\"\n automation-id=\"tui-select__value\"\n class=\"t-value\"\n >\n <div\n *polymorpheusOutlet=\"computedContent as text; context: {$implicit: value, active: computedFocused}\"\n class=\"t-primitive-value\"\n [textContent]=\"text\"\n ></div>\n </div>\n </tui-primitive-textfield>\n</tui-hosted-dropdown>\n","import {Directive, forwardRef} from '@angular/core';\nimport {TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost} from '@taiga-ui/core';\n\nimport {TuiSelectComponent} from './select.component';\n\n@Directive({\n selector: `tui-select`,\n providers: [\n {\n provide: TUI_TEXTFIELD_HOST,\n useExisting: forwardRef(() => TuiSelectDirective),\n },\n ],\n})\nexport class TuiSelectDirective extends TuiAbstractTextfieldHost<\n TuiSelectComponent<unknown>\n> {\n get readOnly(): boolean {\n return true;\n }\n\n get value(): string {\n return this.host.computedValue;\n }\n\n onValueChange(value: string): void {\n this.host.onValueChange(value);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule} from '@taiga-ui/cdk';\nimport {\n TuiHostedDropdownModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldComponent,\n TuiTextfieldControllerModule,\n} from '@taiga-ui/core';\nimport {TuiArrowModule} from '@taiga-ui/kit/components/arrow';\nimport {TuiSelectOptionModule} from '@taiga-ui/kit/components/select-option';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiSelectComponent} from './select.component';\nimport {TuiSelectDirective} from './select.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n PolymorpheusModule,\n TuiActiveZoneModule,\n TuiPrimitiveTextfieldModule,\n TuiHostedDropdownModule,\n TuiSelectOptionModule,\n TuiArrowModule,\n TuiTextfieldControllerModule,\n ],\n declarations: [TuiSelectComponent, TuiSelectDirective],\n exports: [TuiSelectComponent, TuiSelectDirective, TuiTextfieldComponent],\n})\nexport class TuiSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAQa,MAAA,oBAAoB,GAAG;AAChC,IAAA;AACI,QAAA,OAAO,EAAE,kBAAkB;AAC3B,QAAA,WAAW,EAAE,UAAU,CAAC,MAAM,kBAAkB,CAAC;AACpD,KAAA;AACD,IAAA;AACI,QAAA,OAAO,EAAE,2BAA2B;AACpC,QAAA,WAAW,EAAE,UAAU,CAAC,MAAM,kBAAkB,CAAC;AACpD,KAAA;AACD,IAAA;AACI,QAAA,OAAO,EAAE,kBAAkB;AAC3B,QAAA,WAAW,EAAE,UAAU,CAAC,MAAM,kBAAkB,CAAC;AACpD,KAAA;AACD,IAAA;AACI,QAAA,OAAO,EAAE,kBAAkB;AAC3B,QAAA,QAAQ,EAAE,iBAAiB;AAC9B,KAAA;IACD,kCAAkC;;;ACjBzB,MAAA,0BAA0B,GAA8B;AACjE,IAAA,YAAY,EAAE,CAAE,CAAA;EAClB;MAEW,kBAAkB,GAAG,IAAI,cAAc,CAChD,yCAAyC,EACzC;AACI,IAAA,OAAO,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,EAAA,CAAA,kBAAkB,EAAE,kBAAkB,aATjD,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,2BAA2B;QAC3B,uBAAuB;QACvB,qBAAqB;QACrB,cAAc;AACd,QAAA,4BAA4B,CAGtB,EAAA,OAAA,EAAA,CAAA,kBAAkB,EAAE,kBAAkB,EAAE,qBAAqB,CAAA,EAAA,CAAA,CAAA;AAE9D,eAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAbf,OAAA,EAAA,CAAA;YACL,YAAY;YACZ,kBAAkB;YAClB,mBAAmB;YACnB,2BAA2B;YAC3B,uBAAuB;YACvB,qBAAqB;YACrB,cAAc;YACd,4BAA4B;AAC/B,SAAA,CAAA,EAAA,CAAA,CAAA;4FAIQ,eAAe,EAAA,UAAA,EAAA,CAAA;kBAd3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,kBAAkB;wBAClB,mBAAmB;wBACnB,2BAA2B;wBAC3B,uBAAuB;wBACvB,qBAAqB;wBACrB,cAAc;wBACd,4BAA4B;AAC/B,qBAAA;AACD,oBAAA,YAAY,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;AACtD,oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,qBAAqB,CAAC;AAC3E,iBAAA,CAAA;;;AC7BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-select.js","sources":["../../../projects/kit/components/select/select-options.ts","../../../projects/kit/components/select/select.component.ts","../../../projects/kit/components/select/select.template.html","../../../projects/kit/components/select/select.directive.ts","../../../projects/kit/components/select/select.module.ts","../../../projects/kit/components/select/taiga-ui-kit-components-select.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiValueContentContext} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport interface TuiSelectOptions<T> {\n readonly valueContent: PolymorpheusContent<TuiValueContentContext<T>>;\n}\n\nexport const TUI_SELECT_DEFAULT_OPTIONS: TuiSelectOptions<unknown> = {\n valueContent: ``,\n};\n\nexport const TUI_SELECT_OPTIONS = new InjectionToken<TuiSelectOptions<unknown>>(\n `Default parameters for select component`,\n {\n factory: () => TUI_SELECT_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiSelectOptionsProvider: <T>(\n options: Partial<TuiSelectOptions<T>>,\n) => ValueProvider = <T>(options: Partial<TuiSelectOptions<T>>) => ({\n provide: TUI_SELECT_OPTIONS,\n useValue: {...TUI_SELECT_DEFAULT_OPTIONS, ...options},\n});\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n Inject,\n Input,\n Optional,\n Self,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiNullableControl,\n TuiActiveZoneDirective,\n tuiAsControl,\n tuiAsFocusableItemAccessor,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n tuiIsNativeFocused,\n} from '@taiga-ui/cdk';\nimport {\n TUI_TEXTFIELD_CLEANER,\n tuiAsDataListHost,\n tuiAsOptionContent,\n TuiDataListDirective,\n TuiDataListHost,\n TuiHostedDropdownComponent,\n TuiPrimitiveTextfieldComponent,\n TuiSizeL,\n TuiSizeM,\n TuiSizeS,\n TuiTextfieldCleanerDirective,\n TuiValueContentContext,\n} from '@taiga-ui/core';\nimport {TUI_ARROW_MODE, TuiArrowMode} from '@taiga-ui/kit/components/arrow';\nimport {TUI_SELECT_OPTION} from '@taiga-ui/kit/components/select-option';\nimport {FIXED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit/providers';\nimport {TUI_ITEMS_HANDLERS, TuiItemsHandlers} from '@taiga-ui/kit/tokens';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TUI_SELECT_OPTIONS, TuiSelectOptions} from './select-options';\n\n@Component({\n selector: `tui-select`,\n templateUrl: `./select.template.html`,\n styleUrls: [`./select.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsFocusableItemAccessor(TuiSelectComponent),\n tuiAsControl(TuiSelectComponent),\n tuiAsDataListHost(TuiSelectComponent),\n tuiAsOptionContent(TUI_SELECT_OPTION),\n ],\n viewProviders: [FIXED_DROPDOWN_CONTROLLER_PROVIDER],\n})\nexport class TuiSelectComponent<T>\n extends AbstractTuiNullableControl<T>\n implements TuiFocusableElementAccessor, TuiDataListHost<T>\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly textfield?: TuiPrimitiveTextfieldComponent;\n\n @ViewChild(TuiHostedDropdownComponent)\n private readonly hostedDropdown?: TuiHostedDropdownComponent;\n\n @Input()\n @tuiDefaultProp()\n stringify: TuiItemsHandlers<T>['stringify'] = this.itemsHandlers.stringify;\n\n @Input()\n @tuiDefaultProp()\n identityMatcher: TuiItemsHandlers<T>['identityMatcher'] =\n this.itemsHandlers.identityMatcher;\n\n @Input()\n @tuiDefaultProp()\n valueContent: TuiSelectOptions<T>['valueContent'] = this.options.valueContent;\n\n @ContentChild(TuiDataListDirective, {read: TemplateRef})\n readonly datalist: PolymorpheusContent<\n TuiContextWithImplicit<TuiActiveZoneDirective>\n > = ``;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_CLEANER)\n private readonly textfieldCleaner: TuiTextfieldCleanerDirective,\n @Inject(TUI_ARROW_MODE)\n private readonly arrowMode: TuiArrowMode,\n @Inject(TUI_ITEMS_HANDLERS)\n private readonly itemsHandlers: TuiItemsHandlers<T>,\n @Inject(TUI_SELECT_OPTIONS)\n private readonly options: TuiSelectOptions<T>,\n ) {\n super(control, changeDetectorRef);\n }\n\n get arrow(): PolymorpheusContent<\n TuiContextWithImplicit<TuiSizeS | TuiSizeM | TuiSizeL>\n > {\n return !this.interactive ? this.arrowMode.disabled : this.arrowMode.interactive;\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.textfield ? this.textfield.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return (\n tuiIsNativeFocused(this.nativeFocusableElement) ||\n (!!this.hostedDropdown && this.hostedDropdown.focused)\n );\n }\n\n get computedValue(): string {\n return this.value === null ? `` : this.stringify(this.value) || ` `;\n }\n\n get computedContent(): PolymorpheusContent<TuiValueContentContext<T>> {\n return this.valueContent || this.computedValue;\n }\n\n onValueChange(value: string): void {\n if (!value) {\n this.updateValue(null);\n }\n }\n\n onActiveZone(active: boolean): void {\n this.updateFocused(active);\n }\n\n onKeyDownDelete(): void {\n if (this.textfieldCleaner.cleaner) {\n this.updateValue(null);\n }\n }\n\n handleOption(option: T): void {\n this.focusInput();\n this.updateValue(option);\n this.hostedDropdown?.updateOpen(false);\n }\n\n private focusInput(preventScroll: boolean = false): void {\n if (this.nativeFocusableElement) {\n this.nativeFocusableElement.focus({preventScroll});\n }\n }\n}\n","<tui-hosted-dropdown\n class=\"t-hosted\"\n [canOpen]=\"interactive\"\n [content]=\"datalist || ''\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-primitive-textfield\n automation-id=\"tui-select__textfield\"\n class=\"t-textfield\"\n [tuiTextfieldIcon]=\"arrow\"\n [editable]=\"false\"\n [pseudoFocus]=\"computedFocused\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoActive]=\"pseudoActive\"\n [invalid]=\"computedInvalid\"\n [nativeId]=\"nativeId\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [focusable]=\"computedFocusable\"\n [value]=\"computedValue\"\n (valueChange)=\"onValueChange($event)\"\n (keydown.delete.prevent)=\"onKeyDownDelete()\"\n (keydown.backspace.prevent)=\"onKeyDownDelete()\"\n >\n <ng-content></ng-content>\n <ng-content\n select=\"input\"\n ngProjectAs=\"input\"\n ></ng-content>\n <div\n *ngIf=\"value !== null\"\n ngProjectAs=\"tuiContent\"\n automation-id=\"tui-select__value\"\n class=\"t-value\"\n >\n <div\n *polymorpheusOutlet=\"computedContent as text; context: {$implicit: value, active: computedFocused}\"\n class=\"t-primitive-value\"\n [textContent]=\"text\"\n ></div>\n </div>\n </tui-primitive-textfield>\n</tui-hosted-dropdown>\n","import {Directive} from '@angular/core';\nimport {TuiAbstractTextfieldHost, tuiAsTextfieldHost} from '@taiga-ui/core';\n\nimport {TuiSelectComponent} from './select.component';\n\n@Directive({\n selector: `tui-select`,\n providers: [tuiAsTextfieldHost(TuiSelectDirective)],\n})\nexport class TuiSelectDirective extends TuiAbstractTextfieldHost<\n TuiSelectComponent<unknown>\n> {\n get readOnly(): boolean {\n return true;\n }\n\n get value(): string {\n return this.host.computedValue;\n }\n\n onValueChange(value: string): void {\n this.host.onValueChange(value);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule} from '@taiga-ui/cdk';\nimport {\n TuiHostedDropdownModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldComponent,\n TuiTextfieldControllerModule,\n} from '@taiga-ui/core';\nimport {TuiArrowModule} from '@taiga-ui/kit/components/arrow';\nimport {TuiSelectOptionModule} from '@taiga-ui/kit/components/select-option';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiSelectComponent} from './select.component';\nimport {TuiSelectDirective} from './select.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n PolymorpheusModule,\n TuiActiveZoneModule,\n TuiPrimitiveTextfieldModule,\n TuiHostedDropdownModule,\n TuiSelectOptionModule,\n TuiArrowModule,\n TuiTextfieldControllerModule,\n ],\n declarations: [TuiSelectComponent, TuiSelectDirective],\n exports: [TuiSelectComponent, TuiSelectDirective, TuiTextfieldComponent],\n})\nexport class TuiSelectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAQa,MAAA,0BAA0B,GAA8B;AACjE,IAAA,YAAY,EAAE,CAAE,CAAA;EAClB;MAEW,kBAAkB,GAAG,IAAI,cAAc,CAChD,yCAAyC,EACzC;AACI,IAAA,OAAO,EAAE,MAAM,0BAA0B;AAC5C,CAAA,EACH;MAEW,wBAAwB,GAEhB,CAAI,OAAqC,MAAM;AAChE,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,QAAQ,EAAM,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,0BAA0B,CAAK,EAAA,OAAO,CAAC;AACxD,CAAA;;ACkCK,MAAO,kBACT,SAAQ,0BAA6B,CAAA;IA2BrC,WAII,CAAA,OAAyB,EACE,iBAAoC,EAE9C,gBAA8C,EAE9C,SAAuB,EAEvB,aAAkC,EAElC,OAA4B,EAAA;AAE7C,QAAA,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QARjB,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAA8B;QAE9C,IAAS,CAAA,SAAA,GAAT,SAAS,CAAc;QAEvB,IAAa,CAAA,aAAA,GAAb,aAAa,CAAqB;QAElC,IAAO,CAAA,OAAA,GAAP,OAAO,CAAqB;AA7BjD,QAAA,IAAA,CAAA,SAAS,GAAqC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;AAI3E,QAAA,IAAA,CAAA,eAAe,GACX,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC;AAIvC,QAAA,IAAA,CAAA,YAAY,GAAwC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QAGrE,IAAQ,CAAA,QAAA,GAEb,EAAE,CAAC;KAkBN;AAED,IAAA,IAAI,KAAK,GAAA;QAGL,OAAO,CAAC,IAAI,CAAC,WA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,EAAE;wBACL,YAAY;wBACZ,kBAAkB;wBAClB,mBAAmB;wBACnB,2BAA2B;wBAC3B,uBAAuB;wBACvB,qBAAqB;wBACrB,cAAc;wBACd,4BAA4B;AAC/B,qBAAA;AACD,oBAAA,YAAY,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;AACtD,oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,qBAAqB,CAAC;AAC3E,iBAAA,CAAA;;;AC7BD;;AAEG;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, ChangeDetectorRef, ElementRef, Component, ChangeDetectionStrategy, Optional, Self, Inject, Input, HostBinding,
|
|
2
|
+
import { InjectionToken, ChangeDetectorRef, ElementRef, Injector, Component, ChangeDetectionStrategy, Optional, Self, Inject, Input, HostBinding, forwardRef, Directive, HostListener, ContentChild, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { NgModel, NgControl } from '@angular/forms';
|
|
5
|
-
import {
|
|
5
|
+
import { tuiWatch, tuiIsEdgeOlderThan, CHROMIUM_EDGE_START_VERSION, tuiDefaultProp, tuiPure, AbstractTuiControl, tuiIsNativeFocused, tuiClamp, tuiAssert, tuiTypedFromEvent, tuiCoerceBooleanProperty, TuiDestroyService } from '@taiga-ui/cdk';
|
|
6
6
|
import { tuiPercentageToKeyStepValue, tuiKeyStepValueToPercentage } from '@taiga-ui/kit/utils';
|
|
7
|
-
import { take, map, tap, mapTo, filter, takeUntil } from 'rxjs/operators';
|
|
8
7
|
import { __decorate } from 'tslib';
|
|
9
8
|
import { USER_AGENT } from '@ng-web-apis/common';
|
|
9
|
+
import { take, tap, mapTo, filter, takeUntil } from 'rxjs/operators';
|
|
10
10
|
import * as i1$2 from '@angular/common';
|
|
11
11
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
12
12
|
import * as i1$1 from 'rxjs';
|
|
@@ -25,12 +25,13 @@ function tuiSliderOptionsProvider(options) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
class TuiSliderComponent {
|
|
28
|
-
constructor(control, changeDetectorRef, options, elementRef, userAgent) {
|
|
28
|
+
constructor(control, changeDetectorRef, options, elementRef, userAgent, injector) {
|
|
29
29
|
var _a;
|
|
30
30
|
this.control = control;
|
|
31
31
|
this.options = options;
|
|
32
32
|
this.elementRef = elementRef;
|
|
33
33
|
this.userAgent = userAgent;
|
|
34
|
+
this.injector = injector;
|
|
34
35
|
this.size = this.options.size;
|
|
35
36
|
this.segments = 1;
|
|
36
37
|
if (control instanceof NgModel) {
|
|
@@ -41,7 +42,7 @@ class TuiSliderComponent {
|
|
|
41
42
|
* ___
|
|
42
43
|
* See this {@link https://github.com/angular/angular/issues/14988 issue}
|
|
43
44
|
*/
|
|
44
|
-
(_a = control.valueChanges) === null || _a === void 0 ? void 0 : _a.pipe(
|
|
45
|
+
(_a = control.valueChanges) === null || _a === void 0 ? void 0 : _a.pipe(tuiWatch(changeDetectorRef), take(1)).subscribe();
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
get min() {
|
|
@@ -54,9 +55,8 @@ class TuiSliderComponent {
|
|
|
54
55
|
return Number(this.elementRef.nativeElement.step) || 1;
|
|
55
56
|
}
|
|
56
57
|
get value() {
|
|
57
|
-
const { elementRef, control } = this;
|
|
58
|
-
|
|
59
|
-
if (noKeySteps && control instanceof NgModel) {
|
|
58
|
+
const { elementRef, control, hasKeySteps } = this;
|
|
59
|
+
if (!hasKeySteps && control instanceof NgModel) {
|
|
60
60
|
/**
|
|
61
61
|
* If developer uses `[(ngModel)]` and programmatically change value,
|
|
62
62
|
* the `elementRef.nativeElement.value` is equal to the previous value at this moment.
|
|
@@ -74,11 +74,15 @@ class TuiSliderComponent {
|
|
|
74
74
|
get segmentWidth() {
|
|
75
75
|
return 100 / Math.max(1, this.segments);
|
|
76
76
|
}
|
|
77
|
+
// TODO: drop support of legacy Edge (EdgeHTML) in v4.x
|
|
77
78
|
get isOldEdge() {
|
|
78
79
|
return tuiIsEdgeOlderThan(CHROMIUM_EDGE_START_VERSION, this.userAgent);
|
|
79
80
|
}
|
|
81
|
+
get hasKeySteps() {
|
|
82
|
+
return Boolean(this.injector.get(TuiSliderKeyStepsDirective, null));
|
|
83
|
+
}
|
|
80
84
|
}
|
|
81
|
-
TuiSliderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSliderComponent, deps: [{ token: NgControl, optional: true, self: true }, { token: ChangeDetectorRef }, { token: TUI_SLIDER_OPTIONS }, { token: ElementRef }, { token: USER_AGENT }], target: i0.ɵɵFactoryTarget.Component });
|
|
85
|
+
TuiSliderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSliderComponent, deps: [{ token: NgControl, optional: true, self: true }, { token: ChangeDetectorRef }, { token: TUI_SLIDER_OPTIONS }, { token: ElementRef }, { token: USER_AGENT }, { token: Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
82
86
|
TuiSliderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiSliderComponent, selector: "input[type=range][tuiSlider]", inputs: { size: "size", segments: "segments" }, host: { listeners: { "input": "0" }, properties: { "style.--tui-slider-track-color": "options.trackColor", "attr.data-size": "this.size", "style.--tui-slider-fill-percentage.%": "this.valuePercentage", "style.--tui-slider-segment-width.%": "this.segmentWidth", "class._old-edge": "this.isOldEdge" } }, ngImport: i0, template: ``, isInline: true, styles: [":host{display:block;width:100%;color:var(--tui-primary);cursor:pointer}:host:active{cursor:ew-resize}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:auto}:host:not(._old-edge){-webkit-appearance:none;-moz-appearance:none;appearance:none;height:.125rem;padding:.4375rem 0;background-color:transparent;background-clip:content-box;outline:none;border-radius:var(--tui-radius-m)}:host:not(._old-edge)::-webkit-slider-container{border-radius:inherit}:host:not(._old-edge)[data-size=m]::-webkit-slider-runnable-track{height:.125rem;border-radius:inherit;background-repeat:no-repeat;background-color:var(--tui-slider-track-color);background-image:linear-gradient(to right,currentColor 0px .625rem,transparent .25rem),repeating-linear-gradient(to right,var(--tui-base-07) 0 .25rem,transparent 0 var(--tui-slider-segment-width)),linear-gradient(to right,currentColor var(--tui-slider-fill-percentage),transparent var(--tui-slider-fill-percentage));background-position-x:0,.375rem,0;background-size:calc(100% - 1rem),calc(100% - 1rem),auto}:host:not(._old-edge)[data-size=s]::-webkit-slider-runnable-track{height:.125rem;border-radius:inherit;background-repeat:no-repeat;background-color:var(--tui-slider-track-color);background-image:linear-gradient(to right,currentColor 0px .375rem,transparent .25rem),repeating-linear-gradient(to right,var(--tui-base-07) 0 .25rem,transparent 0 var(--tui-slider-segment-width)),linear-gradient(to right,currentColor var(--tui-slider-fill-percentage),transparent var(--tui-slider-fill-percentage));background-position-x:0,.125rem,0;background-size:calc(100% - .5rem),calc(100% - .5rem),auto}:host:not(._old-edge)[data-size=m]::-moz-range-track{height:.125rem;border-radius:inherit;background-repeat:no-repeat;background-color:var(--tui-slider-track-color);background-image:linear-gradient(to right,currentColor 0px .625rem,transparent .25rem),repeating-linear-gradient(to right,var(--tui-base-07) 0 .25rem,transparent 0 var(--tui-slider-segment-width));background-position-x:0,.375rem;background-size:calc(100% - 1rem)}:host:not(._old-edge)[data-size=s]::-moz-range-track{height:.125rem;border-radius:inherit;background-repeat:no-repeat;background-color:var(--tui-slider-track-color);background-image:linear-gradient(to right,currentColor 0px .375rem,transparent .25rem),repeating-linear-gradient(to right,var(--tui-base-07) 0 .25rem,transparent 0 var(--tui-slider-segment-width));background-position-x:0,.125rem;background-size:calc(100% - .5rem)}:host:not(._old-edge)[data-size=m]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:1rem;width:1rem;margin-top:-.4375rem}:not(:disabled):host:not(._old-edge)[data-size=m]::-webkit-slider-thumb{cursor:ew-resize}:not(:disabled):host:not(._old-edge)[data-size=m]::-webkit-slider-thumb:hover{background:var(--tui-primary-hover)}:not(:disabled):host:not(._old-edge)[data-size=m]::-webkit-slider-thumb:active{background:var(--tui-primary-active)}:focus-visible:host:not(._old-edge)[data-size=m]::-webkit-slider-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)[data-size=s]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:.5rem;width:.5rem;margin-top:-.1875rem}:not(:disabled):host:not(._old-edge)[data-size=s]::-webkit-slider-thumb{cursor:ew-resize}:not(:disabled):host:not(._old-edge)[data-size=s]::-webkit-slider-thumb:hover{background:var(--tui-primary-hover)}:not(:disabled):host:not(._old-edge)[data-size=s]::-webkit-slider-thumb:active{background:var(--tui-primary-active)}:focus-visible:host:not(._old-edge)[data-size=s]::-webkit-slider-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)[data-size=m]::-moz-range-thumb{-moz-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:1rem;width:1rem}:not(:disabled):host:not(._old-edge)[data-size=m]::-moz-range-thumb{cursor:ew-resize}:not(:disabled):host:not(._old-edge)[data-size=m]::-moz-range-thumb:hover{background:var(--tui-primary-hover)}:not(:disabled):host:not(._old-edge)[data-size=m]::-moz-range-thumb:active{background:var(--tui-primary-active)}:focus-visible:host:not(._old-edge)[data-size=m]::-moz-range-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)[data-size=s]::-moz-range-thumb{-moz-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:.5rem;width:.5rem}:not(:disabled):host:not(._old-edge)[data-size=s]::-moz-range-thumb{cursor:ew-resize}:not(:disabled):host:not(._old-edge)[data-size=s]::-moz-range-thumb:hover{background:var(--tui-primary-hover)}:not(:disabled):host:not(._old-edge)[data-size=s]::-moz-range-thumb:active{background:var(--tui-primary-active)}:focus-visible:host:not(._old-edge)[data-size=s]::-moz-range-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)::-moz-range-progress{background:currentColor;border-radius:inherit 0 0 inherit}:host._old-edge::-ms-thumb{background:currentColor;border-radius:50%}:host._old-edge::-ms-fill-lower{background:currentColor}:host._old-edge::-ms-track{background:var(--tui-slider-track-color);border:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
83
87
|
__decorate([
|
|
84
88
|
tuiDefaultProp()
|
|
@@ -86,6 +90,9 @@ __decorate([
|
|
|
86
90
|
__decorate([
|
|
87
91
|
tuiDefaultProp()
|
|
88
92
|
], TuiSliderComponent.prototype, "segments", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
tuiPure
|
|
95
|
+
], TuiSliderComponent.prototype, "hasKeySteps", null);
|
|
89
96
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSliderComponent, decorators: [{
|
|
90
97
|
type: Component,
|
|
91
98
|
args: [{
|
|
@@ -129,6 +136,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
129
136
|
}] }, { type: undefined, decorators: [{
|
|
130
137
|
type: Inject,
|
|
131
138
|
args: [USER_AGENT]
|
|
139
|
+
}] }, { type: i0.Injector, decorators: [{
|
|
140
|
+
type: Inject,
|
|
141
|
+
args: [Injector]
|
|
132
142
|
}] }]; }, propDecorators: { size: [{
|
|
133
143
|
type: Input
|
|
134
144
|
}, {
|
|
@@ -145,15 +155,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
145
155
|
}], isOldEdge: [{
|
|
146
156
|
type: HostBinding,
|
|
147
157
|
args: [`class._old-edge`]
|
|
148
|
-
}] } });
|
|
158
|
+
}], hasKeySteps: [] } });
|
|
149
159
|
|
|
150
|
-
// @dynamic
|
|
151
160
|
class TuiSliderKeyStepsDirective extends AbstractTuiControl {
|
|
152
161
|
constructor(control, changeDetectorRef, elementRef, slider) {
|
|
153
162
|
super(control, changeDetectorRef);
|
|
154
163
|
this.elementRef = elementRef;
|
|
155
164
|
this.slider = slider;
|
|
156
|
-
this.keyStepsInput = typedFromEvent(this.elementRef.nativeElement, `input`).pipe(map(() => this.controlValue));
|
|
157
165
|
}
|
|
158
166
|
get nativeFocusableElement() {
|
|
159
167
|
return this.computedDisabled ? null : this.elementRef.nativeElement;
|
|
@@ -162,24 +170,19 @@ class TuiSliderKeyStepsDirective extends AbstractTuiControl {
|
|
|
162
170
|
return tuiIsNativeFocused(this.nativeFocusableElement);
|
|
163
171
|
}
|
|
164
172
|
get min() {
|
|
165
|
-
|
|
166
|
-
return ((_a = this.keySteps[0]) === null || _a === void 0 ? void 0 : _a[1]) || 0;
|
|
173
|
+
return this.keySteps[0][1];
|
|
167
174
|
}
|
|
168
175
|
get max() {
|
|
169
|
-
|
|
170
|
-
return ((_a = this.keySteps[this.keySteps.length - 1]) === null || _a === void 0 ? void 0 : _a[1]) || 100;
|
|
171
|
-
}
|
|
172
|
-
get controlValue() {
|
|
173
|
-
return tuiPercentageToKeyStepValue(this.slider.valuePercentage, this.keySteps);
|
|
176
|
+
return this.keySteps[this.keySteps.length - 1][1];
|
|
174
177
|
}
|
|
175
178
|
updateControlValue() {
|
|
176
|
-
this.updateValue(this.
|
|
179
|
+
this.updateValue(tuiPercentageToKeyStepValue(this.slider.valuePercentage, this.keySteps));
|
|
177
180
|
}
|
|
178
181
|
writeValue(controlValue) {
|
|
179
182
|
if (controlValue === null) {
|
|
180
183
|
return;
|
|
181
184
|
}
|
|
182
|
-
const clampedControlValue =
|
|
185
|
+
const clampedControlValue = tuiClamp(controlValue, this.min, this.max);
|
|
183
186
|
tuiAssert.assert(controlValue === clampedControlValue, `\n[SliderKeySteps]: You cannot programmatically set value which is less/more than min/max`);
|
|
184
187
|
this.slider.value = this.transformToNativeValue(clampedControlValue);
|
|
185
188
|
}
|
|
@@ -192,15 +195,14 @@ class TuiSliderKeyStepsDirective extends AbstractTuiControl {
|
|
|
192
195
|
return (newValuePercentage * (max - min)) / 100 + min;
|
|
193
196
|
}
|
|
194
197
|
}
|
|
195
|
-
TuiSliderKeyStepsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSliderKeyStepsDirective, deps: [{ token: NgControl, optional: true, self: true }, { token: ChangeDetectorRef }, { token: ElementRef }, { token: TuiSliderComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
196
|
-
TuiSliderKeyStepsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiSliderKeyStepsDirective, selector: "input[tuiSlider][keySteps]", inputs: { keySteps: "keySteps" },
|
|
198
|
+
TuiSliderKeyStepsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSliderKeyStepsDirective, deps: [{ token: NgControl, optional: true, self: true }, { token: ChangeDetectorRef }, { token: ElementRef }, { token: forwardRef(() => TuiSliderComponent) }], target: i0.ɵɵFactoryTarget.Directive });
|
|
199
|
+
TuiSliderKeyStepsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiSliderKeyStepsDirective, selector: "input[tuiSlider][keySteps]", inputs: { keySteps: "keySteps" }, host: { listeners: { "input": "updateControlValue()", "change": "updateControlValue()" }, properties: { "attr.aria-valuenow": "safeCurrentValue", "attr.aria-valuemin": "min", "attr.aria-valuemax": "max" } }, usesInheritance: true, ngImport: i0 });
|
|
197
200
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSliderKeyStepsDirective, decorators: [{
|
|
198
201
|
type: Directive,
|
|
199
202
|
args: [{
|
|
200
203
|
selector: `input[tuiSlider][keySteps]`,
|
|
201
204
|
host: {
|
|
202
|
-
'[attr.
|
|
203
|
-
'[attr.aria-valuenow]': `controlValue`,
|
|
205
|
+
'[attr.aria-valuenow]': `safeCurrentValue`,
|
|
204
206
|
'[attr.aria-valuemin]': `min`,
|
|
205
207
|
'[attr.aria-valuemax]': `max`,
|
|
206
208
|
},
|
|
@@ -220,12 +222,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
220
222
|
args: [ElementRef]
|
|
221
223
|
}] }, { type: TuiSliderComponent, decorators: [{
|
|
222
224
|
type: Inject,
|
|
223
|
-
args: [TuiSliderComponent]
|
|
225
|
+
args: [forwardRef(() => TuiSliderComponent)]
|
|
224
226
|
}] }]; }, propDecorators: { keySteps: [{
|
|
225
227
|
type: Input
|
|
226
|
-
}], keyStepsInput: [{
|
|
227
|
-
type: Output
|
|
228
228
|
}], updateControlValue: [{
|
|
229
|
+
type: HostListener,
|
|
230
|
+
args: [`input`]
|
|
231
|
+
}, {
|
|
229
232
|
type: HostListener,
|
|
230
233
|
args: [`change`]
|
|
231
234
|
}] } });
|
|
@@ -244,17 +247,16 @@ const SLIDER_INTERACTION_KEYS = new Set([
|
|
|
244
247
|
* Native <input type='range' readonly> doesn't work.
|
|
245
248
|
* This directive imitates this native behaviour.
|
|
246
249
|
*/
|
|
247
|
-
// @dynamic
|
|
248
250
|
class TuiSliderReadonlyDirective {
|
|
249
251
|
constructor(elementRef, documentRef, destroy$) {
|
|
250
252
|
this.readonly = true;
|
|
251
|
-
const touchStart$ =
|
|
253
|
+
const touchStart$ = tuiTypedFromEvent(elementRef.nativeElement, `touchstart`, {
|
|
252
254
|
passive: false,
|
|
253
255
|
});
|
|
254
|
-
const touchMove$ =
|
|
256
|
+
const touchMove$ = tuiTypedFromEvent(documentRef, `touchmove`, {
|
|
255
257
|
passive: false,
|
|
256
258
|
});
|
|
257
|
-
const touchEnd$ =
|
|
259
|
+
const touchEnd$ = tuiTypedFromEvent(documentRef, `touchend`, {
|
|
258
260
|
passive: true,
|
|
259
261
|
});
|
|
260
262
|
const shouldPreventMove$ = merge(touchStart$.pipe(tap(e => this.preventEvent(e)), mapTo(true)), touchEnd$.pipe(mapTo(false)));
|