@taiga-ui/core 2.35.0 → 2.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstract/abstract-dropdown.d.ts +3 -3
- package/abstract/abstract-hint.d.ts +1 -1
- package/abstract/taiga-ui-core-abstract.metadata.json +1 -1
- package/bundles/taiga-ui-core-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-core-abstract.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-button.umd.js +3 -3
- package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-button.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-button.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.js +2 -19
- package/bundles/taiga-ui-core-components-dialog.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.min.js +2 -2
- package/bundles/taiga-ui-core-components-dialog.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.js +3 -6
- package/bundles/taiga-ui-core-components-dropdown-box.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-group.umd.js +23 -4
- package/bundles/taiga-ui-core-components-group.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-group.umd.min.js +2 -2
- package/bundles/taiga-ui-core-components-group.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js +1 -4
- 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-loader.umd.js +27 -7
- package/bundles/taiga-ui-core-components-loader.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-loader.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-loader.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-notification.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-notification.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +4 -5
- 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-primitive-year-picker.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-year-picker.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.js +3 -3
- package/bundles/taiga-ui-core-components-root.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-root.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.js +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.min.js +2 -2
- package/bundles/taiga-ui-core-components-tooltip.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-constants.umd.js +1 -1
- package/bundles/taiga-ui-core-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-core-constants.umd.min.js +1 -1
- package/bundles/taiga-ui-core-constants.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-modules-notifications.umd.js +4 -6
- package/bundles/taiga-ui-core-modules-notifications.umd.js.map +1 -1
- package/bundles/taiga-ui-core-modules-notifications.umd.min.js +1 -1
- package/bundles/taiga-ui-core-modules-notifications.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-tokens.umd.js +8 -0
- package/bundles/taiga-ui-core-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-core-tokens.umd.min.js +2 -2
- package/bundles/taiga-ui-core-tokens.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-utils-dom.umd.js +1 -1
- package/bundles/taiga-ui-core-utils-dom.umd.js.map +1 -1
- package/bundles/taiga-ui-core-utils-dom.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-utils-format.umd.js +1 -1
- package/bundles/taiga-ui-core-utils-format.umd.js.map +1 -1
- package/bundles/taiga-ui-core-utils-format.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-utils-mask.umd.js +7 -2
- 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 +2 -2
- 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/components/button/button-options.d.ts +1 -1
- package/components/button/taiga-ui-core-components-button.metadata.json +1 -1
- package/components/dialog/dialog.component.d.ts +0 -1
- package/components/dialog/taiga-ui-core-components-dialog.metadata.json +1 -1
- package/components/dropdown-box/dropdown-box.component.d.ts +2 -3
- package/components/dropdown-box/taiga-ui-core-components-dropdown-box.metadata.json +1 -1
- package/components/expand/expand.component.d.ts +2 -1
- package/components/expand/taiga-ui-core-components-expand.metadata.json +1 -1
- package/components/group/group-styles.component.d.ts +2 -0
- package/components/group/group.directive.d.ts +2 -0
- package/components/group/index.d.ts +1 -0
- package/components/group/taiga-ui-core-components-group.metadata.json +1 -1
- package/components/hosted-dropdown/hosted-dropdown.component.d.ts +2 -3
- package/components/hosted-dropdown/taiga-ui-core-components-hosted-dropdown.metadata.json +1 -1
- package/components/loader/index.d.ts +1 -0
- package/components/loader/loader-options.d.ts +11 -0
- package/components/loader/loader.component.d.ts +4 -3
- package/components/loader/taiga-ui-core-components-loader.metadata.json +1 -1
- package/components/notification/notification.component.d.ts +3 -3
- package/components/notification/taiga-ui-core-components-notification.metadata.json +1 -1
- package/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.metadata.json +1 -1
- package/components/primitive-year-picker/primitive-year-picker.component.d.ts +3 -3
- package/components/root/root.component.d.ts +3 -4
- package/components/root/taiga-ui-core-components-root.metadata.json +1 -1
- package/components/tooltip/tooltip.component.d.ts +1 -1
- package/constants/taiga-ui-core-constants.metadata.json +1 -1
- package/constants/version.d.ts +1 -1
- package/esm2015/abstract/abstract-dropdown.js +2 -2
- package/esm2015/abstract/abstract-hint.js +1 -1
- package/esm2015/components/button/button-options.js +1 -1
- package/esm2015/components/button/button.component.js +4 -4
- package/esm2015/components/dialog/dialog.component.js +3 -16
- package/esm2015/components/dropdown-box/dropdown-box.component.js +5 -8
- package/esm2015/components/expand/expand.component.js +1 -1
- package/esm2015/components/group/group-styles.component.js +13 -0
- package/esm2015/components/group/group.directive.js +12 -6
- package/esm2015/components/group/group.module.js +4 -3
- package/esm2015/components/group/index.js +2 -1
- package/esm2015/components/hosted-dropdown/hosted-dropdown.component.js +3 -6
- package/esm2015/components/loader/index.js +2 -1
- package/esm2015/components/loader/loader-options.js +15 -0
- package/esm2015/components/loader/loader.component.js +11 -7
- package/esm2015/components/loader/loader.directive.js +2 -2
- package/esm2015/components/notification/notification.component.js +1 -1
- package/esm2015/components/primitive-textfield/primitive-textfield.component.js +3 -3
- package/esm2015/components/primitive-textfield/primitive-textfield.module.js +2 -3
- package/esm2015/components/primitive-textfield/textfield/textfield.component.js +3 -3
- package/esm2015/components/primitive-year-picker/primitive-year-picker.component.js +1 -1
- package/esm2015/components/root/root.component.js +4 -4
- package/esm2015/components/root/root.module.js +3 -3
- package/esm2015/components/tooltip/tooltip.component.js +2 -2
- package/esm2015/constants/version.js +2 -2
- package/esm2015/interfaces/dropdown-directive.js +1 -1
- package/esm2015/modules/notifications/notification-alert/notification-alert.component.js +4 -5
- package/esm2015/modules/notifications/notifications-host/notifications-host.component.js +3 -3
- package/esm2015/modules/notifications/notifications.service.js +2 -2
- package/esm2015/tokens/notification-options.js +8 -1
- package/esm2015/utils/dom/process-icon.js +2 -2
- package/esm2015/utils/format/format-number.js +2 -2
- package/esm2015/utils/mask/create-auto-corrected-money-pipe.js +2 -2
- package/esm2015/utils/mask/create-number-mask.js +1 -2
- package/esm2015/utils/mask/enable-auto-correct-decimal-symbol.js +5 -0
- package/esm2015/utils/mask/index.js +2 -1
- package/esm2015/utils/miscellaneous/icons-path-factory.js +2 -2
- package/esm2015/utils/miscellaneous/is-editing-key.js +2 -2
- package/esm5/abstract/abstract-dropdown.js +2 -2
- package/esm5/abstract/abstract-hint.js +1 -1
- package/esm5/components/button/button-options.js +1 -1
- package/esm5/components/button/button.component.js +4 -4
- package/esm5/components/dialog/dialog.component.js +3 -20
- package/esm5/components/dropdown-box/dropdown-box.component.js +5 -8
- package/esm5/components/expand/expand.component.js +1 -1
- package/esm5/components/group/group-styles.component.js +16 -0
- package/esm5/components/group/group.directive.js +12 -6
- package/esm5/components/group/group.module.js +4 -3
- package/esm5/components/group/index.js +2 -1
- package/esm5/components/hosted-dropdown/hosted-dropdown.component.js +3 -6
- package/esm5/components/loader/index.js +2 -1
- package/esm5/components/loader/loader-options.js +16 -0
- package/esm5/components/loader/loader.component.js +11 -7
- package/esm5/components/loader/loader.directive.js +2 -2
- package/esm5/components/notification/notification.component.js +1 -1
- package/esm5/components/primitive-textfield/primitive-textfield.component.js +3 -3
- package/esm5/components/primitive-textfield/primitive-textfield.module.js +2 -3
- package/esm5/components/primitive-textfield/textfield/textfield.component.js +3 -3
- package/esm5/components/primitive-year-picker/primitive-year-picker.component.js +1 -1
- package/esm5/components/root/root.component.js +4 -4
- package/esm5/components/root/root.module.js +3 -3
- package/esm5/components/tooltip/tooltip.component.js +2 -2
- package/esm5/constants/version.js +2 -2
- package/esm5/interfaces/dropdown-directive.js +1 -1
- package/esm5/modules/notifications/notification-alert/notification-alert.component.js +4 -5
- package/esm5/modules/notifications/notifications-host/notifications-host.component.js +3 -3
- package/esm5/modules/notifications/notifications.service.js +2 -2
- package/esm5/tokens/notification-options.js +9 -1
- package/esm5/utils/dom/process-icon.js +2 -2
- package/esm5/utils/format/format-number.js +2 -2
- package/esm5/utils/mask/create-auto-corrected-money-pipe.js +2 -2
- package/esm5/utils/mask/create-number-mask.js +1 -2
- package/esm5/utils/mask/enable-auto-correct-decimal-symbol.js +6 -0
- package/esm5/utils/mask/index.js +2 -1
- package/esm5/utils/miscellaneous/icons-path-factory.js +2 -2
- package/esm5/utils/miscellaneous/is-editing-key.js +2 -2
- package/fesm2015/taiga-ui-core-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-button.js +3 -3
- package/fesm2015/taiga-ui-core-components-button.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-dialog.js +2 -15
- package/fesm2015/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-dropdown-box.js +4 -7
- package/fesm2015/taiga-ui-core-components-dropdown-box.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-group.js +23 -8
- package/fesm2015/taiga-ui-core-components-group.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js +2 -5
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-loader.js +26 -9
- package/fesm2015/taiga-ui-core-components-loader.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-notification.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js +5 -6
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-year-picker.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-root.js +5 -5
- package/fesm2015/taiga-ui-core-components-root.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-tooltip.js +1 -1
- package/fesm2015/taiga-ui-core-components-tooltip.js.map +1 -1
- package/fesm2015/taiga-ui-core-constants.js +1 -1
- package/fesm2015/taiga-ui-core-constants.js.map +1 -1
- package/fesm2015/taiga-ui-core-modules-notifications.js +5 -6
- package/fesm2015/taiga-ui-core-modules-notifications.js.map +1 -1
- package/fesm2015/taiga-ui-core-tokens.js +8 -1
- package/fesm2015/taiga-ui-core-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-dom.js +1 -1
- package/fesm2015/taiga-ui-core-utils-dom.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-format.js +1 -1
- package/fesm2015/taiga-ui-core-utils-format.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-mask.js +7 -4
- package/fesm2015/taiga-ui-core-utils-mask.js.map +1 -1
- package/fesm2015/taiga-ui-core-utils-miscellaneous.js +2 -2
- package/fesm2015/taiga-ui-core-utils-miscellaneous.js.map +1 -1
- package/fesm5/taiga-ui-core-abstract.js.map +1 -1
- package/fesm5/taiga-ui-core-components-button.js +3 -3
- package/fesm5/taiga-ui-core-components-button.js.map +1 -1
- package/fesm5/taiga-ui-core-components-dialog.js +2 -19
- package/fesm5/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm5/taiga-ui-core-components-dropdown-box.js +4 -7
- package/fesm5/taiga-ui-core-components-dropdown-box.js.map +1 -1
- package/fesm5/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm5/taiga-ui-core-components-group.js +26 -8
- package/fesm5/taiga-ui-core-components-group.js.map +1 -1
- package/fesm5/taiga-ui-core-components-hosted-dropdown.js +2 -5
- package/fesm5/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm5/taiga-ui-core-components-loader.js +27 -10
- package/fesm5/taiga-ui-core-components-loader.js.map +1 -1
- package/fesm5/taiga-ui-core-components-notification.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-textfield.js +5 -6
- package/fesm5/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-year-picker.js.map +1 -1
- package/fesm5/taiga-ui-core-components-root.js +5 -5
- package/fesm5/taiga-ui-core-components-root.js.map +1 -1
- package/fesm5/taiga-ui-core-components-tooltip.js +1 -1
- package/fesm5/taiga-ui-core-components-tooltip.js.map +1 -1
- package/fesm5/taiga-ui-core-constants.js +1 -1
- package/fesm5/taiga-ui-core-constants.js.map +1 -1
- package/fesm5/taiga-ui-core-modules-notifications.js +5 -6
- package/fesm5/taiga-ui-core-modules-notifications.js.map +1 -1
- package/fesm5/taiga-ui-core-tokens.js +9 -2
- package/fesm5/taiga-ui-core-tokens.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-dom.js +1 -1
- package/fesm5/taiga-ui-core-utils-dom.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-format.js +1 -1
- package/fesm5/taiga-ui-core-utils-format.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-mask.js +8 -4
- package/fesm5/taiga-ui-core-utils-mask.js.map +1 -1
- package/fesm5/taiga-ui-core-utils-miscellaneous.js +2 -2
- package/fesm5/taiga-ui-core-utils-miscellaneous.js.map +1 -1
- package/interfaces/dropdown-directive.d.ts +2 -2
- package/modules/notifications/notification-alert/notification-alert.component.d.ts +3 -4
- package/modules/notifications/notifications.service.d.ts +3 -3
- package/modules/notifications/taiga-ui-core-modules-notifications.metadata.json +1 -1
- package/package.json +4 -4
- package/styles/markup/tui-group.less +4 -2
- package/styles/mixins/slider.less +33 -0
- package/styles/mixins/slider.scss +34 -0
- package/styles/mixins/textfield.less +21 -18
- package/styles/taiga-ui-local.less +1 -0
- package/styles/taiga-ui-local.scss +1 -0
- package/tokens/notification-options.d.ts +10 -4
- package/tokens/taiga-ui-core-tokens.metadata.json +1 -1
- package/utils/format/format-number.d.ts +1 -1
- package/utils/mask/create-auto-corrected-money-pipe.d.ts +1 -1
- package/utils/mask/create-number-mask.d.ts +0 -1
- package/utils/mask/enable-auto-correct-decimal-symbol.d.ts +2 -0
- package/utils/mask/index.d.ts +1 -0
- package/utils/mask/taiga-ui-core-utils-mask.metadata.json +1 -1
- package/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.metadata.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-tooltip.js","sources":["ng://@taiga-ui/core/components/tooltip/tooltip.component.ts","ng://@taiga-ui/core/components/tooltip/tooltip.module.ts","ng://@taiga-ui/core/components/tooltip/taiga-ui-core-components-tooltip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n HostListener,\n Inject,\n Input,\n} from '@angular/core';\nimport {TUI_IS_MOBILE, tuiDefaultProp, TuiDestroyService} from '@taiga-ui/cdk';\nimport {TUI_HINT_OPTIONS, TuiHintOptions} from '@taiga-ui/core/directives';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\nimport {TUI_MODE} from '@taiga-ui/core/tokens';\nimport {TuiBrightness, TuiHintModeT} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n@Component({\n selector: 'tui-tooltip',\n templateUrl: './tooltip.template.html',\n styleUrls: ['./tooltip.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService, MODE_PROVIDER],\n})\nexport class TuiTooltipComponent {\n private globalMode: TuiBrightness | null = null;\n\n @Input()\n @tuiDefaultProp()\n content: PolymorpheusContent = '';\n\n @Input()\n @tuiDefaultProp()\n mode: TuiHintOptions['mode'] = this.options.mode;\n\n @Input()\n @tuiDefaultProp()\n direction: TuiHintOptions['direction'] = this.options.direction;\n\n @Input()\n @tuiDefaultProp()\n showDelay: TuiHintOptions['tuiHintShowDelay'] = this.options.tuiHintShowDelay;\n\n @Input()\n @tuiDefaultProp()\n hideDelay: TuiHintOptions['tuiHintHideDelay'] = this.options.tuiHintHideDelay;\n\n @Input()\n @tuiDefaultProp()\n describeId = '';\n\n constructor(\n @Inject(TuiDestroyService) destroy$: Observable<unknown>,\n @Inject(TUI_MODE) mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_IS_MOBILE) private readonly isMobile: boolean,\n @Inject(TUI_HINT_OPTIONS) private readonly options: TuiHintOptions,\n ) {\n mode$.pipe(takeUntil(destroy$)).subscribe(mode => {\n this.globalMode = mode;\n });\n }\n\n // TODO: Simplify\n @HostBinding('attr.data-mode')\n get computedMode(): TuiHintModeT |
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-tooltip.js","sources":["ng://@taiga-ui/core/components/tooltip/tooltip.component.ts","ng://@taiga-ui/core/components/tooltip/tooltip.module.ts","ng://@taiga-ui/core/components/tooltip/taiga-ui-core-components-tooltip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n HostListener,\n Inject,\n Input,\n} from '@angular/core';\nimport {TUI_IS_MOBILE, tuiDefaultProp, TuiDestroyService} from '@taiga-ui/cdk';\nimport {TUI_HINT_OPTIONS, TuiHintOptions} from '@taiga-ui/core/directives';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\nimport {TUI_MODE} from '@taiga-ui/core/tokens';\nimport {TuiBrightness, TuiHintModeT} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n@Component({\n selector: 'tui-tooltip',\n templateUrl: './tooltip.template.html',\n styleUrls: ['./tooltip.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService, MODE_PROVIDER],\n})\nexport class TuiTooltipComponent {\n private globalMode: TuiBrightness | null = null;\n\n @Input()\n @tuiDefaultProp()\n content: PolymorpheusContent = '';\n\n @Input()\n @tuiDefaultProp()\n mode: TuiHintOptions['mode'] = this.options.mode;\n\n @Input()\n @tuiDefaultProp()\n direction: TuiHintOptions['direction'] = this.options.direction;\n\n @Input()\n @tuiDefaultProp()\n showDelay: TuiHintOptions['tuiHintShowDelay'] = this.options.tuiHintShowDelay;\n\n @Input()\n @tuiDefaultProp()\n hideDelay: TuiHintOptions['tuiHintHideDelay'] = this.options.tuiHintHideDelay;\n\n @Input()\n @tuiDefaultProp()\n describeId = '';\n\n constructor(\n @Inject(TuiDestroyService) destroy$: Observable<unknown>,\n @Inject(TUI_MODE) mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_IS_MOBILE) private readonly isMobile: boolean,\n @Inject(TUI_HINT_OPTIONS) private readonly options: TuiHintOptions,\n ) {\n mode$.pipe(takeUntil(destroy$)).subscribe(mode => {\n this.globalMode = mode;\n });\n }\n\n // TODO: Simplify\n @HostBinding('attr.data-mode')\n get computedMode(): TuiHintModeT | null {\n return this.mode || (this.globalMode === 'onDark' ? 'onDark' : null);\n }\n\n @HostListener('mousedown', ['$event'])\n @HostListener('click', ['$event'])\n stopOnMobile(event: MouseEvent) {\n if (this.isMobile) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n get icon(): PolymorpheusContent {\n return this.options.tooltipIcon;\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {TuiHintModule} from '@taiga-ui/core/directives/hint';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiTooltipComponent} from './tooltip.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule, TuiHintModule, PolymorpheusModule],\n declarations: [TuiTooltipComponent],\n exports: [TuiTooltipComponent],\n})\nexport class TuiTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;IAwBa,mBAAmB,GAAhC,MAAa,mBAAmB;IA2B5B,YAC+B,QAA6B,EACtC,KAAuC,EACjB,QAAiB,EACd,OAAuB;QAD1B,aAAQ,GAAR,QAAQ,CAAS;QACd,YAAO,GAAP,OAAO,CAAgB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AFC,KAAK,EAAE;IACP,cAAc,EAAE;uDACD;AAehB;IADC,WAAW,CAAC,gBAAgB,CAAC;uDAG7B;AAID;IAFC,YAAY,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC;IACrC,YAAY,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC;uDAMjC;AAnDQ,mBAAmB;IAP/B,SAAS,CAAC;QACP,QAAQ,EAAE,aAAa;QACvB,0bAAsC;QAEtC,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,SAAS,EAAE,CAAC,iBAAiB,EAAE,aAAa,CAAC;;KAChD,CAAC;IA6BO,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;IAChB,WAAA,MAAM,CAAC,aAAa,CAAC,CAAA;IACrB,WAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;GA/BpB,mBAAmB,CAwD/B;;ICnEY,gBAAgB,GAA7B,MAAa,gBAAgB;EAAG;AAAnB,gBAAgB;IAL5B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,CAAC;QACxE,YAAY,EAAE,CAAC,mBAAmB,CAAC;QACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;KACjC,CAAC;GACW,gBAAgB,CAAG;;ACbhC;;;;;;"}
|
|
@@ -63,7 +63,7 @@ const TUI_LAST_PUNCTUATION_MARK_REGEXP = /[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]$/;
|
|
|
63
63
|
const TUI_LATIN_REGEXP = /[A-z]/;
|
|
64
64
|
const TUI_LATIN_AND_NUMBERS_REGEXP = /[A-z|0-9]/;
|
|
65
65
|
|
|
66
|
-
const VERSION = '2.
|
|
66
|
+
const VERSION = '2.37.1';
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-constants.js","sources":["ng://@taiga-ui/core/constants/absolute-box-sizes.ts","ng://@taiga-ui/core/constants/decimal-symbols.ts","ng://@taiga-ui/core/constants/default-icons-path.ts","ng://@taiga-ui/core/constants/default-marker-handler.ts","ng://@taiga-ui/core/constants/editing-keys.ts","ng://@taiga-ui/core/constants/events.ts","ng://@taiga-ui/core/constants/mask-caret-trap.ts","ng://@taiga-ui/core/constants/media.ts","ng://@taiga-ui/core/constants/regexp.ts","ng://@taiga-ui/core/constants/version.ts","ng://@taiga-ui/core/constants/taiga-ui-core-constants.ts"],"sourcesContent":["export const DEFAULT_MARGIN = 4;\nexport const DEFAULT_MIN_HEIGHT = 80;\nexport const DEFAULT_MAX_HEIGHT = 400;\nexport const DEFAULT_MAX_WIDTH = 600;\n","export const TUI_DECIMAL_SYMBOLS: ReadonlyArray<string> = [',', '.'];\n","import {TuiStringHandler} from '@taiga-ui/cdk';\n\nexport const DEFAULT_ICONS_PATH: TuiStringHandler<string> = name =>\n name.includes('.svg#') ? name : `#${name}`;\n","import {EMPTY_ARRAY} from '@taiga-ui/cdk';\nimport {TuiMarkerHandler} from '@taiga-ui/core/types';\n\nexport const TUI_DEFAULT_MARKER_HANDLER: TuiMarkerHandler = () => EMPTY_ARRAY;\n","export const tuiEditingKeys: readonly string[] = [\n 'Spacebar',\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Left',\n 'Right',\n 'End',\n 'Home',\n];\n","/**\n * An event indicating that async data for expand has finished loading.\n * Dispatch to finish loading states for {@link TuiExpandComponent}.\n */\nexport const TUI_EXPAND_LOADED = 'tui-expand-loaded';\n\n/**\n * An event for scrolling an element into view within {@link TuiScrollbarComponent}.\n */\nexport const TUI_SCROLL_INTO_VIEW = 'tui-scroll-into-view';\n\n/**\n * An event to notify {@link TuiScrollbarComponent} that\n * it should control a nested element.\n */\nexport const TUI_SCROLLABLE = 'tui-scrollable';\n\n/**\n * An event indicating and error during icon loading in {@link TuiSvgComponent}.\n */\nexport const TUI_ICON_ERROR = 'tui-icon-error';\n","export const MASK_CARET_TRAP = '[]';\n","/**\n * Media constants are exact the same as css media breakpoints\n * @deprecated use TUI_MEDIA token\n */\nexport const MEDIA = {\n mobile: 320,\n tablet: 600,\n desktopSmall: 1024,\n desktopLarge: 1280,\n};\n","export const TUI_DIGIT_REGEXP = /\\d/;\nexport const TUI_NON_DIGIT_REGEXP = /\\D/;\nexport const TUI_NON_DIGITS_REGEXP = /\\D+/g;\nexport const TUI_LEADING_ZEROES_REGEXP = /^0+/;\nexport const TUI_LAST_PUNCTUATION_MARK_REGEXP = /[.,\\\\/#!$%\\\\^&\\\\*;:{}=\\\\-_`~()]$/;\nexport const TUI_LATIN_REGEXP = /[A-z]/;\nexport const TUI_LATIN_AND_NUMBERS_REGEXP = /[A-z|0-9]/;\n","export const VERSION = '2.
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-constants.js","sources":["ng://@taiga-ui/core/constants/absolute-box-sizes.ts","ng://@taiga-ui/core/constants/decimal-symbols.ts","ng://@taiga-ui/core/constants/default-icons-path.ts","ng://@taiga-ui/core/constants/default-marker-handler.ts","ng://@taiga-ui/core/constants/editing-keys.ts","ng://@taiga-ui/core/constants/events.ts","ng://@taiga-ui/core/constants/mask-caret-trap.ts","ng://@taiga-ui/core/constants/media.ts","ng://@taiga-ui/core/constants/regexp.ts","ng://@taiga-ui/core/constants/version.ts","ng://@taiga-ui/core/constants/taiga-ui-core-constants.ts"],"sourcesContent":["export const DEFAULT_MARGIN = 4;\nexport const DEFAULT_MIN_HEIGHT = 80;\nexport const DEFAULT_MAX_HEIGHT = 400;\nexport const DEFAULT_MAX_WIDTH = 600;\n","export const TUI_DECIMAL_SYMBOLS: ReadonlyArray<string> = [',', '.'];\n","import {TuiStringHandler} from '@taiga-ui/cdk';\n\nexport const DEFAULT_ICONS_PATH: TuiStringHandler<string> = name =>\n name.includes('.svg#') ? name : `#${name}`;\n","import {EMPTY_ARRAY} from '@taiga-ui/cdk';\nimport {TuiMarkerHandler} from '@taiga-ui/core/types';\n\nexport const TUI_DEFAULT_MARKER_HANDLER: TuiMarkerHandler = () => EMPTY_ARRAY;\n","export const tuiEditingKeys: readonly string[] = [\n 'Spacebar',\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Left',\n 'Right',\n 'End',\n 'Home',\n];\n","/**\n * An event indicating that async data for expand has finished loading.\n * Dispatch to finish loading states for {@link TuiExpandComponent}.\n */\nexport const TUI_EXPAND_LOADED = 'tui-expand-loaded';\n\n/**\n * An event for scrolling an element into view within {@link TuiScrollbarComponent}.\n */\nexport const TUI_SCROLL_INTO_VIEW = 'tui-scroll-into-view';\n\n/**\n * An event to notify {@link TuiScrollbarComponent} that\n * it should control a nested element.\n */\nexport const TUI_SCROLLABLE = 'tui-scrollable';\n\n/**\n * An event indicating and error during icon loading in {@link TuiSvgComponent}.\n */\nexport const TUI_ICON_ERROR = 'tui-icon-error';\n","export const MASK_CARET_TRAP = '[]';\n","/**\n * Media constants are exact the same as css media breakpoints\n * @deprecated use TUI_MEDIA token\n */\nexport const MEDIA = {\n mobile: 320,\n tablet: 600,\n desktopSmall: 1024,\n desktopLarge: 1280,\n};\n","export const TUI_DIGIT_REGEXP = /\\d/;\nexport const TUI_NON_DIGIT_REGEXP = /\\D/;\nexport const TUI_NON_DIGITS_REGEXP = /\\D+/g;\nexport const TUI_LEADING_ZEROES_REGEXP = /^0+/;\nexport const TUI_LAST_PUNCTUATION_MARK_REGEXP = /[.,\\\\/#!$%\\\\^&\\\\*;:{}=\\\\-_`~()]$/;\nexport const TUI_LATIN_REGEXP = /[A-z]/;\nexport const TUI_LATIN_AND_NUMBERS_REGEXP = /[A-z|0-9]/;\n","export const VERSION = '2.37.1';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAAa,cAAc,GAAG,EAAE;MACnB,kBAAkB,GAAG,GAAG;MACxB,kBAAkB,GAAG,IAAI;MACzB,iBAAiB,GAAG;;MCHpB,mBAAmB,GAA0B,CAAC,GAAG,EAAE,GAAG;;MCEtD,kBAAkB,GAA6B,IAAI,IAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI;;MCA/B,0BAA0B,GAAqB,MAAM;;MCHrD,cAAc,GAAsB;IAC7C,UAAU;IACV,WAAW;IACX,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;;;ACTV;;;;MAIa,iBAAiB,GAAG,oBAAoB;AAErD;;;MAGa,oBAAoB,GAAG,uBAAuB;AAE3D;;;;MAIa,cAAc,GAAG,iBAAiB;AAE/C;;;MAGa,cAAc,GAAG;;MCpBjB,eAAe,GAAG;;ACA/B;;;;MAIa,KAAK,GAAG;IACjB,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;;;MCRT,gBAAgB,GAAG,KAAK;MACxB,oBAAoB,GAAG,KAAK;MAC5B,qBAAqB,GAAG,OAAO;MAC/B,yBAAyB,GAAG,MAAM;MAClC,gCAAgC,GAAG,mCAAmC;MACtE,gBAAgB,GAAG,QAAQ;MAC3B,4BAA4B,GAAG;;MCN/B,OAAO,GAAG;;ACAvB;;;;;;"}
|
|
@@ -31,7 +31,6 @@ class NotificationAlert {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const DEFAULT_ALERT_AUTOCLOSE_TIMEOUT = 3000;
|
|
35
34
|
let TuiNotificationAlertComponent = class TuiNotificationAlertComponent {
|
|
36
35
|
constructor(elementRef, destroy$, options) {
|
|
37
36
|
this.elementRef = elementRef;
|
|
@@ -70,7 +69,7 @@ let TuiNotificationAlertComponent = class TuiNotificationAlertComponent {
|
|
|
70
69
|
}
|
|
71
70
|
timer(isNumber(this.item.autoClose)
|
|
72
71
|
? this.item.autoClose
|
|
73
|
-
:
|
|
72
|
+
: this.options.defaultAutoCloseTime)
|
|
74
73
|
.pipe(takeUntil(fromEvent(this.elementRef.nativeElement, 'mouseenter')), repeatWhen(() => fromEvent(this.elementRef.nativeElement, 'mouseleave')), takeUntil(this.destroy$))
|
|
75
74
|
.subscribe(() => this.closeNotification());
|
|
76
75
|
}
|
|
@@ -89,8 +88,8 @@ __decorate([
|
|
|
89
88
|
TuiNotificationAlertComponent = __decorate([
|
|
90
89
|
Component({
|
|
91
90
|
selector: 'tui-notification-alert',
|
|
92
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
93
91
|
template: "<tui-notification\n *ngIf=\"item.hasCloseButton; else noClose\"\n [status]=\"item.status\"\n [hasIcon]=\"item.hasIcon\"\n (close)=\"closeNotification()\"\n>\n <label\n *ngIf=\"item.label\"\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__heading\"\n class=\"heading\"\n [content]=\"item.label\"\n [context]=\"context\"\n ></label>\n <div\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__content\"\n class=\"content\"\n [content]=\"item.content\"\n [context]=\"context\"\n ></div>\n</tui-notification>\n<ng-template #noClose>\n <tui-notification [status]=\"item.status\" [hasIcon]=\"item.hasIcon\">\n <label\n *ngIf=\"item.label\"\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__heading\"\n class=\"heading\"\n [content]=\"item.label\"\n [context]=\"context\"\n ></label>\n <div\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__content\"\n class=\"content\"\n [content]=\"item.content\"\n [context]=\"context\"\n ></div>\n </tui-notification>\n</ng-template>\n",
|
|
92
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
94
93
|
providers: [TuiDestroyService],
|
|
95
94
|
styles: [":host{box-shadow:0 .5rem 1rem rgba(0,0,0,.16);display:block;border-radius:var(--tui-radius-m)}.heading{font:var(--tui-font-text-m);line-height:1.25rem;font-weight:700;margin:0}.content{color:var(--tui-text-01);word-wrap:break-word}.content:empty{display:none}"]
|
|
96
95
|
}),
|
|
@@ -157,10 +156,10 @@ __decorate([
|
|
|
157
156
|
TuiNotificationsHostComponent = __decorate([
|
|
158
157
|
Component({
|
|
159
158
|
selector: 'tui-notifications-host',
|
|
159
|
+
template: "<ng-container *tuiLet=\"service.items$ | async as items\">\n <div\n *ngIf=\"items.length\"\n class=\"t-wrapper\"\n [@tuiFadeInList]=\"getAnimation(items.length)\"\n [@tuiHeightCollapseList]=\"getAnimation(items.length)\"\n [@tuiSlideInRightList]=\"getAnimation(items.length)\"\n >\n <tui-notification-alert\n *ngFor=\"let item of items\"\n role=\"alert\"\n class=\"t-alert\"\n [item]=\"item\"\n ></tui-notification-alert>\n </div>\n</ng-container>\n",
|
|
160
160
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
161
|
-
template: "<ng-container *tuiLet=\"service.items$ | async as items\">\n <div\n *ngIf=\"items.length\"\n class=\"wrapper\"\n [@tuiFadeInList]=\"getAnimation(items.length)\"\n [@tuiHeightCollapseList]=\"getAnimation(items.length)\"\n [@tuiSlideInRightList]=\"getAnimation(items.length)\"\n >\n <tui-notification-alert\n *ngFor=\"let item of items\"\n role=\"alert\"\n class=\"alert\"\n [item]=\"item\"\n ></tui-notification-alert>\n </div>\n</ng-container>\n",
|
|
162
161
|
animations: [tuiFadeInList, tuiSlideInRightList, tuiHeightCollapseList],
|
|
163
|
-
styles: [":host{position:fixed;top:0;left:0;width:100%;height:0}.wrapper{width:18rem;margin-left:auto;padding:2rem 3rem 0 0;pointer-events:none}:host-context(tui-root._mobile) .wrapper{padding:1rem 1rem 0 0}@media screen and (min-width:80em){.wrapper{width:23rem}}.alert{pointer-events:auto}.alert:not(:first-child){margin-top:.75rem}"]
|
|
162
|
+
styles: [":host{position:fixed;top:0;left:0;width:100%;height:0}.t-wrapper{width:18rem;margin-left:auto;padding:2rem 3rem 0 0;pointer-events:none}:host-context(tui-root._mobile) .t-wrapper{padding:1rem 1rem 0 0}@media screen and (min-width:80em){.t-wrapper{width:23rem}}.t-alert{pointer-events:auto}.t-alert:not(:first-child){margin-top:.75rem}"]
|
|
164
163
|
}),
|
|
165
164
|
__param(0, Inject(TUI_ANIMATION_OPTIONS)),
|
|
166
165
|
__param(1, Inject(TuiNotificationsService))
|
|
@@ -189,5 +188,5 @@ TuiNotificationsModule = __decorate([
|
|
|
189
188
|
* Generated bundle index. Do not edit.
|
|
190
189
|
*/
|
|
191
190
|
|
|
192
|
-
export {
|
|
191
|
+
export { NOTIFICATIONS_HOST, NotificationAlert, TuiNotificationAlertComponent, TuiNotificationAlertModule, TuiNotificationsHostComponent, TuiNotificationsModule, TuiNotificationsService };
|
|
193
192
|
//# sourceMappingURL=taiga-ui-core-modules-notifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-modules-notifications.js","sources":["ng://@taiga-ui/core/modules/notifications/notification-alert/Notification-alert.ts","ng://@taiga-ui/core/modules/notifications/notification-alert/notification-alert.component.ts","ng://@taiga-ui/core/modules/notifications/notification-alert/notification-alert.module.ts","ng://@taiga-ui/core/modules/notifications/notifications.service.ts","ng://@taiga-ui/core/modules/notifications/notifications-host/notifications-host.component.ts","ng://@taiga-ui/core/modules/notifications/notifications.module.ts","ng://@taiga-ui/core/modules/notifications/taiga-ui-core-modules-notifications.ts"],"sourcesContent":["import {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {\n TuiNotificationOptions,\n TuiNotificationOptionsWithData,\n} from '@taiga-ui/core/interfaces';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observer} from 'rxjs';\n\nimport {TuiNotificationContentContext} from '../notification-content-context';\n\nexport class NotificationAlert<O, I> {\n readonly status = this.options.status;\n\n readonly hasIcon = this.options.hasIcon;\n\n readonly autoClose: boolean | number;\n\n readonly hasCloseButton = this.options.hasCloseButton;\n\n readonly label: PolymorpheusContent<TuiContextWithImplicit<TuiNotification>> =\n this.options.label;\n\n readonly data!: I;\n\n constructor(\n readonly observer: Observer<O>,\n readonly content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n private readonly options: Required<\n TuiNotificationOptions | TuiNotificationOptionsWithData<I>\n >,\n ) {\n this.autoClose =\n typeof this.options.autoClose === 'function'\n ? this.options.autoClose(this.options.status)\n : this.options.autoClose;\n\n if (options && this.withData(options)) {\n this.data = options.data;\n }\n }\n\n private withData(\n options: TuiNotificationOptions | TuiNotificationOptionsWithData<I>,\n ): options is TuiNotificationOptionsWithData<I> {\n return 'data' in options;\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n Input,\n OnInit,\n} from '@angular/core';\nimport {isNumber, TuiDestroyService, tuiPure} from '@taiga-ui/cdk';\nimport {NotificationTokenOptions, TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/tokens';\nimport {fromEvent, timer} from 'rxjs';\nimport {repeatWhen, takeUntil} from 'rxjs/operators';\n\nimport {TuiNotificationContentContext} from '../notification-content-context';\nimport {NotificationAlert} from './Notification-alert';\n\nexport const DEFAULT_ALERT_AUTOCLOSE_TIMEOUT = 3000;\n\n@Component({\n selector: 'tui-notification-alert',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './notification-alert.template.html',\n styleUrls: ['./notification-alert.style.less'],\n providers: [TuiDestroyService],\n})\nexport class TuiNotificationAlertComponent<O, I> implements OnInit {\n @Input()\n item!: NotificationAlert<O, I>;\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) private readonly destroy$: TuiDestroyService,\n @Inject(TUI_NOTIFICATION_OPTIONS)\n readonly options: NotificationTokenOptions,\n ) {}\n\n ngOnInit() {\n this.initAutoClose();\n }\n\n get context(): TuiNotificationContentContext<O, I> {\n return this.calculateContext(this.item);\n }\n\n closeNotification() {\n this.item.observer.complete();\n }\n\n @tuiPure\n private calculateContext({\n status,\n data,\n label,\n observer,\n }: NotificationAlert<O, I>): TuiNotificationContentContext<O, I> {\n return {\n $implicit: status,\n data: data,\n label: label,\n closeHook: () => {\n observer.complete();\n },\n emitHook: (data: O) => {\n observer.next(data);\n },\n emitAndCloseHook: (data: O) => {\n observer.next(data);\n observer.complete();\n },\n };\n }\n\n private initAutoClose() {\n if (!this.item.autoClose) {\n return;\n }\n\n timer(\n isNumber(this.item.autoClose)\n ? this.item.autoClose\n : DEFAULT_ALERT_AUTOCLOSE_TIMEOUT,\n )\n .pipe(\n takeUntil(fromEvent(this.elementRef.nativeElement, 'mouseenter')),\n repeatWhen(() => fromEvent(this.elementRef.nativeElement, 'mouseleave')),\n takeUntil(this.destroy$),\n )\n .subscribe(() => this.closeNotification());\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiNotificationModule} from '@taiga-ui/core/components/notification';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiNotificationAlertComponent} from './notification-alert.component';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule, TuiNotificationModule],\n declarations: [TuiNotificationAlertComponent],\n exports: [TuiNotificationAlertComponent],\n})\nexport class TuiNotificationAlertModule {}\n","import {Inject, Injectable} from '@angular/core';\nimport {tuiAssert} from '@taiga-ui/cdk';\nimport {\n TuiNotificationOptions,\n TuiNotificationOptionsWithData,\n} from '@taiga-ui/core/interfaces';\nimport {NotificationTokenOptions, TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/tokens';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {BehaviorSubject, Observable, Observer} from 'rxjs';\n\nimport {NotificationAlert} from './notification-alert/Notification-alert';\nimport {TuiNotificationContentContext} from './notification-content-context';\n\nconst NO_HOST =\n 'Notifications are disabled, enable support by adding TuiNotificationsModule to your main app module';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiNotificationsService {\n /** @internal */\n readonly items$ = new BehaviorSubject<ReadonlyArray<NotificationAlert<any, any>>>([]);\n\n constructor(\n @Inject(TUI_NOTIFICATION_OPTIONS)\n readonly options: NotificationTokenOptions,\n ) {}\n\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n ): Observable<O>;\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n options: TuiNotificationOptions,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptionsWithData<I>,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptions | TuiNotificationOptionsWithData<I> = {},\n ): Observable<O> {\n return new Observable((observer: Observer<O>) => {\n tuiAssert.assert(!!this.items$.observers.length, NO_HOST);\n\n const notification = new NotificationAlert(observer, content, {\n ...this.options,\n ...options,\n });\n\n this.items$.next([...this.items$.value, notification]);\n\n return () => {\n this.items$.next(this.items$.value.filter(item => item !== notification));\n };\n });\n }\n}\n","import {AnimationOptions} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component, Inject} from '@angular/core';\nimport {tuiPure} from '@taiga-ui/cdk';\nimport {\n tuiFadeInList,\n tuiHeightCollapseList,\n tuiSlideInRightList,\n} from '@taiga-ui/core/animations';\nimport {TuiAnimationOptions} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATION_OPTIONS} from '@taiga-ui/core/tokens';\n\nimport {TuiNotificationsService} from '../notifications.service';\n\n@Component({\n selector: 'tui-notifications-host',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './notifications-host.template.html',\n styleUrls: ['./notifications-host.style.less'],\n animations: [tuiFadeInList, tuiSlideInRightList, tuiHeightCollapseList],\n})\nexport class TuiNotificationsHostComponent {\n constructor(\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(TuiNotificationsService) readonly service: TuiNotificationsService,\n ) {}\n\n @tuiPure\n getAnimation(value: number): TuiAnimationOptions {\n return {\n value: String(value),\n ...this.options,\n };\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiLetModule} from '@taiga-ui/cdk';\n\nimport {TuiNotificationAlertModule} from './notification-alert/notification-alert.module';\nimport {TuiNotificationsHostComponent} from './notifications-host/notifications-host.component';\n\n// TODO: remove in ivy compilation\nexport const NOTIFICATIONS_HOST = TuiNotificationsHostComponent;\n\n@NgModule({\n imports: [CommonModule, TuiNotificationAlertModule, TuiLetModule],\n declarations: [TuiNotificationsHostComponent],\n exports: [TuiNotificationsHostComponent],\n entryComponents: [TuiNotificationsHostComponent],\n providers: [\n {\n provide: TuiNotificationsHostComponent,\n useValue: NOTIFICATIONS_HOST,\n },\n ],\n})\nexport class TuiNotificationsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAWa,iBAAiB;IAc1B,YACa,QAAqB,EACrB,OAAiE,EACzD,OAEhB;QAJQ,aAAQ,GAAR,QAAQ,CAAa;QACrB,YAAO,GAAP,OAAO,CAA0D;QACzD,YAAO,GAAP,OAAO,CAEvB;QAlBI,WAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QAE7B,YAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAI/B,mBAAc,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QAE7C,UAAK,GACV,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAWnB,IAAI,CAAC,SAAS;YACV,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,UAAU;kBACtC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;kBAC3C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QAEjC,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YACnC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;SAC5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;QAEjD,UAAU,EAAE,CAAC,aAAa,EAAE,mBAAmB,EAAE,qBAAqB,CAAC;;KAC1E,CAAC;IAGO,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,MAAM,CAAC,uBAAuB,CAAC,CAAA;GAH3B,6BAA6B,CAazC;;AC1BD;MACa,kBAAkB,GAAG,8BAA8B;IAcnD,sBAAsB,GAAnC,MAAa,sBAAsB;EAAG;AAAzB,sBAAsB;IAZlC,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,0BAA0B,EAAE,YAAY,CAAC;QACjE,YAAY,EAAE,CAAC,6BAA6B,CAAC;QAC7C,OAAO,EAAE,CAAC,6BAA6B,CAAC;QACxC,eAAe,EAAE,CAAC,6BAA6B,CAAC;QAChD,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,6BAA6B;gBACtC,QAAQ,EAAE,kBAAkB;aAC/B;SACJ;KACJ,CAAC;GACW,sBAAsB,CAAG;;ACtBtC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-modules-notifications.js","sources":["ng://@taiga-ui/core/modules/notifications/notification-alert/Notification-alert.ts","ng://@taiga-ui/core/modules/notifications/notification-alert/notification-alert.component.ts","ng://@taiga-ui/core/modules/notifications/notification-alert/notification-alert.module.ts","ng://@taiga-ui/core/modules/notifications/notifications.service.ts","ng://@taiga-ui/core/modules/notifications/notifications-host/notifications-host.component.ts","ng://@taiga-ui/core/modules/notifications/notifications.module.ts","ng://@taiga-ui/core/modules/notifications/taiga-ui-core-modules-notifications.ts"],"sourcesContent":["import {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {\n TuiNotificationOptions,\n TuiNotificationOptionsWithData,\n} from '@taiga-ui/core/interfaces';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observer} from 'rxjs';\n\nimport {TuiNotificationContentContext} from '../notification-content-context';\n\nexport class NotificationAlert<O, I> {\n readonly status = this.options.status;\n\n readonly hasIcon = this.options.hasIcon;\n\n readonly autoClose: boolean | number;\n\n readonly hasCloseButton = this.options.hasCloseButton;\n\n readonly label: PolymorpheusContent<TuiContextWithImplicit<TuiNotification>> =\n this.options.label;\n\n readonly data!: I;\n\n constructor(\n readonly observer: Observer<O>,\n readonly content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n private readonly options: Required<\n TuiNotificationOptions | TuiNotificationOptionsWithData<I>\n >,\n ) {\n this.autoClose =\n typeof this.options.autoClose === 'function'\n ? this.options.autoClose(this.options.status)\n : this.options.autoClose;\n\n if (options && this.withData(options)) {\n this.data = options.data;\n }\n }\n\n private withData(\n options: TuiNotificationOptions | TuiNotificationOptionsWithData<I>,\n ): options is TuiNotificationOptionsWithData<I> {\n return 'data' in options;\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n Input,\n OnInit,\n} from '@angular/core';\nimport {isNumber, TuiDestroyService, tuiPure} from '@taiga-ui/cdk';\nimport {\n TUI_NOTIFICATION_OPTIONS,\n TuiNotificationDefaultOptions,\n} from '@taiga-ui/core/tokens';\nimport {fromEvent, timer} from 'rxjs';\nimport {repeatWhen, takeUntil} from 'rxjs/operators';\n\nimport {TuiNotificationContentContext} from '../notification-content-context';\nimport {NotificationAlert} from './Notification-alert';\n\n@Component({\n selector: 'tui-notification-alert',\n templateUrl: './notification-alert.template.html',\n styleUrls: ['./notification-alert.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService],\n})\nexport class TuiNotificationAlertComponent<O, I> implements OnInit {\n @Input()\n item!: NotificationAlert<O, I>;\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) private readonly destroy$: TuiDestroyService,\n @Inject(TUI_NOTIFICATION_OPTIONS)\n readonly options: TuiNotificationDefaultOptions,\n ) {}\n\n ngOnInit() {\n this.initAutoClose();\n }\n\n get context(): TuiNotificationContentContext<O, I> {\n return this.calculateContext(this.item);\n }\n\n closeNotification() {\n this.item.observer.complete();\n }\n\n @tuiPure\n private calculateContext({\n status,\n data,\n label,\n observer,\n }: NotificationAlert<O, I>): TuiNotificationContentContext<O, I> {\n return {\n $implicit: status,\n data: data,\n label: label,\n closeHook: () => {\n observer.complete();\n },\n emitHook: (data: O) => {\n observer.next(data);\n },\n emitAndCloseHook: (data: O) => {\n observer.next(data);\n observer.complete();\n },\n };\n }\n\n private initAutoClose() {\n if (!this.item.autoClose) {\n return;\n }\n\n timer(\n isNumber(this.item.autoClose)\n ? this.item.autoClose\n : this.options.defaultAutoCloseTime,\n )\n .pipe(\n takeUntil(fromEvent(this.elementRef.nativeElement, 'mouseenter')),\n repeatWhen(() => fromEvent(this.elementRef.nativeElement, 'mouseleave')),\n takeUntil(this.destroy$),\n )\n .subscribe(() => this.closeNotification());\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiNotificationModule} from '@taiga-ui/core/components/notification';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiNotificationAlertComponent} from './notification-alert.component';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule, TuiNotificationModule],\n declarations: [TuiNotificationAlertComponent],\n exports: [TuiNotificationAlertComponent],\n})\nexport class TuiNotificationAlertModule {}\n","import {Inject, Injectable} from '@angular/core';\nimport {tuiAssert} from '@taiga-ui/cdk';\nimport {\n TuiNotificationOptions,\n TuiNotificationOptionsWithData,\n} from '@taiga-ui/core/interfaces';\nimport {\n TUI_NOTIFICATION_OPTIONS,\n TuiNotificationDefaultOptions,\n} from '@taiga-ui/core/tokens';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {BehaviorSubject, Observable, Observer} from 'rxjs';\n\nimport {NotificationAlert} from './notification-alert/Notification-alert';\nimport {TuiNotificationContentContext} from './notification-content-context';\n\nconst NO_HOST =\n 'Notifications are disabled, enable support by adding TuiNotificationsModule to your main app module';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiNotificationsService {\n /** @internal */\n readonly items$ = new BehaviorSubject<ReadonlyArray<NotificationAlert<any, any>>>([]);\n\n constructor(\n @Inject(TUI_NOTIFICATION_OPTIONS)\n readonly options: TuiNotificationDefaultOptions,\n ) {}\n\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n ): Observable<O>;\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n options: TuiNotificationOptions,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptionsWithData<I>,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptions | TuiNotificationOptionsWithData<I> = {},\n ): Observable<O> {\n return new Observable((observer: Observer<O>) => {\n tuiAssert.assert(!!this.items$.observers.length, NO_HOST);\n\n const notification = new NotificationAlert(observer, content, {\n ...this.options,\n ...options,\n });\n\n this.items$.next([...this.items$.value, notification]);\n\n return () => {\n this.items$.next(this.items$.value.filter(item => item !== notification));\n };\n });\n }\n}\n","import {AnimationOptions} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component, Inject} from '@angular/core';\nimport {tuiPure} from '@taiga-ui/cdk';\nimport {\n tuiFadeInList,\n tuiHeightCollapseList,\n tuiSlideInRightList,\n} from '@taiga-ui/core/animations';\nimport {TuiAnimationOptions} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATION_OPTIONS} from '@taiga-ui/core/tokens';\n\nimport {TuiNotificationsService} from '../notifications.service';\n\n@Component({\n selector: 'tui-notifications-host',\n templateUrl: './notifications-host.template.html',\n styleUrls: ['./notifications-host.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiFadeInList, tuiSlideInRightList, tuiHeightCollapseList],\n})\nexport class TuiNotificationsHostComponent {\n constructor(\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(TuiNotificationsService) readonly service: TuiNotificationsService,\n ) {}\n\n @tuiPure\n getAnimation(value: number): TuiAnimationOptions {\n return {\n value: String(value),\n ...this.options,\n };\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiLetModule} from '@taiga-ui/cdk';\n\nimport {TuiNotificationAlertModule} from './notification-alert/notification-alert.module';\nimport {TuiNotificationsHostComponent} from './notifications-host/notifications-host.component';\n\n// TODO: remove in ivy compilation\nexport const NOTIFICATIONS_HOST = TuiNotificationsHostComponent;\n\n@NgModule({\n imports: [CommonModule, TuiNotificationAlertModule, TuiLetModule],\n declarations: [TuiNotificationsHostComponent],\n exports: [TuiNotificationsHostComponent],\n entryComponents: [TuiNotificationsHostComponent],\n providers: [\n {\n provide: TuiNotificationsHostComponent,\n useValue: NOTIFICATIONS_HOST,\n },\n ],\n})\nexport class TuiNotificationsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAWa,iBAAiB;IAc1B,YACa,QAAqB,EACrB,OAAiE,EACzD,OAEhB;QAJQ,aAAQ,GAAR,QAAQ,CAAa;QACrB,YAAO,GAAP,OAAO,CAA0D;QACzD,YAAO,GAAP,OAAO,CAEvB;QAlBI,WAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QAE7B,YAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAI/B,mBAAc,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QAE7C,UAAK,GACV,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAWnB,IAAI,CAAC,SAAS;YACV,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,UAAU;kBACtC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;kBAC3C,IAAI,CAAC,OAAO,CAAC,SAAS,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IADC,OAAO;iEAMP;AAZQ,6BAA6B;IAPzC,SAAS,CAAC;QACP,QAAQ,EAAE,wBAAwB;QAClC,mjBAAiD;QAEjD,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,UAAU,EAAE,CAAC,aAAa,EAAE,mBAAmB,EAAE,qBAAqB,CAAC;;KAC1E,CAAC;IAGO,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,MAAM,CAAC,uBAAuB,CAAC,CAAA;GAH3B,6BAA6B,CAazC;;AC1BD;MACa,kBAAkB,GAAG,8BAA8B;IAcnD,sBAAsB,GAAnC,MAAa,sBAAsB;EAAG;AAAzB,sBAAsB;IAZlC,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,0BAA0B,EAAE,YAAY,CAAC;QACjE,YAAY,EAAE,CAAC,6BAA6B,CAAC;QAC7C,OAAO,EAAE,CAAC,6BAA6B,CAAC;QACxC,eAAe,EAAE,CAAC,6BAA6B,CAAC;QAChD,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,6BAA6B;gBACtC,QAAQ,EAAE,kBAAkB;aAC/B;SACJ;KACJ,CAAC;GACW,sBAAsB,CAAG;;ACtBtC;;;;;;"}
|
|
@@ -81,10 +81,17 @@ const TUI_NOTIFICATION_DEFAULT_OPTIONS = {
|
|
|
81
81
|
status: "info" /* Info */,
|
|
82
82
|
hasIcon: true,
|
|
83
83
|
hasCloseButton: true,
|
|
84
|
+
defaultAutoCloseTime: 3000,
|
|
84
85
|
};
|
|
85
86
|
const TUI_NOTIFICATION_OPTIONS = new InjectionToken('Default parameters for notification alert component', {
|
|
86
87
|
factory: () => TUI_NOTIFICATION_DEFAULT_OPTIONS,
|
|
87
88
|
});
|
|
89
|
+
function tuiNotificationOptionsProvider(options) {
|
|
90
|
+
return {
|
|
91
|
+
provide: TUI_NOTIFICATION_OPTIONS,
|
|
92
|
+
useValue: Object.assign(Object.assign({}, TUI_NOTIFICATION_DEFAULT_OPTIONS), options),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
88
95
|
|
|
89
96
|
const TUI_NUMBER_FORMAT = new InjectionToken('Formatting configuration for displayed numbers', {
|
|
90
97
|
factory: () => ({
|
|
@@ -138,5 +145,5 @@ const TUI_VALUE_ACCESSOR = new InjectionToken('Buffer token to pass NG_VALUE_ACC
|
|
|
138
145
|
* Generated bundle index. Do not edit.
|
|
139
146
|
*/
|
|
140
147
|
|
|
141
|
-
export { TUI_ANIMATIONS_DURATION, TUI_ANIMATION_OPTIONS, TUI_ASSERT_ENABLED, TUI_CLOSE_WORD, TUI_DATA_LIST_ACCESSOR, TUI_DATA_LIST_HOST, TUI_DEFAULT_ERROR_MESSAGE, TUI_DOCUMENT_OR_SHADOW_ROOT, TUI_DROPDOWN_DIRECTIVE, TUI_ELEMENT_REF, TUI_FIRST_DAY_OF_WEEK, TUI_ICONS, TUI_ICONS_PATH, TUI_IS_MOBILE_RES, TUI_MEDIA, TUI_MODE, TUI_MONTHS, TUI_NOTHING_FOUND_MESSAGE, TUI_NOTIFICATION_DEFAULT_OPTIONS, TUI_NOTIFICATION_OPTIONS, TUI_NUMBER_FORMAT, TUI_OPTION_CONTENT, TUI_ORDERED_SHORT_WEEK_DAYS, TUI_SANITIZER, TUI_SCROLL_REF, TUI_SHORT_WEEK_DAYS, TUI_SPIN_TEXTS, TUI_SVG_SRC_PROCESSOR, TUI_TEXTFIELD_APPEARANCE, TUI_TEXTFIELD_HOST, TUI_THEME, TUI_VALUE_ACCESSOR, convertToSundayFirstWeekFormat };
|
|
148
|
+
export { TUI_ANIMATIONS_DURATION, TUI_ANIMATION_OPTIONS, TUI_ASSERT_ENABLED, TUI_CLOSE_WORD, TUI_DATA_LIST_ACCESSOR, TUI_DATA_LIST_HOST, TUI_DEFAULT_ERROR_MESSAGE, TUI_DOCUMENT_OR_SHADOW_ROOT, TUI_DROPDOWN_DIRECTIVE, TUI_ELEMENT_REF, TUI_FIRST_DAY_OF_WEEK, TUI_ICONS, TUI_ICONS_PATH, TUI_IS_MOBILE_RES, TUI_MEDIA, TUI_MODE, TUI_MONTHS, TUI_NOTHING_FOUND_MESSAGE, TUI_NOTIFICATION_DEFAULT_OPTIONS, TUI_NOTIFICATION_OPTIONS, TUI_NUMBER_FORMAT, TUI_OPTION_CONTENT, TUI_ORDERED_SHORT_WEEK_DAYS, TUI_SANITIZER, TUI_SCROLL_REF, TUI_SHORT_WEEK_DAYS, TUI_SPIN_TEXTS, TUI_SVG_SRC_PROCESSOR, TUI_TEXTFIELD_APPEARANCE, TUI_TEXTFIELD_HOST, TUI_THEME, TUI_VALUE_ACCESSOR, convertToSundayFirstWeekFormat, tuiNotificationOptionsProvider };
|
|
142
149
|
//# sourceMappingURL=taiga-ui-core-tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-tokens.js","sources":["ng://@taiga-ui/core/tokens/animations-duration.ts","ng://@taiga-ui/core/tokens/animation-options.ts","ng://@taiga-ui/core/tokens/assert-enabled.ts","ng://@taiga-ui/core/tokens/data-list-accessor.ts","ng://@taiga-ui/core/tokens/data-list-host.ts","ng://@taiga-ui/core/tokens/document-or-shadow-root.ts","ng://@taiga-ui/core/tokens/dropdown-directive.ts","ng://@taiga-ui/core/tokens/element-ref.ts","ng://@taiga-ui/core/tokens/first-day-of-week.ts","ng://@taiga-ui/core/tokens/i18n.ts","ng://@taiga-ui/core/tokens/icons.ts","ng://@taiga-ui/core/tokens/icons-path.ts","ng://@taiga-ui/core/tokens/is-mobile-resolution.ts","ng://@taiga-ui/core/tokens/media.ts","ng://@taiga-ui/core/tokens/mode.ts","ng://@taiga-ui/core/tokens/notification-options.ts","ng://@taiga-ui/core/tokens/number-format.ts","ng://@taiga-ui/core/tokens/option-content.ts","ng://@taiga-ui/core/tokens/ordered-short-week-days.ts","ng://@taiga-ui/core/tokens/sanitizer.ts","ng://@taiga-ui/core/tokens/scroll-ref.ts","ng://@taiga-ui/core/tokens/svg-src-processor.ts","ng://@taiga-ui/core/tokens/textfield-appearance.ts","ng://@taiga-ui/core/tokens/textfield-host.ts","ng://@taiga-ui/core/tokens/theme.ts","ng://@taiga-ui/core/tokens/value-accessor.ts","ng://@taiga-ui/core/tokens/taiga-ui-core-tokens.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\n\nexport const TUI_ANIMATIONS_DURATION = new InjectionToken<number>(\n 'Duration of all Taiga UI animations in ms',\n {\n factory: () => 300,\n },\n);\n","import {AnimationOptions} from '@angular/animations';\nimport {inject, InjectionToken} from '@angular/core';\n\nimport {TUI_ANIMATIONS_DURATION} from './animations-duration';\n\nexport const TUI_ANIMATION_OPTIONS = new InjectionToken<AnimationOptions>(\n 'Options for Taiga UI animations',\n {\n factory: () => ({\n params: {\n duration: inject(TUI_ANIMATIONS_DURATION),\n },\n }),\n },\n);\n","import {InjectionToken, isDevMode} from '@angular/core';\n\nexport const TUI_ASSERT_ENABLED = new InjectionToken(\n 'Flag to enable assertions across Taiga UI',\n {\n factory: () => isDevMode(),\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDataListAccessor} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DATA_LIST_ACCESSOR = new InjectionToken<TuiDataListAccessor>(\n 'Accessor for options',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDataListHost} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DATA_LIST_HOST = new InjectionToken<TuiDataListHost<any>>(\n 'DataList controller',\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_DOCUMENT_OR_SHADOW_ROOT = new InjectionToken<DocumentOrShadowRoot>(\n 'Document or ShadowRoot',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDropdown} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DROPDOWN_DIRECTIVE = new InjectionToken<TuiDropdown>(\n 'Directive controlling TuiDropdownBoxComponent',\n);\n","import {ElementRef, InjectionToken} from '@angular/core';\n\nexport const TUI_ELEMENT_REF = new InjectionToken<ElementRef>(\n 'ElementRef when you cannot use @Input for single time injection',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDayOfWeek} from '@taiga-ui/cdk';\n\nexport const TUI_FIRST_DAY_OF_WEEK = new InjectionToken<TuiDayOfWeek>(\n 'The first day of the week index',\n {\n factory: () => TuiDayOfWeek.Monday,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {extractI18n} from '@taiga-ui/i18n';\n\nexport const TUI_MONTHS = new InjectionToken('Localized months names', {\n factory: extractI18n('months'),\n});\n\nexport const TUI_CLOSE_WORD = new InjectionToken(`i18n 'close' word`, {\n factory: extractI18n('close'),\n});\n\nexport const TUI_NOTHING_FOUND_MESSAGE = new InjectionToken(\n `i18n 'Nothing found' message`,\n {\n factory: extractI18n('nothingFoundMessage'),\n },\n);\n\nexport const TUI_DEFAULT_ERROR_MESSAGE = new InjectionToken(`i18n of error message`, {\n factory: extractI18n('defaultErrorMessage'),\n});\n\nexport const TUI_SPIN_TEXTS = new InjectionToken('spin i18n texts', {\n factory: extractI18n('spinTexts'),\n});\n\nexport const TUI_SHORT_WEEK_DAYS = new InjectionToken('calendars i18n texts', {\n factory: extractI18n('shortWeekDays'),\n});\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_ICONS = new InjectionToken<Record<string, string>>(\n 'A key/value dictionary of icon names and src to be defined with TuiSvgService',\n {\n factory: () => ({}),\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiStringHandler} from '@taiga-ui/cdk';\nimport {iconsPathFactory} from '@taiga-ui/core/utils';\n\nexport const TUI_ICONS_PATH: InjectionToken<TuiStringHandler<string>> =\n new InjectionToken<TuiStringHandler<string>>(\n 'A handler to retrieve USE id for icon by name',\n {\n factory: () => iconsPathFactory('assets/taiga-ui/icons/'),\n },\n );\n","import {InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nexport const TUI_IS_MOBILE_RES = new InjectionToken<Observable<boolean>>(\n 'Mobile resolution stream for private providers',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiMedia} from '@taiga-ui/core/interfaces';\n\nexport const TUI_MEDIA = new InjectionToken<TuiMedia>('Token for media constant', {\n factory: () => ({\n mobile: 768,\n desktopSmall: 1024,\n desktopLarge: 1280,\n }),\n});\n","import {InjectionToken} from '@angular/core';\nimport {TuiBrightness} from '@taiga-ui/core/types';\nimport {Observable} from 'rxjs';\n\nexport const TUI_MODE: InjectionToken<Observable<TuiBrightness | null>> =\n new InjectionToken<Observable<TuiBrightness | null>>(\n 'Mode stream for private providers',\n );\n","import {InjectionToken} from '@angular/core';\nimport {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {TuiNotificationAutoClose} from '@taiga-ui/core/interfaces';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport interface NotificationTokenOptions {\n readonly autoClose: TuiNotificationAutoClose;\n readonly label: PolymorpheusContent<TuiContextWithImplicit<TuiNotification>>;\n readonly status: TuiNotification;\n readonly hasIcon: boolean;\n readonly hasCloseButton: boolean;\n}\n\n/** Default values for the notification options. */\nexport const TUI_NOTIFICATION_DEFAULT_OPTIONS: NotificationTokenOptions = {\n autoClose: true,\n label: '',\n status: TuiNotification.Info,\n hasIcon: true,\n hasCloseButton: true,\n};\n\nexport const TUI_NOTIFICATION_OPTIONS = new InjectionToken<NotificationTokenOptions>(\n 'Default parameters for notification alert component',\n {\n factory: () => TUI_NOTIFICATION_DEFAULT_OPTIONS,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';\nimport {NumberFormatSettings} from '@taiga-ui/core/interfaces';\n\nexport const TUI_NUMBER_FORMAT = new InjectionToken<NumberFormatSettings>(\n 'Formatting configuration for displayed numbers',\n {\n factory: () => ({\n decimalSeparator: ',',\n thousandSeparator: CHAR_NO_BREAK_SPACE,\n zeroPadding: true,\n }),\n },\n);\n","import {InjectionToken, TemplateRef} from '@angular/core';\nimport {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport const TUI_OPTION_CONTENT = new InjectionToken<\n PolymorpheusContent<TuiContextWithImplicit<TemplateRef<{}>>>\n>('Content for tuiOption component');\n","import {inject, InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {TUI_FIRST_DAY_OF_WEEK, TUI_SHORT_WEEK_DAYS} from './index';\n\nexport type WEEK_DAYS_NAMES = [string, string, string, string, string, string, string];\n\n// TODO: Remove export in ivy compiation\nexport const convertToSundayFirstWeekFormat = (weekDaysNames: WEEK_DAYS_NAMES) => {\n const sundayIndex = weekDaysNames.length - 1;\n\n return [\n weekDaysNames[sundayIndex],\n ...weekDaysNames.slice(0, sundayIndex),\n ] as WEEK_DAYS_NAMES;\n};\n\nexport const TUI_ORDERED_SHORT_WEEK_DAYS = new InjectionToken<\n Observable<WEEK_DAYS_NAMES>\n>('Ordered calendars i18n texts', {\n factory: () => {\n const firstDayOfWeekIndex = inject(TUI_FIRST_DAY_OF_WEEK);\n\n return inject(TUI_SHORT_WEEK_DAYS).pipe(\n map(convertToSundayFirstWeekFormat),\n map(\n weekDays =>\n [\n ...weekDays.slice(firstDayOfWeekIndex),\n ...weekDays.slice(0, firstDayOfWeekIndex),\n ] as WEEK_DAYS_NAMES,\n ),\n );\n },\n});\n","import {TUI_SANITIZER as TOKEN} from '@taiga-ui/cdk';\n\nexport const TUI_SANITIZER = TOKEN;\n","import {ElementRef, InjectionToken} from '@angular/core';\n\nexport const TUI_SCROLL_REF = new InjectionToken<ElementRef<HTMLElement>>(\n 'Scrollable container',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiStringHandler} from '@taiga-ui/cdk';\nimport {identity} from 'rxjs';\n\nexport const TUI_SVG_SRC_PROCESSOR: InjectionToken<TuiStringHandler<string>> =\n new InjectionToken<TuiStringHandler<string>>('Source path processor for svg', {\n factory: () => identity,\n });\n","import {InjectionToken} from '@angular/core';\nimport {TuiAppearance} from '@taiga-ui/core/enums';\n\nexport const TUI_TEXTFIELD_APPEARANCE = new InjectionToken<string>(\n 'Appearance for inputs',\n {\n factory: () => TuiAppearance.Textfield,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiTextfieldHost} from '@taiga-ui/core/interfaces';\n\nexport const TUI_TEXTFIELD_HOST = new InjectionToken<TuiTextfieldHost>(\n 'An interface to communicate with textfield based controls',\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_THEME = new InjectionToken<string>('Theme name', {\n factory: () => 'Taiga',\n});\n","import {InjectionToken} from '@angular/core';\nimport {ControlValueAccessor} from '@angular/forms';\n\nexport const TUI_VALUE_ACCESSOR = new InjectionToken<ControlValueAccessor>(\n 'Buffer token to pass NG_VALUE_ACCESSOR to a different Injector',\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["TOKEN"],"mappings":";;;;;;;MAEa,uBAAuB,GAAG,IAAI,cAAc,CACrD,2CAA2C,EAC3C;IACI,OAAO,EAAE,MAAM,GAAG;CACrB;;MCDQ,qBAAqB,GAAG,IAAI,cAAc,CACnD,iCAAiC,EACjC;IACI,OAAO,EAAE,OAAO;QACZ,MAAM,EAAE;YACJ,QAAQ,EAAE,MAAM,CAAC,uBAAuB,CAAC;SAC5C;KACJ,CAAC;CACL;;MCXQ,kBAAkB,GAAG,IAAI,cAAc,CAChD,2CAA2C,EAC3C;IACI,OAAO,EAAE,MAAM,SAAS,EAAE;CAC7B;;MCHQ,sBAAsB,GAAG,IAAI,cAAc,CACpD,sBAAsB;;MCDb,kBAAkB,GAAG,IAAI,cAAc,CAChD,qBAAqB;;MCFZ,2BAA2B,GAAG,IAAI,cAAc,CACzD,wBAAwB;;MCAf,sBAAsB,GAAG,IAAI,cAAc,CACpD,+CAA+C;;MCFtC,eAAe,GAAG,IAAI,cAAc,CAC7C,iEAAiE;;MCAxD,qBAAqB,GAAG,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;IACI,OAAO,EAAE;CACZ;;MCJQ,kBAAkB,GAAG,IAAI,cAAc,CAChD,2DAA2D;;MCFlD,SAAS,GAAG,IAAI,cAAc,CAAS,YAAY,EAAE;IAC9D,OAAO,EAAE,MAAM,OAAO;CACzB;;MCDY,kBAAkB,GAAG,IAAI,cAAc,CAChD,gEAAgE;;ACJpE;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-tokens.js","sources":["ng://@taiga-ui/core/tokens/animations-duration.ts","ng://@taiga-ui/core/tokens/animation-options.ts","ng://@taiga-ui/core/tokens/assert-enabled.ts","ng://@taiga-ui/core/tokens/data-list-accessor.ts","ng://@taiga-ui/core/tokens/data-list-host.ts","ng://@taiga-ui/core/tokens/document-or-shadow-root.ts","ng://@taiga-ui/core/tokens/dropdown-directive.ts","ng://@taiga-ui/core/tokens/element-ref.ts","ng://@taiga-ui/core/tokens/first-day-of-week.ts","ng://@taiga-ui/core/tokens/i18n.ts","ng://@taiga-ui/core/tokens/icons.ts","ng://@taiga-ui/core/tokens/icons-path.ts","ng://@taiga-ui/core/tokens/is-mobile-resolution.ts","ng://@taiga-ui/core/tokens/media.ts","ng://@taiga-ui/core/tokens/mode.ts","ng://@taiga-ui/core/tokens/notification-options.ts","ng://@taiga-ui/core/tokens/number-format.ts","ng://@taiga-ui/core/tokens/option-content.ts","ng://@taiga-ui/core/tokens/ordered-short-week-days.ts","ng://@taiga-ui/core/tokens/sanitizer.ts","ng://@taiga-ui/core/tokens/scroll-ref.ts","ng://@taiga-ui/core/tokens/svg-src-processor.ts","ng://@taiga-ui/core/tokens/textfield-appearance.ts","ng://@taiga-ui/core/tokens/textfield-host.ts","ng://@taiga-ui/core/tokens/theme.ts","ng://@taiga-ui/core/tokens/value-accessor.ts","ng://@taiga-ui/core/tokens/taiga-ui-core-tokens.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\n\nexport const TUI_ANIMATIONS_DURATION = new InjectionToken<number>(\n 'Duration of all Taiga UI animations in ms',\n {\n factory: () => 300,\n },\n);\n","import {AnimationOptions} from '@angular/animations';\nimport {inject, InjectionToken} from '@angular/core';\n\nimport {TUI_ANIMATIONS_DURATION} from './animations-duration';\n\nexport const TUI_ANIMATION_OPTIONS = new InjectionToken<AnimationOptions>(\n 'Options for Taiga UI animations',\n {\n factory: () => ({\n params: {\n duration: inject(TUI_ANIMATIONS_DURATION),\n },\n }),\n },\n);\n","import {InjectionToken, isDevMode} from '@angular/core';\n\nexport const TUI_ASSERT_ENABLED = new InjectionToken(\n 'Flag to enable assertions across Taiga UI',\n {\n factory: () => isDevMode(),\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDataListAccessor} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DATA_LIST_ACCESSOR = new InjectionToken<TuiDataListAccessor>(\n 'Accessor for options',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDataListHost} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DATA_LIST_HOST = new InjectionToken<TuiDataListHost<any>>(\n 'DataList controller',\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_DOCUMENT_OR_SHADOW_ROOT = new InjectionToken<DocumentOrShadowRoot>(\n 'Document or ShadowRoot',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDropdown} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DROPDOWN_DIRECTIVE = new InjectionToken<TuiDropdown>(\n 'Directive controlling TuiDropdownBoxComponent',\n);\n","import {ElementRef, InjectionToken} from '@angular/core';\n\nexport const TUI_ELEMENT_REF = new InjectionToken<ElementRef>(\n 'ElementRef when you cannot use @Input for single time injection',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDayOfWeek} from '@taiga-ui/cdk';\n\nexport const TUI_FIRST_DAY_OF_WEEK = new InjectionToken<TuiDayOfWeek>(\n 'The first day of the week index',\n {\n factory: () => TuiDayOfWeek.Monday,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {extractI18n} from '@taiga-ui/i18n';\n\nexport const TUI_MONTHS = new InjectionToken('Localized months names', {\n factory: extractI18n('months'),\n});\n\nexport const TUI_CLOSE_WORD = new InjectionToken(`i18n 'close' word`, {\n factory: extractI18n('close'),\n});\n\nexport const TUI_NOTHING_FOUND_MESSAGE = new InjectionToken(\n `i18n 'Nothing found' message`,\n {\n factory: extractI18n('nothingFoundMessage'),\n },\n);\n\nexport const TUI_DEFAULT_ERROR_MESSAGE = new InjectionToken(`i18n of error message`, {\n factory: extractI18n('defaultErrorMessage'),\n});\n\nexport const TUI_SPIN_TEXTS = new InjectionToken('spin i18n texts', {\n factory: extractI18n('spinTexts'),\n});\n\nexport const TUI_SHORT_WEEK_DAYS = new InjectionToken('calendars i18n texts', {\n factory: extractI18n('shortWeekDays'),\n});\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_ICONS = new InjectionToken<Record<string, string>>(\n 'A key/value dictionary of icon names and src to be defined with TuiSvgService',\n {\n factory: () => ({}),\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiStringHandler} from '@taiga-ui/cdk';\nimport {iconsPathFactory} from '@taiga-ui/core/utils';\n\nexport const TUI_ICONS_PATH: InjectionToken<TuiStringHandler<string>> =\n new InjectionToken<TuiStringHandler<string>>(\n 'A handler to retrieve USE id for icon by name',\n {\n factory: () => iconsPathFactory('assets/taiga-ui/icons/'),\n },\n );\n","import {InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nexport const TUI_IS_MOBILE_RES = new InjectionToken<Observable<boolean>>(\n 'Mobile resolution stream for private providers',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiMedia} from '@taiga-ui/core/interfaces';\n\nexport const TUI_MEDIA = new InjectionToken<TuiMedia>('Token for media constant', {\n factory: () => ({\n mobile: 768,\n desktopSmall: 1024,\n desktopLarge: 1280,\n }),\n});\n","import {InjectionToken} from '@angular/core';\nimport {TuiBrightness} from '@taiga-ui/core/types';\nimport {Observable} from 'rxjs';\n\nexport const TUI_MODE: InjectionToken<Observable<TuiBrightness | null>> =\n new InjectionToken<Observable<TuiBrightness | null>>(\n 'Mode stream for private providers',\n );\n","import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {TuiNotificationAutoClose} from '@taiga-ui/core/interfaces';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport interface TuiNotificationDefaultOptions {\n readonly autoClose: TuiNotificationAutoClose;\n readonly label: PolymorpheusContent<TuiContextWithImplicit<TuiNotification>>;\n readonly status: TuiNotification;\n readonly hasIcon: boolean;\n readonly hasCloseButton: boolean;\n readonly defaultAutoCloseTime: number;\n}\n\n/**\n * @deprecated: remove in v3.0, use TuiNotificationDefaultOptions\n */\nexport type NotificationTokenOptions = TuiNotificationDefaultOptions;\n\n/** Default values for the notification options. */\nexport const TUI_NOTIFICATION_DEFAULT_OPTIONS: TuiNotificationDefaultOptions = {\n autoClose: true,\n label: '',\n status: TuiNotification.Info,\n hasIcon: true,\n hasCloseButton: true,\n defaultAutoCloseTime: 3000,\n};\n\nexport const TUI_NOTIFICATION_OPTIONS = new InjectionToken<TuiNotificationDefaultOptions>(\n 'Default parameters for notification alert component',\n {\n factory: () => TUI_NOTIFICATION_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiNotificationOptionsProvider(\n options: Partial<TuiNotificationDefaultOptions>,\n): ValueProvider {\n return {\n provide: TUI_NOTIFICATION_OPTIONS,\n useValue: {...TUI_NOTIFICATION_DEFAULT_OPTIONS, ...options},\n };\n}\n","import {InjectionToken} from '@angular/core';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';\nimport {NumberFormatSettings} from '@taiga-ui/core/interfaces';\n\nexport const TUI_NUMBER_FORMAT = new InjectionToken<NumberFormatSettings>(\n 'Formatting configuration for displayed numbers',\n {\n factory: () => ({\n decimalSeparator: ',',\n thousandSeparator: CHAR_NO_BREAK_SPACE,\n zeroPadding: true,\n }),\n },\n);\n","import {InjectionToken, TemplateRef} from '@angular/core';\nimport {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport const TUI_OPTION_CONTENT = new InjectionToken<\n PolymorpheusContent<TuiContextWithImplicit<TemplateRef<{}>>>\n>('Content for tuiOption component');\n","import {inject, InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {TUI_FIRST_DAY_OF_WEEK, TUI_SHORT_WEEK_DAYS} from './index';\n\nexport type WEEK_DAYS_NAMES = [string, string, string, string, string, string, string];\n\n// TODO: Remove export in ivy compiation\nexport const convertToSundayFirstWeekFormat = (weekDaysNames: WEEK_DAYS_NAMES) => {\n const sundayIndex = weekDaysNames.length - 1;\n\n return [\n weekDaysNames[sundayIndex],\n ...weekDaysNames.slice(0, sundayIndex),\n ] as WEEK_DAYS_NAMES;\n};\n\nexport const TUI_ORDERED_SHORT_WEEK_DAYS = new InjectionToken<\n Observable<WEEK_DAYS_NAMES>\n>('Ordered calendars i18n texts', {\n factory: () => {\n const firstDayOfWeekIndex = inject(TUI_FIRST_DAY_OF_WEEK);\n\n return inject(TUI_SHORT_WEEK_DAYS).pipe(\n map(convertToSundayFirstWeekFormat),\n map(\n weekDays =>\n [\n ...weekDays.slice(firstDayOfWeekIndex),\n ...weekDays.slice(0, firstDayOfWeekIndex),\n ] as WEEK_DAYS_NAMES,\n ),\n );\n },\n});\n","import {TUI_SANITIZER as TOKEN} from '@taiga-ui/cdk';\n\nexport const TUI_SANITIZER = TOKEN;\n","import {ElementRef, InjectionToken} from '@angular/core';\n\nexport const TUI_SCROLL_REF = new InjectionToken<ElementRef<HTMLElement>>(\n 'Scrollable container',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiStringHandler} from '@taiga-ui/cdk';\nimport {identity} from 'rxjs';\n\nexport const TUI_SVG_SRC_PROCESSOR: InjectionToken<TuiStringHandler<string>> =\n new InjectionToken<TuiStringHandler<string>>('Source path processor for svg', {\n factory: () => identity,\n });\n","import {InjectionToken} from '@angular/core';\nimport {TuiAppearance} from '@taiga-ui/core/enums';\n\nexport const TUI_TEXTFIELD_APPEARANCE = new InjectionToken<string>(\n 'Appearance for inputs',\n {\n factory: () => TuiAppearance.Textfield,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiTextfieldHost} from '@taiga-ui/core/interfaces';\n\nexport const TUI_TEXTFIELD_HOST = new InjectionToken<TuiTextfieldHost>(\n 'An interface to communicate with textfield based controls',\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_THEME = new InjectionToken<string>('Theme name', {\n factory: () => 'Taiga',\n});\n","import {InjectionToken} from '@angular/core';\nimport {ControlValueAccessor} from '@angular/forms';\n\nexport const TUI_VALUE_ACCESSOR = new InjectionToken<ControlValueAccessor>(\n 'Buffer token to pass NG_VALUE_ACCESSOR to a different Injector',\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["TOKEN"],"mappings":";;;;;;;MAEa,uBAAuB,GAAG,IAAI,cAAc,CACrD,2CAA2C,EAC3C;IACI,OAAO,EAAE,MAAM,GAAG;CACrB;;MCDQ,qBAAqB,GAAG,IAAI,cAAc,CACnD,iCAAiC,EACjC;IACI,OAAO,EAAE,OAAO;QACZ,MAAM,EAAE;YACJ,QAAQ,EAAE,MAAM,CAAC,uBAAuB,CAAC;SAC5C;KACJ,CAAC;CACL;;MCXQ,kBAAkB,GAAG,IAAI,cAAc,CAChD,2CAA2C,EAC3C;IACI,OAAO,EAAE,MAAM,SAAS,EAAE;CAC7B;;MCHQ,sBAAsB,GAAG,IAAI,cAAc,CACpD,sBAAsB;;MCDb,kBAAkB,GAAG,IAAI,cAAc,CAChD,qBAAqB;;MCFZ,2BAA2B,GAAG,IAAI,cAAc,CACzD,wBAAwB;;MCAf,sBAAsB,GAAG,IAAI,cAAc,CACpD,+CAA+C;;MCFtC,eAAe,GAAG,IAAI,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a,GAAGA;;MCAhB,cAAc,GAAG,IAAI,cAAc,CAC5C,sBAAsB;;MCCb,qBAAqB,GAC9B,IAAI,cAAc,CAA2B,+BAA+B,EAAE;IAC1E,OAAO,EAAE,MAAM,QAAQ;CAC1B;;MCJQ,wBAAwB,GAAG,IAAI,cAAc,CACtD,uBAAuB,EACvB;IACI,OAAO,EAAE;CACZ;;MCJQ,kBAAkB,GAAG,IAAI,cAAc,CAChD,2DAA2D;;MCFlD,SAAS,GAAG,IAAI,cAAc,CAAS,YAAY,EAAE;IAC9D,OAAO,EAAE,MAAM,OAAO;CACzB;;MCDY,kBAAkB,GAAG,IAAI,cAAc,CAChD,gEAAgE;;ACJpE;;;;;;"}
|
|
@@ -49,7 +49,7 @@ function processIcon(source, name) {
|
|
|
49
49
|
if (!attributes ||
|
|
50
50
|
!attributes.includes(WIDTH_SEARCH) ||
|
|
51
51
|
!attributes.includes(HEIGHT_SEARCH)) {
|
|
52
|
-
return
|
|
52
|
+
return `${src.replace(START, `<svg xmlns="http://www.w3.org/2000/svg"><g id="${name}" xmlns="http://www.w3.org/2000/svg"><svg`)}</g></svg>`;
|
|
53
53
|
}
|
|
54
54
|
const indexOfWidth = attributes.indexOf(WIDTH_SEARCH);
|
|
55
55
|
const indexOfHeight = attributes.indexOf(HEIGHT_SEARCH);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-utils-dom.js","sources":["ng://@taiga-ui/core/utils/dom/are-css-vars-supported.ts","ng://@taiga-ui/core/utils/dom/check-fixed-position.ts","ng://@taiga-ui/core/utils/dom/get-safe-area-size.ts","ng://@taiga-ui/core/utils/dom/get-screen-width.ts","ng://@taiga-ui/core/utils/dom/process-icon.ts","ng://@taiga-ui/core/utils/dom/taiga-ui-core-utils-dom.ts"],"sourcesContent":["import {isEdgeOlderThan} from '@taiga-ui/cdk';\n\n/**\n * TODO: remove \"any\" in new TS version; https://github.com/ng-web-apis/common/pull/6\n */\nexport function areCssVarsSupported(cssRef: any, userAgent: string): boolean {\n return cssRef.supports('(--a: 0)') && !isEdgeOlderThan(17, userAgent);\n}\n","export function checkFixedPosition(element: HTMLElement | null): boolean {\n if (!element || typeof getComputedStyle === 'undefined') {\n return false;\n }\n\n const style = getComputedStyle(element);\n\n return (\n style.getPropertyValue('position') === 'fixed' ||\n checkFixedPosition(element.parentElement)\n );\n}\n","/**\n * Calculates size of safe area on mobile devices (status bars)\n *\n * ATTENTION: Only use in browser environment\n */\nexport function getSafeAreaSize(): number {\n if (!CSS.supports('padding-top: env(safe-area-inset-top)')) {\n return 0;\n }\n\n const div = document.createElement('div');\n\n div.style.paddingTop = 'env(safe-area-inset-top)';\n document.body.appendChild(div);\n\n const safeAreaSize = parseInt(window.getComputedStyle(div).paddingTop!, 10) || 0;\n\n document.body.removeChild(div);\n\n return safeAreaSize;\n}\n","export function getScreenWidth(documentRef: Document): number {\n return Math.max(\n documentRef.documentElement.clientWidth,\n documentRef.defaultView ? documentRef.defaultView.innerWidth : 0,\n );\n}\n","const WIDTH_SEARCH = 'width=\"';\nconst HEIGHT_SEARCH = 'height=\"';\nconst START = '<svg';\n\nexport function processIcon(source: string, name: string): string {\n if (source.includes(`id=\"${name}\"`)) {\n return source;\n }\n\n const src = source.substring(source.indexOf(START));\n const attributes = src.substring(0, src.indexOf('>'));\n\n if (\n !attributes ||\n !attributes.includes(WIDTH_SEARCH) ||\n !attributes.includes(HEIGHT_SEARCH)\n ) {\n return
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-utils-dom.js","sources":["ng://@taiga-ui/core/utils/dom/are-css-vars-supported.ts","ng://@taiga-ui/core/utils/dom/check-fixed-position.ts","ng://@taiga-ui/core/utils/dom/get-safe-area-size.ts","ng://@taiga-ui/core/utils/dom/get-screen-width.ts","ng://@taiga-ui/core/utils/dom/process-icon.ts","ng://@taiga-ui/core/utils/dom/taiga-ui-core-utils-dom.ts"],"sourcesContent":["import {isEdgeOlderThan} from '@taiga-ui/cdk';\n\n/**\n * TODO: remove \"any\" in new TS version; https://github.com/ng-web-apis/common/pull/6\n */\nexport function areCssVarsSupported(cssRef: any, userAgent: string): boolean {\n return cssRef.supports('(--a: 0)') && !isEdgeOlderThan(17, userAgent);\n}\n","export function checkFixedPosition(element: HTMLElement | null): boolean {\n if (!element || typeof getComputedStyle === 'undefined') {\n return false;\n }\n\n const style = getComputedStyle(element);\n\n return (\n style.getPropertyValue('position') === 'fixed' ||\n checkFixedPosition(element.parentElement)\n );\n}\n","/**\n * Calculates size of safe area on mobile devices (status bars)\n *\n * ATTENTION: Only use in browser environment\n */\nexport function getSafeAreaSize(): number {\n if (!CSS.supports('padding-top: env(safe-area-inset-top)')) {\n return 0;\n }\n\n const div = document.createElement('div');\n\n div.style.paddingTop = 'env(safe-area-inset-top)';\n document.body.appendChild(div);\n\n const safeAreaSize = parseInt(window.getComputedStyle(div).paddingTop!, 10) || 0;\n\n document.body.removeChild(div);\n\n return safeAreaSize;\n}\n","export function getScreenWidth(documentRef: Document): number {\n return Math.max(\n documentRef.documentElement.clientWidth,\n documentRef.defaultView ? documentRef.defaultView.innerWidth : 0,\n );\n}\n","const WIDTH_SEARCH = 'width=\"';\nconst HEIGHT_SEARCH = 'height=\"';\nconst START = '<svg';\n\nexport function processIcon(source: string, name: string): string {\n if (source.includes(`id=\"${name}\"`)) {\n return source;\n }\n\n const src = source.substring(source.indexOf(START));\n const attributes = src.substring(0, src.indexOf('>'));\n\n if (\n !attributes ||\n !attributes.includes(WIDTH_SEARCH) ||\n !attributes.includes(HEIGHT_SEARCH)\n ) {\n return `${src.replace(\n START,\n `<svg xmlns=\"http://www.w3.org/2000/svg\"><g id=\"${name}\" xmlns=\"http://www.w3.org/2000/svg\"><svg`,\n )}</g></svg>`;\n }\n\n const indexOfWidth = attributes.indexOf(WIDTH_SEARCH);\n const indexOfHeight = attributes.indexOf(HEIGHT_SEARCH);\n const widthOffset = indexOfWidth + WIDTH_SEARCH.length;\n const heightOffset = indexOfHeight + HEIGHT_SEARCH.length;\n const widthString = attributes.substring(\n widthOffset,\n attributes.indexOf('\"', widthOffset),\n );\n const heightString = attributes.substring(\n heightOffset,\n attributes.indexOf('\"', heightOffset),\n );\n\n if (\n !heightString ||\n !widthString ||\n widthString.includes('%') ||\n heightString.includes('%') ||\n widthString.includes('em') ||\n heightString.includes('em')\n ) {\n return src.replace(START, `<svg id=\"${name}\"`);\n }\n\n const width = parseInt(widthString, 10);\n const height = parseInt(heightString, 10);\n\n return `<g id=\"${name}\" xmlns=\"http://www.w3.org/2000/svg\"><svg x=\"50%\" y=\"50%\" width=\"${\n width / 16\n }em\" height=\"${\n height / 16\n }em\" overflow=\"visible\" viewBox=\"0 0 ${width} ${height}\"><svg x=\"${-width / 2}\" y=\"${\n -height / 2\n }\">${src}</svg></svg></g>`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA;;;SAGgB,mBAAmB,CAAC,MAAW,EAAE,SAAiB;IAC9D,OAAO,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;AAC1E;;SCPgB,kBAAkB,CAAC,OAA2B;IAC1D,IAAI,CAAC,OAAO,IAAI,OAAO,gBAAgB,KAAK,WAAW,EAAE;QACrD,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAExC,QACI,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,OAAO;QAC9C,kBAAkB,CAAC,OAAO,CAAC,aAAa,CAAC,EAC3C;AACN;;ACXA;;;;;SAKgB,eAAe;IAC3B,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,uCAAuC,CAAC,EAAE;QACxD,OAAO,CAAC,CAAC;KACZ;IAED,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAE1C,GAAG,CAAC,KAAK,CAAC,UAAU,GA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aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACxD,MAAM,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC;IACvD,MAAM,YAAY,GAAG,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC;IAC1D,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,CACpC,WAAW,EACX,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,CACvC,CAAC;IACF,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CACrC,YAAY,EACZ,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,CACxC,CAAC;IAEF,IACI,CAAC,YAAY;QACb,CAAC,WAAW;QACZ,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC;QACzB,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC1B,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC1B,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC7B;QACE,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,IAAI,GAAG,CAAC,CAAC;KAClD;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAE1C,OAAO,UAAU,IAAI,qEACjB,KAAK,GAAG,EACZ,eACI,MAAM,GAAG,EACb,uCAAuC,KAAK,IAAI,MAAM,aAAa,CAAC,KAAK,GAAG,CAAC,QACzE,CAAC,MAAM,GAAG,CACd,KAAK,GAAG,kBAAkB,CAAC;AAC/B;;ACzDA;;;;;;"}
|
|
@@ -44,7 +44,7 @@ function getFractionPartPadded(value, precision) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Formats number adding thousand separators and correct decimal separator
|
|
47
|
+
* Formats number adding a thousand separators and correct decimal separator
|
|
48
48
|
* padding decimal part with zeroes to given length
|
|
49
49
|
*
|
|
50
50
|
* @param value the input number
|
|
@@ -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/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","/**\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.substr(0, precision)\n : fractionPartPadded;\n}\n","import {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';\n\nimport {getFractionPartPadded} from './get-fractional-part-padded';\n\n/**\n * Formats number adding 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 const zeroPaddingSize: number = zeroPadding\n ? Math.max(decimalLimit - fractionPartPadded.length, 0)\n : 0;\n const zeroPartString = '0'.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? '-' : '';\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 || decimalLimit\n ? result + decimalSeparator + fractionPartPadded\n : result;\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('+', '');\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: 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,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AAClF;;ACTA;;;;;;SAMgB,wBAAwB,CAAC,KAAa;IAClD,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC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,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/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","/**\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.substr(0, precision)\n : fractionPartPadded;\n}\n","import {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';\n\nimport {getFractionPartPadded} from './get-fractional-part-padded';\n\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 const zeroPaddingSize: number = zeroPadding\n ? Math.max(decimalLimit - fractionPartPadded.length, 0)\n : 0;\n const zeroPartString = '0'.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? '-' : '';\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 || decimalLimit\n ? result + decimalSeparator + fractionPartPadded\n : result;\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('+', '');\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: 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,IAAI,IAAI,IAAI,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AE,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,5 +1,5 @@
|
|
|
1
1
|
import { CHAR_NO_BREAK_SPACE, tuiAssert, isSafari, isNativeFocused, getDocumentOrShadowRoot, CHAR_EN_DASH } from '@taiga-ui/cdk';
|
|
2
|
-
import { MASK_CARET_TRAP, TUI_DIGIT_REGEXP, TUI_NON_DIGITS_REGEXP, TUI_LEADING_ZEROES_REGEXP } from '@taiga-ui/core/constants';
|
|
2
|
+
import { MASK_CARET_TRAP, TUI_DIGIT_REGEXP, TUI_NON_DIGITS_REGEXP, TUI_LEADING_ZEROES_REGEXP, TUI_DECIMAL_SYMBOLS } from '@taiga-ui/core/constants';
|
|
3
3
|
import { otherDecimalSymbol } from '@taiga-ui/core/utils/format';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -50,7 +50,7 @@ function tuiCreateAutoCorrectedNumberPipe(decimalLimit = 0, decimalSymbol = ',',
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
function addDecimalSymbolIfNeeded(value, decimalSymbol = ',') {
|
|
53
|
-
return value.
|
|
53
|
+
return !value.includes(decimalSymbol) ? value + decimalSymbol : value;
|
|
54
54
|
}
|
|
55
55
|
function calculateSafariCaret(previousValue = '', current, previousCaret, decimalSymbol = ',') {
|
|
56
56
|
const tailRegex = new RegExp(`${decimalSymbol}.+`);
|
|
@@ -120,7 +120,6 @@ function tuiCreateCorrectionMask(allowed, correctionHandler) {
|
|
|
120
120
|
const NON_ZERO_DIGIT = /[1-9]/;
|
|
121
121
|
/**
|
|
122
122
|
* Adaptation for {@link https://github.com/text-mask/text-mask/tree/master/addons#createnumbermask `createNumberMask`}
|
|
123
|
-
* @todo TODO: autocCorrectDecimalSymbol is no longer needed. Remove it in 3.0
|
|
124
123
|
*/
|
|
125
124
|
function tuiCreateNumberMask({ allowDecimal = false, decimalSymbol = ',', thousandSymbol = CHAR_NO_BREAK_SPACE, autoCorrectDecimalSymbol = true, decimalLimit = 2, requireDecimal = false, allowNegative = false, integerLimit = 0, } = {}) {
|
|
126
125
|
tuiAssert.assert(Number.isInteger(decimalLimit));
|
|
@@ -232,6 +231,10 @@ function addThousandsSeparator(strNumber, thousandSymbol) {
|
|
|
232
231
|
: strNumber;
|
|
233
232
|
}
|
|
234
233
|
|
|
234
|
+
function tuiEnableAutoCorrectDecimalSymbol({ thousandSeparator, }) {
|
|
235
|
+
return !TUI_DECIMAL_SYMBOLS.includes(thousandSeparator);
|
|
236
|
+
}
|
|
237
|
+
|
|
235
238
|
function maskedMoneyValueIsEmpty(value) {
|
|
236
239
|
switch (value) {
|
|
237
240
|
case '':
|
|
@@ -252,5 +255,5 @@ function maskedNumberStringToNumber(value, decimalsSymbol, thousandSymbol) {
|
|
|
252
255
|
* Generated bundle index. Do not edit.
|
|
253
256
|
*/
|
|
254
257
|
|
|
255
|
-
export { maskedMoneyValueIsEmpty, maskedNumberStringToNumber, tuiCreateAutoCorrectedNumberPipe, tuiCreateCorrectionMask, tuiCreateNumberMask };
|
|
258
|
+
export { maskedMoneyValueIsEmpty, maskedNumberStringToNumber, tuiCreateAutoCorrectedNumberPipe, tuiCreateCorrectionMask, tuiCreateNumberMask, tuiEnableAutoCorrectDecimalSymbol };
|
|
256
259
|
//# 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/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_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,\n allowNegative?: boolean,\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\n const unlucky = !!nativeInput && isSafari(nativeInput);\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 === '-' && allowNegative) {\n return '-';\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.indexOf(decimalSymbol) === -1 ? 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_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 * @todo TODO: autocCorrectDecimalSymbol is no longer needed. Remove it in 3.0\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] === '-' || rawValue[0] === CHAR_EN_DASH) && 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.substr(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('-');\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 ? strNumber.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandSymbol)\n : strNumber;\n}\n","export function maskedMoneyValueIsEmpty(value: string): boolean {\n switch (value) {\n case '':\n case '-':\n case ',':\n case '-,':\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":";;;;AAUA;;;SAGgB,gCAAgC,CAC5C,eAAuB,CAAC,EACxB,gBAAkC,GAAG,EACrC,iBAAyB,mBAAmB,EAC5C,WAA8B,EAC9B,aAAuB;IAEvB,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;IAEvB,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEvD,IAAI,WAAW,IAAI,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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_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): 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\n const unlucky = !!nativeInput && isSafari(nativeInput);\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 === '-' && allowNegative) {\n return '-';\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_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] === '-' || rawValue[0] === CHAR_EN_DASH) && 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.substr(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('-');\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 ? strNumber.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandSymbol)\n : strNumber;\n}\n","import {TUI_DECIMAL_SYMBOLS} from '@taiga-ui/core/constants';\nimport {NumberFormatSettings} from '@taiga-ui/core/interfaces';\n\nexport function tuiEnableAutoCorrectDecimalSymbol({\n thousandSeparator,\n}: NumberFormatSettings): boolean {\n return !TUI_DECIMAL_SYMBOLS.includes(thousandSeparator);\n}\n","export function maskedMoneyValueIsEmpty(value: string): boolean {\n switch (value) {\n case '':\n case '-':\n case ',':\n case '-,':\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":";;;;AAUA;;;SAGgB,gCAAgC,CAC5C,eAAuB,CAAC,EACxB,gBAAkC,GAAG,EACrC,iBAAyB,mBAAmB,EAC5C,WAAqC,EACrC,aAA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,KAAK;QACT,KAAK,EAAE,CAAC;QACR,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,IAAI;YACL,OAAO,IAAI,CAAC;QAChB;YACI,OAAO,KAAK,CAAC;KACpB;AACL;;SCRgB,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;;;;;;"}
|
|
@@ -34,7 +34,7 @@ function getBorder(hasIcon, hasCleaner = false, hasTooltip = false, hasContent =
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function iconsPathFactory(staticPath) {
|
|
37
|
-
const base = staticPath[staticPath.length - 1] === '/' ? staticPath : staticPath
|
|
37
|
+
const base = staticPath[staticPath.length - 1] === '/' ? staticPath : `${staticPath}/`;
|
|
38
38
|
return name => {
|
|
39
39
|
if (name.startsWith('tuiIcon')) {
|
|
40
40
|
return `${base}${name}.svg#${name}`;
|
|
@@ -47,7 +47,7 @@ function iconsPathFactory(staticPath) {
|
|
|
47
47
|
* Check if pressed key is interactive in terms of input field
|
|
48
48
|
*/
|
|
49
49
|
function isEditingKey(key) {
|
|
50
|
-
return key.length === 1 || tuiEditingKeys.
|
|
50
|
+
return key.length === 1 || tuiEditingKeys.includes(key);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
function isPresumedHTMLString(candidate) {
|