@taiga-ui/kit 2.40.0 → 2.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstract/input-slider.d.ts +27 -9
- package/abstract/slider/slider.d.ts +3 -6
- package/abstract/taiga-ui-kit-abstract.metadata.json +1 -1
- package/bundles/taiga-ui-kit-abstract.umd.js +43 -64
- package/bundles/taiga-ui-kit-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-abstract.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-abstract.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-avatar.umd.js +27 -5
- package/bundles/taiga-ui-kit-components-avatar.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-avatar.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-avatar.umd.min.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-breadcrumbs.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-breadcrumbs.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-calendar-month.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-calendar-month.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-calendar-month.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-calendar-month.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-labeled.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-labeled.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-labeled.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-labeled.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-checkbox.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-checkbox.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.js +3 -3
- package/bundles/taiga-ui-kit-components-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.min.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-filter.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-filter.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-copy.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-copy.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-copy.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-copy.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-count.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-count.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-count.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-count.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-range.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-date-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-range.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-date-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-time.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-date-time.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-time.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-date-time.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-date.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-date.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-file.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-file.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-file.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-file.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-files.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-files.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-files.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-month.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-month.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-input-number.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-password.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-password.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-password.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-password.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-phone.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-phone.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-phone.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-phone.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.js +196 -164
- package/bundles/taiga-ui-kit-components-input-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.js +6 -18
- package/bundles/taiga-ui-kit-components-input-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.js +5 -5
- package/bundles/taiga-ui-kit-components-input-tag.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input.umd.min.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-marker-icon.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-marker-icon.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pagination.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-pagination.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pagination.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-pagination.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-progress.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-progress.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-progress.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-progress.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-radio.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-range.umd.js +221 -31
- package/bundles/taiga-ui-kit-components-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-range.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-rating.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-rating.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-rating.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-rating.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.js +62 -6
- package/bundles/taiga-ui-kit-components-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-stepper.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-stepper.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-stepper.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-stepper.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tabs.umd.js +38 -36
- package/bundles/taiga-ui-kit-components-tabs.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tabs.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-tabs.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tag.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-tag.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tag.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-tag.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-text-area.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-text-area.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-text-area.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-text-area.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-toggle.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-toggle.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-toggle.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-tokens.umd.js +6 -0
- package/bundles/taiga-ui-kit-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-tokens.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-tokens.umd.min.js.map +1 -1
- package/components/accordion/taiga-ui-kit-components-accordion.metadata.json +1 -1
- package/components/action/taiga-ui-kit-components-action.metadata.json +1 -1
- package/components/avatar/avatar-options.d.ts +11 -0
- package/components/avatar/avatar.component.d.ts +4 -2
- package/components/avatar/index.d.ts +1 -0
- package/components/avatar/taiga-ui-kit-components-avatar.metadata.json +1 -1
- package/components/breadcrumbs/taiga-ui-kit-components-breadcrumbs.metadata.json +1 -1
- package/components/calendar-month/taiga-ui-kit-components-calendar-month.metadata.json +1 -1
- package/components/carousel/taiga-ui-kit-components-carousel.metadata.json +1 -1
- package/components/checkbox/taiga-ui-kit-components-checkbox.metadata.json +1 -1
- package/components/checkbox-labeled/taiga-ui-kit-components-checkbox-labeled.metadata.json +1 -1
- package/components/combo-box/taiga-ui-kit-components-combo-box.metadata.json +1 -1
- package/components/data-list-wrapper/taiga-ui-kit-components-data-list-wrapper.metadata.json +1 -1
- package/components/files/taiga-ui-kit-components-files.metadata.json +1 -1
- package/components/filter/taiga-ui-kit-components-filter.metadata.json +1 -1
- package/components/input/taiga-ui-kit-components-input.metadata.json +1 -1
- package/components/input-copy/taiga-ui-kit-components-input-copy.metadata.json +1 -1
- package/components/input-count/taiga-ui-kit-components-input-count.metadata.json +1 -1
- package/components/input-date/taiga-ui-kit-components-input-date.metadata.json +1 -1
- package/components/input-date-range/taiga-ui-kit-components-input-date-range.metadata.json +1 -1
- package/components/input-date-time/taiga-ui-kit-components-input-date-time.metadata.json +1 -1
- package/components/input-file/taiga-ui-kit-components-input-file.metadata.json +1 -1
- package/components/input-files/taiga-ui-kit-components-input-files.metadata.json +1 -1
- package/components/input-month/taiga-ui-kit-components-input-month.metadata.json +1 -1
- package/components/input-month-range/taiga-ui-kit-components-input-month-range.metadata.json +1 -1
- package/components/input-number/taiga-ui-kit-components-input-number.metadata.json +1 -1
- package/components/input-password/taiga-ui-kit-components-input-password.metadata.json +1 -1
- package/components/input-phone/taiga-ui-kit-components-input-phone.metadata.json +1 -1
- package/components/input-range/input-range.component.d.ts +44 -31
- package/components/input-range/taiga-ui-kit-components-input-range.metadata.json +1 -1
- package/components/input-slider/input-slider.component.d.ts +2 -8
- package/components/input-slider/taiga-ui-kit-components-input-slider.metadata.json +1 -1
- package/components/input-tag/input-tag.component.d.ts +1 -1
- package/components/input-tag/taiga-ui-kit-components-input-tag.metadata.json +1 -1
- package/components/marker-icon/taiga-ui-kit-components-marker-icon.metadata.json +1 -1
- package/components/multi-select/taiga-ui-kit-components-multi-select.metadata.json +1 -1
- package/components/pagination/taiga-ui-kit-components-pagination.metadata.json +1 -1
- package/components/pdf-viewer/taiga-ui-kit-components-pdf-viewer.metadata.json +1 -1
- package/components/progress/taiga-ui-kit-components-progress.metadata.json +1 -1
- package/components/radio/taiga-ui-kit-components-radio.metadata.json +1 -1
- package/components/range/index.d.ts +1 -0
- package/components/range/range-change.directive.d.ts +20 -0
- package/components/range/range.component.d.ts +33 -5
- package/components/range/taiga-ui-kit-components-range.metadata.json +1 -1
- package/components/rating/taiga-ui-kit-components-rating.metadata.json +1 -1
- package/components/select/taiga-ui-kit-components-select.metadata.json +1 -1
- package/components/slider/index.d.ts +1 -0
- package/components/slider/slider-old.component.d.ts +3 -1
- package/components/slider/slider-readonly.directive.d.ts +9 -0
- package/components/slider/taiga-ui-kit-components-slider.metadata.json +1 -1
- package/components/stepper/taiga-ui-kit-components-stepper.metadata.json +1 -1
- package/components/tabs/index.d.ts +0 -1
- package/components/tabs/tab/tab.component.d.ts +2 -1
- package/components/tabs/tabs/tabs.component.d.ts +2 -3
- package/components/tabs/tabs-with-more/tabs-with-more.component.d.ts +4 -1
- package/components/tabs/taiga-ui-kit-components-tabs.metadata.json +1 -1
- package/components/tag/taiga-ui-kit-components-tag.metadata.json +1 -1
- package/components/text-area/taiga-ui-kit-components-text-area.metadata.json +1 -1
- package/components/toggle/taiga-ui-kit-components-toggle.metadata.json +1 -1
- package/esm2015/abstract/input-slider.js +30 -37
- package/esm2015/abstract/slider/slider.js +13 -19
- package/esm2015/components/accordion/accordion-item/accordion-item.component.js +2 -2
- package/esm2015/components/action/action.component.js +2 -2
- package/esm2015/components/avatar/avatar-options.js +15 -0
- package/esm2015/components/avatar/avatar.component.js +14 -8
- package/esm2015/components/avatar/index.js +2 -1
- package/esm2015/components/breadcrumbs/breadcrumbs-wrapper.component.js +2 -2
- package/esm2015/components/calendar-month/calendar-month.component.js +2 -2
- package/esm2015/components/carousel/carousel.component.js +2 -2
- package/esm2015/components/checkbox/checkbox.component.js +1 -1
- package/esm2015/components/checkbox-labeled/checkbox-labeled.component.js +2 -2
- package/esm2015/components/combo-box/combo-box.component.js +2 -2
- package/esm2015/components/data-list-wrapper/data-list-group-wrapper.component.js +2 -2
- package/esm2015/components/data-list-wrapper/data-list-wrapper.component.js +2 -2
- package/esm2015/components/files/file/file.component.js +2 -2
- package/esm2015/components/files/files.component.js +3 -3
- package/esm2015/components/filter/filter.component.js +2 -2
- package/esm2015/components/input/input.component.js +2 -2
- package/esm2015/components/input-copy/input-copy.component.js +2 -2
- package/esm2015/components/input-count/input-count.component.js +2 -2
- package/esm2015/components/input-date/input-date.component.js +2 -2
- package/esm2015/components/input-date-range/input-date-range.component.js +2 -2
- package/esm2015/components/input-date-time/input-date-time.component.js +2 -2
- package/esm2015/components/input-file/file/file.component.js +2 -2
- package/esm2015/components/input-files/input-files.component.js +1 -1
- package/esm2015/components/input-month/input-month.component.js +2 -2
- package/esm2015/components/input-month-range/input-month-range.component.js +2 -2
- package/esm2015/components/input-number/input-number.component.js +3 -3
- package/esm2015/components/input-password/input-password.component.js +2 -2
- package/esm2015/components/input-phone/input-phone.component.js +2 -2
- package/esm2015/components/input-range/input-range.component.js +192 -156
- package/esm2015/components/input-range/input-range.module.js +13 -15
- package/esm2015/components/input-slider/input-slider.component.js +8 -20
- package/esm2015/components/input-tag/input-tag.component.js +6 -6
- package/esm2015/components/marker-icon/marker-icon.component.js +2 -2
- package/esm2015/components/multi-select/multi-select.component.js +2 -2
- package/esm2015/components/pagination/pagination.component.js +2 -2
- package/esm2015/components/pdf-viewer/pdf-viewer.component.js +2 -2
- package/esm2015/components/progress/progress-circle/progress-circle.component.js +2 -2
- package/esm2015/components/progress/progress-segmented/progress-segmented.component.js +2 -2
- package/esm2015/components/radio/radio.component.js +3 -3
- package/esm2015/components/range/index.js +2 -1
- package/esm2015/components/range/range-change.directive.js +83 -0
- package/esm2015/components/range/range.component.js +118 -28
- package/esm2015/components/range/range.module.js +10 -7
- package/esm2015/components/rating/rating.component.js +2 -2
- package/esm2015/components/select/select.component.js +2 -2
- package/esm2015/components/slider/index.js +2 -1
- package/esm2015/components/slider/slider-key-steps.directive.js +2 -2
- package/esm2015/components/slider/slider-old.component.js +11 -5
- package/esm2015/components/slider/slider-readonly.directive.js +50 -0
- package/esm2015/components/slider/slider.component.js +1 -1
- package/esm2015/components/slider/slider.module.js +4 -1
- package/esm2015/components/stepper/step/step.component.js +2 -2
- package/esm2015/components/tabs/index.js +1 -2
- package/esm2015/components/tabs/tab/tab.component.js +13 -9
- package/esm2015/components/tabs/tabs/tabs.component.js +5 -11
- package/esm2015/components/tabs/tabs-with-more/tabs-with-more.component.js +24 -16
- package/esm2015/components/tabs/underline/underline.component.js +2 -2
- package/esm2015/components/tag/tag.component.js +3 -3
- package/esm2015/components/text-area/text-area.component.js +3 -3
- package/esm2015/components/toggle/toggle.component.js +1 -1
- package/esm2015/tokens/index.js +2 -1
- package/esm2015/tokens/mobile-aware.js +2 -1
- package/esm2015/tokens/tab-margin.js +5 -0
- package/esm5/abstract/input-slider.js +30 -48
- package/esm5/abstract/slider/slider.js +13 -19
- package/esm5/components/accordion/accordion-item/accordion-item.component.js +2 -2
- package/esm5/components/action/action.component.js +2 -2
- package/esm5/components/avatar/avatar-options.js +16 -0
- package/esm5/components/avatar/avatar.component.js +14 -8
- package/esm5/components/avatar/index.js +2 -1
- package/esm5/components/breadcrumbs/breadcrumbs-wrapper.component.js +2 -2
- package/esm5/components/calendar-month/calendar-month.component.js +2 -2
- package/esm5/components/carousel/carousel.component.js +2 -2
- package/esm5/components/checkbox/checkbox.component.js +1 -1
- package/esm5/components/checkbox-labeled/checkbox-labeled.component.js +2 -2
- package/esm5/components/combo-box/combo-box.component.js +2 -2
- package/esm5/components/data-list-wrapper/data-list-group-wrapper.component.js +2 -2
- package/esm5/components/data-list-wrapper/data-list-wrapper.component.js +2 -2
- package/esm5/components/files/file/file.component.js +2 -2
- package/esm5/components/files/files.component.js +3 -3
- package/esm5/components/filter/filter.component.js +2 -2
- package/esm5/components/input/input.component.js +2 -2
- package/esm5/components/input-copy/input-copy.component.js +2 -2
- package/esm5/components/input-count/input-count.component.js +2 -2
- package/esm5/components/input-date/input-date.component.js +2 -2
- package/esm5/components/input-date-range/input-date-range.component.js +2 -2
- package/esm5/components/input-date-time/input-date-time.component.js +2 -2
- package/esm5/components/input-file/file/file.component.js +2 -2
- package/esm5/components/input-files/input-files.component.js +1 -1
- package/esm5/components/input-month/input-month.component.js +2 -2
- package/esm5/components/input-month-range/input-month-range.component.js +2 -2
- package/esm5/components/input-number/input-number.component.js +3 -3
- package/esm5/components/input-password/input-password.component.js +2 -2
- package/esm5/components/input-phone/input-phone.component.js +2 -2
- package/esm5/components/input-range/input-range.component.js +194 -157
- package/esm5/components/input-range/input-range.module.js +13 -15
- package/esm5/components/input-slider/input-slider.component.js +8 -20
- package/esm5/components/input-tag/input-tag.component.js +6 -6
- package/esm5/components/marker-icon/marker-icon.component.js +2 -2
- package/esm5/components/multi-select/multi-select.component.js +2 -2
- package/esm5/components/pagination/pagination.component.js +2 -2
- package/esm5/components/pdf-viewer/pdf-viewer.component.js +2 -2
- package/esm5/components/progress/progress-circle/progress-circle.component.js +2 -2
- package/esm5/components/progress/progress-segmented/progress-segmented.component.js +2 -2
- package/esm5/components/radio/radio.component.js +3 -3
- package/esm5/components/range/index.js +2 -1
- package/esm5/components/range/range-change.directive.js +101 -0
- package/esm5/components/range/range.component.js +126 -29
- package/esm5/components/range/range.module.js +10 -7
- package/esm5/components/rating/rating.component.js +2 -2
- package/esm5/components/select/select.component.js +2 -2
- package/esm5/components/slider/index.js +2 -1
- package/esm5/components/slider/slider-key-steps.directive.js +2 -2
- package/esm5/components/slider/slider-old.component.js +11 -5
- package/esm5/components/slider/slider-readonly.directive.js +51 -0
- package/esm5/components/slider/slider.component.js +1 -1
- package/esm5/components/slider/slider.module.js +4 -1
- package/esm5/components/stepper/step/step.component.js +2 -2
- package/esm5/components/tabs/index.js +1 -2
- package/esm5/components/tabs/tab/tab.component.js +13 -9
- package/esm5/components/tabs/tabs/tabs.component.js +5 -15
- package/esm5/components/tabs/tabs-with-more/tabs-with-more.component.js +27 -16
- package/esm5/components/tabs/underline/underline.component.js +2 -2
- package/esm5/components/tag/tag.component.js +3 -3
- package/esm5/components/text-area/text-area.component.js +3 -3
- package/esm5/components/toggle/toggle.component.js +1 -1
- package/esm5/tokens/index.js +2 -1
- package/esm5/tokens/mobile-aware.js +2 -1
- package/esm5/tokens/tab-margin.js +5 -0
- package/fesm2015/taiga-ui-kit-abstract.js +43 -55
- package/fesm2015/taiga-ui-kit-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-accordion.js +1 -1
- package/fesm2015/taiga-ui-kit-components-accordion.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-action.js +1 -1
- package/fesm2015/taiga-ui-kit-components-action.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-avatar.js +27 -8
- package/fesm2015/taiga-ui-kit-components-avatar.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 +1 -1
- package/fesm2015/taiga-ui-kit-components-calendar-month.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-carousel.js +1 -1
- package/fesm2015/taiga-ui-kit-components-carousel.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox-labeled.js +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox-labeled.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox.js +1 -1
- package/fesm2015/taiga-ui-kit-components-combo-box.js +1 -1
- package/fesm2015/taiga-ui-kit-components-combo-box.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-data-list-wrapper.js +2 -2
- package/fesm2015/taiga-ui-kit-components-data-list-wrapper.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-files.js +3 -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 +1 -1
- package/fesm2015/taiga-ui-kit-components-input-copy.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-count.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-count.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-range.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-time.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-time.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-file.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-file.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-files.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month-range.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-number.js +2 -2
- package/fesm2015/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-password.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-password.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-range.js +198 -167
- package/fesm2015/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-slider.js +7 -19
- package/fesm2015/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-tag.js +5 -5
- package/fesm2015/taiga-ui-kit-components-input-tag.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input.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.js +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-pagination.js +1 -1
- package/fesm2015/taiga-ui-kit-components-pagination.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-pdf-viewer.js +1 -1
- package/fesm2015/taiga-ui-kit-components-pdf-viewer.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-progress.js +2 -2
- package/fesm2015/taiga-ui-kit-components-progress.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio.js +2 -2
- package/fesm2015/taiga-ui-kit-components-radio.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-range.js +199 -34
- package/fesm2015/taiga-ui-kit-components-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-rating.js +1 -1
- package/fesm2015/taiga-ui-kit-components-rating.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-select.js +1 -1
- package/fesm2015/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-slider.js +61 -7
- package/fesm2015/taiga-ui-kit-components-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-stepper.js +1 -1
- package/fesm2015/taiga-ui-kit-components-stepper.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tabs.js +39 -34
- package/fesm2015/taiga-ui-kit-components-tabs.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tag.js +2 -2
- package/fesm2015/taiga-ui-kit-components-tag.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-text-area.js +2 -2
- package/fesm2015/taiga-ui-kit-components-text-area.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-toggle.js +1 -1
- package/fesm2015/taiga-ui-kit-tokens.js +6 -1
- package/fesm2015/taiga-ui-kit-tokens.js.map +1 -1
- package/fesm5/taiga-ui-kit-abstract.js +43 -66
- package/fesm5/taiga-ui-kit-abstract.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-accordion.js +1 -1
- package/fesm5/taiga-ui-kit-components-accordion.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-action.js +1 -1
- package/fesm5/taiga-ui-kit-components-action.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-avatar.js +27 -8
- package/fesm5/taiga-ui-kit-components-avatar.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-breadcrumbs.js +1 -1
- package/fesm5/taiga-ui-kit-components-breadcrumbs.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-calendar-month.js +1 -1
- package/fesm5/taiga-ui-kit-components-calendar-month.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-carousel.js +1 -1
- package/fesm5/taiga-ui-kit-components-carousel.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-checkbox-labeled.js +1 -1
- package/fesm5/taiga-ui-kit-components-checkbox-labeled.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-checkbox.js +1 -1
- package/fesm5/taiga-ui-kit-components-combo-box.js +1 -1
- package/fesm5/taiga-ui-kit-components-combo-box.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-data-list-wrapper.js +2 -2
- package/fesm5/taiga-ui-kit-components-data-list-wrapper.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-files.js +3 -3
- package/fesm5/taiga-ui-kit-components-files.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-filter.js +1 -1
- package/fesm5/taiga-ui-kit-components-filter.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-copy.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-copy.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-count.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-count.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-date-range.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-date-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-date-time.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-date-time.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-date.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-date.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-file.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-file.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-files.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-month-range.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-month-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-month.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-month.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-number.js +2 -2
- package/fesm5/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-password.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-password.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-phone.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-phone.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-range.js +200 -168
- package/fesm5/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-slider.js +7 -19
- package/fesm5/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-tag.js +5 -5
- package/fesm5/taiga-ui-kit-components-input-tag.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input.js +1 -1
- package/fesm5/taiga-ui-kit-components-input.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-marker-icon.js +1 -1
- package/fesm5/taiga-ui-kit-components-marker-icon.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-multi-select.js +1 -1
- package/fesm5/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-pagination.js +1 -1
- package/fesm5/taiga-ui-kit-components-pagination.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-pdf-viewer.js +1 -1
- package/fesm5/taiga-ui-kit-components-pdf-viewer.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-progress.js +2 -2
- package/fesm5/taiga-ui-kit-components-progress.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-radio.js +2 -2
- package/fesm5/taiga-ui-kit-components-radio.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-range.js +225 -35
- package/fesm5/taiga-ui-kit-components-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-rating.js +1 -1
- package/fesm5/taiga-ui-kit-components-rating.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-select.js +1 -1
- package/fesm5/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-slider.js +62 -7
- package/fesm5/taiga-ui-kit-components-slider.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-stepper.js +1 -1
- package/fesm5/taiga-ui-kit-components-stepper.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-tabs.js +42 -38
- package/fesm5/taiga-ui-kit-components-tabs.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-tag.js +2 -2
- package/fesm5/taiga-ui-kit-components-tag.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-text-area.js +2 -2
- package/fesm5/taiga-ui-kit-components-text-area.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-toggle.js +1 -1
- package/fesm5/taiga-ui-kit-tokens.js +6 -1
- package/fesm5/taiga-ui-kit-tokens.js.map +1 -1
- package/package.json +4 -4
- package/tokens/index.d.ts +1 -0
- package/tokens/mobile-aware.d.ts +1 -0
- package/tokens/tab-margin.d.ts +2 -0
- package/tokens/taiga-ui-kit-tokens.metadata.json +1 -1
- package/components/tabs/tabs.const.d.ts +0 -2
- package/esm2015/components/tabs/tabs.const.js +0 -3
- package/esm5/components/tabs/tabs.const.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-phone.js","sources":["ng://@taiga-ui/kit/components/input-phone/input-phone.providers.ts","ng://@taiga-ui/kit/components/input-phone/input-phone.component.ts","ng://@taiga-ui/kit/components/input-phone/input-phone.directive.ts","ng://@taiga-ui/kit/components/input-phone/input-phone.module.ts","ng://@taiga-ui/kit/components/input-phone/taiga-ui-kit-components-input-phone.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {forwardRef, InjectionToken} from '@angular/core';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiDestroyService,\n} from '@taiga-ui/cdk';\nimport {TUI_DATA_LIST_HOST} from '@taiga-ui/core';\nimport {FIXED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit/providers';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {flatMap, startWith, takeUntil, windowToggle} from 'rxjs/operators';\n\nimport {TuiInputPhoneComponent} from './input-phone.component';\n\nexport const SELECTION_STREAM = new InjectionToken<Observable<unknown>>(\n 'A stream of selection changes',\n);\nexport const INPUT_PHONE_PROVIDERS = [\n TuiDestroyService,\n FIXED_DROPDOWN_CONTROLLER_PROVIDER,\n {\n provide: AbstractTuiControl,\n useExisting: forwardRef(() => TuiInputPhoneComponent),\n },\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputPhoneComponent),\n },\n {\n provide: TUI_DATA_LIST_HOST,\n useExisting: forwardRef(() => TuiInputPhoneComponent),\n },\n {\n provide: SELECTION_STREAM,\n deps: [TuiDestroyService, DOCUMENT],\n useFactory: selectionStreamFactory,\n },\n];\n\nexport function selectionStreamFactory(\n destroy$: Observable<unknown>,\n documentRef: Document,\n): Observable<unknown> {\n return fromEvent(documentRef, 'selectionchange').pipe(\n windowToggle(\n merge(fromEvent(documentRef, 'mouseup'), fromEvent(documentRef, 'keydown')),\n () => fromEvent(documentRef, 'mousedown'),\n ),\n flatMap(windowed$ => windowed$.pipe(startWith(null))),\n takeUntil(destroy$),\n );\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n EventEmitter,\n Inject,\n Input,\n Optional,\n Output,\n Self,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiControl,\n getClipboardDataText,\n isNativeFocused,\n setNativeFocused,\n TuiActiveZoneDirective,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiInputModeT,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n formatPhone,\n TUI_MASK_SYMBOLS_REGEXP,\n TUI_TEXTFIELD_CLEANER,\n TuiDataListDirective,\n TuiDataListHost,\n TuiHostedDropdownComponent,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldCleanerDirective,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\nimport {Observable} from 'rxjs';\n\nimport {INPUT_PHONE_PROVIDERS, SELECTION_STREAM} from './input-phone.providers';\n\n// @dynamic\n@Component({\n selector: 'tui-input-phone',\n templateUrl: './input-phone.template.html',\n styleUrls: ['./input-phone.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: INPUT_PHONE_PROVIDERS,\n})\nexport class TuiInputPhoneComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor, TuiDataListHost<string>\n{\n @ViewChild(TuiHostedDropdownComponent)\n private readonly dropdown?: TuiHostedDropdownComponent;\n\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly textfield?: TuiPrimitiveTextfieldComponent;\n\n @Input('countryCode')\n @tuiRequiredSetter()\n set countryCodeSetter(countryCode: string) {\n this.updateValueWithNewCountryCode(countryCode);\n this.countryCode = countryCode;\n }\n\n @Input()\n @tuiDefaultProp()\n phoneMaskAfterCountryCode = '(###) ###-##-##';\n\n @Input()\n @tuiDefaultProp()\n allowText = false;\n\n @Input()\n @tuiDefaultProp()\n search = '';\n\n @Output()\n readonly searchChange = new EventEmitter<string>();\n\n @ContentChild(TuiDataListDirective, {read: TemplateRef})\n readonly datalist?: TemplateRef<TuiContextWithImplicit<TuiActiveZoneDirective>>;\n\n readonly textMaskOptions: TextMaskConfig = {\n mask: value =>\n this.allowText && !this.value && isText(value) && value !== '+'\n ? false\n : [\n ...this.countryCode.split(''),\n ' ',\n ...this.phoneMaskAfterCountryCode\n .replace(/[^#\\- ()]+/g, '')\n .split('')\n .map(item => (item === '#' ? /\\d/ : item)),\n ],\n pipe: value => {\n if (this.allowText) {\n return value;\n }\n\n return value === '' && this.focused && !this.readOnly\n ? `${this.countryCode} `\n : value.replace(/-$/, '');\n },\n guide: false,\n } as TuiTextMaskOptions as unknown as TextMaskConfig;\n\n countryCode = '+7';\n\n open = false;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(SELECTION_STREAM)\n selection$: Observable<unknown>,\n @Inject(TUI_TEXTFIELD_CLEANER)\n private readonly textfieldCleaner: TuiTextfieldCleanerDirective,\n ) {\n super(control, changeDetectorRef);\n\n selection$.subscribe(() => {\n this.setCaretPosition();\n });\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return !this.textfield || this.computedDisabled\n ? null\n : this.textfield.nativeFocusableElement;\n }\n\n get focused(): boolean {\n return (\n isNativeFocused(this.nativeFocusableElement) ||\n (!!this.dropdown && this.dropdown.focused)\n );\n }\n\n get computedValue(): string {\n return this.value\n ? formatPhone(this.value, this.countryCode, this.phoneMaskAfterCountryCode)\n : this.search || '';\n }\n\n get inputMode(): TuiInputModeT {\n return this.allowText ? 'text' : 'numeric';\n }\n\n get canOpen(): boolean {\n return this.interactive && !!this.datalist;\n }\n\n get canClean(): boolean {\n return this.computedValue !== this.countryCode && this.textfieldCleaner.cleaner;\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onDrop(event: DragEvent) {\n if (!event.dataTransfer) {\n return;\n }\n\n this.setValueWithoutPrefix(event.dataTransfer.getData('text'));\n event.preventDefault();\n }\n\n onPaste(event: ClipboardEvent) {\n this.setValueWithoutPrefix(getClipboardDataText(event));\n }\n\n onActiveZone(active: boolean) {\n this.updateFocused(active);\n\n if (active && !this.computedValue && !this.readOnly && !this.allowText) {\n this.updateSearch(this.countryCode);\n\n return;\n }\n\n if (\n this.computedValue === this.countryCode ||\n (this.search !== null &&\n isNaN(parseInt(this.search.replace(TUI_MASK_SYMBOLS_REGEXP, ''), 10)))\n ) {\n this.updateSearch('');\n }\n }\n\n onBackspace(event: KeyboardEvent) {\n const target = event.target as HTMLInputElement;\n\n if (\n (target.selectionStart || 0) <= this.nonRemovableLength &&\n target.selectionStart === target.selectionEnd\n ) {\n event.preventDefault();\n }\n }\n\n onValueChange(value: string) {\n value = value === '' ? this.countryCode : value;\n\n const parsed = isText(value) ? value : value.replace(TUI_MASK_SYMBOLS_REGEXP, '');\n\n this.updateSearch(parsed);\n this.updateValue(parsed === this.countryCode || isText(parsed) ? '' : parsed);\n this.open = true;\n }\n\n handleOption(item: string) {\n this.focusInput();\n this.updateValue(item);\n this.updateSearch('');\n this.open = false;\n }\n\n setDisabledState() {\n super.setDisabledState();\n this.open = false;\n }\n\n writeValue(value: string | null) {\n super.writeValue(value);\n this.updateSearch('');\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n\n private get caretIsInForbiddenArea(): boolean {\n const {nativeFocusableElement} = this;\n\n if (!nativeFocusableElement) {\n return false;\n }\n\n const {selectionStart, selectionEnd} = nativeFocusableElement;\n\n return (\n isNativeFocused(nativeFocusableElement) &&\n selectionStart !== null &&\n selectionStart < this.nonRemovableLength &&\n selectionStart === selectionEnd\n );\n }\n\n private get nonRemovableLength(): number {\n return this.isTextValue ? 0 : this.countryCode.length + 1;\n }\n\n private get maxPhoneLength(): number {\n return (\n this.countryCode.length +\n this.phoneMaskAfterCountryCode.replace(/[^#]+/g, '').length\n );\n }\n\n private get isTextValue(): boolean {\n return !!this.search && isText(this.search);\n }\n\n private setCaretPosition() {\n if (this.caretIsInForbiddenArea && !!this.nativeFocusableElement) {\n this.nativeFocusableElement.setSelectionRange(\n this.nonRemovableLength,\n this.nonRemovableLength,\n );\n }\n }\n\n private setValueWithoutPrefix(value: string) {\n if (this.readOnly) {\n return;\n }\n\n this.open = true;\n this.updateValue(this.cleanValue(value));\n this.updateSearch(\n this.allowText && isText(value)\n ? value\n : value.replace(TUI_MASK_SYMBOLS_REGEXP, ''),\n );\n }\n\n private cleanValue(value: string): string {\n const reg: RegExp =\n this.countryCode === '+7'\n ? /^7|^8/\n : new RegExp(this.countryCode.substring(1));\n const oldValueExist =\n this.value.length > this.countryCode.length &&\n this.value.length < this.maxPhoneLength;\n const newValueLength = value.replace(TUI_MASK_SYMBOLS_REGEXP, '').length;\n const cleanNewValue = value.replace(/[^0-9]+/g, '');\n const selectionLength = String(getSelection()).length;\n\n if (oldValueExist && selectionLength === 0) {\n return `${this.value}${cleanNewValue}`.slice(0, this.maxPhoneLength);\n }\n\n if (newValueLength < this.maxPhoneLength - 1) {\n return `${this.countryCode}${cleanNewValue}`.slice(0, this.maxPhoneLength);\n }\n\n return `${this.countryCode}${cleanNewValue.replace(reg, '')}`.slice(\n 0,\n this.maxPhoneLength,\n );\n }\n\n private focusInput() {\n if (this.nativeFocusableElement) {\n setNativeFocused(this.nativeFocusableElement, true, true);\n }\n }\n\n private updateSearch(search: string) {\n if (this.search === search) {\n return;\n }\n\n this.search = search;\n this.searchChange.emit(search);\n }\n\n private updateValueWithNewCountryCode(newCountryCode: string) {\n if (!this.isTextValue) {\n this.updateValue(this.value.replace(this.countryCode, newCountryCode));\n }\n }\n}\n\nfunction isText(value: string): boolean {\n return isNaN(parseInt(value.replace(TUI_MASK_SYMBOLS_REGEXP, ''), 10));\n}\n","import {Directive, DoCheck, forwardRef} from '@angular/core';\nimport {TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost} from '@taiga-ui/core';\n\nimport {TuiInputPhoneComponent} from './input-phone.component';\n\n@Directive({\n selector: 'tui-input-phone',\n providers: [\n {\n provide: TUI_TEXTFIELD_HOST,\n useExisting: forwardRef(() => TuiInputPhoneDirective),\n },\n ],\n})\nexport class TuiInputPhoneDirective\n extends TuiAbstractTextfieldHost<TuiInputPhoneComponent>\n implements DoCheck\n{\n input?: HTMLInputElement;\n\n get value(): string {\n return this.host.computedValue;\n }\n\n onValueChange(value: string) {\n this.host.onValueChange(value);\n }\n\n process(input: HTMLInputElement) {\n this.input = input;\n }\n\n ngDoCheck() {\n if (!this.input) {\n return;\n }\n\n this.input.type = 'tel';\n this.input.inputMode = this.host.inputMode;\n }\n}\n","import {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 {TuiValueAccessorModule} from '@taiga-ui/kit/directives';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputPhoneComponent} from './input-phone.component';\nimport {TuiInputPhoneDirective} from './input-phone.directive';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiHostedDropdownModule,\n TuiTextfieldControllerModule,\n TuiActiveZoneModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputPhoneComponent, TuiInputPhoneDirective],\n exports: [TuiInputPhoneComponent, TuiInputPhoneDirective, TuiTextfieldComponent],\n})\nexport class TuiInputPhoneModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAca,gBAAgB,GAAG,IAAI,cAAc,CAC9C,+BAA+B,EACjC;MACW,qBAAqB,GAAG;IACjC,iBAAiB;IACjB,kCAAkC;IAClC;QACI,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,UAAU,CAAC,MAAM,sBAAsB,CAAC;KACxD;IACD;QACI,OAAO,EAAE,2BAA2B;QACpC,WAAW,EAAE,UAAU,CAAC,MAAM,sBAAsB,CAAC;KACxD;IACD;QACI,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,UAAU,CAAC,MAAM,sBAAsB,CAAC;KACxD;IACD;QACI,OAAO,EAAE,gBAAgB;QACzB,IAAI,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;QACnC,UAAU,EAAE,sBAAsB;KACrC;EACH;SAEc,sBAAsB,CAClC,QAA6B,EAC7B,WAAqB;IAErB,OAAO,SAAS,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,IAAI,CACjD,YAAY,CACR,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,EAC3E,MAAM,S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BAAnC,MAAa,sBACT,SAAQ,wBAAgD;IAKxD,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;KAClC;IAED,aAAa,CAAC,KAAa;QACvB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KAClC;IAED,OAAO,CAAC,KAAuB;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;KACtB;IAED,SAAS;QACL,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACb,OAAO;SACV;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;KAC9C;EACJ;AA1BY,sBAAsB;IATlC,SAAS,CAAC;QACP,QAAQ,EAAE,iBAAiB;QAC3B,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,kBAAkB;gBAC3B,WAAW,EAAE,UAAU,CAAC,MAAM,wBAAsB,CAAC;aACxD;SACJ;KACJ,CAAC;GACW,sBAAsB,CA0BlC;;ICdY,mBAAmB,GAAhC,MAAa,mBAAmB;EAAG;AAAtB,mBAAmB;IAZ/B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,cAAc;YACd,2BAA2B;YAC3B,uBAAuB;YACvB,4BAA4B;YAC5B,mBAAmB;YACnB,sBAAsB;SACzB;QACD,YAAY,EAAE,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;QAC9D,OAAO,EAAE,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC;KACnF,CAAC;GACW,mBAAmB,CAAG;;AC1BnC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-phone.js","sources":["ng://@taiga-ui/kit/components/input-phone/input-phone.providers.ts","ng://@taiga-ui/kit/components/input-phone/input-phone.component.ts","ng://@taiga-ui/kit/components/input-phone/input-phone.directive.ts","ng://@taiga-ui/kit/components/input-phone/input-phone.module.ts","ng://@taiga-ui/kit/components/input-phone/taiga-ui-kit-components-input-phone.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {forwardRef, InjectionToken} from '@angular/core';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiDestroyService,\n} from '@taiga-ui/cdk';\nimport {TUI_DATA_LIST_HOST} from '@taiga-ui/core';\nimport {FIXED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit/providers';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {flatMap, startWith, takeUntil, windowToggle} from 'rxjs/operators';\n\nimport {TuiInputPhoneComponent} from './input-phone.component';\n\nexport const SELECTION_STREAM = new InjectionToken<Observable<unknown>>(\n 'A stream of selection changes',\n);\nexport const INPUT_PHONE_PROVIDERS = [\n TuiDestroyService,\n FIXED_DROPDOWN_CONTROLLER_PROVIDER,\n {\n provide: AbstractTuiControl,\n useExisting: forwardRef(() => TuiInputPhoneComponent),\n },\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputPhoneComponent),\n },\n {\n provide: TUI_DATA_LIST_HOST,\n useExisting: forwardRef(() => TuiInputPhoneComponent),\n },\n {\n provide: SELECTION_STREAM,\n deps: [TuiDestroyService, DOCUMENT],\n useFactory: selectionStreamFactory,\n },\n];\n\nexport function selectionStreamFactory(\n destroy$: Observable<unknown>,\n documentRef: Document,\n): Observable<unknown> {\n return fromEvent(documentRef, 'selectionchange').pipe(\n windowToggle(\n merge(fromEvent(documentRef, 'mouseup'), fromEvent(documentRef, 'keydown')),\n () => fromEvent(documentRef, 'mousedown'),\n ),\n flatMap(windowed$ => windowed$.pipe(startWith(null))),\n takeUntil(destroy$),\n );\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n EventEmitter,\n Inject,\n Input,\n Optional,\n Output,\n Self,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiControl,\n getClipboardDataText,\n isNativeFocused,\n setNativeFocused,\n TuiActiveZoneDirective,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiInputModeT,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n formatPhone,\n TUI_MASK_SYMBOLS_REGEXP,\n TUI_TEXTFIELD_CLEANER,\n TuiDataListDirective,\n TuiDataListHost,\n TuiHostedDropdownComponent,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldCleanerDirective,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\nimport {Observable} from 'rxjs';\n\nimport {INPUT_PHONE_PROVIDERS, SELECTION_STREAM} from './input-phone.providers';\n\n// @dynamic\n@Component({\n selector: 'tui-input-phone',\n templateUrl: './input-phone.template.html',\n styleUrls: ['./input-phone.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: INPUT_PHONE_PROVIDERS,\n})\nexport class TuiInputPhoneComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor, TuiDataListHost<string>\n{\n @ViewChild(TuiHostedDropdownComponent)\n private readonly dropdown?: TuiHostedDropdownComponent;\n\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly textfield?: TuiPrimitiveTextfieldComponent;\n\n @Input('countryCode')\n @tuiRequiredSetter()\n set countryCodeSetter(countryCode: string) {\n this.updateValueWithNewCountryCode(countryCode);\n this.countryCode = countryCode;\n }\n\n @Input()\n @tuiDefaultProp()\n phoneMaskAfterCountryCode = '(###) ###-##-##';\n\n @Input()\n @tuiDefaultProp()\n allowText = false;\n\n @Input()\n @tuiDefaultProp()\n search = '';\n\n @Output()\n readonly searchChange = new EventEmitter<string>();\n\n @ContentChild(TuiDataListDirective, {read: TemplateRef})\n readonly datalist?: TemplateRef<TuiContextWithImplicit<TuiActiveZoneDirective>>;\n\n readonly textMaskOptions: TextMaskConfig = {\n mask: value =>\n this.allowText && !this.value && isText(value) && value !== '+'\n ? false\n : [\n ...this.countryCode.split(''),\n ' ',\n ...this.phoneMaskAfterCountryCode\n .replace(/[^#\\- ()]+/g, '')\n .split('')\n .map(item => (item === '#' ? /\\d/ : item)),\n ],\n pipe: value => {\n if (this.allowText) {\n return value;\n }\n\n return value === '' && this.focused && !this.readOnly\n ? `${this.countryCode} `\n : value.replace(/-$/, '');\n },\n guide: false,\n } as TuiTextMaskOptions as unknown as TextMaskConfig;\n\n countryCode = '+7';\n\n open = false;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(SELECTION_STREAM)\n selection$: Observable<unknown>,\n @Inject(TUI_TEXTFIELD_CLEANER)\n private readonly textfieldCleaner: TuiTextfieldCleanerDirective,\n ) {\n super(control, changeDetectorRef);\n\n selection$.subscribe(() => {\n this.setCaretPosition();\n });\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return !this.textfield || this.computedDisabled\n ? null\n : this.textfield.nativeFocusableElement;\n }\n\n get focused(): boolean {\n return (\n isNativeFocused(this.nativeFocusableElement) ||\n (!!this.dropdown && this.dropdown.focused)\n );\n }\n\n get computedValue(): string {\n return this.value\n ? formatPhone(this.value, this.countryCode, this.phoneMaskAfterCountryCode)\n : this.search || '';\n }\n\n get inputMode(): TuiInputModeT {\n return this.allowText ? 'text' : 'numeric';\n }\n\n get canOpen(): boolean {\n return this.interactive && !!this.datalist;\n }\n\n get canClean(): boolean {\n return this.computedValue !== this.countryCode && this.textfieldCleaner.cleaner;\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onDrop(event: DragEvent) {\n if (!event.dataTransfer) {\n return;\n }\n\n this.setValueWithoutPrefix(event.dataTransfer.getData('text'));\n event.preventDefault();\n }\n\n onPaste(event: ClipboardEvent) {\n this.setValueWithoutPrefix(getClipboardDataText(event));\n }\n\n onActiveZone(active: boolean) {\n this.updateFocused(active);\n\n if (active && !this.computedValue && !this.readOnly && !this.allowText) {\n this.updateSearch(this.countryCode);\n\n return;\n }\n\n if (\n this.computedValue === this.countryCode ||\n (this.search !== null &&\n isNaN(parseInt(this.search.replace(TUI_MASK_SYMBOLS_REGEXP, ''), 10)))\n ) {\n this.updateSearch('');\n }\n }\n\n onBackspace(event: KeyboardEvent) {\n const target = event.target as HTMLInputElement;\n\n if (\n (target.selectionStart || 0) <= this.nonRemovableLength &&\n target.selectionStart === target.selectionEnd\n ) {\n event.preventDefault();\n }\n }\n\n onValueChange(value: string) {\n value = value === '' ? this.countryCode : value;\n\n const parsed = isText(value) ? value : value.replace(TUI_MASK_SYMBOLS_REGEXP, '');\n\n this.updateSearch(parsed);\n this.updateValue(parsed === this.countryCode || isText(parsed) ? '' : parsed);\n this.open = true;\n }\n\n handleOption(item: string) {\n this.focusInput();\n this.updateValue(item);\n this.updateSearch('');\n this.open = false;\n }\n\n setDisabledState() {\n super.setDisabledState();\n this.open = false;\n }\n\n writeValue(value: string | null) {\n super.writeValue(value);\n this.updateSearch('');\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n\n private get caretIsInForbiddenArea(): boolean {\n const {nativeFocusableElement} = this;\n\n if (!nativeFocusableElement) {\n return false;\n }\n\n const {selectionStart, selectionEnd} = nativeFocusableElement;\n\n return (\n isNativeFocused(nativeFocusableElement) &&\n selectionStart !== null &&\n selectionStart < this.nonRemovableLength &&\n selectionStart === selectionEnd\n );\n }\n\n private get nonRemovableLength(): number {\n return this.isTextValue ? 0 : this.countryCode.length + 1;\n }\n\n private get maxPhoneLength(): number {\n return (\n this.countryCode.length +\n this.phoneMaskAfterCountryCode.replace(/[^#]+/g, '').length\n );\n }\n\n private get isTextValue(): boolean {\n return !!this.search && isText(this.search);\n }\n\n private setCaretPosition() {\n if (this.caretIsInForbiddenArea && !!this.nativeFocusableElement) {\n this.nativeFocusableElement.setSelectionRange(\n this.nonRemovableLength,\n this.nonRemovableLength,\n );\n }\n }\n\n private setValueWithoutPrefix(value: string) {\n if (this.readOnly) {\n return;\n }\n\n this.open = true;\n this.updateValue(this.cleanValue(value));\n this.updateSearch(\n this.allowText && isText(value)\n ? value\n : value.replace(TUI_MASK_SYMBOLS_REGEXP, ''),\n );\n }\n\n private cleanValue(value: string): string {\n const reg: RegExp =\n this.countryCode === '+7'\n ? /^7|^8/\n : new RegExp(this.countryCode.substring(1));\n const oldValueExist =\n this.value.length > this.countryCode.length &&\n this.value.length < this.maxPhoneLength;\n const newValueLength = value.replace(TUI_MASK_SYMBOLS_REGEXP, '').length;\n const cleanNewValue = value.replace(/[^0-9]+/g, '');\n const selectionLength = String(getSelection()).length;\n\n if (oldValueExist && selectionLength === 0) {\n return `${this.value}${cleanNewValue}`.slice(0, this.maxPhoneLength);\n }\n\n if (newValueLength < this.maxPhoneLength - 1) {\n return `${this.countryCode}${cleanNewValue}`.slice(0, this.maxPhoneLength);\n }\n\n return `${this.countryCode}${cleanNewValue.replace(reg, '')}`.slice(\n 0,\n this.maxPhoneLength,\n );\n }\n\n private focusInput() {\n if (this.nativeFocusableElement) {\n setNativeFocused(this.nativeFocusableElement, true, true);\n }\n }\n\n private updateSearch(search: string) {\n if (this.search === search) {\n return;\n }\n\n this.search = search;\n this.searchChange.emit(search);\n }\n\n private updateValueWithNewCountryCode(newCountryCode: string) {\n if (!this.isTextValue) {\n this.updateValue(this.value.replace(this.countryCode, newCountryCode));\n }\n }\n}\n\nfunction isText(value: string): boolean {\n return isNaN(parseInt(value.replace(TUI_MASK_SYMBOLS_REGEXP, ''), 10));\n}\n","import {Directive, DoCheck, forwardRef} from '@angular/core';\nimport {TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost} from '@taiga-ui/core';\n\nimport {TuiInputPhoneComponent} from './input-phone.component';\n\n@Directive({\n selector: 'tui-input-phone',\n providers: [\n {\n provide: TUI_TEXTFIELD_HOST,\n useExisting: forwardRef(() => TuiInputPhoneDirective),\n },\n ],\n})\nexport class TuiInputPhoneDirective\n extends TuiAbstractTextfieldHost<TuiInputPhoneComponent>\n implements DoCheck\n{\n input?: HTMLInputElement;\n\n get value(): string {\n return this.host.computedValue;\n }\n\n onValueChange(value: string) {\n this.host.onValueChange(value);\n }\n\n process(input: HTMLInputElement) {\n this.input = input;\n }\n\n ngDoCheck() {\n if (!this.input) {\n return;\n }\n\n this.input.type = 'tel';\n this.input.inputMode = this.host.inputMode;\n }\n}\n","import {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 {TuiValueAccessorModule} from '@taiga-ui/kit/directives';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputPhoneComponent} from './input-phone.component';\nimport {TuiInputPhoneDirective} from './input-phone.directive';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiHostedDropdownModule,\n TuiTextfieldControllerModule,\n TuiActiveZoneModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputPhoneComponent, TuiInputPhoneDirective],\n exports: [TuiInputPhoneComponent, TuiInputPhoneDirective, TuiTextfieldComponent],\n})\nexport class TuiInputPhoneModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAca,gBAAgB,GAAG,IAAI,cAAc,CAC9C,+BAA+B,EACjC;MACW,qBAAqB,GAAG;IACjC,iBAAiB;IACjB,kCAAkC;IAClC;QACI,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,UAAU,CAAC,MAAM,sBAAsB,CAAC;KACxD;IACD;QACI,OAAO,EAAE,2BAA2B;QACpC,WAAW,EAAE,UAAU,CAAC,MAAM,sBAAsB,CAAC;KACxD;IACD;QACI,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EA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4B;YAC5B,mBAAmB;YACnB,sBAAsB;SACzB;QACD,YAAY,EAAE,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;QAC9D,OAAO,EAAE,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC;KACnF,CAAC;GACW,mBAAmB,CAAG;;AC1BnC;;;;;;"}
|
|
@@ -1,236 +1,270 @@
|
|
|
1
1
|
import { __decorate, __param } from 'tslib';
|
|
2
|
-
import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, HostBinding, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
2
|
+
import { Optional, Self, Inject, ChangeDetectorRef, ElementRef, ViewChildren, ViewChild, Input, HostBinding, Component, ChangeDetectionStrategy, forwardRef, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { AbstractTuiInputSlider } from '@taiga-ui/kit/abstract';
|
|
4
|
+
import { EMPTY_QUERY, isNativeFocusedIn, isNativeFocused, round, clamp, TUI_IS_MOBILE, tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR, TuiActiveZoneModule, TuiPressedModule } from '@taiga-ui/cdk';
|
|
5
|
+
import { getFractionPartPadded, TUI_TEXTFIELD_APPEARANCE, TuiTextfieldController, TUI_TEXTFIELD_WATCHED_CONTROLLER, TEXTFIELD_CONTROLLER_PROVIDER, TuiTextfieldControllerModule, TuiWrapperModule } from '@taiga-ui/core';
|
|
6
|
+
import { AbstractTuiInputSlider, quantumAssertion } from '@taiga-ui/kit/abstract';
|
|
7
|
+
import { TuiInputNumberComponent, TuiInputNumberModule } from '@taiga-ui/kit/components/input-number';
|
|
8
|
+
import { TuiNewRangeDirective, TuiRangeComponent, TuiRangeModule } from '@taiga-ui/kit/components/range';
|
|
9
|
+
import { TUI_FLOATING_PRECISION } from '@taiga-ui/kit/constants';
|
|
7
10
|
import { CommonModule } from '@angular/common';
|
|
8
|
-
import {
|
|
9
|
-
import { TextMaskModule } from 'angular2-text-mask';
|
|
11
|
+
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
10
12
|
|
|
11
13
|
var TuiInputRangeComponent_1;
|
|
12
14
|
// @dynamic
|
|
13
|
-
let TuiInputRangeComponent = TuiInputRangeComponent_1 =
|
|
14
|
-
|
|
15
|
+
let TuiInputRangeComponent = TuiInputRangeComponent_1 =
|
|
16
|
+
/**
|
|
17
|
+
* `AbstractTuiInputSlider` includes all legacy code (it can be deleted in v3.0)
|
|
18
|
+
* TODO replace `extends AbstractTuiInputSlider<[number, number]>` by `extends AbstractTuiControl<[number, number]> implements TuiWithOptionalMinMax<number>`
|
|
19
|
+
*/
|
|
20
|
+
class TuiInputRangeComponent extends AbstractTuiInputSlider {
|
|
21
|
+
constructor(control, changeDetectorRef, isMobile, appearance, elementRef, controller, isNew) {
|
|
15
22
|
super(control, changeDetectorRef);
|
|
16
|
-
this.modeDirective = modeDirective;
|
|
17
23
|
this.isMobile = isMobile;
|
|
18
|
-
this.numberFormat = numberFormat;
|
|
19
24
|
this.appearance = appearance;
|
|
25
|
+
this.elementRef = elementRef;
|
|
26
|
+
this.controller = controller;
|
|
27
|
+
this.isNew = isNew;
|
|
28
|
+
this.inputNumberRefs = EMPTY_QUERY;
|
|
29
|
+
this.rangeRef = null;
|
|
30
|
+
this.min = 0;
|
|
31
|
+
/* TODO: make `100` as default value (like in native sliders) */
|
|
32
|
+
this.max = Infinity;
|
|
33
|
+
this.quantum = 1;
|
|
34
|
+
this.steps = 0;
|
|
35
|
+
this.segments = 0;
|
|
36
|
+
this.keySteps = null;
|
|
37
|
+
this.leftValueContent = '';
|
|
38
|
+
this.rightValueContent = '';
|
|
39
|
+
this.lastActiveSide = 'left';
|
|
20
40
|
}
|
|
21
|
-
get
|
|
22
|
-
|
|
41
|
+
get leftFocusableElement() {
|
|
42
|
+
var _a;
|
|
43
|
+
return ((_a = this.inputNumberRefs.first) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement) || null;
|
|
23
44
|
}
|
|
24
|
-
get
|
|
25
|
-
|
|
45
|
+
get rightFocusableElement() {
|
|
46
|
+
var _a;
|
|
47
|
+
return ((_a = this.inputNumberRefs.last) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement) || null;
|
|
26
48
|
}
|
|
27
|
-
get
|
|
28
|
-
return
|
|
49
|
+
get nativeFocusableElement() {
|
|
50
|
+
return this.disabled
|
|
51
|
+
? null
|
|
52
|
+
: this.leftFocusableElement || this.rightFocusableElement;
|
|
29
53
|
}
|
|
30
|
-
get
|
|
31
|
-
return
|
|
54
|
+
get focused() {
|
|
55
|
+
return isNativeFocusedIn(this.elementRef.nativeElement);
|
|
32
56
|
}
|
|
33
|
-
get
|
|
34
|
-
|
|
57
|
+
get showLeftValueContent() {
|
|
58
|
+
var _a;
|
|
59
|
+
return Boolean((this.minLabel || this.leftValueContent) &&
|
|
60
|
+
!isNativeFocused(this.leftFocusableElement) &&
|
|
61
|
+
!(((_a = this.rangeRef) === null || _a === void 0 ? void 0 : _a.focused) && this.lastActiveSide === 'left'));
|
|
35
62
|
}
|
|
36
|
-
get
|
|
37
|
-
|
|
63
|
+
get showRightValueContent() {
|
|
64
|
+
var _a;
|
|
65
|
+
return Boolean((this.maxLabel || this.rightValueContent) &&
|
|
66
|
+
!isNativeFocused(this.rightFocusableElement) &&
|
|
67
|
+
!(((_a = this.rangeRef) === null || _a === void 0 ? void 0 : _a.focused) && this.lastActiveSide === 'right'));
|
|
38
68
|
}
|
|
39
|
-
get
|
|
40
|
-
return this.
|
|
69
|
+
get precision() {
|
|
70
|
+
return getFractionPartPadded(this.quantum).length;
|
|
41
71
|
}
|
|
42
|
-
get
|
|
43
|
-
return this.
|
|
72
|
+
get decimal() {
|
|
73
|
+
return this.precision ? 'not-zero' : 'never';
|
|
44
74
|
}
|
|
45
|
-
get
|
|
46
|
-
return this.
|
|
75
|
+
get computedSteps() {
|
|
76
|
+
return this.steps || (this.max - this.min) / this.quantum;
|
|
47
77
|
}
|
|
48
|
-
get
|
|
49
|
-
return this.
|
|
78
|
+
get computedSize() {
|
|
79
|
+
return this.isNew && this.controller.size !== 's'
|
|
80
|
+
? this.controller.size
|
|
81
|
+
: this.size;
|
|
50
82
|
}
|
|
51
|
-
get
|
|
52
|
-
return this.
|
|
83
|
+
get legacyLabelOutside() {
|
|
84
|
+
return this.isNew ? this.controller.labelOutside : this.computedSize === 'm';
|
|
53
85
|
}
|
|
54
86
|
onActiveZone(active) {
|
|
55
87
|
this.updateFocused(active);
|
|
56
88
|
}
|
|
57
|
-
|
|
58
|
-
if (
|
|
59
|
-
setNativeFocused(this.nativeRight.nativeElement);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
onKeyDownArrowUpLeft(event) {
|
|
63
|
-
if (this.readOnly) {
|
|
89
|
+
onTextInputFocused(focused, right) {
|
|
90
|
+
if (focused) {
|
|
64
91
|
return;
|
|
65
92
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return;
|
|
93
|
+
const [leftTextInputRef, rightTextInputRef] = this.inputNumberRefs;
|
|
94
|
+
const inputRef = right ? rightTextInputRef : leftTextInputRef;
|
|
95
|
+
const valueIndex = right ? 1 : 0;
|
|
96
|
+
if (!inputRef.nativeValue || inputRef.value !== this.value[valueIndex]) {
|
|
97
|
+
this.updateTextInputValue(this.safeCurrentValue[valueIndex], right);
|
|
72
98
|
}
|
|
73
|
-
event.preventDefault();
|
|
74
|
-
this.processStep(false, false);
|
|
75
99
|
}
|
|
76
|
-
|
|
100
|
+
changeByStep(event, [leftCoefficient, rightCoefficient]) {
|
|
77
101
|
if (this.readOnly) {
|
|
78
102
|
return;
|
|
79
103
|
}
|
|
80
104
|
event.preventDefault();
|
|
81
|
-
this.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
105
|
+
const newValue = this.valueGuard([
|
|
106
|
+
this.value[0] + leftCoefficient * this.step,
|
|
107
|
+
this.value[1] + rightCoefficient * this.step,
|
|
108
|
+
]);
|
|
109
|
+
const leftValueChanged = newValue[0] !== this.value[0];
|
|
110
|
+
const rightValueChanged = newValue[1] !== this.value[1];
|
|
111
|
+
if (leftValueChanged || rightValueChanged) {
|
|
112
|
+
this.safelyUpdateValue(newValue);
|
|
113
|
+
this.updateTextInputValue(newValue[rightValueChanged ? 1 : 0], rightValueChanged);
|
|
86
114
|
}
|
|
87
|
-
event.preventDefault();
|
|
88
|
-
this.processStep(false, true);
|
|
89
115
|
}
|
|
90
|
-
onInputLeft() {
|
|
91
|
-
|
|
92
|
-
const capped = this.capInputValue(value, this.value[1]);
|
|
93
|
-
const postfix = value.slice(-1)[0] === ',' ? ',' : '';
|
|
94
|
-
if (maskedMoneyValueIsEmpty(value) || capped === null) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const newValue = this.formatNumber(capped) + postfix;
|
|
98
|
-
if (this.nativeLeft && this.inputValueLeft !== newValue) {
|
|
99
|
-
this.nativeLeft.nativeElement.value = newValue;
|
|
100
|
-
}
|
|
101
|
-
this.updateValue([capped, this.value[1]]);
|
|
116
|
+
onInputLeft(value) {
|
|
117
|
+
this.safelyUpdateValue([value !== null && value !== void 0 ? value : this.safeCurrentValue[0], this.value[1]]);
|
|
102
118
|
}
|
|
103
|
-
onInputRight() {
|
|
104
|
-
|
|
105
|
-
const capped = this.capInputValue(value);
|
|
106
|
-
const postfix = value.slice(-1)[0] === ',' ? ',' : '';
|
|
107
|
-
if (maskedMoneyValueIsEmpty(value) || capped === null) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const newValue = this.formatNumber(capped) + postfix;
|
|
111
|
-
if (this.nativeRight && this.inputValueRight !== newValue) {
|
|
112
|
-
this.nativeRight.nativeElement.value = newValue;
|
|
113
|
-
}
|
|
114
|
-
if (capped >= this.value[0]) {
|
|
115
|
-
this.updateValue([this.value[0], capped]);
|
|
116
|
-
}
|
|
119
|
+
onInputRight(value) {
|
|
120
|
+
this.safelyUpdateValue([this.value[0], value !== null && value !== void 0 ? value : this.safeCurrentValue[1]]);
|
|
117
121
|
}
|
|
118
|
-
onRangeValue(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
(guardedValue[0] === this.value[0] && guardedValue[1] === this.value[1])) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
if (!this.isMobile) {
|
|
126
|
-
const element = guardedValue[0] !== this.value[0]
|
|
127
|
-
? this.nativeLeft.nativeElement
|
|
128
|
-
: this.nativeRight.nativeElement;
|
|
129
|
-
setNativeFocused(element);
|
|
130
|
-
}
|
|
131
|
-
this.updateValue(guardedValue);
|
|
132
|
-
this.nativeLeft.nativeElement.value = this.formatNumber(guardedValue[0]);
|
|
122
|
+
onRangeValue([left, right]) {
|
|
123
|
+
var _a, _b;
|
|
124
|
+
(_b = (_a = this.rangeRef) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement) === null || _b === void 0 ? void 0 : _b.focus();
|
|
125
|
+
this.safelyUpdateValue([left, right]);
|
|
133
126
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
this.nativeLeft.nativeElement.value = this.formatNumber(value);
|
|
141
|
-
if (value !== this.value[0]) {
|
|
142
|
-
this.updateValue([value, this.value[1]]);
|
|
127
|
+
focusToTextInput() {
|
|
128
|
+
const element = this.lastActiveSide === 'left'
|
|
129
|
+
? this.leftFocusableElement
|
|
130
|
+
: this.rightFocusableElement;
|
|
131
|
+
if (!this.isMobile && element) {
|
|
132
|
+
element.focus();
|
|
143
133
|
}
|
|
144
134
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const inputValue = maskedNumberStringToNumber(this.computedValueRight, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
|
|
150
|
-
const value = isNaN(inputValue)
|
|
151
|
-
? this.value[0]
|
|
152
|
-
: this.valueGuard(Math.max(inputValue, this.value[0]));
|
|
153
|
-
this.nativeRight.nativeElement.value = this.formatNumber(value);
|
|
154
|
-
if (value !== this.value[1]) {
|
|
155
|
-
this.updateValue([this.value[0], value]);
|
|
156
|
-
}
|
|
135
|
+
onActiveThumbChange(activeThumb) {
|
|
136
|
+
this.lastActiveSide = activeThumb;
|
|
157
137
|
}
|
|
158
138
|
getFallbackValue() {
|
|
159
139
|
return [0, 0];
|
|
160
140
|
}
|
|
161
|
-
|
|
162
|
-
|
|
141
|
+
safelyUpdateValue(value) {
|
|
142
|
+
this.updateValue(this.valueGuard(value));
|
|
163
143
|
}
|
|
164
|
-
|
|
165
|
-
|
|
144
|
+
valueGuard([leftValue, rightValue]) {
|
|
145
|
+
const leftCalibratedValue = this.calibrate(leftValue);
|
|
146
|
+
const rightCalibratedValue = this.calibrate(rightValue);
|
|
147
|
+
return [
|
|
148
|
+
Math.min(leftCalibratedValue, this.value[1]),
|
|
149
|
+
Math.max(rightCalibratedValue, this.value[0]),
|
|
150
|
+
];
|
|
166
151
|
}
|
|
167
|
-
|
|
168
|
-
|
|
152
|
+
calibrate(value) {
|
|
153
|
+
const roundedValue = round(Math.round(value / this.quantum) * this.quantum, TUI_FLOATING_PRECISION);
|
|
154
|
+
return clamp(roundedValue, this.min, this.max);
|
|
169
155
|
}
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
right ? Math.max(end, this.value[0]) : this.value[1],
|
|
176
|
-
];
|
|
177
|
-
if (value[0] !== this.value[0] || value[1] !== this.value[1]) {
|
|
178
|
-
this.updateValue(value);
|
|
156
|
+
updateTextInputValue(value, right) {
|
|
157
|
+
const [leftInputRef, rightInputRef] = this.inputNumberRefs;
|
|
158
|
+
const textInputRef = right ? rightInputRef : leftInputRef;
|
|
159
|
+
if (textInputRef) {
|
|
160
|
+
textInputRef.nativeValue = textInputRef.getFormattedValue(value);
|
|
179
161
|
}
|
|
180
162
|
}
|
|
181
163
|
};
|
|
182
164
|
TuiInputRangeComponent.ctorParameters = () => [
|
|
183
165
|
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
|
|
184
166
|
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
185
|
-
{ type: TuiModeDirective, decorators: [{ type: Optional }, { type: Inject, args: [TuiModeDirective,] }] },
|
|
186
167
|
{ type: Boolean, decorators: [{ type: Inject, args: [TUI_IS_MOBILE,] }] },
|
|
187
|
-
{ type:
|
|
188
|
-
{ type:
|
|
168
|
+
{ type: String, decorators: [{ type: Inject, args: [TUI_TEXTFIELD_APPEARANCE,] }] },
|
|
169
|
+
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
|
|
170
|
+
{ type: TuiTextfieldController, decorators: [{ type: Inject, args: [TUI_TEXTFIELD_WATCHED_CONTROLLER,] }] },
|
|
171
|
+
{ type: TuiNewRangeDirective, decorators: [{ type: Optional }, { type: Inject, args: [TuiNewRangeDirective,] }] }
|
|
189
172
|
];
|
|
190
173
|
__decorate([
|
|
191
|
-
|
|
192
|
-
], TuiInputRangeComponent.prototype, "
|
|
174
|
+
ViewChildren(TuiInputNumberComponent)
|
|
175
|
+
], TuiInputRangeComponent.prototype, "inputNumberRefs", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
ViewChild(TuiRangeComponent)
|
|
178
|
+
], TuiInputRangeComponent.prototype, "rangeRef", void 0);
|
|
193
179
|
__decorate([
|
|
194
|
-
|
|
195
|
-
|
|
180
|
+
Input(),
|
|
181
|
+
tuiDefaultProp()
|
|
182
|
+
], TuiInputRangeComponent.prototype, "min", void 0);
|
|
196
183
|
__decorate([
|
|
197
|
-
|
|
198
|
-
|
|
184
|
+
Input(),
|
|
185
|
+
tuiDefaultProp()
|
|
186
|
+
], TuiInputRangeComponent.prototype, "max", void 0);
|
|
199
187
|
__decorate([
|
|
200
|
-
|
|
201
|
-
|
|
188
|
+
Input(),
|
|
189
|
+
tuiDefaultProp(quantumAssertion, 'Quantum must be positive')
|
|
190
|
+
], TuiInputRangeComponent.prototype, "quantum", void 0);
|
|
202
191
|
__decorate([
|
|
203
|
-
|
|
204
|
-
|
|
192
|
+
Input(),
|
|
193
|
+
tuiDefaultProp()
|
|
194
|
+
], TuiInputRangeComponent.prototype, "steps", void 0);
|
|
205
195
|
__decorate([
|
|
206
|
-
|
|
207
|
-
|
|
196
|
+
Input(),
|
|
197
|
+
tuiDefaultProp()
|
|
198
|
+
], TuiInputRangeComponent.prototype, "segments", void 0);
|
|
208
199
|
__decorate([
|
|
209
|
-
|
|
210
|
-
|
|
200
|
+
Input(),
|
|
201
|
+
tuiDefaultProp()
|
|
202
|
+
], TuiInputRangeComponent.prototype, "keySteps", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
Input(),
|
|
205
|
+
tuiDefaultProp()
|
|
206
|
+
], TuiInputRangeComponent.prototype, "leftValueContent", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
Input(),
|
|
209
|
+
tuiDefaultProp()
|
|
210
|
+
], TuiInputRangeComponent.prototype, "rightValueContent", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
HostBinding('class._label-outside')
|
|
213
|
+
], TuiInputRangeComponent.prototype, "legacyLabelOutside", null);
|
|
211
214
|
TuiInputRangeComponent = TuiInputRangeComponent_1 = __decorate([
|
|
212
215
|
Component({
|
|
213
216
|
selector: 'tui-input-range',
|
|
214
|
-
template: "<tui-wrapper\n [appearance]=\"appearance\"\n [readOnly]=\"readOnly\"\n [disabled]=\"disabled\"\n [focused]=\"computedFocused\"\n [hovered]=\"computedHovered\"\n [invalid]=\"computedInvalid\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <
|
|
217
|
+
template: "<tui-wrapper\n class=\"t-wrapper\"\n [appearance]=\"appearance\"\n [readOnly]=\"readOnly\"\n [disabled]=\"disabled\"\n [focused]=\"computedFocused\"\n [hovered]=\"computedHovered\"\n [invalid]=\"computedInvalid\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <tui-input-number\n tuiTextfieldAppearance=\"none\"\n automation-id=\"tui-input-range__left-input\"\n class=\"t-left t-text-input\"\n [min]=\"min\"\n [max]=\"value[1]\"\n [precision]=\"precision\"\n [decimal]=\"decimal\"\n [postfix]=\"pluralizeMap && !showLeftValueContent ? (value[0] | i18nPlural: pluralizeMap) : ''\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [tuiTextfieldSize]=\"computedSize\"\n [tuiTextfieldLabelOutside]=\"legacyLabelOutside\"\n [ngModel]=\"value[0]\"\n (ngModelChange)=\"onInputLeft($event)\"\n (focusedChange)=\"onTextInputFocused($event, false)\"\n (keydown.arrowUp)=\"changeByStep($event, [1, 0])\"\n (keydown.arrowDown)=\"changeByStep($event, [-1, 0])\"\n >\n <ng-content></ng-content>\n <div\n *ngIf=\"showLeftValueContent\"\n polymorpheus-outlet\n [content]=\"minLabel ? legacyMinLabel : leftValueContent\"\n [context]=\"{$implicit: value[0]}\"\n ></div>\n </tui-input-number>\n\n <div class=\"t-right\">\n <tui-input-number\n tuiTextfieldAppearance=\"none\"\n automation-id=\"tui-input-range__right-input\"\n class=\"t-text-input\"\n [min]=\"value[0]\"\n [max]=\"max\"\n [precision]=\"precision\"\n [decimal]=\"decimal\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [tuiTextfieldSize]=\"computedSize\"\n [tuiTextfieldLabelOutside]=\"legacyLabelOutside\"\n [ngModel]=\"value[1]\"\n (ngModelChange)=\"onInputRight($event)\"\n (focusedChange)=\"onTextInputFocused($event, true)\"\n (keydown.arrowUp)=\"changeByStep($event, [0, 1])\"\n (keydown.arrowDown)=\"changeByStep($event, [0, -1])\"\n >\n <div\n *ngIf=\"showRightValueContent\"\n polymorpheus-outlet\n [content]=\"maxLabel ? legacyMaxLabel : rightValueContent\"\n [context]=\"{$implicit: value[1]}\"\n ></div>\n </tui-input-number>\n\n <!-- TODO replace by postfix of the right InputNumber (after fix https://github.com/Tinkoff/taiga-ui/issues/1193) -->\n <span\n *ngIf=\"!showRightValueContent && pluralizeMap\"\n automation-id=\"tui-input-range__pluralize-right\"\n class=\"t-pluralize-right\"\n >\n {{value[1] | i18nPlural: pluralizeMap}}\n </span>\n </div>\n\n <tui-range\n class=\"t-slider\"\n [min]=\"min\"\n [max]=\"max\"\n [steps]=\"computedSteps\"\n [segments]=\"segments\"\n [keySteps]=\"keySteps\"\n [pluralize]=\"segmentsPluralizeMap\"\n [focusable]=\"false\"\n [disabled]=\"readOnly || disabled\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onRangeValue($event)\"\n (tuiPressedChange)=\"focusToTextInput()\"\n (activeThumbChange)=\"onActiveThumbChange($event)\"\n ></tui-range>\n</tui-wrapper>\n\n<!-- TODO remove in v3.0 -->\n<ng-template\n #legacyMinLabel\n let-value\n>\n <ng-container *ngIf=\"value === min\">{{minLabel}}</ng-container>\n <ng-container *ngIf=\"value !== min\">\n {{value}} {{value | i18nPlural: pluralizeMap ||\n pluralizeMapFallback}}\n </ng-container>\n</ng-template>\n\n<!-- TODO remove in v3.0 -->\n<ng-template\n #legacyMaxLabel\n let-value\n>\n <ng-container *ngIf=\"value === max\">{{maxLabel}}</ng-container>\n <ng-container *ngIf=\"value !== max\">\n {{value}} {{value | i18nPlural: pluralizeMap ||\n pluralizeMapFallback}}\n </ng-container>\n</ng-template>\n",
|
|
215
218
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
216
219
|
providers: [
|
|
217
220
|
{
|
|
218
221
|
provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
|
|
219
222
|
useExisting: forwardRef(() => TuiInputRangeComponent_1),
|
|
220
223
|
},
|
|
224
|
+
TEXTFIELD_CONTROLLER_PROVIDER,
|
|
221
225
|
],
|
|
222
|
-
|
|
223
|
-
|
|
226
|
+
host: {
|
|
227
|
+
/**
|
|
228
|
+
* TODO delete it in v3.0
|
|
229
|
+
* Dont forget to clear html-tags
|
|
230
|
+
*/
|
|
231
|
+
'[class._show-ticks-labels]': '!isNew',
|
|
232
|
+
},
|
|
233
|
+
styles: [".t-wrapper{position:relative}.t-left{width:100%}.t-right{position:absolute;right:0;top:0;display:flex;width:50%;height:100%;text-align:right}.t-right .t-text-input{flex:1}.t-text-input{text-align:inherit}.t-pluralize-right{display:flex;align-items:center;padding:1.125rem var(--tui-padding-m) 0 0;margin-left:-.75rem;font:var(--tui-font-text-s)}:host[data-size='l'] .t-pluralize-right{font:var(--tui-font-text-m);padding-top:1.25rem;margin-left:-1rem;padding-right:var(--tui-padding-l)}:host._label-outside .t-pluralize-right{padding-top:0}:host._disabled .t-pluralize-right{color:var(--tui-text-03)}:host{display:block;border-radius:var(--tui-radius-m)}:host._show-ticks-labels._segmented{border-bottom:26px solid transparent}.t-slider{position:absolute;top:100%;left:0;right:0;z-index:1;margin:-.125rem 0 0;background:0 0}"]
|
|
234
|
+
})
|
|
235
|
+
/**
|
|
236
|
+
* `AbstractTuiInputSlider` includes all legacy code (it can be deleted in v3.0)
|
|
237
|
+
* TODO replace `extends AbstractTuiInputSlider<[number, number]>` by `extends AbstractTuiControl<[number, number]> implements TuiWithOptionalMinMax<number>`
|
|
238
|
+
*/
|
|
239
|
+
,
|
|
224
240
|
__param(0, Optional()),
|
|
225
241
|
__param(0, Self()),
|
|
226
242
|
__param(0, Inject(NgControl)),
|
|
227
243
|
__param(1, Inject(ChangeDetectorRef)),
|
|
228
|
-
__param(2,
|
|
229
|
-
__param(
|
|
230
|
-
__param(
|
|
231
|
-
__param(
|
|
232
|
-
__param(
|
|
244
|
+
__param(2, Inject(TUI_IS_MOBILE)),
|
|
245
|
+
__param(3, Inject(TUI_TEXTFIELD_APPEARANCE)),
|
|
246
|
+
__param(4, Inject(ElementRef)),
|
|
247
|
+
__param(5, Inject(TUI_TEXTFIELD_WATCHED_CONTROLLER)),
|
|
248
|
+
__param(6, Optional()),
|
|
249
|
+
__param(6, Inject(TuiNewRangeDirective))
|
|
233
250
|
], TuiInputRangeComponent);
|
|
251
|
+
function tuiTextfieldAppearanceDirectiveFactory({ nativeElement }) {
|
|
252
|
+
return nativeElement.getAttribute('tuiTextfieldAppearance');
|
|
253
|
+
}
|
|
254
|
+
let TuiTextfieldAppearanceDirective = class TuiTextfieldAppearanceDirective {
|
|
255
|
+
};
|
|
256
|
+
TuiTextfieldAppearanceDirective = __decorate([
|
|
257
|
+
Directive({
|
|
258
|
+
selector: '[tuiTextfieldAppearance]',
|
|
259
|
+
providers: [
|
|
260
|
+
{
|
|
261
|
+
provide: TUI_TEXTFIELD_APPEARANCE,
|
|
262
|
+
deps: [ElementRef],
|
|
263
|
+
useFactory: tuiTextfieldAppearanceDirectiveFactory,
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
})
|
|
267
|
+
], TuiTextfieldAppearanceDirective);
|
|
234
268
|
|
|
235
269
|
let TuiInputRangeModule = class TuiInputRangeModule {
|
|
236
270
|
};
|
|
@@ -240,19 +274,16 @@ TuiInputRangeModule = __decorate([
|
|
|
240
274
|
CommonModule,
|
|
241
275
|
FormsModule,
|
|
242
276
|
ReactiveFormsModule,
|
|
243
|
-
|
|
244
|
-
TuiFocusableModule,
|
|
245
|
-
TuiFocusedModule,
|
|
246
|
-
TuiHoveredModule,
|
|
247
|
-
TuiPressedModule,
|
|
248
|
-
TuiMapperPipeModule,
|
|
249
|
-
TuiInputModeModule,
|
|
277
|
+
PolymorpheusModule,
|
|
250
278
|
TuiActiveZoneModule,
|
|
279
|
+
TuiInputNumberModule,
|
|
280
|
+
TuiPressedModule,
|
|
251
281
|
TuiRangeModule,
|
|
282
|
+
TuiTextfieldControllerModule,
|
|
252
283
|
TuiWrapperModule,
|
|
253
284
|
],
|
|
254
|
-
declarations: [TuiInputRangeComponent],
|
|
255
|
-
exports: [TuiInputRangeComponent],
|
|
285
|
+
declarations: [TuiInputRangeComponent, TuiTextfieldAppearanceDirective],
|
|
286
|
+
exports: [TuiInputRangeComponent, TuiNewRangeDirective],
|
|
256
287
|
})
|
|
257
288
|
], TuiInputRangeModule);
|
|
258
289
|
|
|
@@ -260,5 +291,5 @@ TuiInputRangeModule = __decorate([
|
|
|
260
291
|
* Generated bundle index. Do not edit.
|
|
261
292
|
*/
|
|
262
293
|
|
|
263
|
-
export { TuiInputRangeComponent, TuiInputRangeModule };
|
|
294
|
+
export { TuiInputRangeComponent, TuiInputRangeModule, TuiTextfieldAppearanceDirective, tuiTextfieldAppearanceDirectiveFactory };
|
|
264
295
|
//# sourceMappingURL=taiga-ui-kit-components-input-range.js.map
|