@taiga-ui/kit 4.43.0 → 4.44.0-canary.0bcf1bf
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/components/avatar/avatar.options.d.ts +2 -1
- package/components/badge/badge.options.d.ts +2 -1
- package/components/badge-notification/badge-notification.options.d.ts +2 -1
- package/components/block/block.options.d.ts +2 -1
- package/components/breadcrumbs/breadcrumbs.options.d.ts +2 -1
- package/components/checkbox/checkbox.options.d.ts +2 -1
- package/components/chip/chip.options.d.ts +2 -1
- package/components/combo-box/combo-box.directive.d.ts +0 -1
- package/components/files/input-files/input-files.options.d.ts +2 -1
- package/components/index.d.ts +1 -0
- package/components/input-chip/input-chip.directive.d.ts +1 -0
- package/components/input-color/index.d.ts +2 -0
- package/components/input-color/input-color.component.d.ts +23 -0
- package/components/input-color/input-color.options.d.ts +6 -0
- package/components/input-date-range/input-date-range.options.d.ts +2 -1
- package/components/input-month/input-month.options.d.ts +2 -1
- package/components/input-month-range/input-month-range.options.d.ts +2 -1
- package/components/input-password/input-password.options.d.ts +2 -1
- package/components/input-phone-international/input-phone-international.options.d.ts +2 -1
- package/components/input-time/input-time.directive.d.ts +7 -2
- package/components/input-time/input-time.options.d.ts +1 -1
- package/components/line-clamp/line-clamp.options.d.ts +2 -1
- package/components/multi-select/index.d.ts +1 -0
- package/components/multi-select/multi-select-native/multi-select-native.component.d.ts +20 -0
- package/components/multi-select/multi-select.d.ts +3 -1
- package/components/pdf-viewer/pdf-viewer.options.d.ts +2 -1
- package/components/preview/index.d.ts +2 -2
- package/components/preview/preview.d.ts +1 -1
- package/components/progress/progress.options.d.ts +2 -1
- package/components/push/push.options.d.ts +2 -1
- package/components/radio/radio.options.d.ts +2 -1
- package/components/rating/rating.options.d.ts +2 -1
- package/components/select/select-option/select-option.component.d.ts +2 -2
- package/components/slider/helpers/slider-thumb-label.component.d.ts +1 -1
- package/components/slider/slider.options.d.ts +2 -1
- package/components/switch/switch.options.d.ts +2 -1
- package/components/tabs/tabs.options.d.ts +2 -1
- package/components/tabs/tabs.providers.d.ts +2 -1
- package/components/tiles/tiles.tokens.d.ts +2 -1
- package/components/tree/misc/tree.tokens.d.ts +9 -8
- package/directives/chevron/chevron.directive.d.ts +2 -1
- package/directives/fluid-typography/fluid-typography.options.d.ts +2 -1
- package/directives/index.d.ts +1 -0
- package/directives/shimmer/index.d.ts +1 -0
- package/directives/shimmer/shimmer.directive.d.ts +13 -0
- package/esm2022/components/accordion/accordion-item.component.mjs +3 -3
- package/esm2022/components/avatar/avatar-labeled.component.mjs +3 -3
- package/esm2022/components/avatar/avatar-stack.component.mjs +2 -2
- package/esm2022/components/avatar/avatar.options.mjs +6 -3
- package/esm2022/components/badge/badge.options.mjs +6 -3
- package/esm2022/components/badge-notification/badge-notification.options.mjs +6 -3
- package/esm2022/components/block/block.options.mjs +6 -3
- package/esm2022/components/breadcrumbs/breadcrumbs.component.mjs +3 -3
- package/esm2022/components/breadcrumbs/breadcrumbs.options.mjs +6 -3
- package/esm2022/components/checkbox/checkbox.options.mjs +6 -3
- package/esm2022/components/chip/chip.options.mjs +6 -3
- package/esm2022/components/combo-box/combo-box.directive.mjs +6 -7
- package/esm2022/components/confirm/confirm.component.mjs +3 -3
- package/esm2022/components/elastic-container/elastic-container.component.mjs +3 -3
- package/esm2022/components/files/file/file.component.mjs +4 -5
- package/esm2022/components/files/files/files.component.mjs +3 -3
- package/esm2022/components/files/input-files/input-files.options.mjs +6 -3
- package/esm2022/components/filter/filter.component.mjs +3 -3
- package/esm2022/components/floating-container/floating-container.directive.mjs +2 -2
- package/esm2022/components/index.mjs +2 -1
- package/esm2022/components/input-chip/input-chip.component.mjs +3 -3
- package/esm2022/components/input-chip/input-chip.directive.mjs +6 -8
- package/esm2022/components/input-color/index.mjs +3 -0
- package/esm2022/components/input-color/input-color.component.mjs +89 -0
- package/esm2022/components/input-color/input-color.options.mjs +6 -0
- package/esm2022/components/input-color/taiga-ui-kit-components-input-color.mjs +5 -0
- package/esm2022/components/input-date-range/input-date-range.options.mjs +9 -7
- package/esm2022/components/input-inline/input-inline.component.mjs +3 -3
- package/esm2022/components/input-month/input-month.options.mjs +9 -7
- package/esm2022/components/input-month-range/input-month-range.options.mjs +9 -7
- package/esm2022/components/input-number/step/input-number-step.component.mjs +3 -3
- package/esm2022/components/input-password/input-password.options.mjs +6 -3
- package/esm2022/components/input-phone-international/input-phone-international.options.mjs +6 -3
- package/esm2022/components/input-pin/input-pin.component.mjs +3 -3
- package/esm2022/components/input-time/input-time.component.mjs +2 -5
- package/esm2022/components/input-time/input-time.directive.mjs +39 -11
- package/esm2022/components/input-time/input-time.options.mjs +2 -1
- package/esm2022/components/line-clamp/line-clamp-box.component.mjs +3 -3
- package/esm2022/components/line-clamp/line-clamp.component.mjs +3 -3
- package/esm2022/components/line-clamp/line-clamp.options.mjs +6 -3
- package/esm2022/components/multi-select/index.mjs +2 -1
- package/esm2022/components/multi-select/multi-select-group/multi-select-group.component.mjs +3 -3
- package/esm2022/components/multi-select/multi-select-native/multi-select-native.component.mjs +56 -0
- package/esm2022/components/multi-select/multi-select-option/multi-select-option.component.mjs +4 -9
- package/esm2022/components/multi-select/multi-select.mjs +3 -1
- package/esm2022/components/pagination/pagination.component.mjs +3 -3
- package/esm2022/components/pdf-viewer/pdf-viewer.component.mjs +3 -3
- package/esm2022/components/pdf-viewer/pdf-viewer.options.mjs +6 -3
- package/esm2022/components/pin/pin.directive.mjs +2 -2
- package/esm2022/components/preview/{preview-action → action}/preview-action.directive.mjs +1 -1
- package/esm2022/components/preview/dialog/index.mjs +4 -0
- package/esm2022/components/preview/{preview-dialog → dialog}/preview-dialog.component.mjs +1 -1
- package/esm2022/components/preview/{preview-dialog → dialog}/preview-dialog.directive.mjs +1 -1
- package/esm2022/components/preview/{preview-dialog → dialog}/preview-dialog.service.mjs +1 -1
- package/esm2022/components/preview/dialog/taiga-ui-kit-components-preview-dialog.mjs +5 -0
- package/esm2022/components/preview/index.mjs +3 -3
- package/esm2022/components/preview/pagination/preview-pagination.component.mjs +4 -4
- package/esm2022/components/preview/preview.component.mjs +4 -4
- package/esm2022/components/preview/preview.mjs +2 -2
- package/esm2022/components/preview/zoom/preview-zoom.component.mjs +4 -4
- package/esm2022/components/progress/progress-bar/fixed-gradient/progress-fixed-gradient.directive.mjs +2 -2
- package/esm2022/components/progress/progress-bar/progress-bar.component.mjs +2 -2
- package/esm2022/components/progress/progress.options.mjs +6 -3
- package/esm2022/components/push/push-alert.component.mjs +3 -3
- package/esm2022/components/push/push.component.mjs +3 -3
- package/esm2022/components/push/push.options.mjs +6 -3
- package/esm2022/components/radio/radio.options.mjs +6 -3
- package/esm2022/components/rating/rating.component.mjs +3 -3
- package/esm2022/components/rating/rating.options.mjs +6 -3
- package/esm2022/components/select/select-option/select-option.component.mjs +23 -9
- package/esm2022/components/slider/helpers/slider-thumb-label.component.mjs +5 -4
- package/esm2022/components/slider/slider.component.mjs +2 -2
- package/esm2022/components/slider/slider.options.mjs +6 -3
- package/esm2022/components/stepper/step.component.mjs +3 -3
- package/esm2022/components/switch/switch.options.mjs +6 -3
- package/esm2022/components/tabs/tabs-with-more.component.mjs +3 -3
- package/esm2022/components/tabs/tabs.options.mjs +6 -3
- package/esm2022/components/tabs/tabs.providers.mjs +3 -4
- package/esm2022/components/textarea/textarea-limit.directive.mjs +2 -2
- package/esm2022/components/textarea/textarea.component.mjs +3 -3
- package/esm2022/components/tiles/tiles.tokens.mjs +5 -3
- package/esm2022/components/tree/components/tree-item/tree-item.component.mjs +3 -3
- package/esm2022/components/tree/components/tree-item-content/tree-item-content.component.mjs +3 -3
- package/esm2022/components/tree/misc/tree.tokens.mjs +18 -10
- package/esm2022/directives/chevron/chevron.directive.mjs +6 -4
- package/esm2022/directives/fade/fade.directive.mjs +10 -12
- package/esm2022/directives/fluid-typography/fluid-typography.options.mjs +6 -3
- package/esm2022/directives/index.mjs +2 -1
- package/esm2022/directives/shimmer/index.mjs +2 -0
- package/esm2022/directives/shimmer/shimmer.directive.mjs +68 -0
- package/esm2022/directives/shimmer/taiga-ui-kit-directives-shimmer.mjs +5 -0
- package/esm2022/pipes/emails/emails.options.mjs +13 -11
- package/esm2022/pipes/filter-by-input/filter-by-input.pipe.mjs +2 -2
- package/esm2022/tokens/calendar-date-stream.mjs +3 -4
- package/esm2022/tokens/date-inputs-value-transformers.mjs +8 -6
- package/esm2022/tokens/i18n.mjs +74 -26
- package/esm2022/tokens/items-handlers.mjs +6 -3
- package/esm2022/tokens/mobile-calendar.mjs +3 -4
- package/esm2022/tokens/month-formatter.mjs +10 -9
- package/esm2022/tokens/preview-icons.mjs +6 -3
- package/esm2022/tokens/validation-errors.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-accordion.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-avatar.mjs +9 -7
- package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-block.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +7 -5
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-checkbox.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-checkbox.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-chip.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs +5 -6
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-confirm.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-elastic-container.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-elastic-container.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs +10 -9
- package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-filter.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-floating-container.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-floating-container.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs +6 -9
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-color.mjs +100 -0
- package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +8 -6
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +8 -6
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month.mjs +8 -6
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-password.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-input-password.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-time.mjs +41 -15
- package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +9 -7
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs +57 -14
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pagination.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs +7 -5
- package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pin.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-pin.mjs.map +1 -1
- package/fesm2022/{taiga-ui-kit-components-preview-preview-dialog.mjs → taiga-ui-kit-components-preview-dialog.mjs} +1 -1
- package/fesm2022/taiga-ui-kit-components-preview-dialog.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-components-preview.mjs +65 -65
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-progress.mjs +9 -7
- package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-push.mjs +9 -7
- package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-radio.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-radio.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-rating.mjs +7 -5
- package/fesm2022/taiga-ui-kit-components-rating.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-select.mjs +22 -8
- package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-slider.mjs +11 -8
- package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-stepper.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-switch.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tabs.mjs +8 -6
- package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tiles.mjs +5 -3
- package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tree.mjs +22 -14
- package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components.mjs +1 -0
- package/fesm2022/taiga-ui-kit-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs +5 -3
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-fade.mjs +9 -11
- package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs +5 -3
- package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +74 -0
- package/fesm2022/taiga-ui-kit-directives-shimmer.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-directives.mjs +1 -0
- package/fesm2022/taiga-ui-kit-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-emails.mjs +12 -11
- package/fesm2022/taiga-ui-kit-pipes-emails.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs +1 -1
- package/fesm2022/taiga-ui-kit-pipes-filter-by-input.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-tokens.mjs +99 -41
- package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
- package/package.json +25 -13
- package/pipes/emails/emails.options.d.ts +2 -1
- package/styles/components/pin.less +2 -2
- package/styles/components/progress-bar.less +1 -1
- package/tokens/calendar-date-stream.d.ts +2 -1
- package/tokens/date-inputs-value-transformers.d.ts +5 -4
- package/tokens/i18n.d.ts +25 -24
- package/tokens/items-handlers.d.ts +2 -1
- package/tokens/mobile-calendar.d.ts +2 -1
- package/tokens/month-formatter.d.ts +2 -1
- package/tokens/preview-icons.d.ts +2 -1
- package/tokens/validation-errors.d.ts +2 -1
- package/esm2022/components/preview/preview-dialog/index.mjs +0 -4
- package/esm2022/components/preview/preview-dialog/taiga-ui-kit-components-preview-preview-dialog.mjs +0 -5
- package/fesm2022/taiga-ui-kit-components-preview-preview-dialog.mjs.map +0 -1
- /package/components/preview/{preview-action → action}/preview-action.directive.d.ts +0 -0
- /package/components/preview/{preview-dialog → dialog}/index.d.ts +0 -0
- /package/components/preview/{preview-dialog → dialog}/preview-dialog.component.d.ts +0 -0
- /package/components/preview/{preview-dialog → dialog}/preview-dialog.directive.d.ts +0 -0
- /package/components/preview/{preview-dialog → dialog}/preview-dialog.service.d.ts +0 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { NgIf } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, signal, computed, Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
|
|
4
|
+
import * as i3 from '@angular/forms';
|
|
5
|
+
import { FormsModule } from '@angular/forms';
|
|
6
|
+
import * as i1 from '@maskito/angular';
|
|
7
|
+
import { MaskitoDirective } from '@maskito/angular';
|
|
8
|
+
import { maskitoPrefixPostprocessorGenerator, maskitoAddOnFocusPlugin, maskitoRemoveOnBlurPlugin } from '@maskito/kit';
|
|
9
|
+
import { TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
|
|
10
|
+
import { tuiFallbackValueProvider } from '@taiga-ui/cdk/tokens';
|
|
11
|
+
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
12
|
+
import { tuiDirectiveBinding } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
13
|
+
import * as i2 from '@taiga-ui/core/components/textfield';
|
|
14
|
+
import { TuiTextfieldContent, TuiWithTextfield } from '@taiga-ui/core/components/textfield';
|
|
15
|
+
import { TuiIcons } from '@taiga-ui/core/directives/icons';
|
|
16
|
+
import * as i4 from '@taiga-ui/kit/components/slider';
|
|
17
|
+
import { tuiSliderOptionsProvider, TuiSlider } from '@taiga-ui/kit/components/slider';
|
|
18
|
+
import { tuiMaskito } from '@taiga-ui/kit/utils';
|
|
19
|
+
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
20
|
+
|
|
21
|
+
const [TUI_INPUT_COLOR_OPTIONS, tuiInputColorOptionsProvider] = tuiCreateOptions({
|
|
22
|
+
format: 'hex',
|
|
23
|
+
align: 'left',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const REGEX = /[0-9a-fA-F]/;
|
|
27
|
+
class TuiInputColor extends TuiControl {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.options = inject(TUI_INPUT_COLOR_OPTIONS);
|
|
31
|
+
this.el = tuiInjectElement();
|
|
32
|
+
this.list = this.el.getAttribute('list');
|
|
33
|
+
this.format = signal(this.options.format);
|
|
34
|
+
this.align = signal(this.options.align);
|
|
35
|
+
this.icon = tuiDirectiveBinding(TuiIcons, 'iconStart', computed(() => this.align() === 'left'
|
|
36
|
+
? '"data:image/svg+xml;utf8,<svg xmlns=http://www.w3.org/2000/svg></svg>"'
|
|
37
|
+
: ''), {});
|
|
38
|
+
this.maskito = tuiMaskito(computed((length = this.format().length * 2) => ({
|
|
39
|
+
mask: ['#', ...Array.from({ length }).fill(REGEX)],
|
|
40
|
+
postprocessors: [maskitoPrefixPostprocessorGenerator('#')],
|
|
41
|
+
plugins: [maskitoAddOnFocusPlugin('#'), maskitoRemoveOnBlurPlugin('#')],
|
|
42
|
+
overwriteMode: 'replace',
|
|
43
|
+
})));
|
|
44
|
+
this.filled = computed(() => this.format() === 'hex' ? this.value().length === 7 : this.value().length === 9);
|
|
45
|
+
this.opacity = computed(() => this.filled() && this.format() === 'hexa'
|
|
46
|
+
? Number.parseInt(this.value().slice(-2), 16)
|
|
47
|
+
: 255);
|
|
48
|
+
}
|
|
49
|
+
set alignSetter(align) {
|
|
50
|
+
this.align.set(align);
|
|
51
|
+
}
|
|
52
|
+
set formatSetter(mode) {
|
|
53
|
+
this.format.set(mode);
|
|
54
|
+
}
|
|
55
|
+
onInput(value) {
|
|
56
|
+
this.onChange(this.format() === 'hex' ? value : `${value}${toHex(this.opacity())}`);
|
|
57
|
+
}
|
|
58
|
+
onOpacity(opacity) {
|
|
59
|
+
const value = this.filled() ? this.value().slice(0, 7) : '#000000';
|
|
60
|
+
this.onChange(`${value}${toHex(opacity)}`);
|
|
61
|
+
}
|
|
62
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputColor, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
63
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputColor, isStandalone: true, selector: "input[tuiInputColor]", inputs: { alignSetter: ["align", "alignSetter"], formatSetter: ["format", "formatSetter"] }, host: { attributes: { "ngSkipHydration": "true", "inputmode": "numeric", "spellcheck": "false" }, listeners: { "input": "onChange($event.target.value)" }, properties: { "disabled": "disabled()", "value": "value()", "attr.list": "null" } }, providers: [
|
|
64
|
+
tuiAsControl(TuiInputColor),
|
|
65
|
+
tuiFallbackValueProvider(''),
|
|
66
|
+
tuiSliderOptionsProvider({ trackColor: 'transparent' }),
|
|
67
|
+
], usesInheritance: true, hostDirectives: [{ directive: i1.MaskitoDirective }, { directive: i2.TuiWithTextfield }], ngImport: i0, template: "<ng-container *tuiTextfieldContent>\n <input\n #input\n tabindex=\"-1\"\n type=\"color\"\n class=\"tui-input-color_picker\"\n [attr.list]=\"list\"\n [class.tui-input-color_left]=\"align() === 'left'\"\n [disabled]=\"!interactive()\"\n [style.--t-opacity]=\"filled() ? opacity() / 255 : 0\"\n [value]=\"value().length > 6 ? value().slice(0, 7) : ''\"\n (input)=\"onInput(input.value)\"\n />\n <input\n *ngIf=\"format() === 'hexa' && interactive()\"\n max=\"255\"\n tuiSlider\n type=\"range\"\n [ngModel]=\"opacity()\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"onOpacity($event)\"\n (pointerdown.stop)=\"el.focus()\"\n />\n</ng-container>\n", styles: [".tui-input-color_picker.tui-input-color_picker{position:relative;font-size:1rem;inline-size:calc(var(--t-height) / 2);block-size:calc(var(--t-height) / 2);border:none;border-radius:100%;padding:0!important;overflow:hidden;cursor:pointer;background:repeating-conic-gradient(var(--tui-border-normal) 0% 25%,transparent 0% 50%);box-shadow:0 0 0 1px var(--tui-border-normal)}.tui-input-color_picker.tui-input-color_picker:disabled{cursor:default}tui-textfield[data-size=s] .tui-input-color_picker{margin-inline-end:.25rem}tui-textfield[data-size=l] .tui-input-color_picker{margin-inline-end:-.25rem}.tui-input-color_picker.tui-input-color_left{position:absolute;top:50%;left:calc(var(--t-height) / 4);inset-inline-start:calc(var(--t-height) / 4);transform:translateY(-50%)}.tui-input-color_picker::-webkit-color-swatch-wrapper{padding:0}.tui-input-color_picker::-webkit-color-swatch{border:none;opacity:var(--t-opacity)}.tui-input-color_picker::-moz-color-swatch{border:none;opacity:var(--t-opacity)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.TuiSliderComponent, selector: "input[type=range][tuiSlider]", inputs: ["size", "segments"] }, { kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
68
|
+
}
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputColor, decorators: [{
|
|
70
|
+
type: Component,
|
|
71
|
+
args: [{ standalone: true, selector: 'input[tuiInputColor]', imports: [FormsModule, NgIf, TuiSlider, TuiTextfieldContent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
72
|
+
tuiAsControl(TuiInputColor),
|
|
73
|
+
tuiFallbackValueProvider(''),
|
|
74
|
+
tuiSliderOptionsProvider({ trackColor: 'transparent' }),
|
|
75
|
+
], hostDirectives: [MaskitoDirective, TuiWithTextfield], host: {
|
|
76
|
+
ngSkipHydration: 'true',
|
|
77
|
+
inputmode: 'numeric',
|
|
78
|
+
spellcheck: 'false',
|
|
79
|
+
'[disabled]': 'disabled()',
|
|
80
|
+
'[value]': 'value()',
|
|
81
|
+
'[attr.list]': 'null',
|
|
82
|
+
'(input)': 'onChange($event.target.value)',
|
|
83
|
+
}, template: "<ng-container *tuiTextfieldContent>\n <input\n #input\n tabindex=\"-1\"\n type=\"color\"\n class=\"tui-input-color_picker\"\n [attr.list]=\"list\"\n [class.tui-input-color_left]=\"align() === 'left'\"\n [disabled]=\"!interactive()\"\n [style.--t-opacity]=\"filled() ? opacity() / 255 : 0\"\n [value]=\"value().length > 6 ? value().slice(0, 7) : ''\"\n (input)=\"onInput(input.value)\"\n />\n <input\n *ngIf=\"format() === 'hexa' && interactive()\"\n max=\"255\"\n tuiSlider\n type=\"range\"\n [ngModel]=\"opacity()\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"onOpacity($event)\"\n (pointerdown.stop)=\"el.focus()\"\n />\n</ng-container>\n", styles: [".tui-input-color_picker.tui-input-color_picker{position:relative;font-size:1rem;inline-size:calc(var(--t-height) / 2);block-size:calc(var(--t-height) / 2);border:none;border-radius:100%;padding:0!important;overflow:hidden;cursor:pointer;background:repeating-conic-gradient(var(--tui-border-normal) 0% 25%,transparent 0% 50%);box-shadow:0 0 0 1px var(--tui-border-normal)}.tui-input-color_picker.tui-input-color_picker:disabled{cursor:default}tui-textfield[data-size=s] .tui-input-color_picker{margin-inline-end:.25rem}tui-textfield[data-size=l] .tui-input-color_picker{margin-inline-end:-.25rem}.tui-input-color_picker.tui-input-color_left{position:absolute;top:50%;left:calc(var(--t-height) / 4);inset-inline-start:calc(var(--t-height) / 4);transform:translateY(-50%)}.tui-input-color_picker::-webkit-color-swatch-wrapper{padding:0}.tui-input-color_picker::-webkit-color-swatch{border:none;opacity:var(--t-opacity)}.tui-input-color_picker::-moz-color-swatch{border:none;opacity:var(--t-opacity)}\n"] }]
|
|
84
|
+
}], propDecorators: { alignSetter: [{
|
|
85
|
+
type: Input,
|
|
86
|
+
args: ['align']
|
|
87
|
+
}], formatSetter: [{
|
|
88
|
+
type: Input,
|
|
89
|
+
args: ['format']
|
|
90
|
+
}] } });
|
|
91
|
+
function toHex(value) {
|
|
92
|
+
return value.toString(16).padStart(2, '0');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Generated bundle index. Do not edit.
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
export { TUI_INPUT_COLOR_OPTIONS, TuiInputColor, tuiInputColorOptionsProvider };
|
|
100
|
+
//# sourceMappingURL=taiga-ui-kit-components-input-color.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-color.mjs","sources":["../../../projects/kit/components/input-color/input-color.options.ts","../../../projects/kit/components/input-color/input-color.component.ts","../../../projects/kit/components/input-color/input-color.template.html","../../../projects/kit/components/input-color/taiga-ui-kit-components-input-color.ts"],"sourcesContent":["import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport type {TuiHorizontalDirection} from '@taiga-ui/core/types';\n\nexport interface TuiInputColorOptions {\n readonly format: 'hex' | 'hexa';\n readonly align: TuiHorizontalDirection;\n}\n\nexport const [TUI_INPUT_COLOR_OPTIONS, tuiInputColorOptionsProvider] =\n tuiCreateOptions<TuiInputColorOptions>({\n format: 'hex',\n align: 'left',\n });\n","import {NgIf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {\n maskitoAddOnFocusPlugin,\n maskitoPrefixPostprocessorGenerator,\n maskitoRemoveOnBlurPlugin,\n} from '@maskito/kit';\nimport {tuiAsControl, TuiControl} from '@taiga-ui/cdk/classes';\nimport {tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiTextfieldContent, TuiWithTextfield} from '@taiga-ui/core/components/textfield';\nimport {TuiIcons} from '@taiga-ui/core/directives/icons';\nimport type {TuiHorizontalDirection} from '@taiga-ui/core/types';\nimport {TuiSlider, tuiSliderOptionsProvider} from '@taiga-ui/kit/components/slider';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport type {TuiInputColorOptions} from './input-color.options';\nimport {TUI_INPUT_COLOR_OPTIONS} from './input-color.options';\n\nconst REGEX = /[0-9a-fA-F]/;\n\n@Component({\n standalone: true,\n selector: 'input[tuiInputColor]',\n imports: [FormsModule, NgIf, TuiSlider, TuiTextfieldContent],\n templateUrl: './input-color.template.html',\n styleUrls: ['./input-color.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsControl(TuiInputColor),\n tuiFallbackValueProvider(''),\n tuiSliderOptionsProvider({trackColor: 'transparent'}),\n ],\n hostDirectives: [MaskitoDirective, TuiWithTextfield],\n host: {\n ngSkipHydration: 'true',\n inputmode: 'numeric',\n spellcheck: 'false',\n '[disabled]': 'disabled()',\n '[value]': 'value()',\n '[attr.list]': 'null',\n '(input)': 'onChange($event.target.value)',\n },\n})\nexport class TuiInputColor extends TuiControl<string> {\n protected readonly options = inject(TUI_INPUT_COLOR_OPTIONS);\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly list = this.el.getAttribute('list');\n protected readonly format = signal(this.options.format);\n protected readonly align = signal<TuiHorizontalDirection>(this.options.align);\n\n protected readonly icon = tuiDirectiveBinding(\n TuiIcons,\n 'iconStart',\n computed(() =>\n this.align() === 'left'\n ? '\"data:image/svg+xml;utf8,<svg xmlns=http://www.w3.org/2000/svg></svg>\"'\n : '',\n ),\n {},\n );\n\n protected readonly maskito = tuiMaskito(\n computed((length = this.format().length * 2) => ({\n mask: ['#', ...Array.from<RegExp>({length}).fill(REGEX)],\n postprocessors: [maskitoPrefixPostprocessorGenerator('#')],\n plugins: [maskitoAddOnFocusPlugin('#'), maskitoRemoveOnBlurPlugin('#')],\n overwriteMode: 'replace',\n })),\n );\n\n protected readonly filled = computed(() =>\n this.format() === 'hex' ? this.value().length === 7 : this.value().length === 9,\n );\n\n protected readonly opacity = computed(() =>\n this.filled() && this.format() === 'hexa'\n ? Number.parseInt(this.value().slice(-2), 16)\n : 255,\n );\n\n @Input('align')\n public set alignSetter(align: TuiInputColorOptions['align']) {\n this.align.set(align);\n }\n\n @Input('format')\n public set formatSetter(mode: TuiInputColorOptions['format']) {\n this.format.set(mode);\n }\n\n protected onInput(value: string): void {\n this.onChange(\n this.format() === 'hex' ? value : `${value}${toHex(this.opacity())}`,\n );\n }\n\n protected onOpacity(opacity: number): void {\n const value = this.filled() ? this.value().slice(0, 7) : '#000000';\n\n this.onChange(`${value}${toHex(opacity)}`);\n }\n}\n\nfunction toHex(value: number): string {\n return value.toString(16).padStart(2, '0');\n}\n","<ng-container *tuiTextfieldContent>\n <input\n #input\n tabindex=\"-1\"\n type=\"color\"\n class=\"tui-input-color_picker\"\n [attr.list]=\"list\"\n [class.tui-input-color_left]=\"align() === 'left'\"\n [disabled]=\"!interactive()\"\n [style.--t-opacity]=\"filled() ? opacity() / 255 : 0\"\n [value]=\"value().length > 6 ? value().slice(0, 7) : ''\"\n (input)=\"onInput(input.value)\"\n />\n <input\n *ngIf=\"format() === 'hexa' && interactive()\"\n max=\"255\"\n tuiSlider\n type=\"range\"\n [ngModel]=\"opacity()\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"onOpacity($event)\"\n (pointerdown.stop)=\"el.focus()\"\n />\n</ng-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;MAQa,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,GAChE,gBAAgB,CAAuB;AACnC,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,KAAK,EAAE,MAAM;AAChB,CAAA;;ACkBL,MAAM,KAAK,GAAG,aAAa,CAAC;AAE5B,MAwBa,aAAc,SAAQ,UAAkB,CAAA;AAxBrD,IAAA,WAAA,GAAA;;AAyBuB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;QAC1C,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAoB,CAAC;QAC1C,IAAI,CAAA,IAAA,GAAG,IAAI,CAAC,EAAE,C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AAC,QAAQ,CAAA;;AAkBnB,SAAS,KAAK,CAAC,KAAa,EAAA;AACxB,IAAA,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC/C;;AEtHA;;AAEG;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TuiCalendarRange } from '@taiga-ui/kit/components/calendar-range';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, computed, signal, Directive, Input } from '@angular/core';
|
|
3
|
+
import { InjectionToken, inject, computed, signal, Directive, Input } from '@angular/core';
|
|
4
4
|
import * as i3 from '@maskito/angular';
|
|
5
5
|
import { MaskitoDirective } from '@maskito/angular';
|
|
6
6
|
import { maskitoDateRangeOptionsGenerator } from '@maskito/kit';
|
|
7
7
|
import { TUI_IDENTITY_VALUE_TRANSFORMER, tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
|
|
8
8
|
import { RANGE_SEPARATOR_CHAR, DATE_RANGE_FILLER_LENGTH, TuiDayRange } from '@taiga-ui/cdk/date-time';
|
|
9
|
-
import {
|
|
9
|
+
import { tuiProvideOptions, tuiDirectiveBinding, tuiProvide } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
10
10
|
import * as i1 from '@taiga-ui/core/components/textfield';
|
|
11
11
|
import { TuiTextfieldComponent, TuiWithTextfield } from '@taiga-ui/core/components/textfield';
|
|
12
12
|
import * as i2 from '@taiga-ui/core/directives/dropdown';
|
|
@@ -15,10 +15,12 @@ import { TUI_ITEMS_HANDLERS } from '@taiga-ui/core/directives/items-handlers';
|
|
|
15
15
|
import { TUI_INPUT_DATE_OPTIONS_NEW, TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW, TuiInputDateBase, TUI_DATE_ADAPTER } from '@taiga-ui/kit/components/input-date';
|
|
16
16
|
import { tuiMaskito } from '@taiga-ui/kit/utils';
|
|
17
17
|
|
|
18
|
-
const TUI_INPUT_DATE_RANGE_OPTIONS =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
const TUI_INPUT_DATE_RANGE_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_INPUT_DATE_RANGE_OPTIONS' : '', {
|
|
19
|
+
factory: () => ({
|
|
20
|
+
...inject(TUI_INPUT_DATE_OPTIONS_NEW),
|
|
21
|
+
valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
22
24
|
const tuiInputDateRangeOptionsProvider = (options) => tuiProvideOptions(TUI_INPUT_DATE_RANGE_OPTIONS, options, TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW);
|
|
23
25
|
|
|
24
26
|
class TuiInputDateRangeDirective extends TuiInputDateBase {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-date-range.mjs","sources":["../../../projects/kit/components/input-date-range/input-date-range.options.ts","../../../projects/kit/components/input-date-range/input-date-range.directive.ts","../../../projects/kit/components/input-date-range/input-date-range.ts","../../../projects/kit/components/input-date-range/taiga-ui-kit-components-input-date-range.ts"],"sourcesContent":["import type {FactoryProvider} from '@angular/core';\nimport {inject} from '@angular/core';\nimport type {TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {TUI_IDENTITY_VALUE_TRANSFORMER} from '@taiga-ui/cdk/classes';\nimport type {TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-date-range.mjs","sources":["../../../projects/kit/components/input-date-range/input-date-range.options.ts","../../../projects/kit/components/input-date-range/input-date-range.directive.ts","../../../projects/kit/components/input-date-range/input-date-range.ts","../../../projects/kit/components/input-date-range/taiga-ui-kit-components-input-date-range.ts"],"sourcesContent":["import type {FactoryProvider} from '@angular/core';\nimport {inject, InjectionToken} from '@angular/core';\nimport type {TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {TUI_IDENTITY_VALUE_TRANSFORMER} from '@taiga-ui/cdk/classes';\nimport type {TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {TuiInputDateOptionsNew} from '@taiga-ui/kit/components/input-date';\nimport {\n TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW,\n TUI_INPUT_DATE_OPTIONS_NEW,\n} from '@taiga-ui/kit/components/input-date';\n\nexport interface TuiInputDateRangeOptions\n extends Omit<TuiInputDateOptionsNew, 'valueTransformer'> {\n readonly valueTransformer: TuiValueTransformer<TuiDayRange | null, any>;\n}\n\nexport const TUI_INPUT_DATE_RANGE_OPTIONS = new InjectionToken<TuiInputDateRangeOptions>(\n ngDevMode ? 'TUI_INPUT_DATE_RANGE_OPTIONS' : '',\n {\n factory: () => ({\n ...inject(TUI_INPUT_DATE_OPTIONS_NEW),\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n }),\n },\n);\n\nexport const tuiInputDateRangeOptionsProvider = (\n options: Partial<TuiInputDateRangeOptions>,\n): FactoryProvider =>\n tuiProvideOptions(\n TUI_INPUT_DATE_RANGE_OPTIONS,\n options,\n TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW,\n );\n","import {computed, Directive, inject, Input, signal} from '@angular/core';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {maskitoDateRangeOptionsGenerator} from '@maskito/kit';\nimport {tuiAsControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport type {TuiDayLike} from '@taiga-ui/cdk/date-time';\nimport {\n DATE_RANGE_FILLER_LENGTH,\n RANGE_SEPARATOR_CHAR,\n TuiDayRange,\n} from '@taiga-ui/cdk/date-time';\nimport {tuiDirectiveBinding, tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiTextfieldComponent,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiDropdownAuto} from '@taiga-ui/core/directives/dropdown';\nimport type {TuiItemsHandlers} from '@taiga-ui/core/directives/items-handlers';\nimport {TUI_ITEMS_HANDLERS} from '@taiga-ui/core/directives/items-handlers';\nimport type {TuiCalendarRange} from '@taiga-ui/kit/components/calendar-range';\nimport {\n TUI_DATE_ADAPTER,\n TUI_INPUT_DATE_OPTIONS_NEW,\n TuiInputDateBase,\n} from '@taiga-ui/kit/components/input-date';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {TUI_INPUT_DATE_RANGE_OPTIONS} from './input-date-range.options';\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputDateRange]',\n providers: [\n // TODO: Add SelectOption after data-list in calendar-range is refactored\n tuiAsControl(TuiInputDateRangeDirective),\n tuiValueTransformerFrom(TUI_INPUT_DATE_RANGE_OPTIONS),\n tuiProvide(TUI_INPUT_DATE_OPTIONS_NEW, TUI_INPUT_DATE_RANGE_OPTIONS),\n ],\n hostDirectives: [TuiWithTextfield, TuiDropdownAuto, MaskitoDirective],\n})\nexport class TuiInputDateRangeDirective extends TuiInputDateBase<TuiDayRange> {\n protected readonly identity = inject<TuiItemsHandlers<TuiDayRange>>(\n TUI_ITEMS_HANDLERS,\n ).identityMatcher.set((a, b) => a.daySame(b));\n\n protected readonly rangeFiller = tuiDirectiveBinding(\n TuiTextfieldComponent,\n 'fillerSetter',\n computed((filler = this.filler()) => `${filler}${RANGE_SEPARATOR_CHAR}${filler}`),\n {},\n );\n\n protected override readonly mask = tuiMaskito(\n computed(() =>\n maskitoDateRangeOptionsGenerator({\n dateSeparator: this.format().separator,\n mode: TUI_DATE_ADAPTER[this.format().mode],\n min: this.min().toLocalNativeDate(),\n max: this.max().toLocalNativeDate(),\n minLength: this.minLength() || {},\n maxLength: this.maxLength() || {},\n }),\n ),\n );\n\n public readonly minLength = signal<TuiDayLike | null>(null);\n public readonly maxLength = signal<TuiDayLike | null>(null);\n\n @Input('minLength')\n public set minLengthSetter(minLength: TuiDayLike | null) {\n this.minLength.set(minLength);\n }\n\n @Input('maxLength')\n public set maxLengthSetter(maxLength: TuiDayLike | null) {\n this.maxLength.set(maxLength);\n }\n\n protected override processCalendar(calendar: TuiCalendarRange): void {\n super.processCalendar(calendar);\n\n calendar.minLength = this.minLength();\n calendar.maxLength = this.maxLength();\n }\n\n protected override onValueChange(value: string): void {\n this.control?.control?.updateValueAndValidity({emitEvent: false});\n this.onChange(\n value.length === DATE_RANGE_FILLER_LENGTH\n ? TuiDayRange.normalizeParse(value, this.format().mode)\n : null,\n );\n }\n}\n","import {TuiCalendarRange} from '@taiga-ui/kit/components/calendar-range';\n\nimport {TuiInputDateRangeDirective} from './input-date-range.directive';\n\nexport const TuiInputDateRange = [TuiInputDateRangeDirective, TuiCalendarRange] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAiBa,MAAA,4BAA4B,GAAG,IAAI,cAAc,CAC1D,SAAS,GAAG,8BAA8B,GAAG,EAAE,EAC/C;AACI,IAAA,OAAO,EAAE,OAAO;QACZ,GAAG,MAAM,CAAC,0BAA0B,CAAC;AACrC,QAAA,gBAAgB,EAAE,8BAA8B;KACnD,CAAC;AACL,CAAA,EACH;AAEW,MAAA,gCAAgC,GAAG,CAC5C,OAA0C,KAE1C,iBAAiB,CACb,4BAA4B,EAC5B,OAAO,EACP,kCAAkC;;ACL1C,MAWa,0BAA2B,SAAQ,gBAA6B,CAAA;AAX7E,IAAA,WAAA,GAAA;;QAYuB,IAAQ,CAAA,QAAA,GAAG,MAAM,CAChC,kBAAkB,CACrB,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3B,QAAA,IAAA,CAAA,WAAW,GAAG,mBAAmB,CAChD,qBAAqB,EACrB,cAAc,EACd,QAAQ,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,CAAG,EAAA,MAAM,C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AAQ,EAAE,0BAA0B;AACpC,oBAAA,SAAS,EAAE;;AAEP,wBAAA,YAAY,CAA4B,0BAAA,CAAA;wBACxC,uBAAuB,CAAC,4BAA4B,CAAC;AACrD,wBAAA,UAAU,CAAC,0BAA0B,EAAE,4BAA4B,CAAC;AACvE,qBAAA;AACD,oBAAA,cAAc,EAAE,CAAC,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,CAAC;AACxE,iBAAA,CAAA;8BA8Bc,eAAe,EAAA,CAAA;sBADzB,KAAK;uBAAC,WAAW,CAAA;gBAMP,eAAe,EAAA,CAAA;sBADzB,KAAK;uBAAC,WAAW,CAAA;;;MCpET,iBAAiB,GAAG,CAAC,0BAA0B,EAAE,gBAAgB;;ACJ9E;;AAEG;;;;"}
|
|
@@ -11,11 +11,11 @@ class TuiInputInline {
|
|
|
11
11
|
this.value$ = defer(() => tuiControlValue(this.control));
|
|
12
12
|
}
|
|
13
13
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputInline, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputInline, isStandalone: true, selector: "tui-input-inline", queries: [{ propertyName: "control", first: true, predicate: NgControl, descendants: true }], ngImport: i0, template: "<ng-container *tuiLet=\"value$ | async as value\">\n <span\n class=\"t-before\"\n [textContent]=\"value\"\n ></span>\n\n <span\n *ngIf=\"!value\"\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n</ng-container>\n<ng-content select=\"input\" />\n", styles: ["tui-input-inline{position:relative;display:inline-block;white-space:nowrap;box-sizing:border-box}tui-input-inline>.t-before{padding-
|
|
14
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputInline, isStandalone: true, selector: "tui-input-inline", queries: [{ propertyName: "control", first: true, predicate: NgControl, descendants: true }], ngImport: i0, template: "<ng-container *tuiLet=\"value$ | async as value\">\n <span\n class=\"t-before\"\n [textContent]=\"value\"\n ></span>\n\n <span\n *ngIf=\"!value\"\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n</ng-container>\n<ng-content select=\"input\" />\n", styles: ["tui-input-inline{position:relative;display:inline-block;white-space:nowrap;box-sizing:border-box}tui-input-inline>.t-before{padding-inline-end:.02em;margin-inline-start:1px;white-space:pre;visibility:hidden}tui-input-inline>.t-placeholder{display:inline-block;min-inline-size:1px;margin-inline-start:-1px}tui-input-inline>input{position:absolute;top:0;left:0;background-color:transparent;padding:inherit;font:inherit;color:inherit;box-sizing:border-box;inline-size:100%;block-size:100%;border-width:0;text-align:inherit;letter-spacing:inherit;text-indent:inherit;text-transform:inherit;outline:none}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TuiLet, selector: "[tuiLet]", inputs: ["tuiLet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
15
15
|
}
|
|
16
16
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputInline, decorators: [{
|
|
17
17
|
type: Component,
|
|
18
|
-
args: [{ standalone: true, selector: 'tui-input-inline', imports: [AsyncPipe, NgIf, TuiLet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *tuiLet=\"value$ | async as value\">\n <span\n class=\"t-before\"\n [textContent]=\"value\"\n ></span>\n\n <span\n *ngIf=\"!value\"\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n</ng-container>\n<ng-content select=\"input\" />\n", styles: ["tui-input-inline{position:relative;display:inline-block;white-space:nowrap;box-sizing:border-box}tui-input-inline>.t-before{padding-
|
|
18
|
+
args: [{ standalone: true, selector: 'tui-input-inline', imports: [AsyncPipe, NgIf, TuiLet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *tuiLet=\"value$ | async as value\">\n <span\n class=\"t-before\"\n [textContent]=\"value\"\n ></span>\n\n <span\n *ngIf=\"!value\"\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n</ng-container>\n<ng-content select=\"input\" />\n", styles: ["tui-input-inline{position:relative;display:inline-block;white-space:nowrap;box-sizing:border-box}tui-input-inline>.t-before{padding-inline-end:.02em;margin-inline-start:1px;white-space:pre;visibility:hidden}tui-input-inline>.t-placeholder{display:inline-block;min-inline-size:1px;margin-inline-start:-1px}tui-input-inline>input{position:absolute;top:0;left:0;background-color:transparent;padding:inherit;font:inherit;color:inherit;box-sizing:border-box;inline-size:100%;block-size:100%;border-width:0;text-align:inherit;letter-spacing:inherit;text-indent:inherit;text-transform:inherit;outline:none}\n"] }]
|
|
19
19
|
}], propDecorators: { control: [{
|
|
20
20
|
type: ContentChild,
|
|
21
21
|
args: [NgControl]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-inline.mjs","sources":["../../../projects/kit/components/input-inline/input-inline.component.ts","../../../projects/kit/components/input-inline/input-inline.template.html","../../../projects/kit/components/input-inline/taiga-ui-kit-components-input-inline.ts"],"sourcesContent":["import {AsyncPipe, NgIf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiLet} from '@taiga-ui/cdk/directives/let';\nimport {tuiControlValue} from '@taiga-ui/cdk/observables';\nimport {defer} from 'rxjs';\n\n@Component({\n standalone: true,\n selector: 'tui-input-inline',\n imports: [AsyncPipe, NgIf, TuiLet],\n templateUrl: './input-inline.template.html',\n styleUrls: ['./input-inline.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiInputInline {\n @ContentChild(NgControl)\n private readonly control?: NgControl;\n\n protected readonly value$ = defer(() => tuiControlValue(this.control));\n}\n","<ng-container *tuiLet=\"value$ | async as value\">\n <span\n class=\"t-before\"\n [textContent]=\"value\"\n ></span>\n\n <span\n *ngIf=\"!value\"\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n</ng-container>\n<ng-content select=\"input\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAYA,MASa,cAAc,CAAA;AAT3B,IAAA,WAAA,GAAA;AAauB,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC1E,KAAA;+GALY,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,OAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EACT,SAAS,ECtB3B,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,2WAeA,
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-inline.mjs","sources":["../../../projects/kit/components/input-inline/input-inline.component.ts","../../../projects/kit/components/input-inline/input-inline.template.html","../../../projects/kit/components/input-inline/taiga-ui-kit-components-input-inline.ts"],"sourcesContent":["import {AsyncPipe, NgIf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiLet} from '@taiga-ui/cdk/directives/let';\nimport {tuiControlValue} from '@taiga-ui/cdk/observables';\nimport {defer} from 'rxjs';\n\n@Component({\n standalone: true,\n selector: 'tui-input-inline',\n imports: [AsyncPipe, NgIf, TuiLet],\n templateUrl: './input-inline.template.html',\n styleUrls: ['./input-inline.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiInputInline {\n @ContentChild(NgControl)\n private readonly control?: NgControl;\n\n protected readonly value$ = defer(() => tuiControlValue(this.control));\n}\n","<ng-container *tuiLet=\"value$ | async as value\">\n <span\n class=\"t-before\"\n [textContent]=\"value\"\n ></span>\n\n <span\n *ngIf=\"!value\"\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n</ng-container>\n<ng-content select=\"input\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAYA,MASa,cAAc,CAAA;AAT3B,IAAA,WAAA,GAAA;AAauB,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC1E,KAAA;+GALY,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,OAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EACT,SAAS,ECtB3B,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,2WAeA,8oBDAc,SAAS,EAAA,IAAA,EAAA,OAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,IAAI,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,MAAM,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;4FAMxB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAT1B,SAAS;AACM,YAAA,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,YACN,kBAAkB,EAAA,OAAA,EACnB,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,iBAGnB,iBAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,2WAAA,EAAA,MAAA,EAAA,CAAA,2lBAAA,CAAA,EAAA,CAAA;8BAI9B,OAAO,EAAA,CAAA;sBADvB,YAAY;uBAAC,SAAS,CAAA;;;AEtB3B;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TuiCalendarMonth } from '@taiga-ui/kit/components/calendar-month';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, signal, effect, Directive } from '@angular/core';
|
|
3
|
+
import { InjectionToken, inject, signal, effect, Directive } from '@angular/core';
|
|
4
4
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { TUI_IDENTITY_VALUE_TRANSFORMER, TuiControl, tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
|
|
6
6
|
import { TUI_ALLOW_SIGNAL_WRITES } from '@taiga-ui/cdk/constants';
|
|
@@ -10,14 +10,16 @@ import { TuiTextfieldDirective, tuiInjectAuxiliary, tuiTextfieldIconBinding, Tui
|
|
|
10
10
|
import * as i2 from '@taiga-ui/core/directives/dropdown';
|
|
11
11
|
import { tuiDropdownOpen, tuiDropdownEnabled, TuiDropdownAuto } from '@taiga-ui/core/directives/dropdown';
|
|
12
12
|
import { TUI_MONTH_FORMATTER } from '@taiga-ui/kit/tokens';
|
|
13
|
-
import {
|
|
13
|
+
import { tuiProvideOptions } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
14
14
|
import { TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW } from '@taiga-ui/kit/components/input-date';
|
|
15
15
|
import { TUI_INPUT_MONTH_OPTIONS } from '@taiga-ui/kit/components/input-month';
|
|
16
16
|
|
|
17
|
-
const TUI_INPUT_MONTH_RANGE_OPTIONS =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const TUI_INPUT_MONTH_RANGE_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_INPUT_MONTH_RANGE_OPTIONS' : '', {
|
|
18
|
+
factory: () => ({
|
|
19
|
+
...inject(TUI_INPUT_MONTH_OPTIONS),
|
|
20
|
+
valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
21
23
|
const tuiInputMonthRangeOptionsProvider = (options) => tuiProvideOptions(TUI_INPUT_MONTH_RANGE_OPTIONS, options, TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW);
|
|
22
24
|
|
|
23
25
|
class TuiInputMonthRangeDirective extends TuiControl {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-month-range.mjs","sources":["../../../projects/kit/components/input-month-range/input-month-range.options.ts","../../../projects/kit/components/input-month-range/input-month-range.directive.ts","../../../projects/kit/components/input-month-range/input-month-range.ts","../../../projects/kit/components/input-month-range/taiga-ui-kit-components-input-month-range.ts"],"sourcesContent":["import type {FactoryProvider} from '@angular/core';\nimport {inject} from '@angular/core';\nimport type {TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {TUI_IDENTITY_VALUE_TRANSFORMER} from '@taiga-ui/cdk/classes';\nimport type {TuiMonthRange} from '@taiga-ui/cdk/date-time';\nimport type {TuiHandler} from '@taiga-ui/cdk/types';\nimport {
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-month-range.mjs","sources":["../../../projects/kit/components/input-month-range/input-month-range.options.ts","../../../projects/kit/components/input-month-range/input-month-range.directive.ts","../../../projects/kit/components/input-month-range/input-month-range.ts","../../../projects/kit/components/input-month-range/taiga-ui-kit-components-input-month-range.ts"],"sourcesContent":["import type {FactoryProvider} from '@angular/core';\nimport {inject, InjectionToken} from '@angular/core';\nimport type {TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {TUI_IDENTITY_VALUE_TRANSFORMER} from '@taiga-ui/cdk/classes';\nimport type {TuiMonthRange} from '@taiga-ui/cdk/date-time';\nimport type {TuiHandler} from '@taiga-ui/cdk/types';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';\nimport {TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW} from '@taiga-ui/kit/components/input-date';\nimport {TUI_INPUT_MONTH_OPTIONS} from '@taiga-ui/kit/components/input-month';\n\nexport interface TuiInputMonthRangeOptions {\n readonly icon: TuiHandler<TuiSizeL | TuiSizeS, string>;\n readonly valueTransformer: TuiValueTransformer<TuiMonthRange | null, any>;\n}\n\nexport const TUI_INPUT_MONTH_RANGE_OPTIONS =\n new InjectionToken<TuiInputMonthRangeOptions>(\n ngDevMode ? 'TUI_INPUT_MONTH_RANGE_OPTIONS' : '',\n {\n factory: () => ({\n ...inject(TUI_INPUT_MONTH_OPTIONS),\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n }),\n },\n );\n\nexport const tuiInputMonthRangeOptionsProvider = (\n options: Partial<TuiInputMonthRangeOptions>,\n): FactoryProvider =>\n tuiProvideOptions(\n TUI_INPUT_MONTH_RANGE_OPTIONS,\n options,\n TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW,\n );\n","import {Directive, effect, inject, signal} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport type {TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {RANGE_SEPARATOR_CHAR, TuiMonthRange} from '@taiga-ui/cdk/date-time';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n TuiTextfieldDirective,\n tuiTextfieldIconBinding,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n tuiDropdownOpen,\n} from '@taiga-ui/core/directives/dropdown';\nimport {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\nimport {TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens';\n\nimport {TUI_INPUT_MONTH_RANGE_OPTIONS} from './input-month-range.options';\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputMonthRange]',\n providers: [\n tuiAsControl(TuiInputMonthRangeDirective),\n tuiValueTransformerFrom(TUI_INPUT_MONTH_RANGE_OPTIONS),\n ],\n hostDirectives: [TuiWithTextfield, TuiSelectLike, TuiDropdownAuto],\n host: {\n '[disabled]': 'disabled()',\n '(input)': '$event.inputType?.includes(\"delete\") && clear()',\n },\n})\nexport class TuiInputMonthRangeDirective extends TuiControl<TuiMonthRange | null> {\n private readonly textfield = inject(TuiTextfieldDirective);\n private readonly formatter = toSignal(inject(TUI_MONTH_FORMATTER));\n private readonly open = tuiDropdownOpen();\n private readonly intermediateValue = signal<TuiMonth | null>(null);\n\n private readonly calendar = tuiInjectAuxiliary<TuiCalendarMonth>(\n (x) => x instanceof TuiCalendarMonth,\n );\n\n protected readonly icon = tuiTextfieldIconBinding(TUI_INPUT_MONTH_RANGE_OPTIONS);\n protected readonly dropdownEnabled = tuiDropdownEnabled(this.interactive);\n\n protected readonly valueEffect = effect(() => {\n const value = this.value();\n const format = this.formatter() || (() => '');\n const string = value\n ? format(value.from) + RANGE_SEPARATOR_CHAR + format(value.to)\n : '';\n\n this.textfield.value.set(string);\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly calendarInit = effect(() => {\n const calendar = this.calendar();\n\n if (calendar) {\n calendar.options.rangeMode = true;\n }\n });\n\n protected readonly calendarSync = effect(() => {\n this.calendar()?.value.set(this.intermediateValue() ?? this.value());\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n // TODO: use linked signal (Angular 19+)\n protected readonly resetIntermediateValue = effect(() => {\n this.intermediateValue.set(this.value() && null);\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected onMonthClickEffect = effect((onCleanup) => {\n const subscription = this.calendar()?.monthClick.subscribe((month) => {\n const intermediateValue = this.intermediateValue();\n\n if (!intermediateValue) {\n this.intermediateValue.set(month);\n } else {\n this.onChange(TuiMonthRange.sort(intermediateValue, month));\n this.open.set(false);\n }\n });\n\n onCleanup(() => subscription?.unsubscribe());\n });\n\n protected clear(): void {\n this.onChange(null);\n this.open.set(true);\n }\n}\n","import {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthRangeDirective} from './input-month-range.directive';\n\nexport const TuiInputMonthRange = [\n TuiInputMonthRangeDirective,\n TuiCalendarMonth,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgBa,MAAA,6BAA6B,GACtC,IAAI,cAAc,CACd,SAAS,GAAG,+BAA+B,GAAG,EAAE,EAChD;AACI,IAAA,OAAO,EAAE,OAAO;QACZ,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAClC,QAAA,gBAAgB,EAAE,8BAA8B;KACnD,CAAC;AACL,CAAA,EACH;AAEO,MAA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,aAAa,EAAE,eAAe,CAAC;AAClE,oBAAA,IAAI,EAAE;AACF,wBAAA,YAAY,EAAE,YAAY;AAC1B,wBAAA,SAAS,EAAE,iDAAiD;AAC/D,qBAAA;AACJ,iBAAA,CAAA;;;AC/BY,MAAA,kBAAkB,GAAG;IAC9B,2BAA2B;IAC3B,gBAAgB;;;ACNpB;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TuiCalendarMonth } from '@taiga-ui/kit/components/calendar-month';
|
|
2
2
|
import { NgIf } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, computed, effect, Directive, signal, Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
|
|
4
|
+
import { InjectionToken, inject, computed, effect, Directive, signal, Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
|
|
5
5
|
import { TUI_ALLOW_SIGNAL_WRITES } from '@taiga-ui/cdk/constants';
|
|
6
6
|
import { TUI_FIRST_DAY, TUI_LAST_DAY, TuiMonth } from '@taiga-ui/cdk/date-time';
|
|
7
7
|
import * as i1 from '@taiga-ui/core/components/textfield';
|
|
@@ -13,7 +13,7 @@ import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
|
13
13
|
import * as i2 from '@taiga-ui/core/directives/dropdown';
|
|
14
14
|
import { tuiDropdownOpen, tuiDropdownEnabled, TuiDropdownAuto } from '@taiga-ui/core/directives/dropdown';
|
|
15
15
|
import { TUI_MONTH_FORMATTER } from '@taiga-ui/kit/tokens';
|
|
16
|
-
import {
|
|
16
|
+
import { tuiProvideOptions } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
17
17
|
import { TUI_INPUT_DATE_OPTIONS_NEW, TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW } from '@taiga-ui/kit/components/input-date';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -23,10 +23,12 @@ const TUI_INPUT_MONTH_DEFAULT_OPTIONS = {
|
|
|
23
23
|
icon: () => '@tui.calendar',
|
|
24
24
|
valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,
|
|
25
25
|
};
|
|
26
|
-
const TUI_INPUT_MONTH_OPTIONS =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const TUI_INPUT_MONTH_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_INPUT_MONTH_OPTIONS' : '', {
|
|
27
|
+
factory: () => ({
|
|
28
|
+
...inject(TUI_INPUT_DATE_OPTIONS_NEW),
|
|
29
|
+
valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
30
32
|
const tuiInputMonthOptionsProvider = (options) => tuiProvideOptions(TUI_INPUT_MONTH_OPTIONS, options, TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW);
|
|
31
33
|
|
|
32
34
|
class TuiInputMonthDirective extends TuiControl {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-month.mjs","sources":["../../../projects/kit/components/input-month/input-month.options.ts","../../../projects/kit/components/input-month/input-month.directive.ts","../../../projects/kit/components/input-month/input-month.component.ts","../../../projects/kit/components/input-month/input-month.template.html","../../../projects/kit/components/input-month/input-month.ts","../../../projects/kit/components/input-month/taiga-ui-kit-components-input-month.ts"],"sourcesContent":["import type {FactoryProvider} from '@angular/core';\nimport {inject} from '@angular/core';\nimport type {TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {TUI_IDENTITY_VALUE_TRANSFORMER} from '@taiga-ui/cdk/classes';\nimport type {TuiMonth} from '@taiga-ui/cdk/date-time';\nimport type {TuiHandler} from '@taiga-ui/cdk/types';\nimport {\n tuiCreateTokenFromFactory,\n tuiProvideOptions,\n} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';\nimport {\n TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW,\n TUI_INPUT_DATE_OPTIONS_NEW,\n} from '@taiga-ui/kit/components/input-date';\n\nexport interface TuiInputMonthOptions {\n readonly icon: TuiHandler<TuiSizeL | TuiSizeS, string>;\n readonly valueTransformer: TuiValueTransformer<TuiMonth | null, any>;\n}\n\n/**\n * @deprecated remove in v5\n */\nexport const TUI_INPUT_MONTH_DEFAULT_OPTIONS: TuiInputMonthOptions = {\n icon: () => '@tui.calendar',\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n};\n\nexport const TUI_INPUT_MONTH_OPTIONS = tuiCreateTokenFromFactory<TuiInputMonthOptions>(\n () => ({\n ...inject(TUI_INPUT_DATE_OPTIONS_NEW),\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n }),\n);\n\nexport const tuiInputMonthOptionsProvider = (\n options: Partial<TuiInputMonthOptions>,\n): FactoryProvider =>\n tuiProvideOptions(\n TUI_INPUT_MONTH_OPTIONS,\n options,\n TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW,\n );\n","import {computed, Directive, effect, inject} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport type {TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n TuiTextfieldDirective,\n tuiTextfieldIconBinding,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n tuiDropdownOpen,\n} from '@taiga-ui/core/directives/dropdown';\nimport {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\nimport {TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens';\n\nimport {TUI_INPUT_MONTH_OPTIONS} from './input-month.options';\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputMonth]',\n providers: [\n tuiAsControl(TuiInputMonthDirective),\n tuiValueTransformerFrom(TUI_INPUT_MONTH_OPTIONS),\n ],\n hostDirectives: [TuiWithTextfield, TuiSelectLike, TuiDropdownAuto],\n host: {\n '[disabled]': 'disabled()',\n '(input)': '$event.inputType?.includes(\"delete\") && clear()',\n },\n})\nexport class TuiInputMonthDirective extends TuiControl<TuiMonth | null> {\n private readonly textfield = inject(TuiTextfieldDirective);\n private readonly formatter = toSignal(inject(TUI_MONTH_FORMATTER));\n private readonly open = tuiDropdownOpen();\n\n protected readonly icon = tuiTextfieldIconBinding(TUI_INPUT_MONTH_OPTIONS);\n protected readonly dropdownEnabled = tuiDropdownEnabled(\n computed(() => !this.native && this.interactive()),\n );\n\n protected readonly valueEffect = effect(() => {\n this.textfield.value.set(this.formatter()?.(this.value()) || '');\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly calendarIn = effect(() => {\n this.calendar()?.value.set(this.value());\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly calendarOut = effect((onCleanup) => {\n const subscription = this.calendar()?.monthClick.subscribe((month) => {\n this.onChange(month);\n this.open.set(false);\n });\n\n onCleanup(() => subscription?.unsubscribe());\n });\n\n public readonly calendar = tuiInjectAuxiliary<TuiCalendarMonth>(\n (x) => x instanceof TuiCalendarMonth,\n );\n\n public readonly native =\n tuiInjectElement<HTMLInputElement>().type === 'month' && inject(TUI_IS_MOBILE);\n\n protected clear(): void {\n this.onChange(null);\n this.open.set(this.dropdownEnabled());\n }\n}\n","import {NgIf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TuiTextfieldContent} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputMonthDirective} from './input-month.directive';\n\n@Component({\n standalone: true,\n selector: 'input[tuiInputMonth][type=\"month\"]',\n imports: [NgIf, TuiTextfieldContent],\n templateUrl: './input-month.template.html',\n styleUrls: ['./input-month.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n ngSkipHydration: 'true',\n '[type]': '\"text\"',\n },\n})\nexport class TuiInputMonthComponent {\n protected readonly host = inject(TuiInputMonthDirective);\n protected readonly min = signal<TuiMonth | null>(null);\n protected readonly max = signal<TuiMonth | null>(null);\n protected readonly calendarSync = effect(() => {\n const calendar = this.host.calendar();\n\n if (calendar) {\n calendar.min.set(this.min() ?? TUI_FIRST_DAY); // TODO(v5): remove TUI_FIRST_DAY fallback\n calendar.max.set(this.max() ?? TUI_LAST_DAY); // TODO(v5): remove TUI_LAST_DAY fallback\n }\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n // TODO(v5): use signal inputs\n @Input('min')\n public set minSetter(x: TuiMonth | null) {\n this.min.set(x);\n }\n\n // TODO(v5): use signal inputs\n @Input('max')\n public set maxSetter(x: TuiMonth | null) {\n this.max.set(x);\n }\n\n protected onInput(value: string): void {\n if (!value) {\n return this.host.onChange(null);\n }\n\n const [year = 0, month = 0] = value.split('-').map(Number);\n\n this.host.onChange(new TuiMonth(year, month - 1));\n }\n}\n","<ng-container *ngIf=\"host.native\">\n <input\n *tuiTextfieldContent\n type=\"month\"\n [max]=\"max()?.toJSON()\"\n [min]=\"min()?.toJSON()\"\n [value]=\"host.value()?.toJSON()\"\n (click.stop.zoneless)=\"(0)\"\n (input)=\"onInput($any($event.target).value)\"\n (pointerdown.stop.zoneless)=\"(0)\"\n />\n</ng-container>\n","import {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthComponent} from './input-month.component';\nimport {TuiInputMonthDirective} from './input-month.directive';\n\nexport const TuiInputMonth = [\n TuiInputMonthComponent,\n TuiInputMonthDirective,\n TuiCalendarMonth,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAqBA;;AAEG;AACU,MAAA,+BAA+B,GAAyB;AACjE,IAAA,IAAI,EAAE,MAAM,eAAe;AAC3B,IAAA,gBAAgB,EAAE,8BAA8B;EAClD;MAEW,uBAAuB,GAAG,yBAAyB,CAC5D,OAAO;IACH,GAAG,MAAM,CAAC,0BAA0B,CAAC;AACrC,IAAA,gBAAgB,EAAE,8BAA8B;AACnD,CAAA,CAAC,EACJ;AAEW,MAAA,4BAA4B,GAAG,CACxC,OAAsC,KAEtC,iBAAiB,CACb,uBAAuB,EACvB,OAAO,EACP,kCAAkC;;AClB1C,MAaa,sBAAuB,SAAQ,UAA2B,CAAA;AAbvE,IAAA,WAAA,GAAA;;AAcqB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC1C,IAAS,CAAA,SAAA,GAAG,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAClD,IAAI,CAAA,IAAA,GAAG,eAAe,EAAE,CAAC;AAEvB,QAAA,IAAA,CAAA,IAAI,GAAG,uBAAuB,CAAC,uBAAuB,CAAC,CAAC;AACxD,QAAA,IAAA,CAAA,eAAe,GAAG,kBAAkB,CACnD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,CACrD,CAAC;AAEiB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,MAAK;YACzC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;SACpE,EAAE,uBAAuB,CAAC,CAAC;AAET,QAAA,IAAA,CAAA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IACzB,sBAAsB;IACtB,sBAAsB;IACtB,gBAAgB;;;ACRpB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-month.mjs","sources":["../../../projects/kit/components/input-month/input-month.options.ts","../../../projects/kit/components/input-month/input-month.directive.ts","../../../projects/kit/components/input-month/input-month.component.ts","../../../projects/kit/components/input-month/input-month.template.html","../../../projects/kit/components/input-month/input-month.ts","../../../projects/kit/components/input-month/taiga-ui-kit-components-input-month.ts"],"sourcesContent":["import type {FactoryProvider} from '@angular/core';\nimport {inject, InjectionToken} from '@angular/core';\nimport type {TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {TUI_IDENTITY_VALUE_TRANSFORMER} from '@taiga-ui/cdk/classes';\nimport type {TuiMonth} from '@taiga-ui/cdk/date-time';\nimport type {TuiHandler} from '@taiga-ui/cdk/types';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';\nimport {\n TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW,\n TUI_INPUT_DATE_OPTIONS_NEW,\n} from '@taiga-ui/kit/components/input-date';\n\nexport interface TuiInputMonthOptions {\n readonly icon: TuiHandler<TuiSizeL | TuiSizeS, string>;\n readonly valueTransformer: TuiValueTransformer<TuiMonth | null, any>;\n}\n\n/**\n * @deprecated remove in v5\n */\nexport const TUI_INPUT_MONTH_DEFAULT_OPTIONS: TuiInputMonthOptions = {\n icon: () => '@tui.calendar',\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n};\n\nexport const TUI_INPUT_MONTH_OPTIONS = new InjectionToken<TuiInputMonthOptions>(\n ngDevMode ? 'TUI_INPUT_MONTH_OPTIONS' : '',\n {\n factory: () => ({\n ...inject(TUI_INPUT_DATE_OPTIONS_NEW),\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n }),\n },\n);\n\nexport const tuiInputMonthOptionsProvider = (\n options: Partial<TuiInputMonthOptions>,\n): FactoryProvider =>\n tuiProvideOptions(\n TUI_INPUT_MONTH_OPTIONS,\n options,\n TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW,\n );\n","import {computed, Directive, effect, inject} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport type {TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n TuiTextfieldDirective,\n tuiTextfieldIconBinding,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n tuiDropdownOpen,\n} from '@taiga-ui/core/directives/dropdown';\nimport {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\nimport {TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens';\n\nimport {TUI_INPUT_MONTH_OPTIONS} from './input-month.options';\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputMonth]',\n providers: [\n tuiAsControl(TuiInputMonthDirective),\n tuiValueTransformerFrom(TUI_INPUT_MONTH_OPTIONS),\n ],\n hostDirectives: [TuiWithTextfield, TuiSelectLike, TuiDropdownAuto],\n host: {\n '[disabled]': 'disabled()',\n '(input)': '$event.inputType?.includes(\"delete\") && clear()',\n },\n})\nexport class TuiInputMonthDirective extends TuiControl<TuiMonth | null> {\n private readonly textfield = inject(TuiTextfieldDirective);\n private readonly formatter = toSignal(inject(TUI_MONTH_FORMATTER));\n private readonly open = tuiDropdownOpen();\n\n protected readonly icon = tuiTextfieldIconBinding(TUI_INPUT_MONTH_OPTIONS);\n protected readonly dropdownEnabled = tuiDropdownEnabled(\n computed(() => !this.native && this.interactive()),\n );\n\n protected readonly valueEffect = effect(() => {\n this.textfield.value.set(this.formatter()?.(this.value()) || '');\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly calendarIn = effect(() => {\n this.calendar()?.value.set(this.value());\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly calendarOut = effect((onCleanup) => {\n const subscription = this.calendar()?.monthClick.subscribe((month) => {\n this.onChange(month);\n this.open.set(false);\n });\n\n onCleanup(() => subscription?.unsubscribe());\n });\n\n public readonly calendar = tuiInjectAuxiliary<TuiCalendarMonth>(\n (x) => x instanceof TuiCalendarMonth,\n );\n\n public readonly native =\n tuiInjectElement<HTMLInputElement>().type === 'month' && inject(TUI_IS_MOBILE);\n\n protected clear(): void {\n this.onChange(null);\n this.open.set(this.dropdownEnabled());\n }\n}\n","import {NgIf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TuiTextfieldContent} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputMonthDirective} from './input-month.directive';\n\n@Component({\n standalone: true,\n selector: 'input[tuiInputMonth][type=\"month\"]',\n imports: [NgIf, TuiTextfieldContent],\n templateUrl: './input-month.template.html',\n styleUrls: ['./input-month.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n ngSkipHydration: 'true',\n '[type]': '\"text\"',\n },\n})\nexport class TuiInputMonthComponent {\n protected readonly host = inject(TuiInputMonthDirective);\n protected readonly min = signal<TuiMonth | null>(null);\n protected readonly max = signal<TuiMonth | null>(null);\n protected readonly calendarSync = effect(() => {\n const calendar = this.host.calendar();\n\n if (calendar) {\n calendar.min.set(this.min() ?? TUI_FIRST_DAY); // TODO(v5): remove TUI_FIRST_DAY fallback\n calendar.max.set(this.max() ?? TUI_LAST_DAY); // TODO(v5): remove TUI_LAST_DAY fallback\n }\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n // TODO(v5): use signal inputs\n @Input('min')\n public set minSetter(x: TuiMonth | null) {\n this.min.set(x);\n }\n\n // TODO(v5): use signal inputs\n @Input('max')\n public set maxSetter(x: TuiMonth | null) {\n this.max.set(x);\n }\n\n protected onInput(value: string): void {\n if (!value) {\n return this.host.onChange(null);\n }\n\n const [year = 0, month = 0] = value.split('-').map(Number);\n\n this.host.onChange(new TuiMonth(year, month - 1));\n }\n}\n","<ng-container *ngIf=\"host.native\">\n <input\n *tuiTextfieldContent\n type=\"month\"\n [max]=\"max()?.toJSON()\"\n [min]=\"min()?.toJSON()\"\n [value]=\"host.value()?.toJSON()\"\n (click.stop.zoneless)=\"(0)\"\n (input)=\"onInput($any($event.target).value)\"\n (pointerdown.stop.zoneless)=\"(0)\"\n />\n</ng-container>\n","import {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthComponent} from './input-month.component';\nimport {TuiInputMonthDirective} from './input-month.directive';\n\nexport const TuiInputMonth = [\n TuiInputMonthComponent,\n TuiInputMonthDirective,\n TuiCalendarMonth,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAkBA;;AAEG;AACU,MAAA,+BAA+B,GAAyB;AACjE,IAAA,IAAI,EAAE,MAAM,eAAe;AAC3B,IAAA,gBAAgB,EAAE,8BAA8B;EAClD;AAEW,MAAA,uBAAuB,GAAG,IAAI,cAAc,CACrD,SAAS,GAAG,yBAAyB,GAAG,EAAE,EAC1C;AACI,IAAA,OAAO,EAAE,OAAO;QACZ,GAAG,MAAM,CAAC,0BAA0B,CAAC;AACrC,QAAA,gBAAgB,EAAE,8BAA8B;KACnD,CAAC;AACL,CAAA,EACH;AAEW,MAAA,4BAA4B,GAAG,CACx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A,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,IAAI,6FAAE,mBAAmB,EAAA,QAAA,EAAA,kCAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;4FAU1B,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAblC,SAAS;AACM,YAAA,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,YACN,oCAAoC,EAAA,OAAA,EACrC,CAAC,IAAI,EAAE,mBAAmB,CAAC,EAGrB,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,eAAe,EAAE,MAAM;AACvB,wBAAA,QAAQ,EAAE,QAAQ;AACrB,qBAAA,EAAA,QAAA,EAAA,iYAAA,EAAA,MAAA,EAAA,CAAA,iTAAA,CAAA,EAAA,CAAA;8BAiBU,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,KAAK,CAAA;gBAOD,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,KAAK,CAAA;;;AE5CH,MAAA,aAAa,GAAG;IACzB,sBAAsB;IACtB,sBAAsB;IACtB,gBAAgB;;;ACRpB;;AAEG;;;;"}
|
|
@@ -240,7 +240,7 @@ class TuiInputNumberStep {
|
|
|
240
240
|
this.input.setValue(value);
|
|
241
241
|
}
|
|
242
242
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputNumberStep, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
243
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputNumberStep, isStandalone: true, selector: "input[tuiInputNumber][step]", inputs: { stepSetter: ["step", "stepSetter"] }, host: { attributes: { "ngSkipHydration": "true" }, listeners: { "keydown.arrowDown.prevent": "onStep(-step())", "keydown.arrowUp.prevent": "onStep(step())" }, properties: { "class._with-buttons": "step()" } }, ngImport: i0, template: "<ng-container *tuiTextfieldContent>\n <section\n *ngIf=\"step()\"\n class=\"t-input-number-buttons\"\n >\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() >= input.max()\"\n [iconStart]=\"options.icons.increase\"\n (click.prevent)=\"onStep(step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n +\n </button>\n\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() <= input.min()\"\n [iconStart]=\"options.icons.decrease\"\n (click.prevent)=\"onStep(-step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n -\n </button>\n </section>\n</ng-container>\n", styles: [".t-input-number-buttons.t-input-number-buttons{position:absolute;right:0;display:flex;block-size:var(--t-height);flex-direction:column;gap:.125rem;border-radius:inherit}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons{flex-direction:row-reverse}.t-input-number-buttons.t-input-number-buttons>*{flex:1 1 0;border-radius:0}.t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit}.t-input-number-buttons.t-input-number-buttons>*:last-child{border-bottom-right-radius:inherit}tui-textfield[data-size=l] .t-input-number-buttons.t-input-number-buttons>*{inline-size:var(--tui-height-m)}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0}[tuiInputNumber]._with-buttons{border-top-right-radius:0;border-bottom-right-radius:0}tui-textfield[data-size=l]{--t-input-number-offset-end: calc(var(--tui-height-m) + .125rem)}tui-textfield[data-size=m]{--t-input-number-offset-end: calc(var(--tui-height-s) + .125rem)}tui-textfield[data-size=s]{--t-input-number-offset-end: calc(2 * var(--tui-height-s) + .25rem)}[tuiInputNumber]._with-buttons,[tuiInputNumber]._with-buttons~.t-template{inline-size:calc(100% - var(--t-input-number-offset-end))}[tuiInputNumber]._with-buttons~.t-content{margin-inline-end:var(--t-input-number-offset-end)}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
243
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputNumberStep, isStandalone: true, selector: "input[tuiInputNumber][step]", inputs: { stepSetter: ["step", "stepSetter"] }, host: { attributes: { "ngSkipHydration": "true" }, listeners: { "keydown.arrowDown.prevent": "onStep(-step())", "keydown.arrowUp.prevent": "onStep(step())" }, properties: { "class._with-buttons": "step()" } }, ngImport: i0, template: "<ng-container *tuiTextfieldContent>\n <section\n *ngIf=\"step()\"\n class=\"t-input-number-buttons\"\n >\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() >= input.max()\"\n [iconStart]=\"options.icons.increase\"\n (click.prevent)=\"onStep(step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n +\n </button>\n\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() <= input.min()\"\n [iconStart]=\"options.icons.decrease\"\n (click.prevent)=\"onStep(-step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n -\n </button>\n </section>\n</ng-container>\n", styles: [".t-input-number-buttons.t-input-number-buttons{position:absolute;right:0;display:flex;block-size:var(--t-height);flex-direction:column;gap:.125rem;border-radius:inherit}@supports (inset-inline-end: 0){.t-input-number-buttons.t-input-number-buttons{right:unset;inset-inline-end:0}}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons{flex-direction:row-reverse}.t-input-number-buttons.t-input-number-buttons>*{flex:1 1 0;border-radius:0}.t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit}.t-input-number-buttons.t-input-number-buttons>*:last-child{border-bottom-right-radius:inherit}[dir=rtl] .t-input-number-buttons.t-input-number-buttons>*:first-child{border-radius:0;border-top-left-radius:inherit}[dir=rtl] .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0;border-bottom-left-radius:inherit}tui-textfield[data-size=l] .t-input-number-buttons.t-input-number-buttons>*{inline-size:var(--tui-height-m)}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0}[tuiInputNumber]._with-buttons{border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] [tuiInputNumber]._with-buttons{border-radius:inherit;border-top-left-radius:0;border-bottom-left-radius:0}tui-textfield[data-size=l]{--t-input-number-offset-end: calc(var(--tui-height-m) + .125rem)}tui-textfield[data-size=m]{--t-input-number-offset-end: calc(var(--tui-height-s) + .125rem)}tui-textfield[data-size=s]{--t-input-number-offset-end: calc(2 * var(--tui-height-s) + .25rem)}[tuiInputNumber]._with-buttons,[tuiInputNumber]._with-buttons~.t-template{inline-size:calc(100% - var(--t-input-number-offset-end));margin-inline-end:var(--t-input-number-offset-end)}[tuiInputNumber]._with-buttons~.t-content{margin-inline-end:var(--t-input-number-offset-end)}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
244
244
|
}
|
|
245
245
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputNumberStep, decorators: [{
|
|
246
246
|
type: Component,
|
|
@@ -249,7 +249,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
249
249
|
'(keydown.arrowDown.prevent)': 'onStep(-step())',
|
|
250
250
|
'(keydown.arrowUp.prevent)': 'onStep(step())',
|
|
251
251
|
'[class._with-buttons]': 'step()',
|
|
252
|
-
}, template: "<ng-container *tuiTextfieldContent>\n <section\n *ngIf=\"step()\"\n class=\"t-input-number-buttons\"\n >\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() >= input.max()\"\n [iconStart]=\"options.icons.increase\"\n (click.prevent)=\"onStep(step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n +\n </button>\n\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() <= input.min()\"\n [iconStart]=\"options.icons.decrease\"\n (click.prevent)=\"onStep(-step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n -\n </button>\n </section>\n</ng-container>\n", styles: [".t-input-number-buttons.t-input-number-buttons{position:absolute;right:0;display:flex;block-size:var(--t-height);flex-direction:column;gap:.125rem;border-radius:inherit}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons{flex-direction:row-reverse}.t-input-number-buttons.t-input-number-buttons>*{flex:1 1 0;border-radius:0}.t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit}.t-input-number-buttons.t-input-number-buttons>*:last-child{border-bottom-right-radius:inherit}tui-textfield[data-size=l] .t-input-number-buttons.t-input-number-buttons>*{inline-size:var(--tui-height-m)}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0}[tuiInputNumber]._with-buttons{border-top-right-radius:0;border-bottom-right-radius:0}tui-textfield[data-size=l]{--t-input-number-offset-end: calc(var(--tui-height-m) + .125rem)}tui-textfield[data-size=m]{--t-input-number-offset-end: calc(var(--tui-height-s) + .125rem)}tui-textfield[data-size=s]{--t-input-number-offset-end: calc(2 * var(--tui-height-s) + .25rem)}[tuiInputNumber]._with-buttons,[tuiInputNumber]._with-buttons~.t-template{inline-size:calc(100% - var(--t-input-number-offset-end))}[tuiInputNumber]._with-buttons~.t-content{margin-inline-end:var(--t-input-number-offset-end)}\n"] }]
|
|
252
|
+
}, template: "<ng-container *tuiTextfieldContent>\n <section\n *ngIf=\"step()\"\n class=\"t-input-number-buttons\"\n >\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() >= input.max()\"\n [iconStart]=\"options.icons.increase\"\n (click.prevent)=\"onStep(step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n +\n </button>\n\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() <= input.min()\"\n [iconStart]=\"options.icons.decrease\"\n (click.prevent)=\"onStep(-step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n -\n </button>\n </section>\n</ng-container>\n", styles: [".t-input-number-buttons.t-input-number-buttons{position:absolute;right:0;display:flex;block-size:var(--t-height);flex-direction:column;gap:.125rem;border-radius:inherit}@supports (inset-inline-end: 0){.t-input-number-buttons.t-input-number-buttons{right:unset;inset-inline-end:0}}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons{flex-direction:row-reverse}.t-input-number-buttons.t-input-number-buttons>*{flex:1 1 0;border-radius:0}.t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit}.t-input-number-buttons.t-input-number-buttons>*:last-child{border-bottom-right-radius:inherit}[dir=rtl] .t-input-number-buttons.t-input-number-buttons>*:first-child{border-radius:0;border-top-left-radius:inherit}[dir=rtl] .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0;border-bottom-left-radius:inherit}tui-textfield[data-size=l] .t-input-number-buttons.t-input-number-buttons>*{inline-size:var(--tui-height-m)}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0}[tuiInputNumber]._with-buttons{border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] [tuiInputNumber]._with-buttons{border-radius:inherit;border-top-left-radius:0;border-bottom-left-radius:0}tui-textfield[data-size=l]{--t-input-number-offset-end: calc(var(--tui-height-m) + .125rem)}tui-textfield[data-size=m]{--t-input-number-offset-end: calc(var(--tui-height-s) + .125rem)}tui-textfield[data-size=s]{--t-input-number-offset-end: calc(2 * var(--tui-height-s) + .25rem)}[tuiInputNumber]._with-buttons,[tuiInputNumber]._with-buttons~.t-template{inline-size:calc(100% - var(--t-input-number-offset-end));margin-inline-end:var(--t-input-number-offset-end)}[tuiInputNumber]._with-buttons~.t-content{margin-inline-end:var(--t-input-number-offset-end)}\n"] }]
|
|
253
253
|
}], propDecorators: { stepSetter: [{
|
|
254
254
|
type: Input,
|
|
255
255
|
args: ['step']
|