@taiga-ui/kit 2.51.1 → 2.54.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 +1 -0
- package/bundles/taiga-ui-kit-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-abstract.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-accordion.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-breadcrumbs.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-breadcrumbs.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-breadcrumbs.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-breadcrumbs.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-file.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-file.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-file.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-file.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-files.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-files.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-files.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-month.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-month.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.js +8 -2
- package/bundles/taiga-ui-kit-components-input-number.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-phone-international.umd.js +7 -0
- 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 +1 -0
- package/bundles/taiga-ui-kit-components-input-phone.umd.js.map +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 +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-line-clamp.umd.js +32 -4
- package/bundles/taiga-ui-kit-components-line-clamp.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-line-clamp.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-line-clamp.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select-option.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-multi-select-option.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select-option.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-multi-select-option.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.js +2 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pagination.umd.js +3 -2
- package/bundles/taiga-ui-kit-components-pagination.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pagination.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-pagination.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-pdf-viewer.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-progress.umd.js +2 -0
- package/bundles/taiga-ui-kit-components-progress.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-progress.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.js.map +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-select-option.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-select-option.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select-option.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-select-option.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.js +13 -2
- package/bundles/taiga-ui-kit-components-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tabs.umd.js +7 -5
- 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 +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 +1 -1
- 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-tree.umd.js +2 -1
- package/bundles/taiga-ui-kit-components-tree.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tree.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-tree.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-context.umd.js +2 -12
- package/bundles/taiga-ui-kit-directives-dropdown-context.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-context.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-context.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.js +1 -9
- package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-providers.umd.js +6 -0
- package/bundles/taiga-ui-kit-providers.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-providers.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-dom.umd.js +14 -0
- package/bundles/taiga-ui-kit-utils-dom.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-dom.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-utils-dom.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-files.umd.js +12 -0
- package/bundles/taiga-ui-kit-utils-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-files.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-utils-files.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-format.umd.js +4 -0
- package/bundles/taiga-ui-kit-utils-format.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-format.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-utils-format.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-mask.umd.js +6 -0
- 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-math.umd.js +2 -2
- package/bundles/taiga-ui-kit-utils-math.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-math.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-utils-math.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-miscellaneous.umd.js +10 -0
- package/bundles/taiga-ui-kit-utils-miscellaneous.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-miscellaneous.umd.min.js +1 -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/action/taiga-ui-kit-components-action.metadata.json +1 -1
- package/components/breadcrumbs/taiga-ui-kit-components-breadcrumbs.metadata.json +1 -1
- package/components/files/taiga-ui-kit-components-files.metadata.json +1 -1
- package/components/input-file/taiga-ui-kit-components-input-file.metadata.json +1 -1
- package/components/input-files/taiga-ui-kit-components-input-files.metadata.json +1 -1
- package/components/input-month/taiga-ui-kit-components-input-month.metadata.json +1 -1
- package/components/input-month-range/taiga-ui-kit-components-input-month-range.metadata.json +1 -1
- package/components/input-number/taiga-ui-kit-components-input-number.metadata.json +1 -1
- package/components/input-phone/taiga-ui-kit-components-input-phone.metadata.json +1 -1
- package/components/input-phone-international/taiga-ui-kit-components-input-phone-international.metadata.json +1 -1
- package/components/input-phone-international/utils/extract-value-from-event.d.ts +4 -0
- package/components/input-range/taiga-ui-kit-components-input-range.metadata.json +1 -1
- package/components/input-slider/taiga-ui-kit-components-input-slider.metadata.json +1 -1
- package/components/input-tag/taiga-ui-kit-components-input-tag.metadata.json +1 -1
- package/components/line-clamp/index.d.ts +1 -0
- package/components/line-clamp/line-clamp-options.d.ts +7 -0
- package/components/line-clamp/line-clamp.component.d.ts +8 -3
- package/components/line-clamp/taiga-ui-kit-components-line-clamp.metadata.json +1 -1
- package/components/multi-select/taiga-ui-kit-components-multi-select.metadata.json +1 -1
- package/components/multi-select-option/taiga-ui-kit-components-multi-select-option.metadata.json +1 -1
- package/components/pagination/taiga-ui-kit-components-pagination.metadata.json +1 -1
- package/components/pdf-viewer/taiga-ui-kit-components-pdf-viewer.metadata.json +1 -1
- package/components/progress/taiga-ui-kit-components-progress.metadata.json +1 -1
- package/components/range/taiga-ui-kit-components-range.metadata.json +1 -1
- package/components/select-option/taiga-ui-kit-components-select-option.metadata.json +1 -1
- package/components/slider/slider.component.d.ts +1 -0
- package/components/slider/taiga-ui-kit-components-slider.metadata.json +1 -1
- package/components/tabs/taiga-ui-kit-components-tabs.metadata.json +1 -1
- package/components/tag/taiga-ui-kit-components-tag.metadata.json +1 -1
- package/components/text-area/taiga-ui-kit-components-text-area.metadata.json +1 -1
- package/components/tree/taiga-ui-kit-components-tree.metadata.json +1 -1
- package/directives/dropdown-context/dropdown-context.directive.d.ts +0 -1
- package/directives/dropdown-context/taiga-ui-kit-directives-dropdown-context.metadata.json +1 -1
- package/directives/dropdown-selection/taiga-ui-kit-directives-dropdown-selection.metadata.json +1 -1
- package/esm2015/abstract/input-slider.js +2 -1
- package/esm2015/components/accordion/accordion-item/accordion-item.component.js +3 -3
- package/esm2015/components/action/action.component.js +2 -2
- package/esm2015/components/breadcrumbs/breadcrumbs-wrapper.component.js +2 -2
- package/esm2015/components/files/file/file.component.js +2 -2
- package/esm2015/components/files/files.component.js +2 -2
- package/esm2015/components/input-file/file/file.component.js +2 -2
- package/esm2015/components/input-files/input-files.component.js +2 -2
- package/esm2015/components/input-month/input-month.component.js +2 -2
- package/esm2015/components/input-month-range/input-month-range.component.js +2 -2
- package/esm2015/components/input-number/input-number.component.js +9 -3
- package/esm2015/components/input-phone/input-phone.providers.js +2 -1
- package/esm2015/components/input-phone-international/const/countries.js +2 -1
- package/esm2015/components/input-phone-international/utils/extract-value-from-event.js +6 -1
- package/esm2015/components/input-range/input-range.component.js +2 -2
- package/esm2015/components/input-slider/input-slider.component.js +2 -2
- package/esm2015/components/input-tag/input-tag.component.js +2 -2
- package/esm2015/components/line-clamp/index.js +2 -1
- package/esm2015/components/line-clamp/line-clamp-options.js +12 -0
- package/esm2015/components/line-clamp/line-clamp.component.js +23 -8
- package/esm2015/components/multi-select/multi-select-group/multi-select-group.directive.js +2 -1
- package/esm2015/components/multi-select/multi-select.component.js +1 -1
- package/esm2015/components/multi-select-option/multi-select-option.component.js +2 -2
- package/esm2015/components/pagination/pagination.component.js +5 -4
- package/esm2015/components/pdf-viewer/pdf-viewer.component.js +2 -2
- package/esm2015/components/progress/progress-segmented/progress-segmented.component.js +3 -1
- package/esm2015/components/range/range.component.js +2 -2
- package/esm2015/components/select-option/select-option.component.js +2 -2
- package/esm2015/components/slider/slider-key-steps.directive.js +2 -1
- package/esm2015/components/slider/slider-old.component.js +2 -2
- package/esm2015/components/slider/slider.component.js +12 -2
- package/esm2015/components/tabs/tab/tab.component.js +1 -1
- package/esm2015/components/tabs/tab/tab.providers.js +2 -1
- package/esm2015/components/tabs/tabs/tabs.component.js +3 -3
- package/esm2015/components/tabs/tabs-with-more/tabs-with-more.component.js +3 -3
- package/esm2015/components/tabs/tabs-with-more/tabs-with-more.providers.js +2 -1
- package/esm2015/components/tag/tag.component.js +1 -1
- package/esm2015/components/text-area/text-area.component.js +2 -2
- package/esm2015/components/tree/components/tree-item/tree-item.providers.js +2 -1
- package/esm2015/components/tree/components/tree-item-content/tree-item-content.component.js +2 -2
- package/esm2015/directives/dropdown-context/dropdown-context.directive.js +4 -14
- package/esm2015/directives/dropdown-selection/dropdown-selection.directive.js +3 -11
- package/esm2015/providers/month-formatter.provider.js +5 -1
- package/esm2015/providers/specific-dropdown-controllers.js +3 -1
- package/esm2015/utils/dom/get-word-range.js +4 -1
- package/esm2015/utils/dom/scroll-to-element.js +6 -1
- package/esm2015/utils/dom/set-range-offset.js +4 -1
- package/esm2015/utils/files/format-size.js +6 -1
- package/esm2015/utils/files/get-accept-array.js +6 -1
- package/esm2015/utils/format/string-hash-to-hsl.js +4 -1
- package/esm2015/utils/mask/create-auto-corrected-date-pipe.js +6 -1
- package/esm2015/utils/math/horizontal-direction-to-number.js +2 -2
- package/esm2015/utils/miscellaneous/get-precision.js +4 -1
- package/esm2015/utils/miscellaneous/is-flat.js +6 -1
- package/esm5/abstract/input-slider.js +2 -1
- package/esm5/components/accordion/accordion-item/accordion-item.component.js +3 -3
- package/esm5/components/action/action.component.js +2 -2
- package/esm5/components/breadcrumbs/breadcrumbs-wrapper.component.js +2 -2
- package/esm5/components/files/file/file.component.js +2 -2
- package/esm5/components/files/files.component.js +2 -2
- package/esm5/components/input-file/file/file.component.js +2 -2
- package/esm5/components/input-files/input-files.component.js +2 -2
- package/esm5/components/input-month/input-month.component.js +2 -2
- package/esm5/components/input-month-range/input-month-range.component.js +2 -2
- package/esm5/components/input-number/input-number.component.js +9 -3
- package/esm5/components/input-phone/input-phone.providers.js +2 -1
- package/esm5/components/input-phone-international/const/countries.js +2 -1
- package/esm5/components/input-phone-international/utils/extract-value-from-event.js +6 -1
- package/esm5/components/input-range/input-range.component.js +2 -2
- package/esm5/components/input-slider/input-slider.component.js +2 -2
- package/esm5/components/input-tag/input-tag.component.js +2 -2
- package/esm5/components/line-clamp/index.js +2 -1
- package/esm5/components/line-clamp/line-clamp-options.js +13 -0
- package/esm5/components/line-clamp/line-clamp.component.js +23 -8
- package/esm5/components/multi-select/multi-select-group/multi-select-group.directive.js +2 -1
- package/esm5/components/multi-select/multi-select.component.js +1 -1
- package/esm5/components/multi-select-option/multi-select-option.component.js +2 -2
- package/esm5/components/pagination/pagination.component.js +5 -4
- package/esm5/components/pdf-viewer/pdf-viewer.component.js +2 -2
- package/esm5/components/progress/progress-segmented/progress-segmented.component.js +3 -1
- package/esm5/components/range/range.component.js +2 -2
- package/esm5/components/select-option/select-option.component.js +2 -2
- package/esm5/components/slider/slider-key-steps.directive.js +2 -1
- package/esm5/components/slider/slider-old.component.js +2 -2
- package/esm5/components/slider/slider.component.js +12 -2
- package/esm5/components/tabs/tab/tab.component.js +1 -1
- package/esm5/components/tabs/tab/tab.providers.js +2 -1
- package/esm5/components/tabs/tabs/tabs.component.js +3 -3
- package/esm5/components/tabs/tabs-with-more/tabs-with-more.component.js +3 -3
- package/esm5/components/tabs/tabs-with-more/tabs-with-more.providers.js +2 -1
- package/esm5/components/tag/tag.component.js +1 -1
- package/esm5/components/text-area/text-area.component.js +2 -2
- package/esm5/components/tree/components/tree-item/tree-item.providers.js +2 -1
- package/esm5/components/tree/components/tree-item-content/tree-item-content.component.js +2 -2
- package/esm5/directives/dropdown-context/dropdown-context.directive.js +4 -14
- package/esm5/directives/dropdown-selection/dropdown-selection.directive.js +3 -11
- package/esm5/providers/month-formatter.provider.js +5 -1
- package/esm5/providers/specific-dropdown-controllers.js +3 -1
- package/esm5/utils/dom/get-word-range.js +4 -1
- package/esm5/utils/dom/scroll-to-element.js +6 -1
- package/esm5/utils/dom/set-range-offset.js +4 -1
- package/esm5/utils/files/format-size.js +6 -1
- package/esm5/utils/files/get-accept-array.js +6 -1
- package/esm5/utils/format/string-hash-to-hsl.js +4 -1
- package/esm5/utils/mask/create-auto-corrected-date-pipe.js +6 -1
- package/esm5/utils/math/horizontal-direction-to-number.js +2 -2
- package/esm5/utils/miscellaneous/get-precision.js +4 -1
- package/esm5/utils/miscellaneous/is-flat.js +6 -1
- package/fesm2015/taiga-ui-kit-abstract.js +1 -0
- package/fesm2015/taiga-ui-kit-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-accordion.js +2 -2
- package/fesm2015/taiga-ui-kit-components-accordion.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-action.js +1 -1
- package/fesm2015/taiga-ui-kit-components-action.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-breadcrumbs.js +1 -1
- package/fesm2015/taiga-ui-kit-components-breadcrumbs.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-files.js +2 -2
- package/fesm2015/taiga-ui-kit-components-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-file.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-file.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-files.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month-range.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-number.js +8 -2
- package/fesm2015/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone-international.js +7 -1
- package/fesm2015/taiga-ui-kit-components-input-phone-international.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone.js +1 -0
- package/fesm2015/taiga-ui-kit-components-input-phone.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-range.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-slider.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-tag.js +1 -1
- package/fesm2015/taiga-ui-kit-components-input-tag.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-line-clamp.js +33 -8
- package/fesm2015/taiga-ui-kit-components-line-clamp.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select-option.js +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select-option.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select.js +2 -1
- package/fesm2015/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-pagination.js +4 -3
- package/fesm2015/taiga-ui-kit-components-pagination.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-pdf-viewer.js +1 -1
- package/fesm2015/taiga-ui-kit-components-pdf-viewer.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-progress.js +2 -0
- package/fesm2015/taiga-ui-kit-components-progress.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-range.js +1 -1
- package/fesm2015/taiga-ui-kit-components-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-select-option.js +1 -1
- package/fesm2015/taiga-ui-kit-components-select-option.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-slider.js +13 -2
- package/fesm2015/taiga-ui-kit-components-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tabs.js +7 -5
- package/fesm2015/taiga-ui-kit-components-tabs.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tag.js +1 -1
- package/fesm2015/taiga-ui-kit-components-text-area.js +1 -1
- package/fesm2015/taiga-ui-kit-components-text-area.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tree.js +2 -1
- package/fesm2015/taiga-ui-kit-components-tree.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-dropdown-context.js +3 -13
- package/fesm2015/taiga-ui-kit-directives-dropdown-context.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-dropdown-selection.js +2 -10
- package/fesm2015/taiga-ui-kit-directives-dropdown-selection.js.map +1 -1
- package/fesm2015/taiga-ui-kit-providers.js +6 -0
- package/fesm2015/taiga-ui-kit-providers.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-dom.js +12 -1
- package/fesm2015/taiga-ui-kit-utils-dom.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-files.js +11 -1
- package/fesm2015/taiga-ui-kit-utils-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-format.js +4 -1
- package/fesm2015/taiga-ui-kit-utils-format.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-mask.js +6 -1
- package/fesm2015/taiga-ui-kit-utils-mask.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-math.js +2 -2
- package/fesm2015/taiga-ui-kit-utils-math.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-miscellaneous.js +9 -1
- package/fesm2015/taiga-ui-kit-utils-miscellaneous.js.map +1 -1
- package/fesm5/taiga-ui-kit-abstract.js +1 -0
- package/fesm5/taiga-ui-kit-abstract.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-accordion.js +2 -2
- package/fesm5/taiga-ui-kit-components-accordion.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-action.js +1 -1
- package/fesm5/taiga-ui-kit-components-action.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-breadcrumbs.js +1 -1
- package/fesm5/taiga-ui-kit-components-breadcrumbs.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-files.js +2 -2
- package/fesm5/taiga-ui-kit-components-files.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-file.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-file.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-files.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-files.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-month-range.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-month-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-month.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-month.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-number.js +8 -2
- package/fesm5/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-phone-international.js +7 -1
- package/fesm5/taiga-ui-kit-components-input-phone-international.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-phone.js +1 -0
- package/fesm5/taiga-ui-kit-components-input-phone.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-range.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-slider.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-tag.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-tag.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-line-clamp.js +34 -9
- package/fesm5/taiga-ui-kit-components-line-clamp.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-multi-select-option.js +1 -1
- package/fesm5/taiga-ui-kit-components-multi-select-option.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-multi-select.js +2 -1
- package/fesm5/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-pagination.js +4 -3
- package/fesm5/taiga-ui-kit-components-pagination.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-pdf-viewer.js +1 -1
- package/fesm5/taiga-ui-kit-components-pdf-viewer.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-progress.js +2 -0
- package/fesm5/taiga-ui-kit-components-progress.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-range.js +1 -1
- package/fesm5/taiga-ui-kit-components-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-select-option.js +1 -1
- package/fesm5/taiga-ui-kit-components-select-option.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-slider.js +13 -2
- package/fesm5/taiga-ui-kit-components-slider.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-tabs.js +7 -5
- package/fesm5/taiga-ui-kit-components-tabs.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-tag.js +1 -1
- package/fesm5/taiga-ui-kit-components-text-area.js +1 -1
- package/fesm5/taiga-ui-kit-components-text-area.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-tree.js +2 -1
- package/fesm5/taiga-ui-kit-components-tree.js.map +1 -1
- package/fesm5/taiga-ui-kit-directives-dropdown-context.js +3 -13
- package/fesm5/taiga-ui-kit-directives-dropdown-context.js.map +1 -1
- package/fesm5/taiga-ui-kit-directives-dropdown-selection.js +2 -10
- package/fesm5/taiga-ui-kit-directives-dropdown-selection.js.map +1 -1
- package/fesm5/taiga-ui-kit-providers.js +6 -0
- package/fesm5/taiga-ui-kit-providers.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-dom.js +12 -1
- package/fesm5/taiga-ui-kit-utils-dom.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-files.js +11 -1
- package/fesm5/taiga-ui-kit-utils-files.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-format.js +4 -1
- package/fesm5/taiga-ui-kit-utils-format.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-mask.js +6 -1
- package/fesm5/taiga-ui-kit-utils-mask.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-math.js +2 -2
- package/fesm5/taiga-ui-kit-utils-math.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-miscellaneous.js +9 -1
- package/fesm5/taiga-ui-kit-utils-miscellaneous.js.map +1 -1
- package/package.json +5 -5
- package/providers/month-formatter.provider.d.ts +3 -0
- package/providers/taiga-ui-kit-providers.metadata.json +1 -1
- package/utils/dom/get-word-range.d.ts +2 -0
- package/utils/dom/scroll-to-element.d.ts +4 -0
- package/utils/dom/set-range-offset.d.ts +2 -0
- package/utils/dom/taiga-ui-kit-utils-dom.metadata.json +1 -1
- package/utils/files/format-size.d.ts +4 -0
- package/utils/files/get-accept-array.d.ts +4 -0
- package/utils/files/taiga-ui-kit-utils-files.metadata.json +1 -1
- package/utils/format/string-hash-to-hsl.d.ts +2 -0
- package/utils/format/taiga-ui-kit-utils-format.metadata.json +1 -1
- package/utils/mask/create-auto-corrected-date-pipe.d.ts +4 -0
- package/utils/mask/taiga-ui-kit-utils-mask.metadata.json +1 -1
- package/utils/math/horizontal-direction-to-number.d.ts +1 -1
- package/utils/math/taiga-ui-kit-utils-math.metadata.json +1 -1
- package/utils/miscellaneous/get-precision.d.ts +2 -0
- package/utils/miscellaneous/is-flat.d.ts +4 -0
- package/utils/miscellaneous/taiga-ui-kit-utils-miscellaneous.metadata.json +1 -1
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
import { __extends, __decorate, __param } from 'tslib';
|
|
2
2
|
import { DOCUMENT } from '@angular/common';
|
|
3
3
|
import { Inject, ComponentFactoryResolver, Injector, ElementRef, Host, Optional, ChangeDetectorRef, NgZone, Renderer2, ViewContainerRef, Input, Directive, forwardRef, NgModule } from '@angular/core';
|
|
4
|
-
import { ALWAYS_TRUE_HANDLER, typedFromEvent, getNativeFocused, px, CHAR_ZERO_WIDTH_SPACE, CHAR_NO_BREAK_SPACE, TuiPortalService, TuiActiveZoneDirective, TuiDestroyService, TuiParentsScrollService } from '@taiga-ui/cdk';
|
|
4
|
+
import { ALWAYS_TRUE_HANDLER, typedFromEvent, getNativeFocused, EMPTY_CLIENT_RECT, px, CHAR_ZERO_WIDTH_SPACE, CHAR_NO_BREAK_SPACE, TuiPortalService, TuiActiveZoneDirective, TuiDestroyService, TuiParentsScrollService } from '@taiga-ui/cdk';
|
|
5
5
|
import { TUI_DOCUMENT_OR_SHADOW_ROOT, TUI_ELEMENT_REF, TUI_DROPDOWN_DIRECTIVE, AbstractTuiDropdown, TuiDropdownBoxModule } from '@taiga-ui/core';
|
|
6
6
|
import { getWordRange } from '@taiga-ui/kit/utils/dom';
|
|
7
7
|
import { merge } from 'rxjs';
|
|
8
8
|
import { switchMapTo, takeUntil, map } from 'rxjs/operators';
|
|
9
9
|
|
|
10
|
-
var EMPTY_RECT = {
|
|
11
|
-
bottom: 0,
|
|
12
|
-
height: 0,
|
|
13
|
-
left: 0,
|
|
14
|
-
right: 0,
|
|
15
|
-
top: 0,
|
|
16
|
-
width: 0,
|
|
17
|
-
};
|
|
18
10
|
// @dynamic
|
|
19
11
|
var TuiDropdownSelectionDirective = /** @class */ (function (_super) {
|
|
20
12
|
__extends(TuiDropdownSelectionDirective, _super);
|
|
@@ -104,7 +96,7 @@ var TuiDropdownSelectionDirective = /** @class */ (function (_super) {
|
|
|
104
96
|
*/
|
|
105
97
|
get: function () {
|
|
106
98
|
if (!this.range) {
|
|
107
|
-
return
|
|
99
|
+
return EMPTY_CLIENT_RECT;
|
|
108
100
|
}
|
|
109
101
|
switch (this.position) {
|
|
110
102
|
case 'tag': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-directives-dropdown-selection.js","sources":["ng://@taiga-ui/kit/directives/dropdown-selection/dropdown-selection.directive.ts","ng://@taiga-ui/kit/directives/dropdown-selection/dropdown-selection.module.ts","ng://@taiga-ui/kit/directives/dropdown-selection/taiga-ui-kit-directives-dropdown-selection.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectorRef,\n ComponentFactoryResolver,\n Directive,\n ElementRef,\n forwardRef,\n Host,\n Inject,\n Injector,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Renderer2,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n ALWAYS_TRUE_HANDLER,\n CHAR_NO_BREAK_SPACE,\n CHAR_ZERO_WIDTH_SPACE,\n getNativeFocused,\n px,\n TuiActiveZoneDirective,\n TuiBooleanHandler,\n TuiDestroyService,\n TuiParentsScrollService,\n TuiPortalService,\n typedFromEvent,\n} from '@taiga-ui/cdk';\nimport {\n AbstractTuiDropdown,\n TUI_DOCUMENT_OR_SHADOW_ROOT,\n TUI_DROPDOWN_DIRECTIVE,\n TUI_ELEMENT_REF,\n TuiDropdown,\n} from '@taiga-ui/core';\nimport {getWordRange} from '@taiga-ui/kit/utils/dom';\nimport {merge} from 'rxjs';\nimport {map, switchMapTo, takeUntil} from 'rxjs/operators';\n\nconst EMPTY_RECT: ClientRect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n};\n\n// @dynamic\n@Directive({\n selector: '[tuiDropdownSelection]:not(ng-container)',\n providers: [\n {\n provide: TUI_DROPDOWN_DIRECTIVE,\n useExisting: forwardRef(() => TuiDropdownSelectionDirective),\n },\n TuiParentsScrollService,\n TuiDestroyService,\n ],\n})\nexport class TuiDropdownSelectionDirective\n extends AbstractTuiDropdown\n implements TuiDropdown, OnDestroy\n{\n private visibilityHandler: TuiBooleanHandler<Range> = ALWAYS_TRUE_HANDLER;\n private readonly documentRef: Document;\n private ghost?: HTMLElement;\n private range?: Range;\n\n @Input()\n set tuiDropdownSelection(handler: TuiBooleanHandler<Range> | '') {\n if (!handler || !this.range) {\n return;\n }\n\n const inHostAndValid =\n this.elementRef.nativeElement.contains(this.range.commonAncestorContainer) &&\n handler(this.range);\n\n this.visibilityHandler = handler;\n this.toggleDropdownBox(inHostAndValid);\n }\n\n @Input('tuiDropdownSelectionPosition')\n position: 'selection' | 'word' | 'tag' = 'selection';\n\n constructor(\n @Inject(DOCUMENT) documentRef: Document,\n @Inject(ComponentFactoryResolver)\n componentFactoryResolver: ComponentFactoryResolver,\n @Inject(Injector) injector: Injector,\n @Inject(TuiPortalService) portalService: TuiPortalService,\n @Host() @Inject(ElementRef) elementRef: ElementRef<HTMLElement>,\n @Inject(TuiActiveZoneDirective)\n @Optional()\n activeZone: TuiActiveZoneDirective | null,\n @Inject(TUI_DOCUMENT_OR_SHADOW_ROOT)\n @Optional()\n shadowRootRef: Document | null,\n @Inject(TUI_ELEMENT_REF)\n @Optional()\n customElementRef: ElementRef<HTMLElement> | null,\n @Inject(TuiDestroyService)\n destroy$: TuiDestroyService,\n @Inject(TuiParentsScrollService) readonly refresh$: TuiParentsScrollService,\n @Inject(ChangeDetectorRef) private readonly changeDetectorRef: ChangeDetectorRef,\n @Inject(NgZone) private readonly ngZone: NgZone,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(ViewContainerRef) private readonly viewContainerRef: ViewContainerRef,\n ) {\n super(\n componentFactoryResolver,\n injector,\n portalService,\n customElementRef || elementRef,\n activeZone,\n );\n this.documentRef = shadowRootRef || documentRef;\n\n // SSR protection\n if (!this.documentRef.createRange) {\n return;\n }\n\n this.range = this.documentRef.createRange();\n\n const {nativeElement} = this.elementRef;\n\n merge(\n typedFromEvent(this.documentRef, 'mouseup'),\n typedFromEvent(nativeElement, 'mousedown').pipe(\n switchMapTo(\n typedFromEvent(nativeElement, 'mousemove').pipe(\n takeUntil(typedFromEvent(this.documentRef, 'mouseup')),\n ),\n ),\n ),\n typedFromEvent(nativeElement, 'keyup'),\n )\n .pipe(\n map(() => {\n const active = getNativeFocused(this.documentRef);\n const selection = this.documentRef.getSelection();\n\n // TODO: iframe warning\n if (\n (active instanceof HTMLInputElement ||\n active instanceof HTMLTextAreaElement) &&\n nativeElement.contains(active)\n ) {\n return this.veryVerySadInputFix(active);\n }\n\n return selection?.rangeCount ? selection.getRangeAt(0) : this.range;\n }),\n takeUntil(destroy$),\n )\n .subscribe(range => {\n const contained =\n !!range && nativeElement.contains(range.commonAncestorContainer);\n\n this.range = contained ? range : this.range;\n\n const valid =\n contained &&\n (!this.visibilityHandler ||\n !this.range ||\n this.visibilityHandler(this.range));\n\n this.toggleDropdownBox(!!range && (valid || this.inDropdown(range)));\n });\n }\n\n get clientRect(): ClientRect {\n const {defaultView} = this.documentRef;\n const {rangeRect} = this;\n const frameElement = defaultView ? defaultView.frameElement : null;\n\n if (!frameElement) {\n return rangeRect;\n }\n\n const documentRect = frameElement.getBoundingClientRect();\n\n return {\n top: rangeRect.top + documentRect.top,\n left: rangeRect.left + documentRect.left,\n right: rangeRect.left + documentRect.left + rangeRect.width,\n bottom: rangeRect.top + documentRect.top + rangeRect.height,\n width: rangeRect.width,\n height: rangeRect.height,\n };\n }\n\n ngOnDestroy(): void {\n this.closeDropdownBox();\n\n if (this.ghost) {\n this.renderer.removeChild(\n this.viewContainerRef.element.nativeElement,\n this.ghost,\n );\n }\n }\n\n /**\n * get ClientRect of current Range according to provided position\n */\n private get rangeRect(): ClientRect {\n if (!this.range) {\n return EMPTY_RECT;\n }\n\n switch (this.position) {\n case 'tag': {\n const {commonAncestorContainer} = this.range;\n const element =\n commonAncestorContainer.nodeType === Node.ELEMENT_NODE\n ? commonAncestorContainer\n : commonAncestorContainer.parentNode;\n\n return (element as Element).getBoundingClientRect();\n }\n case 'word':\n return getWordRange(this.range).getBoundingClientRect();\n default:\n return this.range.getBoundingClientRect();\n }\n }\n\n /**\n * Toggle dropdown visibility (has to be in ngZone.run because it could be initiated inside iframe in Editor)\n */\n private toggleDropdownBox(visible: boolean): void {\n this.ngZone.run(() => {\n if (visible) {\n this.openDropdownBox();\n } else {\n this.closeDropdownBox();\n }\n\n this.changeDetectorRef.markForCheck();\n });\n }\n\n /**\n * Check if Node is inside dropdown\n */\n private boxContains(node: Node): boolean {\n return (\n !!this.dropdownBoxRef &&\n this.dropdownBoxRef.location.nativeElement.contains(node)\n );\n }\n\n /**\n * Check if given range is at least partially inside dropdown\n */\n private inDropdown(range: Range): boolean {\n const {startContainer, endContainer} = range;\n const inDropdown = this.boxContains(range.commonAncestorContainer);\n const hostToDropdown =\n this.boxContains(endContainer) &&\n this.elementRef.nativeElement.contains(startContainer);\n const dropdownToHost =\n this.boxContains(startContainer) &&\n this.elementRef.nativeElement.contains(endContainer);\n\n return inDropdown || hostToDropdown || dropdownToHost;\n }\n\n /**\n * Position invisible DIV and create Range similar to selected range inside input/textarea\n */\n private veryVerySadInputFix(element: HTMLInputElement | HTMLTextAreaElement): Range {\n const {ghost = this.initGhost(element)} = this;\n const {top, left, width, height} = element.getBoundingClientRect();\n const {selectionStart, selectionEnd} = element;\n const range = this.documentRef.createRange();\n const hostRect = this.elementRef.nativeElement.getBoundingClientRect();\n\n ghost.style.top = px(top - hostRect.top);\n ghost.style.left = px(left - hostRect.left);\n ghost.style.width = px(width);\n ghost.style.height = px(height);\n ghost.textContent = CHAR_ZERO_WIDTH_SPACE + element.value + CHAR_NO_BREAK_SPACE;\n\n range.setStart(ghost.firstChild!, selectionStart || 0);\n range.setEnd(ghost.firstChild!, selectionEnd || 0);\n\n return range;\n }\n\n /**\n * Create an invisible DIV styled exactly like input/textarea element inside directive\n */\n private initGhost(element: HTMLInputElement | HTMLTextAreaElement): HTMLElement {\n const ghost = this.renderer.createElement('div');\n const {nativeElement} = this.viewContainerRef.element;\n const {font, letterSpacing, textTransform, padding} = getComputedStyle(element);\n\n ghost.style.position = 'absolute';\n ghost.style.pointerEvents = 'none';\n ghost.style.opacity = '0';\n ghost.style.whiteSpace = 'pre-wrap';\n ghost.style.font = font;\n ghost.style.letterSpacing = letterSpacing;\n ghost.style.textTransform = textTransform;\n ghost.style.padding = padding;\n\n this.renderer.appendChild(nativeElement, ghost);\n this.ghost = ghost;\n\n return ghost;\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiDropdownBoxModule} from '@taiga-ui/core';\n\nimport {TuiDropdownSelectionDirective} from './dropdown-selection.directive';\n\n@NgModule({\n imports: [TuiDropdownBoxModule],\n declarations: [TuiDropdownSelectionDirective],\n exports: [TuiDropdownSelectionDirective],\n})\nexport class TuiDropdownSelectionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAyCA,IAAM,UAAU,GAAe;IAC3B,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;CACX,CAAC;AAEF;;IAaY,iDAAmB;IAyB3B,uCACsB,WAAqB,EAEvC,wBAAkD,EAChC,QAAkB,EACV,aAA+B,EAC7B,UAAmC,EAG/D,UAAyC,EAGzC,aAA8B,EAG9B,gBAAgD,EAEhD,QAA2B,EACe,QAAiC,EAC/B,iBAAoC,EAC/C,MAAc,EACX,QAAmB,EACZ,gBAAkC;QAtBjF,YAwBI,kBACI,wBAAwB,EACxB,QAAQ,EACR,aAAa,EACb,gBAAgB,IAAI,UAAU,EAC9B,UAAU,CACb,SAuDJ;QAnE6C,cAAQ,GAAR,QAAQ,CAAyB;QAC/B,uBAAiB,GAAjB,iBAAiB,CAAmB;QAC/C,YAAM,GAAN,MAAM,CAAQ;QACX,cAAQ,GAAR,QAAQ,CAAW;QACZ,sBAAgB,GAAhB,gBAAgB,CAAkB;QA5CzE,uBAAiB,GAA6B,mBAAmB,CAAC;QAoB1E,cAAQ,GAAiC,WAAW,CAAC;QAiCjD,KAAI,CAAC,WAAW,GAAG,aAAa,IAAI,WAAW,CAAC;;QAGhD,IAAI,CAAC,KAAI,CAAC,WAAW,CAAC,WAAW,EAAE;;SAElC;QAED,KAAI,CAAC,KAAK,GAAG,KAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;QAErC,IAAA,8CAAa,CAAoB;QAExC,KAAK,CACD,cAAc,CAAC,KAAI,CAAC,WAAW,EAAE,SAAS,CAAC,EAC3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AAA,MAAM,CAAC,uBAAuB,CAAC,CAAA;QAC/B,YAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,YAAA,MAAM,CAAC,MAAM,CAAC,CAAA;QACd,YAAA,MAAM,CAAC,SAAS,CAAC,CAAA;QACjB,YAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;OAhDpB,6BAA6B,CA+PzC;IAAD,oCAAC;CAAA,CA9PW,mBAAmB;;;ICrD/B;KAA0C;IAA7B,0BAA0B;QALtC,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,oBAAoB,CAAC;YAC/B,YAAY,EAAE,CAAC,6BAA6B,CAAC;YAC7C,OAAO,EAAE,CAAC,6BAA6B,CAAC;SAC3C,CAAC;OACW,0BAA0B,CAAG;IAAD,iCAAC;CAA1C;;ACVA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-directives-dropdown-selection.js","sources":["ng://@taiga-ui/kit/directives/dropdown-selection/dropdown-selection.directive.ts","ng://@taiga-ui/kit/directives/dropdown-selection/dropdown-selection.module.ts","ng://@taiga-ui/kit/directives/dropdown-selection/taiga-ui-kit-directives-dropdown-selection.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectorRef,\n ComponentFactoryResolver,\n Directive,\n ElementRef,\n forwardRef,\n Host,\n Inject,\n Injector,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Renderer2,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n ALWAYS_TRUE_HANDLER,\n CHAR_NO_BREAK_SPACE,\n CHAR_ZERO_WIDTH_SPACE,\n EMPTY_CLIENT_RECT,\n getNativeFocused,\n px,\n TuiActiveZoneDirective,\n TuiBooleanHandler,\n TuiDestroyService,\n TuiParentsScrollService,\n TuiPortalService,\n typedFromEvent,\n} from '@taiga-ui/cdk';\nimport {\n AbstractTuiDropdown,\n TUI_DOCUMENT_OR_SHADOW_ROOT,\n TUI_DROPDOWN_DIRECTIVE,\n TUI_ELEMENT_REF,\n TuiDropdown,\n} from '@taiga-ui/core';\nimport {getWordRange} from '@taiga-ui/kit/utils/dom';\nimport {merge} from 'rxjs';\nimport {map, switchMapTo, takeUntil} from 'rxjs/operators';\n\n// @dynamic\n@Directive({\n selector: '[tuiDropdownSelection]:not(ng-container)',\n providers: [\n {\n provide: TUI_DROPDOWN_DIRECTIVE,\n useExisting: forwardRef(() => TuiDropdownSelectionDirective),\n },\n TuiParentsScrollService,\n TuiDestroyService,\n ],\n})\nexport class TuiDropdownSelectionDirective\n extends AbstractTuiDropdown\n implements TuiDropdown, OnDestroy\n{\n private visibilityHandler: TuiBooleanHandler<Range> = ALWAYS_TRUE_HANDLER;\n private readonly documentRef: Document;\n private ghost?: HTMLElement;\n private range?: Range;\n\n @Input()\n set tuiDropdownSelection(handler: TuiBooleanHandler<Range> | '') {\n if (!handler || !this.range) {\n return;\n }\n\n const inHostAndValid =\n this.elementRef.nativeElement.contains(this.range.commonAncestorContainer) &&\n handler(this.range);\n\n this.visibilityHandler = handler;\n this.toggleDropdownBox(inHostAndValid);\n }\n\n @Input('tuiDropdownSelectionPosition')\n position: 'selection' | 'word' | 'tag' = 'selection';\n\n constructor(\n @Inject(DOCUMENT) documentRef: Document,\n @Inject(ComponentFactoryResolver)\n componentFactoryResolver: ComponentFactoryResolver,\n @Inject(Injector) injector: Injector,\n @Inject(TuiPortalService) portalService: TuiPortalService,\n @Host() @Inject(ElementRef) elementRef: ElementRef<HTMLElement>,\n @Inject(TuiActiveZoneDirective)\n @Optional()\n activeZone: TuiActiveZoneDirective | null,\n @Inject(TUI_DOCUMENT_OR_SHADOW_ROOT)\n @Optional()\n shadowRootRef: Document | null,\n @Inject(TUI_ELEMENT_REF)\n @Optional()\n customElementRef: ElementRef<HTMLElement> | null,\n @Inject(TuiDestroyService)\n destroy$: TuiDestroyService,\n @Inject(TuiParentsScrollService) readonly refresh$: TuiParentsScrollService,\n @Inject(ChangeDetectorRef) private readonly changeDetectorRef: ChangeDetectorRef,\n @Inject(NgZone) private readonly ngZone: NgZone,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(ViewContainerRef) private readonly viewContainerRef: ViewContainerRef,\n ) {\n super(\n componentFactoryResolver,\n injector,\n portalService,\n customElementRef || elementRef,\n activeZone,\n );\n this.documentRef = shadowRootRef || documentRef;\n\n // SSR protection\n if (!this.documentRef.createRange) {\n return;\n }\n\n this.range = this.documentRef.createRange();\n\n const {nativeElement} = this.elementRef;\n\n merge(\n typedFromEvent(this.documentRef, 'mouseup'),\n typedFromEvent(nativeElement, 'mousedown').pipe(\n switchMapTo(\n typedFromEvent(nativeElement, 'mousemove').pipe(\n takeUntil(typedFromEvent(this.documentRef, 'mouseup')),\n ),\n ),\n ),\n typedFromEvent(nativeElement, 'keyup'),\n )\n .pipe(\n map(() => {\n const active = getNativeFocused(this.documentRef);\n const selection = this.documentRef.getSelection();\n\n // TODO: iframe warning\n if (\n (active instanceof HTMLInputElement ||\n active instanceof HTMLTextAreaElement) &&\n nativeElement.contains(active)\n ) {\n return this.veryVerySadInputFix(active);\n }\n\n return selection?.rangeCount ? selection.getRangeAt(0) : this.range;\n }),\n takeUntil(destroy$),\n )\n .subscribe(range => {\n const contained =\n !!range && nativeElement.contains(range.commonAncestorContainer);\n\n this.range = contained ? range : this.range;\n\n const valid =\n contained &&\n (!this.visibilityHandler ||\n !this.range ||\n this.visibilityHandler(this.range));\n\n this.toggleDropdownBox(!!range && (valid || this.inDropdown(range)));\n });\n }\n\n get clientRect(): ClientRect {\n const {defaultView} = this.documentRef;\n const {rangeRect} = this;\n const frameElement = defaultView ? defaultView.frameElement : null;\n\n if (!frameElement) {\n return rangeRect;\n }\n\n const documentRect = frameElement.getBoundingClientRect();\n\n return {\n top: rangeRect.top + documentRect.top,\n left: rangeRect.left + documentRect.left,\n right: rangeRect.left + documentRect.left + rangeRect.width,\n bottom: rangeRect.top + documentRect.top + rangeRect.height,\n width: rangeRect.width,\n height: rangeRect.height,\n };\n }\n\n ngOnDestroy(): void {\n this.closeDropdownBox();\n\n if (this.ghost) {\n this.renderer.removeChild(\n this.viewContainerRef.element.nativeElement,\n this.ghost,\n );\n }\n }\n\n /**\n * get ClientRect of current Range according to provided position\n */\n private get rangeRect(): ClientRect {\n if (!this.range) {\n return EMPTY_CLIENT_RECT;\n }\n\n switch (this.position) {\n case 'tag': {\n const {commonAncestorContainer} = this.range;\n const element =\n commonAncestorContainer.nodeType === Node.ELEMENT_NODE\n ? commonAncestorContainer\n : commonAncestorContainer.parentNode;\n\n return (element as Element).getBoundingClientRect();\n }\n case 'word':\n return getWordRange(this.range).getBoundingClientRect();\n default:\n return this.range.getBoundingClientRect();\n }\n }\n\n /**\n * Toggle dropdown visibility (has to be in ngZone.run because it could be initiated inside iframe in Editor)\n */\n private toggleDropdownBox(visible: boolean): void {\n this.ngZone.run(() => {\n if (visible) {\n this.openDropdownBox();\n } else {\n this.closeDropdownBox();\n }\n\n this.changeDetectorRef.markForCheck();\n });\n }\n\n /**\n * Check if Node is inside dropdown\n */\n private boxContains(node: Node): boolean {\n return (\n !!this.dropdownBoxRef &&\n this.dropdownBoxRef.location.nativeElement.contains(node)\n );\n }\n\n /**\n * Check if given range is at least partially inside dropdown\n */\n private inDropdown(range: Range): boolean {\n const {startContainer, endContainer} = range;\n const inDropdown = this.boxContains(range.commonAncestorContainer);\n const hostToDropdown =\n this.boxContains(endContainer) &&\n this.elementRef.nativeElement.contains(startContainer);\n const dropdownToHost =\n this.boxContains(startContainer) &&\n this.elementRef.nativeElement.contains(endContainer);\n\n return inDropdown || hostToDropdown || dropdownToHost;\n }\n\n /**\n * Position invisible DIV and create Range similar to selected range inside input/textarea\n */\n private veryVerySadInputFix(element: HTMLInputElement | HTMLTextAreaElement): Range {\n const {ghost = this.initGhost(element)} = this;\n const {top, left, width, height} = element.getBoundingClientRect();\n const {selectionStart, selectionEnd} = element;\n const range = this.documentRef.createRange();\n const hostRect = this.elementRef.nativeElement.getBoundingClientRect();\n\n ghost.style.top = px(top - hostRect.top);\n ghost.style.left = px(left - hostRect.left);\n ghost.style.width = px(width);\n ghost.style.height = px(height);\n ghost.textContent = CHAR_ZERO_WIDTH_SPACE + element.value + CHAR_NO_BREAK_SPACE;\n\n range.setStart(ghost.firstChild!, selectionStart || 0);\n range.setEnd(ghost.firstChild!, selectionEnd || 0);\n\n return range;\n }\n\n /**\n * Create an invisible DIV styled exactly like input/textarea element inside directive\n */\n private initGhost(element: HTMLInputElement | HTMLTextAreaElement): HTMLElement {\n const ghost = this.renderer.createElement('div');\n const {nativeElement} = this.viewContainerRef.element;\n const {font, letterSpacing, textTransform, padding} = getComputedStyle(element);\n\n ghost.style.position = 'absolute';\n ghost.style.pointerEvents = 'none';\n ghost.style.opacity = '0';\n ghost.style.whiteSpace = 'pre-wrap';\n ghost.style.font = font;\n ghost.style.letterSpacing = letterSpacing;\n ghost.style.textTransform = textTransform;\n ghost.style.padding = padding;\n\n this.renderer.appendChild(nativeElement, ghost);\n this.ghost = ghost;\n\n return ghost;\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiDropdownBoxModule} from '@taiga-ui/core';\n\nimport {TuiDropdownSelectionDirective} from './dropdown-selection.directive';\n\n@NgModule({\n imports: [TuiDropdownBoxModule],\n declarations: [TuiDropdownSelectionDirective],\n exports: [TuiDropdownSelectionDirective],\n})\nexport class TuiDropdownSelectionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA0CA;;IAaY,iDAAmB;IAyB3B,uCACsB,WAAqB,EAEvC,wBAAkD,EAChC,QAAkB,EACV,aAA+B,EAC7B,UAAmC,EAG/D,UAAyC,EAGzC,aAA8B,EAG9B,gBAAgD,EAEhD,QAA2B,EACe,QAAiC,EAC/B,iBAAoC,EAC/C,MAAc,EACX,QAAmB,EACZ,gBAAkC;QAtBjF,YAwBI,kBACI,wBAAwB,EACxB,QAAQ,EACR,aAAa,EACb,gBAAgB,IAAI,UAAU,EAC9B,UAAU,CACb,SAuD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uses offset in characters only
|
|
15
|
+
*/
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
17
|
function monthFormatterFactory(pipe) {
|
|
14
18
|
return function (month) {
|
|
15
19
|
return month
|
|
@@ -20,6 +24,7 @@ function monthFormatterFactory(pipe) {
|
|
|
20
24
|
};
|
|
21
25
|
}
|
|
22
26
|
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
23
28
|
function fixedDropdownControllerFactory(directive) {
|
|
24
29
|
directive = directive || new TuiDropdownControllerDirective();
|
|
25
30
|
directive.limitWidth = 'fixed';
|
|
@@ -32,6 +37,7 @@ var FIXED_DROPDOWN_CONTROLLER_PROVIDER = [
|
|
|
32
37
|
useFactory: fixedDropdownControllerFactory,
|
|
33
38
|
},
|
|
34
39
|
];
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
35
41
|
function leftAlignedDropdownControllerFactory(directive) {
|
|
36
42
|
directive = directive || new TuiDropdownControllerDirective();
|
|
37
43
|
directive.align = 'left';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-providers.js","sources":["ng://@taiga-ui/kit/providers/month-formatter.provider.ts","ng://@taiga-ui/kit/providers/specific-dropdown-controllers.ts","ng://@taiga-ui/kit/providers/value-accessor.provider.ts","ng://@taiga-ui/kit/providers/taiga-ui-kit-providers.ts"],"sourcesContent":["import {FactoryProvider} from '@angular/core';\nimport {TuiHandler, TuiMonth} from '@taiga-ui/cdk';\nimport {TuiMonthPipe} from '@taiga-ui/core';\nimport {TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens';\nimport {Observable, of} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nexport const TUI_MONTH_FORMATTER_PROVIDER: FactoryProvider = {\n provide: TUI_MONTH_FORMATTER,\n deps: [TuiMonthPipe],\n useFactory: monthFormatterFactory,\n};\n\nexport function monthFormatterFactory(\n pipe: TuiMonthPipe,\n): TuiHandler<TuiMonth | null, Observable<string>> {\n return month =>\n month\n ? pipe\n .transform(month)\n .pipe(map(formatted => `${formatted} ${month.formattedYear}`))\n : of('');\n}\n","import {Optional, Provider} from '@angular/core';\nimport {TUI_DROPDOWN_CONTROLLER, TuiDropdownControllerDirective} from '@taiga-ui/core';\n\nexport function fixedDropdownControllerFactory(\n directive: TuiDropdownControllerDirective | null,\n): TuiDropdownControllerDirective {\n directive = directive || new TuiDropdownControllerDirective();\n directive.limitWidth = 'fixed';\n\n return directive;\n}\n\nexport const FIXED_DROPDOWN_CONTROLLER_PROVIDER: Provider = [\n {\n provide: TUI_DROPDOWN_CONTROLLER,\n deps: [[new Optional(), TuiDropdownControllerDirective]],\n useFactory: fixedDropdownControllerFactory,\n },\n];\n\nexport function leftAlignedDropdownControllerFactory(\n directive: TuiDropdownControllerDirective | null,\n): TuiDropdownControllerDirective {\n directive = directive || new TuiDropdownControllerDirective();\n directive.align = 'left';\n\n return directive;\n}\n\nexport const LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER: Provider = [\n {\n provide: TUI_DROPDOWN_CONTROLLER,\n deps: [[new Optional(), TuiDropdownControllerDirective]],\n useFactory: leftAlignedDropdownControllerFactory,\n },\n];\n","import {FactoryProvider, Optional, Self} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {TUI_VALUE_ACCESSOR} from '@taiga-ui/core';\nimport {identity} from 'rxjs';\n\n// TODO: 3.0 remove in ivy compilation\nexport const IDENTITY = identity;\n\nexport const TUI_VALUE_ACCESSOR_PROVIDER: FactoryProvider = {\n provide: TUI_VALUE_ACCESSOR,\n deps: [[new Optional(), new Self(), NG_VALUE_ACCESSOR]],\n useFactory: IDENTITY,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;IAOa,4BAA4B,GAAoB;IACzD,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,CAAC,YAAY,CAAC;IACpB,UAAU,EAAE,qBAAqB;EACnC;
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-providers.js","sources":["ng://@taiga-ui/kit/providers/month-formatter.provider.ts","ng://@taiga-ui/kit/providers/specific-dropdown-controllers.ts","ng://@taiga-ui/kit/providers/value-accessor.provider.ts","ng://@taiga-ui/kit/providers/taiga-ui-kit-providers.ts"],"sourcesContent":["import {FactoryProvider} from '@angular/core';\nimport {TuiHandler, TuiMonth} from '@taiga-ui/cdk';\nimport {TuiMonthPipe} from '@taiga-ui/core';\nimport {TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens';\nimport {Observable, of} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nexport const TUI_MONTH_FORMATTER_PROVIDER: FactoryProvider = {\n provide: TUI_MONTH_FORMATTER,\n deps: [TuiMonthPipe],\n useFactory: monthFormatterFactory,\n};\n\n/**\n * Range.setStart/set-end, except it uses offset in characters only\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function monthFormatterFactory(\n pipe: TuiMonthPipe,\n): TuiHandler<TuiMonth | null, Observable<string>> {\n return month =>\n month\n ? pipe\n .transform(month)\n .pipe(map(formatted => `${formatted} ${month.formattedYear}`))\n : of('');\n}\n","import {Optional, Provider} from '@angular/core';\nimport {TUI_DROPDOWN_CONTROLLER, TuiDropdownControllerDirective} from '@taiga-ui/core';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function fixedDropdownControllerFactory(\n directive: TuiDropdownControllerDirective | null,\n): TuiDropdownControllerDirective {\n directive = directive || new TuiDropdownControllerDirective();\n directive.limitWidth = 'fixed';\n\n return directive;\n}\n\nexport const FIXED_DROPDOWN_CONTROLLER_PROVIDER: Provider = [\n {\n provide: TUI_DROPDOWN_CONTROLLER,\n deps: [[new Optional(), TuiDropdownControllerDirective]],\n useFactory: fixedDropdownControllerFactory,\n },\n];\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function leftAlignedDropdownControllerFactory(\n directive: TuiDropdownControllerDirective | null,\n): TuiDropdownControllerDirective {\n directive = directive || new TuiDropdownControllerDirective();\n directive.align = 'left';\n\n return directive;\n}\n\nexport const LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER: Provider = [\n {\n provide: TUI_DROPDOWN_CONTROLLER,\n deps: [[new Optional(), TuiDropdownControllerDirective]],\n useFactory: leftAlignedDropdownControllerFactory,\n },\n];\n","import {FactoryProvider, Optional, Self} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {TUI_VALUE_ACCESSOR} from '@taiga-ui/core';\nimport {identity} from 'rxjs';\n\n// TODO: 3.0 remove in ivy compilation\nexport const IDENTITY = identity;\n\nexport const TUI_VALUE_ACCESSOR_PROVIDER: FactoryProvider = {\n provide: TUI_VALUE_ACCESSOR,\n deps: [[new Optional(), new Self(), NG_VALUE_ACCESSOR]],\n useFactory: IDENTITY,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;IAOa,4BAA4B,GAAoB;IACzD,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,CAAC,YAAY,CAAC;IACpB,UAAU,EAAE,qBAAqB;EACnC;AAEF;;;AAGA;SACgB,qBAAqB,CACjC,IAAkB;IAElB,OAAO,UAAA,KAAK;QACR,OAAA,KAAK;cACC,IAAI;iBACC,SAAS,CAAC,KAAK,CAAC;iBAChB,IAAI,CAAC,GAAG,CAAC,UAAA,SAAS,IAAI,OAAG,SAAS,SAAI,KAAK,CAAC,aAAe,GAAA,CAAC,CAAC;cAClE,EAAE,CAAC,EAAE,CAAC;KAAA,CAAC;AACrB;;ACvBA;SACgB,8BAA8B,CAC1C,SAAgD;IAEhD,SAAS,GAAG,SAAS,IAAI,IAAI,8BAA8B,EAAE,CAAC;IAC9D,SAAS,CAAC,UAAU,GAAG,OAAO,CAAC;IAE/B,OAAO,SAAS,CAAC;AACrB,CAAC;IAEY,kCAAkC,GAAa;IACxD;QACI,OAAO,EAAE,uBAAuB;QAChC,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,8BAA8B,CAAC,CAAC;QACxD,UAAU,EAAE,8BAA8B;KAC7C;EACH;AAEF;SACgB,oCAAoC,CAChD,SAAgD;IAEhD,SAAS,GAAG,SAAS,IAAI,IAAI,8BAA8B,EAAE,CAAC;IAC9D,SAAS,CAAC,KAAK,GAAG,MAAM,CAAC;IAEzB,OAAO,SAAS,CAAC;AACrB,CAAC;IAEY,yCAAyC,GAAa;IAC/D;QACI,OAAO,EAAE,uBAAuB;QAChC,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,8BAA8B,CAAC,CAAC;QACxD,UAAU,EAAE,oCAAoC;KACnD;;;AC/BL;IACa,QAAQ,GAAG,SAAS;IAEpB,2BAA2B,GAAoB;IACxD,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,IAAI,IAAI,EAAE,EAAE,iBAAiB,CAAC,CAAC;IACvD,UAAU,EAAE,QAAQ;;;ACXxB;;;;;;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { svgNodeFilter, CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_SPACE } from '@taiga-ui/cdk';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
+
* @deprecated: use {@link tuiGetWordRange} instead
|
|
4
5
|
* Creates a cloned range with its boundaries set at word boundaries
|
|
5
6
|
*
|
|
6
7
|
* @param currentRange a range to clone
|
|
7
8
|
* @return modified range
|
|
8
9
|
*/
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
11
|
function getWordRange(currentRange) {
|
|
10
12
|
var range = currentRange.cloneRange();
|
|
11
13
|
var startContainer = range.startContainer, startOffset = range.startOffset, endContainer = range.endContainer, endOffset = range.endOffset;
|
|
@@ -50,7 +52,12 @@ function getWordRange(currentRange) {
|
|
|
50
52
|
} while (treeWalker.nextNode());
|
|
51
53
|
return range;
|
|
52
54
|
}
|
|
55
|
+
var tuiGetWordRange = getWordRange;
|
|
53
56
|
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated: use {@link tuiScrollToElement} instead
|
|
59
|
+
*/
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
54
61
|
function scrollToElement(element, container) {
|
|
55
62
|
var scrolledWidth = container.offsetWidth + container.scrollLeft;
|
|
56
63
|
var elementWidth = element.offsetWidth;
|
|
@@ -68,10 +75,13 @@ function scrollToElement(element, container) {
|
|
|
68
75
|
container.scrollLeft += deltaXLeft;
|
|
69
76
|
}
|
|
70
77
|
}
|
|
78
|
+
var tuiScrollToElement = scrollToElement;
|
|
71
79
|
|
|
72
80
|
/**
|
|
81
|
+
* @deprecated: use {@link tuiSetRangeOffset} instead
|
|
73
82
|
* Range.setStart/set-end, except it uses offset in characters only
|
|
74
83
|
*/
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
75
85
|
function setRangeOffset(range, node, offset, method) {
|
|
76
86
|
var ownerDocument = node.ownerDocument;
|
|
77
87
|
if (!ownerDocument) {
|
|
@@ -93,10 +103,11 @@ function setRangeOffset(range, node, offset, method) {
|
|
|
93
103
|
}
|
|
94
104
|
}
|
|
95
105
|
}
|
|
106
|
+
var tuiSetRangeOffset = setRangeOffset;
|
|
96
107
|
|
|
97
108
|
/**
|
|
98
109
|
* Generated bundle index. Do not edit.
|
|
99
110
|
*/
|
|
100
111
|
|
|
101
|
-
export { getWordRange, scrollToElement, setRangeOffset };
|
|
112
|
+
export { getWordRange, scrollToElement, setRangeOffset, tuiGetWordRange, tuiScrollToElement, tuiSetRangeOffset };
|
|
102
113
|
//# sourceMappingURL=taiga-ui-kit-utils-dom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-utils-dom.js","sources":["ng://@taiga-ui/kit/utils/dom/get-word-range.ts","ng://@taiga-ui/kit/utils/dom/scroll-to-element.ts","ng://@taiga-ui/kit/utils/dom/set-range-offset.ts","ng://@taiga-ui/kit/utils/dom/taiga-ui-kit-utils-dom.ts"],"sourcesContent":["import {CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_SPACE, svgNodeFilter} from '@taiga-ui/cdk';\n\n/**\n * Creates a cloned range with its boundaries set at word boundaries\n *\n * @param currentRange a range to clone\n * @return modified range\n */\nexport function getWordRange(currentRange: Range): Range {\n const range = currentRange.cloneRange();\n const {startContainer, startOffset, endContainer, endOffset} = range;\n const {ownerDocument} = startContainer;\n\n if (!ownerDocument) {\n return range;\n }\n\n const treeWalker = ownerDocument.createTreeWalker(\n ownerDocument.body,\n NodeFilter.SHOW_TEXT,\n svgNodeFilter,\n false,\n );\n\n treeWalker.currentNode = startContainer;\n\n do {\n const container = treeWalker.currentNode;\n const textContent = container.textContent || '';\n const content =\n container === startContainer\n ? textContent.slice(0, Math.max(0, startOffset + 1))\n : textContent;\n const offset =\n Math.max(\n content.lastIndexOf(' '),\n content.lastIndexOf(CHAR_NO_BREAK_SPACE),\n content.lastIndexOf(CHAR_ZERO_WIDTH_SPACE),\n ) + 1;\n\n range.setStart(container, 0);\n\n if (offset) {\n range.setStart(container, offset);\n break;\n }\n } while (treeWalker.previousNode());\n\n treeWalker.currentNode = endContainer;\n\n do {\n const container = treeWalker.currentNode;\n const textContent = container.textContent || '';\n const content =\n container === endContainer ? textContent.slice(endOffset + 1) : textContent;\n const offset = [\n content.indexOf(' '),\n content.indexOf(CHAR_NO_BREAK_SPACE),\n content.indexOf(CHAR_ZERO_WIDTH_SPACE),\n ].reduce(\n (result, item) =>\n result === -1 || item === -1\n ? Math.max(result, item)\n : Math.min(result, item),\n -1,\n );\n\n range.setEnd(container, textContent.length);\n\n if (offset !== -1) {\n range.setEnd(container, offset + textContent.length - content.length);\n break;\n }\n } while (treeWalker.nextNode());\n\n return range;\n}\n","
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-utils-dom.js","sources":["ng://@taiga-ui/kit/utils/dom/get-word-range.ts","ng://@taiga-ui/kit/utils/dom/scroll-to-element.ts","ng://@taiga-ui/kit/utils/dom/set-range-offset.ts","ng://@taiga-ui/kit/utils/dom/taiga-ui-kit-utils-dom.ts"],"sourcesContent":["import {CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_SPACE, svgNodeFilter} from '@taiga-ui/cdk';\n\n/**\n * @deprecated: use {@link tuiGetWordRange} instead\n * Creates a cloned range with its boundaries set at word boundaries\n *\n * @param currentRange a range to clone\n * @return modified range\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getWordRange(currentRange: Range): Range {\n const range = currentRange.cloneRange();\n const {startContainer, startOffset, endContainer, endOffset} = range;\n const {ownerDocument} = startContainer;\n\n if (!ownerDocument) {\n return range;\n }\n\n const treeWalker = ownerDocument.createTreeWalker(\n ownerDocument.body,\n NodeFilter.SHOW_TEXT,\n svgNodeFilter,\n false,\n );\n\n treeWalker.currentNode = startContainer;\n\n do {\n const container = treeWalker.currentNode;\n const textContent = container.textContent || '';\n const content =\n container === startContainer\n ? textContent.slice(0, Math.max(0, startOffset + 1))\n : textContent;\n const offset =\n Math.max(\n content.lastIndexOf(' '),\n content.lastIndexOf(CHAR_NO_BREAK_SPACE),\n content.lastIndexOf(CHAR_ZERO_WIDTH_SPACE),\n ) + 1;\n\n range.setStart(container, 0);\n\n if (offset) {\n range.setStart(container, offset);\n break;\n }\n } while (treeWalker.previousNode());\n\n treeWalker.currentNode = endContainer;\n\n do {\n const container = treeWalker.currentNode;\n const textContent = container.textContent || '';\n const content =\n container === endContainer ? textContent.slice(endOffset + 1) : textContent;\n const offset = [\n content.indexOf(' '),\n content.indexOf(CHAR_NO_BREAK_SPACE),\n content.indexOf(CHAR_ZERO_WIDTH_SPACE),\n ].reduce(\n (result, item) =>\n result === -1 || item === -1\n ? Math.max(result, item)\n : Math.min(result, item),\n -1,\n );\n\n range.setEnd(container, textContent.length);\n\n if (offset !== -1) {\n range.setEnd(container, offset + textContent.length - content.length);\n break;\n }\n } while (treeWalker.nextNode());\n\n return range;\n}\n\nexport const tuiGetWordRange = getWordRange;\n","/**\n * @deprecated: use {@link tuiScrollToElement} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function scrollToElement(element: HTMLElement, container: HTMLElement): void {\n const scrolledWidth = container.offsetWidth + container.scrollLeft;\n const elementWidth = element.offsetWidth;\n const elementX =\n container.scrollLeft +\n element.getBoundingClientRect().left -\n container.getBoundingClientRect().left;\n const elementDidNotFitRight = elementX + elementWidth > scrolledWidth;\n const elementDidNotFitLeft = container.scrollLeft > elementX;\n const deltaXRight = elementX + elementWidth - scrolledWidth;\n const deltaXLeft = elementX - container.scrollLeft;\n\n if (elementDidNotFitRight) {\n container.scrollLeft += deltaXRight;\n }\n\n if (elementDidNotFitLeft) {\n container.scrollLeft += deltaXLeft;\n }\n}\n\nexport const tuiScrollToElement = scrollToElement;\n","import {svgNodeFilter} from '@taiga-ui/cdk';\n\n/**\n * @deprecated: use {@link tuiSetRangeOffset} instead\n * Range.setStart/set-end, except it uses offset in characters only\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function setRangeOffset(\n range: Range,\n node: HTMLElement,\n offset: number,\n method: 'setStart' | 'setEnd',\n): void {\n const {ownerDocument} = node;\n\n if (!ownerDocument) {\n return;\n }\n\n const treeWalker = ownerDocument.createTreeWalker(\n node,\n NodeFilter.SHOW_TEXT,\n svgNodeFilter,\n false,\n );\n\n treeWalker.currentNode = node;\n\n while (treeWalker.nextNode()) {\n if (treeWalker.currentNode.nodeType === Node.TEXT_NODE) {\n const length = treeWalker.currentNode.nodeValue\n ? treeWalker.currentNode.nodeValue.length\n : 0;\n\n if (offset > length) {\n offset -= length;\n } else {\n range[method](treeWalker.currentNode, offset);\n }\n }\n }\n}\n\nexport const tuiSetRangeOffset = setRangeOffset;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA;;;;;;;AAOA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';
|
|
|
2
2
|
|
|
3
3
|
var BYTES_PER_KB = 1000;
|
|
4
4
|
var BYTES_PER_MB = 1000 * BYTES_PER_KB;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated: use {@link tuiFormatSize} instead
|
|
7
|
+
*/
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
5
9
|
function formatSize(units, size) {
|
|
6
10
|
if (size === undefined) {
|
|
7
11
|
return null;
|
|
@@ -14,17 +18,23 @@ function formatSize(units, size) {
|
|
|
14
18
|
}
|
|
15
19
|
return round(size / BYTES_PER_MB, 2).toLocaleString('ru-RU') + " " + units[2];
|
|
16
20
|
}
|
|
21
|
+
var tuiFormatSize = formatSize;
|
|
17
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated: use {@link tuiGetAcceptArray} instead
|
|
25
|
+
*/
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
18
27
|
function getAcceptArray(accept) {
|
|
19
28
|
return accept
|
|
20
29
|
.toLowerCase()
|
|
21
30
|
.split(',')
|
|
22
31
|
.map(function (format) { return format.trim(); });
|
|
23
32
|
}
|
|
33
|
+
var tuiGetAcceptArray = getAcceptArray;
|
|
24
34
|
|
|
25
35
|
/**
|
|
26
36
|
* Generated bundle index. Do not edit.
|
|
27
37
|
*/
|
|
28
38
|
|
|
29
|
-
export { formatSize, getAcceptArray };
|
|
39
|
+
export { formatSize, getAcceptArray, tuiFormatSize, tuiGetAcceptArray };
|
|
30
40
|
//# sourceMappingURL=taiga-ui-kit-utils-files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-utils-files.js","sources":["ng://@taiga-ui/kit/utils/files/format-size.ts","ng://@taiga-ui/kit/utils/files/get-accept-array.ts","ng://@taiga-ui/kit/utils/files/taiga-ui-kit-utils-files.ts"],"sourcesContent":["import {round} from '@taiga-ui/cdk';\n\nconst BYTES_PER_KB = 1000;\nconst BYTES_PER_MB = 1000 * BYTES_PER_KB;\n\nexport function formatSize(\n units: [string, string, string],\n size?: number,\n): string | null {\n if (size === undefined) {\n return null;\n }\n\n if (size < BYTES_PER_KB) {\n return `${size} ${units[0]}`;\n }\n\n if (size < BYTES_PER_MB) {\n return `${(size / BYTES_PER_KB).toFixed(0)} ${units[1]}`;\n }\n\n return `${round(size / BYTES_PER_MB, 2).toLocaleString('ru-RU')} ${units[2]}`;\n}\n","
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-utils-files.js","sources":["ng://@taiga-ui/kit/utils/files/format-size.ts","ng://@taiga-ui/kit/utils/files/get-accept-array.ts","ng://@taiga-ui/kit/utils/files/taiga-ui-kit-utils-files.ts"],"sourcesContent":["import {round} from '@taiga-ui/cdk';\n\nconst BYTES_PER_KB = 1000;\nconst BYTES_PER_MB = 1000 * BYTES_PER_KB;\n\n/**\n * @deprecated: use {@link tuiFormatSize} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function formatSize(\n units: [string, string, string],\n size?: number,\n): string | null {\n if (size === undefined) {\n return null;\n }\n\n if (size < BYTES_PER_KB) {\n return `${size} ${units[0]}`;\n }\n\n if (size < BYTES_PER_MB) {\n return `${(size / BYTES_PER_KB).toFixed(0)} ${units[1]}`;\n }\n\n return `${round(size / BYTES_PER_MB, 2).toLocaleString('ru-RU')} ${units[2]}`;\n}\n\nexport const tuiFormatSize = formatSize;\n","/**\n * @deprecated: use {@link tuiGetAcceptArray} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getAcceptArray(accept: string): readonly string[] {\n return accept\n .toLowerCase()\n .split(',')\n .map(format => format.trim());\n}\n\nexport const tuiGetAcceptArray = getAcceptArray;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA,IAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,IAAM,YAAY,GAAG,IAAI,GAAG,YAAY,CAAC;AAEzC;;;AAGA;SACgB,UAAU,CACtB,KAA+B,EAC/B,IAAa;IAEb,IAAI,IAAI,KAAK,SAAS,EAAE;QACpB,OAAO,IAAI,CAAC;KACf;IAED,IAAI,IAAI,GAAG,YAAY,EAAE;QACrB,OAAU,IAAI,SAAI,KAAK,CAAC,CAAC,CAAG,CAAC;KAChC;IAED,IAAI,IAAI,GAAG,YAAY,EAAE;QACrB,OAAU,CAAC,IAAI,GAAG,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,SAAI,KAAK,CAAC,CAAC,CAAG,CAAC;KAC5D;IAED,OAAU,KAAK,CAAC,IAAI,GAAG,YAAY,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,SAAI,KAAK,CAAC,CAAC,CAAG,CAAC;AAClF,CAAC;IAEY,aAAa,GAAG;;AC5B7B;;;AAGA;SACgB,cAAc,CAAC,MAAc;IACzC,OAAO,MAAM;SACR,WAAW,EAAE;SACb,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,UAAA,MAAM,IAAI,OAAA,MAAM,CAAC,IAAI,EAAE,GAAA,CAAC,CAAC;AACtC,CAAC;IAEY,iBAAiB,GAAG;;ACXjC;;;;;;"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @deprecated: use {@link tuiStringHashToHsl} instead
|
|
2
3
|
* Converts a string to an HSL color
|
|
3
4
|
* @param value string to convert
|
|
4
5
|
* @return HSL color string
|
|
5
6
|
*/
|
|
6
7
|
// @bad TODO: convert stringHashToHsl to stringHashToRgb
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
9
|
function stringHashToHsl(value) {
|
|
8
10
|
if (value === '') {
|
|
9
11
|
return '';
|
|
@@ -18,10 +20,11 @@ function stringHashToHsl(value) {
|
|
|
18
20
|
var lightness = 80 + (hash % 5);
|
|
19
21
|
return "hsl(" + hue + "," + saturation + "%," + lightness + "%)";
|
|
20
22
|
}
|
|
23
|
+
var tuiStringHashToHsl = stringHashToHsl;
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
26
|
* Generated bundle index. Do not edit.
|
|
24
27
|
*/
|
|
25
28
|
|
|
26
|
-
export { stringHashToHsl };
|
|
29
|
+
export { stringHashToHsl, tuiStringHashToHsl };
|
|
27
30
|
//# sourceMappingURL=taiga-ui-kit-utils-format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-utils-format.js","sources":["ng://@taiga-ui/kit/utils/format/string-hash-to-hsl.ts","ng://@taiga-ui/kit/utils/format/taiga-ui-kit-utils-format.ts"],"sourcesContent":["/**\n * Converts a string to an HSL color\n * @param value string to convert\n * @return HSL color string\n */\n// @bad TODO: convert stringHashToHsl to stringHashToRgb\nexport function stringHashToHsl(value: string): string {\n if (value === '') {\n return '';\n }\n\n let hash = 0;\n\n for (let i = 0; i < value.length; i++) {\n hash = value.charCodeAt(i) + ((hash << 5) - hash);\n hash = hash & hash;\n }\n\n const hue = hash % 360;\n const saturation = 60 + (hash % 5);\n const lightness = 80 + (hash % 5);\n\n return `hsl(${hue},${saturation}%,${lightness}%)`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-utils-format.js","sources":["ng://@taiga-ui/kit/utils/format/string-hash-to-hsl.ts","ng://@taiga-ui/kit/utils/format/taiga-ui-kit-utils-format.ts"],"sourcesContent":["/**\n * @deprecated: use {@link tuiStringHashToHsl} instead\n * Converts a string to an HSL color\n * @param value string to convert\n * @return HSL color string\n */\n// @bad TODO: convert stringHashToHsl to stringHashToRgb\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function stringHashToHsl(value: string): string {\n if (value === '') {\n return '';\n }\n\n let hash = 0;\n\n for (let i = 0; i < value.length; i++) {\n hash = value.charCodeAt(i) + ((hash << 5) - hash);\n hash = hash & hash;\n }\n\n const hue = hash % 360;\n const saturation = 60 + (hash % 5);\n const lightness = 80 + (hash % 5);\n\n return `hsl(${hue},${saturation}%,${lightness}%)`;\n}\n\nexport const tuiStringHashToHsl = stringHashToHsl;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;;;;;AAMA;AACA;SACgB,eAAe,CAAC,KAAa;IACzC,IAAI,KAAK,KAAK,EAAE,EAAE;QACd,OAAO,EAAE,CAAC;KACb;IAED,IAAI,IAAI,GAAG,CAAC,CAAC;IAEb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;QAClD,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;KACtB;IAED,IAAM,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC;IACvB,IAAM,UAAU,GAAG,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC;IACnC,IAAM,SAAS,GAAG,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC;IAElC,OAAO,SAAO,GAAG,SAAI,UAAU,UAAK,SAAS,OAAI,CAAC;AACtD,CAAC;IAEY,kBAAkB,GAAG;;AC3BlC;;;;;;"}
|
|
@@ -3,6 +3,10 @@ import { __assign, __read, __spread } from 'tslib';
|
|
|
3
3
|
import { MAX_TIME_VALUES, DATE_TIME_SEPARATOR } from '@taiga-ui/kit/constants';
|
|
4
4
|
import { TUI_DIGIT_REGEXP } from '@taiga-ui/core';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated: use {@link tuiNormalizeDateValue} instead
|
|
8
|
+
*/
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
6
10
|
function normalizeDateValue(dateValue, _a) {
|
|
7
11
|
var value = _a.value, min = _a.min, max = _a.max, dateFormat = _a.dateFormat, dateSeparator = _a.dateSeparator;
|
|
8
12
|
return value && value.toString(dateFormat, dateSeparator) === dateValue
|
|
@@ -21,6 +25,7 @@ function tuiCreateAutoCorrectedDatePipe(config) {
|
|
|
21
25
|
};
|
|
22
26
|
};
|
|
23
27
|
}
|
|
28
|
+
var tuiNormalizeDateValue = normalizeDateValue;
|
|
24
29
|
|
|
25
30
|
function parseWithLimit(value, config) {
|
|
26
31
|
return TuiDay.normalizeParse(value.slice(0, DATE_FILLER_LENGTH), config.dateFormat).dayLimit(config.min, config.max);
|
|
@@ -160,5 +165,5 @@ function tuiCreateTimeMask(mode, maxValues) {
|
|
|
160
165
|
* Generated bundle index. Do not edit.
|
|
161
166
|
*/
|
|
162
167
|
|
|
163
|
-
export { normalizeDateValue, tuiCreateAutoCorrectedDatePipe, tuiCreateAutoCorrectedDateRangePipe, tuiCreateAutoCorrectedDateTimePipe, tuiCreateAutoCorrectedTimePipe, tuiCreateDateMask, tuiCreateDateRangeMask, tuiCreateTimeMask };
|
|
168
|
+
export { normalizeDateValue, tuiCreateAutoCorrectedDatePipe, tuiCreateAutoCorrectedDateRangePipe, tuiCreateAutoCorrectedDateTimePipe, tuiCreateAutoCorrectedTimePipe, tuiCreateDateMask, tuiCreateDateRangeMask, tuiCreateTimeMask, tuiNormalizeDateValue };
|
|
164
169
|
//# sourceMappingURL=taiga-ui-kit-utils-mask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-utils-mask.js","sources":["ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-range-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-time-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-time-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-date-mask.ts","ng://@taiga-ui/kit/utils/mask/create-date-range-mask.ts","ng://@taiga-ui/kit/utils/mask/create-time-mask.ts","ng://@taiga-ui/kit/utils/mask/taiga-ui-kit-utils-mask.ts"],"sourcesContent":["import {DATE_FILLER_LENGTH, TuiDateMode, TuiDay} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler, TuiWithOptionalMinMaxWithValue} from '@taiga-ui/core';\n\nexport interface TuiAutoCorrectedDatePipeConfigs\n extends TuiWithOptionalMinMaxWithValue<TuiDay | null, TuiDay> {\n dateFormat: TuiDateMode;\n dateSeparator: string;\n}\n\nexport function normalizeDateValue(\n dateValue: string,\n {value, min, max, dateFormat, dateSeparator}: TuiAutoCorrectedDatePipeConfigs,\n): string {\n return value && value.toString(dateFormat, dateSeparator) === dateValue\n ? dateValue\n : TuiDay.normalizeParse(dateValue, dateFormat)\n .dayLimit(min, max)\n .toString(dateFormat, dateSeparator);\n}\n\nexport function tuiCreateAutoCorrectedDatePipe(\n config: TuiAutoCorrectedDatePipeConfigs,\n): TuiTextMaskPipeHandler {\n return value => {\n if (value.length !== DATE_FILLER_LENGTH) {\n return {value};\n }\n\n return {\n value: normalizeDateValue(value, config),\n };\n };\n}\n","import {\n DATE_FILLER_LENGTH,\n DATE_RANGE_FILLER_LENGTH,\n RANGE_SEPARATOR_CHAR,\n TuiDateMode,\n TuiDay,\n TuiDayRange,\n} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler, TuiWithOptionalMinMaxWithValue} from '@taiga-ui/core';\n\ninterface TuiAutoCorrectedDatePipeConfigs\n extends TuiWithOptionalMinMaxWithValue<TuiDayRange | null, TuiDay> {\n dateFormat: TuiDateMode;\n dateSeparator: string;\n}\n\nfunction parseWithLimit(value: string, config: TuiAutoCorrectedDatePipeConfigs): TuiDay {\n return TuiDay.normalizeParse(\n value.slice(0, DATE_FILLER_LENGTH),\n config.dateFormat,\n ).dayLimit(config.min, config.max);\n}\n\nfunction processRawValue(value: string, config: TuiAutoCorrectedDatePipeConfigs): string {\n const {dateFormat, dateSeparator} = config;\n\n switch (value.length) {\n case DATE_FILLER_LENGTH:\n return parseWithLimit(value, config).toString(dateFormat, dateSeparator);\n case DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length:\n return (\n parseWithLimit(value, config).toString(dateFormat, dateSeparator) +\n RANGE_SEPARATOR_CHAR\n );\n case DATE_RANGE_FILLER_LENGTH:\n return config.value &&\n config.value.toString(dateFormat, dateSeparator) === value\n ? value\n : TuiDayRange.sort(\n parseWithLimit(value.slice(0, DATE_FILLER_LENGTH), config),\n parseWithLimit(\n value.slice(DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length),\n config,\n ),\n ).toString(dateFormat, dateSeparator);\n default:\n return value;\n }\n}\n\n/**\n * Normalizes date in formatted string\n *\n * Normalizes when:\n *\n * 1. It is a single date\n * 2. It is a single date and a separator\n * 3. It is two dates and a separator between them\n *\n * In **other** cases, the value does not change.\n *\n * @param config with min and max date\n * @return mask pipe handler that handles `min` and `max`\n */\nexport function tuiCreateAutoCorrectedDateRangePipe(\n config: TuiAutoCorrectedDatePipeConfigs,\n): TuiTextMaskPipeHandler {\n return value => ({value: processRawValue(value, config)});\n}\n","import {TuiTimeMode} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core';\nimport {MAX_TIME_VALUES} from '@taiga-ui/kit/constants';\nimport {TuiTimeFormatParts} from '@taiga-ui/kit/types';\n\n/**\n * Adjusts the entered time by omitting only suitable values for hours and minutes\n * @returns time as a string\n */\nexport function tuiCreateAutoCorrectedTimePipe(\n timeMode: TuiTimeMode = 'HH:MM',\n maxValues: Partial<Record<TuiTimeFormatParts, number>> = {},\n): TuiTextMaskPipeHandler {\n const timeFormatArray = ['HH', 'MM', 'SS', 'MS'] as const;\n const safeValues = {\n ...MAX_TIME_VALUES,\n ...maxValues,\n };\n\n return conformedValue => {\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split('');\n\n timeFormatArray.forEach(format => {\n const position = timeMode.indexOf(format);\n const maxFirstDigit = parseInt(String(safeValues[format]).slice(0, 1), 10);\n\n if (parseInt(conformedValueArr[position], 10) > maxFirstDigit) {\n conformedValueArr[position + 1] = conformedValueArr[position];\n conformedValueArr[position] = '0';\n indexesOfPipedChars.push(position);\n }\n });\n\n const isInvalid = timeFormatArray.some(\n format =>\n parseInt(conformedValue.slice(timeMode.indexOf(format), 2), 10) >\n safeValues[format],\n );\n\n return isInvalid\n ? false\n : {\n value: conformedValueArr.join(''),\n indexesOfPipedChars,\n };\n };\n}\n","import {DATE_FILLER_LENGTH, TuiTimeMode} from '@taiga-ui/cdk';\nimport {\n TuiTextMaskConfig,\n TuiTextMaskOptions,\n TuiTextMaskPipeHandler,\n} from '@taiga-ui/core';\nimport {DATE_TIME_SEPARATOR} from '@taiga-ui/kit/constants';\n\nimport {\n normalizeDateValue,\n TuiAutoCorrectedDatePipeConfigs,\n} from './create-auto-corrected-date-pipe';\nimport {tuiCreateAutoCorrectedTimePipe} from './create-auto-corrected-time-pipe';\n\ninterface TuiAutoCorrectedDateTimePipeConfigs extends TuiAutoCorrectedDatePipeConfigs {\n timeMode: TuiTimeMode;\n}\n\nexport function tuiCreateAutoCorrectedDateTimePipe(\n configs: TuiAutoCorrectedDateTimePipeConfigs,\n): TuiTextMaskPipeHandler {\n const timePipe = tuiCreateAutoCorrectedTimePipe(configs.timeMode);\n\n return value => {\n if (value.length < DATE_FILLER_LENGTH) {\n return {value};\n }\n\n const [date, time] = value.split(DATE_TIME_SEPARATOR);\n\n const formattedDate = normalizeDateValue(date, configs);\n\n if (!time) {\n return {value: formattedDate};\n }\n\n const pipedTime = timePipe(\n time,\n {} as unknown as TuiTextMaskOptions & TuiTextMaskConfig,\n );\n\n if (!pipedTime || typeof pipedTime === 'string') {\n return false;\n }\n\n return {\n value: `${formattedDate}${DATE_TIME_SEPARATOR}${pipedTime.value}`,\n indexesOfPipedChars: pipedTime.indexesOfPipedChars\n ? pipedTime.indexesOfPipedChars.map(i => i + date.length + 2)\n : undefined,\n };\n };\n}\n","import {tuiAssert, TuiDateMode} from '@taiga-ui/cdk';\nimport {TUI_DIGIT_REGEXP, TuiTextMaskList} from '@taiga-ui/core';\n\nconst TWO_DIGITS = new Array(2).fill(TUI_DIGIT_REGEXP);\nconst FOUR_DIGITS = new Array(4).fill(TUI_DIGIT_REGEXP);\n\nexport function tuiCreateDateMask(mode: TuiDateMode, separator: string): TuiTextMaskList {\n tuiAssert.assert(separator.length === 1, 'Separator should consist of only 1 symbol');\n\n switch (mode) {\n case 'YMD':\n return [...FOUR_DIGITS, separator, ...TWO_DIGITS, separator, ...TWO_DIGITS];\n case 'MDY':\n case 'DMY':\n default:\n return [...TWO_DIGITS, separator, ...TWO_DIGITS, separator, ...FOUR_DIGITS];\n }\n}\n","import {CHAR_EN_DASH, CHAR_NO_BREAK_SPACE, tuiAssert, TuiDateMode} from '@taiga-ui/cdk';\nimport {TuiTextMaskList} from '@taiga-ui/core';\n\nimport {tuiCreateDateMask} from './create-date-mask';\n\nexport function tuiCreateDateRangeMask(\n dateMode: TuiDateMode,\n dateSeparator: string,\n): TuiTextMaskList {\n tuiAssert.assert(\n dateSeparator.length === 1,\n 'Separator should consist of only 1 symbol',\n );\n\n const dateMask = tuiCreateDateMask(dateMode, dateSeparator);\n\n return [\n ...dateMask,\n CHAR_NO_BREAK_SPACE,\n CHAR_EN_DASH,\n CHAR_NO_BREAK_SPACE,\n ...dateMask,\n ];\n}\n","import {TuiTimeMode} from '@taiga-ui/cdk';\nimport {TUI_DIGIT_REGEXP, TuiTextMaskList} from '@taiga-ui/core';\nimport {MAX_TIME_VALUES} from '@taiga-ui/kit/constants';\nimport {TuiTimeFormatParts} from '@taiga-ui/kit/types';\n\nfunction tuiCreateTimePartMask(\n maxPartValue: number,\n prefix?: string,\n): Array<string | RegExp> {\n const {length} = String(maxPartValue);\n const regExp = new Array(length).fill(TUI_DIGIT_REGEXP);\n\n if (prefix) {\n regExp.unshift(prefix);\n }\n\n return regExp;\n}\n\nexport function tuiCreateTimeMask(\n mode: TuiTimeMode,\n maxValues: Partial<Record<TuiTimeFormatParts, number>> = {},\n): TuiTextMaskList {\n const {HH, MM, SS, MS} = {\n ...MAX_TIME_VALUES,\n ...maxValues,\n };\n\n return [\n ...tuiCreateTimePartMask(HH),\n ...tuiCreateTimePartMask(MM, ':'),\n ...(mode.includes('HH:MM:SS') ? tuiCreateTimePartMask(SS, ':') : []),\n ...(mode === 'HH:MM:SS.MSS' ? tuiCreateTimePartMask(MS, '.') : []),\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;SASgB,kBAAkB,CAC9B,SAAiB,EACjB,EAA6E;QAA5E,gBAAK,EAAE,YAAG,EAAE,YAAG,EAAE,0BAAU,EAAE,gCAAa;IAE3C,OAAO,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,KAAK,SAAS;UACjE,SAAS;UACT,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,UAAU,CAAC;aACvC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;aAClB,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACnD,CAAC;SAEe,8BAA8B,CAC1C,MAAuC;IAEvC,OAAO,UAAA,KAAK;QACR,IAAI,KAAK,CAAC,MAAM,KAAK,kBAAkB,EAAE;YACrC,OAAO,EAAC,KAAK,OAAA,EAAC,CAAC;SAClB;QAED,OAAO;YACH,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC;SAC3C,CAAC;KACL,CAAC;AACN;;AChBA,SAAS,cAAc,CAAC,KAAa,EAAE,MAAuC;IAC1E,OAAO,MAAM,CAAC,cAAc,CACxB,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,EAClC,MAAM,CAAC,UAAU,CACpB,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,eAAe,CAAC,KAAa,EAAE,MAAuC;IACpE,IA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,GAAK,WAAW,EAAE;KACnF;AACL;;SCZgB,sBAAsB,CAClC,QAAqB,EACrB,aAAqB;IAErB,SAAS,CAAC,MAAM,CACZ,aAAa,CAAC,MAAM,KAAK,CAAC,EAC1B,2CAA2C,CAC9C,CAAC;IAEF,IAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAE5D,gBACO,QAAQ;QACX,mBAAmB;QACnB,YAAY;QACZ,mBAAmB;OAChB,QAAQ,EACb;AACN;;AClBA,SAAS,qBAAqB,CAC1B,YAAoB,EACpB,MAAe;IAER,IAAA,oCAAM,CAAyB;IACtC,IAAM,MAAM,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAExD,IAAI,MAAM,EAAE;QACR,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;KAC1B;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;SAEe,iBAAiB,CAC7B,IAAiB,EACjB,SAA2D;IAA3D,0BAAA,EAAA,cAA2D;IAErD,IAAA,uDAGL,EAHM,UAAE,EAAE,UAAE,EAAE,UAAE,EAAE,UAGlB,CAAC;IAEF,gBACO,qBAAqB,CAAC,EAAE,CAAC,EACzB,qBAAqB,CAAC,EAAE,EAAE,GAAG,CAAC,GAC7B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,qBAAqB,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAC/D,IAAI,KAAK,cAAc,GAAG,qBAAqB,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,GACnE;AACN;;AClCA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-utils-mask.js","sources":["ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-range-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-time-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-auto-corrected-date-time-pipe.ts","ng://@taiga-ui/kit/utils/mask/create-date-mask.ts","ng://@taiga-ui/kit/utils/mask/create-date-range-mask.ts","ng://@taiga-ui/kit/utils/mask/create-time-mask.ts","ng://@taiga-ui/kit/utils/mask/taiga-ui-kit-utils-mask.ts"],"sourcesContent":["import {DATE_FILLER_LENGTH, TuiDateMode, TuiDay} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler, TuiWithOptionalMinMaxWithValue} from '@taiga-ui/core';\n\nexport interface TuiAutoCorrectedDatePipeConfigs\n extends TuiWithOptionalMinMaxWithValue<TuiDay | null, TuiDay> {\n dateFormat: TuiDateMode;\n dateSeparator: string;\n}\n\n/**\n * @deprecated: use {@link tuiNormalizeDateValue} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function normalizeDateValue(\n dateValue: string,\n {value, min, max, dateFormat, dateSeparator}: TuiAutoCorrectedDatePipeConfigs,\n): string {\n return value && value.toString(dateFormat, dateSeparator) === dateValue\n ? dateValue\n : TuiDay.normalizeParse(dateValue, dateFormat)\n .dayLimit(min, max)\n .toString(dateFormat, dateSeparator);\n}\n\nexport function tuiCreateAutoCorrectedDatePipe(\n config: TuiAutoCorrectedDatePipeConfigs,\n): TuiTextMaskPipeHandler {\n return value => {\n if (value.length !== DATE_FILLER_LENGTH) {\n return {value};\n }\n\n return {\n value: normalizeDateValue(value, config),\n };\n };\n}\n\nexport const tuiNormalizeDateValue = normalizeDateValue;\n","import {\n DATE_FILLER_LENGTH,\n DATE_RANGE_FILLER_LENGTH,\n RANGE_SEPARATOR_CHAR,\n TuiDateMode,\n TuiDay,\n TuiDayRange,\n} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler, TuiWithOptionalMinMaxWithValue} from '@taiga-ui/core';\n\ninterface TuiAutoCorrectedDatePipeConfigs\n extends TuiWithOptionalMinMaxWithValue<TuiDayRange | null, TuiDay> {\n dateFormat: TuiDateMode;\n dateSeparator: string;\n}\n\nfunction parseWithLimit(value: string, config: TuiAutoCorrectedDatePipeConfigs): TuiDay {\n return TuiDay.normalizeParse(\n value.slice(0, DATE_FILLER_LENGTH),\n config.dateFormat,\n ).dayLimit(config.min, config.max);\n}\n\nfunction processRawValue(value: string, config: TuiAutoCorrectedDatePipeConfigs): string {\n const {dateFormat, dateSeparator} = config;\n\n switch (value.length) {\n case DATE_FILLER_LENGTH:\n return parseWithLimit(value, config).toString(dateFormat, dateSeparator);\n case DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length:\n return (\n parseWithLimit(value, config).toString(dateFormat, dateSeparator) +\n RANGE_SEPARATOR_CHAR\n );\n case DATE_RANGE_FILLER_LENGTH:\n return config.value &&\n config.value.toString(dateFormat, dateSeparator) === value\n ? value\n : TuiDayRange.sort(\n parseWithLimit(value.slice(0, DATE_FILLER_LENGTH), config),\n parseWithLimit(\n value.slice(DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length),\n config,\n ),\n ).toString(dateFormat, dateSeparator);\n default:\n return value;\n }\n}\n\n/**\n * Normalizes date in formatted string\n *\n * Normalizes when:\n *\n * 1. It is a single date\n * 2. It is a single date and a separator\n * 3. It is two dates and a separator between them\n *\n * In **other** cases, the value does not change.\n *\n * @param config with min and max date\n * @return mask pipe handler that handles `min` and `max`\n */\nexport function tuiCreateAutoCorrectedDateRangePipe(\n config: TuiAutoCorrectedDatePipeConfigs,\n): TuiTextMaskPipeHandler {\n return value => ({value: processRawValue(value, config)});\n}\n","import {TuiTimeMode} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core';\nimport {MAX_TIME_VALUES} from '@taiga-ui/kit/constants';\nimport {TuiTimeFormatParts} from '@taiga-ui/kit/types';\n\n/**\n * Adjusts the entered time by omitting only suitable values for hours and minutes\n * @returns time as a string\n */\nexport function tuiCreateAutoCorrectedTimePipe(\n timeMode: TuiTimeMode = 'HH:MM',\n maxValues: Partial<Record<TuiTimeFormatParts, number>> = {},\n): TuiTextMaskPipeHandler {\n const timeFormatArray = ['HH', 'MM', 'SS', 'MS'] as const;\n const safeValues = {\n ...MAX_TIME_VALUES,\n ...maxValues,\n };\n\n return conformedValue => {\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split('');\n\n timeFormatArray.forEach(format => {\n const position = timeMode.indexOf(format);\n const maxFirstDigit = parseInt(String(safeValues[format]).slice(0, 1), 10);\n\n if (parseInt(conformedValueArr[position], 10) > maxFirstDigit) {\n conformedValueArr[position + 1] = conformedValueArr[position];\n conformedValueArr[position] = '0';\n indexesOfPipedChars.push(position);\n }\n });\n\n const isInvalid = timeFormatArray.some(\n format =>\n parseInt(conformedValue.slice(timeMode.indexOf(format), 2), 10) >\n safeValues[format],\n );\n\n return isInvalid\n ? false\n : {\n value: conformedValueArr.join(''),\n indexesOfPipedChars,\n };\n };\n}\n","import {DATE_FILLER_LENGTH, TuiTimeMode} from '@taiga-ui/cdk';\nimport {\n TuiTextMaskConfig,\n TuiTextMaskOptions,\n TuiTextMaskPipeHandler,\n} from '@taiga-ui/core';\nimport {DATE_TIME_SEPARATOR} from '@taiga-ui/kit/constants';\n\nimport {\n normalizeDateValue,\n TuiAutoCorrectedDatePipeConfigs,\n} from './create-auto-corrected-date-pipe';\nimport {tuiCreateAutoCorrectedTimePipe} from './create-auto-corrected-time-pipe';\n\ninterface TuiAutoCorrectedDateTimePipeConfigs extends TuiAutoCorrectedDatePipeConfigs {\n timeMode: TuiTimeMode;\n}\n\nexport function tuiCreateAutoCorrectedDateTimePipe(\n configs: TuiAutoCorrectedDateTimePipeConfigs,\n): TuiTextMaskPipeHandler {\n const timePipe = tuiCreateAutoCorrectedTimePipe(configs.timeMode);\n\n return value => {\n if (value.length < DATE_FILLER_LENGTH) {\n return {value};\n }\n\n const [date, time] = value.split(DATE_TIME_SEPARATOR);\n\n const formattedDate = normalizeDateValue(date, configs);\n\n if (!time) {\n return {value: formattedDate};\n }\n\n const pipedTime = timePipe(\n time,\n {} as unknown as TuiTextMaskOptions & TuiTextMaskConfig,\n );\n\n if (!pipedTime || typeof pipedTime === 'string') {\n return false;\n }\n\n return {\n value: `${formattedDate}${DATE_TIME_SEPARATOR}${pipedTime.value}`,\n indexesOfPipedChars: pipedTime.indexesOfPipedChars\n ? pipedTime.indexesOfPipedChars.map(i => i + date.length + 2)\n : undefined,\n };\n };\n}\n","import {tuiAssert, TuiDateMode} from '@taiga-ui/cdk';\nimport {TUI_DIGIT_REGEXP, TuiTextMaskList} from '@taiga-ui/core';\n\nconst TWO_DIGITS = new Array(2).fill(TUI_DIGIT_REGEXP);\nconst FOUR_DIGITS = new Array(4).fill(TUI_DIGIT_REGEXP);\n\nexport function tuiCreateDateMask(mode: TuiDateMode, separator: string): TuiTextMaskList {\n tuiAssert.assert(separator.length === 1, 'Separator should consist of only 1 symbol');\n\n switch (mode) {\n case 'YMD':\n return [...FOUR_DIGITS, separator, ...TWO_DIGITS, separator, ...TWO_DIGITS];\n case 'MDY':\n case 'DMY':\n default:\n return [...TWO_DIGITS, separator, ...TWO_DIGITS, separator, ...FOUR_DIGITS];\n }\n}\n","import {CHAR_EN_DASH, CHAR_NO_BREAK_SPACE, tuiAssert, TuiDateMode} from '@taiga-ui/cdk';\nimport {TuiTextMaskList} from '@taiga-ui/core';\n\nimport {tuiCreateDateMask} from './create-date-mask';\n\nexport function tuiCreateDateRangeMask(\n dateMode: TuiDateMode,\n dateSeparator: string,\n): TuiTextMaskList {\n tuiAssert.assert(\n dateSeparator.length === 1,\n 'Separator should consist of only 1 symbol',\n );\n\n const dateMask = tuiCreateDateMask(dateMode, dateSeparator);\n\n return [\n ...dateMask,\n CHAR_NO_BREAK_SPACE,\n CHAR_EN_DASH,\n CHAR_NO_BREAK_SPACE,\n ...dateMask,\n ];\n}\n","import {TuiTimeMode} from '@taiga-ui/cdk';\nimport {TUI_DIGIT_REGEXP, TuiTextMaskList} from '@taiga-ui/core';\nimport {MAX_TIME_VALUES} from '@taiga-ui/kit/constants';\nimport {TuiTimeFormatParts} from '@taiga-ui/kit/types';\n\nfunction tuiCreateTimePartMask(\n maxPartValue: number,\n prefix?: string,\n): Array<string | RegExp> {\n const {length} = String(maxPartValue);\n const regExp = new Array(length).fill(TUI_DIGIT_REGEXP);\n\n if (prefix) {\n regExp.unshift(prefix);\n }\n\n return regExp;\n}\n\nexport function tuiCreateTimeMask(\n mode: TuiTimeMode,\n maxValues: Partial<Record<TuiTimeFormatParts, number>> = {},\n): TuiTextMaskList {\n const {HH, MM, SS, MS} = {\n ...MAX_TIME_VALUES,\n ...maxValues,\n };\n\n return [\n ...tuiCreateTimePartMask(HH),\n ...tuiCreateTimePartMask(MM, ':'),\n ...(mode.includes('HH:MM:SS') ? tuiCreateTimePartMask(SS, ':') : []),\n ...(mode === 'HH:MM:SS.MSS' ? tuiCreateTimePartMask(MS, '.') : []),\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AASA;;;AAGA;SACgB,kBAAkB,CAC9B,SAAiB,EACjB,EAA6E;QAA5E,gBAAK,EAAE,YAAG,EAAE,YAAG,EAAE,0BAAU,EAAE,gCAAa;IAE3C,OAAO,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,KAAK,SAAS;UACjE,SAAS;UACT,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,UAAU,CAAC;aACvC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;aAClB,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACnD,CAAC;SAEe,8BAA8B,CAC1C,MAAuC;IAEvC,OAAO,UAAA,KAAK;QACR,IAAI,KAAK,CAAC,MAAM,KAAK,kBAAkB,EAAE;YACrC,OAAO,EAAC,KAAK,OAAA,EAAC,CAAC;SAClB;QAED,OAAO;YACH,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC;SAC3C,CAAC;KACL,CAAC;AACN,CAAC;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,GAAG,EAAE,IAC/D,IAAI,KAAK,cAAc,GAAG,qBAAqB,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,GACnE;AACN;;AClCA;;;;;;"}
|
|
@@ -5,7 +5,7 @@ import { TUI_FLOATING_PRECISION } from '@taiga-ui/kit/constants';
|
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
function
|
|
8
|
+
function tuiHorizontalDirectionToNumber(direction) {
|
|
9
9
|
switch (direction) {
|
|
10
10
|
case 'left':
|
|
11
11
|
return -1;
|
|
@@ -45,5 +45,5 @@ function tuiCheckKeyStepsHaveMinMaxPercents(steps) {
|
|
|
45
45
|
* Generated bundle index. Do not edit.
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
|
-
export {
|
|
48
|
+
export { tuiCheckKeyStepsHaveMinMaxPercents, tuiHorizontalDirectionToNumber, tuiKeyStepValueToPercentage, tuiPercentageToKeyStepValue };
|
|
49
49
|
//# sourceMappingURL=taiga-ui-kit-utils-math.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-utils-math.js","sources":["ng://@taiga-ui/kit/utils/math/horizontal-direction-to-number.ts","ng://@taiga-ui/kit/utils/math/key-steps.ts","ng://@taiga-ui/kit/utils/math/taiga-ui-kit-utils-math.ts"],"sourcesContent":["import {TuiHorizontalDirection} from '@taiga-ui/core';\n\n/**\n * @internal\n */\nexport function
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-utils-math.js","sources":["ng://@taiga-ui/kit/utils/math/horizontal-direction-to-number.ts","ng://@taiga-ui/kit/utils/math/key-steps.ts","ng://@taiga-ui/kit/utils/math/taiga-ui-kit-utils-math.ts"],"sourcesContent":["import {TuiHorizontalDirection} from '@taiga-ui/core';\n\n/**\n * @internal\n */\nexport function tuiHorizontalDirectionToNumber(\n direction: TuiHorizontalDirection,\n): -1 | 1 {\n switch (direction) {\n case 'left':\n return -1;\n case 'right':\n return 1;\n }\n}\n","import {round} from '@taiga-ui/cdk';\nimport {TUI_FLOATING_PRECISION} from '@taiga-ui/kit/constants';\nimport {TuiKeySteps} from '@taiga-ui/kit/types';\n\nfunction tuiFindKeyStepsBoundariesByFn(\n keySteps: TuiKeySteps,\n fn: ([keyStepPercent, keyStepValue]: [number, number]) => boolean,\n): [[number, number], [number, number]] {\n const keyStepUpperIndex = keySteps.findIndex((keyStep, i) => i && fn(keyStep));\n const lowerStep = keySteps[keyStepUpperIndex - 1];\n const upperStep = keySteps[keyStepUpperIndex];\n\n return [lowerStep, upperStep];\n}\n\nexport function tuiPercentageToKeyStepValue(\n valuePercentage: number,\n keySteps: TuiKeySteps,\n): number {\n const [[lowerStepPercent, lowerStepValue], [upperStepPercent, upperStepValue]] =\n tuiFindKeyStepsBoundariesByFn(\n keySteps,\n ([keyStepPercentage, _]) => valuePercentage <= keyStepPercentage,\n );\n const ratio =\n (valuePercentage - lowerStepPercent) / (upperStepPercent - lowerStepPercent);\n const controlValue = (upperStepValue - lowerStepValue) * ratio + lowerStepValue;\n\n return round(controlValue, TUI_FLOATING_PRECISION);\n}\n\nexport function tuiKeyStepValueToPercentage(\n value: number,\n keySteps: TuiKeySteps,\n): number {\n const [[lowerStepPercent, lowerStepValue], [upperStepPercent, upperStepValue]] =\n tuiFindKeyStepsBoundariesByFn(\n keySteps,\n ([_, keyStepValue]) => value <= keyStepValue,\n );\n const ratio = (value - lowerStepValue) / (upperStepValue - lowerStepValue) || 0;\n\n return (upperStepPercent - lowerStepPercent) * ratio + lowerStepPercent;\n}\n\nexport function tuiCheckKeyStepsHaveMinMaxPercents(steps: TuiKeySteps): boolean {\n return !steps.length || (steps[0][0] === 0 && steps[steps.length - 1][0] === 100);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAEA;;;SAGgB,8BAA8B,CAC1C,SAAiC;IAEjC,QAAQ,SAAS;QACb,KAAK,MAAM;YACP,OAAO,CAAC,CAAC,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,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;AACtF;;AC/CA;;;;;;"}
|
|
@@ -45,16 +45,24 @@ function tuiCreateTimePeriods(minHour, maxHour, minutes) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
+
* @deprecated: use {@link tuiGetPrecision} instead
|
|
48
49
|
* @return fractional length
|
|
49
50
|
*/
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
50
52
|
function getPrecision(num) {
|
|
51
53
|
var _a = __read(String(num).split('.'), 2), _b = _a[1], fractionPart = _b === void 0 ? '' : _b;
|
|
52
54
|
return fractionPart.length;
|
|
53
55
|
}
|
|
56
|
+
var tuiGetPrecision = getPrecision;
|
|
54
57
|
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated: use {@link tuiIsFlat} instead
|
|
60
|
+
*/
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
55
62
|
function isFlat(items) {
|
|
56
63
|
return !Array.isArray(items[0]);
|
|
57
64
|
}
|
|
65
|
+
var tuiIsFlat = isFlat;
|
|
58
66
|
|
|
59
67
|
/**
|
|
60
68
|
* @internal
|
|
@@ -76,5 +84,5 @@ var tuiReplayControlValueChangesFactory = TuiReplayControlValueChangesFactory;
|
|
|
76
84
|
* Generated bundle index. Do not edit.
|
|
77
85
|
*/
|
|
78
86
|
|
|
79
|
-
export { TuiReplayControlValueChangesFactory, getPrecision, isFlat, tuiCreateDefaultDayRangePeriods, tuiCreateTimePeriods, tuiReplayControlValueChangesFactory };
|
|
87
|
+
export { TuiReplayControlValueChangesFactory, getPrecision, isFlat, tuiCreateDefaultDayRangePeriods, tuiCreateTimePeriods, tuiGetPrecision, tuiIsFlat, tuiReplayControlValueChangesFactory };
|
|
80
88
|
//# sourceMappingURL=taiga-ui-kit-utils-miscellaneous.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-utils-miscellaneous.js","sources":["ng://@taiga-ui/kit/utils/miscellaneous/create-default-day-range-periods.ts","ng://@taiga-ui/kit/utils/miscellaneous/create-time-periods.ts","ng://@taiga-ui/kit/utils/miscellaneous/get-precision.ts","ng://@taiga-ui/kit/utils/miscellaneous/is-flat.ts","ng://@taiga-ui/kit/utils/miscellaneous/replay-control-value-changes-factory.ts","ng://@taiga-ui/kit/utils/miscellaneous/taiga-ui-kit-utils-miscellaneous.ts"],"sourcesContent":["import {TUI_FIRST_DAY, TuiDay, TuiDayRange} from '@taiga-ui/cdk';\nimport {TuiDayRangePeriod} from '@taiga-ui/kit/classes';\n\nexport function tuiCreateDefaultDayRangePeriods(\n periodTitles: [string, string, string, string, string, string] = [\n 'For all the time',\n 'Today',\n 'Yesterday',\n 'Current week',\n 'Current month',\n 'Previous month',\n ],\n): readonly TuiDayRangePeriod[] {\n const today = TuiDay.currentLocal();\n const yesterday = today.append({day: -1});\n const startOfWeek = today.append({day: -today.dayOfWeek()});\n const endOfWeek = startOfWeek.append({day: 6});\n const startOfMonth = today.append({day: 1 - today.day});\n const endOfMonth = startOfMonth.append({month: 1, day: -1});\n const startOfLastMonth = startOfMonth.append({month: -1});\n\n return [\n new TuiDayRangePeriod(new TuiDayRange(TUI_FIRST_DAY, today), periodTitles[0]),\n new TuiDayRangePeriod(new TuiDayRange(today, today), periodTitles[1]),\n new TuiDayRangePeriod(new TuiDayRange(yesterday, yesterday), periodTitles[2]),\n new TuiDayRangePeriod(new TuiDayRange(startOfWeek, endOfWeek), periodTitles[3]),\n new TuiDayRangePeriod(new TuiDayRange(startOfMonth, endOfMonth), periodTitles[4]),\n new TuiDayRangePeriod(\n new TuiDayRange(startOfLastMonth, startOfMonth.append({day: -1})),\n periodTitles[5],\n ),\n ];\n}\n","import {HOURS_IN_DAY, TuiTime} from '@taiga-ui/cdk';\n\nexport function tuiCreateTimePeriods(\n minHour: number = 0,\n maxHour: number = HOURS_IN_DAY,\n minutes: readonly number[] = [0, 30],\n): readonly TuiTime[] {\n const timeArray: TuiTime[] = [];\n\n for (let i = minHour; i < maxHour; i++) {\n for (let j = 0; j < minutes.length; j++) {\n const time = new TuiTime(i, minutes[j]);\n\n timeArray.push(time);\n }\n }\n\n return timeArray;\n}\n","/**\n * @return fractional length\n */\nexport function getPrecision(num: number): number {\n const [, fractionPart = ''] = String(num).split('.');\n\n return fractionPart.length;\n}\n","
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-utils-miscellaneous.js","sources":["ng://@taiga-ui/kit/utils/miscellaneous/create-default-day-range-periods.ts","ng://@taiga-ui/kit/utils/miscellaneous/create-time-periods.ts","ng://@taiga-ui/kit/utils/miscellaneous/get-precision.ts","ng://@taiga-ui/kit/utils/miscellaneous/is-flat.ts","ng://@taiga-ui/kit/utils/miscellaneous/replay-control-value-changes-factory.ts","ng://@taiga-ui/kit/utils/miscellaneous/taiga-ui-kit-utils-miscellaneous.ts"],"sourcesContent":["import {TUI_FIRST_DAY, TuiDay, TuiDayRange} from '@taiga-ui/cdk';\nimport {TuiDayRangePeriod} from '@taiga-ui/kit/classes';\n\nexport function tuiCreateDefaultDayRangePeriods(\n periodTitles: [string, string, string, string, string, string] = [\n 'For all the time',\n 'Today',\n 'Yesterday',\n 'Current week',\n 'Current month',\n 'Previous month',\n ],\n): readonly TuiDayRangePeriod[] {\n const today = TuiDay.currentLocal();\n const yesterday = today.append({day: -1});\n const startOfWeek = today.append({day: -today.dayOfWeek()});\n const endOfWeek = startOfWeek.append({day: 6});\n const startOfMonth = today.append({day: 1 - today.day});\n const endOfMonth = startOfMonth.append({month: 1, day: -1});\n const startOfLastMonth = startOfMonth.append({month: -1});\n\n return [\n new TuiDayRangePeriod(new TuiDayRange(TUI_FIRST_DAY, today), periodTitles[0]),\n new TuiDayRangePeriod(new TuiDayRange(today, today), periodTitles[1]),\n new TuiDayRangePeriod(new TuiDayRange(yesterday, yesterday), periodTitles[2]),\n new TuiDayRangePeriod(new TuiDayRange(startOfWeek, endOfWeek), periodTitles[3]),\n new TuiDayRangePeriod(new TuiDayRange(startOfMonth, endOfMonth), periodTitles[4]),\n new TuiDayRangePeriod(\n new TuiDayRange(startOfLastMonth, startOfMonth.append({day: -1})),\n periodTitles[5],\n ),\n ];\n}\n","import {HOURS_IN_DAY, TuiTime} from '@taiga-ui/cdk';\n\nexport function tuiCreateTimePeriods(\n minHour: number = 0,\n maxHour: number = HOURS_IN_DAY,\n minutes: readonly number[] = [0, 30],\n): readonly TuiTime[] {\n const timeArray: TuiTime[] = [];\n\n for (let i = minHour; i < maxHour; i++) {\n for (let j = 0; j < minutes.length; j++) {\n const time = new TuiTime(i, minutes[j]);\n\n timeArray.push(time);\n }\n }\n\n return timeArray;\n}\n","/**\n * @deprecated: use {@link tuiGetPrecision} instead\n * @return fractional length\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getPrecision(num: number): number {\n const [, fractionPart = ''] = String(num).split('.');\n\n return fractionPart.length;\n}\n\nexport const tuiGetPrecision = getPrecision;\n","/**\n * @deprecated: use {@link tuiIsFlat} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isFlat<T>(\n items: readonly T[] | ReadonlyArray<readonly T[]>,\n): items is readonly T[] {\n return !Array.isArray(items[0]);\n}\n\nexport const tuiIsFlat = isFlat;\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport {NgControl} from '@angular/forms';\nimport {\n TuiControlValueTransformer,\n TuiDay,\n TuiDayRange,\n tuiReplayedValueChangesFrom,\n TuiTime,\n} from '@taiga-ui/cdk';\nimport {Observable, of} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n/**\n * @internal\n * @deprecated use {@link tuiReplayControlValueChangesFactory}\n * TODO: 3.0 name should be shorter and start with lowercase letter.\n */\nexport function TuiReplayControlValueChangesFactory<\n T extends TuiDayRange | TuiDay | [TuiDay | null, TuiTime | null],\n>(\n control: NgControl | null,\n valueTransformer?: TuiControlValueTransformer<T> | null,\n): Observable<T | null> | null {\n return control\n ? tuiReplayedValueChangesFrom(control).pipe(\n map(value =>\n valueTransformer\n ? valueTransformer.fromControlValue(value)\n : (value as T),\n ),\n )\n : of(null);\n}\n\nexport const tuiReplayControlValueChangesFactory = TuiReplayControlValueChangesFactory;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;SAGgB,+BAA+B,CAC3C,YAOC;IAPD,6BAAA,EAAA;QACI,kBAAkB;QAClB,OAAO;QACP,WAAW;QACX,cAAc;QACd,eAAe;QACf,gBAAgB;KACnB;IAED,IAAM,KAAK,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;IACpC,IAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC;IAC1C,IAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,EAAC,CAAC,CAAC;IAC5D,IAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC;IAC/C,IAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,EAAC,CAAC,CAAC;IACxD,IAAM,UAAU,GAAG,YAAY,CAAC,MAAM,CAAC,EAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC;IAC5D,IAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,EAAC,KAAK,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC;IAE1D,OAAO;QACH,IAAI,iBAAiB,CAAC,IAAI,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;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,EAA3C,UAAiB,EAAjB,sCAA2C,CAAC;IAErD,OAAO,YAAY,CAAC,MAAM,CAAC;AAC/B,CAAC;IAEY,eAAe,GAAG;;ACX/B;;;AAGA;SACgB,MAAM,CAClB,KAAiD;IAEjD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;IAEY,SAAS,GAAG;;ACEzB;;;;;SAKgB,mCAAmC,CAG/C,OAAyB,EACzB,gBAAuD;IAEvD,OAAO,OAAO;UACR,2BAA2B,CAAC,OAAO,CAAC,CAAC,IAAI,CACrC,GAAG,CAAC,UAAA,KAAK;YACL,OAAA,gBAAgB;kBACV,gBAAgB,CAAC,gBAAgB,CAAC,KAAK,CAAC;kBACvC,KAAW;SAAA,CACrB,CACJ;UACD,EAAE,CAAC,IAAI,CAAC,CAAC;AACnB,CAAC;IAEY,mCAAmC,GAAG;;AClCnD;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.54.0",
|
|
4
4
|
"description": "Taiga UI Angular main components kit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"@angular/forms": ">=9.0.0",
|
|
24
24
|
"@angular/router": ">=9.0.0",
|
|
25
25
|
"@ng-web-apis/common": ">=1.12.1 < 2",
|
|
26
|
-
"@ng-web-apis/mutation-observer": ">=1.1.0",
|
|
27
|
-
"@taiga-ui/cdk": ">=2.
|
|
28
|
-
"@taiga-ui/core": ">=2.
|
|
29
|
-
"@taiga-ui/i18n": ">=2.
|
|
26
|
+
"@ng-web-apis/mutation-observer": ">=1.1.0 < 2",
|
|
27
|
+
"@taiga-ui/cdk": ">=2.54.0",
|
|
28
|
+
"@taiga-ui/core": ">=2.54.0",
|
|
29
|
+
"@taiga-ui/i18n": ">=2.54.0",
|
|
30
30
|
"@tinkoff/ng-polymorpheus": ">=3.1.12 < 4",
|
|
31
31
|
"rxjs": ">=6.0.0"
|
|
32
32
|
},
|
|
@@ -3,4 +3,7 @@ import { TuiHandler, TuiMonth } from '@taiga-ui/cdk';
|
|
|
3
3
|
import { TuiMonthPipe } from '@taiga-ui/core';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
export declare const TUI_MONTH_FORMATTER_PROVIDER: FactoryProvider;
|
|
6
|
+
/**
|
|
7
|
+
* Range.setStart/set-end, except it uses offset in characters only
|
|
8
|
+
*/
|
|
6
9
|
export declare function monthFormatterFactory(pipe: TuiMonthPipe): TuiHandler<TuiMonth | null, Observable<string>>;
|