@taiga-ui/kit 2.30.0 → 2.34.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/taiga-ui-kit-abstract.metadata.json +1 -1
- package/bundles/taiga-ui-kit-abstract.umd.js +7 -6
- 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 +3 -3
- 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-arrow.umd.js +44 -8
- package/bundles/taiga-ui-kit-components-arrow.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-arrow.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-arrow.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-avatar.umd.js +2 -2
- 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-badge.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-badge.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-badge.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-badge.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-badged-content.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-badged-content.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-badged-content.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-badged-content.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-breadcrumbs.umd.js +2 -2
- 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 +4 -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 +2 -2
- package/bundles/taiga-ui-kit-components-calendar-month.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.js +5 -4
- 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-block.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-checkbox-block.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-block.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-checkbox-block.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-labeled.umd.js +2 -2
- 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 +3 -3
- package/bundles/taiga-ui-kit-components-checkbox.umd.js.map +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 +129 -56
- package/bundles/taiga-ui-kit-components-combo-box.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.min.js +2 -2
- 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 +17 -11
- 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 +2 -2
- package/bundles/taiga-ui-kit-components-data-list-wrapper.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-field-error.umd.js +10 -15
- package/bundles/taiga-ui-kit-components-field-error.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-field-error.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-field-error.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-filter.umd.js +2 -2
- 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 +47 -17
- package/bundles/taiga-ui-kit-components-input-copy.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-copy.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-copy.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-count.umd.js +45 -11
- 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 +80 -28
- 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 +2 -2
- 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 +80 -36
- 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 +2 -2
- 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 +76 -28
- package/bundles/taiga-ui-kit-components-input-date.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date.umd.min.js +2 -2
- 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 -8
- package/bundles/taiga-ui-kit-components-input-file.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-file.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-file.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-inline.umd.js +2 -15
- package/bundles/taiga-ui-kit-components-input-inline.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-inline.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-inline.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.js +52 -10
- 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 +48 -10
- 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 +52 -10
- package/bundles/taiga-ui-kit-components-input-number.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-number.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-password.umd.js +50 -11
- 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-international.umd.js +51 -23
- package/bundles/taiga-ui-kit-components-input-phone-international.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-phone-international.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-phone-international.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-phone.umd.js +59 -23
- 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 +8 -5
- 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 +8 -5
- package/bundles/taiga-ui-kit-components-input-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-slider.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.js +44 -15
- package/bundles/taiga-ui-kit-components-input-tag.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-tag.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-time.umd.js +19 -14
- package/bundles/taiga-ui-kit-components-input-time.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-time.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-time.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input.umd.js +33 -4
- 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 +2 -2
- 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 +50 -23
- package/bundles/taiga-ui-kit-components-multi-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-multi-select.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-block.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-radio-block.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-block.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-radio-block.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-labeled.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-radio-labeled.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-labeled.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-radio-labeled.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-list.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-radio-list.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-list.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-radio-list.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.js +7 -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 +1 -1
- package/bundles/taiga-ui-kit-components-range.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-rating.umd.js +373 -0
- package/bundles/taiga-ui-kit-components-rating.umd.js.map +1 -0
- package/bundles/taiga-ui-kit-components-rating.umd.min.js +16 -0
- package/bundles/taiga-ui-kit-components-rating.umd.min.js.map +1 -0
- package/bundles/taiga-ui-kit-components-select.umd.js +107 -43
- package/bundles/taiga-ui-kit-components-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-select.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.js +142 -27
- package/bundles/taiga-ui-kit-components-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.min.js +2 -2
- 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 +1 -1
- package/bundles/taiga-ui-kit-components-stepper.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tabs.umd.js +1 -1
- 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 +11 -5
- 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 +8 -6
- 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 +7 -2
- package/bundles/taiga-ui-kit-components-toggle.umd.js.map +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-components.umd.js +12 -4
- package/bundles/taiga-ui-kit-components.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-constants.umd.js +8 -0
- package/bundles/taiga-ui-kit-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-constants.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-constants.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-pipes-field-error.umd.js +389 -0
- package/bundles/taiga-ui-kit-pipes-field-error.umd.js.map +1 -0
- package/bundles/taiga-ui-kit-pipes-field-error.umd.min.js +16 -0
- package/bundles/taiga-ui-kit-pipes-field-error.umd.min.js.map +1 -0
- package/bundles/taiga-ui-kit-pipes.umd.js +12 -4
- package/bundles/taiga-ui-kit-pipes.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-pipes.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-providers.umd.js +6 -5
- package/bundles/taiga-ui-kit-providers.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-providers.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-providers.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-tokens.umd.js +246 -4
- package/bundles/taiga-ui-kit-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-tokens.umd.min.js +15 -1
- package/bundles/taiga-ui-kit-tokens.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-mask.umd.js +17 -8
- package/bundles/taiga-ui-kit-utils-mask.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-mask.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-utils-mask.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-miscellaneous.umd.js +241 -6
- package/bundles/taiga-ui-kit-utils-miscellaneous.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-miscellaneous.umd.min.js +15 -1
- package/bundles/taiga-ui-kit-utils-miscellaneous.umd.min.js.map +1 -1
- package/components/accordion/taiga-ui-kit-components-accordion.metadata.json +1 -1
- package/components/arrow/arrow-options.d.ts +18 -0
- package/components/arrow/arrow.component.d.ts +5 -3
- package/components/arrow/index.d.ts +1 -0
- package/components/arrow/taiga-ui-kit-components-arrow.metadata.json +1 -1
- package/components/avatar/taiga-ui-kit-components-avatar.metadata.json +1 -1
- package/components/badge/taiga-ui-kit-components-badge.metadata.json +1 -1
- package/components/badged-content/taiga-ui-kit-components-badged-content.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/carousel-buttons.directive.d.ts +2 -2
- package/components/carousel/taiga-ui-kit-components-carousel.metadata.json +1 -1
- package/components/checkbox/checkbox.component.d.ts +2 -2
- package/components/checkbox/taiga-ui-kit-components-checkbox.metadata.json +1 -1
- package/components/checkbox-block/taiga-ui-kit-components-checkbox-block.metadata.json +1 -1
- package/components/checkbox-labeled/taiga-ui-kit-components-checkbox-labeled.metadata.json +1 -1
- package/components/combo-box/combo-box-strict.directive.d.ts +7 -0
- package/components/combo-box/combo-box.component.d.ts +11 -8
- package/components/combo-box/combo-box.directive.d.ts +6 -0
- package/components/combo-box/combo-box.providers.d.ts +2 -0
- package/components/combo-box/index.d.ts +3 -0
- package/components/combo-box/taiga-ui-kit-components-combo-box.metadata.json +1 -1
- package/components/data-list-wrapper/data-list-wrapper.component.d.ts +5 -3
- package/components/data-list-wrapper/taiga-ui-kit-components-data-list-wrapper.metadata.json +1 -1
- package/components/field-error/field-error.component.d.ts +1 -2
- package/components/field-error/field-error.module.d.ts +3 -0
- package/components/field-error/taiga-ui-kit-components-field-error.metadata.json +1 -1
- package/components/filter/taiga-ui-kit-components-filter.metadata.json +1 -1
- package/components/index.d.ts +1 -0
- package/components/input/index.d.ts +1 -0
- package/components/input/input.directive.d.ts +5 -0
- package/components/input/taiga-ui-kit-components-input.metadata.json +1 -1
- package/components/input-copy/index.d.ts +2 -0
- package/components/input-copy/input-copy.directive.d.ts +5 -0
- package/components/input-copy/input-copy.providers.d.ts +2 -0
- package/components/input-copy/taiga-ui-kit-components-input-copy.metadata.json +1 -1
- package/components/input-count/index.d.ts +1 -0
- package/components/input-count/input-count-options.d.ts +10 -4
- package/components/input-count/input-count.component.d.ts +3 -3
- package/components/input-count/input-count.directive.d.ts +6 -0
- package/components/input-count/taiga-ui-kit-components-input-count.metadata.json +1 -1
- package/components/input-date/index.d.ts +2 -0
- package/components/input-date/input-date.component.d.ts +3 -4
- package/components/input-date/input-date.directive.d.ts +7 -0
- package/components/input-date/input-date.providers.d.ts +4 -0
- package/components/input-date/taiga-ui-kit-components-input-date.metadata.json +1 -1
- package/components/input-date-range/index.d.ts +2 -0
- package/components/input-date-range/input-date-range.component.d.ts +3 -4
- package/components/input-date-range/input-date-range.directive.d.ts +7 -0
- package/components/input-date-range/input-date-range.providers.d.ts +4 -0
- package/components/input-date-range/taiga-ui-kit-components-input-date-range.metadata.json +1 -1
- package/components/input-date-time/index.d.ts +2 -0
- package/components/input-date-time/input-date-time.component.d.ts +3 -5
- package/components/input-date-time/input-date-time.directive.d.ts +7 -0
- package/components/input-date-time/input-date-time.providers.d.ts +4 -0
- package/components/input-date-time/taiga-ui-kit-components-input-date-time.metadata.json +1 -1
- package/components/input-file/input-file.component.d.ts +0 -1
- package/components/input-file/taiga-ui-kit-components-input-file.metadata.json +1 -1
- package/components/input-inline/input-inline.component.d.ts +0 -1
- package/components/input-inline/taiga-ui-kit-components-input-inline.metadata.json +1 -1
- package/components/input-month/index.d.ts +1 -0
- package/components/input-month/input-month.component.d.ts +2 -3
- package/components/input-month/input-month.directive.d.ts +7 -0
- package/components/input-month/taiga-ui-kit-components-input-month.metadata.json +1 -1
- package/components/input-month-range/index.d.ts +1 -0
- package/components/input-month-range/input-month-range.component.d.ts +2 -3
- package/components/input-month-range/input-month-range.directive.d.ts +7 -0
- package/components/input-month-range/taiga-ui-kit-components-input-month-range.metadata.json +1 -1
- package/components/input-number/index.d.ts +1 -0
- package/components/input-number/input-number.component.d.ts +1 -1
- package/components/input-number/input-number.directive.d.ts +7 -0
- package/components/input-number/taiga-ui-kit-components-input-number.metadata.json +1 -1
- package/components/input-password/index.d.ts +1 -0
- package/components/input-password/input-password-options.d.ts +10 -4
- package/components/input-password/input-password.component.d.ts +3 -4
- package/components/input-password/input-password.directive.d.ts +8 -0
- package/components/input-password/taiga-ui-kit-components-input-password.metadata.json +1 -1
- package/components/input-phone/index.d.ts +1 -0
- package/components/input-phone/input-phone.component.d.ts +1 -1
- package/components/input-phone/input-phone.directive.d.ts +7 -0
- package/components/input-phone/taiga-ui-kit-components-input-phone.metadata.json +1 -1
- package/components/input-phone-international/const/countries.d.ts +15 -7
- package/components/input-phone-international/index.d.ts +2 -0
- package/components/input-phone-international/input-phone-international.component.d.ts +4 -3
- package/components/input-phone-international/taiga-ui-kit-components-input-phone-international.metadata.json +1 -1
- package/components/input-phone-international/tokens/countries-masks.d.ts +3 -0
- package/components/input-phone-international/utils/extract-value-from-event.d.ts +1 -0
- package/components/input-range/input-range.component.d.ts +2 -1
- package/components/input-range/taiga-ui-kit-components-input-range.metadata.json +1 -1
- package/components/input-slider/input-slider.component.d.ts +2 -1
- package/components/input-slider/taiga-ui-kit-components-input-slider.metadata.json +1 -1
- package/components/input-tag/index.d.ts +1 -0
- package/components/input-tag/input-tag-options.d.ts +7 -0
- package/components/input-tag/input-tag.component.d.ts +6 -2
- package/components/input-tag/taiga-ui-kit-components-input-tag.metadata.json +1 -1
- package/components/input-time/input-time-options.d.ts +13 -4
- package/components/input-time/input-time.component.d.ts +9 -10
- package/components/input-time/taiga-ui-kit-components-input-time.metadata.json +1 -1
- package/components/marker-icon/taiga-ui-kit-components-marker-icon.metadata.json +1 -1
- package/components/multi-select/index.d.ts +1 -0
- package/components/multi-select/multi-select-options.d.ts +10 -0
- package/components/multi-select/multi-select.component.d.ts +14 -8
- package/components/multi-select/taiga-ui-kit-components-multi-select.metadata.json +1 -1
- package/components/radio/radio-options.d.ts +10 -4
- package/components/radio/radio.component.d.ts +2 -2
- package/components/radio/taiga-ui-kit-components-radio.metadata.json +1 -1
- package/components/radio-block/taiga-ui-kit-components-radio-block.metadata.json +1 -1
- package/components/radio-labeled/taiga-ui-kit-components-radio-labeled.metadata.json +1 -1
- package/components/radio-list/taiga-ui-kit-components-radio-list.metadata.json +1 -1
- package/components/range/taiga-ui-kit-components-range.metadata.json +1 -1
- package/components/rating/index.d.ts +3 -0
- package/components/rating/package.json +13 -0
- package/components/rating/rating-options.d.ts +10 -0
- package/components/rating/rating.component.d.ts +21 -0
- package/components/rating/rating.module.d.ts +2 -0
- package/components/rating/taiga-ui-kit-components-rating.d.ts +4 -0
- package/components/rating/taiga-ui-kit-components-rating.metadata.json +1 -0
- package/components/select/index.d.ts +3 -0
- package/components/select/select-options.d.ts +9 -0
- package/components/select/select.component.d.ts +11 -6
- package/components/select/select.directive.d.ts +7 -0
- package/components/select/select.providers.d.ts +2 -0
- 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 +19 -0
- package/components/slider/slider.component.d.ts +16 -13
- 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/taiga-ui-kit-components-tabs.metadata.json +1 -1
- package/components/tag/tag.component.d.ts +1 -0
- package/components/tag/taiga-ui-kit-components-tag.metadata.json +1 -1
- package/components/taiga-ui-kit-components.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/components/toggle/toggle-options.d.ts +10 -4
- package/components/toggle/toggle.component.d.ts +3 -3
- package/constants/index.d.ts +1 -0
- package/constants/max-time-values.d.ts +2 -0
- package/constants/taiga-ui-kit-constants.metadata.json +1 -1
- package/esm2015/abstract/input-slider.js +4 -2
- package/esm2015/abstract/slider/slider.js +2 -2
- package/esm2015/components/accordion/accordion-item/accordion-item.component.js +3 -3
- package/esm2015/components/accordion/accordion.component.js +3 -3
- package/esm2015/components/arrow/arrow-options.js +28 -0
- package/esm2015/components/arrow/arrow.component.js +12 -8
- package/esm2015/components/arrow/arrow.module.js +3 -2
- package/esm2015/components/arrow/index.js +2 -1
- package/esm2015/components/avatar/avatar.component.js +3 -3
- package/esm2015/components/badge/badge.component.js +3 -3
- package/esm2015/components/badged-content/badged-content.component.js +3 -3
- package/esm2015/components/breadcrumbs/breadcrumbs.component.js +3 -3
- package/esm2015/components/calendar-month/calendar-month.component.js +5 -2
- package/esm2015/components/carousel/carousel-buttons.directive.js +1 -1
- package/esm2015/components/carousel/carousel-scroll.directive.js +5 -4
- package/esm2015/components/carousel/carousel.component.js +1 -1
- package/esm2015/components/checkbox/checkbox.component.js +4 -4
- package/esm2015/components/checkbox-block/checkbox-block.component.js +3 -3
- package/esm2015/components/checkbox-labeled/checkbox-labeled.component.js +3 -3
- package/esm2015/components/combo-box/combo-box-strict.directive.js +31 -0
- package/esm2015/components/combo-box/combo-box.component.js +41 -55
- package/esm2015/components/combo-box/combo-box.directive.js +25 -0
- package/esm2015/components/combo-box/combo-box.module.js +15 -4
- package/esm2015/components/combo-box/combo-box.providers.js +28 -0
- package/esm2015/components/combo-box/index.js +4 -1
- package/esm2015/components/data-list-wrapper/data-list-wrapper.component.js +17 -11
- package/esm2015/components/field-error/field-error.component.js +8 -12
- package/esm2015/components/field-error/field-error.module.js +6 -2
- package/esm2015/components/filter/filter.component.js +3 -3
- package/esm2015/components/index.js +2 -1
- package/esm2015/components/input/index.js +2 -1
- package/esm2015/components/input/input.component.js +3 -3
- package/esm2015/components/input/input.directive.js +22 -0
- package/esm2015/components/input/input.module.js +5 -4
- package/esm2015/components/input/input.providers.js +6 -2
- package/esm2015/components/input-copy/index.js +3 -1
- package/esm2015/components/input-copy/input-copy.component.js +8 -15
- package/esm2015/components/input-copy/input-copy.directive.js +22 -0
- package/esm2015/components/input-copy/input-copy.module.js +5 -4
- package/esm2015/components/input-copy/input-copy.providers.js +16 -0
- package/esm2015/components/input-count/index.js +2 -1
- package/esm2015/components/input-count/input-count-options.js +5 -1
- package/esm2015/components/input-count/input-count.component.js +10 -10
- package/esm2015/components/input-count/input-count.directive.js +26 -0
- package/esm2015/components/input-count/input-count.module.js +5 -4
- package/esm2015/components/input-date/index.js +3 -1
- package/esm2015/components/input-date/input-date.component.js +19 -29
- package/esm2015/components/input-date/input-date.directive.js +28 -0
- package/esm2015/components/input-date/input-date.module.js +5 -4
- package/esm2015/components/input-date/input-date.providers.js +29 -0
- package/esm2015/components/input-date-range/index.js +3 -1
- package/esm2015/components/input-date-range/input-date-range.component.js +19 -29
- package/esm2015/components/input-date-range/input-date-range.directive.js +28 -0
- package/esm2015/components/input-date-range/input-date-range.module.js +9 -4
- package/esm2015/components/input-date-range/input-date-range.providers.js +29 -0
- package/esm2015/components/input-date-time/index.js +3 -1
- package/esm2015/components/input-date-time/input-date-time.component.js +19 -33
- package/esm2015/components/input-date-time/input-date-time.directive.js +28 -0
- package/esm2015/components/input-date-time/input-date-time.module.js +9 -4
- package/esm2015/components/input-date-time/input-date-time.providers.js +29 -0
- package/esm2015/components/input-file/input-file.component.js +2 -5
- package/esm2015/components/input-inline/input-inline.component.js +4 -13
- package/esm2015/components/input-month/index.js +2 -1
- package/esm2015/components/input-month/input-month.component.js +7 -6
- package/esm2015/components/input-month/input-month.directive.js +30 -0
- package/esm2015/components/input-month/input-month.module.js +5 -4
- package/esm2015/components/input-month-range/index.js +2 -1
- package/esm2015/components/input-month-range/input-month-range.component.js +7 -6
- package/esm2015/components/input-month-range/input-month-range.directive.js +30 -0
- package/esm2015/components/input-month-range/input-month-range.module.js +9 -4
- package/esm2015/components/input-number/index.js +2 -1
- package/esm2015/components/input-number/input-number.component.js +16 -10
- package/esm2015/components/input-number/input-number.directive.js +29 -0
- package/esm2015/components/input-number/input-number.module.js +5 -4
- package/esm2015/components/input-password/index.js +2 -1
- package/esm2015/components/input-password/input-password-options.js +5 -1
- package/esm2015/components/input-password/input-password.component.js +8 -7
- package/esm2015/components/input-password/input-password.directive.js +30 -0
- package/esm2015/components/input-password/input-password.module.js +9 -4
- package/esm2015/components/input-phone/index.js +2 -1
- package/esm2015/components/input-phone/input-phone.component.js +14 -25
- package/esm2015/components/input-phone/input-phone.directive.js +29 -0
- package/esm2015/components/input-phone/input-phone.module.js +5 -4
- package/esm2015/components/input-phone/input-phone.providers.js +17 -3
- package/esm2015/components/input-phone-international/const/countries.js +14 -5
- package/esm2015/components/input-phone-international/index.js +3 -1
- package/esm2015/components/input-phone-international/input-phone-international.component.js +24 -22
- package/esm2015/components/input-phone-international/tokens/countries-masks.js +6 -0
- package/esm2015/components/input-phone-international/utils/extract-value-from-event.js +9 -0
- package/esm2015/components/input-range/input-range.component.js +10 -7
- package/esm2015/components/input-slider/input-slider.component.js +10 -7
- package/esm2015/components/input-tag/index.js +2 -1
- package/esm2015/components/input-tag/input-tag-options.js +9 -0
- package/esm2015/components/input-tag/input-tag.component.js +31 -15
- package/esm2015/components/input-time/input-time-options.js +8 -1
- package/esm2015/components/input-time/input-time.component.js +10 -8
- package/esm2015/components/marker-icon/marker-icon.component.js +3 -3
- package/esm2015/components/multi-select/index.js +2 -1
- package/esm2015/components/multi-select/multi-select-options.js +13 -0
- package/esm2015/components/multi-select/multi-select.component.js +31 -17
- package/esm2015/components/multi-select/multi-select.module.js +3 -1
- package/esm2015/components/radio/radio-options.js +5 -1
- package/esm2015/components/radio/radio.component.js +3 -3
- package/esm2015/components/radio-block/radio-block.component.js +3 -3
- package/esm2015/components/radio-labeled/radio-labeled.component.js +3 -3
- package/esm2015/components/radio-list/radio-list.component.js +3 -3
- package/esm2015/components/range/range.component.js +1 -1
- package/esm2015/components/rating/index.js +4 -0
- package/esm2015/components/rating/rating-options.js +15 -0
- package/esm2015/components/rating/rating.component.js +91 -0
- package/esm2015/components/rating/rating.module.js +23 -0
- package/esm2015/components/rating/taiga-ui-kit-components-rating.js +5 -0
- package/esm2015/components/select/index.js +4 -1
- package/esm2015/components/select/select-options.js +12 -0
- package/esm2015/components/select/select.component.js +36 -42
- package/esm2015/components/select/select.directive.js +28 -0
- package/esm2015/components/select/select.module.js +5 -4
- package/esm2015/components/select/select.providers.js +28 -0
- package/esm2015/components/slider/index.js +2 -1
- package/esm2015/components/slider/slider-old.component.js +71 -0
- package/esm2015/components/slider/slider.component.js +66 -46
- package/esm2015/components/slider/slider.module.js +4 -3
- package/esm2015/components/stepper/step/step.component.js +3 -3
- package/esm2015/components/tabs/tab/tab.providers.js +3 -3
- package/esm2015/components/tag/tag.component.js +12 -6
- package/esm2015/components/text-area/text-area.component.js +9 -6
- package/esm2015/components/text-area/text-area.module.js +2 -3
- package/esm2015/components/toggle/toggle-options.js +5 -1
- package/esm2015/components/toggle/toggle.component.js +3 -3
- package/esm2015/constants/index.js +2 -1
- package/esm2015/constants/max-time-values.js +7 -0
- package/esm2015/pipes/field-error/field-error-pipe.js +120 -0
- package/esm2015/pipes/field-error/field-error.module.js +13 -0
- package/esm2015/pipes/field-error/index.js +3 -0
- package/esm2015/pipes/field-error/taiga-ui-kit-pipes-field-error.js +5 -0
- package/esm2015/pipes/index.js +2 -1
- package/esm2015/providers/value-accessor.provider.js +3 -2
- package/esm2015/tokens/date-inputs-value-transformers.js +5 -0
- package/esm2015/tokens/index.js +3 -1
- package/esm2015/tokens/items-handlers.js +15 -0
- package/esm2015/types/index.js +1 -1
- package/esm2015/types/time-format-parts.js +1 -0
- package/esm2015/utils/mask/create-auto-corrected-time-pipe.js +7 -6
- package/esm2015/utils/mask/create-time-mask.js +16 -8
- package/esm2015/utils/miscellaneous/get-precision.js +8 -0
- package/esm2015/utils/miscellaneous/index.js +2 -1
- package/esm2015/utils/miscellaneous/replay-control-value-changes-factory.js +10 -4
- package/esm5/abstract/input-slider.js +4 -2
- package/esm5/abstract/slider/slider.js +2 -2
- package/esm5/components/accordion/accordion-item/accordion-item.component.js +3 -3
- package/esm5/components/accordion/accordion.component.js +3 -3
- package/esm5/components/arrow/arrow-options.js +29 -0
- package/esm5/components/arrow/arrow.component.js +12 -8
- package/esm5/components/arrow/arrow.module.js +3 -2
- package/esm5/components/arrow/index.js +2 -1
- package/esm5/components/avatar/avatar.component.js +3 -3
- package/esm5/components/badge/badge.component.js +3 -3
- package/esm5/components/badged-content/badged-content.component.js +3 -3
- package/esm5/components/breadcrumbs/breadcrumbs.component.js +3 -3
- package/esm5/components/calendar-month/calendar-month.component.js +5 -2
- package/esm5/components/carousel/carousel-buttons.directive.js +1 -1
- package/esm5/components/carousel/carousel-scroll.directive.js +5 -4
- package/esm5/components/carousel/carousel.component.js +1 -1
- package/esm5/components/checkbox/checkbox.component.js +4 -4
- package/esm5/components/checkbox-block/checkbox-block.component.js +3 -3
- package/esm5/components/checkbox-labeled/checkbox-labeled.component.js +3 -3
- package/esm5/components/combo-box/combo-box-strict.directive.js +32 -0
- package/esm5/components/combo-box/combo-box.component.js +40 -59
- package/esm5/components/combo-box/combo-box.directive.js +35 -0
- package/esm5/components/combo-box/combo-box.module.js +15 -4
- package/esm5/components/combo-box/combo-box.providers.js +28 -0
- package/esm5/components/combo-box/index.js +4 -1
- package/esm5/components/data-list-wrapper/data-list-wrapper.component.js +18 -11
- package/esm5/components/field-error/field-error.component.js +8 -16
- package/esm5/components/field-error/field-error.module.js +6 -2
- package/esm5/components/filter/filter.component.js +3 -3
- package/esm5/components/index.js +2 -1
- package/esm5/components/input/index.js +2 -1
- package/esm5/components/input/input.component.js +3 -3
- package/esm5/components/input/input.directive.js +28 -0
- package/esm5/components/input/input.module.js +5 -4
- package/esm5/components/input/input.providers.js +6 -2
- package/esm5/components/input-copy/index.js +3 -1
- package/esm5/components/input-copy/input-copy.component.js +7 -15
- package/esm5/components/input-copy/input-copy.directive.js +28 -0
- package/esm5/components/input-copy/input-copy.module.js +5 -4
- package/esm5/components/input-copy/input-copy.providers.js +16 -0
- package/esm5/components/input-count/index.js +2 -1
- package/esm5/components/input-count/input-count-options.js +6 -1
- package/esm5/components/input-count/input-count.component.js +10 -10
- package/esm5/components/input-count/input-count.directive.js +32 -0
- package/esm5/components/input-count/input-count.module.js +5 -4
- package/esm5/components/input-date/index.js +3 -1
- package/esm5/components/input-date/input-date.component.js +18 -29
- package/esm5/components/input-date/input-date.directive.js +38 -0
- package/esm5/components/input-date/input-date.module.js +5 -4
- package/esm5/components/input-date/input-date.providers.js +29 -0
- package/esm5/components/input-date-range/index.js +3 -1
- package/esm5/components/input-date-range/input-date-range.component.js +18 -29
- package/esm5/components/input-date-range/input-date-range.directive.js +38 -0
- package/esm5/components/input-date-range/input-date-range.module.js +9 -4
- package/esm5/components/input-date-range/input-date-range.providers.js +29 -0
- package/esm5/components/input-date-time/index.js +3 -1
- package/esm5/components/input-date-time/input-date-time.component.js +18 -37
- package/esm5/components/input-date-time/input-date-time.directive.js +38 -0
- package/esm5/components/input-date-time/input-date-time.module.js +9 -4
- package/esm5/components/input-date-time/input-date-time.providers.js +29 -0
- package/esm5/components/input-file/input-file.component.js +2 -9
- package/esm5/components/input-inline/input-inline.component.js +4 -17
- package/esm5/components/input-month/index.js +2 -1
- package/esm5/components/input-month/input-month.component.js +7 -10
- package/esm5/components/input-month/input-month.directive.js +44 -0
- package/esm5/components/input-month/input-month.module.js +5 -4
- package/esm5/components/input-month-range/index.js +2 -1
- package/esm5/components/input-month-range/input-month-range.component.js +7 -10
- package/esm5/components/input-month-range/input-month-range.directive.js +44 -0
- package/esm5/components/input-month-range/input-month-range.module.js +9 -4
- package/esm5/components/input-number/index.js +2 -1
- package/esm5/components/input-number/input-number.component.js +16 -10
- package/esm5/components/input-number/input-number.directive.js +39 -0
- package/esm5/components/input-number/input-number.module.js +5 -4
- package/esm5/components/input-password/index.js +2 -1
- package/esm5/components/input-password/input-password-options.js +6 -1
- package/esm5/components/input-password/input-password.component.js +8 -11
- package/esm5/components/input-password/input-password.directive.js +36 -0
- package/esm5/components/input-password/input-password.module.js +9 -4
- package/esm5/components/input-phone/index.js +2 -1
- package/esm5/components/input-phone/input-phone.component.js +13 -25
- package/esm5/components/input-phone/input-phone.directive.js +39 -0
- package/esm5/components/input-phone/input-phone.module.js +5 -4
- package/esm5/components/input-phone/input-phone.providers.js +17 -3
- package/esm5/components/input-phone-international/const/countries.js +14 -5
- package/esm5/components/input-phone-international/index.js +3 -1
- package/esm5/components/input-phone-international/input-phone-international.component.js +28 -22
- package/esm5/components/input-phone-international/tokens/countries-masks.js +6 -0
- package/esm5/components/input-phone-international/utils/extract-value-from-event.js +9 -0
- package/esm5/components/input-range/input-range.component.js +10 -7
- package/esm5/components/input-slider/input-slider.component.js +10 -7
- package/esm5/components/input-tag/index.js +2 -1
- package/esm5/components/input-tag/input-tag-options.js +9 -0
- package/esm5/components/input-tag/input-tag.component.js +36 -16
- package/esm5/components/input-time/input-time-options.js +9 -1
- package/esm5/components/input-time/input-time.component.js +10 -12
- package/esm5/components/marker-icon/marker-icon.component.js +3 -3
- package/esm5/components/multi-select/index.js +2 -1
- package/esm5/components/multi-select/multi-select-options.js +14 -0
- package/esm5/components/multi-select/multi-select.component.js +35 -21
- package/esm5/components/multi-select/multi-select.module.js +3 -1
- package/esm5/components/radio/radio-options.js +6 -1
- package/esm5/components/radio/radio.component.js +3 -3
- package/esm5/components/radio-block/radio-block.component.js +3 -3
- package/esm5/components/radio-labeled/radio-labeled.component.js +3 -3
- package/esm5/components/radio-list/radio-list.component.js +3 -3
- package/esm5/components/range/range.component.js +1 -1
- package/esm5/components/rating/index.js +4 -0
- package/esm5/components/rating/rating-options.js +16 -0
- package/esm5/components/rating/rating.component.js +111 -0
- package/esm5/components/rating/rating.module.js +26 -0
- package/esm5/components/rating/taiga-ui-kit-components-rating.js +5 -0
- package/esm5/components/select/index.js +4 -1
- package/esm5/components/select/select-options.js +13 -0
- package/esm5/components/select/select.component.js +35 -46
- package/esm5/components/select/select.directive.js +42 -0
- package/esm5/components/select/select.module.js +5 -4
- package/esm5/components/select/select.providers.js +28 -0
- package/esm5/components/slider/index.js +2 -1
- package/esm5/components/slider/slider-old.component.js +90 -0
- package/esm5/components/slider/slider.component.js +83 -53
- package/esm5/components/slider/slider.module.js +4 -3
- package/esm5/components/stepper/step/step.component.js +3 -3
- package/esm5/components/tabs/tab/tab.providers.js +3 -3
- package/esm5/components/tag/tag.component.js +12 -6
- package/esm5/components/text-area/text-area.component.js +9 -6
- package/esm5/components/text-area/text-area.module.js +2 -3
- package/esm5/components/toggle/toggle-options.js +6 -1
- package/esm5/components/toggle/toggle.component.js +3 -3
- package/esm5/constants/index.js +2 -1
- package/esm5/constants/max-time-values.js +7 -0
- package/esm5/pipes/field-error/field-error-pipe.js +153 -0
- package/esm5/pipes/field-error/field-error.module.js +16 -0
- package/esm5/pipes/field-error/index.js +3 -0
- package/esm5/pipes/field-error/taiga-ui-kit-pipes-field-error.js +5 -0
- package/esm5/pipes/index.js +2 -1
- package/esm5/providers/value-accessor.provider.js +3 -2
- package/esm5/tokens/date-inputs-value-transformers.js +5 -0
- package/esm5/tokens/index.js +3 -1
- package/esm5/tokens/items-handlers.js +16 -0
- package/esm5/types/index.js +1 -1
- package/esm5/types/time-format-parts.js +1 -0
- package/esm5/utils/mask/create-auto-corrected-time-pipe.js +8 -5
- package/esm5/utils/mask/create-time-mask.js +15 -7
- package/esm5/utils/miscellaneous/get-precision.js +9 -0
- package/esm5/utils/miscellaneous/index.js +2 -1
- package/esm5/utils/miscellaneous/replay-control-value-changes-factory.js +12 -4
- package/fesm2015/taiga-ui-kit-abstract.js +4 -2
- package/fesm2015/taiga-ui-kit-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-accordion.js +4 -4
- package/fesm2015/taiga-ui-kit-components-accordion.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-arrow.js +40 -11
- package/fesm2015/taiga-ui-kit-components-arrow.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-avatar.js +2 -2
- package/fesm2015/taiga-ui-kit-components-avatar.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-badge.js +2 -2
- package/fesm2015/taiga-ui-kit-components-badge.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-badged-content.js +2 -2
- package/fesm2015/taiga-ui-kit-components-badged-content.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-breadcrumbs.js +2 -2
- package/fesm2015/taiga-ui-kit-components-breadcrumbs.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-calendar-month.js +4 -1
- package/fesm2015/taiga-ui-kit-components-calendar-month.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-carousel.js +5 -4
- package/fesm2015/taiga-ui-kit-components-carousel.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox-block.js +2 -2
- package/fesm2015/taiga-ui-kit-components-checkbox-block.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox-labeled.js +2 -2
- package/fesm2015/taiga-ui-kit-components-checkbox-labeled.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox.js +3 -3
- package/fesm2015/taiga-ui-kit-components-checkbox.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-combo-box.js +118 -53
- package/fesm2015/taiga-ui-kit-components-combo-box.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-data-list-wrapper.js +16 -10
- package/fesm2015/taiga-ui-kit-components-data-list-wrapper.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-field-error.js +12 -13
- package/fesm2015/taiga-ui-kit-components-field-error.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-filter.js +2 -2
- package/fesm2015/taiga-ui-kit-components-filter.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-copy.js +41 -18
- package/fesm2015/taiga-ui-kit-components-input-copy.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-count.js +40 -14
- package/fesm2015/taiga-ui-kit-components-input-count.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-range.js +72 -31
- package/fesm2015/taiga-ui-kit-components-input-date-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-time.js +72 -35
- package/fesm2015/taiga-ui-kit-components-input-date-time.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date.js +68 -31
- package/fesm2015/taiga-ui-kit-components-input-date.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-file.js +1 -4
- package/fesm2015/taiga-ui-kit-components-input-file.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-inline.js +3 -12
- package/fesm2015/taiga-ui-kit-components-input-inline.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month-range.js +41 -10
- package/fesm2015/taiga-ui-kit-components-input-month-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month.js +37 -10
- package/fesm2015/taiga-ui-kit-components-input-month.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-number.js +45 -14
- package/fesm2015/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-password.js +45 -10
- package/fesm2015/taiga-ui-kit-components-input-password.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone-international.js +47 -26
- package/fesm2015/taiga-ui-kit-components-input-phone-international.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone.js +53 -27
- package/fesm2015/taiga-ui-kit-components-input-phone.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-range.js +9 -6
- package/fesm2015/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-slider.js +9 -6
- package/fesm2015/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-tag.js +39 -16
- package/fesm2015/taiga-ui-kit-components-input-tag.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-time.js +16 -7
- package/fesm2015/taiga-ui-kit-components-input-time.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input.js +29 -7
- package/fesm2015/taiga-ui-kit-components-input.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-marker-icon.js +2 -2
- package/fesm2015/taiga-ui-kit-components-marker-icon.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select.js +44 -18
- package/fesm2015/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio-block.js +2 -2
- package/fesm2015/taiga-ui-kit-components-radio-block.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio-labeled.js +2 -2
- package/fesm2015/taiga-ui-kit-components-radio-labeled.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio-list.js +2 -2
- package/fesm2015/taiga-ui-kit-components-radio-list.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio.js +7 -3
- package/fesm2015/taiga-ui-kit-components-radio.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-range.js +1 -1
- package/fesm2015/taiga-ui-kit-components-rating.js +127 -0
- package/fesm2015/taiga-ui-kit-components-rating.js.map +1 -0
- package/fesm2015/taiga-ui-kit-components-select.js +91 -40
- package/fesm2015/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-slider.js +100 -14
- package/fesm2015/taiga-ui-kit-components-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-stepper.js +2 -2
- package/fesm2015/taiga-ui-kit-components-stepper.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tabs.js +2 -2
- package/fesm2015/taiga-ui-kit-components-tabs.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tag.js +11 -5
- package/fesm2015/taiga-ui-kit-components-tag.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-text-area.js +9 -7
- package/fesm2015/taiga-ui-kit-components-text-area.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-toggle.js +7 -3
- package/fesm2015/taiga-ui-kit-components-toggle.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components.js +1 -0
- package/fesm2015/taiga-ui-kit-components.js.map +1 -1
- package/fesm2015/taiga-ui-kit-constants.js +8 -1
- package/fesm2015/taiga-ui-kit-constants.js.map +1 -1
- package/fesm2015/taiga-ui-kit-pipes-field-error.js +135 -0
- package/fesm2015/taiga-ui-kit-pipes-field-error.js.map +1 -0
- package/fesm2015/taiga-ui-kit-pipes.js +1 -0
- package/fesm2015/taiga-ui-kit-pipes.js.map +1 -1
- package/fesm2015/taiga-ui-kit-providers.js +2 -1
- package/fesm2015/taiga-ui-kit-providers.js.map +1 -1
- package/fesm2015/taiga-ui-kit-tokens.js +19 -1
- package/fesm2015/taiga-ui-kit-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-mask.js +20 -12
- package/fesm2015/taiga-ui-kit-utils-mask.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-miscellaneous.js +17 -3
- package/fesm2015/taiga-ui-kit-utils-miscellaneous.js.map +1 -1
- package/fesm5/taiga-ui-kit-abstract.js +4 -2
- package/fesm5/taiga-ui-kit-abstract.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-accordion.js +4 -4
- package/fesm5/taiga-ui-kit-components-accordion.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-arrow.js +41 -12
- package/fesm5/taiga-ui-kit-components-arrow.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-avatar.js +2 -2
- package/fesm5/taiga-ui-kit-components-avatar.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-badge.js +2 -2
- package/fesm5/taiga-ui-kit-components-badge.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-badged-content.js +2 -2
- package/fesm5/taiga-ui-kit-components-badged-content.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-breadcrumbs.js +2 -2
- package/fesm5/taiga-ui-kit-components-breadcrumbs.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-calendar-month.js +4 -1
- package/fesm5/taiga-ui-kit-components-calendar-month.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-carousel.js +5 -4
- package/fesm5/taiga-ui-kit-components-carousel.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-checkbox-block.js +2 -2
- package/fesm5/taiga-ui-kit-components-checkbox-block.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-checkbox-labeled.js +2 -2
- package/fesm5/taiga-ui-kit-components-checkbox-labeled.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-checkbox.js +3 -3
- package/fesm5/taiga-ui-kit-components-checkbox.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-combo-box.js +128 -57
- package/fesm5/taiga-ui-kit-components-combo-box.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-data-list-wrapper.js +17 -10
- package/fesm5/taiga-ui-kit-components-data-list-wrapper.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-field-error.js +12 -17
- package/fesm5/taiga-ui-kit-components-field-error.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-filter.js +2 -2
- package/fesm5/taiga-ui-kit-components-filter.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-copy.js +46 -18
- package/fesm5/taiga-ui-kit-components-input-copy.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-count.js +47 -15
- package/fesm5/taiga-ui-kit-components-input-count.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-date-range.js +81 -31
- package/fesm5/taiga-ui-kit-components-input-date-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-date-time.js +81 -39
- package/fesm5/taiga-ui-kit-components-input-date-time.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-date.js +77 -31
- package/fesm5/taiga-ui-kit-components-input-date.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-file.js +1 -8
- package/fesm5/taiga-ui-kit-components-input-file.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-inline.js +3 -16
- package/fesm5/taiga-ui-kit-components-input-inline.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-month-range.js +55 -14
- package/fesm5/taiga-ui-kit-components-input-month-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-month.js +51 -14
- package/fesm5/taiga-ui-kit-components-input-month.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-number.js +55 -14
- package/fesm5/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-password.js +52 -15
- package/fesm5/taiga-ui-kit-components-input-password.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-phone-international.js +51 -26
- package/fesm5/taiga-ui-kit-components-input-phone-international.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-phone.js +62 -27
- package/fesm5/taiga-ui-kit-components-input-phone.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-range.js +9 -6
- package/fesm5/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-slider.js +9 -6
- package/fesm5/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-tag.js +44 -17
- package/fesm5/taiga-ui-kit-components-input-tag.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-time.js +17 -12
- package/fesm5/taiga-ui-kit-components-input-time.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input.js +36 -8
- package/fesm5/taiga-ui-kit-components-input.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-marker-icon.js +2 -2
- package/fesm5/taiga-ui-kit-components-marker-icon.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-multi-select.js +49 -23
- package/fesm5/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-radio-block.js +2 -2
- package/fesm5/taiga-ui-kit-components-radio-block.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-radio-labeled.js +2 -2
- package/fesm5/taiga-ui-kit-components-radio-labeled.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-radio-list.js +2 -2
- package/fesm5/taiga-ui-kit-components-radio-list.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-radio.js +8 -4
- package/fesm5/taiga-ui-kit-components-radio.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-range.js +1 -1
- package/fesm5/taiga-ui-kit-components-rating.js +150 -0
- package/fesm5/taiga-ui-kit-components-rating.js.map +1 -0
- package/fesm5/taiga-ui-kit-components-select.js +105 -45
- package/fesm5/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-slider.js +141 -26
- package/fesm5/taiga-ui-kit-components-slider.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-stepper.js +2 -2
- package/fesm5/taiga-ui-kit-components-stepper.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-tabs.js +2 -2
- package/fesm5/taiga-ui-kit-components-tabs.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-tag.js +11 -5
- package/fesm5/taiga-ui-kit-components-tag.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-text-area.js +9 -7
- package/fesm5/taiga-ui-kit-components-text-area.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-toggle.js +8 -4
- package/fesm5/taiga-ui-kit-components-toggle.js.map +1 -1
- package/fesm5/taiga-ui-kit-components.js +1 -0
- package/fesm5/taiga-ui-kit-components.js.map +1 -1
- package/fesm5/taiga-ui-kit-constants.js +8 -1
- package/fesm5/taiga-ui-kit-constants.js.map +1 -1
- package/fesm5/taiga-ui-kit-pipes-field-error.js +171 -0
- package/fesm5/taiga-ui-kit-pipes-field-error.js.map +1 -0
- package/fesm5/taiga-ui-kit-pipes.js +1 -0
- package/fesm5/taiga-ui-kit-pipes.js.map +1 -1
- package/fesm5/taiga-ui-kit-providers.js +2 -1
- package/fesm5/taiga-ui-kit-providers.js.map +1 -1
- package/fesm5/taiga-ui-kit-tokens.js +20 -1
- package/fesm5/taiga-ui-kit-tokens.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-mask.js +19 -10
- package/fesm5/taiga-ui-kit-utils-mask.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-miscellaneous.js +20 -3
- package/fesm5/taiga-ui-kit-utils-miscellaneous.js.map +1 -1
- package/package.json +12 -12
- package/pipes/field-error/field-error-pipe.d.ts +29 -0
- package/pipes/field-error/field-error.module.d.ts +2 -0
- package/pipes/field-error/index.d.ts +2 -0
- package/pipes/field-error/package.json +13 -0
- package/pipes/field-error/taiga-ui-kit-pipes-field-error.d.ts +4 -0
- package/pipes/field-error/taiga-ui-kit-pipes-field-error.metadata.json +1 -0
- package/pipes/index.d.ts +1 -0
- package/pipes/taiga-ui-kit-pipes.metadata.json +1 -1
- package/providers/taiga-ui-kit-providers.metadata.json +1 -1
- package/providers/value-accessor.provider.d.ts +1 -1
- package/tokens/date-inputs-value-transformers.d.ts +5 -0
- package/tokens/index.d.ts +2 -0
- package/tokens/items-handlers.d.ts +10 -0
- package/tokens/taiga-ui-kit-tokens.metadata.json +1 -1
- package/types/index.d.ts +1 -0
- package/types/taiga-ui-kit-types.metadata.json +1 -1
- package/types/time-format-parts.d.ts +1 -0
- package/utils/mask/create-auto-corrected-time-pipe.d.ts +2 -1
- package/utils/mask/create-time-mask.d.ts +2 -1
- package/utils/mask/taiga-ui-kit-utils-mask.metadata.json +1 -1
- package/utils/miscellaneous/get-precision.d.ts +4 -0
- package/utils/miscellaneous/index.d.ts +1 -0
- package/utils/miscellaneous/replay-control-value-changes-factory.d.ts +3 -2
- package/utils/miscellaneous/taiga-ui-kit-utils-miscellaneous.metadata.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-month.js","sources":["ng://@taiga-ui/kit/components/input-month/input-month.component.ts","ng://@taiga-ui/kit/components/input-month/input-month.module.ts","ng://@taiga-ui/kit/components/input-month/taiga-ui-kit-components-input-month.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiNullableControl,\n ALWAYS_FALSE_HANDLER,\n TUI_FIRST_DAY,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TUI_LAST_DAY,\n TuiBooleanHandler,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiMonth,\n} from '@taiga-ui/cdk';\nimport {\n sizeBigger,\n TUI_TEXTFIELD_SIZE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldSizeDirective,\n TuiWithOptionalMinMax,\n} from '@taiga-ui/core';\nimport {LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit/providers';\n\n// @dynamic\n@Component({\n selector: 'tui-input-month',\n templateUrl: './input-month.template.html',\n styleUrls: ['./input-month.style.less'],\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputMonthComponent),\n },\n LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiInputMonthComponent\n extends AbstractTuiNullableControl<TuiMonth>\n implements TuiWithOptionalMinMax<TuiMonth>, TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-month.js","sources":["ng://@taiga-ui/kit/components/input-month/input-month.component.ts","ng://@taiga-ui/kit/components/input-month/input-month.directive.ts","ng://@taiga-ui/kit/components/input-month/input-month.module.ts","ng://@taiga-ui/kit/components/input-month/taiga-ui-kit-components-input-month.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiControl,\n AbstractTuiNullableControl,\n ALWAYS_FALSE_HANDLER,\n TUI_FIRST_DAY,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TUI_LAST_DAY,\n TuiBooleanHandler,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiMonth,\n} from '@taiga-ui/cdk';\nimport {\n sizeBigger,\n TUI_TEXTFIELD_SIZE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldSizeDirective,\n TuiWithOptionalMinMax,\n} from '@taiga-ui/core';\nimport {LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit/providers';\n\n// @dynamic\n@Component({\n selector: 'tui-input-month',\n templateUrl: './input-month.template.html',\n styleUrls: ['./input-month.style.less'],\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputMonthComponent),\n },\n {\n provide: AbstractTuiControl,\n useExisting: forwardRef(() => TuiInputMonthComponent),\n },\n LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiInputMonthComponent\n extends AbstractTuiNullableControl<TuiMonth>\n implements TuiWithOptionalMinMax<TuiMonth>, TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n readonly textfield?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n min: TuiMonth = TUI_FIRST_DAY;\n\n @Input()\n @tuiDefaultProp()\n max: TuiMonth = TUI_LAST_DAY;\n\n @Input()\n @tuiDefaultProp()\n disabledItemHandler: TuiBooleanHandler<TuiMonth> = ALWAYS_FALSE_HANDLER;\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(TUI_TEXTFIELD_SIZE)\n private readonly textfieldSize: TuiTextfieldSizeDirective,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.textfield ? this.textfield.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.textfield && this.textfield.focused;\n }\n\n get calendarIcon(): string {\n return sizeBigger(this.textfieldSize.size)\n ? 'tuiIconCalendarLarge'\n : 'tuiIconCalendar';\n }\n\n onValueChange(value: string) {\n if (value === '') {\n this.updateValue(null);\n this.onOpenChange(true);\n }\n }\n\n onMonthClick(month: TuiMonth) {\n this.updateValue(month);\n this.close();\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onFocused(focused: boolean) {\n this.updateFocused(focused);\n }\n\n onOpenChange(open: boolean) {\n this.open = open;\n }\n\n toggle() {\n this.open = !this.open;\n }\n\n setDisabledState() {\n super.setDisabledState();\n this.close();\n }\n\n private close() {\n this.open = false;\n }\n}\n","import {Directive, forwardRef} from '@angular/core';\nimport {TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost} from '@taiga-ui/core';\n\nimport {TuiInputMonthComponent} from './input-month.component';\n\n@Directive({\n selector: 'tui-input-month',\n providers: [\n {\n provide: TUI_TEXTFIELD_HOST,\n useExisting: forwardRef(() => TuiInputMonthDirective),\n },\n ],\n})\nexport class TuiInputMonthDirective extends TuiAbstractTextfieldHost<TuiInputMonthComponent> {\n get readOnly(): boolean {\n return true;\n }\n\n // TODO: Fix change detection\n get value(): string {\n return this.host.textfield?.value || '';\n }\n\n onValueChange(value: string) {\n this.host.onValueChange(value);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiPreventDefaultModule} from '@taiga-ui/cdk';\nimport {\n TuiHostedDropdownModule,\n TuiMonthPipeModule,\n TuiPrimitiveTextfieldModule,\n TuiSvgModule,\n TuiTextfieldComponent,\n} from '@taiga-ui/core';\nimport {TuiCalendarMonthModule} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthComponent} from './input-month.component';\nimport {TuiInputMonthDirective} from './input-month.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiCalendarMonthModule,\n TuiHostedDropdownModule,\n TuiPrimitiveTextfieldModule,\n TuiSvgModule,\n TuiPreventDefaultModule,\n TuiMonthPipeModule,\n ],\n declarations: [TuiInputMonthComponent, TuiInputMonthDirective],\n exports: [TuiInputMonthComponent, TuiInputMonthDirective, TuiTextfieldComponent],\n})\nexport class TuiInputMonthModule {}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AI,QAAQ;QACR,OAAO,IAAI,CAAC;KACf;;IAGD,IAAI,KAAK;;QACL,OAAO,OAAA,IAAI,CAAC,IAAI,CAAC,SAAS,0CAAE,KAAK,KAAI,EAAE,CAAC;KAC3C;IAED,aAAa,CAAC,KAAa;QACvB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KAClC;EACJ;AAbY,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,CAalC;;ICCY,mBAAmB,GAAhC,MAAa,mBAAmB;EAAG;AAAtB,mBAAmB;IAb/B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,sBAAsB;YACtB,uBAAuB;YACvB,2BAA2B;YAC3B,YAAY;YACZ,uBAAuB;YACvB,kBAAkB;SACrB;QACD,YAAY,EAAE,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;QAC9D,OAAO,EAAE,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC;KACnF,CAAC;GACW,mBAAmB,CAAG;;AC5BnC;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __decorate, __param } from 'tslib';
|
|
2
|
-
import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, HostListener, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
2
|
+
import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, HostListener, Component, ChangeDetectionStrategy, forwardRef, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { NgControl } from '@angular/forms';
|
|
4
|
-
import { AbstractTuiNullableControl, tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR, TuiMapperPipeModule } from '@taiga-ui/cdk';
|
|
5
|
-
import { tuiCreateNumberMask, tuiCreateAutoCorrectedNumberPipe, getFractionPartPadded, formatNumber, maskedMoneyValueIsEmpty, maskedNumberStringToNumber, TUI_DECIMAL_SYMBOLS, TUI_NUMBER_FORMAT, TuiPrimitiveTextfieldComponent, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule } from '@taiga-ui/core';
|
|
4
|
+
import { AbstractTuiNullableControl, tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiControl, TuiMapperPipeModule } from '@taiga-ui/cdk';
|
|
5
|
+
import { tuiCreateNumberMask, tuiCreateAutoCorrectedNumberPipe, getFractionPartPadded, formatNumber, maskedMoneyValueIsEmpty, maskedNumberStringToNumber, TUI_DECIMAL_SYMBOLS, TUI_NUMBER_FORMAT, TuiPrimitiveTextfieldComponent, TuiAbstractTextfieldHost, TUI_TEXTFIELD_HOST, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule, TuiTextfieldComponent } from '@taiga-ui/core';
|
|
6
6
|
import { TuiValueAccessorModule } from '@taiga-ui/kit/directives';
|
|
7
7
|
import { TextMaskModule } from 'angular2-text-mask';
|
|
8
8
|
|
|
@@ -48,11 +48,11 @@ let TuiInputNumberComponent = TuiInputNumberComponent_1 = class TuiInputNumberCo
|
|
|
48
48
|
return this.decimal === 'never' ? 'numeric' : 'decimal';
|
|
49
49
|
}
|
|
50
50
|
get calculatedMaxLength() {
|
|
51
|
-
|
|
52
|
-
(this.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
const decimalPart = this.decimal !== 'never' &&
|
|
52
|
+
this.nativeValue.includes(this.numberFormat.decimalSeparator);
|
|
53
|
+
const precision = decimalPart ? this.precision + 1 : 0;
|
|
54
|
+
const takeThousand = this.numberFormat.thousandSeparator.repeat(5).length;
|
|
55
|
+
return DEFAULT_MAX_LENGTH + precision + takeThousand;
|
|
56
56
|
}
|
|
57
57
|
get formattedValue() {
|
|
58
58
|
const value = this.value || 0;
|
|
@@ -83,7 +83,7 @@ let TuiInputNumberComponent = TuiInputNumberComponent_1 = class TuiInputNumberCo
|
|
|
83
83
|
event.preventDefault();
|
|
84
84
|
nativeFocusableElement.selectionStart++;
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
onValueChange(value) {
|
|
87
87
|
if (maskedMoneyValueIsEmpty(value)) {
|
|
88
88
|
this.updateValue(null);
|
|
89
89
|
return;
|
|
@@ -159,7 +159,9 @@ let TuiInputNumberComponent = TuiInputNumberComponent_1 = class TuiInputNumberCo
|
|
|
159
159
|
}
|
|
160
160
|
absoluteCapInputValue(inputValue) {
|
|
161
161
|
const value = maskedNumberStringToNumber(inputValue, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
|
|
162
|
-
const capped = value < 0
|
|
162
|
+
const capped = value < 0
|
|
163
|
+
? Math.max(Math.max(this.min, Number.MIN_SAFE_INTEGER), value)
|
|
164
|
+
: Math.min(value, Math.min(this.max, Number.MAX_SAFE_INTEGER));
|
|
163
165
|
const ineligibleValue = isNaN(capped) || capped < this.min || capped > this.max;
|
|
164
166
|
return ineligibleValue ? null : capped;
|
|
165
167
|
}
|
|
@@ -209,13 +211,17 @@ __decorate([
|
|
|
209
211
|
TuiInputNumberComponent = TuiInputNumberComponent_1 = __decorate([
|
|
210
212
|
Component({
|
|
211
213
|
selector: 'tui-input-number',
|
|
212
|
-
template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"decimal\"\n class=\"textfield\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoFocused]=\"computedFocused\"\n [invalid]=\"computedInvalid\"\n [tuiTextfieldMaxLength]=\"calculatedMaxLength\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [textMask]=\"isNegativeAllowed | tuiMapper: mask:decimal:precision:nativeFocusableElement\"\n [value]=\"computedValue\"\n [prefix]=\"prefix\"\n [postfix]=\"postfix\"\n [focusable]=\"focusable\"\n (valueChange)=\"
|
|
214
|
+
template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"decimal\"\n class=\"textfield\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoFocused]=\"computedFocused\"\n [invalid]=\"computedInvalid\"\n [tuiTextfieldMaxLength]=\"calculatedMaxLength\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [textMask]=\"isNegativeAllowed | tuiMapper: mask:decimal:precision:nativeFocusableElement\"\n [value]=\"computedValue\"\n [prefix]=\"prefix\"\n [postfix]=\"postfix\"\n [focusable]=\"focusable\"\n (valueChange)=\"onValueChange($event)\"\n (hoveredChange)=\"onHovered($event)\"\n (focusedChange)=\"onFocused($event)\"\n (pressedChange)=\"onPressed($event)\"\n (keydown)=\"onKeyDown($event)\"\n>\n <ng-content></ng-content>\n <ng-content select=\"input\" ngProjectAs=\"input\"></ng-content>\n</tui-primitive-textfield>\n",
|
|
213
215
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
214
216
|
providers: [
|
|
215
217
|
{
|
|
216
218
|
provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
|
|
217
219
|
useExisting: forwardRef(() => TuiInputNumberComponent_1),
|
|
218
220
|
},
|
|
221
|
+
{
|
|
222
|
+
provide: AbstractTuiControl,
|
|
223
|
+
useExisting: forwardRef(() => TuiInputNumberComponent_1),
|
|
224
|
+
},
|
|
219
225
|
],
|
|
220
226
|
styles: [":host{display:block;border-radius:var(--tui-radius-m);text-align:left}.textfield{border-radius:inherit;text-align:inherit}"]
|
|
221
227
|
}),
|
|
@@ -226,6 +232,31 @@ TuiInputNumberComponent = TuiInputNumberComponent_1 = __decorate([
|
|
|
226
232
|
__param(2, Inject(TUI_NUMBER_FORMAT))
|
|
227
233
|
], TuiInputNumberComponent);
|
|
228
234
|
|
|
235
|
+
var TuiInputNumberDirective_1;
|
|
236
|
+
let TuiInputNumberDirective = TuiInputNumberDirective_1 = class TuiInputNumberDirective extends TuiAbstractTextfieldHost {
|
|
237
|
+
get value() {
|
|
238
|
+
return this.host.computedValue;
|
|
239
|
+
}
|
|
240
|
+
onValueChange(value) {
|
|
241
|
+
this.host.onValueChange(value);
|
|
242
|
+
}
|
|
243
|
+
process(input) {
|
|
244
|
+
input.inputMode = 'decimal';
|
|
245
|
+
// TODO maxLength?
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
TuiInputNumberDirective = TuiInputNumberDirective_1 = __decorate([
|
|
249
|
+
Directive({
|
|
250
|
+
selector: 'tui-input-number',
|
|
251
|
+
providers: [
|
|
252
|
+
{
|
|
253
|
+
provide: TUI_TEXTFIELD_HOST,
|
|
254
|
+
useExisting: forwardRef(() => TuiInputNumberDirective_1),
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
})
|
|
258
|
+
], TuiInputNumberDirective);
|
|
259
|
+
|
|
229
260
|
let TuiInputNumberModule = class TuiInputNumberModule {
|
|
230
261
|
};
|
|
231
262
|
TuiInputNumberModule = __decorate([
|
|
@@ -237,8 +268,8 @@ TuiInputNumberModule = __decorate([
|
|
|
237
268
|
TuiTextfieldControllerModule,
|
|
238
269
|
TuiValueAccessorModule,
|
|
239
270
|
],
|
|
240
|
-
declarations: [TuiInputNumberComponent],
|
|
241
|
-
exports: [TuiInputNumberComponent],
|
|
271
|
+
declarations: [TuiInputNumberComponent, TuiInputNumberDirective],
|
|
272
|
+
exports: [TuiInputNumberComponent, TuiInputNumberDirective, TuiTextfieldComponent],
|
|
242
273
|
})
|
|
243
274
|
], TuiInputNumberModule);
|
|
244
275
|
|
|
@@ -246,5 +277,5 @@ TuiInputNumberModule = __decorate([
|
|
|
246
277
|
* Generated bundle index. Do not edit.
|
|
247
278
|
*/
|
|
248
279
|
|
|
249
|
-
export { TuiInputNumberComponent, TuiInputNumberModule };
|
|
280
|
+
export { TuiInputNumberComponent, TuiInputNumberDirective, TuiInputNumberModule };
|
|
250
281
|
//# sourceMappingURL=taiga-ui-kit-components-input-number.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-number.js","sources":["ng://@taiga-ui/kit/components/input-number/input-number.component.ts","ng://@taiga-ui/kit/components/input-number/input-number.module.ts","ng://@taiga-ui/kit/components/input-number/taiga-ui-kit-components-input-number.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n HostListener,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiNullableControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiInputModeT,\n TuiMapper,\n} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n getFractionPartPadded,\n maskedMoneyValueIsEmpty,\n maskedNumberStringToNumber,\n NumberFormatSettings,\n TUI_DECIMAL_SYMBOLS,\n TUI_NUMBER_FORMAT,\n tuiCreateAutoCorrectedNumberPipe,\n tuiCreateNumberMask,\n TuiDecimalT,\n TuiPrimitiveTextfieldComponent,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\n\nconst DEFAULT_MAX_LENGTH = 18;\n\n// @dynamic\n@Component({\n selector: 'tui-input-number',\n templateUrl: './input-number.template.html',\n styleUrls: ['./input-number.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputNumberComponent),\n },\n ],\n})\nexport class TuiInputNumberComponent\n extends AbstractTuiNullableControl<number>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly primitiveTextfield?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n min = -Infinity;\n\n @Input()\n @tuiDefaultProp()\n max = Infinity;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = 'not-zero';\n\n @Input()\n @tuiDefaultProp()\n precision = 2;\n\n @Input()\n @tuiDefaultProp()\n prefix = '';\n\n @Input()\n @tuiDefaultProp()\n postfix = '';\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef)\n changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_NUMBER_FORMAT)\n private readonly numberFormat: NumberFormatSettings,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return !this.primitiveTextfield || this.computedDisabled\n ? null\n : this.primitiveTextfield.nativeFocusableElement;\n }\n\n get focused(): boolean {\n return !!this.primitiveTextfield && this.primitiveTextfield.focused;\n }\n\n get isNegativeAllowed(): boolean {\n return this.min < 0;\n }\n\n get inputMode(): TuiInputModeT {\n return this.decimal === 'never' ? 'numeric' : 'decimal';\n }\n\n get calculatedMaxLength(): number {\n return (\n DEFAULT_MAX_LENGTH +\n (this.decimal !== 'never' &&\n this.nativeValue.includes(this.numberFormat.decimalSeparator)\n ? this.precision + 1\n : 0)\n );\n }\n\n get formattedValue(): string {\n const value = this.value || 0;\n const absValue = Math.abs(value);\n const hasFraction = absValue % 1 > 0;\n let limit = this.decimal === 'always' || hasFraction ? this.precision : 0;\n\n const fraction = hasFraction ? getFractionPartPadded(value, this.precision) : '';\n\n if (this.focused && this.decimal !== 'always') {\n limit = fraction.length;\n }\n\n return formatNumber(\n value,\n limit,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n this.numberFormat.zeroPadding,\n );\n }\n\n get computedValue(): string {\n if (this.focused) {\n return this.nativeValue;\n }\n\n return this.value === null ? '' : this.formattedValue;\n }\n\n @HostListener('keydown.0', ['$event'])\n onZero(event: KeyboardEvent) {\n const decimal =\n this.nativeValue.split(this.numberFormat.decimalSeparator)[1] || '';\n const {nativeFocusableElement} = this;\n\n if (\n decimal.length < this.precision ||\n !nativeFocusableElement ||\n !nativeFocusableElement.selectionStart ||\n this.nativeValue[nativeFocusableElement.selectionStart] !== '0'\n ) {\n return;\n }\n\n event.preventDefault();\n nativeFocusableElement.selectionStart++;\n }\n\n mask: TuiMapper<boolean, TuiTextMaskOptions> = (\n allowNegative: boolean,\n decimal: TuiDecimalT,\n decimalLimit: number,\n nativeFocusableElement: HTMLInputElement | null,\n ) => ({\n mask: tuiCreateNumberMask({\n allowNegative,\n decimalLimit,\n allowDecimal: decimal !== 'never',\n requireDecimal: decimal === 'always',\n autoCorrectDecimalSymbol: false,\n decimalSymbol: this.numberFormat.decimalSeparator,\n thousandSymbol: this.numberFormat.thousandSeparator,\n }),\n pipe: tuiCreateAutoCorrectedNumberPipe(\n decimal === 'always' ? decimalLimit : 0,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n nativeFocusableElement || undefined,\n allowNegative,\n ),\n guide: false,\n });\n\n onValue(value: string) {\n if (maskedMoneyValueIsEmpty(value)) {\n this.updateValue(null);\n\n return;\n }\n\n if (this.isNativeValueNotFinished) {\n return;\n }\n\n const capped = this.absoluteCapInputValue(value);\n\n if (capped === null || isNaN(capped)) {\n return;\n }\n\n this.updateValue(capped);\n\n if (\n capped !==\n maskedNumberStringToNumber(\n value,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n )\n ) {\n this.nativeValue = this.formattedValue;\n }\n }\n\n onKeyDown(event: KeyboardEvent) {\n if (TUI_DECIMAL_SYMBOLS.indexOf(event.key) === -1) {\n return;\n }\n\n if (this.decimal === 'never') {\n event.preventDefault();\n\n return;\n }\n\n if (this.nativeValue.includes(this.numberFormat.decimalSeparator)) {\n event.preventDefault();\n this.setCaretAfterComma();\n }\n }\n\n onFocused(focused: boolean) {\n this.updateFocused(focused);\n\n if (focused) {\n return;\n }\n\n const nativeNumberValue = this.nativeNumberValue;\n\n if (isNaN(nativeNumberValue)) {\n this.clear();\n\n return;\n }\n\n const clamped = Math.min(this.max, Math.max(this.min, nativeNumberValue));\n\n this.updateValue(clamped);\n this.nativeValue = this.formattedValue;\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onPressed(pressed: boolean) {\n this.updatePressed(pressed);\n }\n\n private get isNativeValueNotFinished(): boolean {\n const nativeNumberValue = this.nativeNumberValue;\n\n return nativeNumberValue < 0\n ? nativeNumberValue > this.max\n : nativeNumberValue < this.min;\n }\n\n private get nativeValue(): string {\n return this.nativeFocusableElement ? this.nativeFocusableElement.value : '';\n }\n\n private get nativeNumberValue(): number {\n return maskedNumberStringToNumber(\n this.nativeValue,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n\n private set nativeValue(value: string) {\n if (!this.primitiveTextfield || !this.nativeFocusableElement) {\n return;\n }\n\n this.primitiveTextfield.value = value;\n this.nativeFocusableElement.value = value;\n }\n\n private clear() {\n this.nativeValue = '';\n this.updateValue(null);\n }\n\n private absoluteCapInputValue(inputValue: string): number | null {\n const value = maskedNumberStringToNumber(\n inputValue,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n const capped = value < 0 ? Math.max(this.min, value) : Math.min(value, this.max);\n const ineligibleValue = isNaN(capped) || capped < this.min || capped > this.max;\n\n return ineligibleValue ? null : capped;\n }\n\n private setCaretAfterComma() {\n if (!this.nativeFocusableElement) {\n return;\n }\n\n const afterCommaPosition = this.nativeValue.length - this.precision;\n\n this.nativeFocusableElement.setSelectionRange(\n afterCommaPosition,\n afterCommaPosition,\n );\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiMapperPipeModule} from '@taiga-ui/cdk';\nimport {TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit/directives';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputNumberComponent} from './input-number.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiMapperPipeModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputNumberComponent],\n exports: [TuiInputNumberComponent],\n})\nexport class TuiInputNumberModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAoCA,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;IAaa,uBAAuB,+BAApC,MAAa,uBACT,SAAQ,0BAAkC;IA8B1C,YAII,OAAyB,EAEzB,iBAAoC,EAEnB,YAAkC;QAEnD,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAFjB,iBAAY,GAAZ,YAAY,CAAsB;QA9BvD,QAAG,GAAG,CAAC,QAAQ,CAAC;QAIhB,QAAG,GAAG,QAAQ,CAAC;QAIf,YAAO,GAAgB,UAAU,CAAC;QAIlC,cAAS,GAAG,CAAC,CAAC;QAId,WAAM,GAAG,EAAE,CAAC;QAIZ,YAAO,GAAG,EAAE,CAAC;QA2Fb,SAAI,GAA2C,CAC3C,aAAsB,EACtB,OAAoB,EACpB,YAAoB,EACpB,sBAA+C,MAC7C;YACF,IAAI,EAAE,mBAAmB,CAAC;gBACtB,aAAa;gBACb,YAAY;gBACZ,YAAY,EAAE,OAAO,KAAK,OAAO;gBACjC,cAAc,EAAE,OAAO,KAAK,QAAQ;gBACpC,wBAAwB,EAAE,KAAK;gBAC/B,aAAa,EAAE,IAAI,CAAC,YAAY,CAAC,gBAAgB;gBACjD,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,iBAAiB;aACtD,CAAC;YACF,IAAI,EAAE,gCAAgC,CAClC,OAAO,KAAK,QAAQ,GAAG,YAAY,GAAG,CAAC,EACvC,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAClC,IAAI,CAAC,YAAY,CAAC,iBAAiB,EACnC,sBAAsB,IAAI,SAAS,EACnC,aAAa,CAChB;YACD,KAAK,EAAE,KAAK;SACf,CAAC,CAAC;KArGF;IAED,IAAI,sBAAsB;QACtB,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,gBAAgB;cAClD,IAAI;cACJ,I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WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;GAtCrB,uBAAuB,CAwRnC;;ICxTY,oBAAoB,GAAjC,MAAa,oBAAoB;EAAG;AAAvB,oBAAoB;IAXhC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,cAAc;YACd,mBAAmB;YACnB,2BAA2B;YAC3B,4BAA4B;YAC5B,sBAAsB;SACzB;QACD,YAAY,EAAE,CAAC,uBAAuB,CAAC;QACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;KACrC,CAAC;GACW,oBAAoB,CAAG;;ACnBpC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-number.js","sources":["ng://@taiga-ui/kit/components/input-number/input-number.component.ts","ng://@taiga-ui/kit/components/input-number/input-number.directive.ts","ng://@taiga-ui/kit/components/input-number/input-number.module.ts","ng://@taiga-ui/kit/components/input-number/taiga-ui-kit-components-input-number.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n HostListener,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiControl,\n AbstractTuiNullableControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiInputModeT,\n TuiMapper,\n} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n getFractionPartPadded,\n maskedMoneyValueIsEmpty,\n maskedNumberStringToNumber,\n NumberFormatSettings,\n TUI_DECIMAL_SYMBOLS,\n TUI_NUMBER_FORMAT,\n tuiCreateAutoCorrectedNumberPipe,\n tuiCreateNumberMask,\n TuiDecimalT,\n TuiPrimitiveTextfieldComponent,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\n\nconst DEFAULT_MAX_LENGTH = 18;\n\n// @dynamic\n@Component({\n selector: 'tui-input-number',\n templateUrl: './input-number.template.html',\n styleUrls: ['./input-number.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputNumberComponent),\n },\n {\n provide: AbstractTuiControl,\n useExisting: forwardRef(() => TuiInputNumberComponent),\n },\n ],\n})\nexport class TuiInputNumberComponent\n extends AbstractTuiNullableControl<number>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly primitiveTextfield?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n min = -Infinity;\n\n @Input()\n @tuiDefaultProp()\n max = Infinity;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = 'not-zero';\n\n @Input()\n @tuiDefaultProp()\n precision = 2;\n\n @Input()\n @tuiDefaultProp()\n prefix = '';\n\n @Input()\n @tuiDefaultProp()\n postfix = '';\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef)\n changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_NUMBER_FORMAT)\n private readonly numberFormat: NumberFormatSettings,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return !this.primitiveTextfield || this.computedDisabled\n ? null\n : this.primitiveTextfield.nativeFocusableElement;\n }\n\n get focused(): boolean {\n return !!this.primitiveTextfield && this.primitiveTextfield.focused;\n }\n\n get isNegativeAllowed(): boolean {\n return this.min < 0;\n }\n\n get inputMode(): TuiInputModeT {\n return this.decimal === 'never' ? 'numeric' : 'decimal';\n }\n\n get calculatedMaxLength(): number {\n const decimalPart =\n this.decimal !== 'never' &&\n this.nativeValue.includes(this.numberFormat.decimalSeparator);\n const precision = decimalPart ? this.precision + 1 : 0;\n const takeThousand = this.numberFormat.thousandSeparator.repeat(5).length;\n\n return DEFAULT_MAX_LENGTH + precision + takeThousand;\n }\n\n get formattedValue(): string {\n const value = this.value || 0;\n const absValue = Math.abs(value);\n const hasFraction = absValue % 1 > 0;\n let limit = this.decimal === 'always' || hasFraction ? this.precision : 0;\n\n const fraction = hasFraction ? getFractionPartPadded(value, this.precision) : '';\n\n if (this.focused && this.decimal !== 'always') {\n limit = fraction.length;\n }\n\n return formatNumber(\n value,\n limit,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n this.numberFormat.zeroPadding,\n );\n }\n\n get computedValue(): string {\n if (this.focused) {\n return this.nativeValue;\n }\n\n return this.value === null ? '' : this.formattedValue;\n }\n\n @HostListener('keydown.0', ['$event'])\n onZero(event: KeyboardEvent) {\n const decimal =\n this.nativeValue.split(this.numberFormat.decimalSeparator)[1] || '';\n const {nativeFocusableElement} = this;\n\n if (\n decimal.length < this.precision ||\n !nativeFocusableElement ||\n !nativeFocusableElement.selectionStart ||\n this.nativeValue[nativeFocusableElement.selectionStart] !== '0'\n ) {\n return;\n }\n\n event.preventDefault();\n nativeFocusableElement.selectionStart++;\n }\n\n mask: TuiMapper<boolean, TuiTextMaskOptions> = (\n allowNegative: boolean,\n decimal: TuiDecimalT,\n decimalLimit: number,\n nativeFocusableElement: HTMLInputElement | null,\n ) => ({\n mask: tuiCreateNumberMask({\n allowNegative,\n decimalLimit,\n allowDecimal: decimal !== 'never',\n requireDecimal: decimal === 'always',\n autoCorrectDecimalSymbol: false,\n decimalSymbol: this.numberFormat.decimalSeparator,\n thousandSymbol: this.numberFormat.thousandSeparator,\n }),\n pipe: tuiCreateAutoCorrectedNumberPipe(\n decimal === 'always' ? decimalLimit : 0,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n nativeFocusableElement || undefined,\n allowNegative,\n ),\n guide: false,\n });\n\n onValueChange(value: string) {\n if (maskedMoneyValueIsEmpty(value)) {\n this.updateValue(null);\n\n return;\n }\n\n if (this.isNativeValueNotFinished) {\n return;\n }\n\n const capped = this.absoluteCapInputValue(value);\n\n if (capped === null || isNaN(capped)) {\n return;\n }\n\n this.updateValue(capped);\n\n if (\n capped !==\n maskedNumberStringToNumber(\n value,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n )\n ) {\n this.nativeValue = this.formattedValue;\n }\n }\n\n onKeyDown(event: KeyboardEvent) {\n if (TUI_DECIMAL_SYMBOLS.indexOf(event.key) === -1) {\n return;\n }\n\n if (this.decimal === 'never') {\n event.preventDefault();\n\n return;\n }\n\n if (this.nativeValue.includes(this.numberFormat.decimalSeparator)) {\n event.preventDefault();\n this.setCaretAfterComma();\n }\n }\n\n onFocused(focused: boolean) {\n this.updateFocused(focused);\n\n if (focused) {\n return;\n }\n\n const nativeNumberValue = this.nativeNumberValue;\n\n if (isNaN(nativeNumberValue)) {\n this.clear();\n\n return;\n }\n\n const clamped = Math.min(this.max, Math.max(this.min, nativeNumberValue));\n\n this.updateValue(clamped);\n this.nativeValue = this.formattedValue;\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onPressed(pressed: boolean) {\n this.updatePressed(pressed);\n }\n\n private get isNativeValueNotFinished(): boolean {\n const nativeNumberValue = this.nativeNumberValue;\n\n return nativeNumberValue < 0\n ? nativeNumberValue > this.max\n : nativeNumberValue < this.min;\n }\n\n private get nativeValue(): string {\n return this.nativeFocusableElement ? this.nativeFocusableElement.value : '';\n }\n\n private get nativeNumberValue(): number {\n return maskedNumberStringToNumber(\n this.nativeValue,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n\n private set nativeValue(value: string) {\n if (!this.primitiveTextfield || !this.nativeFocusableElement) {\n return;\n }\n\n this.primitiveTextfield.value = value;\n this.nativeFocusableElement.value = value;\n }\n\n private clear() {\n this.nativeValue = '';\n this.updateValue(null);\n }\n\n private absoluteCapInputValue(inputValue: string): number | null {\n const value = maskedNumberStringToNumber(\n inputValue,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n const capped =\n value < 0\n ? Math.max(Math.max(this.min, Number.MIN_SAFE_INTEGER), value)\n : Math.min(value, Math.min(this.max, Number.MAX_SAFE_INTEGER));\n const ineligibleValue = isNaN(capped) || capped < this.min || capped > this.max;\n\n return ineligibleValue ? null : capped;\n }\n\n private setCaretAfterComma() {\n if (!this.nativeFocusableElement) {\n return;\n }\n\n const afterCommaPosition = this.nativeValue.length - this.precision;\n\n this.nativeFocusableElement.setSelectionRange(\n afterCommaPosition,\n afterCommaPosition,\n );\n }\n}\n","import {Directive, forwardRef} from '@angular/core';\nimport {TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost} from '@taiga-ui/core';\n\nimport {TuiInputNumberComponent} from './input-number.component';\n\n@Directive({\n selector: 'tui-input-number',\n providers: [\n {\n provide: TUI_TEXTFIELD_HOST,\n useExisting: forwardRef(() => TuiInputNumberDirective),\n },\n ],\n})\nexport class TuiInputNumberDirective extends TuiAbstractTextfieldHost<TuiInputNumberComponent> {\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 input.inputMode = 'decimal';\n // TODO maxLength?\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiMapperPipeModule} from '@taiga-ui/cdk';\nimport {\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 {TuiInputNumberComponent} from './input-number.component';\nimport {TuiInputNumberDirective} from './input-number.directive';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiMapperPipeModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputNumberComponent, TuiInputNumberDirective],\n exports: [TuiInputNumberComponent, TuiInputNumberDirective, TuiTextfieldComponent],\n})\nexport class TuiInputNumberModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAqCA,MAA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decorate, __param } from 'tslib';
|
|
2
|
-
import { InjectionToken, Optional, Self, Inject, ChangeDetectorRef, ViewChild, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Optional, Self, Inject, ChangeDetectorRef, ViewChild, Component, ChangeDetectionStrategy, forwardRef, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { NgControl, FormsModule } from '@angular/forms';
|
|
4
4
|
import { AbstractTuiControl, tuiPure, TUI_FOCUSABLE_ITEM_ACCESSOR, TuiLetModule } from '@taiga-ui/cdk';
|
|
5
|
-
import { TuiTextfieldSizeDirective, TUI_TEXTFIELD_SIZE, TuiHintControllerDirective, TUI_HINT_WATCHED_CONTROLLER, TUI_MODE, TuiPrimitiveTextfieldComponent, HINT_CONTROLLER_PROVIDER, MODE_PROVIDER, TuiSvgModule, TuiHintModule, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule } from '@taiga-ui/core';
|
|
5
|
+
import { TuiTextfieldSizeDirective, TUI_TEXTFIELD_SIZE, TuiHintControllerDirective, TUI_HINT_WATCHED_CONTROLLER, TUI_MODE, TuiPrimitiveTextfieldComponent, HINT_CONTROLLER_PROVIDER, MODE_PROVIDER, TuiAbstractTextfieldHost, TUI_TEXTFIELD_HOST, TuiSvgModule, TuiHintModule, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule, TuiTextfieldComponent } from '@taiga-ui/core';
|
|
6
6
|
import { TUI_PASSWORD_TEXTS } from '@taiga-ui/kit/tokens';
|
|
7
7
|
import { combineLatest, Observable } from 'rxjs';
|
|
8
8
|
import { startWith, map } from 'rxjs/operators';
|
|
@@ -22,6 +22,10 @@ const TUI_INPUT_PASSWORD_DEFAULT_OPTIONS = {
|
|
|
22
22
|
const TUI_INPUT_PASSWORD_OPTIONS = new InjectionToken('Default parameters for input password component', {
|
|
23
23
|
factory: () => TUI_INPUT_PASSWORD_DEFAULT_OPTIONS,
|
|
24
24
|
});
|
|
25
|
+
const tuiInputPasswordOptionsProvider = (options) => ({
|
|
26
|
+
provide: TUI_INPUT_PASSWORD_OPTIONS,
|
|
27
|
+
useValue: Object.assign(Object.assign({}, TUI_INPUT_PASSWORD_DEFAULT_OPTIONS), options),
|
|
28
|
+
});
|
|
25
29
|
|
|
26
30
|
var TuiInputPasswordComponent_1;
|
|
27
31
|
// @dynamic
|
|
@@ -54,10 +58,7 @@ let TuiInputPasswordComponent = TuiInputPasswordComponent_1 = class TuiInputPass
|
|
|
54
58
|
return this.getContext(this.textfieldSize.size);
|
|
55
59
|
}
|
|
56
60
|
get inputType() {
|
|
57
|
-
return this.isPasswordHidden || !this.
|
|
58
|
-
}
|
|
59
|
-
get hasEyeIcon() {
|
|
60
|
-
return !(this.disabled || this.readOnly);
|
|
61
|
+
return this.isPasswordHidden || !this.interactive ? 'password' : 'text';
|
|
61
62
|
}
|
|
62
63
|
onValueChange(textValue) {
|
|
63
64
|
this.updateValue(textValue);
|
|
@@ -99,13 +100,17 @@ __decorate([
|
|
|
99
100
|
TuiInputPasswordComponent = TuiInputPasswordComponent_1 = __decorate([
|
|
100
101
|
Component({
|
|
101
102
|
selector: 'tui-input-password',
|
|
102
|
-
template: "<tui-primitive-textfield\n class=\"textfield\"\n [pseudoFocused]=\"pseudoFocused\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [invalid]=\"computedInvalid\"\n [focusable]=\"focusable\"\n [nativeId]=\"nativeId\"\n [tuiTextfieldType]=\"inputType\"\n [disabled]=\"
|
|
103
|
+
template: "<tui-primitive-textfield\n class=\"textfield\"\n [pseudoFocused]=\"pseudoFocused\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [invalid]=\"computedInvalid\"\n [focusable]=\"focusable\"\n [nativeId]=\"nativeId\"\n [tuiTextfieldType]=\"inputType\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [iconContent]=\"interactive ? iconContent : null\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n (pressedChange)=\"onPressed($event)\"\n>\n <ng-content></ng-content>\n <ng-content select=\"input\" ngProjectAs=\"input\"></ng-content>\n</tui-primitive-textfield>\n\n<ng-template #iconContent=\"polymorpheus\" polymorpheus>\n <span\n *tuiLet=\"passwordTexts$ | async as texts\"\n polymorpheus-outlet\n [content]=\"icon\"\n [context]=\"context\"\n >\n <ng-template let-icon>\n <tui-svg\n automation-id=\"tui-password__icon\"\n tuiHintId=\"not_required\"\n class=\"icon\"\n [tuiHint]=\"texts[0] && texts[1] && hintContent\"\n [tuiHintDirection]=\"hintController.direction\"\n [tuiHintMode]=\"computedMode$ | async\"\n [src]=\"icon\"\n (click)=\"togglePasswordVisibility()\"\n ></tui-svg>\n </ng-template>\n\n <ng-template #hintContent=\"polymorpheus\" polymorpheus>\n {{ isPasswordHidden ? texts[0] : texts[1] }}\n </ng-template>\n </span>\n</ng-template>\n",
|
|
103
104
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
104
105
|
providers: [
|
|
105
106
|
{
|
|
106
107
|
provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
|
|
107
108
|
useExisting: forwardRef(() => TuiInputPasswordComponent_1),
|
|
108
109
|
},
|
|
110
|
+
{
|
|
111
|
+
provide: AbstractTuiControl,
|
|
112
|
+
useExisting: forwardRef(() => TuiInputPasswordComponent_1),
|
|
113
|
+
},
|
|
109
114
|
HINT_CONTROLLER_PROVIDER,
|
|
110
115
|
MODE_PROVIDER,
|
|
111
116
|
],
|
|
@@ -122,6 +127,32 @@ TuiInputPasswordComponent = TuiInputPasswordComponent_1 = __decorate([
|
|
|
122
127
|
__param(6, Inject(TUI_MODE))
|
|
123
128
|
], TuiInputPasswordComponent);
|
|
124
129
|
|
|
130
|
+
var TuiInputPasswordDirective_1;
|
|
131
|
+
let TuiInputPasswordDirective = TuiInputPasswordDirective_1 = class TuiInputPasswordDirective extends TuiAbstractTextfieldHost {
|
|
132
|
+
onValueChange(value) {
|
|
133
|
+
this.host.onValueChange(value);
|
|
134
|
+
}
|
|
135
|
+
process(input) {
|
|
136
|
+
this.input = input;
|
|
137
|
+
}
|
|
138
|
+
ngDoCheck() {
|
|
139
|
+
if (this.input) {
|
|
140
|
+
this.input.type = this.host.isPasswordHidden ? 'password' : 'text';
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
TuiInputPasswordDirective = TuiInputPasswordDirective_1 = __decorate([
|
|
145
|
+
Directive({
|
|
146
|
+
selector: 'tui-input-password',
|
|
147
|
+
providers: [
|
|
148
|
+
{
|
|
149
|
+
provide: TUI_TEXTFIELD_HOST,
|
|
150
|
+
useExisting: forwardRef(() => TuiInputPasswordDirective_1),
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
})
|
|
154
|
+
], TuiInputPasswordDirective);
|
|
155
|
+
|
|
125
156
|
let TuiInputPasswordModule = class TuiInputPasswordModule {
|
|
126
157
|
};
|
|
127
158
|
TuiInputPasswordModule = __decorate([
|
|
@@ -136,8 +167,12 @@ TuiInputPasswordModule = __decorate([
|
|
|
136
167
|
TuiPrimitiveTextfieldModule,
|
|
137
168
|
TuiTextfieldControllerModule,
|
|
138
169
|
],
|
|
139
|
-
declarations: [TuiInputPasswordComponent],
|
|
140
|
-
exports: [
|
|
170
|
+
declarations: [TuiInputPasswordComponent, TuiInputPasswordDirective],
|
|
171
|
+
exports: [
|
|
172
|
+
TuiInputPasswordComponent,
|
|
173
|
+
TuiInputPasswordDirective,
|
|
174
|
+
TuiTextfieldComponent,
|
|
175
|
+
],
|
|
141
176
|
})
|
|
142
177
|
], TuiInputPasswordModule);
|
|
143
178
|
|
|
@@ -145,5 +180,5 @@ TuiInputPasswordModule = __decorate([
|
|
|
145
180
|
* Generated bundle index. Do not edit.
|
|
146
181
|
*/
|
|
147
182
|
|
|
148
|
-
export { PASSWORD_ICON_HIDE, PASSWORD_ICON_SHOW, TUI_INPUT_PASSWORD_DEFAULT_OPTIONS, TUI_INPUT_PASSWORD_OPTIONS, TuiInputPasswordComponent, TuiInputPasswordModule };
|
|
183
|
+
export { PASSWORD_ICON_HIDE, PASSWORD_ICON_SHOW, TUI_INPUT_PASSWORD_DEFAULT_OPTIONS, TUI_INPUT_PASSWORD_OPTIONS, TuiInputPasswordComponent, TuiInputPasswordDirective, TuiInputPasswordModule, tuiInputPasswordOptionsProvider };
|
|
149
184
|
//# sourceMappingURL=taiga-ui-kit-components-input-password.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-password.js","sources":["ng://@taiga-ui/kit/components/input-password/input-password-options.ts","ng://@taiga-ui/kit/components/input-password/input-password.component.ts","ng://@taiga-ui/kit/components/input-password/input-password.module.ts","ng://@taiga-ui/kit/components/input-password/taiga-ui-kit-components-input-password.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\nimport {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {TuiSizeL, TuiSizeS} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport interface InputPasswordOptions {\n readonly icons: Readonly<{\n hide: PolymorpheusContent<TuiContextWithImplicit<TuiSizeS | TuiSizeL>>;\n show: PolymorpheusContent<TuiContextWithImplicit<TuiSizeS | TuiSizeL>>;\n }>;\n}\n\n// TODO: remove in ivy compilation\nexport const PASSWORD_ICON_HIDE = ({$implicit}: any) =>\n $implicit === 's' ? 'tuiIconEyeClosed' : 'tuiIconHideLarge';\nexport const PASSWORD_ICON_SHOW = ({$implicit}: any) =>\n $implicit === 's' ? 'tuiIconEyeOpen' : 'tuiIconShowLarge';\n\n/** Default values for the input password options. */\nexport const TUI_INPUT_PASSWORD_DEFAULT_OPTIONS: InputPasswordOptions = {\n icons: {\n hide: PASSWORD_ICON_HIDE,\n show: PASSWORD_ICON_SHOW,\n },\n};\n\nexport const TUI_INPUT_PASSWORD_OPTIONS = new InjectionToken<InputPasswordOptions>(\n 'Default parameters for input password component',\n {\n factory: () => TUI_INPUT_PASSWORD_DEFAULT_OPTIONS,\n },\n);\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiContextWithImplicit,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {\n HINT_CONTROLLER_PROVIDER,\n MODE_PROVIDER,\n TUI_HINT_WATCHED_CONTROLLER,\n TUI_MODE,\n TUI_TEXTFIELD_SIZE,\n TuiBrightness,\n TuiHintControllerDirective,\n TuiHintModeT,\n TuiPrimitiveTextfieldComponent,\n TuiSizeL,\n TuiSizeS,\n TuiTextfieldSizeDirective,\n} from '@taiga-ui/core';\nimport {TUI_PASSWORD_TEXTS} from '@taiga-ui/kit/tokens';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {combineLatest, Observable} from 'rxjs';\nimport {map, startWith} from 'rxjs/operators';\n\nimport {InputPasswordOptions, TUI_INPUT_PASSWORD_OPTIONS} from './input-password-options';\n\n// @dynamic\n@Component({\n selector: 'tui-input-password',\n templateUrl: './input-password.template.html',\n styleUrls: ['./input-password.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputPasswordComponent),\n },\n HINT_CONTROLLER_PROVIDER,\n MODE_PROVIDER,\n ],\n})\nexport class TuiInputPasswordComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly textfield?: TuiPrimitiveTextfieldComponent;\n\n isPasswordHidden = true;\n\n readonly computedMode$: Observable<TuiBrightness | TuiHintModeT | null> =\n combineLatest([\n this.mode$,\n this.hintController.change$.pipe(\n startWith(null),\n map(() => this.hintController.mode),\n ),\n ]).pipe(\n map(([mode, controller]) => controller || mode),\n startWith(null),\n );\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_SIZE)\n private readonly textfieldSize: TuiTextfieldSizeDirective,\n @Inject(TUI_PASSWORD_TEXTS)\n readonly passwordTexts$: Observable<[string, string]>,\n @Inject(TUI_INPUT_PASSWORD_OPTIONS)\n readonly options: InputPasswordOptions,\n @Inject(TUI_HINT_WATCHED_CONTROLLER)\n readonly hintController: TuiHintControllerDirective,\n @Inject(TUI_MODE)\n private readonly mode$: Observable<TuiBrightness | null>,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.computedDisabled || !this.textfield\n ? null\n : this.textfield.nativeFocusableElement;\n }\n\n get focused(): boolean {\n return !!this.textfield && this.textfield.focused;\n }\n\n get icon(): PolymorpheusContent<TuiContextWithImplicit<TuiSizeS | TuiSizeL>> {\n return this.isPasswordHidden ? this.options.icons.hide : this.options.icons.show;\n }\n\n get context(): TuiContextWithImplicit<TuiSizeS | TuiSizeL> {\n return this.getContext(this.textfieldSize.size);\n }\n\n get inputType(): string {\n return this.isPasswordHidden || !this.hasEyeIcon ? 'password' : 'text';\n }\n\n get hasEyeIcon(): boolean {\n return !(this.disabled || this.readOnly);\n }\n\n onValueChange(textValue: string) {\n this.updateValue(textValue);\n }\n\n onFocused(focused: boolean) {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onPressed(pressed: boolean) {\n this.updatePressed(pressed);\n }\n\n togglePasswordVisibility() {\n this.isPasswordHidden = !this.isPasswordHidden;\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n\n @tuiPure\n private getContext(\n $implicit: TuiSizeS | TuiSizeL,\n ): TuiContextWithImplicit<TuiSizeS | TuiSizeL> {\n return {$implicit};\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {TuiLetModule} from '@taiga-ui/cdk';\nimport {\n TuiHintModule,\n TuiPrimitiveTextfieldModule,\n TuiSvgModule,\n TuiTextfieldControllerModule,\n} from '@taiga-ui/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiInputPasswordComponent} from './input-password.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n PolymorpheusModule,\n TuiLetModule,\n TuiSvgModule,\n TuiHintModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n ],\n declarations: [TuiInputPasswordComponent],\n exports: [TuiInputPasswordComponent],\n})\nexport class TuiInputPasswordModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAYA;MACa,kBAAkB,GAAG,CAAC,EAAC,SAAS,EAAM,KAC/C,SAAS,KAAK,GAAG,GAAG,kBAAkB,GAAG,mBAAmB;MACnD,kBAAkB,GAAG,CAAC,EAAC,SAAS,EAAM,KAC/C,SAAS,KAAK,GAAG,GAAG,gBAAgB,GAAG,mBAAmB;AAE9D;MACa,kCAAkC,GAAyB;IACpE,KAAK,EAAE;QACH,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,kBAAkB;KAC3B;EACH;MAEW,0BAA0B,GAAG,IAAI,cAAc,CACxD,iDAAiD,EACjD;IACI,OAAO,EAAE,MAAM,kCAAkC;CACpD;;;ACUL;IAea,yBAAyB,iCAAtC,MAAa,yBACT,SAAQ,kBAA0B;IAoBlC,YAII,OAAyB,EACE,iBAAoC,EAE9C,aAAwC,EAEhD,cAA4C,EAE5C,OAA6B,EAE7B,cAA0C,EAElC,KAAuC;QAExD,KAAK,CAAC,OAAO,EAAE,iBAAi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O,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,IAAI,EAAE,CAAA;IACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;IAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,MAAM,CAAC,kBAAkB,CAAC,CAAA;IAE1B,WAAA,MAAM,CAAC,kBAAkB,CAAC,CAAA;IAE1B,WAAA,MAAM,CAAC,0BAA0B,CAAC,CAAA;IAElC,WAAA,MAAM,CAAC,2BAA2B,CAAC,CAAA;IAEnC,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;GAnCZ,yBAAyB,CAiGrC;;IC5HY,sBAAsB,GAAnC,MAAa,sBAAsB;EAAG;AAAzB,sBAAsB;IAdlC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,WAAW;YACX,kBAAkB;YAClB,YAAY;YACZ,YAAY;YACZ,aAAa;YACb,2BAA2B;YAC3B,4BAA4B;SAC/B;QACD,YAAY,EAAE,CAAC,yBAAyB,CAAC;QACzC,OAAO,EAAE,CAAC,yBAAyB,CAAC;KACvC,CAAC;GACW,sBAAsB,CAAG;;AC5BtC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-password.js","sources":["ng://@taiga-ui/kit/components/input-password/input-password-options.ts","ng://@taiga-ui/kit/components/input-password/input-password.component.ts","ng://@taiga-ui/kit/components/input-password/input-password.directive.ts","ng://@taiga-ui/kit/components/input-password/input-password.module.ts","ng://@taiga-ui/kit/components/input-password/taiga-ui-kit-components-input-password.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {TuiSizeL, TuiSizeS} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport interface TuiInputPasswordOptions {\n readonly icons: Readonly<{\n hide: PolymorpheusContent<TuiContextWithImplicit<TuiSizeS | TuiSizeL>>;\n show: PolymorpheusContent<TuiContextWithImplicit<TuiSizeS | TuiSizeL>>;\n }>;\n}\n\n/**\n * @deprecated: use TuiInputPasswordOptions instead\n * todo: remove in 3.0\n */\nexport type InputPasswordOptions = TuiInputPasswordOptions;\n\n// TODO: remove in ivy compilation\nexport const PASSWORD_ICON_HIDE = ({$implicit}: any) =>\n $implicit === 's' ? 'tuiIconEyeClosed' : 'tuiIconHideLarge';\nexport const PASSWORD_ICON_SHOW = ({$implicit}: any) =>\n $implicit === 's' ? 'tuiIconEyeOpen' : 'tuiIconShowLarge';\n\n/** Default values for the input password options. */\nexport const TUI_INPUT_PASSWORD_DEFAULT_OPTIONS: TuiInputPasswordOptions = {\n icons: {\n hide: PASSWORD_ICON_HIDE,\n show: PASSWORD_ICON_SHOW,\n },\n};\n\nexport const TUI_INPUT_PASSWORD_OPTIONS = new InjectionToken<TuiInputPasswordOptions>(\n 'Default parameters for input password component',\n {\n factory: () => TUI_INPUT_PASSWORD_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiInputPasswordOptionsProvider: (\n options: Partial<TuiInputPasswordOptions>,\n) => ValueProvider = (options: Partial<TuiInputPasswordOptions>) => ({\n provide: TUI_INPUT_PASSWORD_OPTIONS,\n useValue: {...TUI_INPUT_PASSWORD_DEFAULT_OPTIONS, ...options},\n});\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiContextWithImplicit,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {\n HINT_CONTROLLER_PROVIDER,\n MODE_PROVIDER,\n TUI_HINT_WATCHED_CONTROLLER,\n TUI_MODE,\n TUI_TEXTFIELD_SIZE,\n TuiBrightness,\n TuiHintControllerDirective,\n TuiHintModeT,\n TuiPrimitiveTextfieldComponent,\n TuiSizeL,\n TuiSizeS,\n TuiTextfieldSizeDirective,\n} from '@taiga-ui/core';\nimport {TUI_PASSWORD_TEXTS} from '@taiga-ui/kit/tokens';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {combineLatest, Observable} from 'rxjs';\nimport {map, startWith} from 'rxjs/operators';\n\nimport {\n TUI_INPUT_PASSWORD_OPTIONS,\n TuiInputPasswordOptions,\n} from './input-password-options';\n\n// @dynamic\n@Component({\n selector: 'tui-input-password',\n templateUrl: './input-password.template.html',\n styleUrls: ['./input-password.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputPasswordComponent),\n },\n {\n provide: AbstractTuiControl,\n useExisting: forwardRef(() => TuiInputPasswordComponent),\n },\n HINT_CONTROLLER_PROVIDER,\n MODE_PROVIDER,\n ],\n})\nexport class TuiInputPasswordComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly textfield?: TuiPrimitiveTextfieldComponent;\n\n isPasswordHidden = true;\n\n readonly computedMode$: Observable<TuiBrightness | TuiHintModeT | null> =\n combineLatest([\n this.mode$,\n this.hintController.change$.pipe(\n startWith(null),\n map(() => this.hintController.mode),\n ),\n ]).pipe(\n map(([mode, controller]) => controller || mode),\n startWith(null),\n );\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_SIZE)\n private readonly textfieldSize: TuiTextfieldSizeDirective,\n @Inject(TUI_PASSWORD_TEXTS)\n readonly passwordTexts$: Observable<[string, string]>,\n @Inject(TUI_INPUT_PASSWORD_OPTIONS)\n readonly options: TuiInputPasswordOptions,\n @Inject(TUI_HINT_WATCHED_CONTROLLER)\n readonly hintController: TuiHintControllerDirective,\n @Inject(TUI_MODE)\n private readonly mode$: Observable<TuiBrightness | null>,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.computedDisabled || !this.textfield\n ? null\n : this.textfield.nativeFocusableElement;\n }\n\n get focused(): boolean {\n return !!this.textfield && this.textfield.focused;\n }\n\n get icon(): PolymorpheusContent<TuiContextWithImplicit<TuiSizeS | TuiSizeL>> {\n return this.isPasswordHidden ? this.options.icons.hide : this.options.icons.show;\n }\n\n get context(): TuiContextWithImplicit<TuiSizeS | TuiSizeL> {\n return this.getContext(this.textfieldSize.size);\n }\n\n get inputType(): string {\n return this.isPasswordHidden || !this.interactive ? 'password' : 'text';\n }\n\n onValueChange(textValue: string) {\n this.updateValue(textValue);\n }\n\n onFocused(focused: boolean) {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onPressed(pressed: boolean) {\n this.updatePressed(pressed);\n }\n\n togglePasswordVisibility() {\n this.isPasswordHidden = !this.isPasswordHidden;\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n\n @tuiPure\n private getContext(\n $implicit: TuiSizeS | TuiSizeL,\n ): TuiContextWithImplicit<TuiSizeS | TuiSizeL> {\n return {$implicit};\n }\n}\n","import {Directive, forwardRef} from '@angular/core';\nimport {TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost} from '@taiga-ui/core';\n\nimport {TuiInputPasswordComponent} from './input-password.component';\n\n@Directive({\n selector: 'tui-input-password',\n providers: [\n {\n provide: TUI_TEXTFIELD_HOST,\n useExisting: forwardRef(() => TuiInputPasswordDirective),\n },\n ],\n})\nexport class TuiInputPasswordDirective extends TuiAbstractTextfieldHost<TuiInputPasswordComponent> {\n input?: HTMLInputElement;\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 this.input.type = this.host.isPasswordHidden ? 'password' : 'text';\n }\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {TuiLetModule} from '@taiga-ui/cdk';\nimport {\n TuiHintModule,\n TuiPrimitiveTextfieldModule,\n TuiSvgModule,\n TuiTextfieldComponent,\n TuiTextfieldControllerModule,\n} from '@taiga-ui/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiInputPasswordComponent} from './input-password.component';\nimport {TuiInputPasswordDirective} from './input-password.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n PolymorpheusModule,\n TuiLetModule,\n TuiSvgModule,\n TuiHintModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n ],\n declarations: [TuiInputPasswordComponent, TuiInputPasswordDirective],\n exports: [\n TuiInputPasswordComponent,\n TuiInputPasswordDirective,\n TuiTextfieldComponent,\n ],\n})\nexport class TuiInputPasswordModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAkBA;MACa,kBAAkB,GAAG,CAAC,EAAC,SAAS,EAAM,KAC/C,SAAS,KAAK,GAAG,GAAG,kBAAkB,GAAG,mBAAmB;MACnD,kBAAkB,GAAG,CAAC,EAAC,SAAS,EAAM,KAC/C,SAAS,KAAK,GAAG,GAAG,gBAAgB,GAAG,mBAAmB;AAE9D;MACa,kCAAkC,GAA4B;IACvE,KAAK,EAAE;QACH,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,kBAAkB;KAC3B;EACH;MAEW,0BAA0B,GAAG,IAAI,cAAc,CACxD,iDAAiD,EACjD;IACI,OAAO,EAAE,MAAM,kCAAkC;CACpD,EACH;MAEW,+BAA+B,GAEvB,CAAC,OAAyC,MAAM;IACjE,OAAO,EAAE,0BAA0B;IACnC,QAAQ,kCAAM,kCAAkC,GAAK,OAAO,CAAC;CAChE;;;ACDD;IAmBa,yBAAyB,iCA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,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,WAAW;YACX,kBAAkB;YAClB,YAAY;YACZ,YAAY;YACZ,aAAa;YACb,2BAA2B;YAC3B,4BAA4B;SAC/B;QACD,YAAY,EAAE,CAAC,yBAAyB,EAAE,yBAAyB,CAAC;QACpE,OAAO,EAAE;YACL,yBAAyB;YACzB,yBAAyB;YACzB,qBAAqB;SACxB;KACJ,CAAC;GACW,sBAAsB,CAAG;;AClCtC;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TuiCountryIsoCode as TuiCountryIsoCode$1 } from '@taiga-ui/i18n';
|
|
2
2
|
import { __decorate, __param } from 'tslib';
|
|
3
|
-
import { EventEmitter, Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Output, HostListener, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
3
|
+
import { InjectionToken, EventEmitter, Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Output, HostListener, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
4
4
|
import { NgControl, FormsModule } from '@angular/forms';
|
|
5
|
-
import { AbstractTuiControl, setNativeFocused,
|
|
5
|
+
import { getClipboardDataText, AbstractTuiControl, setNativeFocused, tuiDefaultProp, tuiPure, TUI_FOCUSABLE_ITEM_ACCESSOR, TuiLetModule, TuiMapperPipeModule, TuiActiveZoneModule } from '@taiga-ui/cdk';
|
|
6
6
|
import { TUI_NON_DIGITS_REGEXP, TUI_ICONS_PATH, TuiPrimitiveTextfieldComponent, TuiSvgModule, TuiGroupModule, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule, TuiHintControllerModule, TuiHostedDropdownModule, TuiDataListModule } from '@taiga-ui/core';
|
|
7
7
|
import { TUI_ARROW, TuiArrowModule } from '@taiga-ui/kit/components/arrow';
|
|
8
8
|
import { TuiInputPhoneComponent, TuiInputPhoneModule } from '@taiga-ui/kit/components/input-phone';
|
|
@@ -14,10 +14,10 @@ import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @deprecated Dont use it (will be deleted soon).
|
|
17
|
-
* - Use
|
|
17
|
+
* - Use token `TUI_COUNTRIES_MASKS` to get phone mask by country iso code
|
|
18
18
|
* - Use token `TUI_COUNTRIES` to get localized country name by its iso code
|
|
19
19
|
* @example
|
|
20
|
-
* import {TUI_COUNTRIES,
|
|
20
|
+
* import {TUI_COUNTRIES, TUI_COUNTRIES_MASKS} from '@taiga-ui/kit';
|
|
21
21
|
*
|
|
22
22
|
* @todo TODO: remove it in 3.0
|
|
23
23
|
*/
|
|
@@ -38,7 +38,7 @@ const COUNTRIES = {
|
|
|
38
38
|
[TuiCountryIsoCode$1.AU]: { mask: '+61#-####-####', name: 'Австралия' },
|
|
39
39
|
[TuiCountryIsoCode$1.AW]: { mask: '+297###-####', name: 'Аруба' },
|
|
40
40
|
[TuiCountryIsoCode$1.AZ]: { mask: '+994##-###-##-##', name: 'Азербайджан' },
|
|
41
|
-
[TuiCountryIsoCode$1.BA]: { mask: '+387
|
|
41
|
+
[TuiCountryIsoCode$1.BA]: { mask: '+387 ###-####-#', name: 'Босния и Герцеговина' },
|
|
42
42
|
[TuiCountryIsoCode$1.BB]: { mask: '+1(246) ###-####', name: 'Барбадос' },
|
|
43
43
|
[TuiCountryIsoCode$1.BD]: { mask: '+880##-###-###', name: 'Бангладеш' },
|
|
44
44
|
[TuiCountryIsoCode$1.BE]: { mask: '+32(###) ###-###', name: 'Бельгия' },
|
|
@@ -250,12 +250,21 @@ const COUNTRIES = {
|
|
|
250
250
|
[TuiCountryIsoCode$1.ZM]: { mask: '+260##-###-####', name: 'Замбия' },
|
|
251
251
|
[TuiCountryIsoCode$1.ZW]: { mask: '+263#-######', name: 'Зимбабве' },
|
|
252
252
|
};
|
|
253
|
-
|
|
253
|
+
/**
|
|
254
|
+
* @deprecated will be deleted soon
|
|
255
|
+
* TODO: remove in 3.0 (in ivy compilation)
|
|
256
|
+
*/
|
|
254
257
|
function countriesMasksReducer(acc, [countryIsoCode, { mask }]) {
|
|
255
258
|
acc[countryIsoCode] = mask;
|
|
256
259
|
return acc;
|
|
257
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* @deprecated will be deleted soon
|
|
263
|
+
* Use token `TUI_COUNTRIES_MASKS`
|
|
264
|
+
* TODO: remove in 3.0
|
|
265
|
+
*/
|
|
258
266
|
const COUNTRIES_MASKS = Object.entries(COUNTRIES).reduce(countriesMasksReducer, {});
|
|
267
|
+
const MASK_AFTER_CODE_REGEXP = /\([#]+\)|[#\- ]/g;
|
|
259
268
|
|
|
260
269
|
/** @deprecated use `import {TuiCountryIsoCode} from '@taiga-ui/i18n'` */
|
|
261
270
|
var TuiCountryIsoCode;
|
|
@@ -466,22 +475,39 @@ var TuiCountryIsoCode;
|
|
|
466
475
|
TuiCountryIsoCode["CA"] = "CA";
|
|
467
476
|
})(TuiCountryIsoCode || (TuiCountryIsoCode = {}));
|
|
468
477
|
|
|
478
|
+
const TUI_COUNTRIES_MASKS = new InjectionToken('Countries masks', {
|
|
479
|
+
factory: () => COUNTRIES_MASKS,
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
function extractValueFromEvent(event) {
|
|
483
|
+
var _a;
|
|
484
|
+
// TODO: iframe warning
|
|
485
|
+
return event instanceof DragEvent
|
|
486
|
+
? ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData('text/plain')) || ''
|
|
487
|
+
: getClipboardDataText(event);
|
|
488
|
+
}
|
|
489
|
+
|
|
469
490
|
var TuiInputPhoneInternationalComponent_1;
|
|
470
|
-
const MASK_AFTER_CODE_REGEXP = /\([#]+\)|[#\- ]/g;
|
|
471
491
|
// @dynamic
|
|
472
492
|
let TuiInputPhoneInternationalComponent = TuiInputPhoneInternationalComponent_1 = class TuiInputPhoneInternationalComponent extends AbstractTuiControl {
|
|
473
|
-
constructor(control, changeDetectorRef, iconsPath, countriesNames
|
|
493
|
+
constructor(control, changeDetectorRef, iconsPath, countriesNames$, countriesMasks) {
|
|
474
494
|
super(control, changeDetectorRef);
|
|
475
495
|
this.countriesNames$ = countriesNames$;
|
|
496
|
+
this.countriesMasks = countriesMasks;
|
|
476
497
|
this.staticPath = null;
|
|
477
|
-
this.countryIsoCode = TuiCountryIsoCode$1.RU;
|
|
478
498
|
this.countries = [];
|
|
479
499
|
this.countryIsoCodeChange = new EventEmitter();
|
|
500
|
+
this.countryIsoCode = TuiCountryIsoCode$1.RU;
|
|
480
501
|
this.open = false;
|
|
481
502
|
this.arrow = TUI_ARROW;
|
|
482
503
|
this.isoToCountryCodeMapper = item => this.isoToCountryCode(item);
|
|
483
504
|
this.staticPath = iconsPath('tuiIcon').replace('tuiIcon.svg#tuiIcon', '');
|
|
484
505
|
}
|
|
506
|
+
set isoCode(code) {
|
|
507
|
+
var _a;
|
|
508
|
+
(_a = this.inputPhoneComponent) === null || _a === void 0 ? void 0 : _a.writeValue(this.value);
|
|
509
|
+
this.countryIsoCode = code;
|
|
510
|
+
}
|
|
485
511
|
get nativeFocusableElement() {
|
|
486
512
|
return this.inputPhoneComponent && !this.computedDisabled
|
|
487
513
|
? this.inputPhoneComponent.nativeFocusableElement
|
|
@@ -496,14 +522,14 @@ let TuiInputPhoneInternationalComponent = TuiInputPhoneInternationalComponent_1
|
|
|
496
522
|
}
|
|
497
523
|
get phoneMaskAfterCountryCode() {
|
|
498
524
|
const countryCode = this.isoToCountryCode(this.countryIsoCode);
|
|
499
|
-
return this.calculateMaskAfterCountryCode(
|
|
525
|
+
return this.calculateMaskAfterCountryCode(this.countriesMasks[this.countryIsoCode], countryCode);
|
|
500
526
|
}
|
|
501
527
|
get countryFlagPath() {
|
|
502
528
|
return this.getFlagPath(this.countryIsoCode);
|
|
503
529
|
}
|
|
504
530
|
onPaste(event) {
|
|
505
|
-
const value =
|
|
506
|
-
const countryIsoCode = this.countries.find(countryIsoCode => value.startsWith(this.isoToCountryCode(countryIsoCode)));
|
|
531
|
+
const value = extractValueFromEvent(event).replace('+', '');
|
|
532
|
+
const countryIsoCode = this.countries.find(countryIsoCode => value.startsWith(this.isoToCountryCode(countryIsoCode).replace('+', '')));
|
|
507
533
|
if (countryIsoCode) {
|
|
508
534
|
this.updateCountryIsoCode(countryIsoCode);
|
|
509
535
|
this.updateValue('+' + value.replace(TUI_NON_DIGITS_REGEXP, ''));
|
|
@@ -530,7 +556,7 @@ let TuiInputPhoneInternationalComponent = TuiInputPhoneInternationalComponent_1
|
|
|
530
556
|
this.close();
|
|
531
557
|
}
|
|
532
558
|
isoToCountryCode(isoCode) {
|
|
533
|
-
return
|
|
559
|
+
return this.countriesMasks[isoCode].replace(MASK_AFTER_CODE_REGEXP, '');
|
|
534
560
|
}
|
|
535
561
|
onModelChange(value) {
|
|
536
562
|
this.updateValue(value);
|
|
@@ -548,14 +574,7 @@ let TuiInputPhoneInternationalComponent = TuiInputPhoneInternationalComponent_1
|
|
|
548
574
|
this.open = false;
|
|
549
575
|
}
|
|
550
576
|
getMaxAllowedLength(isoCode) {
|
|
551
|
-
return
|
|
552
|
-
}
|
|
553
|
-
extractValue(event) {
|
|
554
|
-
var _a;
|
|
555
|
-
// TODO: iframe warning
|
|
556
|
-
return event instanceof DragEvent
|
|
557
|
-
? ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData('text/plain')) || ''
|
|
558
|
-
: getClipboardDataText(event);
|
|
577
|
+
return this.countriesMasks[isoCode].replace(/[()\- ]/g, '').length;
|
|
559
578
|
}
|
|
560
579
|
updateCountryIsoCode(code) {
|
|
561
580
|
this.countryIsoCode = code;
|
|
@@ -566,7 +585,8 @@ TuiInputPhoneInternationalComponent.ctorParameters = () => [
|
|
|
566
585
|
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
|
|
567
586
|
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
568
587
|
{ type: undefined, decorators: [{ type: Inject, args: [TUI_ICONS_PATH,] }] },
|
|
569
|
-
{ type: Observable, decorators: [{ type: Inject, args: [TUI_COUNTRIES,] }] }
|
|
588
|
+
{ type: Observable, decorators: [{ type: Inject, args: [TUI_COUNTRIES,] }] },
|
|
589
|
+
{ type: undefined, decorators: [{ type: Inject, args: [TUI_COUNTRIES_MASKS,] }] }
|
|
570
590
|
];
|
|
571
591
|
__decorate([
|
|
572
592
|
ViewChild(TuiInputPhoneComponent)
|
|
@@ -575,9 +595,9 @@ __decorate([
|
|
|
575
595
|
ViewChild(TuiPrimitiveTextfieldComponent)
|
|
576
596
|
], TuiInputPhoneInternationalComponent.prototype, "primitiveTextfield", void 0);
|
|
577
597
|
__decorate([
|
|
578
|
-
Input(),
|
|
598
|
+
Input('countryIsoCode'),
|
|
579
599
|
tuiDefaultProp()
|
|
580
|
-
], TuiInputPhoneInternationalComponent.prototype, "
|
|
600
|
+
], TuiInputPhoneInternationalComponent.prototype, "isoCode", null);
|
|
581
601
|
__decorate([
|
|
582
602
|
Input()
|
|
583
603
|
], TuiInputPhoneInternationalComponent.prototype, "countries", void 0);
|
|
@@ -610,7 +630,8 @@ TuiInputPhoneInternationalComponent = TuiInputPhoneInternationalComponent_1 = __
|
|
|
610
630
|
__param(0, Inject(NgControl)),
|
|
611
631
|
__param(1, Inject(ChangeDetectorRef)),
|
|
612
632
|
__param(2, Inject(TUI_ICONS_PATH)),
|
|
613
|
-
__param(3, Inject(TUI_COUNTRIES))
|
|
633
|
+
__param(3, Inject(TUI_COUNTRIES)),
|
|
634
|
+
__param(4, Inject(TUI_COUNTRIES_MASKS))
|
|
614
635
|
], TuiInputPhoneInternationalComponent);
|
|
615
636
|
|
|
616
637
|
let TuiInputPhoneInternationalModule = class TuiInputPhoneInternationalModule {
|
|
@@ -643,5 +664,5 @@ TuiInputPhoneInternationalModule = __decorate([
|
|
|
643
664
|
* Generated bundle index. Do not edit.
|
|
644
665
|
*/
|
|
645
666
|
|
|
646
|
-
export { COUNTRIES, COUNTRIES_MASKS, TuiCountryIsoCode, TuiInputPhoneInternationalComponent, TuiInputPhoneInternationalModule, countriesMasksReducer };
|
|
667
|
+
export { COUNTRIES, COUNTRIES_MASKS, MASK_AFTER_CODE_REGEXP, TUI_COUNTRIES_MASKS, TuiCountryIsoCode, TuiInputPhoneInternationalComponent, TuiInputPhoneInternationalModule, countriesMasksReducer, extractValueFromEvent };
|
|
647
668
|
//# sourceMappingURL=taiga-ui-kit-components-input-phone-international.js.map
|