@taiga-ui/core 2.51.0 → 2.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/taiga-ui-core-components-data-list.umd.js +1 -0
- package/bundles/taiga-ui-core-components-data-list.umd.js.map +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 -0
- package/bundles/taiga-ui-core-components-dialog.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.js +1 -1
- 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 +14 -20
- package/bundles/taiga-ui-core-components-hints-host.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-hints-host.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-hints-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js +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 +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-link.umd.js +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-primitive-textfield.umd.js +3 -3
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-scrollbar.umd.js +1 -0
- package/bundles/taiga-ui-core-components-scrollbar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-scrollbar.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-described-by.umd.js +1 -0
- package/bundles/taiga-ui-core-directives-described-by.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-described-by.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-directives-mask-accessor.umd.js +1 -0
- package/bundles/taiga-ui-core-directives-mask-accessor.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-mask-accessor.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-directives-textfield-controller.umd.js +15 -0
- 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-observables.umd.js +9 -3
- package/bundles/taiga-ui-core-observables.umd.js.map +1 -1
- package/bundles/taiga-ui-core-observables.umd.min.js +1 -1
- package/bundles/taiga-ui-core-observables.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-providers.umd.js +18 -0
- 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-utils-dom.umd.js +26 -0
- 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 +33 -0
- 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 +12 -0
- 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 +30 -1
- package/bundles/taiga-ui-core-utils-miscellaneous.umd.js.map +1 -1
- package/bundles/taiga-ui-core-utils-miscellaneous.umd.min.js +1 -1
- package/bundles/taiga-ui-core-utils-miscellaneous.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-utils-mobile.umd.js +1 -1
- package/bundles/taiga-ui-core-utils-mobile.umd.js.map +1 -1
- package/bundles/taiga-ui-core-utils-mobile.umd.min.js +1 -1
- package/bundles/taiga-ui-core-utils-mobile.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-utils-polyfills.umd.js +1 -0
- 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/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 +1 -0
- package/components/hints-host/hints-host.component.d.ts +4 -5
- package/components/hints-host/taiga-ui-core-components-hints-host.metadata.json +1 -1
- package/components/hosted-dropdown/taiga-ui-core-components-hosted-dropdown.metadata.json +1 -1
- package/components/link/taiga-ui-core-components-link.metadata.json +1 -1
- package/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.metadata.json +1 -1
- package/components/scrollbar/taiga-ui-core-components-scrollbar.metadata.json +1 -1
- package/constants/taiga-ui-core-constants.metadata.json +1 -1
- package/constants/version.d.ts +1 -1
- package/directives/described-by/taiga-ui-core-directives-described-by.metadata.json +1 -1
- package/directives/mask-accessor/taiga-ui-core-directives-mask-accessor.metadata.json +1 -1
- package/directives/textfield-controller/taiga-ui-core-directives-textfield-controller.metadata.json +1 -1
- package/directives/textfield-controller/textfield-controller.provider.d.ts +4 -0
- package/esm2015/components/data-list/option/option.component.js +2 -1
- package/esm2015/components/dialog/dialog.providers.js +2 -1
- package/esm2015/components/expand/expand.component.js +2 -2
- package/esm2015/components/hints-host/hint-box/hint-box.component.js +8 -2
- package/esm2015/components/hints-host/hint-box/hint-box.module.js +3 -2
- package/esm2015/components/hints-host/hints-host.component.js +4 -9
- package/esm2015/components/hints-host/hints-host.module.js +3 -9
- package/esm2015/components/hosted-dropdown/hosted-dropdown.component.js +2 -2
- package/esm2015/components/link/link.component.js +1 -1
- package/esm2015/components/primitive-textfield/primitive-textfield.component.js +2 -2
- package/esm2015/components/primitive-textfield/value-decoration/value-decoration.component.js +3 -3
- package/esm2015/components/scrollbar/scrollbar.component.js +2 -1
- package/esm2015/constants/version.js +2 -2
- package/esm2015/directives/described-by/described-by.providers.js +2 -1
- package/esm2015/directives/mask-accessor/mask-accessor.directive.js +2 -1
- package/esm2015/directives/textfield-controller/textfield-autocomplete.directive.js +2 -1
- package/esm2015/directives/textfield-controller/textfield-cleaner.directive.js +2 -1
- package/esm2015/directives/textfield-controller/textfield-controller.provider.js +6 -1
- package/esm2015/directives/textfield-controller/textfield-custom-content.directive.js +2 -1
- package/esm2015/directives/textfield-controller/textfield-example-text.directive.js +2 -1
- package/esm2015/directives/textfield-controller/textfield-input-mode.directive.js +2 -1
- package/esm2015/directives/textfield-controller/textfield-label-outside.directive.js +2 -1
- package/esm2015/directives/textfield-controller/textfield-max-length.directive.js +2 -1
- package/esm2015/directives/textfield-controller/textfield-size.directive.js +2 -1
- package/esm2015/directives/textfield-controller/textfield-type.directive.js +2 -1
- package/esm2015/interfaces/hint.js +1 -0
- package/esm2015/interfaces/index.js +1 -1
- package/esm2015/observables/smart-search.js +8 -3
- package/esm2015/providers/is-mobile-resolution.provider.js +6 -1
- package/esm2015/providers/mode.provider.js +6 -1
- package/esm2015/providers/watched-controller-provider-factory.js +6 -1
- package/esm2015/utils/dom/are-css-vars-supported.js +4 -1
- package/esm2015/utils/dom/check-fixed-position.js +6 -1
- package/esm2015/utils/dom/get-safe-area-size.js +4 -1
- package/esm2015/utils/dom/get-screen-width.js +6 -1
- package/esm2015/utils/dom/process-icon.js +6 -1
- package/esm2015/utils/format/capitalize-first-letter.js +6 -1
- package/esm2015/utils/format/capitalize.js +4 -1
- package/esm2015/utils/format/format-number.js +4 -1
- package/esm2015/utils/format/format-phone.js +4 -1
- package/esm2015/utils/format/get-fractional-part-padded.js +4 -1
- package/esm2015/utils/format/number-to-string-without-exp.js +4 -1
- package/esm2015/utils/format/other-decimal-symbol.js +6 -1
- package/esm2015/utils/format/pluralize.js +2 -1
- package/esm2015/utils/mask/masked-money-value-is-empty.js +6 -1
- package/esm2015/utils/mask/masked-number-string-to-number.js +6 -1
- package/esm2015/utils/miscellaneous/color-fallback.js +5 -2
- package/esm2015/utils/miscellaneous/get-border.js +6 -1
- package/esm2015/utils/miscellaneous/icons-path-factory.js +6 -1
- package/esm2015/utils/miscellaneous/is-editing-key.js +4 -1
- package/esm2015/utils/miscellaneous/is-presumed-html-string.js +6 -1
- package/esm2015/utils/miscellaneous/size-bigger.js +4 -1
- package/esm2015/utils/mobile/is-mobile.js +2 -2
- package/esm2015/utils/polyfills/inner-html.js +2 -1
- package/esm5/components/data-list/option/option.component.js +2 -1
- package/esm5/components/dialog/dialog.providers.js +2 -1
- package/esm5/components/expand/expand.component.js +2 -2
- package/esm5/components/hints-host/hint-box/hint-box.component.js +8 -2
- package/esm5/components/hints-host/hint-box/hint-box.module.js +3 -2
- package/esm5/components/hints-host/hints-host.component.js +4 -9
- package/esm5/components/hints-host/hints-host.module.js +3 -9
- package/esm5/components/hosted-dropdown/hosted-dropdown.component.js +2 -2
- package/esm5/components/link/link.component.js +1 -1
- package/esm5/components/primitive-textfield/primitive-textfield.component.js +2 -2
- package/esm5/components/primitive-textfield/value-decoration/value-decoration.component.js +3 -3
- package/esm5/components/scrollbar/scrollbar.component.js +2 -1
- package/esm5/constants/version.js +2 -2
- package/esm5/directives/described-by/described-by.providers.js +2 -1
- package/esm5/directives/mask-accessor/mask-accessor.directive.js +2 -1
- package/esm5/directives/textfield-controller/textfield-autocomplete.directive.js +2 -1
- package/esm5/directives/textfield-controller/textfield-cleaner.directive.js +2 -1
- package/esm5/directives/textfield-controller/textfield-controller.provider.js +6 -1
- package/esm5/directives/textfield-controller/textfield-custom-content.directive.js +2 -1
- package/esm5/directives/textfield-controller/textfield-example-text.directive.js +2 -1
- package/esm5/directives/textfield-controller/textfield-input-mode.directive.js +2 -1
- package/esm5/directives/textfield-controller/textfield-label-outside.directive.js +2 -1
- package/esm5/directives/textfield-controller/textfield-max-length.directive.js +2 -1
- package/esm5/directives/textfield-controller/textfield-size.directive.js +2 -1
- package/esm5/directives/textfield-controller/textfield-type.directive.js +2 -1
- package/esm5/interfaces/hint.js +1 -0
- package/esm5/interfaces/index.js +1 -1
- package/esm5/observables/smart-search.js +9 -4
- package/esm5/providers/is-mobile-resolution.provider.js +6 -1
- package/esm5/providers/mode.provider.js +6 -1
- package/esm5/providers/watched-controller-provider-factory.js +6 -1
- package/esm5/utils/dom/are-css-vars-supported.js +4 -1
- package/esm5/utils/dom/check-fixed-position.js +6 -1
- package/esm5/utils/dom/get-safe-area-size.js +4 -1
- package/esm5/utils/dom/get-screen-width.js +6 -1
- package/esm5/utils/dom/process-icon.js +6 -1
- package/esm5/utils/format/capitalize-first-letter.js +6 -1
- package/esm5/utils/format/capitalize.js +4 -1
- package/esm5/utils/format/format-number.js +4 -1
- package/esm5/utils/format/format-phone.js +4 -1
- package/esm5/utils/format/get-fractional-part-padded.js +4 -1
- package/esm5/utils/format/number-to-string-without-exp.js +4 -1
- package/esm5/utils/format/other-decimal-symbol.js +6 -1
- package/esm5/utils/format/pluralize.js +2 -1
- package/esm5/utils/mask/masked-money-value-is-empty.js +6 -1
- package/esm5/utils/mask/masked-number-string-to-number.js +6 -1
- package/esm5/utils/miscellaneous/color-fallback.js +5 -2
- package/esm5/utils/miscellaneous/get-border.js +6 -1
- package/esm5/utils/miscellaneous/icons-path-factory.js +6 -1
- package/esm5/utils/miscellaneous/is-editing-key.js +4 -1
- package/esm5/utils/miscellaneous/is-presumed-html-string.js +6 -1
- package/esm5/utils/miscellaneous/size-bigger.js +4 -1
- package/esm5/utils/mobile/is-mobile.js +2 -2
- package/esm5/utils/polyfills/inner-html.js +2 -1
- package/fesm2015/taiga-ui-core-components-data-list.js +1 -0
- package/fesm2015/taiga-ui-core-components-data-list.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-dialog.js +1 -0
- package/fesm2015/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-expand.js +1 -1
- package/fesm2015/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hints-host.js +11 -17
- package/fesm2015/taiga-ui-core-components-hints-host.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js +1 -1
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-link.js +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js +3 -3
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-scrollbar.js +1 -0
- package/fesm2015/taiga-ui-core-components-scrollbar.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-described-by.js +1 -0
- package/fesm2015/taiga-ui-core-directives-described-by.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-mask-accessor.js +1 -0
- package/fesm2015/taiga-ui-core-directives-mask-accessor.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-textfield-controller.js +15 -1
- package/fesm2015/taiga-ui-core-directives-textfield-controller.js.map +1 -1
- package/fesm2015/taiga-ui-core-observables.js +8 -3
- package/fesm2015/taiga-ui-core-observables.js.map +1 -1
- package/fesm2015/taiga-ui-core-providers.js +16 -1
- package/fesm2015/taiga-ui-core-providers.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-dom.js +22 -1
- package/fesm2015/taiga-ui-core-utils-dom.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-format.js +27 -1
- package/fesm2015/taiga-ui-core-utils-format.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-mask.js +11 -1
- package/fesm2015/taiga-ui-core-utils-mask.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-miscellaneous.js +26 -2
- package/fesm2015/taiga-ui-core-utils-miscellaneous.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-mobile.js +1 -1
- package/fesm2015/taiga-ui-core-utils-mobile.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-polyfills.js +1 -0
- package/fesm2015/taiga-ui-core-utils-polyfills.js.map +1 -1
- package/fesm5/taiga-ui-core-components-data-list.js +1 -0
- package/fesm5/taiga-ui-core-components-data-list.js.map +1 -1
- package/fesm5/taiga-ui-core-components-dialog.js +1 -0
- package/fesm5/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm5/taiga-ui-core-components-expand.js +1 -1
- package/fesm5/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm5/taiga-ui-core-components-hints-host.js +11 -17
- package/fesm5/taiga-ui-core-components-hints-host.js.map +1 -1
- package/fesm5/taiga-ui-core-components-hosted-dropdown.js +1 -1
- package/fesm5/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm5/taiga-ui-core-components-link.js +1 -1
- package/fesm5/taiga-ui-core-components-primitive-textfield.js +3 -3
- package/fesm5/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm5/taiga-ui-core-components-scrollbar.js +1 -0
- package/fesm5/taiga-ui-core-components-scrollbar.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-described-by.js +1 -0
- package/fesm5/taiga-ui-core-directives-described-by.js.map +1 -1
- package/fesm5/taiga-ui-core-directives-mask-accessor.js +1 -0
- package/fesm5/taiga-ui-core-directives-mask-accessor.js.map +1 -1
- package/fesm5/taiga-ui-core-directives-textfield-controller.js +15 -1
- package/fesm5/taiga-ui-core-directives-textfield-controller.js.map +1 -1
- package/fesm5/taiga-ui-core-observables.js +9 -4
- package/fesm5/taiga-ui-core-observables.js.map +1 -1
- package/fesm5/taiga-ui-core-providers.js +16 -1
- package/fesm5/taiga-ui-core-providers.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-dom.js +22 -1
- package/fesm5/taiga-ui-core-utils-dom.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-format.js +27 -1
- package/fesm5/taiga-ui-core-utils-format.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-mask.js +11 -1
- package/fesm5/taiga-ui-core-utils-mask.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-miscellaneous.js +26 -2
- package/fesm5/taiga-ui-core-utils-miscellaneous.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-mobile.js +1 -1
- package/fesm5/taiga-ui-core-utils-mobile.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-polyfills.js +1 -0
- package/fesm5/taiga-ui-core-utils-polyfills.js.map +1 -1
- package/interfaces/hint.d.ts +7 -0
- package/interfaces/index.d.ts +1 -0
- package/interfaces/taiga-ui-core-interfaces.metadata.json +1 -1
- package/observables/smart-search.d.ts +5 -1
- package/observables/taiga-ui-core-observables.metadata.json +1 -1
- package/package.json +4 -4
- package/providers/is-mobile-resolution.provider.d.ts +4 -0
- package/providers/mode.provider.d.ts +4 -0
- package/providers/taiga-ui-core-providers.metadata.json +1 -1
- package/providers/watched-controller-provider-factory.d.ts +4 -0
- package/styles/mixins/mixins.less +2 -2
- package/utils/dom/are-css-vars-supported.d.ts +2 -0
- package/utils/dom/check-fixed-position.d.ts +4 -0
- package/utils/dom/get-safe-area-size.d.ts +2 -0
- package/utils/dom/get-screen-width.d.ts +4 -0
- package/utils/dom/process-icon.d.ts +4 -0
- package/utils/dom/taiga-ui-core-utils-dom.metadata.json +1 -1
- package/utils/format/capitalize-first-letter.d.ts +4 -0
- package/utils/format/capitalize.d.ts +2 -0
- package/utils/format/format-number.d.ts +2 -0
- package/utils/format/format-phone.d.ts +2 -0
- package/utils/format/get-fractional-part-padded.d.ts +2 -0
- package/utils/format/number-to-string-without-exp.d.ts +2 -0
- package/utils/format/other-decimal-symbol.d.ts +4 -0
- package/utils/format/taiga-ui-core-utils-format.metadata.json +1 -1
- package/utils/mask/masked-money-value-is-empty.d.ts +4 -0
- package/utils/mask/masked-number-string-to-number.d.ts +4 -0
- package/utils/mask/taiga-ui-core-utils-mask.metadata.json +1 -1
- package/utils/miscellaneous/color-fallback.d.ts +3 -1
- package/utils/miscellaneous/get-border.d.ts +4 -0
- package/utils/miscellaneous/icons-path-factory.d.ts +4 -0
- package/utils/miscellaneous/is-editing-key.d.ts +2 -0
- package/utils/miscellaneous/is-presumed-html-string.d.ts +4 -0
- package/utils/miscellaneous/size-bigger.d.ts +2 -0
- package/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.metadata.json +1 -1
- package/utils/mobile/taiga-ui-core-utils-mobile.metadata.json +1 -1
|
@@ -2,26 +2,36 @@ import { CHAR_NO_BREAK_SPACE, CHAR_HYPHEN, CHAR_PLUS } from '@taiga-ui/cdk';
|
|
|
2
2
|
import { __read } from 'tslib';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
+
* @deprecated: use {@link tuiCapitalize} instead
|
|
5
6
|
* Capitalizes a given string, replacing it with a lowercase string and making
|
|
6
7
|
* the first letter of each word uppercase.
|
|
7
8
|
*
|
|
8
9
|
* @param value the input string
|
|
9
10
|
* @return the capitalized string
|
|
10
11
|
*/
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
13
|
function capitalize(value) {
|
|
12
14
|
return value.toLowerCase().replace(/(?:^|\s)\S/g, function (char) { return char.toUpperCase(); });
|
|
13
15
|
}
|
|
16
|
+
var tuiCapitalize = capitalize;
|
|
14
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated: use {@link tuiCapitalizeFirstLetter} instead
|
|
20
|
+
*/
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
15
22
|
function capitalizeFirstLetter(value) {
|
|
16
23
|
return "" + value.charAt(0).toUpperCase() + value.slice(1);
|
|
17
24
|
}
|
|
25
|
+
var tuiCapitalizeFirstLetter = capitalizeFirstLetter;
|
|
18
26
|
|
|
19
27
|
/**
|
|
28
|
+
* @deprecated: use {@link tuiNumberToStringWithoutExp} instead
|
|
20
29
|
* Convert number to string with replacing exponent part on decimals
|
|
21
30
|
*
|
|
22
31
|
* @param value the number
|
|
23
32
|
* @return string representation of a number
|
|
24
33
|
*/
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
25
35
|
function numberToStringWithoutExp(value) {
|
|
26
36
|
var valueAsString = String(value);
|
|
27
37
|
var _a = __read(valueAsString.split('e-'), 2), numberPart = _a[0], expPart = _a[1];
|
|
@@ -33,23 +43,28 @@ function numberToStringWithoutExp(value) {
|
|
|
33
43
|
}
|
|
34
44
|
return valueWithoutExp;
|
|
35
45
|
}
|
|
46
|
+
var tuiNumberToStringWithoutExp = numberToStringWithoutExp;
|
|
36
47
|
|
|
37
48
|
/**
|
|
49
|
+
* @deprecated: use {@link tuiGetFractionPartPadded} instead
|
|
38
50
|
* Return fractional part of number
|
|
39
51
|
*
|
|
40
52
|
* @param value the number
|
|
41
53
|
* @param precision number of digits of decimal part, null to keep untouched
|
|
42
54
|
* @return the fractional part of number
|
|
43
55
|
*/
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
44
57
|
function getFractionPartPadded(value, precision) {
|
|
45
58
|
var _a = __read(numberToStringWithoutExp(value).split('.'), 2), _b = _a[1], fractionPartPadded = _b === void 0 ? '' : _b;
|
|
46
59
|
return typeof precision === 'number'
|
|
47
60
|
? fractionPartPadded.slice(0, Math.max(0, precision))
|
|
48
61
|
: fractionPartPadded;
|
|
49
62
|
}
|
|
63
|
+
var tuiGetFractionPartPadded = getFractionPartPadded;
|
|
50
64
|
|
|
51
65
|
// TODO: refactor later to `formatNumber(value: number, options: Partial<AllTheStuff>)`
|
|
52
66
|
/**
|
|
67
|
+
* @deprecated: use {@link tuiFormatNumber} instead
|
|
53
68
|
* Formats number adding a thousand separators and correct decimal separator
|
|
54
69
|
* padding decimal part with zeroes to given length
|
|
55
70
|
*
|
|
@@ -60,6 +75,7 @@ function getFractionPartPadded(value, precision) {
|
|
|
60
75
|
* @param zeroPadding enable zeros at the end of decimal part
|
|
61
76
|
* @return the formatted string
|
|
62
77
|
*/
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
63
79
|
function formatNumber(value, decimalLimit, decimalSeparator, thousandSeparator, zeroPadding) {
|
|
64
80
|
if (decimalLimit === void 0) { decimalLimit = null; }
|
|
65
81
|
if (decimalSeparator === void 0) { decimalSeparator = ','; }
|
|
@@ -88,8 +104,10 @@ function formatNumber(value, decimalLimit, decimalSeparator, thousandSeparator,
|
|
|
88
104
|
}
|
|
89
105
|
return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;
|
|
90
106
|
}
|
|
107
|
+
var tuiFormatNumber = formatNumber;
|
|
91
108
|
|
|
92
109
|
/**
|
|
110
|
+
* @deprecated: use {@link tuiFormatPhone} instead
|
|
93
111
|
* Formats a string with the phone format +7XXXXXXXXXXXX or XXXXXXXXXXXX,
|
|
94
112
|
* adding parentheses and hyphens.
|
|
95
113
|
*
|
|
@@ -98,6 +116,7 @@ function formatNumber(value, decimalLimit, decimalSeparator, thousandSeparator,
|
|
|
98
116
|
* @param phoneMask a phone number mask
|
|
99
117
|
* @return the formatted phone string of the form +7 XXX XXX-XX-XX
|
|
100
118
|
*/
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
101
120
|
function formatPhone(value, countryCode, phoneMask) {
|
|
102
121
|
if (!value) {
|
|
103
122
|
return '';
|
|
@@ -127,10 +146,16 @@ function formatPhone(value, countryCode, phoneMask) {
|
|
|
127
146
|
}
|
|
128
147
|
return result;
|
|
129
148
|
}
|
|
149
|
+
var tuiFormatPhone = formatPhone;
|
|
130
150
|
|
|
151
|
+
/**
|
|
152
|
+
* @deprecated: use {@link tuiOtherDecimalSymbol} instead
|
|
153
|
+
*/
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
131
155
|
function otherDecimalSymbol(symbol) {
|
|
132
156
|
return symbol === '.' ? ',' : '.';
|
|
133
157
|
}
|
|
158
|
+
var tuiOtherDecimalSymbol = otherDecimalSymbol;
|
|
134
159
|
|
|
135
160
|
/**
|
|
136
161
|
* Selects the correct plural form to display.
|
|
@@ -140,6 +165,7 @@ function otherDecimalSymbol(symbol) {
|
|
|
140
165
|
* @deprecated This implementation targets Russian.
|
|
141
166
|
* Use https://angular.io/api/common/NgPlural for your implementations.
|
|
142
167
|
*/
|
|
168
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
143
169
|
function pluralize(value, _a) {
|
|
144
170
|
var _b = __read(_a, 3), one = _b[0], few = _b[1], many = _b[2];
|
|
145
171
|
var ten = value % 10;
|
|
@@ -172,5 +198,5 @@ function tuiPluralizeToICU(pluralize) {
|
|
|
172
198
|
* Generated bundle index. Do not edit.
|
|
173
199
|
*/
|
|
174
200
|
|
|
175
|
-
export { capitalize, capitalizeFirstLetter, formatNumber, formatPhone, getFractionPartPadded, numberToStringWithoutExp, otherDecimalSymbol, pluralize, tuiPluralizeToICU };
|
|
201
|
+
export { capitalize, capitalizeFirstLetter, formatNumber, formatPhone, getFractionPartPadded, numberToStringWithoutExp, otherDecimalSymbol, pluralize, tuiCapitalize, tuiCapitalizeFirstLetter, tuiFormatNumber, tuiFormatPhone, tuiGetFractionPartPadded, tuiNumberToStringWithoutExp, tuiOtherDecimalSymbol, tuiPluralizeToICU };
|
|
176
202
|
//# sourceMappingURL=taiga-ui-core-utils-format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-utils-format.js","sources":["ng://@taiga-ui/core/utils/format/capitalize.ts","ng://@taiga-ui/core/utils/format/capitalize-first-letter.ts","ng://@taiga-ui/core/utils/format/number-to-string-without-exp.ts","ng://@taiga-ui/core/utils/format/get-fractional-part-padded.ts","ng://@taiga-ui/core/utils/format/format-number.ts","ng://@taiga-ui/core/utils/format/format-phone.ts","ng://@taiga-ui/core/utils/format/other-decimal-symbol.ts","ng://@taiga-ui/core/utils/format/pluralize.ts","ng://@taiga-ui/core/utils/format/pluralize-to-icu.ts","ng://@taiga-ui/core/utils/format/taiga-ui-core-utils-format.ts"],"sourcesContent":["/**\n * Capitalizes a given string, replacing it with a lowercase string and making\n * the first letter of each word uppercase.\n *\n * @param value the input string\n * @return the capitalized string\n */\nexport function capitalize(value: string): string {\n return value.toLowerCase().replace(/(?:^|\\s)\\S/g, char => char.toUpperCase());\n}\n","export function capitalizeFirstLetter(value: string): string {\n return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n}\n","/**\n * Convert number to string with replacing exponent part on decimals\n *\n * @param value the number\n * @return string representation of a number\n */\nexport function numberToStringWithoutExp(value: number): string {\n const valueAsString = String(value);\n const [numberPart, expPart] = valueAsString.split('e-');\n\n let valueWithoutExp = valueAsString;\n\n if (expPart) {\n const [, fractionalPart] = numberPart.split('.');\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n","import {numberToStringWithoutExp} from './number-to-string-without-exp';\n\n/**\n * Return fractional part of number\n *\n * @param value the number\n * @param precision number of digits of decimal part, null to keep untouched\n * @return the fractional part of number\n */\nexport function getFractionPartPadded(value: number, precision?: number | null): string {\n const [, fractionPartPadded = ''] = numberToStringWithoutExp(value).split('.');\n\n return typeof precision === 'number'\n ? fractionPartPadded.slice(0, Math.max(0, precision))\n : fractionPartPadded;\n}\n","import {CHAR_HYPHEN, CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';\n\nimport {getFractionPartPadded} from './get-fractional-part-padded';\n\n// TODO: refactor later to `formatNumber(value: number, options: Partial<AllTheStuff>)`\n/**\n * Formats number adding a thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n *\n * @param value the input number\n * @param decimalLimit number of digits of decimal part, null to keep untouched\n * @param decimalSeparator separator between the integer and the decimal part\n * @param thousandSeparator separator between thousands\n * @param zeroPadding enable zeros at the end of decimal part\n * @return the formatted string\n */\nexport function formatNumber(\n value: number,\n decimalLimit: number | null = null,\n decimalSeparator: string = ',',\n thousandSeparator: string = CHAR_NO_BREAK_SPACE,\n zeroPadding: boolean = true,\n): string {\n const integerPartString = String(Math.floor(Math.abs(value)));\n\n let fractionPartPadded = getFractionPartPadded(value, decimalLimit);\n\n if (decimalLimit !== null) {\n if (zeroPadding) {\n const zeroPaddingSize: number = Math.max(\n decimalLimit - fractionPartPadded.length,\n 0,\n );\n const zeroPartString = '0'.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n } else {\n fractionPartPadded = fractionPartPadded.replace(/0*$/, '');\n }\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? CHAR_HYPHEN : '';\n let result = sign + integerPartString.charAt(0);\n\n for (let i = 1; i < integerPartString.length; i++) {\n if (i % 3 === remainder && integerPartString.length > 3) {\n result += thousandSeparator;\n }\n\n result += integerPartString.charAt(i);\n }\n\n return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;\n}\n","import {CHAR_PLUS} from '@taiga-ui/cdk';\n\n/**\n * Formats a string with the phone format +7XXXXXXXXXXXX or XXXXXXXXXXXX,\n * adding parentheses and hyphens.\n *\n * @param value the input string\n * @param countryCode a country code\n * @param phoneMask a phone number mask\n * @return the formatted phone string of the form +7 XXX XXX-XX-XX\n */\nexport function formatPhone(\n value: string,\n countryCode: string,\n phoneMask: string,\n): string {\n if (!value) {\n return '';\n }\n\n let result = countryCode;\n\n countryCode = countryCode.replace(/[()]/g, '');\n\n if (!value.startsWith(countryCode)) {\n value = countryCode + value.replace(CHAR_PLUS, '');\n }\n\n const splitPhoneMask = phoneMask.split('');\n const splitValue = value.slice(countryCode.length).split('');\n\n result += ' ';\n\n if (splitValue.length === 0) {\n return result;\n }\n\n for (let i = 0; i < splitPhoneMask.length; i++) {\n if (splitValue.length === 0) {\n break;\n }\n\n if (splitPhoneMask[i] === '#') {\n result += splitValue[0] || '';\n splitValue.splice(0, 1);\n } else {\n result += splitPhoneMask[i];\n }\n }\n\n return result;\n}\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\nexport function otherDecimalSymbol(symbol: TuiDecimalSymbol): TuiDecimalSymbol {\n return symbol === '.' ? ',' : '.';\n}\n","import {TuiPluralize} from '@taiga-ui/core/types';\n\n/**\n * Selects the correct plural form to display.\n *\n * @param value the input number\n * @param args an array of three plural forms, e.g. ['год', 'года', 'лет']\n * @deprecated This implementation targets Russian.\n * Use https://angular.io/api/common/NgPlural for your implementations.\n */\nexport function pluralize(value: number, [one, few, many]: TuiPluralize): string {\n const ten = value % 10;\n const hundred = value % 100;\n\n // 1, 21, 101, 121, но не 11, 111, 211...\n if (ten === 1 && hundred !== 11) {\n return one;\n }\n\n // 2, 3, 4, 22, 33, 44, 152, 163, 174, но не 12, 13, 14, 112, 213, 314...\n if (ten >= 2 && ten <= 4 && (hundred < 10 || hundred >= 20)) {\n return few;\n }\n\n return many;\n}\n","import {TuiPluralize} from '@taiga-ui/core/types';\n\n// TODO: 3.0 remove in 3.0\n\n/**\n * Temporary util for mapping TuiPluralize array to ICU format\n */\nexport function tuiPluralizeToICU(pluralize: TuiPluralize): Record<string, string> {\n return {\n one: pluralize[0],\n few: pluralize[1],\n many: pluralize[2],\n other: pluralize[2],\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;;;;;SAOgB,UAAU,CAAC,KAAa;IACpC,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,WAAW,EAAE,GAAA,CAAC,CAAC;AAClF;;SCTgB,qBAAqB,CAAC,KAAa;IAC/C,OAAO,KAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAG,CAAC;AAC/D;;ACFA;;;;;;SAMgB,wBAAwB,CAAC,KAAa;IAClD,IAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAA,yCAAiD,EAAhD,kBAAU,EAAE,eAAoC,CAAC;IAExD,IAAI,eAAe,GAAG,aAAa,CAAC;IAEpC,IAAI,OAAO,EAAE;QACH,IAAA,qCAA0C,EAAvC,sBAAuC,CAAC;QACjD,IAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,MAAM,KAAI,CAAC,CAAC,CAAC;QAEtE,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;KAClD;IAED,OAAO,eAAe,CAAC;AAC3B;;AClBA;;;;;;;SAOgB,qBAAqB,CAAC,KAAa,EAAE,SAAyB;IACpE,IAAA,0DAAwE,EAArE,UAAuB,EAAvB,4CAAqE,CAAC;IAE/E,OAAO,OAAO,SAAS,KAAK,QAAQ;UAC9B,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;UACnD,kBAAkB,CAAC;AAC7B;;ACXA;AACA;;;;;;;;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AAM,CAAC;AAClB;;SCjDgB,kBAAkB,CAAC,MAAwB;IACvD,OAAO,MAAM,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AACtC;;ACFA;;;;;;;;SAQgB,SAAS,CAAC,KAAa,EAAE,EAA8B;QAA9B,kBAA8B,EAA7B,WAAG,EAAE,WAAG,EAAE,YAAI;IACpD,IAAM,GAAG,GAAG,KAAK,GAAG,EAAE,CAAC;IACvB,IAAM,OAAO,GAAG,KAAK,GAAG,GAAG,CAAC;;IAG5B,IAAI,GAAG,KAAK,CAAC,IAAI,OAAO,KAAK,EAAE,EAAE;QAC7B,OAAO,GAAG,CAAC;KACd;;IAGD,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,OAAO,GAAG,EAAE,IAAI,OAAO,IAAI,EAAE,CAAC,EAAE;QACzD,OAAO,GAAG,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AAChB;;ACvBA;AAEA;;;SAGgB,iBAAiB,CAAC,SAAuB;IACrD,OAAO;QACH,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;QACjB,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;QACjB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QAClB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;KACtB,CAAC;AACN;;ACdA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-utils-format.js","sources":["ng://@taiga-ui/core/utils/format/capitalize.ts","ng://@taiga-ui/core/utils/format/capitalize-first-letter.ts","ng://@taiga-ui/core/utils/format/number-to-string-without-exp.ts","ng://@taiga-ui/core/utils/format/get-fractional-part-padded.ts","ng://@taiga-ui/core/utils/format/format-number.ts","ng://@taiga-ui/core/utils/format/format-phone.ts","ng://@taiga-ui/core/utils/format/other-decimal-symbol.ts","ng://@taiga-ui/core/utils/format/pluralize.ts","ng://@taiga-ui/core/utils/format/pluralize-to-icu.ts","ng://@taiga-ui/core/utils/format/taiga-ui-core-utils-format.ts"],"sourcesContent":["/**\n * @deprecated: use {@link tuiCapitalize} instead\n * Capitalizes a given string, replacing it with a lowercase string and making\n * the first letter of each word uppercase.\n *\n * @param value the input string\n * @return the capitalized string\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function capitalize(value: string): string {\n return value.toLowerCase().replace(/(?:^|\\s)\\S/g, char => char.toUpperCase());\n}\n\nexport const tuiCapitalize = capitalize;\n","/**\n * @deprecated: use {@link tuiCapitalizeFirstLetter} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function capitalizeFirstLetter(value: string): string {\n return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n}\n\nexport const tuiCapitalizeFirstLetter = capitalizeFirstLetter;\n","/**\n * @deprecated: use {@link tuiNumberToStringWithoutExp} instead\n * Convert number to string with replacing exponent part on decimals\n *\n * @param value the number\n * @return string representation of a number\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function numberToStringWithoutExp(value: number): string {\n const valueAsString = String(value);\n const [numberPart, expPart] = valueAsString.split('e-');\n\n let valueWithoutExp = valueAsString;\n\n if (expPart) {\n const [, fractionalPart] = numberPart.split('.');\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n\nexport const tuiNumberToStringWithoutExp = numberToStringWithoutExp;\n","import {numberToStringWithoutExp} from './number-to-string-without-exp';\n\n/**\n * @deprecated: use {@link tuiGetFractionPartPadded} instead\n * Return fractional part of number\n *\n * @param value the number\n * @param precision number of digits of decimal part, null to keep untouched\n * @return the fractional part of number\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getFractionPartPadded(value: number, precision?: number | null): string {\n const [, fractionPartPadded = ''] = numberToStringWithoutExp(value).split('.');\n\n return typeof precision === 'number'\n ? fractionPartPadded.slice(0, Math.max(0, precision))\n : fractionPartPadded;\n}\n\nexport const tuiGetFractionPartPadded = getFractionPartPadded;\n","import {CHAR_HYPHEN, CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';\n\nimport {getFractionPartPadded} from './get-fractional-part-padded';\n\n// TODO: refactor later to `formatNumber(value: number, options: Partial<AllTheStuff>)`\n/**\n * @deprecated: use {@link tuiFormatNumber} instead\n * Formats number adding a thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n *\n * @param value the input number\n * @param decimalLimit number of digits of decimal part, null to keep untouched\n * @param decimalSeparator separator between the integer and the decimal part\n * @param thousandSeparator separator between thousands\n * @param zeroPadding enable zeros at the end of decimal part\n * @return the formatted string\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function formatNumber(\n value: number,\n decimalLimit: number | null = null,\n decimalSeparator: string = ',',\n thousandSeparator: string = CHAR_NO_BREAK_SPACE,\n zeroPadding: boolean = true,\n): string {\n const integerPartString = String(Math.floor(Math.abs(value)));\n\n let fractionPartPadded = getFractionPartPadded(value, decimalLimit);\n\n if (decimalLimit !== null) {\n if (zeroPadding) {\n const zeroPaddingSize: number = Math.max(\n decimalLimit - fractionPartPadded.length,\n 0,\n );\n const zeroPartString = '0'.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n } else {\n fractionPartPadded = fractionPartPadded.replace(/0*$/, '');\n }\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? CHAR_HYPHEN : '';\n let result = sign + integerPartString.charAt(0);\n\n for (let i = 1; i < integerPartString.length; i++) {\n if (i % 3 === remainder && integerPartString.length > 3) {\n result += thousandSeparator;\n }\n\n result += integerPartString.charAt(i);\n }\n\n return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;\n}\n\nexport const tuiFormatNumber = formatNumber;\n","import {CHAR_PLUS} from '@taiga-ui/cdk';\n\n/**\n * @deprecated: use {@link tuiFormatPhone} instead\n * Formats a string with the phone format +7XXXXXXXXXXXX or XXXXXXXXXXXX,\n * adding parentheses and hyphens.\n *\n * @param value the input string\n * @param countryCode a country code\n * @param phoneMask a phone number mask\n * @return the formatted phone string of the form +7 XXX XXX-XX-XX\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function formatPhone(\n value: string,\n countryCode: string,\n phoneMask: string,\n): string {\n if (!value) {\n return '';\n }\n\n let result = countryCode;\n\n countryCode = countryCode.replace(/[()]/g, '');\n\n if (!value.startsWith(countryCode)) {\n value = countryCode + value.replace(CHAR_PLUS, '');\n }\n\n const splitPhoneMask = phoneMask.split('');\n const splitValue = value.slice(countryCode.length).split('');\n\n result += ' ';\n\n if (splitValue.length === 0) {\n return result;\n }\n\n for (let i = 0; i < splitPhoneMask.length; i++) {\n if (splitValue.length === 0) {\n break;\n }\n\n if (splitPhoneMask[i] === '#') {\n result += splitValue[0] || '';\n splitValue.splice(0, 1);\n } else {\n result += splitPhoneMask[i];\n }\n }\n\n return result;\n}\n\nexport const tuiFormatPhone = formatPhone;\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\n/**\n * @deprecated: use {@link tuiOtherDecimalSymbol} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function otherDecimalSymbol(symbol: TuiDecimalSymbol): TuiDecimalSymbol {\n return symbol === '.' ? ',' : '.';\n}\n\nexport const tuiOtherDecimalSymbol = otherDecimalSymbol;\n","import {TuiPluralize} from '@taiga-ui/core/types';\n\n/**\n * Selects the correct plural form to display.\n *\n * @param value the input number\n * @param args an array of three plural forms, e.g. ['год', 'года', 'лет']\n * @deprecated This implementation targets Russian.\n * Use https://angular.io/api/common/NgPlural for your implementations.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function pluralize(value: number, [one, few, many]: TuiPluralize): string {\n const ten = value % 10;\n const hundred = value % 100;\n\n // 1, 21, 101, 121, но не 11, 111, 211...\n if (ten === 1 && hundred !== 11) {\n return one;\n }\n\n // 2, 3, 4, 22, 33, 44, 152, 163, 174, но не 12, 13, 14, 112, 213, 314...\n if (ten >= 2 && ten <= 4 && (hundred < 10 || hundred >= 20)) {\n return few;\n }\n\n return many;\n}\n","import {TuiPluralize} from '@taiga-ui/core/types';\n\n// TODO: 3.0 remove in 3.0\n\n/**\n * Temporary util for mapping TuiPluralize array to ICU format\n */\nexport function tuiPluralizeToICU(pluralize: TuiPluralize): Record<string, string> {\n return {\n one: pluralize[0],\n few: pluralize[1],\n many: pluralize[2],\n other: pluralize[2],\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;;;;;;AAQA;SACgB,UAAU,CAAC,KAAa;IACpC,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,WAAW,EAAE,GAAA,CAAC,CAAC;AAClF,CAAC;IAEY,aAAa,GAAG;;ACb7B;;;AAGA;SACgB,qBAAqB,CAAC,KAAa;IAC/C,OAAO,KAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAG,CAAC;AAC/D,CAAC;IAEY,wBAAwB,GAAG;;ACRxC;;;;;;;AAOA;SACgB,wBAAwB,CAAC,KAAa;IAClD,IAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAA,yCAAiD,EAAhD,kBAAU,EAAE,eAAoC,CAAC;IAExD,IAAI,eAAe,GAAG,aAAa,CAAC;IAEpC,IAAI,OAAO,EAAE;QACH,IAAA,qCAA0C,EAAvC,sBAAuC,CAAC;QACjD,IAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,MAAM,KAAI,CAAC,CAAC,CAAC;QAEtE,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;KAClD;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC;IAEY,2BAA2B,GAAG;;ACtB3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CAAC,CAAC;KACtB,CAAC;AACN;;ACdA;;;;;;"}
|
|
@@ -251,6 +251,10 @@ function tuiEnableAutoCorrectDecimalSymbol(_a) {
|
|
|
251
251
|
return !TUI_DECIMAL_SYMBOLS.includes(thousandSeparator);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
/**
|
|
255
|
+
* @deprecated: use {@link tuiMaskedMoneyValueIsEmpty} instead
|
|
256
|
+
*/
|
|
257
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
254
258
|
function maskedMoneyValueIsEmpty(value) {
|
|
255
259
|
switch (value) {
|
|
256
260
|
case '':
|
|
@@ -262,14 +266,20 @@ function maskedMoneyValueIsEmpty(value) {
|
|
|
262
266
|
return false;
|
|
263
267
|
}
|
|
264
268
|
}
|
|
269
|
+
var tuiMaskedMoneyValueIsEmpty = maskedMoneyValueIsEmpty;
|
|
265
270
|
|
|
271
|
+
/**
|
|
272
|
+
* @deprecated: use {@link tuiMaskedNumberStringToNumber} instead
|
|
273
|
+
*/
|
|
274
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
266
275
|
function maskedNumberStringToNumber(value, decimalsSymbol, thousandSymbol) {
|
|
267
276
|
return parseFloat(value.split(thousandSymbol).join('').split(decimalsSymbol).join('.'));
|
|
268
277
|
}
|
|
278
|
+
var tuiMaskedNumberStringToNumber = maskedNumberStringToNumber;
|
|
269
279
|
|
|
270
280
|
/**
|
|
271
281
|
* Generated bundle index. Do not edit.
|
|
272
282
|
*/
|
|
273
283
|
|
|
274
|
-
export { maskedMoneyValueIsEmpty, maskedNumberStringToNumber, tuiCreateAutoCorrectedNumberPipe, tuiCreateCorrectionMask, tuiCreateNumberMask, tuiEnableAutoCorrectDecimalSymbol };
|
|
284
|
+
export { maskedMoneyValueIsEmpty, maskedNumberStringToNumber, tuiCreateAutoCorrectedNumberPipe, tuiCreateCorrectionMask, tuiCreateNumberMask, tuiEnableAutoCorrectDecimalSymbol, tuiMaskedMoneyValueIsEmpty, tuiMaskedNumberStringToNumber };
|
|
275
285
|
//# sourceMappingURL=taiga-ui-core-utils-mask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-utils-mask.js","sources":["ng://@taiga-ui/core/utils/mask/create-auto-corrected-money-pipe.ts","ng://@taiga-ui/core/utils/mask/create-correction-mask.ts","ng://@taiga-ui/core/utils/mask/create-number-mask.ts","ng://@taiga-ui/core/utils/mask/enable-auto-correct-decimal-symbol.ts","ng://@taiga-ui/core/utils/mask/masked-money-value-is-empty.ts","ng://@taiga-ui/core/utils/mask/masked-number-string-to-number.ts","ng://@taiga-ui/core/utils/mask/taiga-ui-core-utils-mask.ts"],"sourcesContent":["import {\n CHAR_HYPHEN,\n CHAR_NO_BREAK_SPACE,\n getDocumentOrShadowRoot,\n isNativeFocused,\n isSafari,\n tuiAssert,\n} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core/mask';\nimport {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\n/**\n * Used to finish a number with zeros to a given precision\n */\nexport function tuiCreateAutoCorrectedNumberPipe(\n decimalLimit: number = 0,\n decimalSymbol: TuiDecimalSymbol = ',',\n thousandSymbol: string = CHAR_NO_BREAK_SPACE,\n nativeInput?: HTMLInputElement | null,\n allowNegative?: boolean,\n isIOS = false,\n): TuiTextMaskPipeHandler {\n tuiAssert.assert(Number.isInteger(decimalLimit));\n tuiAssert.assert(decimalLimit >= 0);\n\n // Guess for which browser I need this :)\n let previousCaret = -1;\n const unlucky = (!!nativeInput && isSafari(nativeInput)) || isIOS;\n\n if (nativeInput && unlucky) {\n nativeInput.addEventListener('beforeinput', () => {\n previousCaret = nativeInput.selectionStart || 0;\n });\n }\n\n return (conformedValue, config) => {\n // Removing everything by selecting and pressing '-'\n if (!conformedValue && config.rawValue === CHAR_HYPHEN && allowNegative) {\n return CHAR_HYPHEN;\n }\n\n // remove these hacks after text mask library has changed\n if (nativeInput && unlucky && isNativeFocused(nativeInput)) {\n const caret = calculateSafariCaret(\n config.previousConformedValue,\n conformedValue,\n previousCaret,\n );\n\n setTimeout(() => {\n nativeInput.setSelectionRange(caret, caret);\n });\n }\n\n if (\n nativeInput &&\n nativeInput.ownerDocument !== getDocumentOrShadowRoot(nativeInput) &&\n isNativeFocused(nativeInput) &&\n config.currentCaretPosition\n ) {\n const realCaretPosition =\n config.currentCaretPosition +\n calculateCaretGap(\n config.previousConformedValue,\n conformedValue,\n thousandSymbol,\n );\n\n setTimeout(() => {\n nativeInput.setSelectionRange(realCaretPosition, realCaretPosition);\n });\n }\n\n if (conformedValue === '' || !decimalLimit) {\n return {value: conformedValue};\n }\n\n const withDecimalSymbol = addDecimalSymbolIfNeeded(conformedValue, decimalSymbol);\n const decimalPart = withDecimalSymbol.split(decimalSymbol)[1];\n const zeroPaddingSize = decimalLimit - decimalPart.length;\n\n return {\n value: withDecimalSymbol + '0'.repeat(zeroPaddingSize),\n };\n };\n}\n\nfunction addDecimalSymbolIfNeeded(\n value: string,\n decimalSymbol: TuiDecimalSymbol = ',',\n): string {\n return !value.includes(decimalSymbol) ? value + decimalSymbol : value;\n}\n\nfunction calculateSafariCaret(\n previousValue: string = '',\n current: string,\n previousCaret: number,\n decimalSymbol: string = ',',\n): number {\n const tailRegex = new RegExp(`${decimalSymbol}.+`);\n const previousWithoutTail = previousValue.replace(tailRegex, '');\n const currentWithoutTail = current.replace(tailRegex, '');\n\n const pasteOrCutOperation =\n Math.abs(previousWithoutTail.length - currentWithoutTail.length) > 2;\n\n if (pasteOrCutOperation) {\n return current.length;\n }\n\n if (previousValue.length === current.length) {\n if (previousValue.indexOf(decimalSymbol) <= previousCaret) {\n return calculateChangedTailIndex(previousValue, current);\n }\n\n return previousWithoutTail === currentWithoutTail\n ? previousCaret - 1\n : previousCaret + 1;\n }\n\n if (previousValue.length === 0) {\n return 1;\n }\n\n const changeLength = current.length - previousValue.length;\n\n return previousCaret + changeLength;\n}\n\nfunction calculateChangedTailIndex(previous: string, current: string): number {\n for (let i = 0; i < current.length; i++) {\n if (previous[i] !== current[i]) {\n return current[i] === '0' ? i : i + 1;\n }\n }\n\n return current.length;\n}\n\nfunction calculateCaretGap(\n previousValue: string = '',\n current: string,\n thousandSymbol: string,\n): number {\n const pasteOrCutOperation = Math.abs(previousValue.length - current.length) > 2;\n\n if (pasteOrCutOperation) {\n return 0;\n }\n\n const wereSpaces = previousValue.split(thousandSymbol).length;\n const nowSpaces = current.split(thousandSymbol).length;\n\n return nowSpaces - wereSpaces;\n}\n","import {tuiAssert} from '@taiga-ui/cdk';\nimport {MASK_CARET_TRAP} from '@taiga-ui/core/constants';\nimport {\n TuiTextMaskCorrectionHandler,\n TuiTextMaskList,\n TuiTextMaskListHandler,\n} from '@taiga-ui/core/mask';\n\nconst ASSERTION = 'Correction function must return single char or null';\n\nexport function tuiCreateCorrectionMask(\n allowed: RegExp,\n correctionHandler: TuiTextMaskCorrectionHandler,\n): TuiTextMaskListHandler {\n return rawValue => {\n const mask = rawValue.split('').reduce<TuiTextMaskList>((result, char, index) => {\n const corrected = correctionHandler(char, index);\n\n tuiAssert.assert(corrected === null || corrected.length === 1, ASSERTION);\n\n if (!allowed.test(char) && !corrected) {\n return result;\n }\n\n if (allowed.test(char)) {\n return [...result, allowed];\n }\n\n if (corrected) {\n return [...result, corrected, MASK_CARET_TRAP];\n }\n\n return result;\n }, []);\n const lastIndex = mask.lastIndexOf(MASK_CARET_TRAP);\n const filtered = mask.filter(\n (item, index) => item !== MASK_CARET_TRAP || index === lastIndex,\n );\n\n return filtered.some(item => item !== allowed)\n ? [...filtered, allowed]\n : filtered;\n };\n}\n","import {CHAR_EN_DASH, CHAR_HYPHEN, CHAR_NO_BREAK_SPACE, tuiAssert} from '@taiga-ui/cdk';\nimport {\n MASK_CARET_TRAP,\n TUI_DIGIT_REGEXP,\n TUI_LEADING_ZEROES_REGEXP,\n TUI_NON_DIGITS_REGEXP,\n} from '@taiga-ui/core/constants';\nimport {TuiNumberMaskOptions, TuiTextMaskListHandler} from '@taiga-ui/core/mask';\nimport {TuiDecimalSymbol} from '@taiga-ui/core/types';\nimport {otherDecimalSymbol} from '@taiga-ui/core/utils/format';\n\nconst NON_ZERO_DIGIT = /[1-9]/;\n\n/**\n * Adaptation for {@link https://github.com/text-mask/text-mask/tree/master/addons#createnumbermask `createNumberMask`}\n */\nexport function tuiCreateNumberMask({\n allowDecimal = false,\n decimalSymbol = ',',\n thousandSymbol = CHAR_NO_BREAK_SPACE,\n autoCorrectDecimalSymbol = true,\n decimalLimit = 2,\n requireDecimal = false,\n allowNegative = false,\n integerLimit = 0,\n}: TuiNumberMaskOptions = {}): TuiTextMaskListHandler {\n tuiAssert.assert(Number.isInteger(decimalLimit));\n tuiAssert.assert(decimalLimit >= 0);\n tuiAssert.assert(Number.isInteger(integerLimit));\n tuiAssert.assert(integerLimit >= 0);\n\n return (rawValue, {previousConformedValue}) => {\n if (previousConformedValue && requireDecimal) {\n const conformedWithoutSeparator = rawValue.split(thousandSymbol).join('');\n const previousConformedValueWithoutDecimalSymbolAndSeparator =\n previousConformedValue\n .split(thousandSymbol)\n .join('')\n .split(decimalSymbol)\n .join('');\n\n // Forbid removal of decimal separator if decimal part is required\n if (\n conformedWithoutSeparator ===\n previousConformedValueWithoutDecimalSymbolAndSeparator\n ) {\n rawValue = previousConformedValue;\n }\n }\n\n const isNegative =\n (rawValue[0] === CHAR_HYPHEN || rawValue[0] === CHAR_EN_DASH) &&\n allowNegative;\n\n if (\n isDecimalSymbol(rawValue, decimalSymbol, autoCorrectDecimalSymbol) &&\n allowDecimal\n ) {\n return ['0', decimalSymbol, TUI_DIGIT_REGEXP];\n }\n\n if (isNegative) {\n rawValue = rawValue.slice(1);\n }\n\n const decimalIndex = getDecimalSymbolIndex(\n rawValue,\n decimalSymbol,\n autoCorrectDecimalSymbol,\n );\n const hasDecimal = decimalIndex !== -1;\n const integer = hasDecimal ? rawValue.slice(0, decimalIndex) : rawValue;\n const thousandSeparators = integer.match(new RegExp(thousandSymbol, 'g')) || [];\n const integerCapped = integerLimit\n ? integer.slice(0, integerLimit + thousandSeparators.length)\n : integer;\n const integerCappedClean = integerCapped.replace(TUI_NON_DIGITS_REGEXP, '');\n const [leadingZerosMatch] = integerCappedClean.match(\n TUI_LEADING_ZEROES_REGEXP,\n ) || [''];\n const leadingZerosAmount = leadingZerosMatch.length;\n const integerCappedZerosClean = integerCappedClean\n .replace(/^0+(?!\\.|$)/, '')\n .trim();\n const withSeparator = addThousandsSeparator(\n integerCappedZerosClean,\n thousandSymbol,\n );\n const mask = convertToMask(withSeparator);\n\n if ((hasDecimal && allowDecimal) || requireDecimal) {\n const fraction = hasDecimal\n ? convertToMask(\n rawValue.slice(decimalIndex + 1).replace(TUI_NON_DIGITS_REGEXP, ''),\n )\n : [];\n const fractionCapped = decimalLimit\n ? fraction.slice(0, decimalLimit)\n : fraction;\n\n if (rawValue[decimalIndex] !== otherDecimalSymbol(decimalSymbol)) {\n mask.push(MASK_CARET_TRAP);\n }\n\n mask.push(decimalSymbol, MASK_CARET_TRAP, ...fractionCapped);\n\n for (let i = 0; i < decimalLimit - fractionCapped.length; i++) {\n mask.push(TUI_DIGIT_REGEXP);\n }\n }\n\n const isOnlyZeroDigit = mask.length === 1 && integerCappedZerosClean === '0';\n\n if (isNegative) {\n if (mask.length === 0) {\n mask.push(TUI_DIGIT_REGEXP);\n }\n\n mask.unshift(CHAR_HYPHEN);\n }\n\n return preventLeadingZeroes(mask, isOnlyZeroDigit, leadingZerosAmount);\n };\n}\n\nfunction preventLeadingZeroes(\n mask: Array<string | RegExp>,\n isOnlyZeroDigit: boolean = false,\n leadingZerosAmount: number = 0,\n): Array<string | RegExp> {\n if (isOnlyZeroDigit || leadingZerosAmount === 0) {\n return mask;\n }\n\n const firstDigitIndex = mask.indexOf(TUI_DIGIT_REGEXP);\n\n if (firstDigitIndex === -1) {\n return mask;\n }\n\n const secondMaskDigit = mask[firstDigitIndex + 1];\n const isCaretTrap = secondMaskDigit === MASK_CARET_TRAP;\n\n if (isCaretTrap && leadingZerosAmount === 1) {\n return mask;\n } else if (isCaretTrap) {\n mask.unshift(NON_ZERO_DIGIT);\n\n return mask;\n }\n\n mask[firstDigitIndex] = NON_ZERO_DIGIT;\n\n return mask;\n}\n\nfunction getDecimalSymbolIndex(\n str: string,\n decimalSymbol: TuiDecimalSymbol,\n autoCorrectDecimalSymbol: boolean,\n): number {\n if (!autoCorrectDecimalSymbol) {\n return str.lastIndexOf(decimalSymbol);\n }\n\n return Math.max(\n str.lastIndexOf(decimalSymbol),\n str.lastIndexOf(otherDecimalSymbol(decimalSymbol)),\n );\n}\n\nfunction isDecimalSymbol(\n str: string,\n decimalSymbol: TuiDecimalSymbol,\n autoCorrectDecimalSymbol: boolean,\n): boolean {\n if (autoCorrectDecimalSymbol) {\n return /^[,.]$/.test(str);\n }\n\n return str === decimalSymbol;\n}\n\nfunction convertToMask(strNumber: string): Array<string | RegExp> {\n return strNumber\n .split('')\n .map(char => (TUI_DIGIT_REGEXP.test(char) ? TUI_DIGIT_REGEXP : char));\n}\n\nfunction addThousandsSeparator(strNumber: string, thousandSymbol: string): string {\n return strNumber.length > 3\n ? // TODO: investigate to disallow potentially catastrophic exponential-time regular expressions.\n // eslint-disable-next-line unicorn/no-unsafe-regex\n strNumber.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandSymbol)\n : strNumber;\n}\n","import {TUI_DECIMAL_SYMBOLS} from '@taiga-ui/core/constants';\nimport {TuiNumberFormatSettings} from '@taiga-ui/core/interfaces';\n\nexport function tuiEnableAutoCorrectDecimalSymbol({\n thousandSeparator,\n}: TuiNumberFormatSettings): boolean {\n return !TUI_DECIMAL_SYMBOLS.includes(thousandSeparator);\n}\n","import {CHAR_HYPHEN} from '@taiga-ui/cdk';\n\nexport function maskedMoneyValueIsEmpty(value: string): boolean {\n switch (value) {\n case '':\n case CHAR_HYPHEN:\n case ',':\n case `${CHAR_HYPHEN},`:\n return true;\n default:\n return false;\n }\n}\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\nexport function maskedNumberStringToNumber(\n value: string,\n decimalsSymbol: TuiDecimalSymbol,\n thousandSymbol: string,\n): number {\n return parseFloat(\n value.split(thousandSymbol).join('').split(decimalsSymbol).join('.'),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWA;;;SAGgB,gCAAgC,CAC5C,YAAwB,EACxB,aAAqC,EACrC,cAA4C,EAC5C,WAAqC,EACrC,aAAuB,EACvB,KAAa;IALb,6BAAA,EAAA,gBAAwB;IACxB,8BAAA,EAAA,mBAAqC;IACrC,+BAAA,EAAA,oCAA4C;IAG5C,sBAAA,EAAA,aAAa;IAEb,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IACjD,SAAS,CAAC,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC;;IAGpC,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC;IACvB,IAAM,OAAO,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,WAAW,CAAC,KAAK,KAAK,CAAC;IAElE,IAAI,WAAW,IAAI,OAAO,EAAE;QACxB,WAAW,CAAC,gBAAgB,CAAC,aAAa,EAAE;YACxC,aAAa,GAAG,WAAW,CAAC,cAAc,IAAI,CAAC,CAAC;SACnD,CAAC,CAAC;KACN;IAED,OAAO,UAAC,cAAc,EAAE,MAAM;;QAE1B,IAAI,CAAC,cAAc,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,aAAa,EAAE;YACrE,OAAO,WAAW,CAAC;SACtB;;QAGD,IAAI,WAAW,IAAI,OAAO,IAAI,eAAe,CAAC,WAAW,CAAC,EAAE;YACxD,IAAM,OAAK,GAAG,oBAAoB,CAC9B,MAAM,CAAC,sBAAsB,EAC7B,cAAc,EACd,aAAa,CAChB,CAAC;YAEF,UAAU,CAAC;gBACP,WAAW,CAAC,iBAAiB,C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AAC;AAED,SAAS,aAAa,CAAC,SAAiB;IACpC,OAAO,SAAS;SACX,KAAK,CAAC,EAAE,CAAC;SACT,GAAG,CAAC,UAAA,IAAI,IAAI,QAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,gBAAgB,GAAG,IAAI,IAAC,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,qBAAqB,CAAC,SAAiB,EAAE,cAAsB;IACpE,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC;;;YAGrB,SAAS,CAAC,OAAO,CAAC,uBAAuB,EAAE,cAAc,CAAC;UAC1D,SAAS,CAAC;AACpB;;SChMgB,iCAAiC,CAAC,EAExB;QADtB,wCAAiB;IAEjB,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAC5D;;SCLgB,uBAAuB,CAAC,KAAa;IACjD,QAAQ,KAAK;QACT,KAAK,EAAE,CAAC;QACR,KAAK,WAAW,CAAC;QACjB,KAAK,GAAG,CAAC;QACT,KAAQ,WAAW,MAAG;YAClB,OAAO,IAAI,CAAC;QAChB;YACI,OAAO,KAAK,CAAC;KACpB;AACL;;SCVgB,0BAA0B,CACtC,KAAa,EACb,cAAgC,EAChC,cAAsB;IAEtB,OAAO,UAAU,CACb,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACvE,CAAC;AACN;;ACVA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-utils-mask.js","sources":["ng://@taiga-ui/core/utils/mask/create-auto-corrected-money-pipe.ts","ng://@taiga-ui/core/utils/mask/create-correction-mask.ts","ng://@taiga-ui/core/utils/mask/create-number-mask.ts","ng://@taiga-ui/core/utils/mask/enable-auto-correct-decimal-symbol.ts","ng://@taiga-ui/core/utils/mask/masked-money-value-is-empty.ts","ng://@taiga-ui/core/utils/mask/masked-number-string-to-number.ts","ng://@taiga-ui/core/utils/mask/taiga-ui-core-utils-mask.ts"],"sourcesContent":["import {\n CHAR_HYPHEN,\n CHAR_NO_BREAK_SPACE,\n getDocumentOrShadowRoot,\n isNativeFocused,\n isSafari,\n tuiAssert,\n} from '@taiga-ui/cdk';\nimport {TuiTextMaskPipeHandler} from '@taiga-ui/core/mask';\nimport {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\n/**\n * Used to finish a number with zeros to a given precision\n */\nexport function tuiCreateAutoCorrectedNumberPipe(\n decimalLimit: number = 0,\n decimalSymbol: TuiDecimalSymbol = ',',\n thousandSymbol: string = CHAR_NO_BREAK_SPACE,\n nativeInput?: HTMLInputElement | null,\n allowNegative?: boolean,\n isIOS = false,\n): TuiTextMaskPipeHandler {\n tuiAssert.assert(Number.isInteger(decimalLimit));\n tuiAssert.assert(decimalLimit >= 0);\n\n // Guess for which browser I need this :)\n let previousCaret = -1;\n const unlucky = (!!nativeInput && isSafari(nativeInput)) || isIOS;\n\n if (nativeInput && unlucky) {\n nativeInput.addEventListener('beforeinput', () => {\n previousCaret = nativeInput.selectionStart || 0;\n });\n }\n\n return (conformedValue, config) => {\n // Removing everything by selecting and pressing '-'\n if (!conformedValue && config.rawValue === CHAR_HYPHEN && allowNegative) {\n return CHAR_HYPHEN;\n }\n\n // remove these hacks after text mask library has changed\n if (nativeInput && unlucky && isNativeFocused(nativeInput)) {\n const caret = calculateSafariCaret(\n config.previousConformedValue,\n conformedValue,\n previousCaret,\n );\n\n setTimeout(() => {\n nativeInput.setSelectionRange(caret, caret);\n });\n }\n\n if (\n nativeInput &&\n nativeInput.ownerDocument !== getDocumentOrShadowRoot(nativeInput) &&\n isNativeFocused(nativeInput) &&\n config.currentCaretPosition\n ) {\n const realCaretPosition =\n config.currentCaretPosition +\n calculateCaretGap(\n config.previousConformedValue,\n conformedValue,\n thousandSymbol,\n );\n\n setTimeout(() => {\n nativeInput.setSelectionRange(realCaretPosition, realCaretPosition);\n });\n }\n\n if (conformedValue === '' || !decimalLimit) {\n return {value: conformedValue};\n }\n\n const withDecimalSymbol = addDecimalSymbolIfNeeded(conformedValue, decimalSymbol);\n const decimalPart = withDecimalSymbol.split(decimalSymbol)[1];\n const zeroPaddingSize = decimalLimit - decimalPart.length;\n\n return {\n value: withDecimalSymbol + '0'.repeat(zeroPaddingSize),\n };\n };\n}\n\nfunction addDecimalSymbolIfNeeded(\n value: string,\n decimalSymbol: TuiDecimalSymbol = ',',\n): string {\n return !value.includes(decimalSymbol) ? value + decimalSymbol : value;\n}\n\nfunction calculateSafariCaret(\n previousValue: string = '',\n current: string,\n previousCaret: number,\n decimalSymbol: string = ',',\n): number {\n const tailRegex = new RegExp(`${decimalSymbol}.+`);\n const previousWithoutTail = previousValue.replace(tailRegex, '');\n const currentWithoutTail = current.replace(tailRegex, '');\n\n const pasteOrCutOperation =\n Math.abs(previousWithoutTail.length - currentWithoutTail.length) > 2;\n\n if (pasteOrCutOperation) {\n return current.length;\n }\n\n if (previousValue.length === current.length) {\n if (previousValue.indexOf(decimalSymbol) <= previousCaret) {\n return calculateChangedTailIndex(previousValue, current);\n }\n\n return previousWithoutTail === currentWithoutTail\n ? previousCaret - 1\n : previousCaret + 1;\n }\n\n if (previousValue.length === 0) {\n return 1;\n }\n\n const changeLength = current.length - previousValue.length;\n\n return previousCaret + changeLength;\n}\n\nfunction calculateChangedTailIndex(previous: string, current: string): number {\n for (let i = 0; i < current.length; i++) {\n if (previous[i] !== current[i]) {\n return current[i] === '0' ? i : i + 1;\n }\n }\n\n return current.length;\n}\n\nfunction calculateCaretGap(\n previousValue: string = '',\n current: string,\n thousandSymbol: string,\n): number {\n const pasteOrCutOperation = Math.abs(previousValue.length - current.length) > 2;\n\n if (pasteOrCutOperation) {\n return 0;\n }\n\n const wereSpaces = previousValue.split(thousandSymbol).length;\n const nowSpaces = current.split(thousandSymbol).length;\n\n return nowSpaces - wereSpaces;\n}\n","import {tuiAssert} from '@taiga-ui/cdk';\nimport {MASK_CARET_TRAP} from '@taiga-ui/core/constants';\nimport {\n TuiTextMaskCorrectionHandler,\n TuiTextMaskList,\n TuiTextMaskListHandler,\n} from '@taiga-ui/core/mask';\n\nconst ASSERTION = 'Correction function must return single char or null';\n\nexport function tuiCreateCorrectionMask(\n allowed: RegExp,\n correctionHandler: TuiTextMaskCorrectionHandler,\n): TuiTextMaskListHandler {\n return rawValue => {\n const mask = rawValue.split('').reduce<TuiTextMaskList>((result, char, index) => {\n const corrected = correctionHandler(char, index);\n\n tuiAssert.assert(corrected === null || corrected.length === 1, ASSERTION);\n\n if (!allowed.test(char) && !corrected) {\n return result;\n }\n\n if (allowed.test(char)) {\n return [...result, allowed];\n }\n\n if (corrected) {\n return [...result, corrected, MASK_CARET_TRAP];\n }\n\n return result;\n }, []);\n const lastIndex = mask.lastIndexOf(MASK_CARET_TRAP);\n const filtered = mask.filter(\n (item, index) => item !== MASK_CARET_TRAP || index === lastIndex,\n );\n\n return filtered.some(item => item !== allowed)\n ? [...filtered, allowed]\n : filtered;\n };\n}\n","import {CHAR_EN_DASH, CHAR_HYPHEN, CHAR_NO_BREAK_SPACE, tuiAssert} from '@taiga-ui/cdk';\nimport {\n MASK_CARET_TRAP,\n TUI_DIGIT_REGEXP,\n TUI_LEADING_ZEROES_REGEXP,\n TUI_NON_DIGITS_REGEXP,\n} from '@taiga-ui/core/constants';\nimport {TuiNumberMaskOptions, TuiTextMaskListHandler} from '@taiga-ui/core/mask';\nimport {TuiDecimalSymbol} from '@taiga-ui/core/types';\nimport {otherDecimalSymbol} from '@taiga-ui/core/utils/format';\n\nconst NON_ZERO_DIGIT = /[1-9]/;\n\n/**\n * Adaptation for {@link https://github.com/text-mask/text-mask/tree/master/addons#createnumbermask `createNumberMask`}\n */\nexport function tuiCreateNumberMask({\n allowDecimal = false,\n decimalSymbol = ',',\n thousandSymbol = CHAR_NO_BREAK_SPACE,\n autoCorrectDecimalSymbol = true,\n decimalLimit = 2,\n requireDecimal = false,\n allowNegative = false,\n integerLimit = 0,\n}: TuiNumberMaskOptions = {}): TuiTextMaskListHandler {\n tuiAssert.assert(Number.isInteger(decimalLimit));\n tuiAssert.assert(decimalLimit >= 0);\n tuiAssert.assert(Number.isInteger(integerLimit));\n tuiAssert.assert(integerLimit >= 0);\n\n return (rawValue, {previousConformedValue}) => {\n if (previousConformedValue && requireDecimal) {\n const conformedWithoutSeparator = rawValue.split(thousandSymbol).join('');\n const previousConformedValueWithoutDecimalSymbolAndSeparator =\n previousConformedValue\n .split(thousandSymbol)\n .join('')\n .split(decimalSymbol)\n .join('');\n\n // Forbid removal of decimal separator if decimal part is required\n if (\n conformedWithoutSeparator ===\n previousConformedValueWithoutDecimalSymbolAndSeparator\n ) {\n rawValue = previousConformedValue;\n }\n }\n\n const isNegative =\n (rawValue[0] === CHAR_HYPHEN || rawValue[0] === CHAR_EN_DASH) &&\n allowNegative;\n\n if (\n isDecimalSymbol(rawValue, decimalSymbol, autoCorrectDecimalSymbol) &&\n allowDecimal\n ) {\n return ['0', decimalSymbol, TUI_DIGIT_REGEXP];\n }\n\n if (isNegative) {\n rawValue = rawValue.slice(1);\n }\n\n const decimalIndex = getDecimalSymbolIndex(\n rawValue,\n decimalSymbol,\n autoCorrectDecimalSymbol,\n );\n const hasDecimal = decimalIndex !== -1;\n const integer = hasDecimal ? rawValue.slice(0, decimalIndex) : rawValue;\n const thousandSeparators = integer.match(new RegExp(thousandSymbol, 'g')) || [];\n const integerCapped = integerLimit\n ? integer.slice(0, integerLimit + thousandSeparators.length)\n : integer;\n const integerCappedClean = integerCapped.replace(TUI_NON_DIGITS_REGEXP, '');\n const [leadingZerosMatch] = integerCappedClean.match(\n TUI_LEADING_ZEROES_REGEXP,\n ) || [''];\n const leadingZerosAmount = leadingZerosMatch.length;\n const integerCappedZerosClean = integerCappedClean\n .replace(/^0+(?!\\.|$)/, '')\n .trim();\n const withSeparator = addThousandsSeparator(\n integerCappedZerosClean,\n thousandSymbol,\n );\n const mask = convertToMask(withSeparator);\n\n if ((hasDecimal && allowDecimal) || requireDecimal) {\n const fraction = hasDecimal\n ? convertToMask(\n rawValue.slice(decimalIndex + 1).replace(TUI_NON_DIGITS_REGEXP, ''),\n )\n : [];\n const fractionCapped = decimalLimit\n ? fraction.slice(0, decimalLimit)\n : fraction;\n\n if (rawValue[decimalIndex] !== otherDecimalSymbol(decimalSymbol)) {\n mask.push(MASK_CARET_TRAP);\n }\n\n mask.push(decimalSymbol, MASK_CARET_TRAP, ...fractionCapped);\n\n for (let i = 0; i < decimalLimit - fractionCapped.length; i++) {\n mask.push(TUI_DIGIT_REGEXP);\n }\n }\n\n const isOnlyZeroDigit = mask.length === 1 && integerCappedZerosClean === '0';\n\n if (isNegative) {\n if (mask.length === 0) {\n mask.push(TUI_DIGIT_REGEXP);\n }\n\n mask.unshift(CHAR_HYPHEN);\n }\n\n return preventLeadingZeroes(mask, isOnlyZeroDigit, leadingZerosAmount);\n };\n}\n\nfunction preventLeadingZeroes(\n mask: Array<string | RegExp>,\n isOnlyZeroDigit: boolean = false,\n leadingZerosAmount: number = 0,\n): Array<string | RegExp> {\n if (isOnlyZeroDigit || leadingZerosAmount === 0) {\n return mask;\n }\n\n const firstDigitIndex = mask.indexOf(TUI_DIGIT_REGEXP);\n\n if (firstDigitIndex === -1) {\n return mask;\n }\n\n const secondMaskDigit = mask[firstDigitIndex + 1];\n const isCaretTrap = secondMaskDigit === MASK_CARET_TRAP;\n\n if (isCaretTrap && leadingZerosAmount === 1) {\n return mask;\n } else if (isCaretTrap) {\n mask.unshift(NON_ZERO_DIGIT);\n\n return mask;\n }\n\n mask[firstDigitIndex] = NON_ZERO_DIGIT;\n\n return mask;\n}\n\nfunction getDecimalSymbolIndex(\n str: string,\n decimalSymbol: TuiDecimalSymbol,\n autoCorrectDecimalSymbol: boolean,\n): number {\n if (!autoCorrectDecimalSymbol) {\n return str.lastIndexOf(decimalSymbol);\n }\n\n return Math.max(\n str.lastIndexOf(decimalSymbol),\n str.lastIndexOf(otherDecimalSymbol(decimalSymbol)),\n );\n}\n\nfunction isDecimalSymbol(\n str: string,\n decimalSymbol: TuiDecimalSymbol,\n autoCorrectDecimalSymbol: boolean,\n): boolean {\n if (autoCorrectDecimalSymbol) {\n return /^[,.]$/.test(str);\n }\n\n return str === decimalSymbol;\n}\n\nfunction convertToMask(strNumber: string): Array<string | RegExp> {\n return strNumber\n .split('')\n .map(char => (TUI_DIGIT_REGEXP.test(char) ? TUI_DIGIT_REGEXP : char));\n}\n\nfunction addThousandsSeparator(strNumber: string, thousandSymbol: string): string {\n return strNumber.length > 3\n ? // TODO: investigate to disallow potentially catastrophic exponential-time regular expressions.\n // eslint-disable-next-line unicorn/no-unsafe-regex\n strNumber.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandSymbol)\n : strNumber;\n}\n","import {TUI_DECIMAL_SYMBOLS} from '@taiga-ui/core/constants';\nimport {TuiNumberFormatSettings} from '@taiga-ui/core/interfaces';\n\nexport function tuiEnableAutoCorrectDecimalSymbol({\n thousandSeparator,\n}: TuiNumberFormatSettings): boolean {\n return !TUI_DECIMAL_SYMBOLS.includes(thousandSeparator);\n}\n","import {CHAR_HYPHEN} from '@taiga-ui/cdk';\n\n/**\n * @deprecated: use {@link tuiMaskedMoneyValueIsEmpty} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function maskedMoneyValueIsEmpty(value: string): boolean {\n switch (value) {\n case '':\n case CHAR_HYPHEN:\n case ',':\n case `${CHAR_HYPHEN},`:\n return true;\n default:\n return false;\n }\n}\n\nexport const tuiMaskedMoneyValueIsEmpty = maskedMoneyValueIsEmpty;\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\n/**\n * @deprecated: use {@link tuiMaskedNumberStringToNumber} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function maskedNumberStringToNumber(\n value: string,\n decimalsSymbol: TuiDecimalSymbol,\n thousandSymbol: string,\n): number {\n return parseFloat(\n value.split(thousandSymbol).join('').split(decimalsSymbol).join('.'),\n );\n}\n\nexport const tuiMaskedNumberStringToNumber = maskedNumberStringToNumber;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWA;;;SAGgB,gCAAgC,CAC5C,YAAwB,EACxB,aAAqC,EACrC,cAA4C,EAC5C,WAAqC,EACrC,aAAuB,EACvB,KAAa;IALb,6BAAA,EAAA,gBAAwB;IACxB,8BAAA,EAAA,mBAAqC;IACrC,+BAAA,EAAA,oCAA4C;IAG5C,sBAAA,EAAA,aAAa;IAEb,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IACjD,SAAS,CAAC,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC;;IAGpC,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC;IACvB,IAAM,OAAO,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,WAAW,CAAC,KAAK,KAAK,CAAC;IAElE,IAAI,WAAW,IAAI,OAAO,EAAE;QACxB,WAAW,CAAC,gBAAgB,CAAC,aAAa,EAAE;YACxC,aAAa,GAAG,WAAW,CAAC,cAAc,IAAI,CAAC,CAAC;SACnD,CAAC,CAAC;KACN;IAED,OAAO,UAAC,cAAc,EAAE,MAAM;;QAE1B,IAAI,CAAC,cAAc,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,aAAa,EAAE;YACrE,OAAO,WAAW,CAAC;SACtB;;QAGD,IAAI,WAAW,IAAI,OAAO,IAAI,eAAe,CAAC,WAAW,CAAC,EAAE;YACxD,IAAM,OAAK,GAAG,oBAAoB,CAC9B,MAAM,CAAC,sBAAsB,EAC7B,cAAc,EACd,aAAa,CAChB,CAAC;YAEF,UAAU,CAAC;gBACP,WAAW,CAAC,iBAAiB,CAAC,OAAK,EAAE,OAAK,CAAC,CAAC;aAC/C,CAAC,CAAC;SACN;QAED,IACI,WAAW;YACX,WAAW,CAAC,aAAa,KAAK,uBAAuB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IAAI,QAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,gBAAgB,GAAG,IAAI,IAAC,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,qBAAqB,CAAC,SAAiB,EAAE,cAAsB;IACpE,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC;;;YAGrB,SAAS,CAAC,OAAO,CAAC,uBAAuB,EAAE,cAAc,CAAC;UAC1D,SAAS,CAAC;AACpB;;SChMgB,iCAAiC,CAAC,EAExB;QADtB,wCAAiB;IAEjB,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAC5D;;ACLA;;;AAGA;SACgB,uBAAuB,CAAC,KAAa;IACjD,QAAQ,KAAK;QACT,KAAK,EAAE,CAAC;QACR,KAAK,WAAW,CAAC;QACjB,KAAK,GAAG,CAAC;QACT,KAAQ,WAAW,MAAG;YAClB,OAAO,IAAI,CAAC;QAChB;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC;IAEY,0BAA0B,GAAG;;AChB1C;;;AAGA;SACgB,0BAA0B,CACtC,KAAa,EACb,cAAgC,EAChC,cAAsB;IAEtB,OAAO,UAAU,CACb,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACvE,CAAC;AACN,CAAC;IAEY,6BAA6B,GAAG;;AChB7C;;;;;;"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { DEFAULT_ICONS_PATH, tuiEditingKeys } from '@taiga-ui/core/constants';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated has been deleted in 3.0, please use CSS variables
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4
7
|
function colorFallback(color) {
|
|
5
8
|
switch (color) {
|
|
6
9
|
case 'secondary':
|
|
@@ -16,6 +19,10 @@ function colorFallback(color) {
|
|
|
16
19
|
|
|
17
20
|
var ITEM_SIZE = 1.5;
|
|
18
21
|
var CONTENT_SIZE = 2.5;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated: use {@link tuiGetBorder} instead
|
|
24
|
+
*/
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
19
26
|
function getBorder(hasIcon, hasCleaner, hasTooltip, hasContent) {
|
|
20
27
|
if (hasCleaner === void 0) { hasCleaner = false; }
|
|
21
28
|
if (hasTooltip === void 0) { hasTooltip = false; }
|
|
@@ -35,7 +42,12 @@ function getBorder(hasIcon, hasCleaner, hasTooltip, hasContent) {
|
|
|
35
42
|
}
|
|
36
43
|
return border;
|
|
37
44
|
}
|
|
45
|
+
var tuiGetBorder = getBorder;
|
|
38
46
|
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated: use {@link tuiIconsPathFactory} instead
|
|
49
|
+
*/
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
39
51
|
function iconsPathFactory(staticPath) {
|
|
40
52
|
var base = staticPath[staticPath.length - 1] === '/' ? staticPath : staticPath + "/";
|
|
41
53
|
return function (name) {
|
|
@@ -45,34 +57,46 @@ function iconsPathFactory(staticPath) {
|
|
|
45
57
|
return DEFAULT_ICONS_PATH(name);
|
|
46
58
|
};
|
|
47
59
|
}
|
|
60
|
+
var tuiIconsPathFactory = iconsPathFactory;
|
|
48
61
|
|
|
49
62
|
/**
|
|
63
|
+
* @deprecated: use {@link tuiIsEditingKey} instead
|
|
50
64
|
* Check if pressed key is interactive in terms of input field
|
|
51
65
|
*/
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
52
67
|
function isEditingKey(key) {
|
|
53
68
|
return key.length === 1 || tuiEditingKeys.includes(key);
|
|
54
69
|
}
|
|
70
|
+
var tuiIsEditingKey = isEditingKey;
|
|
55
71
|
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated: use {@link tuiIsPresumedHTMLString} instead
|
|
74
|
+
*/
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
56
76
|
function isPresumedHTMLString(candidate) {
|
|
57
77
|
var trimmed = candidate.trim();
|
|
58
78
|
return trimmed.startsWith('<') && trimmed.endsWith('>');
|
|
59
79
|
}
|
|
80
|
+
var tuiIsPresumedHTMLString = isPresumedHTMLString;
|
|
60
81
|
|
|
61
82
|
var SIZES = ['xs', 's', 'm', 'l', 'xl', 'xxl'];
|
|
62
83
|
/**
|
|
84
|
+
* @deprecated: use {@link tuiSizeBigger} instead
|
|
63
85
|
* Compares size constants to determine if first size is bigger than the second
|
|
64
86
|
*
|
|
65
87
|
* @param size size that we need to compare
|
|
66
88
|
* @param biggerThanSize size to compare with, 's' by default
|
|
67
89
|
*/
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
68
91
|
function sizeBigger(size, biggerThanSize) {
|
|
69
92
|
if (biggerThanSize === void 0) { biggerThanSize = 's'; }
|
|
70
93
|
return SIZES.indexOf(size) > SIZES.indexOf(biggerThanSize);
|
|
71
94
|
}
|
|
95
|
+
var tuiSizeBigger = sizeBigger;
|
|
72
96
|
|
|
73
97
|
/**
|
|
74
98
|
* Generated bundle index. Do not edit.
|
|
75
99
|
*/
|
|
76
100
|
|
|
77
|
-
export { colorFallback, getBorder, iconsPathFactory, isEditingKey, isPresumedHTMLString, sizeBigger };
|
|
101
|
+
export { colorFallback, getBorder, iconsPathFactory, isEditingKey, isPresumedHTMLString, sizeBigger, tuiGetBorder, tuiIconsPathFactory, tuiIsEditingKey, tuiIsPresumedHTMLString, tuiSizeBigger };
|
|
78
102
|
//# sourceMappingURL=taiga-ui-core-utils-miscellaneous.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-utils-miscellaneous.js","sources":["ng://@taiga-ui/core/utils/miscellaneous/color-fallback.ts","ng://@taiga-ui/core/utils/miscellaneous/get-border.ts","ng://@taiga-ui/core/utils/miscellaneous/icons-path-factory.ts","ng://@taiga-ui/core/utils/miscellaneous/is-editing-key.ts","ng://@taiga-ui/core/utils/miscellaneous/is-presumed-html-string.ts","ng://@taiga-ui/core/utils/miscellaneous/size-bigger.ts","ng://@taiga-ui/core/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-utils-miscellaneous.js","sources":["ng://@taiga-ui/core/utils/miscellaneous/color-fallback.ts","ng://@taiga-ui/core/utils/miscellaneous/get-border.ts","ng://@taiga-ui/core/utils/miscellaneous/icons-path-factory.ts","ng://@taiga-ui/core/utils/miscellaneous/is-editing-key.ts","ng://@taiga-ui/core/utils/miscellaneous/is-presumed-html-string.ts","ng://@taiga-ui/core/utils/miscellaneous/size-bigger.ts","ng://@taiga-ui/core/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.ts"],"sourcesContent":["/**\n * @deprecated has been deleted in 3.0, please use CSS variables\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function colorFallback(color: string | null): string {\n switch (color) {\n case 'secondary':\n return 'var(--tui-info-fill)';\n case 'error':\n return 'var(--tui-error-fill)';\n case 'success':\n return 'var(--tui-success-fill)';\n default:\n return `var(--tui-${color || 'base-05'})`;\n }\n}\n","const ITEM_SIZE = 1.5;\nconst CONTENT_SIZE = 2.5;\n\n/**\n * @deprecated: use {@link tuiGetBorder} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getBorder(\n hasIcon: boolean,\n hasCleaner: boolean = false,\n hasTooltip: boolean = false,\n hasContent: boolean = false,\n): number {\n let border = 0;\n\n if (hasIcon) {\n border += ITEM_SIZE;\n }\n\n if (hasCleaner) {\n border += ITEM_SIZE;\n }\n\n if (hasTooltip) {\n border += ITEM_SIZE;\n }\n\n if (hasContent) {\n border += CONTENT_SIZE;\n }\n\n return border;\n}\n\nexport const tuiGetBorder = getBorder;\n","import {TuiStringHandler} from '@taiga-ui/cdk';\nimport {DEFAULT_ICONS_PATH} from '@taiga-ui/core/constants';\n\n/**\n * @deprecated: use {@link tuiIconsPathFactory} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function iconsPathFactory(staticPath: string): TuiStringHandler<string> {\n const base =\n staticPath[staticPath.length - 1] === '/' ? staticPath : `${staticPath}/`;\n\n return name => {\n if (name.startsWith('tuiIcon')) {\n return `${base}${name}.svg#${name}`;\n }\n\n return DEFAULT_ICONS_PATH(name);\n };\n}\n\nexport const tuiIconsPathFactory = iconsPathFactory;\n","import {tuiEditingKeys} from '@taiga-ui/core/constants';\n\n/**\n * @deprecated: use {@link tuiIsEditingKey} instead\n * Check if pressed key is interactive in terms of input field\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isEditingKey(key: string): boolean {\n return key.length === 1 || tuiEditingKeys.includes(key);\n}\n\nexport const tuiIsEditingKey = isEditingKey;\n","/**\n * @deprecated: use {@link tuiIsPresumedHTMLString} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isPresumedHTMLString(candidate: string): boolean {\n const trimmed = candidate.trim();\n\n return trimmed.startsWith('<') && trimmed.endsWith('>');\n}\n\nexport const tuiIsPresumedHTMLString = isPresumedHTMLString;\n","import {TuiSizeXS, TuiSizeXXL} from '@taiga-ui/core/types';\n\nconst SIZES: ReadonlyArray<TuiSizeXS | TuiSizeXXL> = ['xs', 's', 'm', 'l', 'xl', 'xxl'];\n\n/**\n * @deprecated: use {@link tuiSizeBigger} instead\n * Compares size constants to determine if first size is bigger than the second\n *\n * @param size size that we need to compare\n * @param biggerThanSize size to compare with, 's' by default\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function sizeBigger(\n size: TuiSizeXS | TuiSizeXXL,\n biggerThanSize: TuiSizeXS | TuiSizeXXL = 's',\n): boolean {\n return SIZES.indexOf(size) > SIZES.indexOf(biggerThanSize);\n}\n\nexport const tuiSizeBigger = sizeBigger;\n","/**\n *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C,CAAC;AACN,CAAC;IAEY,mBAAmB,GAAG;;AClBnC;;;;AAIA;SACgB,YAAY,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC5D,CAAC;IAEY,eAAe,GAAG;;ACX/B;;;AAGA;SACgB,oBAAoB,CAAC,SAAiB;IAClD,IAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;IAEjC,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC5D,CAAC;IAEY,uBAAuB,GAAG;;ACRvC,IAAM,KAAK,GAA0C,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAExF;;;;;;;AAOA;SACgB,UAAU,CACtB,IAA4B,EAC5B,cAA4C;IAA5C,+BAAA,EAAA,oBAA4C;IAE5C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AAC/D,CAAC;IAEY,aAAa,GAAG;;ACnB7B;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-utils-mobile.js","sources":["ng://@taiga-ui/core/utils/mobile/is-mobile.ts","ng://@taiga-ui/core/utils/mobile/taiga-ui-core-utils-mobile.ts"],"sourcesContent":["import {TuiMedia} from '@taiga-ui/core/interfaces';\nimport {tuiGetViewportWidth} from '@taiga-ui/core/utils/dom';\n\nexport function tuiIsMobile(windowRef: Window, {mobile}: TuiMedia): boolean {\n return tuiGetViewportWidth(windowRef)
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-utils-mobile.js","sources":["ng://@taiga-ui/core/utils/mobile/is-mobile.ts","ng://@taiga-ui/core/utils/mobile/taiga-ui-core-utils-mobile.ts"],"sourcesContent":["import {TuiMedia} from '@taiga-ui/core/interfaces';\nimport {tuiGetViewportWidth} from '@taiga-ui/core/utils/dom';\n\nexport function tuiIsMobile(windowRef: Window, {mobile}: TuiMedia): boolean {\n return tuiGetViewportWidth(windowRef) < mobile;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;SAGgB,WAAW,CAAC,SAAiB,EAAE,EAAkB;QAAjB,kBAAM;IAClD,OAAO,mBAAmB,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;AACnD;;ACLA;;;;;;"}
|
|
@@ -4,6 +4,7 @@ import { TuiXmlParsingException } from '@taiga-ui/cdk';
|
|
|
4
4
|
* @deprecated
|
|
5
5
|
* TODO: remove in v3.0
|
|
6
6
|
*/
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
8
|
function innerHTML(documentRef) {
|
|
8
9
|
var svg = documentRef.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
9
10
|
if (svg.innerHTML !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-utils-polyfills.js","sources":["ng://@taiga-ui/core/utils/polyfills/inner-html.ts","ng://@taiga-ui/core/utils/polyfills/taiga-ui-core-utils-polyfills.ts"],"sourcesContent":["import {TuiXmlParsingException} from '@taiga-ui/cdk';\n\n/**\n * @deprecated\n * TODO: remove in v3.0\n */\nexport function innerHTML(documentRef: Document): void {\n const svg = documentRef.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n if (svg.innerHTML !== undefined) {\n return;\n }\n\n const serializer = new XMLSerializer();\n const parser = new DOMParser();\n\n Object.defineProperty(SVGElement.prototype, 'innerHTML', {\n get: function (this: SVGElement): string {\n const result: string[] = [];\n let childNode: any = this.firstChild;\n\n while (childNode) {\n result.push(serializer.serializeToString(childNode));\n childNode = childNode.nextSibling;\n }\n\n return result.join('');\n },\n set: function (this: SVGElement, text: string) {\n while (this.firstChild) {\n this.removeChild(this.firstChild);\n }\n\n try {\n const svgDocElement = parser.parseFromString(\n text,\n 'image/svg+xml',\n ).documentElement;\n\n if (this.ownerDocument) {\n this.appendChild(this.ownerDocument.importNode(svgDocElement, true));\n }\n } catch (e) {\n throw new TuiXmlParsingException();\n }\n },\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA;;;;
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-utils-polyfills.js","sources":["ng://@taiga-ui/core/utils/polyfills/inner-html.ts","ng://@taiga-ui/core/utils/polyfills/taiga-ui-core-utils-polyfills.ts"],"sourcesContent":["import {TuiXmlParsingException} from '@taiga-ui/cdk';\n\n/**\n * @deprecated\n * TODO: remove in v3.0\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function innerHTML(documentRef: Document): void {\n const svg = documentRef.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n if (svg.innerHTML !== undefined) {\n return;\n }\n\n const serializer = new XMLSerializer();\n const parser = new DOMParser();\n\n Object.defineProperty(SVGElement.prototype, 'innerHTML', {\n get: function (this: SVGElement): string {\n const result: string[] = [];\n let childNode: any = this.firstChild;\n\n while (childNode) {\n result.push(serializer.serializeToString(childNode));\n childNode = childNode.nextSibling;\n }\n\n return result.join('');\n },\n set: function (this: SVGElement, text: string) {\n while (this.firstChild) {\n this.removeChild(this.firstChild);\n }\n\n try {\n const svgDocElement = parser.parseFromString(\n text,\n 'image/svg+xml',\n ).documentElement;\n\n if (this.ownerDocument) {\n this.appendChild(this.ownerDocument.importNode(svgDocElement, true));\n }\n } catch (e) {\n throw new TuiXmlParsingException();\n }\n },\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA;;;;AAIA;SACgB,SAAS,CAAC,WAAqB;IAC3C,IAAM,GAAG,GAAG,WAAW,CAAC,eAAe,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;IAE7E,IAAI,GAAG,CAAC,SAAS,KAAK,SAAS,EAAE;QAC7B,OAAO;KACV;IAED,IAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;IACvC,IAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;IAE/B,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE;QACrD,GAAG,EAAE;YACD,IAAM,MAAM,GAAa,EAAE,CAAC;YAC5B,IAAI,SAAS,GAAQ,IAAI,CAAC,UAAU,CAAC;YAErC,OAAO,SAAS,EAAE;gBACd,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;gBACrD,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC;aACrC;YAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC1B;QACD,GAAG,EAAE,UAA4B,IAAY;YACzC,OAAO,IAAI,CAAC,UAAU,EAAE;gBACpB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aACrC;YAED,IAAI;gBACA,IAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CACxC,IAAI,EACJ,eAAe,CAClB,CAAC,eAAe,CAAC;gBAElB,IAAI,IAAI,CAAC,aAAa,EAAE;oBACpB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;iBACxE;aACJ;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,sBAAsB,EAAE,CAAC;aACtC;SACJ;KACJ,CAAC,CAAC;AACP;;AChDA;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TuiActiveZoneDirective } from '@taiga-ui/cdk';
|
|
2
|
+
import { PolymorpheusComponent } from '@tinkoff/ng-polymorpheus';
|
|
3
|
+
export interface TuiHint {
|
|
4
|
+
readonly id: string | null;
|
|
5
|
+
readonly component: PolymorpheusComponent<object, object>;
|
|
6
|
+
readonly activeZone: TuiActiveZoneDirective | null;
|
|
7
|
+
}
|
package/interfaces/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './data-list-host';
|
|
|
5
5
|
export * from './dialog-context';
|
|
6
6
|
export * from './dialog-options';
|
|
7
7
|
export * from './dropdown-directive';
|
|
8
|
+
export * from './hint';
|
|
8
9
|
export * from './icon-error';
|
|
9
10
|
export * from './media';
|
|
10
11
|
export * from './notification-options';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"TuiAlertAutoClose":{"__symbolic":"interface"},"TuiAlertOptions":{"__symbolic":"interface"},"TuiAnimationOptions":{"__symbolic":"interface"},"TuiDataListAccessor":{"__symbolic":"interface"},"TuiDataListHost":{"__symbolic":"interface"},"TuiDialogContext":{"__symbolic":"interface"},"TuiDialogOptions":{"__symbolic":"interface"},"TuiDropdown":{"__symbolic":"interface"},"TuiIconError":{"__symbolic":"interface"},"TuiMedia":{"__symbolic":"interface"},"TuiNotificationAutoClose":{"__symbolic":"interface"},"TuiNotificationOptions":{"__symbolic":"interface"},"TuiNotificationOptionsWithData":{"__symbolic":"interface"},"TuiNumberFormatSettings":{"__symbolic":"interface"},"NumberFormatSettings":{"__symbolic":"interface"},"TuiTextfieldHost":{"__symbolic":"interface"},"TuiValueContentContext":{"__symbolic":"interface"},"TuiWithOptionalMinMax":{"__symbolic":"interface"},"TuiWithOptionalMinMaxWithValue":{"__symbolic":"interface"}},"origins":{"TuiAlertAutoClose":"./alert-options","TuiAlertOptions":"./alert-options","TuiAnimationOptions":"./animation-options","TuiDataListAccessor":"./data-list-accessor","TuiDataListHost":"./data-list-host","TuiDialogContext":"./dialog-context","TuiDialogOptions":"./dialog-options","TuiDropdown":"./dropdown-directive","TuiIconError":"./icon-error","TuiMedia":"./media","TuiNotificationAutoClose":"./notification-options","TuiNotificationOptions":"./notification-options","TuiNotificationOptionsWithData":"./notification-options","TuiNumberFormatSettings":"./number-format-settings","NumberFormatSettings":"./number-format-settings","TuiTextfieldHost":"./textfield-host","TuiValueContentContext":"./value-content-context","TuiWithOptionalMinMax":"./with-optional-min-max","TuiWithOptionalMinMaxWithValue":"./with-optional-min-max"},"importAs":"@taiga-ui/core/interfaces"}
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"TuiAlertAutoClose":{"__symbolic":"interface"},"TuiAlertOptions":{"__symbolic":"interface"},"TuiAnimationOptions":{"__symbolic":"interface"},"TuiDataListAccessor":{"__symbolic":"interface"},"TuiDataListHost":{"__symbolic":"interface"},"TuiDialogContext":{"__symbolic":"interface"},"TuiDialogOptions":{"__symbolic":"interface"},"TuiDropdown":{"__symbolic":"interface"},"TuiHint":{"__symbolic":"interface"},"TuiIconError":{"__symbolic":"interface"},"TuiMedia":{"__symbolic":"interface"},"TuiNotificationAutoClose":{"__symbolic":"interface"},"TuiNotificationOptions":{"__symbolic":"interface"},"TuiNotificationOptionsWithData":{"__symbolic":"interface"},"TuiNumberFormatSettings":{"__symbolic":"interface"},"NumberFormatSettings":{"__symbolic":"interface"},"TuiTextfieldHost":{"__symbolic":"interface"},"TuiValueContentContext":{"__symbolic":"interface"},"TuiWithOptionalMinMax":{"__symbolic":"interface"},"TuiWithOptionalMinMaxWithValue":{"__symbolic":"interface"}},"origins":{"TuiAlertAutoClose":"./alert-options","TuiAlertOptions":"./alert-options","TuiAnimationOptions":"./animation-options","TuiDataListAccessor":"./data-list-accessor","TuiDataListHost":"./data-list-host","TuiDialogContext":"./dialog-context","TuiDialogOptions":"./dialog-options","TuiDropdown":"./dropdown-directive","TuiHint":"./hint","TuiIconError":"./icon-error","TuiMedia":"./media","TuiNotificationAutoClose":"./notification-options","TuiNotificationOptions":"./notification-options","TuiNotificationOptionsWithData":"./notification-options","TuiNumberFormatSettings":"./number-format-settings","NumberFormatSettings":"./number-format-settings","TuiTextfieldHost":"./textfield-host","TuiValueContentContext":"./value-content-context","TuiWithOptionalMinMax":"./with-optional-min-max","TuiWithOptionalMinMaxWithValue":"./with-optional-min-max"},"importAs":"@taiga-ui/core/interfaces"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { Observable, OperatorFunction } from 'rxjs';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated: use {@link tuiSmartSearch} instead
|
|
4
|
+
*/
|
|
5
|
+
export declare function smartSearch<T>(getSearchFunction: (search: string) => Observable<readonly T[] | readonly T[][]>, searchDebounceTimeMs?: number): OperatorFunction<string, readonly T[] | readonly T[][] | null>;
|
|
6
|
+
export declare const tuiSmartSearch: typeof smartSearch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"smartSearch":{"__symbolic":"function","parameters":["getSearchFunction","
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"smartSearch":{"__symbolic":"function","parameters":["getSearchFunction","searchDebounceTimeMs"],"defaults":[null,400],"value":{"__symbolic":"error","message":"Lambda not supported","line":18,"character":11,"module":"./smart-search"}},"tuiSmartSearch":{"__symbolic":"reference","name":"smartSearch"},"tuiZonefulMap":{"__symbolic":"function","parameters":["project","ngZone"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs","name":"pipe","line":16,"character":11},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"map","line":16,"character":16},"arguments":[{"__symbolic":"reference","name":"project"}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"distinctUntilChanged","line":16,"character":30}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"tuiZonefull","line":16,"character":54},"arguments":[{"__symbolic":"reference","name":"ngZone"}]}]}}},"origins":{"smartSearch":"./smart-search","tuiSmartSearch":"./smart-search","tuiZonefulMap":"./zoneful-map"},"importAs":"@taiga-ui/core/observables"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.53.0",
|
|
4
4
|
"description": "Core library for creating Angular components and applications using Taiga UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"repository": "https://github.com/tinkoff/taiga-ui",
|
|
16
16
|
"license": "Apache-2.0",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@taiga-ui/i18n": "^2.
|
|
18
|
+
"@taiga-ui/i18n": "^2.53.0",
|
|
19
19
|
"tslib": "^1.10.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"@angular/router": ">=9.0.0",
|
|
28
28
|
"@ng-web-apis/common": ">=1.12.1 < 2",
|
|
29
29
|
"@ng-web-apis/mutation-observer": ">=1.1.0",
|
|
30
|
-
"@taiga-ui/cdk": ">=2.
|
|
31
|
-
"@taiga-ui/i18n": ">=2.
|
|
30
|
+
"@taiga-ui/cdk": ">=2.53.0",
|
|
31
|
+
"@taiga-ui/i18n": ">=2.53.0",
|
|
32
32
|
"@tinkoff/ng-event-plugins": ">=2.3.2",
|
|
33
33
|
"@tinkoff/ng-polymorpheus": ">=3.1.12 < 4",
|
|
34
34
|
"rxjs": ">=6.0.0"
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ElementRef, Provider } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated: use {@link tuiIsMobileResFactory} instead
|
|
5
|
+
*/
|
|
3
6
|
export declare function isMobileResFactory(mobile$: Observable<boolean>, { nativeElement }: ElementRef): Observable<boolean>;
|
|
4
7
|
export declare const TUI_IS_MOBILE_RES_PROVIDER: Provider;
|
|
8
|
+
export declare const tuiIsMobileResFactory: typeof isMobileResFactory;
|
|
@@ -2,5 +2,9 @@ import { ElementRef, Provider } from '@angular/core';
|
|
|
2
2
|
import { TuiModeDirective } from '@taiga-ui/core/directives/mode';
|
|
3
3
|
import { TuiBrightness } from '@taiga-ui/core/types';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated: use {@link tuiModeFactory} instead
|
|
7
|
+
*/
|
|
5
8
|
export declare function modeFactory(mode: TuiModeDirective | null, { nativeElement }: ElementRef): Observable<TuiBrightness | null>;
|
|
6
9
|
export declare const MODE_PROVIDER: Provider;
|
|
10
|
+
export declare const tuiModeFactory: typeof modeFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"isMobileResFactory":{"__symbolic":"function"},"TUI_IS_MOBILE_RES_PROVIDER":{"provide":{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_IS_MOBILE_RES","line":
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"isMobileResFactory":{"__symbolic":"function"},"TUI_IS_MOBILE_RES_PROVIDER":{"provide":{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_IS_MOBILE_RES","line":18,"character":13},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":19,"character":16}},{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_IS_MOBILE_RES","line":19,"character":28}],{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":19,"character":48}],"useFactory":{"__symbolic":"reference","name":"isMobileResFactory"}},"tuiIsMobileResFactory":{"__symbolic":"reference","name":"isMobileResFactory"},"modeFactory":{"__symbolic":"function"},"MODE_PROVIDER":{"provide":{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_MODE","line":28,"character":13},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":29,"character":16}},{"__symbolic":"reference","module":"@taiga-ui/core/directives/mode","name":"TuiModeDirective","line":29,"character":28}],{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":29,"character":47}],"useFactory":{"__symbolic":"reference","name":"modeFactory"}},"tuiModeFactory":{"__symbolic":"reference","name":"modeFactory"},"watchedControllerFactory":{"__symbolic":"function"},"tuiWatchedControllerFactory":{"__symbolic":"reference","name":"watchedControllerFactory"}},"origins":{"isMobileResFactory":"./is-mobile-resolution.provider","TUI_IS_MOBILE_RES_PROVIDER":"./is-mobile-resolution.provider","tuiIsMobileResFactory":"./is-mobile-resolution.provider","modeFactory":"./mode.provider","MODE_PROVIDER":"./mode.provider","tuiModeFactory":"./mode.provider","watchedControllerFactory":"./watched-controller-provider-factory","tuiWatchedControllerFactory":"./watched-controller-provider-factory"},"importAs":"@taiga-ui/core/providers"}
|