@taiga-ui/kit 2.43.0 → 2.44.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/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.map +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-action.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-avatar.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-avatar.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-breadcrumbs.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-breadcrumbs.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-calendar-month.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-calendar-month.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-calendar-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-calendar-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-carousel.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-block.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-block.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-labeled.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox-labeled.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-combo-box.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-field-error.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-field-error.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.js +49 -49
- package/bundles/taiga-ui-kit-components-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-files.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-filter.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-filter.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-copy.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-copy.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-count.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-count.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-range.umd.js +3 -1
- package/bundles/taiga-ui-kit-components-input-date-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-time.umd.js +3 -1
- package/bundles/taiga-ui-kit-components-input-date-time.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date-time.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date.umd.js +3 -1
- package/bundles/taiga-ui-kit-components-input-date.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-date.umd.min.js.map +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.map +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.map +1 -1
- package/bundles/taiga-ui-kit-components-input-inline.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-inline.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-month-range.umd.js.map +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.map +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 +3 -2
- package/bundles/taiga-ui-kit-components-input-number.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-password.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-password.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-password.umd.min.js.map +1 -1
- 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.map +1 -1
- package/bundles/taiga-ui-kit-components-input-phone.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-phone.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.js +5 -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-input-time.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-time.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-line-clamp.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-line-clamp.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-multi-select.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pagination.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-pagination.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-block.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-block.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-labeled.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-labeled.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-list.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio-list.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-range.umd.js.map +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.map +1 -1
- package/bundles/taiga-ui-kit-components-select-option.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.js +4 -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-stepper.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-stepper.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tabs.umd.js +62 -21
- package/bundles/taiga-ui-kit-components-tabs.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tabs.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-tabs.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tag.umd.js.map +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-toggle.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-toggle.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-tree.umd.js.map +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.map +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-context.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-hover.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-hover.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-highlight.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-highlight.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-lazy-loading.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-lazy-loading.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-present.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-present.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-project-class.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-directives-project-class.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-pipes-field-error.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-pipes-field-error.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-dom.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-dom.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-math.umd.js +1 -1
- package/bundles/taiga-ui-kit-utils-math.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-utils-math.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-utils-math.umd.min.js.map +1 -1
- package/components/accordion/accordion-item/accordion-item-content.directive.d.ts +2 -2
- package/components/accordion/taiga-ui-kit-components-accordion.metadata.json +1 -1
- package/components/breadcrumbs/breadcrumbs-wrapper.component.d.ts +1 -1
- package/components/files/files.component.d.ts +1 -1
- package/components/files/index.d.ts +1 -0
- package/components/files/taiga-ui-kit-components-files.d.ts +0 -1
- package/components/files/taiga-ui-kit-components-files.metadata.json +1 -1
- package/components/input-count/input-count-options.d.ts +2 -2
- package/components/input-count/input-count.component.d.ts +2 -2
- package/components/input-date/input-date.providers.d.ts +2 -1
- package/components/input-date/taiga-ui-kit-components-input-date.metadata.json +1 -1
- package/components/input-date-range/input-date-range.providers.d.ts +2 -1
- package/components/input-date-range/taiga-ui-kit-components-input-date-range.metadata.json +1 -1
- package/components/input-date-time/input-date-time.providers.d.ts +2 -1
- package/components/input-date-time/taiga-ui-kit-components-input-date-time.metadata.json +1 -1
- package/components/input-number/input-number.component.d.ts +2 -2
- package/components/input-number/taiga-ui-kit-components-input-number.metadata.json +1 -1
- package/components/input-password/input-password-options.d.ts +2 -2
- package/components/input-password/input-password.directive.d.ts +2 -1
- package/components/input-password/taiga-ui-kit-components-input-password.metadata.json +1 -1
- package/components/input-range/input-range.component.d.ts +2 -1
- package/components/input-range/taiga-ui-kit-components-input-range.metadata.json +1 -1
- package/components/input-tag/input-tag.component.d.ts +1 -1
- package/components/input-tag/taiga-ui-kit-components-input-tag.metadata.json +1 -1
- package/components/input-time/input-time-options.d.ts +1 -1
- package/components/multi-select/multi-select-group/multi-select-group.directive.d.ts +3 -3
- package/components/radio-list/taiga-ui-kit-components-radio-list.metadata.json +1 -1
- package/components/select-option/select-option.component.d.ts +2 -2
- package/components/select-option/taiga-ui-kit-components-select-option.metadata.json +1 -1
- package/components/slider/taiga-ui-kit-components-slider.metadata.json +1 -1
- package/components/tabs/index.d.ts +1 -0
- package/components/tabs/tab.directive.d.ts +2 -2
- package/components/tabs/tabs/tabs.component.d.ts +3 -1
- package/components/tabs/tabs-options.d.ts +9 -0
- package/components/tabs/tabs-with-more/tabs-with-more.component.d.ts +7 -2
- package/components/tabs/taiga-ui-kit-components-tabs.metadata.json +1 -1
- package/components/text-area/taiga-ui-kit-components-text-area.metadata.json +1 -1
- package/components/tree/misc/tree.interfaces.d.ts +1 -1
- package/esm2015/abstract/input-slider.js +1 -1
- package/esm2015/abstract/slider/slider.js +1 -1
- package/esm2015/components/accordion/accordion-item/accordion-item-content.directive.js +1 -1
- package/esm2015/components/accordion/accordion-item/accordion-item.component.js +1 -1
- package/esm2015/components/accordion/accordion.component.js +1 -1
- package/esm2015/components/action/action.component.js +1 -1
- package/esm2015/components/avatar/avatar.component.js +1 -1
- package/esm2015/components/breadcrumbs/breadcrumbs-wrapper.component.js +1 -1
- package/esm2015/components/calendar-month/calendar-month.component.js +1 -1
- package/esm2015/components/calendar-range/calendar-range.component.js +1 -1
- package/esm2015/components/carousel/carousel.component.js +1 -1
- package/esm2015/components/checkbox/checkbox.component.js +1 -1
- package/esm2015/components/checkbox-block/checkbox-block.component.js +1 -1
- package/esm2015/components/checkbox-labeled/checkbox-labeled.component.js +1 -1
- package/esm2015/components/combo-box/combo-box-strict.directive.js +1 -1
- package/esm2015/components/combo-box/combo-box.component.js +1 -1
- package/esm2015/components/combo-box/combo-box.directive.js +1 -1
- package/esm2015/components/field-error/field-error.component.js +1 -1
- package/esm2015/components/files/file/file.component.js +1 -1
- package/esm2015/components/files/files.component.js +1 -1
- package/esm2015/components/files/index.js +2 -1
- package/esm2015/components/files/taiga-ui-kit-components-files.js +1 -2
- package/esm2015/components/filter/filter.component.js +1 -1
- package/esm2015/components/input/input.component.js +1 -1
- package/esm2015/components/input/input.directive.js +1 -1
- package/esm2015/components/input-copy/input-copy.component.js +1 -1
- package/esm2015/components/input-copy/input-copy.directive.js +1 -1
- package/esm2015/components/input-count/input-count-options.js +1 -1
- package/esm2015/components/input-count/input-count.component.js +1 -1
- package/esm2015/components/input-count/input-count.directive.js +1 -1
- package/esm2015/components/input-date/input-date.component.js +1 -1
- package/esm2015/components/input-date/input-date.directive.js +1 -1
- package/esm2015/components/input-date/input-date.providers.js +1 -1
- package/esm2015/components/input-date-range/input-date-range.component.js +1 -1
- package/esm2015/components/input-date-range/input-date-range.directive.js +1 -1
- package/esm2015/components/input-date-range/input-date-range.providers.js +1 -1
- package/esm2015/components/input-date-time/input-date-time.component.js +1 -1
- package/esm2015/components/input-date-time/input-date-time.directive.js +1 -1
- package/esm2015/components/input-date-time/input-date-time.providers.js +1 -1
- package/esm2015/components/input-file/file/file.component.js +1 -1
- package/esm2015/components/input-file/input-file.component.js +1 -1
- package/esm2015/components/input-files/input-files.component.js +1 -1
- package/esm2015/components/input-inline/input-inline.component.js +1 -1
- package/esm2015/components/input-month/input-month.component.js +1 -1
- package/esm2015/components/input-month/input-month.directive.js +1 -1
- package/esm2015/components/input-month-range/input-month-range.component.js +1 -1
- package/esm2015/components/input-month-range/input-month-range.directive.js +1 -1
- package/esm2015/components/input-number/input-number.component.js +6 -5
- package/esm2015/components/input-number/input-number.directive.js +1 -1
- package/esm2015/components/input-password/input-password-options.js +3 -3
- package/esm2015/components/input-password/input-password.component.js +1 -1
- package/esm2015/components/input-password/input-password.directive.js +1 -1
- package/esm2015/components/input-phone/input-phone.component.js +1 -1
- package/esm2015/components/input-phone/input-phone.directive.js +1 -1
- package/esm2015/components/input-phone-international/input-phone-international.component.js +1 -1
- package/esm2015/components/input-range/input-range.component.js +7 -3
- package/esm2015/components/input-slider/input-slider.component.js +3 -3
- package/esm2015/components/input-tag/input-tag.component.js +2 -2
- package/esm2015/components/input-time/input-time-options.js +1 -1
- package/esm2015/components/input-time/input-time.component.js +1 -1
- package/esm2015/components/line-clamp/line-clamp.component.js +1 -1
- package/esm2015/components/multi-select/multi-select-group/multi-select-group.component.js +1 -1
- package/esm2015/components/multi-select/multi-select.component.js +1 -1
- package/esm2015/components/pagination/pagination.component.js +1 -1
- package/esm2015/components/radio/radio.component.js +1 -1
- package/esm2015/components/radio-block/radio-block.component.js +1 -1
- package/esm2015/components/radio-labeled/radio-labeled.component.js +1 -1
- package/esm2015/components/radio-list/radio-list.component.js +1 -1
- package/esm2015/components/range/range.component.js +1 -1
- package/esm2015/components/select/select.component.js +1 -1
- package/esm2015/components/select/select.directive.js +1 -1
- package/esm2015/components/select-option/select-option.component.js +1 -1
- package/esm2015/components/slider/slider-key-steps.directive.js +5 -3
- package/esm2015/components/slider/slider-old.component.js +1 -1
- package/esm2015/components/slider/slider-readonly.directive.js +1 -1
- package/esm2015/components/slider/slider.component.js +2 -2
- package/esm2015/components/stepper/step/step.component.js +1 -1
- package/esm2015/components/stepper/stepper.component.js +1 -1
- package/esm2015/components/tabs/index.js +2 -1
- package/esm2015/components/tabs/tab/tab.component.js +1 -1
- package/esm2015/components/tabs/tab.directive.js +1 -1
- package/esm2015/components/tabs/tabs/tabs.component.js +14 -10
- package/esm2015/components/tabs/tabs-options.js +14 -0
- package/esm2015/components/tabs/tabs-with-more/tabs-with-more.component.js +32 -13
- package/esm2015/components/tag/tag.component.js +1 -1
- package/esm2015/components/text-area/text-area.component.js +2 -2
- package/esm2015/components/text-area/text-area.directive.js +1 -1
- package/esm2015/components/toggle/toggle.component.js +1 -1
- package/esm2015/components/tree/components/tree/tree.component.js +1 -1
- package/esm2015/components/tree/components/tree-item/tree-item.component.js +1 -1
- package/esm2015/components/tree/components/tree-item-content/tree-item-content.component.js +1 -1
- package/esm2015/components/tree/directives/tree-controller.directive.js +1 -1
- package/esm2015/components/tree/directives/tree-item-controller.directive.js +1 -1
- package/esm2015/components/tree/directives/tree-node.directive.js +1 -1
- package/esm2015/components/tree/misc/tree.interfaces.js +1 -1
- package/esm2015/components/tree/misc/tree.service.js +1 -1
- package/esm2015/directives/dropdown-context/dropdown-context.directive.js +1 -1
- package/esm2015/directives/dropdown-hover/dropdown-hover.directive.js +1 -1
- package/esm2015/directives/dropdown-selection/dropdown-selection.directive.js +1 -1
- package/esm2015/directives/highlight/highlight.directive.js +1 -1
- package/esm2015/directives/lazy-loading/lazy-loading.directive.js +1 -1
- package/esm2015/directives/lazy-loading/lazy-loading.service.js +1 -1
- package/esm2015/directives/present/present.directive.js +1 -1
- package/esm2015/directives/project-class/project-class.directive.js +1 -1
- package/esm2015/internal/primitive-calendar-range/primitive-calendar-range.component.js +1 -1
- package/esm2015/pipes/field-error/field-error-content-pipe.js +1 -1
- package/esm2015/pipes/field-error/field-error-pipe.js +1 -1
- package/esm2015/types/handler-with-context.js +1 -1
- package/esm2015/utils/dom/scroll-to-element.js +1 -1
- package/esm2015/utils/dom/set-range-offset.js +1 -1
- package/esm2015/utils/math/key-steps.js +2 -2
- package/esm5/abstract/input-slider.js +1 -1
- package/esm5/abstract/slider/slider.js +1 -1
- package/esm5/components/accordion/accordion-item/accordion-item-content.directive.js +1 -1
- package/esm5/components/accordion/accordion-item/accordion-item.component.js +1 -1
- package/esm5/components/accordion/accordion.component.js +1 -1
- package/esm5/components/action/action.component.js +1 -1
- package/esm5/components/avatar/avatar.component.js +1 -1
- package/esm5/components/breadcrumbs/breadcrumbs-wrapper.component.js +1 -1
- package/esm5/components/calendar-month/calendar-month.component.js +1 -1
- package/esm5/components/calendar-range/calendar-range.component.js +1 -1
- package/esm5/components/carousel/carousel.component.js +1 -1
- package/esm5/components/checkbox/checkbox.component.js +1 -1
- package/esm5/components/checkbox-block/checkbox-block.component.js +1 -1
- package/esm5/components/checkbox-labeled/checkbox-labeled.component.js +1 -1
- package/esm5/components/combo-box/combo-box-strict.directive.js +1 -1
- package/esm5/components/combo-box/combo-box.component.js +1 -1
- package/esm5/components/combo-box/combo-box.directive.js +1 -1
- package/esm5/components/field-error/field-error.component.js +1 -1
- package/esm5/components/files/file/file.component.js +1 -1
- package/esm5/components/files/files.component.js +1 -1
- package/esm5/components/files/index.js +2 -1
- package/esm5/components/files/taiga-ui-kit-components-files.js +1 -2
- package/esm5/components/filter/filter.component.js +1 -1
- package/esm5/components/input/input.component.js +1 -1
- package/esm5/components/input/input.directive.js +1 -1
- package/esm5/components/input-copy/input-copy.component.js +1 -1
- package/esm5/components/input-copy/input-copy.directive.js +1 -1
- package/esm5/components/input-count/input-count-options.js +1 -1
- package/esm5/components/input-count/input-count.component.js +1 -1
- package/esm5/components/input-count/input-count.directive.js +1 -1
- package/esm5/components/input-date/input-date.component.js +1 -1
- package/esm5/components/input-date/input-date.directive.js +1 -1
- package/esm5/components/input-date/input-date.providers.js +4 -2
- package/esm5/components/input-date-range/input-date-range.component.js +1 -1
- package/esm5/components/input-date-range/input-date-range.directive.js +1 -1
- package/esm5/components/input-date-range/input-date-range.providers.js +4 -2
- package/esm5/components/input-date-time/input-date-time.component.js +1 -1
- package/esm5/components/input-date-time/input-date-time.directive.js +1 -1
- package/esm5/components/input-date-time/input-date-time.providers.js +4 -2
- package/esm5/components/input-file/file/file.component.js +1 -1
- package/esm5/components/input-file/input-file.component.js +1 -1
- package/esm5/components/input-files/input-files.component.js +1 -1
- package/esm5/components/input-inline/input-inline.component.js +1 -1
- package/esm5/components/input-month/input-month.component.js +1 -1
- package/esm5/components/input-month/input-month.directive.js +1 -1
- package/esm5/components/input-month-range/input-month-range.component.js +1 -1
- package/esm5/components/input-month-range/input-month-range.directive.js +1 -1
- package/esm5/components/input-number/input-number.component.js +6 -5
- package/esm5/components/input-number/input-number.directive.js +1 -1
- package/esm5/components/input-password/input-password-options.js +2 -2
- package/esm5/components/input-password/input-password.component.js +1 -1
- package/esm5/components/input-password/input-password.directive.js +1 -1
- package/esm5/components/input-phone/input-phone.component.js +1 -1
- package/esm5/components/input-phone/input-phone.directive.js +1 -1
- package/esm5/components/input-phone-international/input-phone-international.component.js +1 -1
- package/esm5/components/input-range/input-range.component.js +6 -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/input-time/input-time-options.js +1 -1
- package/esm5/components/input-time/input-time.component.js +1 -1
- package/esm5/components/line-clamp/line-clamp.component.js +1 -1
- package/esm5/components/multi-select/multi-select-group/multi-select-group.component.js +1 -1
- package/esm5/components/multi-select/multi-select.component.js +1 -1
- package/esm5/components/pagination/pagination.component.js +1 -1
- package/esm5/components/radio/radio.component.js +1 -1
- package/esm5/components/radio-block/radio-block.component.js +1 -1
- package/esm5/components/radio-labeled/radio-labeled.component.js +1 -1
- package/esm5/components/radio-list/radio-list.component.js +1 -1
- package/esm5/components/range/range.component.js +1 -1
- package/esm5/components/select/select.component.js +1 -1
- package/esm5/components/select/select.directive.js +1 -1
- package/esm5/components/select-option/select-option.component.js +1 -1
- package/esm5/components/slider/slider-key-steps.directive.js +5 -3
- package/esm5/components/slider/slider-old.component.js +1 -1
- package/esm5/components/slider/slider-readonly.directive.js +1 -1
- package/esm5/components/slider/slider.component.js +2 -2
- package/esm5/components/stepper/step/step.component.js +1 -1
- package/esm5/components/stepper/stepper.component.js +1 -1
- package/esm5/components/tabs/index.js +2 -1
- package/esm5/components/tabs/tab/tab.component.js +1 -1
- package/esm5/components/tabs/tab.directive.js +1 -1
- package/esm5/components/tabs/tabs/tabs.component.js +14 -10
- package/esm5/components/tabs/tabs-options.js +15 -0
- package/esm5/components/tabs/tabs-with-more/tabs-with-more.component.js +36 -13
- package/esm5/components/tag/tag.component.js +1 -1
- package/esm5/components/text-area/text-area.component.js +2 -2
- package/esm5/components/text-area/text-area.directive.js +1 -1
- package/esm5/components/toggle/toggle.component.js +1 -1
- package/esm5/components/tree/components/tree/tree.component.js +1 -1
- package/esm5/components/tree/components/tree-item/tree-item.component.js +1 -1
- package/esm5/components/tree/components/tree-item-content/tree-item-content.component.js +1 -1
- package/esm5/components/tree/directives/tree-controller.directive.js +1 -1
- package/esm5/components/tree/directives/tree-item-controller.directive.js +1 -1
- package/esm5/components/tree/directives/tree-node.directive.js +1 -1
- package/esm5/components/tree/misc/tree.interfaces.js +1 -1
- package/esm5/components/tree/misc/tree.service.js +1 -1
- package/esm5/directives/dropdown-context/dropdown-context.directive.js +1 -1
- package/esm5/directives/dropdown-hover/dropdown-hover.directive.js +1 -1
- package/esm5/directives/dropdown-selection/dropdown-selection.directive.js +1 -1
- package/esm5/directives/highlight/highlight.directive.js +1 -1
- package/esm5/directives/lazy-loading/lazy-loading.directive.js +1 -1
- package/esm5/directives/lazy-loading/lazy-loading.service.js +1 -1
- package/esm5/directives/present/present.directive.js +1 -1
- package/esm5/directives/project-class/project-class.directive.js +1 -1
- package/esm5/internal/primitive-calendar-range/primitive-calendar-range.component.js +1 -1
- package/esm5/pipes/field-error/field-error-content-pipe.js +1 -1
- package/esm5/pipes/field-error/field-error-pipe.js +1 -1
- package/esm5/types/handler-with-context.js +1 -1
- package/esm5/utils/dom/scroll-to-element.js +1 -1
- package/esm5/utils/dom/set-range-offset.js +1 -1
- package/esm5/utils/math/key-steps.js +2 -2
- package/fesm2015/taiga-ui-kit-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-accordion.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-action.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-avatar.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-breadcrumbs.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-calendar-month.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-calendar-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-carousel.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox-block.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox-labeled.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-combo-box.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-field-error.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-files.js +47 -47
- package/fesm2015/taiga-ui-kit-components-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-filter.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-copy.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-count.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date-time.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-date.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-file.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-inline.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-month.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-number.js +5 -4
- package/fesm2015/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-password.js +2 -2
- package/fesm2015/taiga-ui-kit-components-input-password.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone-international.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-phone.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-range.js +6 -2
- package/fesm2015/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-slider.js +2 -2
- 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-input-time.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-line-clamp.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-pagination.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio-block.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio-labeled.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio-list.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-radio.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-select-option.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-slider.js +5 -3
- package/fesm2015/taiga-ui-kit-components-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-stepper.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tabs.js +56 -22
- package/fesm2015/taiga-ui-kit-components-tabs.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tag.js.map +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-toggle.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-tree.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-dropdown-context.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-dropdown-hover.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-dropdown-selection.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-highlight.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-lazy-loading.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-present.js.map +1 -1
- package/fesm2015/taiga-ui-kit-directives-project-class.js.map +1 -1
- package/fesm2015/taiga-ui-kit-internal-primitive-calendar-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-pipes-field-error.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-dom.js.map +1 -1
- package/fesm2015/taiga-ui-kit-utils-math.js +1 -1
- package/fesm2015/taiga-ui-kit-utils-math.js.map +1 -1
- package/fesm5/taiga-ui-kit-abstract.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-accordion.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-action.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-avatar.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-breadcrumbs.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-calendar-month.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-calendar-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-carousel.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-checkbox-block.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-checkbox-labeled.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-checkbox.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-combo-box.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-field-error.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-files.js +52 -52
- package/fesm5/taiga-ui-kit-components-files.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-filter.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-copy.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-count.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-date-range.js +3 -1
- package/fesm5/taiga-ui-kit-components-input-date-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-date-time.js +3 -1
- package/fesm5/taiga-ui-kit-components-input-date-time.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-date.js +3 -1
- package/fesm5/taiga-ui-kit-components-input-date.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-file.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-files.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-inline.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-month-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-month.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-number.js +5 -4
- package/fesm5/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-password.js +1 -1
- package/fesm5/taiga-ui-kit-components-input-password.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-phone-international.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-phone.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-range.js +5 -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-input-time.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-line-clamp.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-multi-select.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-pagination.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-radio-block.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-radio-labeled.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-radio-list.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-radio.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-select-option.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-slider.js +5 -3
- package/fesm5/taiga-ui-kit-components-slider.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-stepper.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-tabs.js +61 -23
- package/fesm5/taiga-ui-kit-components-tabs.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-tag.js.map +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-toggle.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-tree.js.map +1 -1
- package/fesm5/taiga-ui-kit-directives-dropdown-context.js.map +1 -1
- package/fesm5/taiga-ui-kit-directives-dropdown-hover.js.map +1 -1
- package/fesm5/taiga-ui-kit-directives-dropdown-selection.js.map +1 -1
- package/fesm5/taiga-ui-kit-directives-highlight.js.map +1 -1
- package/fesm5/taiga-ui-kit-directives-lazy-loading.js.map +1 -1
- package/fesm5/taiga-ui-kit-directives-present.js.map +1 -1
- package/fesm5/taiga-ui-kit-directives-project-class.js.map +1 -1
- package/fesm5/taiga-ui-kit-internal-primitive-calendar-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-pipes-field-error.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-dom.js.map +1 -1
- package/fesm5/taiga-ui-kit-utils-math.js +1 -1
- package/fesm5/taiga-ui-kit-utils-math.js.map +1 -1
- package/package.json +4 -4
- package/types/handler-with-context.d.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-directives-dropdown-context.js","sources":["ng://@taiga-ui/kit/directives/dropdown-context/dropdown-context.directive.ts","ng://@taiga-ui/kit/directives/dropdown-context/dropdown-context.module.ts","ng://@taiga-ui/kit/directives/dropdown-context/taiga-ui-kit-directives-dropdown-context.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ComponentFactoryResolver,\n Directive,\n ElementRef,\n forwardRef,\n HostListener,\n Inject,\n Injector,\n Input,\n} from '@angular/core';\nimport {\n getClosestFocusable,\n getNativeFocused,\n setNativeFocused,\n TuiActiveZoneDirective,\n tuiDefaultProp,\n TuiDestroyService,\n TuiPortalService,\n} from '@taiga-ui/cdk';\nimport {AbstractTuiDropdown, TUI_DROPDOWN_DIRECTIVE, TuiDropdown} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {EMPTY, Observable} from 'rxjs';\nimport {filter, takeUntil} from 'rxjs/operators';\n\n// @dynamic\n@Directive({\n selector: '[tuiDropdownContext]',\n providers: [\n TuiDestroyService,\n TuiActiveZoneDirective,\n {\n provide: TUI_DROPDOWN_DIRECTIVE,\n useExisting: forwardRef(() => TuiDropdownContextDirective),\n },\n ],\n})\nexport class TuiDropdownContextDirective\n extends AbstractTuiDropdown\n implements TuiDropdown\n{\n private lastClickedClientRect: ClientRect = this.getClientRectFromDot(0, 0);\n\n @Input('tuiDropdownContext')\n @tuiDefaultProp()\n content: PolymorpheusContent = '';\n\n readonly refresh$ = EMPTY;\n\n readonly context = {close: () => this.closeDropdownBox()};\n\n constructor(\n protected readonly elementRef: ElementRef,\n @Inject(DOCUMENT) private readonly documentRef: Document,\n @Inject(TuiDestroyService) destroy$: Observable<unknown>,\n @Inject(ComponentFactoryResolver)\n componentFactoryResolver: ComponentFactoryResolver,\n @Inject(Injector) injector: Injector,\n @Inject(TuiPortalService) portalService: TuiPortalService,\n readonly activeZone: TuiActiveZoneDirective,\n ) {\n super(componentFactoryResolver, injector, portalService, elementRef, activeZone);\n\n activeZone.tuiActiveZoneChange\n .pipe(\n filter(isActive => !isActive),\n takeUntil(destroy$),\n )\n .subscribe(() => this.closeDropdownBox());\n }\n\n get clientRect(): ClientRect {\n return this.lastClickedClientRect;\n }\n\n get fixed(): boolean {\n return true;\n }\n\n private get dropdownContent(): HTMLElement | null {\n return this.dropdownBoxRef?.instance.contentElementRef?.nativeElement || null;\n }\n\n @HostListener('click')\n onHostClick() {\n this.closeDropdownBox();\n }\n\n @HostListener('contextmenu.prevent', ['$event.clientX', '$event.clientY'])\n onContextMenu(x: number, y: number) {\n this.closeDropdownBox();\n this.openDropdown(x, y);\n }\n\n @HostListener('document:contextmenu', ['$event.target'])\n onAnotherContextOpen(target: HTMLElement) {\n const isAnotherContextOpened = !this.elementRef.nativeElement.contains(target);\n\n if (isAnotherContextOpened) {\n this.closeDropdownBox();\n }\n }\n\n @HostListener('document:keydown.arrowDown', ['$event', 'true'])\n @HostListener('document:keydown.arrowUp', ['$event', 'false'])\n onArrow(event: KeyboardEvent, down: boolean) {\n const activeElement = getNativeFocused(this.documentRef);\n const focusInside = activeElement && this.activeZone.contains(activeElement);\n\n if (!this.dropdownContent || focusInside) {\n return;\n }\n\n event.preventDefault();\n\n const nextEl = this.dropdownContent.nextElementSibling;\n const initial =\n down || !this.checkIsFocusableElement(nextEl) ? this.dropdownContent : nextEl;\n const focusable = getClosestFocusable(initial, !down, this.dropdownContent);\n\n if (focusable === null) {\n return;\n }\n\n setNativeFocused(focusable);\n }\n\n @HostListener('document:keydown.esc', ['$event'])\n onKeyDownEsc(event: KeyboardEvent) {\n if (!this.dropdownContent) {\n return;\n }\n\n event.stopPropagation();\n this.closeDropdownBox();\n }\n\n private openDropdown(x: number, y: number): void {\n this.lastClickedClientRect = this.getClientRectFromDot(x, y);\n this.openDropdownBox();\n }\n\n private getClientRectFromDot(x: number, y: number): ClientRect {\n return {\n top: y,\n bottom: y,\n left: x,\n right: x,\n height: 0,\n width: 0,\n };\n }\n\n private checkIsFocusableElement(element: Element | null): element is HTMLElement {\n return !!element && 'focus' in element && 'blur' in element;\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiDropdownBoxModule} from '@taiga-ui/core';\n\nimport {TuiDropdownContextDirective} from './dropdown-context.directive';\n\n@NgModule({\n imports: [TuiDropdownBoxModule],\n declarations: [TuiDropdownContextDirective],\n exports: [TuiDropdownContextDirective],\n})\nexport class TuiDropdownContextModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAyBA;;IAaY,+CAAmB;IAa3B,qCACuB,UAAsB,EACN,WAAqB,EAC7B,QAA6B,EAExD,wBAAkD,EAChC,QAAkB,EACV,aAA+B,EAChD,UAAkC;QAR/C,YAUI,kBAAM,wBAAwB,EAAE,QAAQ,EAAE,aAAa,EAAE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AAM,CAAC,QAAQ,CAAC,CAAA;QAChB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,wBAAwB,CAAC,CAAA;QAEhC,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;QAChB,WAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;OArBpB,2BAA2B,CAuHvC;IAAD,kCAAC;CAAA,CAtHW,mBAAmB;;;IC5B/B;KAAwC;IAA3B,wBAAwB;QALpC,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,oBAAoB,CAAC;YAC/B,YAAY,EAAE,CAAC,2BAA2B,CAAC;YAC3C,OAAO,EAAE,CAAC,2BAA2B,CAAC;SACzC,CAAC;OACW,wBAAwB,CAAG;IAAD,+BAAC;CAAxC;;ACVA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-directives-dropdown-context.js","sources":["ng://@taiga-ui/kit/directives/dropdown-context/dropdown-context.directive.ts","ng://@taiga-ui/kit/directives/dropdown-context/dropdown-context.module.ts","ng://@taiga-ui/kit/directives/dropdown-context/taiga-ui-kit-directives-dropdown-context.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ComponentFactoryResolver,\n Directive,\n ElementRef,\n forwardRef,\n HostListener,\n Inject,\n Injector,\n Input,\n} from '@angular/core';\nimport {\n getClosestFocusable,\n getNativeFocused,\n setNativeFocused,\n TuiActiveZoneDirective,\n tuiDefaultProp,\n TuiDestroyService,\n TuiPortalService,\n} from '@taiga-ui/cdk';\nimport {AbstractTuiDropdown, TUI_DROPDOWN_DIRECTIVE, TuiDropdown} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {EMPTY, Observable} from 'rxjs';\nimport {filter, takeUntil} from 'rxjs/operators';\n\n// @dynamic\n@Directive({\n selector: '[tuiDropdownContext]',\n providers: [\n TuiDestroyService,\n TuiActiveZoneDirective,\n {\n provide: TUI_DROPDOWN_DIRECTIVE,\n useExisting: forwardRef(() => TuiDropdownContextDirective),\n },\n ],\n})\nexport class TuiDropdownContextDirective\n extends AbstractTuiDropdown\n implements TuiDropdown\n{\n private lastClickedClientRect: ClientRect = this.getClientRectFromDot(0, 0);\n\n @Input('tuiDropdownContext')\n @tuiDefaultProp()\n content: PolymorpheusContent = '';\n\n readonly refresh$ = EMPTY;\n\n readonly context = {close: () => this.closeDropdownBox()};\n\n constructor(\n protected readonly elementRef: ElementRef,\n @Inject(DOCUMENT) private readonly documentRef: Document,\n @Inject(TuiDestroyService) destroy$: Observable<unknown>,\n @Inject(ComponentFactoryResolver)\n componentFactoryResolver: ComponentFactoryResolver,\n @Inject(Injector) injector: Injector,\n @Inject(TuiPortalService) portalService: TuiPortalService,\n readonly activeZone: TuiActiveZoneDirective,\n ) {\n super(componentFactoryResolver, injector, portalService, elementRef, activeZone);\n\n activeZone.tuiActiveZoneChange\n .pipe(\n filter(isActive => !isActive),\n takeUntil(destroy$),\n )\n .subscribe(() => this.closeDropdownBox());\n }\n\n get clientRect(): ClientRect {\n return this.lastClickedClientRect;\n }\n\n get fixed(): boolean {\n return true;\n }\n\n private get dropdownContent(): HTMLElement | null {\n return this.dropdownBoxRef?.instance.contentElementRef?.nativeElement || null;\n }\n\n @HostListener('click')\n onHostClick(): void {\n this.closeDropdownBox();\n }\n\n @HostListener('contextmenu.prevent', ['$event.clientX', '$event.clientY'])\n onContextMenu(x: number, y: number): void {\n this.closeDropdownBox();\n this.openDropdown(x, y);\n }\n\n @HostListener('document:contextmenu', ['$event.target'])\n onAnotherContextOpen(target: HTMLElement): void {\n const isAnotherContextOpened = !this.elementRef.nativeElement.contains(target);\n\n if (isAnotherContextOpened) {\n this.closeDropdownBox();\n }\n }\n\n @HostListener('document:keydown.arrowDown', ['$event', 'true'])\n @HostListener('document:keydown.arrowUp', ['$event', 'false'])\n onArrow(event: KeyboardEvent, down: boolean): void {\n const activeElement = getNativeFocused(this.documentRef);\n const focusInside = activeElement && this.activeZone.contains(activeElement);\n\n if (!this.dropdownContent || focusInside) {\n return;\n }\n\n event.preventDefault();\n\n const nextEl = this.dropdownContent.nextElementSibling;\n const initial =\n down || !this.checkIsFocusableElement(nextEl) ? this.dropdownContent : nextEl;\n const focusable = getClosestFocusable(initial, !down, this.dropdownContent);\n\n if (focusable === null) {\n return;\n }\n\n setNativeFocused(focusable);\n }\n\n @HostListener('document:keydown.esc', ['$event'])\n onKeyDownEsc(event: KeyboardEvent): void {\n if (!this.dropdownContent) {\n return;\n }\n\n event.stopPropagation();\n this.closeDropdownBox();\n }\n\n private openDropdown(x: number, y: number): void {\n this.lastClickedClientRect = this.getClientRectFromDot(x, y);\n this.openDropdownBox();\n }\n\n private getClientRectFromDot(x: number, y: number): ClientRect {\n return {\n top: y,\n bottom: y,\n left: x,\n right: x,\n height: 0,\n width: 0,\n };\n }\n\n private checkIsFocusableElement(element: Element | null): element is HTMLElement {\n return !!element && 'focus' in element && 'blur' in element;\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiDropdownBoxModule} from '@taiga-ui/core';\n\nimport {TuiDropdownContextDirective} from './dropdown-context.directive';\n\n@NgModule({\n imports: [TuiDropdownBoxModule],\n declarations: [TuiDropdownContextDirective],\n exports: [TuiDropdownContextDirective],\n})\nexport class TuiDropdownContextModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAyBA;;IAaY,+CAAmB;IAa3B,qCACuB,UAAsB,EACN,WAAqB,EAC7B,QAA6B,EAExD,wBAAkD,EAChC,QAAkB,EACV,aAA+B,EAChD,UAAkC;QAR/C,YAUI,kBAAM,wBAAwB,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,CAAC,SAQnF;QAjBsB,gBAAU,GAAV,UAAU,CAAY;QACN,iBAAW,GAAX,WAAW,CAAU;QAM/C,gBAAU,GAAV,UAAU,CAAwB;QAlBvC,2BAAqB,GAAe,KAAI,CAAC,oBAAoB,CAAC,C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,CAAC,gBAAgB,CAAC,CAAA;OArBpB,2BAA2B,CAuHvC;IAAD,kCAAC;CAAA,CAtHW,mBAAmB;;;IC5B/B;KAAwC;IAA3B,wBAAwB;QALpC,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,oBAAoB,CAAC;YAC/B,YAAY,EAAE,CAAC,2BAA2B,CAAC;YAC3C,OAAO,EAAE,CAAC,2BAA2B,CAAC;SACzC,CAAC;OACW,wBAAwB,CAAG;IAAD,+BAAC;CAAxC;;ACVA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-directives-dropdown-hover.js","sources":["ng://@taiga-ui/kit/directives/dropdown-hover/dropdown-hover.directive.ts","ng://@taiga-ui/kit/directives/dropdown-hover/dropdown-hover.module.ts","ng://@taiga-ui/kit/directives/dropdown-hover/taiga-ui-kit-directives-dropdown-hover.ts"],"sourcesContent":["import {Directive, ElementRef, HostListener, Inject} from '@angular/core';\nimport {\n getClosestFocusable,\n isNativeFocusedIn,\n isPresent,\n setNativeMouseFocused,\n TuiDestroyService,\n typedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TuiHostedDropdownComponent} from '@taiga-ui/core';\nimport {merge, Observable, of, timer} from 'rxjs';\nimport {\n debounce,\n debounceTime,\n distinctUntilChanged,\n filter,\n map,\n mapTo,\n share,\n switchMap,\n takeUntil,\n tap,\n} from 'rxjs/operators';\n\n@Directive({\n selector: 'tui-hosted-dropdown[tuiDropdownHover]',\n providers: [TuiDestroyService],\n})\nexport class TuiDropdownHoverDirective {\n constructor(\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(TuiHostedDropdownComponent)\n private readonly dropdown: TuiHostedDropdownComponent,\n ) {\n const dropdown$ = dropdown.openChange.pipe(\n // Give change detection time to open dropdown\n debounceTime(0),\n map(() => dropdown.dropdown),\n filter(isPresent),\n share(),\n );\n\n const open$ = merge(\n typedFromEvent(nativeElement, 'mouseenter'),\n typedFromEvent(nativeElement, 'click').pipe(\n tap(e => e.stopImmediatePropagation()),\n ),\n dropdown$.pipe(\n switchMap(element =>\n merge(\n typedFromEvent(element, 'focusin'),\n typedFromEvent(element, 'mouseenter'),\n ),\n ),\n ),\n ).pipe(mapTo(true));\n\n const close$ = merge(\n typedFromEvent(nativeElement, 'mouseleave'),\n dropdown$.pipe(\n switchMap(element =>\n typedFromEvent(element, 'mouseleave').pipe(\n filter(() => !isNativeFocusedIn(element)),\n ),\n ),\n ),\n ).pipe(mapTo(false));\n\n merge(open$, close$)\n .pipe(\n debounce(value => (value ? of(value) : timer(300))),\n distinctUntilChanged(),\n takeUntil(destroy$),\n )\n .subscribe(open => {\n dropdown.updateOpen(open);\n });\n }\n\n @HostListener('mouseenter')\n onMouseEnter() {\n const {host} = this.dropdown;\n\n if (isNativeFocusedIn(host)) {\n return;\n }\n\n const focusable = getClosestFocusable(host, false, host, false);\n\n if (focusable) {\n setNativeMouseFocused(focusable);\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiDropdownHoverDirective} from './dropdown-hover.directive';\n\n@NgModule({\n declarations: [TuiDropdownHoverDirective],\n exports: [TuiDropdownHoverDirective],\n})\nexport class TuiDropdownHoverModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;IA6BI,mCAC+B,QAA0B,EACjC,EAAwC,EAE3C,QAAoC;YAFhC,gCAAa;QAEjB,aAAQ,GAAR,QAAQ,CAA4B;QAErD,IAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI;;QAEtC,YAAY,CAAC,CAAC,CAAC,EACf,GAAG,CAAC,cAAM,OAAA,QAAQ,CAAC,QAAQ,GAAA,CAAC,EAC5B,MAAM,CAAC,SAAS,CAAC,EACjB,KAAK,EAAE,CACV,CAAC;QAEF,IAAM,KAAK,GAAG,KAAK,CACf,cAAc,CAAC,aAAa,EAAE,YAAY,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IAAI,EAAE,KAAK,CAAC,CAAC;QAEhE,IAAI,SAAS,EAAE;YACX,qBAAqB,CAAC,SAAS,CAAC,CAAC;SACpC;KACJ;;gBA/DwC,UAAU,uBAA9C,MAAM,SAAC,iBAAiB;gBACY,UAAU,uBAA9C,MAAM,SAAC,UAAU;gBAES,0BAA0B,uBADpD,MAAM,SAAC,0BAA0B;;IAiDtC;QADC,YAAY,CAAC,YAAY,CAAC;iEAa1B;IAjEQ,yBAAyB;QAJrC,SAAS,CAAC;YACP,QAAQ,EAAE,uCAAuC;YACjD,SAAS,EAAE,CAAC,iBAAiB,CAAC;SACjC,CAAC;QAGO,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;QAClB,WAAA,MAAM,CAAC,0BAA0B,CAAC,CAAA;OAJ9B,yBAAyB,CAkErC;IAAD,gCAAC;CAlED;;;ICpBA;KAAsC;IAAzB,sBAAsB;QAJlC,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,yBAAyB,CAAC;YACzC,OAAO,EAAE,CAAC,yBAAyB,CAAC;SACvC,CAAC;OACW,sBAAsB,CAAG;IAAD,6BAAC;CAAtC;;ACRA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-directives-dropdown-hover.js","sources":["ng://@taiga-ui/kit/directives/dropdown-hover/dropdown-hover.directive.ts","ng://@taiga-ui/kit/directives/dropdown-hover/dropdown-hover.module.ts","ng://@taiga-ui/kit/directives/dropdown-hover/taiga-ui-kit-directives-dropdown-hover.ts"],"sourcesContent":["import {Directive, ElementRef, HostListener, Inject} from '@angular/core';\nimport {\n getClosestFocusable,\n isNativeFocusedIn,\n isPresent,\n setNativeMouseFocused,\n TuiDestroyService,\n typedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TuiHostedDropdownComponent} from '@taiga-ui/core';\nimport {merge, Observable, of, timer} from 'rxjs';\nimport {\n debounce,\n debounceTime,\n distinctUntilChanged,\n filter,\n map,\n mapTo,\n share,\n switchMap,\n takeUntil,\n tap,\n} from 'rxjs/operators';\n\n@Directive({\n selector: 'tui-hosted-dropdown[tuiDropdownHover]',\n providers: [TuiDestroyService],\n})\nexport class TuiDropdownHoverDirective {\n constructor(\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(TuiHostedDropdownComponent)\n private readonly dropdown: TuiHostedDropdownComponent,\n ) {\n const dropdown$ = dropdown.openChange.pipe(\n // Give change detection time to open dropdown\n debounceTime(0),\n map(() => dropdown.dropdown),\n filter(isPresent),\n share(),\n );\n\n const open$ = merge(\n typedFromEvent(nativeElement, 'mouseenter'),\n typedFromEvent(nativeElement, 'click').pipe(\n tap(e => e.stopImmediatePropagation()),\n ),\n dropdown$.pipe(\n switchMap(element =>\n merge(\n typedFromEvent(element, 'focusin'),\n typedFromEvent(element, 'mouseenter'),\n ),\n ),\n ),\n ).pipe(mapTo(true));\n\n const close$ = merge(\n typedFromEvent(nativeElement, 'mouseleave'),\n dropdown$.pipe(\n switchMap(element =>\n typedFromEvent(element, 'mouseleave').pipe(\n filter(() => !isNativeFocusedIn(element)),\n ),\n ),\n ),\n ).pipe(mapTo(false));\n\n merge(open$, close$)\n .pipe(\n debounce(value => (value ? of(value) : timer(300))),\n distinctUntilChanged(),\n takeUntil(destroy$),\n )\n .subscribe(open => {\n dropdown.updateOpen(open);\n });\n }\n\n @HostListener('mouseenter')\n onMouseEnter(): void {\n const {host} = this.dropdown;\n\n if (isNativeFocusedIn(host)) {\n return;\n }\n\n const focusable = getClosestFocusable(host, false, host, false);\n\n if (focusable) {\n setNativeMouseFocused(focusable);\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiDropdownHoverDirective} from './dropdown-hover.directive';\n\n@NgModule({\n declarations: [TuiDropdownHoverDirective],\n exports: [TuiDropdownHoverDirective],\n})\nexport class TuiDropdownHoverModule {}\n","/**\n * Generated bundle index. Do not edit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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 && selection.rangeCount\n ? selection.getRangeAt(0)\n : 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() {\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) {\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,SAyDJ;QArE6C,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,CAA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,EAAE,CAAA;QAEV,WAAA,MAAM,CAAC,2BAA2B,CAAC,CAAA;QACnC,WAAA,QAAQ,EAAE,CAAA;QAEV,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;QACvB,WAAA,QAAQ,EAAE,CAAA;QAEV,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QAEzB,WAAA,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,CAiQzC;IAAD,oCAAC;CAAA,CAhQW,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 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 && selection.rangeCount\n ? selection.getRangeAt(0)\n : 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;I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QW,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-directives-highlight.js","sources":["ng://@taiga-ui/kit/directives/highlight/highlight.directive.ts","ng://@taiga-ui/kit/directives/highlight/highlight.module.ts","ng://@taiga-ui/kit/directives/highlight/taiga-ui-kit-directives-highlight.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {Directive, ElementRef, Inject, Input, OnChanges, Renderer2} from '@angular/core';\nimport {\n px,\n svgNodeFilter,\n tuiDefaultProp,\n TuiDestroyService,\n TuiResizeService,\n} from '@taiga-ui/cdk';\nimport {Observable} from 'rxjs';\n\n// @dynamic\n@Directive({\n selector: '[tuiHighlight]',\n host: {\n '[style.position]': '\"relative\"',\n '[style.zIndex]': '0',\n },\n providers: [TuiDestroyService, TuiResizeService],\n})\nexport class TuiHighlightDirective implements OnChanges {\n private readonly highlight: HTMLElement = this.setUpHighlight();\n\n private readonly treeWalker = this.documentRef.createTreeWalker(\n this.elementRef.nativeElement,\n NodeFilter.SHOW_TEXT,\n svgNodeFilter,\n false,\n );\n\n @Input()\n @tuiDefaultProp()\n tuiHighlight = '';\n\n @Input()\n tuiHighlightColor = 'var(--tui-selection)';\n\n constructor(\n @Inject(DOCUMENT) private readonly documentRef: Document,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(TuiResizeService) resize$: Observable<unknown>,\n ) {\n resize$.subscribe(() => {\n this.updateStyles();\n });\n }\n\n get match(): boolean {\n return this.indexOf(this.elementRef.nativeElement.textContent) !== -1;\n }\n\n ngOnChanges() {\n this.updateStyles();\n }\n\n private updateStyles() {\n this.highlight.style.display = 'none';\n\n if (!this.match) {\n return;\n }\n\n this.treeWalker.currentNode = this.elementRef.nativeElement;\n\n do {\n const index = this.indexOf(this.treeWalker.currentNode.nodeValue);\n\n if (index === -1) {\n continue;\n }\n\n const range = this.documentRef.createRange();\n\n range.setStart(this.treeWalker.currentNode, index);\n range.setEnd(this.treeWalker.currentNode, index + this.tuiHighlight.length);\n\n const hostRect = this.elementRef.nativeElement.getBoundingClientRect();\n const {left, top, width, height} = range.getBoundingClientRect();\n const {style} = this.highlight;\n\n style.background = this.tuiHighlightColor;\n style.left = px(left - hostRect.left);\n style.top = px(top - hostRect.top);\n style.width = px(width);\n style.height = px(height);\n style.display = 'block';\n\n return;\n } while (this.treeWalker.nextNode());\n }\n\n private indexOf(source: string | null): number {\n return !source || !this.tuiHighlight\n ? -1\n : source.toLowerCase().indexOf(this.tuiHighlight.toLowerCase());\n }\n\n private setUpHighlight(): HTMLElement {\n const highlight = this.renderer.createElement('div');\n const {style} = highlight;\n\n style.background = this.tuiHighlightColor;\n style.zIndex = '-1';\n style.position = 'absolute';\n this.renderer.appendChild(this.elementRef.nativeElement, highlight);\n\n return highlight;\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiHighlightDirective} from './highlight.directive';\n\n@NgModule({\n declarations: [TuiHighlightDirective],\n exports: [TuiHighlightDirective],\n})\nexport class TuiHighlightModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA;;IA0BI,+BACuC,WAAqB,EACnB,UAAmC,EACpC,QAAmB,EAC7B,OAA4B;QAJ1D,iBASC;QARsC,gBAAW,GAAX,WAAW,CAAU;QACnB,eAAU,GAAV,UAAU,CAAyB;QACpC,aAAQ,GAAR,QAAQ,CAAW;QAnB1C,cAAS,GAAgB,IAAI,CAAC,cAAc,EAAE,CAAC;QAE/C,eAAU,GAAG,IAAI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BACiC,UAAU,uBAA1D,MAAM,SAAC,UAAU;gBAC4B,SAAS,uBAAtD,MAAM,SAAC,SAAS;gBACkB,UAAU,uBAA5C,MAAM,SAAC,gBAAgB;;IAT5B;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;+DACC;IAGlB;QADC,KAAK,EAAE;oEACmC;IAflC,qBAAqB;QARjC,SAAS,CAAC;YACP,QAAQ,EAAE,gBAAgB;YAC1B,IAAI,EAAE;gBACF,kBAAkB,EAAE,YAAY;gBAChC,gBAAgB,EAAE,GAAG;aACxB;YACD,SAAS,EAAE,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;SACnD,CAAC;QAmBO,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;QAChB,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;QAClB,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;QACjB,WAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;OArBpB,qBAAqB,CAyFjC;IAAD,4BAAC;CAzFD;;;ICZA;KAAkC;IAArB,kBAAkB;QAJ9B,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,qBAAqB,CAAC;YACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;SACnC,CAAC;OACW,kBAAkB,CAAG;IAAD,yBAAC;CAAlC;;ACRA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-directives-highlight.js","sources":["ng://@taiga-ui/kit/directives/highlight/highlight.directive.ts","ng://@taiga-ui/kit/directives/highlight/highlight.module.ts","ng://@taiga-ui/kit/directives/highlight/taiga-ui-kit-directives-highlight.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {Directive, ElementRef, Inject, Input, OnChanges, Renderer2} from '@angular/core';\nimport {\n px,\n svgNodeFilter,\n tuiDefaultProp,\n TuiDestroyService,\n TuiResizeService,\n} from '@taiga-ui/cdk';\nimport {Observable} from 'rxjs';\n\n// @dynamic\n@Directive({\n selector: '[tuiHighlight]',\n host: {\n '[style.position]': '\"relative\"',\n '[style.zIndex]': '0',\n },\n providers: [TuiDestroyService, TuiResizeService],\n})\nexport class TuiHighlightDirective implements OnChanges {\n private readonly highlight: HTMLElement = this.setUpHighlight();\n\n private readonly treeWalker = this.documentRef.createTreeWalker(\n this.elementRef.nativeElement,\n NodeFilter.SHOW_TEXT,\n svgNodeFilter,\n false,\n );\n\n @Input()\n @tuiDefaultProp()\n tuiHighlight = '';\n\n @Input()\n tuiHighlightColor = 'var(--tui-selection)';\n\n constructor(\n @Inject(DOCUMENT) private readonly documentRef: Document,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(TuiResizeService) resize$: Observable<unknown>,\n ) {\n resize$.subscribe(() => {\n this.updateStyles();\n });\n }\n\n get match(): boolean {\n return this.indexOf(this.elementRef.nativeElement.textContent) !== -1;\n }\n\n ngOnChanges(): void {\n this.updateStyles();\n }\n\n private updateStyles(): void {\n this.highlight.style.display = 'none';\n\n if (!this.match) {\n return;\n }\n\n this.treeWalker.currentNode = this.elementRef.nativeElement;\n\n do {\n const index = this.indexOf(this.treeWalker.currentNode.nodeValue);\n\n if (index === -1) {\n continue;\n }\n\n const range = this.documentRef.createRange();\n\n range.setStart(this.treeWalker.currentNode, index);\n range.setEnd(this.treeWalker.currentNode, index + this.tuiHighlight.length);\n\n const hostRect = this.elementRef.nativeElement.getBoundingClientRect();\n const {left, top, width, height} = range.getBoundingClientRect();\n const {style} = this.highlight;\n\n style.background = this.tuiHighlightColor;\n style.left = px(left - hostRect.left);\n style.top = px(top - hostRect.top);\n style.width = px(width);\n style.height = px(height);\n style.display = 'block';\n\n return;\n } while (this.treeWalker.nextNode());\n }\n\n private indexOf(source: string | null): number {\n return !source || !this.tuiHighlight\n ? -1\n : source.toLowerCase().indexOf(this.tuiHighlight.toLowerCase());\n }\n\n private setUpHighlight(): HTMLElement {\n const highlight = this.renderer.createElement('div');\n const {style} = highlight;\n\n style.background = this.tuiHighlightColor;\n style.zIndex = '-1';\n style.position = 'absolute';\n this.renderer.appendChild(this.elementRef.nativeElement, highlight);\n\n return highlight;\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiHighlightDirective} from './highlight.directive';\n\n@NgModule({\n declarations: [TuiHighlightDirective],\n exports: [TuiHighlightDirective],\n})\nexport class TuiHighlightModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA;;IA0BI,+BACuC,WAAqB,EACnB,UAAmC,EACpC,QAAmB,EAC7B,OAA4B;QAJ1D,iBASC;QARsC,gBAAW,GAAX,WAAW,CAAU;QACnB,eAAU,GAAV,UAAU,CAAyB;QACpC,aAAQ,GAAR,QAAQ,CAAW;QAnB1C,cAAS,GAAgB,IAAI,CAAC,cAAc,EAAE,CAAC;QAE/C,eAAU,GAAG,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAC3D,IAAI,CAAC,UAAU,CAAC,aAAa,EAC7B,UAAU,CAAC,SAAS,EACpB,aAAa,EACb,KAAK,CACR,CAAC;QAIF,iBAAY,GAAG,EAAE,CAAC;QAGlB,sBAAiB,GAAG,sBAAsB,CAAC;QAQvC,OAAO,CAAC,SAAS,CAAC;YACd,KAAI,CAAC,YAAY,EAAE,CAAC;SACvB,CAAC,CAAC;KACN;IAED,sBAAI,wCAAK;aAAT;YACI,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;SACzE;;;OAAA;IAED,2CAAW,GAAX;QACI,IAAI,CAAC,YAAY,EAAE,CAAC;KACvB;IAEO,4CAAY,GAApB;QACI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACb,OAAO;SACV;QAED,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,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Y,EAAE,CAAC,qBAAqB,CAAC;YACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;SACnC,CAAC;OACW,kBAAkB,CAAG;IAAD,yBAAC;CAAlC;;ACRA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-directives-lazy-loading.js","sources":["ng://@taiga-ui/kit/directives/lazy-loading/lazy-loading.service.ts","ng://@taiga-ui/kit/directives/lazy-loading/lazy-loading.directive.ts","ng://@taiga-ui/kit/directives/lazy-loading/lazy-loading.module.ts","ng://@taiga-ui/kit/directives/lazy-loading/taiga-ui-kit-directives-lazy-loading.ts"],"sourcesContent":["import {ChangeDetectorRef, Inject, Injectable} from '@angular/core';\nimport {IntersectionObserverService} from '@ng-web-apis/intersection-observer';\nimport {TuiDestroyService, watch} from '@taiga-ui/cdk';\nimport {Observable, of, Subject} from 'rxjs';\nimport {catchError, filter, mapTo, switchMap, take, takeUntil} from 'rxjs/operators';\n\n@Injectable()\nexport class TuiLazyLoadingService extends Observable<string> {\n private readonly src$ = new Subject<string>();\n\n constructor(\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(IntersectionObserverService)\n intersections$: Observable<IntersectionObserverEntry[]>,\n ) {\n super(subscriber =>\n this.src$\n .pipe(\n switchMap(src =>\n intersections$.pipe(\n filter(([{isIntersecting}]) => isIntersecting),\n mapTo(src),\n catchError(() => of(src)),\n watch(changeDetectorRef),\n take(1),\n ),\n ),\n takeUntil(destroy$),\n )\n .subscribe(subscriber),\n );\n }\n\n next(src: string) {\n this.src$.next(src);\n }\n}\n","import {\n Directive,\n ElementRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n} from '@angular/core';\nimport {IntersectionObserverService} from '@ng-web-apis/intersection-observer';\nimport {TuiDestroyService} from '@taiga-ui/cdk';\n\nimport {TuiLazyLoadingService} from './lazy-loading.service';\n\n@Directive({\n selector: 'img[loading=\"lazy\"]',\n providers: [TuiLazyLoadingService, IntersectionObserverService, TuiDestroyService],\n})\nexport class TuiLazyLoadingDirective {\n @Input('src')\n set srcSetter(src: string) {\n this.src = this.supported ? src : null;\n this.src$.next(src);\n }\n\n @HostBinding('style.animation')\n animation = 'tuiSkeletonVibe ease-in-out 1s infinite alternate';\n\n @HostBinding('style.background')\n background = 'rgba(0, 0, 0, .16)';\n\n @HostBinding('attr.src')\n src: string | null = null;\n\n constructor(\n @Inject(TuiLazyLoadingService)\n private readonly src$: TuiLazyLoadingService,\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLImageElement>,\n ) {\n if (!this.supported) {\n this.src$.subscribe(src => {\n this.src = src;\n });\n }\n }\n\n private get supported() {\n return 'loading' in this.elementRef.nativeElement;\n }\n\n @HostListener('load')\n onLoad() {\n this.background = '';\n this.animation = '';\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiLazyLoadingDirective} from './lazy-loading.directive';\n\n@NgModule({\n declarations: [TuiLazyLoadingDirective],\n exports: [TuiLazyLoadingDirective],\n})\nexport class TuiLazyLoadingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;IAO2C,yCAAkB;IAGzD,+BAC+B,iBAAoC,EACpC,QAA0B,EAErD,cAAuD;QAJ3D,YAMI,kBAAM,UAAA,UAAU;YACZ,OAAA,KAAI,CAAC,IAAI;iBACJ,IAAI,CACD,SAAS,CAAC,UAAA,GAAG;gBACT,OAAA,cAAc,CAAC,IAAI,CACf,MAAM,CAAC,UAAC,EAAkB;wBAAlB,kBAAkB,EAAhB,qCAAc;oBAAO,OAAA,cAAc;iBAAA,CAAC,EAC9C,KAAK,CAAC,GAAG,CAAC,EACV,UAAU,CAAC,cAAM,OAAA,EAAE,CAAC,GAAG,CAAC,GAAA,CAAC,EACzB,KAAK,CAAC,iBAAiB,CAAC,EACxB,IAAI,CAAC,CAAC,CAAC,CACV;aAAA,CACJ,EAC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CAAC,UAAU,CAAC,aAAa,CAAC;SACrD;;;OAAA;IAGD,wCAAM,GAAN;QACI,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;KACvB;;gBAnB0B,qBAAqB,uBAD3C,MAAM,SAAC,qBAAqB;gBAGA,UAAU,uBADtC,MAAM,SAAC,UAAU;;IAjBtB;QADC,KAAK,CAAC,KAAK,CAAC;4DAIZ;IAGD;QADC,WAAW,CAAC,iBAAiB,CAAC;8DACiC;IAGhE;QADC,WAAW,CAAC,kBAAkB,CAAC;+DACE;IAGlC;QADC,WAAW,CAAC,UAAU,CAAC;wDACE;IAoB1B;QADC,YAAY,CAAC,MAAM,CAAC;yDAIpB;IArCQ,uBAAuB;QAJnC,SAAS,CAAC;YACP,QAAQ,EAAE,qBAAqB;YAC/B,SAAS,EAAE,CAAC,qBAAqB,EAAE,2BAA2B,EAAE,iBAAiB,CAAC;SACrF,CAAC;QAkBO,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;QAE7B,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;OAnBd,uBAAuB,CAsCnC;IAAD,8BAAC;CAtCD;;;ICTA;KAAoC;IAAvB,oBAAoB;QAJhC,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,uBAAuB,CAAC;YACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;SACrC,CAAC;OACW,oBAAoB,CAAG;IAAD,2BAAC;CAApC;;ACRA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-directives-lazy-loading.js","sources":["ng://@taiga-ui/kit/directives/lazy-loading/lazy-loading.service.ts","ng://@taiga-ui/kit/directives/lazy-loading/lazy-loading.directive.ts","ng://@taiga-ui/kit/directives/lazy-loading/lazy-loading.module.ts","ng://@taiga-ui/kit/directives/lazy-loading/taiga-ui-kit-directives-lazy-loading.ts"],"sourcesContent":["import {ChangeDetectorRef, Inject, Injectable} from '@angular/core';\nimport {IntersectionObserverService} from '@ng-web-apis/intersection-observer';\nimport {TuiDestroyService, watch} from '@taiga-ui/cdk';\nimport {Observable, of, Subject} from 'rxjs';\nimport {catchError, filter, mapTo, switchMap, take, takeUntil} from 'rxjs/operators';\n\n@Injectable()\nexport class TuiLazyLoadingService extends Observable<string> {\n private readonly src$ = new Subject<string>();\n\n constructor(\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(IntersectionObserverService)\n intersections$: Observable<IntersectionObserverEntry[]>,\n ) {\n super(subscriber =>\n this.src$\n .pipe(\n switchMap(src =>\n intersections$.pipe(\n filter(([{isIntersecting}]) => isIntersecting),\n mapTo(src),\n catchError(() => of(src)),\n watch(changeDetectorRef),\n take(1),\n ),\n ),\n takeUntil(destroy$),\n )\n .subscribe(subscriber),\n );\n }\n\n next(src: string): void {\n this.src$.next(src);\n }\n}\n","import {\n Directive,\n ElementRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n} from '@angular/core';\nimport {IntersectionObserverService} from '@ng-web-apis/intersection-observer';\nimport {TuiDestroyService} from '@taiga-ui/cdk';\n\nimport {TuiLazyLoadingService} from './lazy-loading.service';\n\n@Directive({\n selector: 'img[loading=\"lazy\"]',\n providers: [TuiLazyLoadingService, IntersectionObserverService, TuiDestroyService],\n})\nexport class TuiLazyLoadingDirective {\n @Input('src')\n set srcSetter(src: string) {\n this.src = this.supported ? src : null;\n this.src$.next(src);\n }\n\n @HostBinding('style.animation')\n animation = 'tuiSkeletonVibe ease-in-out 1s infinite alternate';\n\n @HostBinding('style.background')\n background = 'rgba(0, 0, 0, .16)';\n\n @HostBinding('attr.src')\n src: string | null = null;\n\n constructor(\n @Inject(TuiLazyLoadingService)\n private readonly src$: TuiLazyLoadingService,\n @Inject(ElementRef)\n private readonly elementRef: ElementRef<HTMLImageElement>,\n ) {\n if (!this.supported) {\n this.src$.subscribe(src => {\n this.src = src;\n });\n }\n }\n\n private get supported(): boolean {\n return 'loading' in this.elementRef.nativeElement;\n }\n\n @HostListener('load')\n onLoad(): void {\n this.background = '';\n this.animation = '';\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiLazyLoadingDirective} from './lazy-loading.directive';\n\n@NgModule({\n declarations: [TuiLazyLoadingDirective],\n exports: [TuiLazyLoadingDirective],\n})\nexport class TuiLazyLoadingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;IAO2C,yCAAkB;IAGzD,+BAC+B,iBAAoC,EACpC,QAA0B,EAErD,cAAuD;QAJ3D,YAMI,kBAAM,UAAA,UAAU;YACZ,OAAA,KAAI,CAAC,IAAI;iBACJ,IAAI,CACD,SAAS,CAAC,UAAA,GAAG;gBACT,OAAA,cAAc,CAAC,IAAI,CACf,MAAM,CAAC,UAAC,EAAkB;wBAAlB,kBAAkB,EAAhB,qCAAc;oBAAO,OAAA,cAAc;iBAAA,CAAC,EAC9C,KAAK,CAAC,GAAG,CAAC,EACV,UAAU,CAAC,cAAM,OAAA,EAAE,CAAC,GAAG,CAAC,GAAA,CAAC,EACzB,KAAK,CAAC,iBAAiB,CAAC,EACxB,IAAI,CAAC,CAAC,CAAC,CACV;aAAA,CACJ,EACD,SAAS,CAAC,QAAQ,CAAC,CACtB;iBACA,SAAS,CAAC,UAAU,CAAC;SAAA,CAC7B,SACJ;QAxBgB,UAAI,GAAG,IAAI,OAAO,EAAU,CAAC;;KAwB7C;IAED,oCAAI,GAAJ,UAAK,GAAW;QACZ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACvB;;gBAzBiD,iBAAiB,uBAA9D,MAAM,SAAC,iBAAiB;gBACY,UAAU,uBAA9C,MAAM,SAAC,iBAAiB;gBAET,UAAU,uBADzB,MAAM,SAAC,2BAA2B;;IAN9B,qBAAqB;QADjC,UAAU,EAAE;QAKJ,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACz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,CAAC;yDAIpB;IArCQ,uBAAuB;QAJnC,SAAS,CAAC;YACP,QAAQ,EAAE,qBAAqB;YAC/B,SAAS,EAAE,CAAC,qBAAqB,EAAE,2BAA2B,EAAE,iBAAiB,CAAC;SACrF,CAAC;QAkBO,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;QAE7B,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;OAnBd,uBAAuB,CAsCnC;IAAD,8BAAC;CAtCD;;;ICTA;KAAoC;IAAvB,oBAAoB;QAJhC,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,uBAAuB,CAAC;YACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;SACrC,CAAC;OACW,oBAAoB,CAAG;IAAD,2BAAC;CAApC;;ACRA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-directives-present.js","sources":["ng://@taiga-ui/kit/directives/present/present.directive.ts","ng://@taiga-ui/kit/directives/present/present.module.ts","ng://@taiga-ui/kit/directives/present/taiga-ui-kit-directives-present.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n HostListener,\n Inject,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {USER_AGENT} from '@ng-web-apis/common';\nimport {isCurrentTarget, isFirefox, TuiDirectiveStylesService} from '@taiga-ui/cdk';\nimport {Observable, Subject} from 'rxjs';\nimport {distinctUntilChanged, skip, startWith} from 'rxjs/operators';\n\nconst STYLE = `\n@keyframes tuiPresent {\n from {\n content: '1';\n }\n\n to {\n content: '2';\n }\n}\n\n.tui-present {\n animation: tuiPresent 1000s infinite;\n}`;\n\n@Directive({\n selector: '[tuiPresentChange]',\n host: {\n class: 'tui-present',\n },\n})\nexport class TuiPresentDirective implements OnDestroy {\n private readonly visibility$ = new Subject<boolean>();\n private readonly observer?: MutationObserver;\n\n @Output()\n readonly tuiPresentChange: Observable<boolean>;\n\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(TuiDirectiveStylesService) directiveStyles: TuiDirectiveStylesService,\n @Inject(USER_AGENT) userAgent: string,\n ) {\n directiveStyles.addStyle(STYLE, 'TuiPresentDirective');\n\n this.tuiPresentChange = this.visibility$.pipe(\n startWith(false),\n distinctUntilChanged(),\n skip(1),\n );\n\n if (isFirefox(userAgent)) {\n return;\n }\n\n this.observer = new MutationObserver(() => {\n if (\n !nativeElement.offsetParent &&\n nativeElement.offsetWidth === 0 &&\n nativeElement.offsetHeight === 0\n ) {\n this.visibility$.next(false);\n }\n });\n\n this.observer.observe(nativeElement, {\n attributes: true,\n attributeFilter: ['style', 'class'],\n });\n }\n\n /**\n * Someday animationcancel would work and mutation observer would not be needed:\n * https://drafts.csswg.org/css-animations/#eventdef-animationevent-animationcancel\n * It would also trigger on CSS like display: none on parent nodes which is awesome\n * but currently only works in Firefox\n */\n @HostListener('animationcancel', ['$event', 'false'])\n @HostListener('animationstart', ['$event', 'true'])\n onAnimation(event: Event, visibility: boolean) {\n if (isCurrentTarget(event)) {\n this.visibility$.next(visibility);\n }\n }\n\n ngOnDestroy() {\n this.visibility$.next(false);\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiPresentDirective} from './present.directive';\n\n@NgModule({\n declarations: [TuiPresentDirective],\n exports: [TuiPresentDirective],\n})\nexport class TuiPresentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAaA,IAAM,KAAK,GAAG,kLAaZ,CAAC;;IAeC,6BACwB,EAAwC,EACzB,eAA0C,EACzD,SAAiB;QAHzC,iBA+BC;YA9BwB,gCAAa;QAPrB,gBAAW,GAAG,IAAI,OAAO,EAAW,CAAC;QAWlD,eAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;QAEvD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CACzC,SAAS,CAAC,KAAK,CAAC,EAChB,oBAAoB,EAAE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AM,CAAC,yBAAyB,CAAC,CAAA;QACjC,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;OAVd,mBAAmB,CAyD/B;IAAD,0BAAC;CAzDD;;;IC1BA;KAAgC;IAAnB,gBAAgB;QAJ5B,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;YACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;SACjC,CAAC;OACW,gBAAgB,CAAG;IAAD,uBAAC;CAAhC;;ACRA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-directives-present.js","sources":["ng://@taiga-ui/kit/directives/present/present.directive.ts","ng://@taiga-ui/kit/directives/present/present.module.ts","ng://@taiga-ui/kit/directives/present/taiga-ui-kit-directives-present.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n HostListener,\n Inject,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {USER_AGENT} from '@ng-web-apis/common';\nimport {isCurrentTarget, isFirefox, TuiDirectiveStylesService} from '@taiga-ui/cdk';\nimport {Observable, Subject} from 'rxjs';\nimport {distinctUntilChanged, skip, startWith} from 'rxjs/operators';\n\nconst STYLE = `\n@keyframes tuiPresent {\n from {\n content: '1';\n }\n\n to {\n content: '2';\n }\n}\n\n.tui-present {\n animation: tuiPresent 1000s infinite;\n}`;\n\n@Directive({\n selector: '[tuiPresentChange]',\n host: {\n class: 'tui-present',\n },\n})\nexport class TuiPresentDirective implements OnDestroy {\n private readonly visibility$ = new Subject<boolean>();\n private readonly observer?: MutationObserver;\n\n @Output()\n readonly tuiPresentChange: Observable<boolean>;\n\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(TuiDirectiveStylesService) directiveStyles: TuiDirectiveStylesService,\n @Inject(USER_AGENT) userAgent: string,\n ) {\n directiveStyles.addStyle(STYLE, 'TuiPresentDirective');\n\n this.tuiPresentChange = this.visibility$.pipe(\n startWith(false),\n distinctUntilChanged(),\n skip(1),\n );\n\n if (isFirefox(userAgent)) {\n return;\n }\n\n this.observer = new MutationObserver(() => {\n if (\n !nativeElement.offsetParent &&\n nativeElement.offsetWidth === 0 &&\n nativeElement.offsetHeight === 0\n ) {\n this.visibility$.next(false);\n }\n });\n\n this.observer.observe(nativeElement, {\n attributes: true,\n attributeFilter: ['style', 'class'],\n });\n }\n\n /**\n * Someday animationcancel would work and mutation observer would not be needed:\n * https://drafts.csswg.org/css-animations/#eventdef-animationevent-animationcancel\n * It would also trigger on CSS like display: none on parent nodes which is awesome\n * but currently only works in Firefox\n */\n @HostListener('animationcancel', ['$event', 'false'])\n @HostListener('animationstart', ['$event', 'true'])\n onAnimation(event: Event, visibility: boolean): void {\n if (isCurrentTarget(event)) {\n this.visibility$.next(visibility);\n }\n }\n\n ngOnDestroy(): void {\n this.visibility$.next(false);\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiPresentDirective} from './present.directive';\n\n@NgModule({\n declarations: [TuiPresentDirective],\n exports: [TuiPresentDirective],\n})\nexport class TuiPresentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAaA,IAAM,KAAK,GAAG,kLAaZ,CAAC;;IAeC,6BACwB,EAAwC,EACzB,eAA0C,EACzD,SAAiB;QAHzC,iBA+BC;YA9BwB,gCAAa;QAPrB,gBAAW,GAAG,IAAI,OAAO,EAAW,CAAC;QAWlD,eAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;QAEvD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CACzC,SAAS,CAAC,KAAK,CAAC,EAChB,oBAAoB,EAAE,EACtB,IAAI,CAAC,CAAC,CAAC,CACV,CAAC;QAEF,IAAI,SAAS,CAAC,SAAS,CAAC,EAAE;YACtB,OAAO;SACV;QAED,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC;YACjC,IACI,CAAC,aAAa,CAAC,YAAY;gBA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C,mBAAmB,CAAC;YACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;SACjC,CAAC;OACW,gBAAgB,CAAG;IAAD,uBAAC;CAAhC;;ACRA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-directives-project-class.js","sources":["ng://@taiga-ui/kit/directives/project-class/project-class.directive.ts","ng://@taiga-ui/kit/directives/project-class/project-class.module.ts","ng://@taiga-ui/kit/directives/project-class/taiga-ui-kit-directives-project-class.ts"],"sourcesContent":["import {AfterViewChecked, Directive, ElementRef, Inject, Input} from '@angular/core';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\n\n/**\n * A directive for projecting classes from nested children to host\n */\n@Directive({\n selector: '[tuiProjectClass]',\n})\nexport class TuiProjectClassDirective implements AfterViewChecked {\n @Input('tuiProjectClass')\n @tuiDefaultProp()\n classNames: readonly string[] = [];\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n ) {}\n\n ngAfterViewChecked() {\n if (!this.classNames.length) {\n return;\n }\n\n this.classNames.forEach(className => {\n const hostElement = this.elementRef.nativeElement;\n\n if (hostElement.querySelector(`.${className}`)) {\n hostElement.classList.add(className);\n } else {\n hostElement.classList.remove(className);\n }\n });\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiProjectClassDirective} from './project-class.directive';\n\n@NgModule({\n declarations: [TuiProjectClassDirective],\n exports: [TuiProjectClassDirective],\n})\nexport class TuiProjectClassModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;;;IAWI,kCACyC,UAAmC;QAAnC,eAAU,GAAV,UAAU,CAAyB;QAH5E,eAAU,GAAsB,EAAE,CAAC;KAI/B;IAEJ,qDAAkB,GAAlB;QAAA,iBAcC;QAbG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YACzB,OAAO;SACV;QAED,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAA,SAAS;YAC7B,IAAM,WAAW,GAAG,KAAI,CAAC,UAAU,CAAC,aAAa,CAAC;YAElD,IAAI,WAAW,CAAC,aAAa,CAAC,MAAI,SAAW,CAAC,EAAE;gBAC5C,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;aACxC;iBAAM;gBACH,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAC3C;SACJ,CAAC,CAAC;KACN;;gBAjBoD,UAAU,uBAA1D,MAAM,SAAC,UAAU;;IAHtB;QAFC,KAAK,CAAC,iBAAiB,CAAC;QACxB,cAAc,EAAE;gEACkB;IAH1B,wBAAwB;QAHpC,SAAS,CAAC;YACP,QAAQ,EAAE,mBAAmB;SAChC,CAAC;QAOO,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;OANd,wBAAwB,CAwBpC;IAAD,+BAAC;CAxBD;;;ICDA;KAAqC;IAAxB,qBAAqB;QAJjC,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,wBAAwB,CAAC;YACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;SACtC,CAAC;OACW,qBAAqB,CAAG;IAAD,4BAAC;CAArC;;ACRA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-directives-project-class.js","sources":["ng://@taiga-ui/kit/directives/project-class/project-class.directive.ts","ng://@taiga-ui/kit/directives/project-class/project-class.module.ts","ng://@taiga-ui/kit/directives/project-class/taiga-ui-kit-directives-project-class.ts"],"sourcesContent":["import {AfterViewChecked, Directive, ElementRef, Inject, Input} from '@angular/core';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\n\n/**\n * A directive for projecting classes from nested children to host\n */\n@Directive({\n selector: '[tuiProjectClass]',\n})\nexport class TuiProjectClassDirective implements AfterViewChecked {\n @Input('tuiProjectClass')\n @tuiDefaultProp()\n classNames: readonly string[] = [];\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n ) {}\n\n ngAfterViewChecked(): void {\n if (!this.classNames.length) {\n return;\n }\n\n this.classNames.forEach(className => {\n const hostElement = this.elementRef.nativeElement;\n\n if (hostElement.querySelector(`.${className}`)) {\n hostElement.classList.add(className);\n } else {\n hostElement.classList.remove(className);\n }\n });\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiProjectClassDirective} from './project-class.directive';\n\n@NgModule({\n declarations: [TuiProjectClassDirective],\n exports: [TuiProjectClassDirective],\n})\nexport class TuiProjectClassModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;;;IAWI,kCACyC,UAAmC;QAAnC,eAAU,GAAV,UAAU,CAAyB;QAH5E,eAAU,GAAsB,EAAE,CAAC;KAI/B;IAEJ,qDAAkB,GAAlB;QAAA,iBAcC;QAbG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YACzB,OAAO;SACV;QAED,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAA,SAAS;YAC7B,IAAM,WAAW,GAAG,KAAI,CAAC,UAAU,CAAC,aAAa,CAAC;YAElD,IAAI,WAAW,CAAC,aAAa,CAAC,MAAI,SAAW,CAAC,EAAE;gBAC5C,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;aACxC;iBAAM;gBACH,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aAC3C;SACJ,CAAC,CAAC;KACN;;gBAjBoD,UAAU,uBAA1D,MAAM,SAAC,UAAU;;IAHtB;QAFC,KAAK,CAAC,iBAAiB,CAAC;QACxB,cAAc,EAAE;gEACkB;IAH1B,wBAAwB;QAHpC,SAAS,CAAC;YACP,QAAQ,EAAE,mBAAmB;SAChC,CAAC;QAOO,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;OANd,wBAAwB,CAwBpC;IAAD,+BAAC;CAxBD;;;ICDA;KAAqC;IAAxB,qBAAqB;QAJjC,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,wBAAwB,CAAC;YACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;SACtC,CAAC;OACW,qBAAqB,CAAG;IAAD,4BAAC;CAArC;;ACRA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-internal-primitive-calendar-range.js","sources":["ng://@taiga-ui/kit/internal/primitive-calendar-range/primitive-calendar-range.component.ts","ng://@taiga-ui/kit/internal/primitive-calendar-range/primitive-calendar-range.module.ts","ng://@taiga-ui/kit/internal/primitive-calendar-range/taiga-ui-kit-internal-primitive-calendar-range.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Inject,\n Input,\n OnInit,\n Optional,\n Output,\n} from '@angular/core';\nimport {\n ALWAYS_FALSE_HANDLER,\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiBooleanHandler,\n TuiDay,\n TuiDayRange,\n tuiDefaultProp,\n TuiDestroyService,\n TuiMapper,\n TuiMonth,\n watch,\n} from '@taiga-ui/cdk';\nimport {TUI_DEFAULT_MARKER_HANDLER, TuiMarkerHandler} from '@taiga-ui/core';\nimport {TUI_CALENDAR_DATA_STREAM} from '@taiga-ui/kit/tokens';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * @internal\n */\n@Component({\n selector: 'tui-primitive-calendar-range',\n templateUrl: './primitive-calendar-range.template.html',\n styleUrls: ['./primitive-calendar-range.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService],\n})\nexport class TuiPrimitiveCalendarRangeComponent implements OnInit {\n @Input()\n @tuiDefaultProp()\n disabledItemHandler: TuiBooleanHandler<TuiDay> = ALWAYS_FALSE_HANDLER;\n\n @Input()\n @tuiDefaultProp()\n markerHandler: TuiMarkerHandler = TUI_DEFAULT_MARKER_HANDLER;\n\n @Input()\n @tuiDefaultProp()\n defaultViewedMonthFirst = TuiMonth.currentLocal();\n\n @Input()\n @tuiDefaultProp()\n defaultViewedMonthSecond = TuiMonth.currentLocal().append({month: 1});\n\n @Input()\n @tuiDefaultProp()\n min = TUI_FIRST_DAY;\n\n @Input()\n @tuiDefaultProp()\n max = TUI_LAST_DAY;\n\n @Input()\n @tuiDefaultProp()\n value: TuiDayRange | null = null;\n\n @Output()\n readonly dayClick = new EventEmitter<TuiDay>();\n\n hoveredItem: TuiDay | null = null;\n\n userViewedMonthFirst: TuiMonth = this.defaultViewedMonthFirst;\n userViewedMonthSecond: TuiMonth = this.defaultViewedMonthSecond;\n\n constructor(\n @Inject(TUI_CALENDAR_DATA_STREAM)\n @Optional()\n valueChanges: Observable<TuiDayRange | null> | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TuiDestroyService) destroy$: TuiDestroyService,\n ) {\n if (!valueChanges) {\n return;\n }\n\n valueChanges\n .pipe(watch(changeDetectorRef), takeUntil(destroy$))\n .subscribe(value => {\n this.value = value;\n this.updateViewedMonths();\n });\n }\n\n get cappedUserViewedMonthSecond(): TuiMonth {\n return this.userViewedMonthSecond.monthBefore(this.max)\n ? this.userViewedMonthSecond\n : this.max;\n }\n\n get cappedUserViewedMonthFirst(): TuiMonth {\n return this.userViewedMonthFirst.monthSameOrBefore(this.userViewedMonthSecond)\n ? this.userViewedMonthFirst\n : this.userViewedMonthSecond;\n }\n\n monthOffset: TuiMapper<TuiMonth, TuiMonth> = (value, offset: number) =>\n value.append({month: offset});\n\n ngOnInit() {\n this.setInitialMonths();\n }\n\n onSectionFirstViewedMonth(month: TuiMonth) {\n this.userViewedMonthFirst = month;\n\n if (this.userViewedMonthSecond.year < this.userViewedMonthFirst.year) {\n this.userViewedMonthSecond = this.userViewedMonthSecond.append({\n year: month.year - this.userViewedMonthSecond.year,\n });\n }\n }\n\n onSectionSecondViewedMonth(month: TuiMonth) {\n this.userViewedMonthSecond = month;\n\n if (this.userViewedMonthFirst.year > this.userViewedMonthSecond.year) {\n this.userViewedMonthFirst = this.userViewedMonthFirst.append({\n year: month.year - this.userViewedMonthFirst.year,\n });\n }\n }\n\n onDayClick(day: TuiDay) {\n this.dayClick.emit(day);\n }\n\n private setInitialMonths() {\n if (!this.value) {\n this.userViewedMonthSecond = this.updatedViewedMonthSecond(\n this.defaultViewedMonthSecond,\n );\n\n this.userViewedMonthFirst = this.updatedViewedMonthFirst(\n this.defaultViewedMonthFirst,\n );\n }\n }\n\n private updatedViewedMonthSecond(month: TuiMonth) {\n if (month.monthSameOrAfter(this.max)) {\n return this.max;\n }\n\n if (month.monthBefore(this.min)) {\n return this.min.append({month: 1});\n }\n\n return month;\n }\n\n private updatedViewedMonthFirst(month: TuiMonth) {\n if (month.monthSameOrAfter(this.userViewedMonthSecond)) {\n return this.userViewedMonthSecond.append({month: -1});\n }\n\n if (month.monthSameOrBefore(this.min)) {\n return this.min;\n }\n\n return month;\n }\n\n private updateViewedMonths() {\n this.userViewedMonthFirst =\n this.value === null ? this.defaultViewedMonthFirst : this.value.from;\n this.userViewedMonthSecond =\n this.value === null ? this.defaultViewedMonthSecond : this.value.to;\n\n if (this.userViewedMonthFirst.monthSame(this.userViewedMonthSecond)) {\n this.userViewedMonthSecond = this.userViewedMonthSecond.append({month: 1});\n }\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiMapperPipeModule} from '@taiga-ui/cdk';\nimport {TuiCalendarModule, TuiScrollbarModule} from '@taiga-ui/core';\n\nimport {TuiPrimitiveCalendarRangeComponent} from './primitive-calendar-range.component';\n\n/**\n * @internal\n */\n@NgModule({\n imports: [TuiMapperPipeModule, TuiScrollbarModule, TuiCalendarModule],\n declarations: [TuiPrimitiveCalendarRangeComponent],\n exports: [TuiPrimitiveCalendarRangeComponent],\n})\nexport class TuiPrimitiveCalendarRangeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AA6BA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uBAA9D,MAAM,SAAC,iBAAiB;gBACY,iBAAiB,uBAArD,MAAM,SAAC,iBAAiB;;IAvC7B;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;mFACqD;IAItE;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;6EAC4C;IAI7D;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;uFACiC;IAIlD;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;wFACqD;IAItE;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;mEACG;IAIpB;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;mEACE;IAInB;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;qEACgB;IAGjC;QADC,MAAM,EAAE;wEACsC;IA9BtC,kCAAkC;QAP9C,SAAS,CAAC;YACP,QAAQ,EAAE,8BAA8B;YACxC,w8BAAuD;YAEvD,eAAe,EAAE,uBAAuB,CAAC,MAAM;YAC/C,SAAS,EAAE,CAAC,iBAAiB,CAAC;;SACjC,CAAC;QAuCO,WAAA,MAAM,CAAC,wBAAwB,CAAC,CAAA;QAChC,WAAA,QAAQ,EAAE,CAAA;QAEV,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;OA1CrB,kCAAkC,CAiJ9C;IAAD,yCAAC;CAjJD;;ACjCA;;;;IAQA;KAA+C;IAAlC,+BAA+B;QAL3C,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;YACrE,YAAY,EAAE,CAAC,kCAAkC,CAAC;YAClD,OAAO,EAAE,CAAC,kCAAkC,CAAC;SAChD,CAAC;OACW,+BAA+B,CAAG;IAAD,sCAAC;CAA/C;;ACdA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-internal-primitive-calendar-range.js","sources":["ng://@taiga-ui/kit/internal/primitive-calendar-range/primitive-calendar-range.component.ts","ng://@taiga-ui/kit/internal/primitive-calendar-range/primitive-calendar-range.module.ts","ng://@taiga-ui/kit/internal/primitive-calendar-range/taiga-ui-kit-internal-primitive-calendar-range.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Inject,\n Input,\n OnInit,\n Optional,\n Output,\n} from '@angular/core';\nimport {\n ALWAYS_FALSE_HANDLER,\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiBooleanHandler,\n TuiDay,\n TuiDayRange,\n tuiDefaultProp,\n TuiDestroyService,\n TuiMapper,\n TuiMonth,\n watch,\n} from '@taiga-ui/cdk';\nimport {TUI_DEFAULT_MARKER_HANDLER, TuiMarkerHandler} from '@taiga-ui/core';\nimport {TUI_CALENDAR_DATA_STREAM} from '@taiga-ui/kit/tokens';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * @internal\n */\n@Component({\n selector: 'tui-primitive-calendar-range',\n templateUrl: './primitive-calendar-range.template.html',\n styleUrls: ['./primitive-calendar-range.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService],\n})\nexport class TuiPrimitiveCalendarRangeComponent implements OnInit {\n @Input()\n @tuiDefaultProp()\n disabledItemHandler: TuiBooleanHandler<TuiDay> = ALWAYS_FALSE_HANDLER;\n\n @Input()\n @tuiDefaultProp()\n markerHandler: TuiMarkerHandler = TUI_DEFAULT_MARKER_HANDLER;\n\n @Input()\n @tuiDefaultProp()\n defaultViewedMonthFirst = TuiMonth.currentLocal();\n\n @Input()\n @tuiDefaultProp()\n defaultViewedMonthSecond = TuiMonth.currentLocal().append({month: 1});\n\n @Input()\n @tuiDefaultProp()\n min = TUI_FIRST_DAY;\n\n @Input()\n @tuiDefaultProp()\n max = TUI_LAST_DAY;\n\n @Input()\n @tuiDefaultProp()\n value: TuiDayRange | null = null;\n\n @Output()\n readonly dayClick = new EventEmitter<TuiDay>();\n\n hoveredItem: TuiDay | null = null;\n\n userViewedMonthFirst: TuiMonth = this.defaultViewedMonthFirst;\n userViewedMonthSecond: TuiMonth = this.defaultViewedMonthSecond;\n\n constructor(\n @Inject(TUI_CALENDAR_DATA_STREAM)\n @Optional()\n valueChanges: Observable<TuiDayRange | null> | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TuiDestroyService) destroy$: TuiDestroyService,\n ) {\n if (!valueChanges) {\n return;\n }\n\n valueChanges\n .pipe(watch(changeDetectorRef), takeUntil(destroy$))\n .subscribe(value => {\n this.value = value;\n this.updateViewedMonths();\n });\n }\n\n get cappedUserViewedMonthSecond(): TuiMonth {\n return this.userViewedMonthSecond.monthBefore(this.max)\n ? this.userViewedMonthSecond\n : this.max;\n }\n\n get cappedUserViewedMonthFirst(): TuiMonth {\n return this.userViewedMonthFirst.monthSameOrBefore(this.userViewedMonthSecond)\n ? this.userViewedMonthFirst\n : this.userViewedMonthSecond;\n }\n\n monthOffset: TuiMapper<TuiMonth, TuiMonth> = (value, offset: number) =>\n value.append({month: offset});\n\n ngOnInit(): void {\n this.setInitialMonths();\n }\n\n onSectionFirstViewedMonth(month: TuiMonth): void {\n this.userViewedMonthFirst = month;\n\n if (this.userViewedMonthSecond.year < this.userViewedMonthFirst.year) {\n this.userViewedMonthSecond = this.userViewedMonthSecond.append({\n year: month.year - this.userViewedMonthSecond.year,\n });\n }\n }\n\n onSectionSecondViewedMonth(month: TuiMonth): void {\n this.userViewedMonthSecond = month;\n\n if (this.userViewedMonthFirst.year > this.userViewedMonthSecond.year) {\n this.userViewedMonthFirst = this.userViewedMonthFirst.append({\n year: month.year - this.userViewedMonthFirst.year,\n });\n }\n }\n\n onDayClick(day: TuiDay): void {\n this.dayClick.emit(day);\n }\n\n private setInitialMonths(): void {\n if (!this.value) {\n this.userViewedMonthSecond = this.updatedViewedMonthSecond(\n this.defaultViewedMonthSecond,\n );\n\n this.userViewedMonthFirst = this.updatedViewedMonthFirst(\n this.defaultViewedMonthFirst,\n );\n }\n }\n\n private updatedViewedMonthSecond(month: TuiMonth): TuiMonth {\n if (month.monthSameOrAfter(this.max)) {\n return this.max;\n }\n\n if (month.monthBefore(this.min)) {\n return this.min.append({month: 1});\n }\n\n return month;\n }\n\n private updatedViewedMonthFirst(month: TuiMonth): TuiMonth {\n if (month.monthSameOrAfter(this.userViewedMonthSecond)) {\n return this.userViewedMonthSecond.append({month: -1});\n }\n\n if (month.monthSameOrBefore(this.min)) {\n return this.min;\n }\n\n return month;\n }\n\n private updateViewedMonths(): void {\n this.userViewedMonthFirst =\n this.value === null ? this.defaultViewedMonthFirst : this.value.from;\n this.userViewedMonthSecond =\n this.value === null ? this.defaultViewedMonthSecond : this.value.to;\n\n if (this.userViewedMonthFirst.monthSame(this.userViewedMonthSecond)) {\n this.userViewedMonthSecond = this.userViewedMonthSecond.append({month: 1});\n }\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiMapperPipeModule} from '@taiga-ui/cdk';\nimport {TuiCalendarModule, TuiScrollbarModule} from '@taiga-ui/core';\n\nimport {TuiPrimitiveCalendarRangeComponent} from './primitive-calendar-range.component';\n\n/**\n * @internal\n */\n@NgModule({\n imports: [TuiMapperPipeModule, TuiScrollbarModule, TuiCalendarModule],\n declarations: [TuiPrimitiveCalendarRangeComponent],\n exports: [TuiPrimitiveCalendarRangeComponent],\n})\nexport class TuiPrimitiveCalendarRangeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AA6BA;;;;IA+CI,4CAGI,YAAmD,EACxB,iBAAoC,EACpC,QAA2B;QAL1D,iBAiBC;QAnDD,wBAAmB,GAA8B,oBAAoB,CAAC;QAItE,kBAAa,GAAqB,0BAA0B,CAAC;QAI7D,4BAAuB,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;QAIlD,6BAAwB,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,EAAC,KAAK,EAAE,CAAC,EAAC,CAAC,CAAC;Q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c,EAAE;mEACG;IAIpB;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;mEACE;IAInB;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;qEACgB;IAGjC;QADC,MAAM,EAAE;wEACsC;IA9BtC,kCAAkC;QAP9C,SAAS,CAAC;YACP,QAAQ,EAAE,8BAA8B;YACxC,w8BAAuD;YAEvD,eAAe,EAAE,uBAAuB,CAAC,MAAM;YAC/C,SAAS,EAAE,CAAC,iBAAiB,CAAC;;SACjC,CAAC;QAuCO,WAAA,MAAM,CAAC,wBAAwB,CAAC,CAAA;QAChC,WAAA,QAAQ,EAAE,CAAA;QAEV,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;OA1CrB,kCAAkC,CAiJ9C;IAAD,yCAAC;CAjJD;;ACjCA;;;;IAQA;KAA+C;IAAlC,+BAA+B;QAL3C,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;YACrE,YAAY,EAAE,CAAC,kCAAkC,CAAC;YAClD,OAAO,EAAE,CAAC,kCAAkC,CAAC;SAChD,CAAC;OACW,+BAA+B,CAAG;IAAD,sCAAC;CAA/C;;ACdA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-pipes-field-error.js","sources":["ng://@taiga-ui/kit/pipes/field-error/field-error-pipe.ts","ng://@taiga-ui/kit/pipes/field-error/field-error-content-pipe.ts","ng://@taiga-ui/kit/pipes/field-error/field-error.module.ts","ng://@taiga-ui/kit/pipes/field-error/taiga-ui-kit-pipes-field-error.ts"],"sourcesContent":["import {Inject, Optional, Pipe, PipeTransform, Self} from '@angular/core';\nimport {\n AbstractControl,\n FormArrayName,\n FormGroupDirective,\n FormGroupName,\n NgControl,\n} from '@angular/forms';\nimport {tuiPure, TuiValidationError} from '@taiga-ui/cdk';\nimport {TUI_VALIDATION_ERRORS} from '@taiga-ui/kit/tokens';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {EMPTY, isObservable, merge, Observable, of} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nconst EMPTY_RECORD = {};\n\n// @dynamic\n@Pipe({\n name: 'tuiFieldError',\n pure: false,\n})\nexport class TuiFieldErrorPipe implements PipeTransform {\n private order: readonly string[] = [];\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n private readonly ngControl: NgControl | null,\n @Optional()\n @Self()\n @Inject(FormArrayName)\n private readonly formArrayName: FormArrayName | null,\n @Optional()\n @Self()\n @Inject(FormGroupName)\n private readonly formGroupName: FormGroupName | null,\n @Optional()\n @Self()\n @Inject(FormGroupDirective)\n private readonly formGroup: FormGroupDirective | null,\n @Inject(TUI_VALIDATION_ERRORS)\n private readonly validationErrors: Record<\n string,\n PolymorpheusContent | Observable<PolymorpheusContent>\n >,\n ) {\n if (this.ngControl && !this.ngControl.valueAccessor) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n transform(order: readonly string[]): Observable<TuiValidationError | null> {\n this.order = order;\n\n return this.computedError;\n }\n\n @tuiPure\n get change$(): Observable<unknown> {\n return merge(\n this.control?.valueChanges || EMPTY,\n this.control?.statusChanges || EMPTY,\n );\n }\n\n get computedError(): Observable<TuiValidationError | null> {\n return (this.invalid && this.touched && this.error) || of(null);\n }\n\n registerOnChange() {}\n\n registerOnTouched() {}\n\n setDisabledState() {}\n\n writeValue() {}\n\n private get error(): Observable<TuiValidationError> | null {\n const {errorId} = this;\n\n if (!errorId) {\n return null;\n }\n\n const firstError = this.controlErrors[errorId];\n const errorContent = this.validationErrors[errorId];\n\n return this.getError(firstError, errorContent);\n }\n\n private get invalid(): boolean {\n return !!this.control?.invalid;\n }\n\n private get touched(): boolean {\n return !!this.control?.touched;\n }\n\n private get control(): AbstractControl | null {\n return (\n this.ngControl?.control ||\n this.formArrayName?.control ||\n this.formGroupName?.control ||\n this.formGroup?.control ||\n null\n );\n }\n\n private get errorId(): string {\n return this.getErrorId(this.order, this.controlErrors);\n }\n\n private get controlErrors(): Record<string, any> {\n return this.control?.errors || EMPTY_RECORD;\n }\n\n @tuiPure\n private getErrorId(\n order: readonly string[],\n controlErrors: Record<string, any>,\n ): string {\n const id = order?.find(errorId => controlErrors[errorId]);\n const fallback = Object.keys(controlErrors)[0];\n\n return id || fallback || '';\n }\n\n @tuiPure\n private getError(\n firstError: any,\n errorContent?: PolymorpheusContent | Observable<PolymorpheusContent>,\n ): Observable<TuiValidationError> {\n if (firstError instanceof TuiValidationError) {\n return of(firstError);\n }\n\n if (errorContent === undefined && typeof firstError === 'string') {\n return of(new TuiValidationError(firstError));\n }\n\n if (isObservable(errorContent)) {\n return errorContent.pipe(\n map(error => new TuiValidationError(error || '', firstError)),\n );\n }\n\n return of(new TuiValidationError(errorContent || '', firstError));\n }\n}\n","import {AsyncPipe} from '@angular/common';\nimport {Inject, Injector, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiFieldErrorPipe} from './field-error-pipe';\n\n// @dynamic\n@Pipe({\n name: 'tuiFieldErrorContent',\n pure: false,\n})\nexport class TuiFieldErrorContentPipe implements PipeTransform, OnDestroy {\n private readonly localInjector = Injector.create({\n providers: [{provide: AsyncPipe}, {provide: TuiFieldErrorPipe}],\n parent: this.injector,\n });\n\n private readonly asyncPipe = this.localInjector.get(AsyncPipe);\n private readonly fieldErrorPipe = this.localInjector.get(TuiFieldErrorPipe);\n\n constructor(@Inject(Injector) private readonly injector: Injector) {}\n\n transform(order: readonly string[]): PolymorpheusContent {\n return this.getErrorContent(order);\n }\n\n ngOnDestroy() {\n this.asyncPipe.ngOnDestroy();\n }\n\n private getErrorContent(order: readonly string[]): PolymorpheusContent {\n const error = this.asyncPipe.transform(this.fieldErrorPipe.transform(order));\n\n if (!error) {\n return '';\n }\n\n return typeof error.message === 'function'\n ? error.message(error.context)\n : error.message;\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFieldErrorContentPipe} from './field-error-content-pipe';\nimport {TuiFieldErrorPipe} from './field-error-pipe';\n\n@NgModule({\n declarations: [TuiFieldErrorPipe, TuiFieldErrorContentPipe],\n exports: [TuiFieldErrorPipe, TuiFieldErrorContentPipe],\n})\nexport class TuiFieldErrorPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAcA,IAAM,YAAY,GAAG,EAAE,CAAC;AAExB;;IAQI,2BAIqB,SAA2B,EAI3B,aAAmC,EAInC,aAAmC,EAInC,SAAoC,EAEpC,gBAGhB;QAjBgB,cAAS,GAAT,SAAS,CAAkB;QAI3B,kBAAa,GAAb,aAAa,CAAsB;QAInC,kBAAa,GAAb,aAAa,CAAsB;QAInC,cAAS,GAAT,SAAS,CAA2B;QAEpC,qBAAgB,GAAhB,gBAAgB,CAGhC;QAvBG,UAAK,GAAsB,EAAE,CAAC;QAyBlC,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE;YACjD,IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC;SACvC;KACJ;IAED,qCAAS,GAAT,UAAU,KAAwB;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,OAAO,IAAI,CAAC,aAAa,CAAC;KAC7B;IAGD,sBAAI,sCAAO;aAAX;;YACI,OAAO,KAAK,CACR,OAAA,IAAI,CAAC,OAAO,0CAAE,YAAY,KAAI,KAAK,EACnC,OAAA,IAAI,CAAC,OAAO,0CAAE,aAAa,KAAI,KAAK,CACvC,CAAC;SACL;;;OAAA;IAED,sBAAI,4CAAa;aAAjB;YACI,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC;SACnE;;;OAAA;IAED,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AAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAE7E,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,EAAE,CAAC;SACb;QAED,OAAO,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU;cACpC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;cAC5B,KAAK,CAAC,OAAO,CAAC;KACvB;;gBApBwD,QAAQ,uBAApD,MAAM,SAAC,QAAQ;;IATnB,wBAAwB;QAJpC,IAAI,CAAC;YACF,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,KAAK;SACd,CAAC;QAUe,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;OATpB,wBAAwB,CA8BpC;IAAD,+BAAC;CA9BD;;;ICFA;KAAuC;IAA1B,uBAAuB;QAJnC,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;YAC3D,OAAO,EAAE,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;SACzD,CAAC;OACW,uBAAuB,CAAG;IAAD,8BAAC;CAAvC;;ACTA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-pipes-field-error.js","sources":["ng://@taiga-ui/kit/pipes/field-error/field-error-pipe.ts","ng://@taiga-ui/kit/pipes/field-error/field-error-content-pipe.ts","ng://@taiga-ui/kit/pipes/field-error/field-error.module.ts","ng://@taiga-ui/kit/pipes/field-error/taiga-ui-kit-pipes-field-error.ts"],"sourcesContent":["import {Inject, Optional, Pipe, PipeTransform, Self} from '@angular/core';\nimport {\n AbstractControl,\n FormArrayName,\n FormGroupDirective,\n FormGroupName,\n NgControl,\n} from '@angular/forms';\nimport {tuiPure, TuiValidationError} from '@taiga-ui/cdk';\nimport {TUI_VALIDATION_ERRORS} from '@taiga-ui/kit/tokens';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {EMPTY, isObservable, merge, Observable, of} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nconst EMPTY_RECORD = {};\n\n// @dynamic\n@Pipe({\n name: 'tuiFieldError',\n pure: false,\n})\nexport class TuiFieldErrorPipe implements PipeTransform {\n private order: readonly string[] = [];\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n private readonly ngControl: NgControl | null,\n @Optional()\n @Self()\n @Inject(FormArrayName)\n private readonly formArrayName: FormArrayName | null,\n @Optional()\n @Self()\n @Inject(FormGroupName)\n private readonly formGroupName: FormGroupName | null,\n @Optional()\n @Self()\n @Inject(FormGroupDirective)\n private readonly formGroup: FormGroupDirective | null,\n @Inject(TUI_VALIDATION_ERRORS)\n private readonly validationErrors: Record<\n string,\n PolymorpheusContent | Observable<PolymorpheusContent>\n >,\n ) {\n if (this.ngControl && !this.ngControl.valueAccessor) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n transform(order: readonly string[]): Observable<TuiValidationError | null> {\n this.order = order;\n\n return this.computedError;\n }\n\n @tuiPure\n get change$(): Observable<unknown> {\n return merge(\n this.control?.valueChanges || EMPTY,\n this.control?.statusChanges || EMPTY,\n );\n }\n\n get computedError(): Observable<TuiValidationError | null> {\n return (this.invalid && this.touched && this.error) || of(null);\n }\n\n registerOnChange(): void {}\n\n registerOnTouched(): void {}\n\n setDisabledState(): void {}\n\n writeValue(): void {}\n\n private get error(): Observable<TuiValidationError> | null {\n const {errorId} = this;\n\n if (!errorId) {\n return null;\n }\n\n const firstError = this.controlErrors[errorId];\n const errorContent = this.validationErrors[errorId];\n\n return this.getError(firstError, errorContent);\n }\n\n private get invalid(): boolean {\n return !!this.control?.invalid;\n }\n\n private get touched(): boolean {\n return !!this.control?.touched;\n }\n\n private get control(): AbstractControl | null {\n return (\n this.ngControl?.control ||\n this.formArrayName?.control ||\n this.formGroupName?.control ||\n this.formGroup?.control ||\n null\n );\n }\n\n private get errorId(): string {\n return this.getErrorId(this.order, this.controlErrors);\n }\n\n private get controlErrors(): Record<string, any> {\n return this.control?.errors || EMPTY_RECORD;\n }\n\n @tuiPure\n private getErrorId(\n order: readonly string[],\n controlErrors: Record<string, any>,\n ): string {\n const id = order?.find(errorId => controlErrors[errorId]);\n const fallback = Object.keys(controlErrors)[0];\n\n return id || fallback || '';\n }\n\n @tuiPure\n private getError(\n firstError: any,\n errorContent?: PolymorpheusContent | Observable<PolymorpheusContent>,\n ): Observable<TuiValidationError> {\n if (firstError instanceof TuiValidationError) {\n return of(firstError);\n }\n\n if (errorContent === undefined && typeof firstError === 'string') {\n return of(new TuiValidationError(firstError));\n }\n\n if (isObservable(errorContent)) {\n return errorContent.pipe(\n map(error => new TuiValidationError(error || '', firstError)),\n );\n }\n\n return of(new TuiValidationError(errorContent || '', firstError));\n }\n}\n","import {AsyncPipe} from '@angular/common';\nimport {Inject, Injector, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiFieldErrorPipe} from './field-error-pipe';\n\n// @dynamic\n@Pipe({\n name: 'tuiFieldErrorContent',\n pure: false,\n})\nexport class TuiFieldErrorContentPipe implements PipeTransform, OnDestroy {\n private readonly localInjector = Injector.create({\n providers: [{provide: AsyncPipe}, {provide: TuiFieldErrorPipe}],\n parent: this.injector,\n });\n\n private readonly asyncPipe = this.localInjector.get(AsyncPipe);\n private readonly fieldErrorPipe = this.localInjector.get(TuiFieldErrorPipe);\n\n constructor(@Inject(Injector) private readonly injector: Injector) {}\n\n transform(order: readonly string[]): PolymorpheusContent {\n return this.getErrorContent(order);\n }\n\n ngOnDestroy(): void {\n this.asyncPipe.ngOnDestroy();\n }\n\n private getErrorContent(order: readonly string[]): PolymorpheusContent {\n const error = this.asyncPipe.transform(this.fieldErrorPipe.transform(order));\n\n if (!error) {\n return '';\n }\n\n return typeof error.message === 'function'\n ? error.message(error.context)\n : error.message;\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFieldErrorContentPipe} from './field-error-content-pipe';\nimport {TuiFieldErrorPipe} from './field-error-pipe';\n\n@NgModule({\n declarations: [TuiFieldErrorPipe, TuiFieldErrorContentPipe],\n exports: [TuiFieldErrorPipe, TuiFieldErrorContentPipe],\n})\nexport class TuiFieldErrorPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAcA,IAAM,YAAY,GAAG,EAAE,CAAC;AAExB;;IAQI,2BAIqB,SAA2B,EAI3B,aAAmC,EAInC,aAAmC,EAInC,SAAoC,EAEpC,gBAGhB;QAjBgB,cAAS,GAAT,SAAS,CAAkB;QAI3B,kBAAa,GAAb,aAAa,CAAsB;QAInC,kBAAa,GAAb,aAAa,CAAsB;QAInC,cAAS,GAAT,SAAS,CAA2B;QAEpC,qBAAgB,GAAhB,gBAAgB,CAGhC;QAvBG,UAAK,GAAsB,EAAE,CAAC;QAyBlC,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE;YACjD,IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC;SACvC;KACJ;IAED,qCAAS,GAAT,UAAU,KAAwB;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,OAAO,IAAI,CAAC,aAAa,CAAC;KAC7B;IAGD,sBAAI,sCAAO;aAAX;;YACI,OAAO,KAAK,CACR,OAAA,IAAI,CAAC,OAAO,0CAAE,YAAY,KAAI,KAAK,EACnC,OAAA,IAAI,CAAC,OAAO,0CAAE,aAAa,KAAI,KAAK,CACvC,CAAC;SACL;;;OAAA;IAED,sBAAI,4CAAa;aAAjB;YACI,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC;SACnE;;;OAAA;IAED,4CAAgB,GAAhB,eAA2B;IAE3B,6CAAiB,GAAjB,eAA4B;IAE5B,4CAAgB,GAAhB,eAA2B;IAE3B,sCAAU,GAAV,eAAqB;IAErB,s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O,KAAK,CAAC,OAAO,KAAK,UAAU;cACpC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;cAC5B,KAAK,CAAC,OAAO,CAAC;KACvB;;gBApBwD,QAAQ,uBAApD,MAAM,SAAC,QAAQ;;IATnB,wBAAwB;QAJpC,IAAI,CAAC;YACF,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,KAAK;SACd,CAAC;QAUe,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;OATpB,wBAAwB,CA8BpC;IAAD,+BAAC;CA9BD;;;ICFA;KAAuC;IAA1B,uBAAuB;QAJnC,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;YAC3D,OAAO,EAAE,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;SACzD,CAAC;OACW,uBAAuB,CAAG;IAAD,8BAAC;CAAvC;;ACTA;;;;;;"}
|
|
@@ -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.substr(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.substr(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","export function scrollToElement(element: HTMLElement, container: HTMLElement) {\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","import {svgNodeFilter} from '@taiga-ui/cdk';\n\n/**\n * Range.setStart/set-end, except it uses offset in characters only\n */\nexport function setRangeOffset(\n range: Range,\n node: HTMLElement,\n offset: number,\n method: 'setStart' | 'setEnd',\n) {\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA;;;;;;SAMgB,YAAY,CAAC,YAAmB;IAC5C,IAAM,KAAK,GAAG,YAAY,CAAC,UAAU,EAAE,CAAC;IACjC,IAAA,qCAAc,EAAE,+BAAW,EAAE,iCAAY,EAAE,2BAAS,CAAU;IAC9D,IAAA,4CAAa,CAAmB;IAEvC,IAAI,CAAC,aAAa,EAAE;QAChB,OAAO,KAAK,CAAC;KAChB;IAED,IAAM,UAAU,GAAG,aAAa,CAAC,gBAAgB,CAC7C,aAAa,CAAC,IAAI,EAClB,UAAU,CAAC,SAAS,EACpB,aAAa,EACb,KAAK,CACR,CAAC;IAEF,UAAU,CAAC,WAAW,GAAG,cAAc,CAAC;IAExC,GAAG;QACC,IAAM,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC;QACzC,IAAM,WAAW,GAAG,SAAS,CAAC,WAAW,IAAI,EAAE,CAAC;QAChD,IAAM,OAAO,GACT,SAAS,KAAK,cAAc;cACtB,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC;cACtC,WAAW,CAAC;QACtB,IAAM,MAAM,GACR,IAAI,CAAC,GAAG,CACJ,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,EACxB,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,EACxC,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAC7C,GAAG,CAAC,CAAC;QAEV,KAAK,CAAC,QAAQ,CAAC,SA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AE;gBACjB,MAAM,IAAI,QAAM,CAAC;aACpB;iBAAM;gBACH,KAAK,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;aACjD;SACJ;KACJ;AACL;;ACvCA;;;;;;"}
|
|
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.substr(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.substr(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","export 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","import {svgNodeFilter} from '@taiga-ui/cdk';\n\n/**\n * Range.setStart/set-end, except it uses offset in characters only\n */\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA;;;;;;SAMgB,YAAY,CAAC,YAAmB;IAC5C,IAAM,KAAK,GAAG,YAAY,CAAC,UAAU,EAAE,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a,CAAC;IAC5D,IAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC,UAAU,CAAC;IAEnD,IAAI,qBAAqB,EAAE;QACvB,SAAS,CAAC,UAAU,IAAI,WAAW,CAAC;KACvC;IAED,IAAI,oBAAoB,EAAE;QACtB,SAAS,CAAC,UAAU,IAAI,UAAU,CAAC;KACtC;AACL;;ACjBA;;;SAGgB,cAAc,CAC1B,KAAY,EACZ,IAAiB,EACjB,MAAc,EACd,MAA6B;IAEtB,IAAA,kCAAa,CAAS;IAE7B,IAAI,CAAC,aAAa,EAAE;QAChB,OAAO;KACV;IAED,IAAM,UAAU,GAAG,aAAa,CAAC,gBAAgB,CAC7C,IAAI,EACJ,UAAU,CAAC,SAAS,EACpB,aAAa,EACb,KAAK,CACR,CAAC;IAEF,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC;IAE9B,OAAO,UAAU,CAAC,QAAQ,EAAE,EAAE;QAC1B,IAAI,UAAU,CAAC,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE;YACpD,IAAM,QAAM,GAAG,UAAU,CAAC,WAAW,CAAC,SAAS;kBACzC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM;kBACvC,CAAC,CAAC;YAER,IAAI,MAAM,GAAG,QAAM,EAAE;gBACjB,MAAM,IAAI,QAAM,CAAC;aACpB;iBAAM;gBACH,KAAK,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;aACjD;SACJ;KACJ;AACL;;ACvCA;;;;;;"}
|
|
@@ -34,7 +34,7 @@ function tuiKeyStepValueToPercentage(value, keySteps) {
|
|
|
34
34
|
var _b = __read(_a, 2), _ = _b[0], keyStepValue = _b[1];
|
|
35
35
|
return value <= keyStepValue;
|
|
36
36
|
}), 2), _b = __read(_a[0], 2), lowerStepPercent = _b[0], lowerStepValue = _b[1], _c = __read(_a[1], 2), upperStepPercent = _c[0], upperStepValue = _c[1];
|
|
37
|
-
var ratio = (value - lowerStepValue) / (upperStepValue - lowerStepValue);
|
|
37
|
+
var ratio = (value - lowerStepValue) / (upperStepValue - lowerStepValue) || 0;
|
|
38
38
|
return (upperStepPercent - lowerStepPercent) * ratio + lowerStepPercent;
|
|
39
39
|
}
|
|
40
40
|
function tuiCheckKeyStepsHaveMinMaxPercents(steps) {
|
|
@@ -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 horizontalDirectionToNumber(direction: TuiHorizontalDirection): -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);\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,2BAA2B,CAAC,SAAiC;IACzE,QAAQ,SAAS;QACb,KAAK,MAAM;YACP,OAAO,CAAC,CAAC,CAAC;QACd,KAAK,OAAO;YACR,OAAO,CAAC,CAAC;KAChB;AACL;;ACRA,SAAS,6BAA6B,CAClC,QAAqB,EACrB,EAAiE;IAEjE,IAAM,iBAAiB,GAAG,QAAQ,CAAC,SAAS,CAAC,UAAC,OAAO,EAAE,CAAC,IAAK,OAAA,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAA,CAAC,CAAC;IAC/E,IAAM,SAAS,GAAG,QAAQ,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC;IAClD,IAAM,SAAS,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAE9C,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAClC,CAAC;SAEe,2BAA2B,CACvC,eAAuB,EACvB,QAAqB;IAEf,IAAA;;;UAID,EAJE,qBAAkC,EAAjC,wBAAgB,EAAE,sBAAc,EAAG,qBAAkC,EAAjC,wBAAgB,EAAE,sBAIzD,CAAC;IACN,IAAM,KAAK,GACP,CAAC,eAAe,GAAG,gBAAgB,KAAK,gBAAgB,GAAG,gBAAgB,CAAC,CAAC;IACjF,IAAM,YAAY,GAAG,CAAC,cAAc,GAAG,cAAc,IAAI,KAAK,GAAG,cAAc,CAAC;IAEhF,OAAO,KAAK,CAAC,YAAY,EAAE,sBAAsB,CAAC,CAAC;AACvD,CAAC;SAEe,2BAA2B,CACvC,KAAa,EACb,QAAqB;IAEf,IAAA;;;UAID,EAJE,qBAAkC,EAAjC,wBAAgB,EAAE,sBAAc,EAAG,qBAAkC,EAAjC,wBAAgB,EAAE,sBAIzD,CAAC;IACN,IAAM,KAAK,GAAG,CAAC,KAAK,GAAG,cAAc,KAAK,cAAc,GAAG,cAAc,CAAC,CAAC;
|
|
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 horizontalDirectionToNumber(direction: TuiHorizontalDirection): -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,2BAA2B,CAAC,SAAiC;IACzE,QAAQ,SAAS;QACb,KAAK,MAAM;YACP,OAAO,CAAC,CAAC,CAAC;QACd,KAAK,OAAO;YACR,OAAO,CAAC,CAAC;KAChB;AACL;;ACRA,SAAS,6BAA6B,CAClC,QAAqB,EACrB,EAAiE;IAEjE,IAAM,iBAAiB,GAAG,QAAQ,CAAC,SAAS,CAAC,UAAC,OAAO,EAAE,CAAC,IAAK,OAAA,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAA,CAAC,CAAC;IAC/E,IAAM,SAAS,GAAG,QAAQ,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC;IAClD,IAAM,SAAS,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAE9C,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAClC,CAAC;SAEe,2BAA2B,CACvC,eAAuB,EACvB,QAAqB;IAEf,IAAA;;;UAID,EAJE,qBAAkC,EAAjC,wBAAgB,EAAE,sBAAc,EAAG,qBAAkC,EAAjC,wBAAgB,EAAE,sBAIzD,CAAC;IACN,IAAM,KAAK,GACP,CAAC,eAAe,GAAG,gBAAgB,KAAK,gBAAgB,GAAG,gBAAgB,CAAC,CAAC;IACjF,IAAM,YAAY,GAAG,CAAC,cAAc,GAAG,cAAc,IAAI,KAAK,GAAG,cAAc,CAAC;IAEhF,OAAO,KAAK,CAAC,YAAY,EAAE,sBAAsB,CAAC,CAAC;AACvD,CAAC;SAEe,2BAA2B,CACvC,KAAa,EACb,QAAqB;IAEf,IAAA;;;UAID,EAJE,qBAAkC,EAAjC,wBAAgB,EAAE,sBAAc,EAAG,qBAAkC,EAAjC,wBAAgB,EAAE,sBAIzD,CAAC;IACN,IAAM,KAAK,GAAG,CAAC,KAAK,GAAG,cAAc,KAAK,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAEhF,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,IAAI,KAAK,GAAG,gBAAgB,CAAC;AAC5E,CAAC;SAEe,kCAAkC,CAAC,KAAkB;IACjE,OAAO,CAAC,KAAK,CAAC,MAAM,KAAK,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;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.0",
|
|
4
4
|
"description": "Taiga UI Angular main components kit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@angular/router": ">=9.0.0",
|
|
25
25
|
"@ng-web-apis/common": ">=1.12.1 < 2",
|
|
26
26
|
"@ng-web-apis/mutation-observer": ">=1.1.0",
|
|
27
|
-
"@taiga-ui/cdk": ">=2.
|
|
28
|
-
"@taiga-ui/core": ">=2.
|
|
29
|
-
"@taiga-ui/i18n": ">=2.
|
|
27
|
+
"@taiga-ui/cdk": ">=2.44.0",
|
|
28
|
+
"@taiga-ui/core": ">=2.44.0",
|
|
29
|
+
"@taiga-ui/i18n": ">=2.44.0",
|
|
30
30
|
"@tinkoff/ng-polymorpheus": ">=3.1.12 < 4",
|
|
31
31
|
"rxjs": ">=6.0.0"
|
|
32
32
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare type TuiHandlerWithContext<I, O, C extends
|
|
2
|
-
export declare type TuiBooleanHandlerWithContext<I, C extends
|
|
1
|
+
export declare type TuiHandlerWithContext<I, O, C extends Record<string, unknown> = Record<string, never>> = (item: I, context?: C) => O;
|
|
2
|
+
export declare type TuiBooleanHandlerWithContext<I, C extends Record<string, any> = Record<string, never>> = TuiHandlerWithContext<I, boolean, C>;
|