@taiga-ui/core 2.43.0 → 2.46.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/animations/animations.d.ts +6 -0
- package/animations/taiga-ui-core-animations.metadata.json +1 -1
- package/bundles/taiga-ui-core-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-core-abstract.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-animations.umd.js.map +1 -1
- package/bundles/taiga-ui-core-animations.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-alert.umd.js +2 -4
- package/bundles/taiga-ui-core-components-alert.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-alert.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-button.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-calendar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-calendar.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-data-list.umd.js +3 -3
- package/bundles/taiga-ui-core-components-data-list.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-data-list.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-data-list.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.js +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.js +3 -3
- package/bundles/taiga-ui-core-components-expand.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-hints-host.umd.js +38 -26
- package/bundles/taiga-ui-core-components-hints-host.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-hints-host.umd.min.js +2 -2
- package/bundles/taiga-ui-core-components-hints-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-label.umd.js +1 -1
- package/bundles/taiga-ui-core-components-label.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-label.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-link.umd.js +2 -2
- package/bundles/taiga-ui-core-components-link.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-link.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-link.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-loader.umd.js +10 -75
- package/bundles/taiga-ui-core-components-loader.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-loader.umd.min.js +2 -2
- package/bundles/taiga-ui-core-components-loader.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-calendar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-calendar.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-spin-button.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-spin-button.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +26 -10
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js +2 -2
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-year-picker.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-year-picker.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.js +1 -1
- package/bundles/taiga-ui-core-components-root.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-root.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-scrollbar.umd.js +2 -2
- package/bundles/taiga-ui-core-components-scrollbar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-scrollbar.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-scrollbar.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-svg.umd.js +9 -5
- package/bundles/taiga-ui-core-components-svg.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-svg.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-svg.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-constants.umd.js +1 -1
- package/bundles/taiga-ui-core-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-core-constants.umd.min.js +1 -1
- package/bundles/taiga-ui-core-constants.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-directives-dropdown-controller.umd.js +1 -1
- package/bundles/taiga-ui-core-directives-dropdown-controller.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-dropdown-controller.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-directives-hint-controller.umd.js +2 -2
- package/bundles/taiga-ui-core-directives-hint-controller.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-hint-controller.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-directives-hint.umd.js +2 -2
- package/bundles/taiga-ui-core-directives-hint.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-hint.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-directives-pointer-hint.umd.js +1 -1
- package/bundles/taiga-ui-core-directives-pointer-hint.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-pointer-hint.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-directives-table-mode.umd.js +0 -2
- package/bundles/taiga-ui-core-directives-table-mode.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-table-mode.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-directives-textfield-controller.umd.js +2 -2
- package/bundles/taiga-ui-core-directives-textfield-controller.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-textfield-controller.umd.min.js +1 -1
- package/bundles/taiga-ui-core-directives-textfield-controller.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-directives-wrapper.umd.js +3 -2
- package/bundles/taiga-ui-core-directives-wrapper.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-wrapper.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-enums.umd.js +2 -2
- package/bundles/taiga-ui-core-enums.umd.js.map +1 -1
- package/bundles/taiga-ui-core-enums.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-internal-primitive-year-month-pagination.umd.js.map +1 -1
- package/bundles/taiga-ui-core-internal-primitive-year-month-pagination.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-internal-svg-defs-host.umd.js +1 -1
- package/bundles/taiga-ui-core-internal-svg-defs-host.umd.js.map +1 -1
- package/bundles/taiga-ui-core-internal-svg-defs-host.umd.min.js +1 -1
- package/bundles/taiga-ui-core-internal-svg-defs-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-pipes-calendar-sheet.umd.js +2 -2
- package/bundles/taiga-ui-core-pipes-calendar-sheet.umd.js.map +1 -1
- package/bundles/taiga-ui-core-pipes-calendar-sheet.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-providers.umd.js +7 -9
- package/bundles/taiga-ui-core-providers.umd.js.map +1 -1
- package/bundles/taiga-ui-core-providers.umd.min.js +1 -1
- package/bundles/taiga-ui-core-providers.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-services.umd.js +1 -1
- package/bundles/taiga-ui-core-services.umd.js.map +1 -1
- package/bundles/taiga-ui-core-services.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-tokens.umd.js +22 -10
- package/bundles/taiga-ui-core-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-core-tokens.umd.min.js +2 -2
- package/bundles/taiga-ui-core-tokens.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-utils-dom.umd.js +5 -5
- package/bundles/taiga-ui-core-utils-dom.umd.js.map +1 -1
- package/bundles/taiga-ui-core-utils-dom.umd.min.js +1 -1
- package/bundles/taiga-ui-core-utils-dom.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-utils-format.umd.js +2 -2
- package/bundles/taiga-ui-core-utils-format.umd.js.map +1 -1
- package/bundles/taiga-ui-core-utils-format.umd.min.js +1 -1
- package/bundles/taiga-ui-core-utils-format.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-utils-mask.umd.js +1 -1
- package/bundles/taiga-ui-core-utils-mask.umd.js.map +1 -1
- package/bundles/taiga-ui-core-utils-mask.umd.min.js +1 -1
- package/bundles/taiga-ui-core-utils-mask.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-utils-miscellaneous.umd.js.map +1 -1
- package/bundles/taiga-ui-core-utils-miscellaneous.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-utils-polyfills.umd.js.map +1 -1
- package/bundles/taiga-ui-core-utils-polyfills.umd.min.js.map +1 -1
- package/components/alert/taiga-ui-core-components-alert.metadata.json +1 -1
- package/components/data-list/option/option.component.d.ts +2 -2
- package/components/data-list/taiga-ui-core-components-data-list.metadata.json +1 -1
- package/components/dialog/taiga-ui-core-components-dialog.metadata.json +1 -1
- package/components/expand/taiga-ui-core-components-expand.metadata.json +1 -1
- package/components/hints-host/hint-box/hint-box.component.d.ts +13 -2
- package/components/hints-host/hints-host.component.d.ts +4 -10
- package/components/hints-host/taiga-ui-core-components-hints-host.metadata.json +1 -1
- package/components/link/taiga-ui-core-components-link.metadata.json +1 -1
- package/components/loader/index.d.ts +0 -1
- package/components/loader/loader.component.d.ts +1 -3
- package/components/loader/taiga-ui-core-components-loader.metadata.json +1 -1
- package/components/primitive-textfield/primitive-textfield.component.d.ts +3 -1
- package/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.metadata.json +1 -1
- package/components/root/taiga-ui-core-components-root.metadata.json +1 -1
- package/components/scrollbar/scrollbar.component.d.ts +2 -2
- package/components/scrollbar/taiga-ui-core-components-scrollbar.metadata.json +1 -1
- package/components/svg/svg.component.d.ts +3 -2
- package/components/svg/taiga-ui-core-components-svg.metadata.json +1 -1
- package/constants/taiga-ui-core-constants.metadata.json +1 -1
- package/constants/version.d.ts +1 -1
- package/directives/table-mode/table-mode.directive.d.ts +0 -1
- package/directives/table-mode/taiga-ui-core-directives-table-mode.metadata.json +1 -1
- package/directives/wrapper/taiga-ui-core-directives-wrapper.metadata.json +1 -1
- package/esm2015/abstract/abstract-dropdown.js +1 -1
- package/esm2015/abstract/abstract-hint.js +1 -1
- package/esm2015/abstract/abstract-textfield-host.js +1 -1
- package/esm2015/animations/animations.js +1 -1
- package/esm2015/components/alert/alert.component.js +2 -2
- package/esm2015/components/alert/alert.service.js +2 -4
- package/esm2015/components/button/button-options.js +1 -1
- package/esm2015/components/button/button.component.js +1 -1
- package/esm2015/components/calendar/calendar.component.js +1 -1
- package/esm2015/components/data-list/data-list-dropdown-manager.directive.js +2 -2
- package/esm2015/components/data-list/data-list.component.js +1 -1
- package/esm2015/components/data-list/option/option.component.js +3 -3
- package/esm2015/components/dialog/dialog.component.js +2 -2
- package/esm2015/components/dropdown-box/dropdown-box.component.js +1 -1
- package/esm2015/components/expand/expand-content.directive.js +2 -2
- package/esm2015/components/expand/expand.component.js +3 -3
- package/esm2015/components/hints-host/hint-box/hint-box.component.js +27 -14
- package/esm2015/components/hints-host/hint-box/hint-box.module.js +4 -2
- package/esm2015/components/hints-host/hints-host.component.js +11 -13
- package/esm2015/components/hints-host/hints-host.module.js +1 -2
- package/esm2015/components/hosted-dropdown/hosted-dropdown.component.js +1 -1
- package/esm2015/components/label/label.component.js +2 -2
- package/esm2015/components/link/link.component.js +3 -3
- package/esm2015/components/loader/index.js +1 -2
- package/esm2015/components/loader/loader.component.js +7 -15
- package/esm2015/components/loader/loader.module.js +2 -3
- package/esm2015/components/primitive-calendar/primitive-calendar.component.js +1 -1
- package/esm2015/components/primitive-checkbox/primitive-checkbox.component.js +1 -1
- package/esm2015/components/primitive-spin-button/primitive-spin-button.component.js +1 -1
- package/esm2015/components/primitive-textfield/primitive-textfield-options.js +2 -2
- package/esm2015/components/primitive-textfield/primitive-textfield.component.js +16 -8
- package/esm2015/components/primitive-textfield/primitive-textfield.directive.js +1 -1
- package/esm2015/components/primitive-textfield/textfield/textfield.component.js +2 -2
- package/esm2015/components/primitive-textfield/value-decoration/value-decoration.component.js +2 -2
- package/esm2015/components/primitive-year-picker/primitive-year-picker.component.js +1 -1
- package/esm2015/components/root/root.component.js +2 -2
- package/esm2015/components/scrollbar/scrollable.directive.js +1 -1
- package/esm2015/components/scrollbar/scrollbar.component.js +3 -3
- package/esm2015/components/svg/svg.component.js +11 -7
- package/esm2015/components/tooltip/tooltip.component.js +1 -1
- package/esm2015/constants/version.js +2 -2
- package/esm2015/directives/dropdown-controller/dropdown-controller.provider.js +2 -2
- package/esm2015/directives/hint/hint-options.js +2 -2
- package/esm2015/directives/hint/hint.directive.js +2 -2
- package/esm2015/directives/hint-controller/hint-controller.directive.js +2 -2
- package/esm2015/directives/hint-controller/hint-controller.provider.js +2 -2
- package/esm2015/directives/pointer-hint/pointer-hint.directive.js +2 -2
- package/esm2015/directives/table-mode/table-mode.directive.js +1 -3
- package/esm2015/directives/textfield-controller/textfield-custom-content.directive.js +3 -3
- package/esm2015/directives/wrapper/wrapper.directive.js +4 -3
- package/esm2015/enums/interactive-state.js +3 -3
- package/esm2015/internal/primitive-year-month-pagination/primitive-year-month-pagination.component.js +1 -1
- package/esm2015/internal/svg-defs-host/svg-defs-host.component.js +2 -2
- package/esm2015/pipes/calendar-sheet/calendar-sheet.pipe.js +1 -1
- package/esm2015/pipes/calendar-sheet/utils.js +3 -3
- package/esm2015/providers/is-mobile-resolution.provider.js +5 -10
- package/esm2015/services/hint.service.js +2 -2
- package/esm2015/services/svg.service.js +1 -1
- package/esm2015/tokens/icon-place.js +5 -0
- package/esm2015/tokens/icons-path.js +4 -5
- package/esm2015/tokens/index.js +3 -1
- package/esm2015/tokens/is-mobile-resolution.js +13 -3
- package/esm2015/tokens/option-content.js +1 -1
- package/esm2015/tokens/ordered-short-week-days.js +2 -2
- package/esm2015/tokens/svg-content-processor.js +4 -0
- package/esm2015/types/pluralize.js +1 -1
- package/esm2015/utils/dom/are-css-vars-supported.js +2 -2
- package/esm2015/utils/dom/process-icon.js +5 -5
- package/esm2015/utils/format/get-fractional-part-padded.js +2 -2
- package/esm2015/utils/format/pluralize-to-icu.js +2 -2
- package/esm2015/utils/mask/create-number-mask.js +2 -2
- package/esm2015/utils/miscellaneous/index.js +2 -2
- package/esm2015/utils/miscellaneous/is-presumed-html-string.js +5 -0
- package/esm2015/utils/polyfills/index.js +2 -2
- package/esm2015/utils/polyfills/{inner-HTML.js → inner-html.js} +1 -1
- package/esm5/abstract/abstract-dropdown.js +1 -1
- package/esm5/abstract/abstract-hint.js +1 -1
- package/esm5/abstract/abstract-textfield-host.js +1 -1
- package/esm5/animations/animations.js +1 -1
- package/esm5/components/alert/alert.component.js +2 -2
- package/esm5/components/alert/alert.service.js +2 -4
- package/esm5/components/button/button-options.js +1 -1
- package/esm5/components/button/button.component.js +1 -1
- package/esm5/components/calendar/calendar.component.js +1 -1
- package/esm5/components/data-list/data-list-dropdown-manager.directive.js +2 -2
- package/esm5/components/data-list/data-list.component.js +1 -1
- package/esm5/components/data-list/option/option.component.js +3 -3
- package/esm5/components/dialog/dialog.component.js +2 -2
- package/esm5/components/dropdown-box/dropdown-box.component.js +1 -1
- package/esm5/components/expand/expand-content.directive.js +2 -2
- package/esm5/components/expand/expand.component.js +3 -3
- package/esm5/components/hints-host/hint-box/hint-box.component.js +32 -15
- package/esm5/components/hints-host/hint-box/hint-box.module.js +4 -2
- package/esm5/components/hints-host/hints-host.component.js +12 -14
- package/esm5/components/hints-host/hints-host.module.js +1 -2
- package/esm5/components/hosted-dropdown/hosted-dropdown.component.js +1 -1
- package/esm5/components/label/label.component.js +2 -2
- package/esm5/components/link/link.component.js +3 -3
- package/esm5/components/loader/index.js +1 -2
- package/esm5/components/loader/loader.component.js +7 -15
- package/esm5/components/loader/loader.module.js +2 -3
- package/esm5/components/primitive-calendar/primitive-calendar.component.js +1 -1
- package/esm5/components/primitive-checkbox/primitive-checkbox.component.js +1 -1
- package/esm5/components/primitive-spin-button/primitive-spin-button.component.js +1 -1
- package/esm5/components/primitive-textfield/primitive-textfield-options.js +2 -2
- package/esm5/components/primitive-textfield/primitive-textfield.component.js +24 -8
- package/esm5/components/primitive-textfield/primitive-textfield.directive.js +1 -1
- package/esm5/components/primitive-textfield/textfield/textfield.component.js +2 -2
- package/esm5/components/primitive-textfield/value-decoration/value-decoration.component.js +2 -2
- package/esm5/components/primitive-year-picker/primitive-year-picker.component.js +1 -1
- package/esm5/components/root/root.component.js +2 -2
- package/esm5/components/scrollbar/scrollable.directive.js +1 -1
- package/esm5/components/scrollbar/scrollbar.component.js +3 -3
- package/esm5/components/svg/svg.component.js +11 -7
- package/esm5/components/tooltip/tooltip.component.js +1 -1
- package/esm5/constants/version.js +2 -2
- package/esm5/directives/dropdown-controller/dropdown-controller.provider.js +2 -2
- package/esm5/directives/hint/hint-options.js +2 -2
- package/esm5/directives/hint/hint.directive.js +2 -2
- package/esm5/directives/hint-controller/hint-controller.directive.js +2 -2
- package/esm5/directives/hint-controller/hint-controller.provider.js +2 -2
- package/esm5/directives/pointer-hint/pointer-hint.directive.js +2 -2
- package/esm5/directives/table-mode/table-mode.directive.js +1 -3
- package/esm5/directives/textfield-controller/textfield-custom-content.directive.js +3 -3
- package/esm5/directives/wrapper/wrapper.directive.js +4 -3
- package/esm5/enums/interactive-state.js +3 -3
- package/esm5/internal/primitive-year-month-pagination/primitive-year-month-pagination.component.js +1 -1
- package/esm5/internal/svg-defs-host/svg-defs-host.component.js +2 -2
- package/esm5/pipes/calendar-sheet/calendar-sheet.pipe.js +1 -1
- package/esm5/pipes/calendar-sheet/utils.js +3 -3
- package/esm5/providers/is-mobile-resolution.provider.js +6 -12
- package/esm5/services/hint.service.js +2 -2
- package/esm5/services/svg.service.js +1 -1
- package/esm5/tokens/icon-place.js +5 -0
- package/esm5/tokens/icons-path.js +4 -5
- package/esm5/tokens/index.js +3 -1
- package/esm5/tokens/is-mobile-resolution.js +13 -3
- package/esm5/tokens/option-content.js +1 -1
- package/esm5/tokens/ordered-short-week-days.js +2 -2
- package/esm5/tokens/svg-content-processor.js +4 -0
- package/esm5/types/pluralize.js +1 -1
- package/esm5/utils/dom/are-css-vars-supported.js +2 -2
- package/esm5/utils/dom/process-icon.js +5 -5
- package/esm5/utils/format/get-fractional-part-padded.js +2 -2
- package/esm5/utils/format/pluralize-to-icu.js +2 -2
- package/esm5/utils/mask/create-number-mask.js +2 -2
- package/esm5/utils/miscellaneous/index.js +2 -2
- package/esm5/utils/miscellaneous/is-presumed-html-string.js +5 -0
- package/esm5/utils/polyfills/index.js +2 -2
- package/esm5/utils/polyfills/{inner-HTML.js → inner-html.js} +1 -1
- package/fesm2015/taiga-ui-core-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-core-animations.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-alert.js +2 -4
- package/fesm2015/taiga-ui-core-components-alert.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-button.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-calendar.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-data-list.js +3 -3
- package/fesm2015/taiga-ui-core-components-data-list.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-dialog.js +1 -1
- package/fesm2015/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-dropdown-box.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-expand.js +3 -3
- package/fesm2015/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hints-host.js +34 -26
- package/fesm2015/taiga-ui-core-components-hints-host.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-label.js +1 -1
- package/fesm2015/taiga-ui-core-components-label.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-link.js +2 -2
- package/fesm2015/taiga-ui-core-components-link.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-loader.js +9 -73
- package/fesm2015/taiga-ui-core-components-loader.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-calendar.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-spin-button.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js +18 -10
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-year-picker.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-root.js +1 -1
- package/fesm2015/taiga-ui-core-components-root.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-scrollbar.js +2 -2
- package/fesm2015/taiga-ui-core-components-scrollbar.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-svg.js +10 -6
- package/fesm2015/taiga-ui-core-components-svg.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-tooltip.js.map +1 -1
- package/fesm2015/taiga-ui-core-constants.js +1 -1
- package/fesm2015/taiga-ui-core-constants.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-dropdown-controller.js +1 -1
- package/fesm2015/taiga-ui-core-directives-dropdown-controller.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-hint-controller.js +2 -2
- package/fesm2015/taiga-ui-core-directives-hint-controller.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-hint.js +2 -2
- package/fesm2015/taiga-ui-core-directives-hint.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-pointer-hint.js +1 -1
- package/fesm2015/taiga-ui-core-directives-pointer-hint.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-table-mode.js +0 -2
- package/fesm2015/taiga-ui-core-directives-table-mode.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-textfield-controller.js +2 -2
- package/fesm2015/taiga-ui-core-directives-textfield-controller.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-wrapper.js +3 -2
- package/fesm2015/taiga-ui-core-directives-wrapper.js.map +1 -1
- package/fesm2015/taiga-ui-core-enums.js +2 -2
- package/fesm2015/taiga-ui-core-enums.js.map +1 -1
- package/fesm2015/taiga-ui-core-internal-primitive-year-month-pagination.js.map +1 -1
- package/fesm2015/taiga-ui-core-internal-svg-defs-host.js +1 -1
- package/fesm2015/taiga-ui-core-internal-svg-defs-host.js.map +1 -1
- package/fesm2015/taiga-ui-core-pipes-calendar-sheet.js +2 -2
- package/fesm2015/taiga-ui-core-pipes-calendar-sheet.js.map +1 -1
- package/fesm2015/taiga-ui-core-providers.js +7 -9
- package/fesm2015/taiga-ui-core-providers.js.map +1 -1
- package/fesm2015/taiga-ui-core-services.js +1 -1
- package/fesm2015/taiga-ui-core-services.js.map +1 -1
- package/fesm2015/taiga-ui-core-tokens.js +22 -10
- package/fesm2015/taiga-ui-core-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-dom.js +5 -5
- package/fesm2015/taiga-ui-core-utils-dom.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-format.js +2 -2
- package/fesm2015/taiga-ui-core-utils-format.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-mask.js +1 -1
- package/fesm2015/taiga-ui-core-utils-mask.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-miscellaneous.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-polyfills.js.map +1 -1
- package/fesm5/taiga-ui-core-abstract.js.map +1 -1
- package/fesm5/taiga-ui-core-animations.js.map +1 -1
- package/fesm5/taiga-ui-core-components-alert.js +2 -4
- package/fesm5/taiga-ui-core-components-alert.js.map +1 -1
- package/fesm5/taiga-ui-core-components-button.js.map +1 -1
- package/fesm5/taiga-ui-core-components-calendar.js.map +1 -1
- package/fesm5/taiga-ui-core-components-data-list.js +3 -3
- package/fesm5/taiga-ui-core-components-data-list.js.map +1 -1
- package/fesm5/taiga-ui-core-components-dialog.js +1 -1
- package/fesm5/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm5/taiga-ui-core-components-dropdown-box.js.map +1 -1
- package/fesm5/taiga-ui-core-components-expand.js +3 -3
- package/fesm5/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm5/taiga-ui-core-components-hints-host.js +39 -27
- package/fesm5/taiga-ui-core-components-hints-host.js.map +1 -1
- package/fesm5/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm5/taiga-ui-core-components-label.js +1 -1
- package/fesm5/taiga-ui-core-components-label.js.map +1 -1
- package/fesm5/taiga-ui-core-components-link.js +2 -2
- package/fesm5/taiga-ui-core-components-link.js.map +1 -1
- package/fesm5/taiga-ui-core-components-loader.js +10 -77
- package/fesm5/taiga-ui-core-components-loader.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-calendar.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-spin-button.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-textfield.js +26 -10
- package/fesm5/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-year-picker.js.map +1 -1
- package/fesm5/taiga-ui-core-components-root.js +1 -1
- package/fesm5/taiga-ui-core-components-root.js.map +1 -1
- package/fesm5/taiga-ui-core-components-scrollbar.js +2 -2
- package/fesm5/taiga-ui-core-components-scrollbar.js.map +1 -1
- package/fesm5/taiga-ui-core-components-svg.js +10 -6
- package/fesm5/taiga-ui-core-components-svg.js.map +1 -1
- package/fesm5/taiga-ui-core-components-tooltip.js.map +1 -1
- package/fesm5/taiga-ui-core-constants.js +1 -1
- package/fesm5/taiga-ui-core-constants.js.map +1 -1
- package/fesm5/taiga-ui-core-directives-dropdown-controller.js +1 -1
- package/fesm5/taiga-ui-core-directives-dropdown-controller.js.map +1 -1
- package/fesm5/taiga-ui-core-directives-hint-controller.js +2 -2
- package/fesm5/taiga-ui-core-directives-hint-controller.js.map +1 -1
- package/fesm5/taiga-ui-core-directives-hint.js +2 -2
- package/fesm5/taiga-ui-core-directives-hint.js.map +1 -1
- package/fesm5/taiga-ui-core-directives-pointer-hint.js +1 -1
- package/fesm5/taiga-ui-core-directives-pointer-hint.js.map +1 -1
- package/fesm5/taiga-ui-core-directives-table-mode.js +0 -2
- package/fesm5/taiga-ui-core-directives-table-mode.js.map +1 -1
- package/fesm5/taiga-ui-core-directives-textfield-controller.js +2 -2
- package/fesm5/taiga-ui-core-directives-textfield-controller.js.map +1 -1
- package/fesm5/taiga-ui-core-directives-wrapper.js +3 -2
- package/fesm5/taiga-ui-core-directives-wrapper.js.map +1 -1
- package/fesm5/taiga-ui-core-enums.js +2 -2
- package/fesm5/taiga-ui-core-enums.js.map +1 -1
- package/fesm5/taiga-ui-core-internal-primitive-year-month-pagination.js.map +1 -1
- package/fesm5/taiga-ui-core-internal-svg-defs-host.js +1 -1
- package/fesm5/taiga-ui-core-internal-svg-defs-host.js.map +1 -1
- package/fesm5/taiga-ui-core-pipes-calendar-sheet.js +2 -2
- package/fesm5/taiga-ui-core-pipes-calendar-sheet.js.map +1 -1
- package/fesm5/taiga-ui-core-providers.js +8 -11
- package/fesm5/taiga-ui-core-providers.js.map +1 -1
- package/fesm5/taiga-ui-core-services.js +1 -1
- package/fesm5/taiga-ui-core-services.js.map +1 -1
- package/fesm5/taiga-ui-core-tokens.js +22 -10
- package/fesm5/taiga-ui-core-tokens.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-dom.js +5 -5
- package/fesm5/taiga-ui-core-utils-dom.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-format.js +2 -2
- package/fesm5/taiga-ui-core-utils-format.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-mask.js +1 -1
- package/fesm5/taiga-ui-core-utils-mask.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-miscellaneous.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-polyfills.js.map +1 -1
- package/internal/svg-defs-host/svg-defs-host.component.d.ts +1 -1
- package/internal/svg-defs-host/taiga-ui-core-internal-svg-defs-host.metadata.json +1 -1
- package/package.json +4 -4
- package/providers/is-mobile-resolution.provider.d.ts +2 -3
- package/providers/taiga-ui-core-providers.metadata.json +1 -1
- package/services/hint.service.d.ts +1 -1
- package/styles/basic/main.less +0 -1
- package/styles/markup/tui-list.less +15 -0
- package/styles/markup/tui-palette.less +1 -1
- package/styles/mixins/mixins.less +3 -9
- package/styles/mixins/slider.less +1 -1
- package/styles/mixins/textfield.less +9 -7
- package/styles/mixins/textfield.scss +6 -0
- package/styles/taiga-ui-global-old.less +0 -1
- package/styles/taiga-ui-global.less +0 -1
- package/styles/theme/variables.less +1 -1
- package/styles/theme/wrapper/secondary.less +2 -0
- package/tokens/icon-place.d.ts +2 -0
- package/tokens/index.d.ts +2 -0
- package/tokens/option-content.d.ts +1 -1
- package/tokens/svg-content-processor.d.ts +3 -0
- package/tokens/taiga-ui-core-tokens.metadata.json +1 -1
- package/utils/dom/are-css-vars-supported.d.ts +1 -1
- package/utils/miscellaneous/index.d.ts +1 -1
- package/utils/miscellaneous/{is-presumed-hTMLString.d.ts → is-presumed-html-string.d.ts} +0 -0
- package/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.metadata.json +1 -1
- package/utils/polyfills/index.d.ts +1 -1
- package/utils/polyfills/{inner-HTML.d.ts → inner-html.d.ts} +0 -0
- package/utils/polyfills/taiga-ui-core-utils-polyfills.metadata.json +1 -1
- package/components/loader/loader.directive.d.ts +0 -12
- package/esm2015/components/loader/loader.directive.js +0 -61
- package/esm2015/utils/miscellaneous/is-presumed-hTMLString.js +0 -5
- package/esm5/components/loader/loader.directive.js +0 -64
- package/esm5/utils/miscellaneous/is-presumed-hTMLString.js +0 -5
- package/styles/markup/tui-autofill.less +0 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-dropdown-box.js","sources":["ng://@taiga-ui/core/components/dropdown-box/dropdown-box.component.ts","ng://@taiga-ui/core/components/dropdown-box/dropdown-box.module.ts","ng://@taiga-ui/core/components/dropdown-box/taiga-ui-core-components-dropdown-box.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {\n AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n NgZone,\n ViewChild,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {\n AbstractTuiPortalHostComponent,\n getClosestElement,\n getClosestFocusable,\n inRange,\n POLLING_TIME,\n px,\n setNativeFocused,\n TuiActiveZoneDirective,\n tuiAssertIsHTMLElement,\n TuiDestroyService,\n TuiDropdownHostComponent,\n TuiOverscrollModeT,\n tuiPure,\n tuiZonefree,\n} from '@taiga-ui/cdk';\nimport {tuiDropdownAnimation} from '@taiga-ui/core/animations';\nimport {DEFAULT_MARGIN, DEFAULT_MAX_WIDTH} from '@taiga-ui/core/constants';\nimport {TuiDropdownAnimation} from '@taiga-ui/core/enums';\nimport {TuiAnimationOptions, TuiDropdown} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATION_OPTIONS, TUI_DROPDOWN_DIRECTIVE} from '@taiga-ui/core/tokens';\nimport {TuiHorizontalDirection, TuiVerticalDirection} from '@taiga-ui/core/types';\nimport {getScreenWidth} from '@taiga-ui/core/utils/dom';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {takeUntil, throttleTime} from 'rxjs/operators';\n\n/**\n * This component is used to show template in a portal using default style of white rounded box with a shadow\n */\n// @bad TODO: OnPush\n// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395\n// @dynamic\n@Component({\n selector: 'tui-dropdown-box',\n templateUrl: './dropdown-box.template.html',\n styleUrls: ['./dropdown-box.style.less'],\n changeDetection: ChangeDetectionStrategy.Default,\n providers: [TuiDestroyService],\n animations: [tuiDropdownAnimation],\n})\nexport class TuiDropdownBoxComponent implements AfterViewChecked {\n private readonly animationTop = {\n value: TuiDropdownAnimation.FadeInTop,\n ...this.options,\n };\n\n private readonly animationBottom = {\n value: TuiDropdownAnimation.FadeInBottom,\n ...this.options,\n };\n\n /**\n * Is previous position on top (to prevent jumping up and down on scroll)\n */\n private prevDirectionIsTop = false;\n\n @HostBinding('@tuiDropdownAnimation')\n dropdownAnimation!: TuiAnimationOptions;\n\n @ViewChild('content', {read: ElementRef})\n readonly contentElementRef?: ElementRef<HTMLElement>;\n\n constructor(\n @Inject(TuiDestroyService)\n destroy$: TuiDestroyService,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TUI_DROPDOWN_DIRECTIVE) readonly directive: TuiDropdown,\n @Inject(WINDOW) private readonly windowRef: Window,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(AbstractTuiPortalHostComponent)\n private readonly portalHost: TuiDropdownHostComponent,\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n ) {\n merge(\n animationFrame$.pipe(throttleTime(POLLING_TIME)),\n this.directive.refresh$,\n fromEvent(this.windowRef, 'resize'),\n )\n .pipe(tuiZonefree(ngZone), takeUntil(destroy$))\n .subscribe(() => {\n this.calculatePositionAndSize();\n });\n }\n\n get overscroll(): TuiOverscrollModeT {\n return this.inModal ? 'all' : 'scroll';\n }\n\n @tuiPure\n getContext<T extends object>(\n context?: T,\n activeZone?: TuiActiveZoneDirective,\n ):\n | (T & {activeZone?: TuiActiveZoneDirective})\n | {activeZone?: TuiActiveZoneDirective} {\n return {...context, activeZone};\n }\n\n ngAfterViewChecked() {\n this.calculatePositionAndSize();\n }\n\n onTopFocus() {\n this.moveFocusOutside(true);\n }\n\n onBottomFocus() {\n this.moveFocusOutside(false);\n }\n\n @tuiPure\n private get inModal(): boolean {\n // @awful TODO: get rid of component tag name dependency\n return !!getClosestElement(this.directive.host, 'tui-dialog-host');\n }\n\n private calculatePositionAndSize() {\n const {clientRect} = this.directive;\n const {style} = this.elementRef.nativeElement;\n const hostRect = this.directive.fixed\n ? this.portalHost.fixedPositionOffset()\n : this.portalHost.clientRect;\n\n style.position = this.directive.fixed ? 'fixed' : 'absolute';\n\n this.calculateVerticalPosition(style, clientRect, hostRect);\n this.calculateHorizontalPosition(style, clientRect, hostRect);\n this.calculateWidth(style, clientRect);\n }\n\n private getFinalAlign(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n ): TuiHorizontalDirection {\n const dropdownRect = this.elementRef.nativeElement.getBoundingClientRect();\n const dropdownWidth = this.elementRef.nativeElement.offsetWidth;\n const screenWidth = getScreenWidth(this.windowRef.document);\n const isDropdownSizeHypotheticallyFitsViewport =\n directiveRect.left + dropdownWidth < screenWidth ||\n directiveRect.right - dropdownWidth > 0;\n const isDropdownSizeActuallyFitsViewport =\n dropdownRect.right <= screenWidth && dropdownRect.left >= 0;\n let finalAlign: TuiHorizontalDirection = this.directive.align;\n\n switch (this.directive.align) {\n case 'left':\n if (\n isDropdownSizeHypotheticallyFitsViewport &&\n dropdownRect.right > screenWidth\n ) {\n finalAlign = 'right';\n }\n\n break;\n case 'right':\n if (isDropdownSizeHypotheticallyFitsViewport && dropdownRect.left < 0) {\n finalAlign = 'left';\n }\n\n break;\n }\n\n if (style.right === 'auto' && isDropdownSizeActuallyFitsViewport) {\n finalAlign = 'left';\n }\n\n if (style.left === 'auto' && isDropdownSizeActuallyFitsViewport) {\n finalAlign = 'right';\n }\n\n return finalAlign;\n }\n\n /**\n * Calculates horizontal position\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateHorizontalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ) {\n const offset = this.directive.sided\n ? this.elementRef.nativeElement.getBoundingClientRect().width + DEFAULT_MARGIN\n : 0;\n const left = Math.ceil(directiveRect.left - hostRect.left - offset);\n const right = Math.floor(hostRect.right - directiveRect.right - offset);\n\n switch (this.getFinalAlign(style, directiveRect)) {\n case 'left':\n if (\n right + DEFAULT_MARGIN > this.windowRef.innerWidth ||\n inRange(left + DEFAULT_MARGIN, 0, this.windowRef.innerWidth)\n ) {\n style.left = px(left);\n style.right = 'auto';\n } else {\n style.left = 'auto';\n style.right = px(right);\n }\n\n break;\n case 'right':\n if (\n inRange(right + DEFAULT_MARGIN, 0, this.windowRef.innerWidth) ||\n left + DEFAULT_MARGIN > this.windowRef.innerWidth\n ) {\n style.left = 'auto';\n style.right = px(right);\n } else {\n style.left = px(left);\n style.right = 'auto';\n }\n\n break;\n }\n }\n\n /**\n * Calculates vertical position and height\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateVerticalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ) {\n const windowHeight = this.windowRef.innerHeight;\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n const finalDirection = this.getFinalDirection(directiveRect);\n\n this.prevDirectionIsTop = finalDirection === 'top';\n\n if (finalDirection === 'top') {\n this.dropdownAnimation = this.animationBottom;\n\n style.maxHeight = px(Math.min(boxHeightLimit, topAvailableHeight));\n style.top = 'auto';\n style.bottom = px(\n hostRect.bottom - directiveRect.top - DEFAULT_MARGIN + offset,\n );\n } else {\n this.dropdownAnimation = this.animationTop;\n\n style.maxHeight = px(Math.min(boxHeightLimit, bottomAvailableHeight));\n style.top = px(directiveRect.bottom - hostRect.top - DEFAULT_MARGIN + offset);\n style.bottom = 'auto';\n }\n }\n\n private getFinalDirection(directiveRect: ClientRect): TuiVerticalDirection | null {\n const windowHeight = this.windowRef.innerHeight;\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n\n // Maximum space available on top and on the bottom in the viewport\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n\n let finalDirection: TuiVerticalDirection | null = null;\n\n // Given direction is applied if we can fit the box in the limits that way\n switch (this.directive.direction) {\n case 'top':\n if (topAvailableHeight >= this.directive.minHeight) {\n finalDirection = 'top';\n }\n\n break;\n case 'bottom':\n if (bottomAvailableHeight >= this.directive.minHeight) {\n finalDirection = 'bottom';\n }\n\n break;\n }\n\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n\n // Choose direction if given direction did not fit\n if (finalDirection === null && this.contentElementRef) {\n // Box height if it fits without scroll\n const visualHeight = Math.min(\n this.contentElementRef.nativeElement.getBoundingClientRect().height +\n (this.elementRef.nativeElement.offsetHeight -\n this.elementRef.nativeElement.clientHeight),\n boxHeightLimit,\n );\n\n // If there is enough space to fit below without scroll,\n // choose 'bottom', unless it was previously on the top\n if (this.prevDirectionIsTop && topAvailableHeight >= visualHeight) {\n finalDirection = 'top';\n } else if (bottomAvailableHeight >= visualHeight) {\n finalDirection = 'bottom';\n } else {\n // Corner case — select direction with more space\n finalDirection =\n bottomAvailableHeight >= topAvailableHeight ? 'bottom' : 'top';\n }\n }\n\n return finalDirection;\n }\n\n /**\n * Calculates width\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n */\n private calculateWidth(style: CSSStyleDeclaration, directiveRect: ClientRect) {\n style.width =\n this.directive.limitMinWidth === 'fixed' && !this.directive.sided\n ? px(directiveRect.width)\n : '';\n\n if (this.directive.limitMinWidth === 'min' && !this.directive.sided) {\n style.minWidth = px(directiveRect.width);\n style.maxWidth = px(DEFAULT_MAX_WIDTH);\n\n return;\n }\n\n style.minWidth = '';\n style.maxWidth = '';\n }\n\n private moveFocusOutside(previous: boolean) {\n const {host} = this.directive;\n const {ownerDocument} = host;\n const root = ownerDocument ? ownerDocument.body : host;\n\n tuiAssertIsHTMLElement(host);\n\n let focusable = getClosestFocusable(host, previous, root);\n\n while (focusable !== null && host.contains(focusable)) {\n focusable = getClosestFocusable(focusable, previous, root);\n }\n\n if (focusable === null) {\n return;\n }\n\n setNativeFocused(focusable);\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiOverscrollModule} from '@taiga-ui/cdk';\nimport {TuiScrollbarModule} from '@taiga-ui/core/components/scrollbar';\nimport {TuiModeModule} from '@taiga-ui/core/directives/mode';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDropdownBoxComponent} from './dropdown-box.component';\n\n@NgModule({\n imports: [\n TuiActiveZoneModule,\n PolymorpheusModule,\n TuiOverscrollModule,\n TuiScrollbarModule,\n TuiModeModule,\n ],\n entryComponents: [TuiDropdownBoxComponent],\n declarations: [TuiDropdownBoxComponent],\n exports: [TuiDropdownBoxComponent],\n})\nexport class TuiDropdownBoxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAsCA;;;AAGA;AACA;AACA;IASa,uBAAuB,GAApC,MAAa,uBAAuB;IAsBhC,YAEI,QAA2B,EACX,MAAc,EACW,SAAsB,EAC9B,SAAiB,EACb,UAAmC,EAEvD,UAAoC,EACL,OAAyB,EAChD,eAAmC;QANnB,cAAS,GAAT,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uB;IARnC,SAAS,CAAC;QACP,QAAQ,EAAE,kBAAkB;QAC5B,urBAA2C;QAE3C,eAAe,EAAE,uBAAuB,CAAC,OAAO;QAChD,SAAS,EAAE,CAAC,iBAAiB,CAAC;QAC9B,UAAU,EAAE,CAAC,oBAAoB,CAAC;;KACrC,CAAC;IAwBO,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,MAAM,CAAC,MAAM,CAAC,CAAA;IACd,WAAA,MAAM,CAAC,sBAAsB,CAAC,CAAA;IAC9B,WAAA,MAAM,CAAC,MAAM,CAAC,CAAA;IACd,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,MAAM,CAAC,8BAA8B,CAAC,CAAA;IAEtC,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;GAhCnB,uBAAuB,CAwUnC;;ICxWY,oBAAoB,GAAjC,MAAa,oBAAoB;EAAG;AAAvB,oBAAoB;IAZhC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,kBAAkB;YAClB,aAAa;SAChB;QACD,eAAe,EAAE,CAAC,uBAAuB,CAAC;QAC1C,YAAY,EAAE,CAAC,uBAAuB,CAAC;QACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;KACrC,CAAC;GACW,oBAAoB,CAAG;;ACpBpC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-dropdown-box.js","sources":["ng://@taiga-ui/core/components/dropdown-box/dropdown-box.component.ts","ng://@taiga-ui/core/components/dropdown-box/dropdown-box.module.ts","ng://@taiga-ui/core/components/dropdown-box/taiga-ui-core-components-dropdown-box.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {\n AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n NgZone,\n ViewChild,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {\n AbstractTuiPortalHostComponent,\n getClosestElement,\n getClosestFocusable,\n inRange,\n POLLING_TIME,\n px,\n setNativeFocused,\n TuiActiveZoneDirective,\n tuiAssertIsHTMLElement,\n TuiDestroyService,\n TuiDropdownHostComponent,\n TuiOverscrollModeT,\n tuiPure,\n tuiZonefree,\n} from '@taiga-ui/cdk';\nimport {tuiDropdownAnimation} from '@taiga-ui/core/animations';\nimport {DEFAULT_MARGIN, DEFAULT_MAX_WIDTH} from '@taiga-ui/core/constants';\nimport {TuiDropdownAnimation} from '@taiga-ui/core/enums';\nimport {TuiAnimationOptions, TuiDropdown} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATION_OPTIONS, TUI_DROPDOWN_DIRECTIVE} from '@taiga-ui/core/tokens';\nimport {TuiHorizontalDirection, TuiVerticalDirection} from '@taiga-ui/core/types';\nimport {getScreenWidth} from '@taiga-ui/core/utils/dom';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {takeUntil, throttleTime} from 'rxjs/operators';\n\n/**\n * This component is used to show template in a portal using default style of white rounded box with a shadow\n */\n// @bad TODO: OnPush\n// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395\n// @dynamic\n@Component({\n selector: 'tui-dropdown-box',\n templateUrl: './dropdown-box.template.html',\n styleUrls: ['./dropdown-box.style.less'],\n changeDetection: ChangeDetectionStrategy.Default,\n providers: [TuiDestroyService],\n animations: [tuiDropdownAnimation],\n})\nexport class TuiDropdownBoxComponent implements AfterViewChecked {\n private readonly animationTop = {\n value: TuiDropdownAnimation.FadeInTop,\n ...this.options,\n };\n\n private readonly animationBottom = {\n value: TuiDropdownAnimation.FadeInBottom,\n ...this.options,\n };\n\n /**\n * Is previous position on top (to prevent jumping up and down on scroll)\n */\n private prevDirectionIsTop = false;\n\n @HostBinding('@tuiDropdownAnimation')\n dropdownAnimation!: TuiAnimationOptions;\n\n @ViewChild('content', {read: ElementRef})\n readonly contentElementRef?: ElementRef<HTMLElement>;\n\n constructor(\n @Inject(TuiDestroyService)\n destroy$: TuiDestroyService,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TUI_DROPDOWN_DIRECTIVE) readonly directive: TuiDropdown,\n @Inject(WINDOW) private readonly windowRef: Window,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(AbstractTuiPortalHostComponent)\n private readonly portalHost: TuiDropdownHostComponent,\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n ) {\n merge(\n animationFrame$.pipe(throttleTime(POLLING_TIME)),\n this.directive.refresh$,\n fromEvent(this.windowRef, 'resize'),\n )\n .pipe(tuiZonefree(ngZone), takeUntil(destroy$))\n .subscribe(() => {\n this.calculatePositionAndSize();\n });\n }\n\n get overscroll(): TuiOverscrollModeT {\n return this.inModal ? 'all' : 'scroll';\n }\n\n @tuiPure\n getContext<T extends object>(\n context?: T,\n activeZone?: TuiActiveZoneDirective,\n ):\n | (T & {activeZone?: TuiActiveZoneDirective})\n | {activeZone?: TuiActiveZoneDirective} {\n return {...context, activeZone};\n }\n\n ngAfterViewChecked(): void {\n this.calculatePositionAndSize();\n }\n\n onTopFocus(): void {\n this.moveFocusOutside(true);\n }\n\n onBottomFocus(): void {\n this.moveFocusOutside(false);\n }\n\n @tuiPure\n private get inModal(): boolean {\n // @awful TODO: get rid of component tag name dependency\n return !!getClosestElement(this.directive.host, 'tui-dialog-host');\n }\n\n private calculatePositionAndSize(): void {\n const {clientRect} = this.directive;\n const {style} = this.elementRef.nativeElement;\n const hostRect = this.directive.fixed\n ? this.portalHost.fixedPositionOffset()\n : this.portalHost.clientRect;\n\n style.position = this.directive.fixed ? 'fixed' : 'absolute';\n\n this.calculateVerticalPosition(style, clientRect, hostRect);\n this.calculateHorizontalPosition(style, clientRect, hostRect);\n this.calculateWidth(style, clientRect);\n }\n\n private getFinalAlign(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n ): TuiHorizontalDirection {\n const dropdownRect = this.elementRef.nativeElement.getBoundingClientRect();\n const dropdownWidth = this.elementRef.nativeElement.offsetWidth;\n const screenWidth = getScreenWidth(this.windowRef.document);\n const isDropdownSizeHypotheticallyFitsViewport =\n directiveRect.left + dropdownWidth < screenWidth ||\n directiveRect.right - dropdownWidth > 0;\n const isDropdownSizeActuallyFitsViewport =\n dropdownRect.right <= screenWidth && dropdownRect.left >= 0;\n let finalAlign: TuiHorizontalDirection = this.directive.align;\n\n switch (this.directive.align) {\n case 'left':\n if (\n isDropdownSizeHypotheticallyFitsViewport &&\n dropdownRect.right > screenWidth\n ) {\n finalAlign = 'right';\n }\n\n break;\n case 'right':\n if (isDropdownSizeHypotheticallyFitsViewport && dropdownRect.left < 0) {\n finalAlign = 'left';\n }\n\n break;\n }\n\n if (style.right === 'auto' && isDropdownSizeActuallyFitsViewport) {\n finalAlign = 'left';\n }\n\n if (style.left === 'auto' && isDropdownSizeActuallyFitsViewport) {\n finalAlign = 'right';\n }\n\n return finalAlign;\n }\n\n /**\n * Calculates horizontal position\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateHorizontalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ): void {\n const offset = this.directive.sided\n ? this.elementRef.nativeElement.getBoundingClientRect().width + DEFAULT_MARGIN\n : 0;\n const left = Math.ceil(directiveRect.left - hostRect.left - offset);\n const right = Math.floor(hostRect.right - directiveRect.right - offset);\n\n switch (this.getFinalAlign(style, directiveRect)) {\n case 'left':\n if (\n right + DEFAULT_MARGIN > this.windowRef.innerWidth ||\n inRange(left + DEFAULT_MARGIN, 0, this.windowRef.innerWidth)\n ) {\n style.left = px(left);\n style.right = 'auto';\n } else {\n style.left = 'auto';\n style.right = px(right);\n }\n\n break;\n case 'right':\n if (\n inRange(right + DEFAULT_MARGIN, 0, this.windowRef.innerWidth) ||\n left + DEFAULT_MARGIN > this.windowRef.innerWidth\n ) {\n style.left = 'auto';\n style.right = px(right);\n } else {\n style.left = px(left);\n style.right = 'auto';\n }\n\n break;\n }\n }\n\n /**\n * Calculates vertical position and height\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateVerticalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ): void {\n const windowHeight = this.windowRef.innerHeight;\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n const finalDirection = this.getFinalDirection(directiveRect);\n\n this.prevDirectionIsTop = finalDirection === 'top';\n\n if (finalDirection === 'top') {\n this.dropdownAnimation = this.animationBottom;\n\n style.maxHeight = px(Math.min(boxHeightLimit, topAvailableHeight));\n style.top = 'auto';\n style.bottom = px(\n hostRect.bottom - directiveRect.top - DEFAULT_MARGIN + offset,\n );\n } else {\n this.dropdownAnimation = this.animationTop;\n\n style.maxHeight = px(Math.min(boxHeightLimit, bottomAvailableHeight));\n style.top = px(directiveRect.bottom - hostRect.top - DEFAULT_MARGIN + offset);\n style.bottom = 'auto';\n }\n }\n\n private getFinalDirection(directiveRect: ClientRect): TuiVerticalDirection | null {\n const windowHeight = this.windowRef.innerHeight;\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n\n // Maximum space available on top and on the bottom in the viewport\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n\n let finalDirection: TuiVerticalDirection | null = null;\n\n // Given direction is applied if we can fit the box in the limits that way\n switch (this.directive.direction) {\n case 'top':\n if (topAvailableHeight >= this.directive.minHeight) {\n finalDirection = 'top';\n }\n\n break;\n case 'bottom':\n if (bottomAvailableHeight >= this.directive.minHeight) {\n finalDirection = 'bottom';\n }\n\n break;\n }\n\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n\n // Choose direction if given direction did not fit\n if (finalDirection === null && this.contentElementRef) {\n // Box height if it fits without scroll\n const visualHeight = Math.min(\n this.contentElementRef.nativeElement.getBoundingClientRect().height +\n (this.elementRef.nativeElement.offsetHeight -\n this.elementRef.nativeElement.clientHeight),\n boxHeightLimit,\n );\n\n // If there is enough space to fit below without scroll,\n // choose 'bottom', unless it was previously on the top\n if (this.prevDirectionIsTop && topAvailableHeight >= visualHeight) {\n finalDirection = 'top';\n } else if (bottomAvailableHeight >= visualHeight) {\n finalDirection = 'bottom';\n } else {\n // Corner case — select direction with more space\n finalDirection =\n bottomAvailableHeight >= topAvailableHeight ? 'bottom' : 'top';\n }\n }\n\n return finalDirection;\n }\n\n /**\n * Calculates width\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n */\n private calculateWidth(style: CSSStyleDeclaration, directiveRect: ClientRect): void {\n style.width =\n this.directive.limitMinWidth === 'fixed' && !this.directive.sided\n ? px(directiveRect.width)\n : '';\n\n if (this.directive.limitMinWidth === 'min' && !this.directive.sided) {\n style.minWidth = px(directiveRect.width);\n style.maxWidth = px(DEFAULT_MAX_WIDTH);\n\n return;\n }\n\n style.minWidth = '';\n style.maxWidth = '';\n }\n\n private moveFocusOutside(previous: boolean): void {\n const {host} = this.directive;\n const {ownerDocument} = host;\n const root = ownerDocument ? ownerDocument.body : host;\n\n tuiAssertIsHTMLElement(host);\n\n let focusable = getClosestFocusable(host, previous, root);\n\n while (focusable !== null && host.contains(focusable)) {\n focusable = getClosestFocusable(focusable, previous, root);\n }\n\n if (focusable === null) {\n return;\n }\n\n setNativeFocused(focusable);\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiOverscrollModule} from '@taiga-ui/cdk';\nimport {TuiScrollbarModule} from '@taiga-ui/core/components/scrollbar';\nimport {TuiModeModule} from '@taiga-ui/core/directives/mode';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDropdownBoxComponent} from './dropdown-box.component';\n\n@NgModule({\n imports: [\n TuiActiveZoneModule,\n PolymorpheusModule,\n TuiOverscrollModule,\n TuiScrollbarModule,\n TuiModeModule,\n ],\n entryComponents: [TuiDropdownBoxComponent],\n declarations: [TuiDropdownBoxComponent],\n exports: [TuiDropdownBoxComponent],\n})\nexport class TuiDropdownBoxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAsCA;;;AAGA;AACA;AACA;IASa,uBAAuB,GAApC,MAAa,uBAAuB;IAsBhC,YAEI,QAA2B,EACX,MAAc,EACW,SAAsB,EAC9B,SAAiB,EACb,UAAmC,EAEvD,UAAoC,EACL,OAAyB,EAChD,eAAmC;QANnB,cAAS,GAAT,SAAS,CAAa;QAC9B,cAAS,GAAT,SAAS,CAAQ;QACb,eAAU,GAAV,UAAU,CAAyB;QAEvD,eAAU,GAAV,UAAU,CAA0B;QACL,YAAO,GAAP,OAAO,CAAkB;QA9B5D,iBAAY,mBACzB,KAAK,iCACF,IAAI,CAAC,OAAO,EACjB;QAEe,oBAAe,mBAC5B,KAAK,uCACF,IAAI,CAAC,OAAO,EACjB;;;;QAKM,uBAAkB,GAAG,KAAK,CAAC;QAoB/B,KAAK,CACD,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,EAChD,IAAI,CAAC,SAAS,CAAC,QAAQ,EACvB,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CACtC;aACI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,S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AAA,MAAM,CAAC,eAAe,CAAC,CAAA;GAhCnB,uBAAuB,CAwUnC;;ICxWY,oBAAoB,GAAjC,MAAa,oBAAoB;EAAG;AAAvB,oBAAoB;IAZhC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,kBAAkB;YAClB,aAAa;SAChB;QACD,eAAe,EAAE,CAAC,uBAAuB,CAAC;QAC1C,YAAY,EAAE,CAAC,uBAAuB,CAAC;QACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;KACrC,CAAC;GACW,oBAAoB,CAAG;;ACpBpC;;;;;;"}
|
|
@@ -5,7 +5,7 @@ import { TUI_EXPAND_LOADED } from '@taiga-ui/core/constants';
|
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
6
|
import { TuiLoaderModule } from '@taiga-ui/core/components/loader';
|
|
7
7
|
|
|
8
|
-
// @bad TODO Replace with PolymorpheusContent
|
|
8
|
+
// @bad TODO: 3.0 Replace with PolymorpheusContent
|
|
9
9
|
let TuiExpandContentDirective = class TuiExpandContentDirective {
|
|
10
10
|
};
|
|
11
11
|
TuiExpandContentDirective = __decorate([
|
|
@@ -83,7 +83,7 @@ let TuiExpandComponent = class TuiExpandComponent {
|
|
|
83
83
|
}
|
|
84
84
|
retrigger(state) {
|
|
85
85
|
this.state = State.Prepared;
|
|
86
|
-
// We need delay to
|
|
86
|
+
// We need delay to re-trigger CSS height transition from the correct number
|
|
87
87
|
setTimeout(() => {
|
|
88
88
|
if (this.state !== State.Prepared) {
|
|
89
89
|
return;
|
|
@@ -132,7 +132,7 @@ __decorate([
|
|
|
132
132
|
TuiExpandComponent = __decorate([
|
|
133
133
|
Component({
|
|
134
134
|
selector: 'tui-expand',
|
|
135
|
-
template: "<div\n #wrapper\n class=\"wrapper\"\n>\n <ng-container *ngIf=\"contentVisible\">\n <ng-content></ng-content>\n <!-- TODO: collision with async pipe, fix after upgrade to ng11 -->\n <tui-loader\n *ngIf=\"this.async; else content\"\n size=\"l\"\n [overlay]=\"true\"\n [showLoader]=\"loading\"\n >\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </tui-loader>\n </ng-container>\n</div>\n",
|
|
135
|
+
template: "<div\n #wrapper\n class=\"wrapper\"\n>\n <ng-container *ngIf=\"contentVisible\">\n <ng-content></ng-content>\n <!-- TODO: 3.0 collision with async pipe, fix after upgrade to ng11 -->\n <tui-loader\n *ngIf=\"this.async; else content\"\n size=\"l\"\n [overlay]=\"true\"\n [showLoader]=\"loading\"\n >\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </tui-loader>\n </ng-container>\n</div>\n",
|
|
136
136
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
137
137
|
styles: [":host{display:block;transition-property:opacity,height,visibility;transition-duration:var(--tui-duration,300ms);opacity:0}:host._overflow{overflow:hidden}:host._expanded{opacity:1;transform:translate3d(0,0,0)}:host._loading{opacity:.99}.wrapper:after,.wrapper:before{content:'';display:table}"]
|
|
138
138
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-expand.js","sources":["ng://@taiga-ui/core/components/expand/expand-content.directive.ts","ng://@taiga-ui/core/components/expand/expand.component.ts","ng://@taiga-ui/core/components/expand/expand.module.ts","ng://@taiga-ui/core/components/expand/taiga-ui-core-components-expand.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n// @bad TODO Replace with PolymorpheusContent\n@Directive({\n selector: '[tuiExpandContent]',\n})\nexport class TuiExpandContentDirective {}\n","import {NgIfContext} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {isCurrentTarget, tuiDefaultProp, tuiRequiredSetter} from '@taiga-ui/cdk';\nimport {TUI_EXPAND_LOADED} from '@taiga-ui/core/constants';\n\nimport {TuiExpandContentDirective} from './expand-content.directive';\n\nenum State {\n Idle,\n Loading,\n Prepared,\n Animated,\n}\n\nconst LOADER_HEIGHT = 48;\n\n@Component({\n selector: 'tui-expand',\n templateUrl: './expand.template.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: ['./expand.style.less'],\n})\nexport class TuiExpandComponent {\n @ViewChild('wrapper')\n private readonly contentWrapper?: ElementRef<HTMLDivElement>;\n\n private state = State.Idle;\n\n @Input()\n @tuiDefaultProp()\n async = false;\n\n @Input('expanded')\n @tuiRequiredSetter()\n set expandedSetter(expanded: boolean | null) {\n if (this.expanded === null) {\n this.expanded = expanded;\n\n return;\n }\n\n if (this.state !== State.Idle) {\n this.expanded = expanded;\n this.state = State.Animated;\n\n return;\n }\n\n this.expanded = expanded;\n this.retrigger(this.async && expanded ? State.Loading : State.Animated);\n }\n\n @ContentChild(TuiExpandContentDirective, {read: TemplateRef})\n content: TemplateRef<NgIfContext<boolean>> | null = null;\n\n @HostBinding('class._expanded')\n @HostBinding('attr.aria-expanded')\n expanded: boolean | null = null;\n\n constructor(\n @Inject(ChangeDetectorRef) private readonly changeDetectorRef: ChangeDetectorRef,\n ) {}\n\n @HostBinding('class._overflow')\n get overflow(): boolean {\n return this.state !== State.Idle;\n }\n\n @HostBinding('class._loading')\n get loading(): boolean {\n return !!this.expanded && this.async && this.state === State.Loading;\n }\n\n @HostBinding('style.height.px')\n get height(): number | null {\n const {expanded, state, contentWrapper} = this;\n\n if (\n (expanded && state === State.Prepared) ||\n (!expanded && state === State.Animated)\n ) {\n return 0;\n }\n\n if (\n contentWrapper &&\n ((!expanded && state === State.Prepared) ||\n (expanded && state === State.Animated))\n ) {\n return contentWrapper.nativeElement.offsetHeight;\n }\n\n if (contentWrapper && expanded && state === State.Loading) {\n return Math.max(contentWrapper.nativeElement.offsetHeight, LOADER_HEIGHT);\n }\n\n return null;\n }\n\n get contentVisible(): boolean {\n return this.expanded || this.state !== State.Idle;\n }\n\n @HostListener('transitionend', ['$event'])\n onTransitionEnd(event: TransitionEvent) {\n if (\n isCurrentTarget(event) &&\n event.propertyName === 'opacity' &&\n this.state === State.Animated\n ) {\n this.state = State.Idle;\n }\n }\n\n @HostListener(TUI_EXPAND_LOADED, ['$event'])\n onExpandLoaded(event: Event) {\n event.stopPropagation();\n\n if (this.state === State.Loading) {\n this.retrigger(State.Animated);\n }\n }\n\n private retrigger(state: State) {\n this.state = State.Prepared;\n\n // We need delay to
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-expand.js","sources":["ng://@taiga-ui/core/components/expand/expand-content.directive.ts","ng://@taiga-ui/core/components/expand/expand.component.ts","ng://@taiga-ui/core/components/expand/expand.module.ts","ng://@taiga-ui/core/components/expand/taiga-ui-core-components-expand.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n// @bad TODO: 3.0 Replace with PolymorpheusContent\n@Directive({\n selector: '[tuiExpandContent]',\n})\nexport class TuiExpandContentDirective {}\n","import {NgIfContext} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {isCurrentTarget, tuiDefaultProp, tuiRequiredSetter} from '@taiga-ui/cdk';\nimport {TUI_EXPAND_LOADED} from '@taiga-ui/core/constants';\n\nimport {TuiExpandContentDirective} from './expand-content.directive';\n\nenum State {\n Idle,\n Loading,\n Prepared,\n Animated,\n}\n\nconst LOADER_HEIGHT = 48;\n\n@Component({\n selector: 'tui-expand',\n templateUrl: './expand.template.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: ['./expand.style.less'],\n})\nexport class TuiExpandComponent {\n @ViewChild('wrapper')\n private readonly contentWrapper?: ElementRef<HTMLDivElement>;\n\n private state = State.Idle;\n\n @Input()\n @tuiDefaultProp()\n async = false;\n\n @Input('expanded')\n @tuiRequiredSetter()\n set expandedSetter(expanded: boolean | null) {\n if (this.expanded === null) {\n this.expanded = expanded;\n\n return;\n }\n\n if (this.state !== State.Idle) {\n this.expanded = expanded;\n this.state = State.Animated;\n\n return;\n }\n\n this.expanded = expanded;\n this.retrigger(this.async && expanded ? State.Loading : State.Animated);\n }\n\n @ContentChild(TuiExpandContentDirective, {read: TemplateRef})\n content: TemplateRef<NgIfContext<boolean>> | null = null;\n\n @HostBinding('class._expanded')\n @HostBinding('attr.aria-expanded')\n expanded: boolean | null = null;\n\n constructor(\n @Inject(ChangeDetectorRef) private readonly changeDetectorRef: ChangeDetectorRef,\n ) {}\n\n @HostBinding('class._overflow')\n get overflow(): boolean {\n return this.state !== State.Idle;\n }\n\n @HostBinding('class._loading')\n get loading(): boolean {\n return !!this.expanded && this.async && this.state === State.Loading;\n }\n\n @HostBinding('style.height.px')\n get height(): number | null {\n const {expanded, state, contentWrapper} = this;\n\n if (\n (expanded && state === State.Prepared) ||\n (!expanded && state === State.Animated)\n ) {\n return 0;\n }\n\n if (\n contentWrapper &&\n ((!expanded && state === State.Prepared) ||\n (expanded && state === State.Animated))\n ) {\n return contentWrapper.nativeElement.offsetHeight;\n }\n\n if (contentWrapper && expanded && state === State.Loading) {\n return Math.max(contentWrapper.nativeElement.offsetHeight, LOADER_HEIGHT);\n }\n\n return null;\n }\n\n get contentVisible(): boolean {\n return this.expanded || this.state !== State.Idle;\n }\n\n @HostListener('transitionend', ['$event'])\n onTransitionEnd(event: TransitionEvent): void {\n if (\n isCurrentTarget(event) &&\n event.propertyName === 'opacity' &&\n this.state === State.Animated\n ) {\n this.state = State.Idle;\n }\n }\n\n @HostListener(TUI_EXPAND_LOADED, ['$event'])\n onExpandLoaded(event: Event): void {\n event.stopPropagation();\n\n if (this.state === State.Loading) {\n this.retrigger(State.Animated);\n }\n }\n\n private retrigger(state: State): void {\n this.state = State.Prepared;\n\n // We need delay to re-trigger CSS height transition from the correct number\n setTimeout(() => {\n if (this.state !== State.Prepared) {\n return;\n }\n\n this.state = state;\n this.changeDetectorRef.markForCheck();\n });\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiLoaderModule} from '@taiga-ui/core/components/loader';\n\nimport {TuiExpandComponent} from './expand.component';\nimport {TuiExpandContentDirective} from './expand-content.directive';\n\n@NgModule({\n imports: [CommonModule, TuiLoaderModule],\n declarations: [TuiExpandComponent, TuiExpandContentDirective],\n exports: [TuiExpandComponent, TuiExpandContentDirective],\n})\nexport class TuiExpandModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA;IAIa,yBAAyB,GAAtC,MAAa,yBAAyB;EAAG;AAA5B,yBAAyB;IAHrC,SAAS,CAAC;QACP,QAAQ,EAAE,oBAAoB;KACjC,CAAC;GACW,yBAAyB,CAAG;;ACazC,IAAK,KAKJ;AALD,WAAK,KAAK;IACN,iCAAI,CAAA;IACJ,uCAAO,CAAA;IACP,yCAAQ,CAAA;IACR,yCAAQ,CAAA;AACZ,CAAC,EALI,KAAK,KAAL,KAAK,QAKT;AAED,MAAM,aAAa,GAAG,EAAE,CAAC;IAQZ,kBAAkB,GAA/B,MAAa,kBAAkB;IAqC3B,YACgD,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;QAlC5E,UAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QAI3B,UAAK,GAAG,KAAK,CAAC;QAuBd,YAAO,GAA6C,IAAI,CAAC;QAIzD,aAAQ,GAAmB,IAAI,CAAC;KAI5B;IA3BJ,IAAI,cAAc,CAAC,QAAwB;QACvC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE;YACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAEzB,OAAO;SACV;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE;YAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC;YA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;IADC,YAAY,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,CAAC;wDAO3C;AAnGQ,kBAAkB;IAN9B,SAAS,CAAC;QACP,QAAQ,EAAE,YAAY;QACtB,sgBAAqC;QACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;KAElD,CAAC;IAuCO,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;GAtCrB,kBAAkB,CAkH9B;;ICxIY,eAAe,GAA5B,MAAa,eAAe;EAAG;AAAlB,eAAe;IAL3B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC;QACxC,YAAY,EAAE,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;QAC7D,OAAO,EAAE,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;KAC3D,CAAC;GACW,eAAe,CAAG;;ACZ/B;;;;;;"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { __decorate, __param } from 'tslib';
|
|
2
|
-
import {
|
|
2
|
+
import { ElementRef, Inject, Component, ChangeDetectionStrategy, NgZone, forwardRef, ViewChild, HostBinding, NgModule } from '@angular/core';
|
|
3
3
|
import { ANIMATION_FRAME, WINDOW } from '@ng-web-apis/common';
|
|
4
|
-
import { tuiZonefree, px, TuiDestroyService, tuiPure, TuiHoveredModule, TuiActiveZoneModule } from '@taiga-ui/cdk';
|
|
4
|
+
import { TUI_PARENT_ANIMATION, tuiZonefree, px, TuiDestroyService, tuiPure, TuiHoveredModule, TuiActiveZoneModule } from '@taiga-ui/cdk';
|
|
5
|
+
import { tuiFadeIn } from '@taiga-ui/core/animations';
|
|
5
6
|
import { TuiPointerHintDirective } from '@taiga-ui/core/directives/pointer-hint';
|
|
6
7
|
import { TUI_ANIMATION_OPTIONS, TUI_MEDIA } from '@taiga-ui/core/tokens';
|
|
8
|
+
import { PolymorpheusComponent, POLYMORPHEUS_CONTEXT, PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
7
9
|
import { Observable } from 'rxjs';
|
|
8
10
|
import { takeUntil } from 'rxjs/operators';
|
|
9
|
-
import { tuiFadeIn } from '@taiga-ui/core/animations';
|
|
10
11
|
import { TuiHintDirective } from '@taiga-ui/core/directives/hint';
|
|
11
12
|
import { TuiHintService } from '@taiga-ui/core/services';
|
|
12
13
|
import { CommonModule } from '@angular/common';
|
|
13
|
-
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
14
14
|
|
|
15
15
|
let TuiHintsHostComponent = class TuiHintsHostComponent {
|
|
16
|
-
constructor(
|
|
17
|
-
this.options = options;
|
|
16
|
+
constructor(elementRef, hints$) {
|
|
18
17
|
this.elementRef = elementRef;
|
|
19
18
|
this.hints$ = hints$;
|
|
20
|
-
this.
|
|
19
|
+
this.component = new PolymorpheusComponent(TuiHintBoxComponent);
|
|
21
20
|
}
|
|
22
21
|
get clientRect() {
|
|
23
22
|
return this.elementRef.nativeElement.getBoundingClientRect();
|
|
@@ -29,24 +28,22 @@ let TuiHintsHostComponent = class TuiHintsHostComponent {
|
|
|
29
28
|
}
|
|
30
29
|
};
|
|
31
30
|
TuiHintsHostComponent.ctorParameters = () => [
|
|
32
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_ANIMATION_OPTIONS,] }] },
|
|
33
31
|
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
|
|
34
32
|
{ type: TuiHintService, decorators: [{ type: Inject, args: [TuiHintService,] }] }
|
|
35
33
|
];
|
|
36
34
|
TuiHintsHostComponent = __decorate([
|
|
37
35
|
Component({
|
|
38
36
|
selector: 'tui-hints-host',
|
|
39
|
-
template: "<
|
|
37
|
+
template: "<div\n *ngFor=\"let hint of hints$ | async\"\n role=\"tooltip\"\n polymorpheus-outlet\n @tuiParentAnimation\n [attr.id]=\"hint.id\"\n [content]=\"component\"\n [context]=\"{ $implicit: hint }\"\n [tuiActiveZoneParent]=\"hint.activeZone\"\n (tuiHoveredChange)=\"onHovered($event, hint)\"\n></div>\n",
|
|
40
38
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
-
animations: [
|
|
39
|
+
animations: [TUI_PARENT_ANIMATION],
|
|
42
40
|
host: {
|
|
43
41
|
'aria-live': 'polite',
|
|
44
42
|
},
|
|
45
|
-
styles: [":host{position:fixed;bottom:0;left:0;width:100%;height:0}
|
|
43
|
+
styles: [":host{position:fixed;bottom:0;left:0;width:100%;height:0}"]
|
|
46
44
|
}),
|
|
47
|
-
__param(0, Inject(
|
|
48
|
-
__param(1, Inject(
|
|
49
|
-
__param(2, Inject(TuiHintService))
|
|
45
|
+
__param(0, Inject(ElementRef)),
|
|
46
|
+
__param(1, Inject(TuiHintService))
|
|
50
47
|
], TuiHintsHostComponent);
|
|
51
48
|
|
|
52
49
|
const SPACE = 8;
|
|
@@ -80,15 +77,21 @@ const reverseDirectionsHorizontal = {
|
|
|
80
77
|
// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
|
|
81
78
|
// @dynamic
|
|
82
79
|
let TuiHintBoxComponent = class TuiHintBoxComponent {
|
|
83
|
-
constructor(animationFrame$, destroy$, ngZone, elementRef, windowRef, media, hintsHost) {
|
|
80
|
+
constructor(animationFrame$, destroy$, ngZone, options, elementRef, windowRef, media, hintsHost, context) {
|
|
81
|
+
this.options = options;
|
|
84
82
|
this.elementRef = elementRef;
|
|
85
83
|
this.windowRef = windowRef;
|
|
86
84
|
this.media = media;
|
|
87
85
|
this.hintsHost = hintsHost;
|
|
86
|
+
this.context = context;
|
|
87
|
+
this.animation = Object.assign({ value: '' }, this.options);
|
|
88
88
|
animationFrame$
|
|
89
89
|
.pipe(tuiZonefree(ngZone), takeUntil(destroy$))
|
|
90
90
|
.subscribe(() => this.calculatePosition());
|
|
91
91
|
}
|
|
92
|
+
get hint() {
|
|
93
|
+
return this.context.$implicit;
|
|
94
|
+
}
|
|
92
95
|
get isUntouchable() {
|
|
93
96
|
return this.hint instanceof TuiPointerHintDirective;
|
|
94
97
|
}
|
|
@@ -245,17 +248,19 @@ TuiHintBoxComponent.ctorParameters = () => [
|
|
|
245
248
|
{ type: Observable, decorators: [{ type: Inject, args: [ANIMATION_FRAME,] }] },
|
|
246
249
|
{ type: Observable, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
|
|
247
250
|
{ type: NgZone, decorators: [{ type: Inject, args: [NgZone,] }] },
|
|
251
|
+
{ type: undefined, decorators: [{ type: Inject, args: [TUI_ANIMATION_OPTIONS,] }] },
|
|
248
252
|
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
|
|
249
253
|
{ type: Window, decorators: [{ type: Inject, args: [WINDOW,] }] },
|
|
250
254
|
{ type: undefined, decorators: [{ type: Inject, args: [TUI_MEDIA,] }] },
|
|
251
|
-
{ type: TuiHintsHostComponent, decorators: [{ type: Inject, args: [TuiHintsHostComponent,] }] }
|
|
255
|
+
{ type: TuiHintsHostComponent, decorators: [{ type: Inject, args: [forwardRef(() => TuiHintsHostComponent),] }] },
|
|
256
|
+
{ type: undefined, decorators: [{ type: Inject, args: [POLYMORPHEUS_CONTEXT,] }] }
|
|
252
257
|
];
|
|
253
258
|
__decorate([
|
|
254
259
|
ViewChild('arrow')
|
|
255
260
|
], TuiHintBoxComponent.prototype, "arrow", void 0);
|
|
256
261
|
__decorate([
|
|
257
|
-
|
|
258
|
-
], TuiHintBoxComponent.prototype, "
|
|
262
|
+
HostBinding('@tuiFadeIn')
|
|
263
|
+
], TuiHintBoxComponent.prototype, "animation", void 0);
|
|
259
264
|
__decorate([
|
|
260
265
|
tuiPure,
|
|
261
266
|
HostBinding('class._untouchable')
|
|
@@ -266,27 +271,31 @@ __decorate([
|
|
|
266
271
|
TuiHintBoxComponent = __decorate([
|
|
267
272
|
Component({
|
|
268
273
|
selector: 'tui-hint-box[hint]',
|
|
269
|
-
template: "<!-- @bad TODO: Refactor to use this arrow in all cases -->\n<div\n *ngIf=\"isMobile\"\n #arrow\n class=\"t-arrow\"\n></div>\n<div\n automation-id=\"tui-hint-box__tooltip\"\n class=\"t-tooltip\"\n>\n <ng-
|
|
274
|
+
template: "<!-- @bad TODO: Refactor to use this arrow in all cases -->\n<div\n *ngIf=\"isMobile\"\n #arrow\n class=\"t-arrow\"\n></div>\n<div\n automation-id=\"tui-hint-box__tooltip\"\n polymorpheus-outlet\n class=\"t-tooltip\"\n [content]=\"hint.content\"\n>\n <ng-template let-text>\n <span class=\"t-text\">{{ text }}</span>\n </ng-template>\n</div>\n",
|
|
270
275
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
271
276
|
providers: [TuiDestroyService],
|
|
272
|
-
|
|
277
|
+
animations: [tuiFadeIn],
|
|
278
|
+
styles: [":host{position:absolute;top:0;left:0;max-width:18rem;min-height:var(--tui-height-m);padding:.75rem 1rem;background:var(--tui-primary);border-radius:var(--tui-radius-l);color:var(--tui-primary-text);box-sizing:border-box}:host .t-arrow,:host:not([data-mode=overflow]):before{content:'';position:absolute;width:.5rem;height:.5rem;border-radius:.125rem;box-sizing:border-box;background-color:inherit;transform:rotate(45deg)}:host[data-tui-host-direction=top] .t-arrow{bottom:-.25rem}:host[data-tui-host-direction=bottom] .t-arrow{top:-.25rem}:host[data-tui-host-direction=bottom]:before,:host[data-tui-host-direction=top]:before{display:none}:host[data-tui-host-direction=top-left]:before,:host[data-tui-host-direction=top-middle]:before,:host[data-tui-host-direction=top-right]:before{bottom:-.25rem}:host[data-tui-host-direction=bottom-left]:before,:host[data-tui-host-direction=bottom-middle]:before,:host[data-tui-host-direction=bottom-right]:before{top:-.25rem}:host[data-tui-host-direction=bottom-middle]:before,:host[data-tui-host-direction=top-middle]:before{left:calc(50% - .2rem)}:host[data-tui-host-direction=bottom-left]:before,:host[data-tui-host-direction=top-left]:before{right:1.075rem}:host[data-tui-host-direction=bottom-right]:before,:host[data-tui-host-direction=top-right]:before{left:1.075rem}:host[data-tui-host-direction=left]:before,:host[data-tui-host-direction=right]:before{top:50%;margin-top:-.25rem}:host[data-tui-host-direction=left]:before{right:-.25rem}:host[data-tui-host-direction=right]:before{left:-.25rem}:host[data-mode=error]{background-color:var(--tui-error-fill)}:host[data-mode=onDark],:host[data-mode=overflow]{box-shadow:0 .5rem 1rem rgba(0,0,0,.16);border:1px solid var(--tui-base-03);background-color:var(--tui-base-01);color:var(--tui-text-01)}:host[data-mode=onDark]:before,:host[data-mode=overflow]:before{border:1px solid var(--tui-base-03)}:host[data-mode=onDark][data-tui-host-direction=left]:before,:host[data-mode=overflow][data-tui-host-direction=left]:before{border-left-color:transparent;border-bottom-color:transparent}:host[data-mode=onDark][data-tui-host-direction=right]:before,:host[data-mode=overflow][data-tui-host-direction=right]:before{border-right-color:transparent;border-top-color:transparent}:host[data-mode=onDark][data-tui-host-direction=top-left]:before,:host[data-mode=onDark][data-tui-host-direction=top-middle]:before,:host[data-mode=onDark][data-tui-host-direction=top-right]:before,:host[data-mode=overflow][data-tui-host-direction=top-left]:before,:host[data-mode=overflow][data-tui-host-direction=top-middle]:before,:host[data-mode=overflow][data-tui-host-direction=top-right]:before{border-left-color:transparent;border-top-color:transparent}:host[data-mode=onDark][data-tui-host-direction=bottom-left]:before,:host[data-mode=onDark][data-tui-host-direction=bottom-middle]:before,:host[data-mode=onDark][data-tui-host-direction=bottom-right]:before,:host[data-mode=overflow][data-tui-host-direction=bottom-left]:before,:host[data-mode=overflow][data-tui-host-direction=bottom-middle]:before,:host[data-mode=overflow][data-tui-host-direction=bottom-right]:before{border-right-color:transparent;border-bottom-color:transparent}:host[data-mode=overflow]{max-width:none}:host._untouchable{pointer-events:none}.t-tooltip{font:var(--tui-font-text-s);word-wrap:break-word}:host[data-mode=overflow] .t-tooltip{font:inherit}.t-text{white-space:pre-wrap}"]
|
|
273
279
|
}),
|
|
274
280
|
__param(0, Inject(ANIMATION_FRAME)),
|
|
275
281
|
__param(1, Inject(TuiDestroyService)),
|
|
276
282
|
__param(2, Inject(NgZone)),
|
|
277
|
-
__param(3, Inject(
|
|
278
|
-
__param(4, Inject(
|
|
279
|
-
__param(5, Inject(
|
|
280
|
-
__param(6, Inject(
|
|
283
|
+
__param(3, Inject(TUI_ANIMATION_OPTIONS)),
|
|
284
|
+
__param(4, Inject(ElementRef)),
|
|
285
|
+
__param(5, Inject(WINDOW)),
|
|
286
|
+
__param(6, Inject(TUI_MEDIA)),
|
|
287
|
+
__param(7, Inject(forwardRef(() => TuiHintsHostComponent))),
|
|
288
|
+
__param(8, Inject(POLYMORPHEUS_CONTEXT))
|
|
281
289
|
], TuiHintBoxComponent);
|
|
282
290
|
|
|
283
291
|
let TuiHintBoxModule = class TuiHintBoxModule {
|
|
284
292
|
};
|
|
285
293
|
TuiHintBoxModule = __decorate([
|
|
286
294
|
NgModule({
|
|
287
|
-
imports: [CommonModule],
|
|
295
|
+
imports: [CommonModule, PolymorpheusModule],
|
|
288
296
|
declarations: [TuiHintBoxComponent],
|
|
289
297
|
exports: [TuiHintBoxComponent],
|
|
298
|
+
entryComponents: [TuiHintBoxComponent],
|
|
290
299
|
})
|
|
291
300
|
], TuiHintBoxModule);
|
|
292
301
|
|
|
@@ -303,7 +312,6 @@ TuiHintsHostModule = __decorate([
|
|
|
303
312
|
],
|
|
304
313
|
declarations: [TuiHintsHostComponent],
|
|
305
314
|
exports: [TuiHintsHostComponent],
|
|
306
|
-
entryComponents: [TuiHintsHostComponent],
|
|
307
315
|
})
|
|
308
316
|
], TuiHintsHostModule);
|
|
309
317
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-hints-host.js","sources":["ng://@taiga-ui/core/components/hints-host/hints-host.component.ts","ng://@taiga-ui/core/components/hints-host/hint-box/hint-box.component.ts","ng://@taiga-ui/core/components/hints-host/hint-box/hint-box.module.ts","ng://@taiga-ui/core/components/hints-host/hints-host.module.ts","ng://@taiga-ui/core/components/hints-host/taiga-ui-core-components-hints-host.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component, ElementRef, Inject} from '@angular/core';\nimport {AbstractTuiHint} from '@taiga-ui/core/abstract';\nimport {tuiFadeIn} from '@taiga-ui/core/animations';\nimport {TuiHintDirective} from '@taiga-ui/core/directives/hint';\nimport {TuiHintService} from '@taiga-ui/core/services';\nimport {TUI_ANIMATION_OPTIONS} from '@taiga-ui/core/tokens';\n\n@Component({\n selector: 'tui-hints-host',\n templateUrl: './hints-host.template.html',\n styleUrls: ['./hints-host.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiFadeIn],\n host: {\n 'aria-live': 'polite',\n },\n})\nexport class TuiHintsHostComponent {\n readonly animation = {\n value: '',\n ...this.options,\n } as const;\n\n constructor(\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiHintService) readonly hints$: TuiHintService,\n ) {}\n\n get clientRect(): ClientRect {\n return this.elementRef.nativeElement.getBoundingClientRect();\n }\n\n onHovered(hovered: boolean, directive: AbstractTuiHint) {\n if (directive instanceof TuiHintDirective) {\n directive.componentHovered$.next(hovered);\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n Input,\n NgZone,\n ViewChild,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {px, TuiDestroyService, tuiPure, tuiZonefree} from '@taiga-ui/cdk';\nimport {AbstractTuiHint} from '@taiga-ui/core/abstract';\nimport {TuiPointerHintDirective} from '@taiga-ui/core/directives/pointer-hint';\nimport {TuiMedia} from '@taiga-ui/core/interfaces';\nimport {TUI_MEDIA} from '@taiga-ui/core/tokens';\nimport {TuiDirection, TuiHintModeT} from '@taiga-ui/core/types';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {TuiHintsHostComponent} from '../hints-host.component';\n\nconst SPACE = 8;\nconst BORDER_WIDTH = 1;\nconst LEFT_PADDING = 16;\nconst TOP_PADDING = 12;\nconst ARROW_SIZE = 8;\nconst ARROW_OFFSET = 16;\nconst ARROWHEAD_OFFSET = ARROW_OFFSET + (ARROW_SIZE * Math.sqrt(2)) / 2;\nconst reverseDirectionsVertical: {[key in TuiDirection]: TuiDirection} = {\n 'top-left': 'bottom-left',\n 'top-right': 'bottom-right',\n 'bottom-left': 'top-left',\n 'bottom-right': 'top-right',\n left: 'right',\n right: 'left',\n 'top-middle': 'bottom-middle',\n 'bottom-middle': 'top-middle',\n};\nconst reverseDirectionsHorizontal: {[key in TuiDirection]: TuiDirection} = {\n 'top-left': 'top-right',\n 'top-right': 'top-left',\n 'bottom-left': 'bottom-right',\n 'bottom-right': 'bottom-left',\n left: 'right',\n right: 'left',\n 'top-middle': 'top-middle',\n 'bottom-middle': 'bottom-middle',\n};\n\n// TODO: consider abstracting UI and move to CDK, split hint and overflow\n// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395\n// @dynamic\n@Component({\n selector: 'tui-hint-box[hint]',\n templateUrl: './hint-box.template.html',\n styleUrls: ['./hint-box.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService],\n})\nexport class TuiHintBoxComponent {\n @ViewChild('arrow')\n private readonly arrow?: ElementRef<HTMLElement>;\n\n @Input()\n hint!: AbstractTuiHint;\n\n constructor(\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(WINDOW) private readonly windowRef: Window,\n @Inject(TUI_MEDIA) private readonly media: TuiMedia,\n @Inject(TuiHintsHostComponent)\n private readonly hintsHost: TuiHintsHostComponent,\n ) {\n animationFrame$\n .pipe(tuiZonefree(ngZone), takeUntil(destroy$))\n .subscribe(() => this.calculatePosition());\n }\n\n @tuiPure\n @HostBinding('class._untouchable')\n get isUntouchable(): boolean {\n return this.hint instanceof TuiPointerHintDirective;\n }\n\n @HostBinding('attr.data-mode')\n get mode(): TuiHintModeT | null {\n return this.hint.mode;\n }\n\n get isMobile(): boolean {\n return this.windowRef.innerWidth <= this.media.mobile;\n }\n\n /**\n * Calculates wrapper position.\n * Styles are set directly to avoid visual shake of element\n */\n private calculatePosition() {\n if (this.mode !== 'overflow') {\n this.calculateCoordinates();\n } else {\n this.setOverflowStyles();\n }\n }\n\n private calculateCoordinates() {\n if (this.isMobile) {\n this.calculateMobileCoordinates();\n\n return;\n }\n\n const hostRect = this.hint.getElementClientRect();\n const portalRect = this.hintsHost.clientRect;\n const tooltip = this.elementRef.nativeElement;\n const {style} = tooltip;\n const tooltipRect = tooltip.getBoundingClientRect();\n const isHostLong = hostRect.width > ARROWHEAD_OFFSET * 2;\n const directions: TuiDirection[] = [\n 'left',\n 'right',\n 'bottom-left',\n 'bottom-right',\n 'bottom-middle',\n 'top-left',\n 'top-right',\n 'top-middle',\n ];\n\n let top = 0;\n let left = 0;\n let {direction} = this.hint;\n\n const horizontalTop =\n hostRect.top + hostRect.height / 2 - tooltipRect.height / 2 - portalRect.top;\n const horizontalLeft =\n hostRect.left - tooltipRect.width - SPACE - portalRect.left;\n const horizontalRight = hostRect.left + hostRect.width + SPACE - portalRect.left;\n const verticalBottom = hostRect.bottom + SPACE - portalRect.top;\n const verticalTop = hostRect.top - tooltipRect.height - SPACE - portalRect.top;\n const verticalRight = isHostLong\n ? hostRect.left - portalRect.left\n : hostRect.left + hostRect.width / 2 - ARROWHEAD_OFFSET - portalRect.left;\n const verticalLeft = isHostLong\n ? hostRect.left - tooltipRect.width + hostRect.width - portalRect.left\n : hostRect.left -\n tooltipRect.width +\n hostRect.width / 2 +\n ARROWHEAD_OFFSET -\n portalRect.left;\n const verticalMiddle =\n hostRect.left - tooltipRect.width / 2 + hostRect.width / 2 - portalRect.left;\n\n directions.splice(directions.indexOf(direction), 1);\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (direction) {\n case 'left':\n top = horizontalTop;\n left = horizontalLeft;\n break;\n case 'right':\n top = horizontalTop;\n left = horizontalRight;\n break;\n case 'top-right':\n top = verticalTop;\n left = verticalRight;\n break;\n case 'top-left':\n top = verticalTop;\n left = verticalLeft;\n break;\n case 'bottom-right':\n top = verticalBottom;\n left = verticalRight;\n break;\n case 'bottom-left':\n top = verticalBottom;\n left = verticalLeft;\n break;\n case 'bottom-middle':\n top = verticalBottom;\n left = verticalMiddle;\n break;\n case 'top-middle':\n top = verticalTop;\n left = verticalMiddle;\n break;\n }\n\n const verticalFit =\n top + portalRect.top > SPACE &&\n top + tooltipRect.height + SPACE + portalRect.top <\n this.windowRef.innerHeight;\n const horizontalFit =\n left > SPACE &&\n left + tooltipRect.width + SPACE + portalRect.left < portalRect.width;\n\n if (directions.length === 0 || (verticalFit && horizontalFit)) {\n break;\n }\n\n direction = verticalFit\n ? reverseDirectionsHorizontal[direction]\n : reverseDirectionsVertical[direction];\n direction =\n directions.splice(directions.indexOf(direction), 1)[0] || direction;\n }\n\n style.top = px(top);\n style.left = px(left);\n\n tooltip.setAttribute('data-tui-host-direction', direction);\n }\n\n private calculateMobileCoordinates() {\n const hostRect = this.hint.getElementClientRect();\n const portalRect = this.hintsHost.clientRect;\n const tooltip = this.elementRef.nativeElement;\n const {style} = tooltip;\n const tooltipRect = tooltip.getBoundingClientRect();\n const verticalTop = hostRect.top - tooltipRect.height - SPACE - portalRect.top;\n const verticalBottom = hostRect.bottom + SPACE - portalRect.top;\n const verticalTopFit =\n verticalTop + portalRect.top > SPACE &&\n hostRect.top < this.windowRef.innerHeight;\n const verticalBottomFit =\n hostRect.bottom > 0 &&\n hostRect.bottom + 2 * SPACE + tooltipRect.height < this.windowRef.innerHeight;\n const direction =\n (this.hint.direction.includes('top') && verticalTopFit) || !verticalBottomFit\n ? 'top'\n : 'bottom';\n const attemptedLeft =\n portalRect.left + hostRect.left + hostRect.width / 2 - tooltipRect.width / 2;\n const left = Math.max(\n attemptedLeft + tooltipRect.width + SPACE > portalRect.right\n ? portalRect.right - SPACE - tooltipRect.width\n : attemptedLeft,\n SPACE * 2,\n );\n\n style.left = px(left);\n style.top = direction === 'top' ? px(verticalTop) : px(verticalBottom);\n\n if (this.arrow) {\n this.arrow.nativeElement.style.left = px(\n hostRect.left <= SPACE * 2 && hostRect.width > ARROW_OFFSET * 2\n ? ARROW_OFFSET\n : hostRect.left + hostRect.width / 2 - left - ARROW_SIZE / 2,\n );\n }\n\n tooltip.setAttribute('data-tui-host-direction', direction);\n }\n\n private setOverflowStyles() {\n const hostRect = this.hint.getElementClientRect();\n const {style} = this.elementRef.nativeElement;\n\n style.top = px(hostRect.top - window.innerHeight - TOP_PADDING - BORDER_WIDTH);\n style.left = px(hostRect.left - LEFT_PADDING - BORDER_WIDTH);\n style.width = px(hostRect.width + LEFT_PADDING * 2 + BORDER_WIDTH * 2);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\n\nimport {TuiHintBoxComponent} from './hint-box.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [TuiHintBoxComponent],\n exports: [TuiHintBoxComponent],\n})\nexport class TuiHintBoxModule {}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiHoveredModule} from '@taiga-ui/cdk';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHintBoxModule} from './hint-box/hint-box.module';\nimport {TuiHintsHostComponent} from './hints-host.component';\n\n@NgModule({\n imports: [\n CommonModule,\n PolymorpheusModule,\n TuiHoveredModule,\n TuiHintBoxModule,\n TuiActiveZoneModule,\n ],\n declarations: [TuiHintsHostComponent],\n exports: [TuiHintsHostComponent],\n entryComponents: [TuiHintsHostComponent],\n})\nexport class TuiHintsHostModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;IAkBa,qBAAqB,GAAlC,MAAa,qBAAqB;IAM9B,YACoD,OAAyB,EACpC,UAAmC,EACvC,MAAsB;QAFP,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QACN,OAAO,EAAE;YACL,YAAY;YACZ,kBAAkB;YAClB,gBAAgB;YAChB,gBAAgB;YAChB,mBAAmB;SACtB;QACD,YAAY,EAAE,CAAC,qBAAqB,CAAC;QACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;QAChC,eAAe,EAAE,CAAC,qBAAqB,CAAC;KAC3C,CAAC;GACW,kBAAkB,CAAG;;ACpBlC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-hints-host.js","sources":["ng://@taiga-ui/core/components/hints-host/hints-host.component.ts","ng://@taiga-ui/core/components/hints-host/hint-box/hint-box.component.ts","ng://@taiga-ui/core/components/hints-host/hint-box/hint-box.module.ts","ng://@taiga-ui/core/components/hints-host/hints-host.module.ts","ng://@taiga-ui/core/components/hints-host/taiga-ui-core-components-hints-host.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, ElementRef, Inject} from '@angular/core';\nimport {TUI_PARENT_ANIMATION} from '@taiga-ui/cdk';\nimport {AbstractTuiHint} from '@taiga-ui/core/abstract';\nimport {TuiHintDirective} from '@taiga-ui/core/directives/hint';\nimport {TuiHintService} from '@taiga-ui/core/services';\nimport {PolymorpheusComponent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHintBoxComponent} from './hint-box/hint-box.component';\n\n@Component({\n selector: 'tui-hints-host',\n templateUrl: './hints-host.template.html',\n styleUrls: ['./hints-host.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [TUI_PARENT_ANIMATION],\n host: {\n 'aria-live': 'polite',\n },\n})\nexport class TuiHintsHostComponent {\n readonly component = new PolymorpheusComponent(TuiHintBoxComponent);\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiHintService) readonly hints$: TuiHintService,\n ) {}\n\n get clientRect(): ClientRect {\n return this.elementRef.nativeElement.getBoundingClientRect();\n }\n\n onHovered(hovered: boolean, directive: AbstractTuiHint): void {\n if (directive instanceof TuiHintDirective) {\n directive.componentHovered$.next(hovered);\n }\n }\n}\n","import {AnimationOptions} from '@angular/animations';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n forwardRef,\n HostBinding,\n Inject,\n NgZone,\n ViewChild,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {\n px,\n TuiContextWithImplicit,\n TuiDestroyService,\n tuiPure,\n tuiZonefree,\n} from '@taiga-ui/cdk';\nimport {AbstractTuiHint} from '@taiga-ui/core/abstract';\nimport {tuiFadeIn} from '@taiga-ui/core/animations';\nimport {TuiPointerHintDirective} from '@taiga-ui/core/directives/pointer-hint';\nimport {TuiMedia} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATION_OPTIONS, TUI_MEDIA} from '@taiga-ui/core/tokens';\nimport {TuiDirection, TuiHintModeT} from '@taiga-ui/core/types';\nimport {POLYMORPHEUS_CONTEXT} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {TuiHintsHostComponent} from '../hints-host.component';\n\nconst SPACE = 8;\nconst BORDER_WIDTH = 1;\nconst LEFT_PADDING = 16;\nconst TOP_PADDING = 12;\nconst ARROW_SIZE = 8;\nconst ARROW_OFFSET = 16;\nconst ARROWHEAD_OFFSET = ARROW_OFFSET + (ARROW_SIZE * Math.sqrt(2)) / 2;\nconst reverseDirectionsVertical: {[key in TuiDirection]: TuiDirection} = {\n 'top-left': 'bottom-left',\n 'top-right': 'bottom-right',\n 'bottom-left': 'top-left',\n 'bottom-right': 'top-right',\n left: 'right',\n right: 'left',\n 'top-middle': 'bottom-middle',\n 'bottom-middle': 'top-middle',\n};\nconst reverseDirectionsHorizontal: {[key in TuiDirection]: TuiDirection} = {\n 'top-left': 'top-right',\n 'top-right': 'top-left',\n 'bottom-left': 'bottom-right',\n 'bottom-right': 'bottom-left',\n left: 'right',\n right: 'left',\n 'top-middle': 'top-middle',\n 'bottom-middle': 'bottom-middle',\n};\n\n// TODO: consider abstracting UI and move to CDK, split hint and overflow\n// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395\n// @dynamic\n@Component({\n selector: 'tui-hint-box[hint]',\n templateUrl: './hint-box.template.html',\n styleUrls: ['./hint-box.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService],\n animations: [tuiFadeIn],\n})\nexport class TuiHintBoxComponent {\n @ViewChild('arrow')\n private readonly arrow?: ElementRef<HTMLElement>;\n\n @HostBinding('@tuiFadeIn')\n readonly animation = {value: '', ...this.options} as const;\n\n constructor(\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(WINDOW) private readonly windowRef: Window,\n @Inject(TUI_MEDIA) private readonly media: TuiMedia,\n @Inject(forwardRef(() => TuiHintsHostComponent))\n private readonly hintsHost: TuiHintsHostComponent,\n @Inject(POLYMORPHEUS_CONTEXT)\n private readonly context: TuiContextWithImplicit<AbstractTuiHint>,\n ) {\n animationFrame$\n .pipe(tuiZonefree(ngZone), takeUntil(destroy$))\n .subscribe(() => this.calculatePosition());\n }\n\n get hint(): AbstractTuiHint {\n return this.context.$implicit;\n }\n\n @tuiPure\n @HostBinding('class._untouchable')\n get isUntouchable(): boolean {\n return this.hint instanceof TuiPointerHintDirective;\n }\n\n @HostBinding('attr.data-mode')\n get mode(): TuiHintModeT | null {\n return this.hint.mode;\n }\n\n get isMobile(): boolean {\n return this.windowRef.innerWidth <= this.media.mobile;\n }\n\n /**\n * Calculates wrapper position.\n * Styles are set directly to avoid visual shake of element\n */\n private calculatePosition(): void {\n if (this.mode !== 'overflow') {\n this.calculateCoordinates();\n } else {\n this.setOverflowStyles();\n }\n }\n\n private calculateCoordinates(): void {\n if (this.isMobile) {\n this.calculateMobileCoordinates();\n\n return;\n }\n\n const hostRect = this.hint.getElementClientRect();\n const portalRect = this.hintsHost.clientRect;\n const tooltip = this.elementRef.nativeElement;\n const {style} = tooltip;\n const tooltipRect = tooltip.getBoundingClientRect();\n const isHostLong = hostRect.width > ARROWHEAD_OFFSET * 2;\n const directions: TuiDirection[] = [\n 'left',\n 'right',\n 'bottom-left',\n 'bottom-right',\n 'bottom-middle',\n 'top-left',\n 'top-right',\n 'top-middle',\n ];\n\n let top = 0;\n let left = 0;\n let {direction} = this.hint;\n\n const horizontalTop =\n hostRect.top + hostRect.height / 2 - tooltipRect.height / 2 - portalRect.top;\n const horizontalLeft =\n hostRect.left - tooltipRect.width - SPACE - portalRect.left;\n const horizontalRight = hostRect.left + hostRect.width + SPACE - portalRect.left;\n const verticalBottom = hostRect.bottom + SPACE - portalRect.top;\n const verticalTop = hostRect.top - tooltipRect.height - SPACE - portalRect.top;\n const verticalRight = isHostLong\n ? hostRect.left - portalRect.left\n : hostRect.left + hostRect.width / 2 - ARROWHEAD_OFFSET - portalRect.left;\n const verticalLeft = isHostLong\n ? hostRect.left - tooltipRect.width + hostRect.width - portalRect.left\n : hostRect.left -\n tooltipRect.width +\n hostRect.width / 2 +\n ARROWHEAD_OFFSET -\n portalRect.left;\n const verticalMiddle =\n hostRect.left - tooltipRect.width / 2 + hostRect.width / 2 - portalRect.left;\n\n directions.splice(directions.indexOf(direction), 1);\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (direction) {\n case 'left':\n top = horizontalTop;\n left = horizontalLeft;\n break;\n case 'right':\n top = horizontalTop;\n left = horizontalRight;\n break;\n case 'top-right':\n top = verticalTop;\n left = verticalRight;\n break;\n case 'top-left':\n top = verticalTop;\n left = verticalLeft;\n break;\n case 'bottom-right':\n top = verticalBottom;\n left = verticalRight;\n break;\n case 'bottom-left':\n top = verticalBottom;\n left = verticalLeft;\n break;\n case 'bottom-middle':\n top = verticalBottom;\n left = verticalMiddle;\n break;\n case 'top-middle':\n top = verticalTop;\n left = verticalMiddle;\n break;\n }\n\n const verticalFit =\n top + portalRect.top > SPACE &&\n top + tooltipRect.height + SPACE + portalRect.top <\n this.windowRef.innerHeight;\n const horizontalFit =\n left > SPACE &&\n left + tooltipRect.width + SPACE + portalRect.left < portalRect.width;\n\n if (directions.length === 0 || (verticalFit && horizontalFit)) {\n break;\n }\n\n direction = verticalFit\n ? reverseDirectionsHorizontal[direction]\n : reverseDirectionsVertical[direction];\n direction =\n directions.splice(directions.indexOf(direction), 1)[0] || direction;\n }\n\n style.top = px(top);\n style.left = px(left);\n\n tooltip.setAttribute('data-tui-host-direction', direction);\n }\n\n private calculateMobileCoordinates(): void {\n const hostRect = this.hint.getElementClientRect();\n const portalRect = this.hintsHost.clientRect;\n const tooltip = this.elementRef.nativeElement;\n const {style} = tooltip;\n const tooltipRect = tooltip.getBoundingClientRect();\n const verticalTop = hostRect.top - tooltipRect.height - SPACE - portalRect.top;\n const verticalBottom = hostRect.bottom + SPACE - portalRect.top;\n const verticalTopFit =\n verticalTop + portalRect.top > SPACE &&\n hostRect.top < this.windowRef.innerHeight;\n const verticalBottomFit =\n hostRect.bottom > 0 &&\n hostRect.bottom + 2 * SPACE + tooltipRect.height < this.windowRef.innerHeight;\n const direction =\n (this.hint.direction.includes('top') && verticalTopFit) || !verticalBottomFit\n ? 'top'\n : 'bottom';\n const attemptedLeft =\n portalRect.left + hostRect.left + hostRect.width / 2 - tooltipRect.width / 2;\n const left = Math.max(\n attemptedLeft + tooltipRect.width + SPACE > portalRect.right\n ? portalRect.right - SPACE - tooltipRect.width\n : attemptedLeft,\n SPACE * 2,\n );\n\n style.left = px(left);\n style.top = direction === 'top' ? px(verticalTop) : px(verticalBottom);\n\n if (this.arrow) {\n this.arrow.nativeElement.style.left = px(\n hostRect.left <= SPACE * 2 && hostRect.width > ARROW_OFFSET * 2\n ? ARROW_OFFSET\n : hostRect.left + hostRect.width / 2 - left - ARROW_SIZE / 2,\n );\n }\n\n tooltip.setAttribute('data-tui-host-direction', direction);\n }\n\n private setOverflowStyles(): void {\n const hostRect = this.hint.getElementClientRect();\n const {style} = this.elementRef.nativeElement;\n\n style.top = px(hostRect.top - window.innerHeight - TOP_PADDING - BORDER_WIDTH);\n style.left = px(hostRect.left - LEFT_PADDING - BORDER_WIDTH);\n style.width = px(hostRect.width + LEFT_PADDING * 2 + BORDER_WIDTH * 2);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHintBoxComponent} from './hint-box.component';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule],\n declarations: [TuiHintBoxComponent],\n exports: [TuiHintBoxComponent],\n entryComponents: [TuiHintBoxComponent],\n})\nexport class TuiHintBoxModule {}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiHoveredModule} from '@taiga-ui/cdk';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHintBoxModule} from './hint-box/hint-box.module';\nimport {TuiHintsHostComponent} from './hints-host.component';\n\n@NgModule({\n imports: [\n CommonModule,\n PolymorpheusModule,\n TuiHoveredModule,\n TuiHintBoxModule,\n TuiActiveZoneModule,\n ],\n declarations: [TuiHintsHostComponent],\n exports: [TuiHintsHostComponent],\n})\nexport class TuiHintsHostModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;IAmBa,qBAAqB,GAAlC,MAAa,qBAAqB;IAG9B,YACyC,UAAmC,EACvC,MAAsB;QADlB,eAAU,GAAV,UAAU,CAAyB;QACvC,WAAM,GAAN,MAAM,CAAgB;QAJlD,cAAS,GAAG,IAAI,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;KAKhE;IAEJ,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC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EAAE,CAAC,mBAAmB,CAAC;QACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;QAC9B,eAAe,EAAE,CAAC,mBAAmB,CAAC;KACzC,CAAC;GACW,gBAAgB,CAAG;;ICOnB,kBAAkB,GAA/B,MAAa,kBAAkB;EAAG;AAArB,kBAAkB;IAX9B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,kBAAkB;YAClB,gBAAgB;YAChB,gBAAgB;YAChB,mBAAmB;SACtB;QACD,YAAY,EAAE,CAAC,qBAAqB,CAAC;QACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;KACnC,CAAC;GACW,kBAAkB,CAAG;;ACnBlC;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-hosted-dropdown.js","sources":["ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown-connector.directive.ts","ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown.component.ts","ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown.module.ts","ng://@taiga-ui/core/components/hosted-dropdown/taiga-ui-core-components-hosted-dropdown.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n@Directive({\n selector: '[tuiHostedDropdownHost]',\n})\nexport class TuiHostedDropdownConnectorDirective {}\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\nimport {\n getClosestFocusable,\n isElementEditable,\n isNativeFocusedIn,\n isNativeKeyboardFocusable,\n setNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiActiveZoneDirective,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {\n DROPDOWN_CONTROLLER_PROVIDER,\n TUI_DROPDOWN_WATCHED_CONTROLLER,\n TuiDropdownControllerDirective,\n} from '@taiga-ui/core/directives/dropdown-controller';\nimport {isEditingKey} from '@taiga-ui/core/utils/miscellaneous';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHostedDropdownConnectorDirective} from './hosted-dropdown-connector.directive';\n\n@Component({\n selector: 'tui-hosted-dropdown',\n templateUrl: './hosted-dropdown.template.html',\n styleUrls: ['./hosted-dropdown.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiHostedDropdownComponent),\n },\n DROPDOWN_CONTROLLER_PROVIDER,\n ],\n})\nexport class TuiHostedDropdownComponent implements TuiFocusableElementAccessor {\n @ContentChild(TuiHostedDropdownConnectorDirective, {read: ElementRef})\n private readonly dropdownHost?: ElementRef<HTMLElement>;\n\n @ViewChild('wrapper', {read: ElementRef})\n private readonly wrapper?: ElementRef<HTMLDivElement>;\n\n @ViewChild(TuiDropdownDirective)\n private readonly dropdownDirective?: TuiDropdownDirective;\n\n @Input()\n @tuiDefaultProp()\n content: PolymorpheusContent<TuiContextWithImplicit<TuiActiveZoneDirective>> = '';\n\n @Input()\n @tuiDefaultProp()\n canOpen = true;\n\n @Input()\n @tuiDefaultProp()\n open = false;\n\n @Output()\n readonly openChange = new EventEmitter<boolean>();\n\n @Output()\n readonly focusedChange = new EventEmitter<boolean>();\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef,\n @Inject(TUI_DROPDOWN_WATCHED_CONTROLLER)\n readonly controller: TuiDropdownControllerDirective,\n ) {}\n\n get host(): HTMLElement {\n return this.dropdownHost\n ? this.dropdownHost.nativeElement\n : this.elementRef.nativeElement;\n }\n\n get dropdown(): HTMLElement | null {\n return !this.dropdownDirective || this.dropdownDirective.dropdownBoxRef === null\n ? null\n : this.dropdownDirective.dropdownBoxRef.location.nativeElement;\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return isNativeKeyboardFocusable(this.host)\n ? this.host\n : getClosestFocusable(this.host, false, this.elementRef.nativeElement);\n }\n\n @HostBinding('class._hosted_dropdown_focused')\n get focused(): boolean {\n return (\n isNativeFocusedIn(this.host) ||\n (this.open && !!this.wrapper && isNativeFocusedIn(this.wrapper.nativeElement))\n );\n }\n\n @HostListener('focusin', ['$event.target'])\n onFocusIn(target: HTMLElement) {\n const host = this.dropdownHost\n ? this.dropdownHost.nativeElement\n : this.nativeFocusableElement || this.elementRef.nativeElement;\n\n if (!host.contains(target)) {\n this.updateOpen(false);\n }\n }\n\n @HostListener('click', ['$event.target'])\n onClick(target: HTMLElement) {\n const host = this.nativeFocusableElement || this.host;\n const dropdownHost = this.dropdownHost ? this.dropdownHost.nativeElement : host;\n\n if (!this.hostEditable && dropdownHost.contains(target)) {\n this.updateOpen(!this.open);\n }\n }\n\n @HostListener('keydown.esc', ['$event'])\n onKeyDownEsc(event: Event) {\n if (!this.canOpen || !this.open) {\n return;\n }\n\n event.stopPropagation();\n this.closeDropdown();\n }\n\n @HostListener('keydown.arrowDown', ['$event', 'true'])\n @HostListener('keydown.arrowUp', ['$event', 'false'])\n onArrow(event: KeyboardEvent, down: boolean) {\n this.focusDropdown(event, down);\n }\n\n onKeydown({key, target, defaultPrevented}: KeyboardEvent) {\n if (\n !defaultPrevented &&\n isEditingKey(key) &&\n this.hostEditable &&\n // TODO: iframe warning\n target instanceof HTMLElement &&\n !isElementEditable(target)\n ) {\n this.focusHost();\n }\n }\n\n onActiveZone(active: boolean) {\n this.updateFocused(active);\n\n if (!active) {\n this.updateOpen(false);\n }\n }\n\n onHostObscured(obscured: boolean) {\n if (obscured) {\n this.closeDropdown();\n }\n }\n\n updateOpen(open: boolean) {\n if (open && !this.canOpen) {\n return;\n }\n\n this.open = open;\n this.openChange.emit(open);\n }\n\n private get hostEditable(): boolean {\n const host = this.nativeFocusableElement || this.host;\n\n // TODO: iframe warning\n return host instanceof HTMLElement && isElementEditable(host);\n }\n\n private focusDropdown(event: KeyboardEvent, first: boolean) {\n const host = this.nativeFocusableElement;\n\n // TODO: iframe warning\n if (\n !host ||\n !(host instanceof HTMLElement) ||\n !(event.target instanceof Node) ||\n !host.contains(event.target)\n ) {\n return;\n }\n\n if (\n !this.wrapper ||\n !this.open ||\n this.dropdown === null ||\n // TODO: iframe warning\n !(this.wrapper.nativeElement.nextElementSibling instanceof HTMLElement)\n ) {\n this.updateOpen(true);\n\n if (!isElementEditable(host)) {\n event.preventDefault();\n }\n\n return;\n }\n\n const initial = first\n ? this.wrapper.nativeElement\n : this.wrapper.nativeElement.nextElementSibling;\n const focusable = getClosestFocusable(\n initial,\n !first,\n this.wrapper.nativeElement,\n );\n\n if (focusable === null) {\n return;\n }\n\n setNativeFocused(focusable);\n event.preventDefault();\n }\n\n private closeDropdown() {\n if (this.focused) {\n this.focusHost();\n }\n\n this.updateOpen(false);\n }\n\n private focusHost() {\n const host = this.nativeFocusableElement;\n\n if (host !== null) {\n setNativeFocused(host, true, true);\n }\n }\n\n private updateFocused(focused: boolean) {\n this.focusedChange.emit(focused);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiObscuredModule} from '@taiga-ui/cdk';\nimport {TuiDropdownModule} from '@taiga-ui/core/directives/dropdown';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHostedDropdownComponent} from './hosted-dropdown.component';\nimport {TuiHostedDropdownConnectorDirective} from './hosted-dropdown-connector.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiObscuredModule,\n PolymorpheusModule,\n TuiActiveZoneModule,\n TuiDropdownModule,\n ],\n declarations: [TuiHostedDropdownComponent, TuiHostedDropdownConnectorDirective],\n exports: [TuiHostedDropdownComponent, TuiHostedDropdownConnectorDirective],\n})\nexport class TuiHostedDropdownModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';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/hosted-dropdown-connector.directive.ts","ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown.component.ts","ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown.module.ts","ng://@taiga-ui/core/components/hosted-dropdown/taiga-ui-core-components-hosted-dropdown.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n@Directive({\n selector: '[tuiHostedDropdownHost]',\n})\nexport class TuiHostedDropdownConnectorDirective {}\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\nimport {\n getClosestFocusable,\n isElementEditable,\n isNativeFocusedIn,\n isNativeKeyboardFocusable,\n setNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiActiveZoneDirective,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {\n DROPDOWN_CONTROLLER_PROVIDER,\n TUI_DROPDOWN_WATCHED_CONTROLLER,\n TuiDropdownControllerDirective,\n} from '@taiga-ui/core/directives/dropdown-controller';\nimport {isEditingKey} from '@taiga-ui/core/utils/miscellaneous';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHostedDropdownConnectorDirective} from './hosted-dropdown-connector.directive';\n\n@Component({\n selector: 'tui-hosted-dropdown',\n templateUrl: './hosted-dropdown.template.html',\n styleUrls: ['./hosted-dropdown.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiHostedDropdownComponent),\n },\n DROPDOWN_CONTROLLER_PROVIDER,\n ],\n})\nexport class TuiHostedDropdownComponent implements TuiFocusableElementAccessor {\n @ContentChild(TuiHostedDropdownConnectorDirective, {read: ElementRef})\n private readonly dropdownHost?: ElementRef<HTMLElement>;\n\n @ViewChild('wrapper', {read: ElementRef})\n private readonly wrapper?: ElementRef<HTMLDivElement>;\n\n @ViewChild(TuiDropdownDirective)\n private readonly dropdownDirective?: TuiDropdownDirective;\n\n @Input()\n @tuiDefaultProp()\n content: PolymorpheusContent<TuiContextWithImplicit<TuiActiveZoneDirective>> = '';\n\n @Input()\n @tuiDefaultProp()\n canOpen = true;\n\n @Input()\n @tuiDefaultProp()\n open = false;\n\n @Output()\n readonly openChange = new EventEmitter<boolean>();\n\n @Output()\n readonly focusedChange = new EventEmitter<boolean>();\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef,\n @Inject(TUI_DROPDOWN_WATCHED_CONTROLLER)\n readonly controller: TuiDropdownControllerDirective,\n ) {}\n\n get host(): HTMLElement {\n return this.dropdownHost\n ? this.dropdownHost.nativeElement\n : this.elementRef.nativeElement;\n }\n\n get dropdown(): HTMLElement | null {\n return !this.dropdownDirective || this.dropdownDirective.dropdownBoxRef === null\n ? null\n : this.dropdownDirective.dropdownBoxRef.location.nativeElement;\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return isNativeKeyboardFocusable(this.host)\n ? this.host\n : getClosestFocusable(this.host, false, this.elementRef.nativeElement);\n }\n\n @HostBinding('class._hosted_dropdown_focused')\n get focused(): boolean {\n return (\n isNativeFocusedIn(this.host) ||\n (this.open && !!this.wrapper && isNativeFocusedIn(this.wrapper.nativeElement))\n );\n }\n\n @HostListener('focusin', ['$event.target'])\n onFocusIn(target: HTMLElement): void {\n const host = this.dropdownHost\n ? this.dropdownHost.nativeElement\n : this.nativeFocusableElement || this.elementRef.nativeElement;\n\n if (!host.contains(target)) {\n this.updateOpen(false);\n }\n }\n\n @HostListener('click', ['$event.target'])\n onClick(target: HTMLElement): void {\n const host = this.nativeFocusableElement || this.host;\n const dropdownHost = this.dropdownHost ? this.dropdownHost.nativeElement : host;\n\n if (!this.hostEditable && dropdownHost.contains(target)) {\n this.updateOpen(!this.open);\n }\n }\n\n @HostListener('keydown.esc', ['$event'])\n onKeyDownEsc(event: Event): void {\n if (!this.canOpen || !this.open) {\n return;\n }\n\n event.stopPropagation();\n this.closeDropdown();\n }\n\n @HostListener('keydown.arrowDown', ['$event', 'true'])\n @HostListener('keydown.arrowUp', ['$event', 'false'])\n onArrow(event: KeyboardEvent, down: boolean): void {\n this.focusDropdown(event, down);\n }\n\n onKeydown({key, target, defaultPrevented}: KeyboardEvent): void {\n if (\n !defaultPrevented &&\n isEditingKey(key) &&\n this.hostEditable &&\n // TODO: iframe warning\n target instanceof HTMLElement &&\n !isElementEditable(target)\n ) {\n this.focusHost();\n }\n }\n\n onActiveZone(active: boolean): void {\n this.updateFocused(active);\n\n if (!active) {\n this.updateOpen(false);\n }\n }\n\n onHostObscured(obscured: boolean): void {\n if (obscured) {\n this.closeDropdown();\n }\n }\n\n updateOpen(open: boolean): void {\n if (open && !this.canOpen) {\n return;\n }\n\n this.open = open;\n this.openChange.emit(open);\n }\n\n private get hostEditable(): boolean {\n const host = this.nativeFocusableElement || this.host;\n\n // TODO: iframe warning\n return host instanceof HTMLElement && isElementEditable(host);\n }\n\n private focusDropdown(event: KeyboardEvent, first: boolean): void {\n const host = this.nativeFocusableElement;\n\n // TODO: iframe warning\n if (\n !host ||\n !(host instanceof HTMLElement) ||\n !(event.target instanceof Node) ||\n !host.contains(event.target)\n ) {\n return;\n }\n\n if (\n !this.wrapper ||\n !this.open ||\n this.dropdown === null ||\n // TODO: iframe warning\n !(this.wrapper.nativeElement.nextElementSibling instanceof HTMLElement)\n ) {\n this.updateOpen(true);\n\n if (!isElementEditable(host)) {\n event.preventDefault();\n }\n\n return;\n }\n\n const initial = first\n ? this.wrapper.nativeElement\n : this.wrapper.nativeElement.nextElementSibling;\n const focusable = getClosestFocusable(\n initial,\n !first,\n this.wrapper.nativeElement,\n );\n\n if (focusable === null) {\n return;\n }\n\n setNativeFocused(focusable);\n event.preventDefault();\n }\n\n private closeDropdown(): void {\n if (this.focused) {\n this.focusHost();\n }\n\n this.updateOpen(false);\n }\n\n private focusHost(): void {\n const host = this.nativeFocusableElement;\n\n if (host !== null) {\n setNativeFocused(host, true, true);\n }\n }\n\n private updateFocused(focused: boolean): void {\n this.focusedChange.emit(focused);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiObscuredModule} from '@taiga-ui/cdk';\nimport {TuiDropdownModule} from '@taiga-ui/core/directives/dropdown';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHostedDropdownComponent} from './hosted-dropdown.component';\nimport {TuiHostedDropdownConnectorDirective} from './hosted-dropdown-connector.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiObscuredModule,\n PolymorpheusModule,\n TuiActiveZoneModule,\n TuiDropdownModule,\n ],\n declarations: [TuiHostedDropdownComponent, TuiHostedDropdownConnectorDirective],\n exports: [TuiHostedDropdownComponent, TuiHostedDropdownConnectorDirective],\n})\nexport class TuiHostedDropdownModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAKa,mCAAmC,GAAhD,MAAa,mCAAmC;EAAG;AAAtC,mCAAmC;IAH/C,SAAS,CAAC;QACP,QAAQ,EAAE,yBAAyB;KACtC,CAAC;GACW,mCAAmC,CAAG;;;IC8CtC,0BAA0B,kCAAvC,MAAa,0BAA0B;IA4BnC,YACyC,UAAsB,EAElD,UAA0C;QAFd,eAAU,GAAV,UAAU,CAAY;QAElD,eAAU,GAAV,UAAU,CAAgC;QAnBvD,YAAO,GAAwE,EAAE,CAAC;QAIlF,YAAO,GAAG,IAAI,CAAC;QAIf,SAAI,GAAG,KAAK,CAAC;QAGJ,eAAU,GAAG,IAAI,YAAY,EAAW,CAAC;QAGzC,kBAAa,GAAG,IAAI,YAAY,EAAW,CAAC;KAMjD;IAEJ,IAAI,IAAI;QACJ,OAAO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8C;QAE9C,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,2BAA2B;gBACpC,WAAW,EAAE,UAAU,CAAC,MAAM,4BAA0B,CAAC;aAC5D;YACD,4BAA4B;SAC/B;;KACJ,CAAC;IA8BO,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,MAAM,CAAC,+BAA+B,CAAC,CAAA;GA9BnC,0BAA0B,CA6MtC;;IC5OY,uBAAuB,GAApC,MAAa,uBAAuB;EAAG;AAA1B,uBAAuB;IAXnC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,iBAAiB;YACjB,kBAAkB;YAClB,mBAAmB;YACnB,iBAAiB;SACpB;QACD,YAAY,EAAE,CAAC,0BAA0B,EAAE,mCAAmC,CAAC;QAC/E,OAAO,EAAE,CAAC,0BAA0B,EAAE,mCAAmC,CAAC;KAC7E,CAAC;GACW,uBAAuB,CAAG;;ACpBvC;;;;;;"}
|
|
@@ -10,7 +10,7 @@ import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
|
10
10
|
let TuiLabelComponent = class TuiLabelComponent {
|
|
11
11
|
constructor(mode$) {
|
|
12
12
|
this.mode$ = mode$;
|
|
13
|
-
// TODO: Rename to tuiLabel
|
|
13
|
+
// TODO: 3.0 Rename to tuiLabel
|
|
14
14
|
this.label = '';
|
|
15
15
|
this.context = {
|
|
16
16
|
$implicit: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-label.js","sources":["ng://@taiga-ui/core/components/label/label.component.ts","ng://@taiga-ui/core/components/label/label.module.ts","ng://@taiga-ui/core/components/label/taiga-ui-core-components-label.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiContextWithImplicit, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\nimport {TUI_MODE} from '@taiga-ui/core/tokens';\nimport {TuiBrightness} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\n@Component({\n selector: 'label[tuiLabel]',\n templateUrl: './label.template.html',\n styleUrls: ['./label.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [MODE_PROVIDER],\n host: {\n '($.data-mode.attr)': 'mode$',\n },\n})\nexport class TuiLabelComponent<T> {\n // TODO: Rename to tuiLabel
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-label.js","sources":["ng://@taiga-ui/core/components/label/label.component.ts","ng://@taiga-ui/core/components/label/label.module.ts","ng://@taiga-ui/core/components/label/taiga-ui-core-components-label.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiContextWithImplicit, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\nimport {TUI_MODE} from '@taiga-ui/core/tokens';\nimport {TuiBrightness} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\n@Component({\n selector: 'label[tuiLabel]',\n templateUrl: './label.template.html',\n styleUrls: ['./label.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [MODE_PROVIDER],\n host: {\n '($.data-mode.attr)': 'mode$',\n },\n})\nexport class TuiLabelComponent<T> {\n // TODO: 3.0 Rename to tuiLabel\n @Input()\n @tuiDefaultProp()\n label: PolymorpheusContent = '';\n\n @Input()\n @tuiDefaultProp()\n context: TuiContextWithImplicit<T | null> = {\n $implicit: null,\n };\n\n @ContentChild(NgControl)\n @HostBinding('class._control')\n readonly control?: NgControl;\n\n constructor(@Inject(TUI_MODE) readonly mode$: Observable<TuiBrightness | null>) {}\n}\n","import {NgModule} from '@angular/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiLabelComponent} from './label.component';\n\n@NgModule({\n imports: [PolymorpheusModule],\n declarations: [TuiLabelComponent],\n exports: [TuiLabelComponent],\n})\nexport class TuiLabelModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IA0Ba,iBAAiB,GAA9B,MAAa,iBAAiB;IAgB1B,YAAuC,KAAuC;QAAvC,UAAK,GAAL,KAAK,CAAkC;;QAZ9E,UAAK,GAAwB,EAAE,CAAC;QAIhC,YAAO,GAAqC;YACxC,SAAS,EAAE,IAAI;SAClB,CAAC;KAMgF;EACrF;;YADiD,UAAU,uBAA3C,MAAM,SAAC,QAAQ;;AAZ5B;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;gDACe;AAIhC;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;kDAGf;AAIF;IAFC,YAAY,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,gBAAgB,CAAC;kDACD;AAdpB,iBAAiB;IAV7B,SAAS,CAAC;QACP,QAAQ,EAAE,iBAAiB;QAC3B,2RAAoC;QAEpC,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,SAAS,EAAE,CAAC,aAAa,CAAC;QAC1B,IAAI,EAAE;YACF,oBAAoB,EAAE,OAAO;SAChC;;KACJ,CAAC;IAiBe,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;GAhBpB,iBAAiB,CAiB7B;;ICjCY,cAAc,GAA3B,MAAa,cAAc;EAAG;AAAjB,cAAc;IAL1B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,kBAAkB,CAAC;QAC7B,YAAY,EAAE,CAAC,iBAAiB,CAAC;QACjC,OAAO,EAAE,CAAC,iBAAiB,CAAC;KAC/B,CAAC;GACW,cAAc,CAAG;;ACV9B;;;;;;"}
|
|
@@ -15,7 +15,7 @@ let TuiLinkComponent = TuiLinkComponent_1 = class TuiLinkComponent {
|
|
|
15
15
|
this.elementRef = elementRef;
|
|
16
16
|
this.mode$ = mode$;
|
|
17
17
|
this.pseudo = false;
|
|
18
|
-
// TODO: Remove `null`
|
|
18
|
+
// TODO: 3.0 Remove `null`
|
|
19
19
|
this.icon = null;
|
|
20
20
|
this.iconAlign = 'right';
|
|
21
21
|
this.iconRotated = false;
|
|
@@ -91,7 +91,7 @@ TuiLinkComponent = TuiLinkComponent_1 = __decorate([
|
|
|
91
91
|
host: {
|
|
92
92
|
'($.data-mode.attr)': 'mode$',
|
|
93
93
|
},
|
|
94
|
-
styles: [":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;line-height:inherit;transition-property:color;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;color:var(--tui-link);text-decoration:none;text-align:left;text-transform:inherit;font-weight:inherit;cursor:pointer;outline:0}:host:hover{color:var(--tui-link-hover)}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:default}:host[data-mode=onLight]{color:var(--tui-text-02)}:host[data-mode=onLight]._active,:host[data-mode=onLight]:hover{color:var(--tui-text-01)}:host[data-mode=onLight]._pseudo{color:var(--tui-text-01)}:host[data-mode=onLight]._pseudo._active,:host[data-mode=onLight]._pseudo:hover{color:var(--tui-text-03)}:host[data-mode=onLight][data-host-mode=negative]{color:var(--tui-negative-night)}:host[data-mode=onLight][data-host-mode=negative]._active,:host[data-mode=onLight][data-host-mode=negative]:active,:host[data-mode=onLight][data-host-mode=negative]:hover{color:var(--tui-negative-night-hover)}:host[data-mode=onDark]{color:var(--tui-text-03-night)}:host[data-mode=onDark]._active,:host[data-mode=onDark]:active,:host[data-mode=onDark]:hover{color:var(--tui-text-01-night)}:host[data-mode=onDark]._pseudo{color:var(--tui-text-01-night)}:host[data-mode=onDark]._pseudo._active,:host[data-mode=onDark]._pseudo:active,:host[data-mode=onDark]._pseudo:hover{color:var(--tui-text-03-night)}:host[data-mode=onDark][data-host-mode=positive]{color:var(--tui-positive-night)}:host[data-mode=onDark][data-host-mode=positive]._active,:host[data-mode=onDark][data-host-mode=positive]:active,:host[data-mode=onDark][data-host-mode=positive]:hover{color:var(--tui-positive-night-hover)}:host[data-host-mode=negative]{color:var(--tui-negative)}:host[data-host-mode=negative]:hover{color:var(--tui-negative-hover)}:host[data-host-mode=positive]{color:var(--tui-positive)}:host[data-host-mode=positive]:hover{color:var(--tui-positive-hover)}.t-content{display:inline-block}:host._focus-visible .t-content{background:var(--tui-selection)}:host[data-mode=onLight]._focus-visible .t-content{background:var(--tui-clear);color:var(--tui-text-01)}:host[data-mode=onDark]._focus-visible .t-content{background:var(--tui-clear-inverse);color:var(--tui-text-01-night)}:host[data-host-mode=positive]._focus-visible .t-content{background:var(--tui-success-bg)}:host[data-host-mode=negative]._focus-visible .t-content{background:var(--tui-error-bg)}:host._pseudo .t-content{padding-bottom:.15em;-webkit-text-decoration:underline dashed;text-decoration:underline dashed;text-underline-offset:.2em;text-decoration-thickness:.7px}.t-icon{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;margin-top:-.125rem;opacity:.8}.t-icon_left{margin-right:.25rem}.t-icon_right{margin-left:.25rem}:host:hover .t-icon{opacity:1}:host._icon-rotated .t-icon{transform:rotate(180deg)}"]
|
|
94
|
+
styles: [":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;line-height:inherit;transition-property:color;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;color:var(--tui-link);text-decoration:none;text-align:left;text-transform:inherit;font-weight:inherit;cursor:pointer;outline:0}:host:hover{color:var(--tui-link-hover)}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:default}:host[data-mode=onLight]{color:var(--tui-text-02)}:host[data-mode=onLight]._active,:host[data-mode=onLight]:hover{color:var(--tui-text-01)}:host[data-mode=onLight]._pseudo{color:var(--tui-text-01)}:host[data-mode=onLight]._pseudo .t-content{-webkit-text-decoration-color:rgba(0,0,0,.48);text-decoration-color:rgba(0,0,0,.48)}:host[data-mode=onLight]._pseudo._active,:host[data-mode=onLight]._pseudo:hover{color:var(--tui-text-03)}:host[data-mode=onLight][data-host-mode=negative]{color:var(--tui-negative-night)}:host[data-mode=onLight][data-host-mode=negative]._active,:host[data-mode=onLight][data-host-mode=negative]:active,:host[data-mode=onLight][data-host-mode=negative]:hover{color:var(--tui-negative-night-hover)}:host[data-mode=onDark]{color:var(--tui-text-03-night)}:host[data-mode=onDark]._active,:host[data-mode=onDark]:active,:host[data-mode=onDark]:hover{color:var(--tui-text-01-night)}:host[data-mode=onDark]._pseudo{color:var(--tui-text-01-night)}:host[data-mode=onDark]._pseudo .t-content{-webkit-text-decoration-color:rgba(255,255,255,.48);text-decoration-color:rgba(255,255,255,.48)}:host[data-mode=onDark]._pseudo._active,:host[data-mode=onDark]._pseudo:active,:host[data-mode=onDark]._pseudo:hover{color:var(--tui-text-03-night)}:host[data-mode=onDark][data-host-mode=positive]{color:var(--tui-positive-night)}:host[data-mode=onDark][data-host-mode=positive]._active,:host[data-mode=onDark][data-host-mode=positive]:active,:host[data-mode=onDark][data-host-mode=positive]:hover{color:var(--tui-positive-night-hover)}:host[data-host-mode=negative]{color:var(--tui-negative)}:host[data-host-mode=negative]:hover{color:var(--tui-negative-hover)}:host[data-host-mode=negative]._pseudo .t-content{-webkit-text-decoration-color:rgba(222,76,30,.48);text-decoration-color:rgba(222,76,30,.48)}:host[data-host-mode=positive]{color:var(--tui-positive)}:host[data-host-mode=positive]:hover{color:var(--tui-positive-hover)}:host[data-host-mode=positive]._pseudo .t-content{-webkit-text-decoration-color:rgba(58,169,129,.48);text-decoration-color:rgba(58,169,129,.48)}.t-content{display:inline-block}:host._focus-visible .t-content{background:var(--tui-selection)}:host[data-mode=onLight]._focus-visible .t-content{background:var(--tui-clear);color:var(--tui-text-01)}:host[data-mode=onDark]._focus-visible .t-content{background:var(--tui-clear-inverse);color:var(--tui-text-01-night)}:host[data-host-mode=positive]._focus-visible .t-content{background:var(--tui-success-bg)}:host[data-host-mode=negative]._focus-visible .t-content{background:var(--tui-error-bg)}:host._pseudo .t-content{padding-bottom:.15em;-webkit-text-decoration:underline dashed rgba(51,111,238,.48);text-decoration:underline dashed rgba(51,111,238,.48);text-underline-offset:.2em;text-decoration-thickness:.7px}.t-icon{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;margin-top:-.125rem;opacity:.8}.t-icon_left{margin-right:.25rem}.t-icon_right{margin-left:.25rem}:host:hover .t-icon{opacity:1}:host._icon-rotated .t-icon{transform:rotate(180deg)}"]
|
|
95
95
|
}),
|
|
96
96
|
__param(0, Inject(ElementRef)),
|
|
97
97
|
__param(1, Inject(TUI_MODE)),
|