@taiga-ui/kit 4.52.0-canary.c91900a → 4.52.0-canary.ca43bcb
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/combo-box/combo-box.d.ts +2 -0
- package/components/combo-box/combo-box.directive.d.ts +5 -5
- package/components/combo-box/index.d.ts +1 -0
- package/components/confirm/confirm.component.d.ts +1 -1
- package/components/confirm/confirm.service.d.ts +1 -1
- package/components/copy/copy.directive.d.ts +1 -2
- package/components/input-chip/input-chip.component.d.ts +1 -1
- package/components/input-chip/input-chip.d.ts +1 -1
- package/components/input-chip/input-chip.directive.d.ts +2 -2
- package/components/input-color/index.d.ts +1 -0
- package/components/input-color/input-color.component.d.ts +4 -4
- package/components/input-color/input-color.d.ts +2 -0
- package/components/input-date/input-date.d.ts +1 -1
- package/components/input-date/input-date.directive.d.ts +5 -5
- package/components/input-date-multi/input-date-multi.d.ts +1 -2
- package/components/input-date-multi/input-date-multi.directive.d.ts +1 -1
- package/components/input-date-range/input-date-range.d.ts +1 -1
- package/components/input-date-range/input-date-range.directive.d.ts +3 -3
- package/components/input-date-time/input-date-time.d.ts +1 -1
- package/components/input-date-time/input-date-time.directive.d.ts +3 -3
- package/components/input-month/input-month.d.ts +1 -1
- package/components/input-month/input-month.directive.d.ts +5 -4
- package/components/input-month-range/input-month-range.d.ts +1 -1
- package/components/input-month-range/input-month-range.directive.d.ts +5 -4
- package/components/input-number/input-number.d.ts +1 -1
- package/components/input-number/input-number.directive.d.ts +3 -3
- package/components/input-phone/index.d.ts +1 -0
- package/components/input-phone/input-phone.d.ts +2 -0
- package/components/input-phone/input-phone.directive.d.ts +7 -7
- package/components/input-phone-international/index.d.ts +1 -0
- package/components/input-phone-international/input-phone-international.component.d.ts +1 -6
- package/components/input-phone-international/input-phone-international.d.ts +2 -0
- package/components/input-pin/index.d.ts +1 -0
- package/components/input-pin/input-pin.component.d.ts +3 -3
- package/components/input-pin/input-pin.d.ts +2 -0
- package/components/input-range/input-range.component.d.ts +8 -40
- package/components/input-slider/input-slider.d.ts +1 -1
- package/components/input-time/input-time.component.d.ts +1 -3
- package/components/input-time/input-time.d.ts +1 -1
- package/components/input-time/input-time.directive.d.ts +3 -3
- package/components/input-year/input-year.d.ts +1 -1
- package/components/input-year/input-year.directive.d.ts +4 -4
- package/components/line-clamp/line-clamp-box.component.d.ts +1 -1
- package/components/notification-middle/notification-middle.service.d.ts +1 -1
- package/components/preview/dialog/preview-dialog.service.d.ts +1 -1
- package/components/push/push-alert.component.d.ts +1 -1
- package/components/push/push.options.d.ts +1 -1
- package/components/push/push.service.d.ts +1 -1
- package/components/routable-dialog/generate-dialogable-route.d.ts +1 -1
- package/components/select/native-select/native-select.component.d.ts +4 -4
- package/components/select/select.d.ts +1 -1
- package/components/select/select.directive.d.ts +4 -3
- package/components/textarea/index.d.ts +2 -1
- package/components/textarea/textarea.component.d.ts +4 -4
- package/components/textarea/textarea.d.ts +3 -0
- package/components/textarea/textarea.directive.d.ts +13 -0
- package/components/toast/toast.component.d.ts +1 -1
- package/components/toast/toast.options.d.ts +1 -1
- package/components/toast/toast.service.d.ts +1 -1
- package/directives/button-select/button-select.directive.d.ts +1 -1
- package/directives/index.d.ts +0 -1
- package/directives/password/password.directive.d.ts +1 -1
- package/directives/tooltip/tooltip.directive.d.ts +1 -1
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs +25 -22
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-confirm.mjs +1 -1
- package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-copy.mjs +5 -8
- package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-filter.mjs +1 -1
- package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs +16 -10
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-color.mjs +16 -13
- package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs +6 -5
- package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +12 -7
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +13 -10
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date.mjs +13 -10
- package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +11 -8
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month.mjs +12 -9
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +12 -10
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +74 -64
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs +21 -18
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs +8 -6
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-range.mjs +52 -49
- package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs +2 -1
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-time.mjs +23 -24
- package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-year.mjs +14 -9
- package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs +1 -1
- package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +1 -1
- package/fesm2022/taiga-ui-kit-components-notification-middle.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-preview.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-push.mjs +6 -7
- package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs +1 -1
- package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-select.mjs +31 -16
- package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-slider.mjs +1 -1
- package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tabs.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +43 -45
- package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-toast.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-button-select.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-button-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs +1 -1
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs +1 -1
- package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-password.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-password.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives.mjs +0 -1
- package/fesm2022/taiga-ui-kit-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs +43 -0
- package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-pipes-flag.mjs +31 -0
- package/fesm2022/taiga-ui-kit-pipes-flag.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-pipes-initials.mjs +28 -0
- package/fesm2022/taiga-ui-kit-pipes-initials.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-pipes.mjs +3 -0
- package/fesm2022/taiga-ui-kit-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-tokens.mjs +1 -1
- package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-utils.mjs +1 -7
- package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
- package/package.json +26 -18
- package/pipes/auto-color/auto-color.pipe.d.ts +13 -0
- package/pipes/auto-color/index.d.ts +1 -0
- package/pipes/flag/flag.pipe.d.ts +14 -0
- package/pipes/flag/index.d.ts +1 -0
- package/pipes/index.d.ts +3 -0
- package/pipes/initials/index.d.ts +1 -0
- package/pipes/initials/initials.pipe.d.ts +7 -0
- package/utils/index.d.ts +0 -1
- package/components/textarea/textarea-limit.directive.d.ts +0 -26
- package/directives/lazy-loading/index.d.ts +0 -2
- package/directives/lazy-loading/lazy-loading.directive.d.ts +0 -18
- package/directives/lazy-loading/lazy-loading.service.d.ts +0 -12
- package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs +0 -80
- package/fesm2022/taiga-ui-kit-directives-lazy-loading.mjs.map +0 -1
- package/utils/phone.d.ts +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, computed, effect, signal, untracked, Input, Directive, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
3
|
import { tuiDirectiveBinding, tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
4
|
-
import * as i1 from '@taiga-ui/core/components/textfield';
|
|
5
|
-
import { TuiTextfieldComponent, tuiInjectAuxiliary,
|
|
4
|
+
import * as i1$1 from '@taiga-ui/core/components/textfield';
|
|
5
|
+
import { TuiTextfieldComponent, tuiInjectAuxiliary, tuiTextfieldIcon, TuiWithNativePicker, TuiTextfieldContent, TuiTextfield } from '@taiga-ui/core/components/textfield';
|
|
6
6
|
import { TUI_DATE_FORMAT } from '@taiga-ui/core/tokens';
|
|
7
7
|
import { TUI_DATE_TEXTS } from '@taiga-ui/kit/tokens';
|
|
8
8
|
import { identity } from 'rxjs';
|
|
@@ -15,10 +15,12 @@ import { TUI_IDENTITY_VALUE_TRANSFORMER, TuiControl, tuiAsControl, tuiValueTrans
|
|
|
15
15
|
import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
|
|
16
16
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
17
17
|
import { tuiAsOptionContent } from '@taiga-ui/core/components/data-list';
|
|
18
|
-
import * as
|
|
19
|
-
import {
|
|
18
|
+
import * as i1 from '@taiga-ui/core/components/input';
|
|
19
|
+
import { TuiInputDirective, TuiWithInput } from '@taiga-ui/core/components/input';
|
|
20
20
|
import * as i3 from '@taiga-ui/core/directives/items-handlers';
|
|
21
21
|
import { TuiItemsHandlersDirective, TUI_ITEMS_HANDLERS, TuiItemsHandlersValidator } from '@taiga-ui/core/directives/items-handlers';
|
|
22
|
+
import * as i2 from '@taiga-ui/core/portals/dropdown';
|
|
23
|
+
import { TuiDropdownOpen, tuiDropdownEnabled, TuiDropdownAuto } from '@taiga-ui/core/portals/dropdown';
|
|
22
24
|
import { TuiCalendarRange } from '@taiga-ui/kit/components/calendar-range';
|
|
23
25
|
import { TuiSelectOption } from '@taiga-ui/kit/components/select';
|
|
24
26
|
import { tuiMaskito } from '@taiga-ui/kit/utils';
|
|
@@ -50,7 +52,7 @@ class TuiInputDateBase extends TuiControl {
|
|
|
50
52
|
super(...arguments);
|
|
51
53
|
this.calendar = tuiInjectAuxiliary((x) => x instanceof TuiCalendar || x instanceof TuiCalendarRange);
|
|
52
54
|
this.el = tuiInjectElement();
|
|
53
|
-
this.
|
|
55
|
+
this.input = inject(TuiInputDirective);
|
|
54
56
|
this.filler = tuiWithDateFiller();
|
|
55
57
|
this.mobile = inject(TUI_IS_MOBILE);
|
|
56
58
|
this.open = inject(TuiDropdownOpen).open;
|
|
@@ -62,7 +64,7 @@ class TuiInputDateBase extends TuiControl {
|
|
|
62
64
|
this.valueEffect = effect(() => {
|
|
63
65
|
const value = this.stringify(this.value()) ||
|
|
64
66
|
(this.filler().length === this.el.value.length ? '' : this.el.value);
|
|
65
|
-
this.
|
|
67
|
+
this.input.value.set(value);
|
|
66
68
|
});
|
|
67
69
|
this.calendarIn = effect(() => {
|
|
68
70
|
if (this.calendar()) {
|
|
@@ -88,7 +90,7 @@ class TuiInputDateBase extends TuiControl {
|
|
|
88
90
|
const changed = untracked(() => value !== this.value());
|
|
89
91
|
if (changed || reset) {
|
|
90
92
|
super.writeValue(value);
|
|
91
|
-
this.
|
|
93
|
+
this.input.value.set(this.stringify(this.value()));
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
setDate(value) {
|
|
@@ -156,7 +158,7 @@ class TuiInputDateDirective extends TuiInputDateBase {
|
|
|
156
158
|
tuiAsOptionContent(TuiSelectOption),
|
|
157
159
|
tuiAsControl(TuiInputDateDirective),
|
|
158
160
|
tuiValueTransformerFrom(TUI_INPUT_DATE_OPTIONS_NEW),
|
|
159
|
-
], usesInheritance: true, hostDirectives: [{ directive: i1.
|
|
161
|
+
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.TuiDropdownAuto }, { directive: i3.TuiItemsHandlersValidator }, { directive: i4.MaskitoDirective }], ngImport: i0 }); }
|
|
160
162
|
}
|
|
161
163
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputDateDirective, decorators: [{
|
|
162
164
|
type: Directive,
|
|
@@ -168,7 +170,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
168
170
|
tuiValueTransformerFrom(TUI_INPUT_DATE_OPTIONS_NEW),
|
|
169
171
|
],
|
|
170
172
|
hostDirectives: [
|
|
171
|
-
|
|
173
|
+
TuiWithInput,
|
|
172
174
|
TuiDropdownAuto,
|
|
173
175
|
TuiItemsHandlersValidator,
|
|
174
176
|
MaskitoDirective,
|
|
@@ -189,7 +191,7 @@ class TuiInputDateComponent {
|
|
|
189
191
|
this.host.onChange(new TuiDay(year, month - 1, day));
|
|
190
192
|
}
|
|
191
193
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
192
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiInputDateComponent, isStandalone: true, selector: "input[tuiInputDate][type=\"date\"]", inputs: { list: "list" }, host: { attributes: { "ngSkipHydration": "true" }, properties: { "attr.list": "null" } }, hostDirectives: [{ directive: i1.TuiWithNativePicker }], ngImport: i0, template: "@if (host.native) {\n <input\n *tuiTextfieldContent\n type=\"date\"\n [attr.list]=\"list\"\n [max]=\"host.max().toJSON()\"\n [min]=\"host.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}\n", styles: ["tui-textfield input[tuiInputDate]~.t-content input[type=date]{position:absolute;inset:0 0 0 auto;inline-size:2.5rem;padding:0;opacity:0}tui-textfield input[tuiInputDate]~.t-content input[type=date]::-webkit-calendar-picker-indicator{position:absolute;top:0;left:0;inline-size:100%;block-size:100%}\n"], dependencies: [{ kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
194
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiInputDateComponent, isStandalone: true, selector: "input[tuiInputDate][type=\"date\"]", inputs: { list: "list" }, host: { attributes: { "ngSkipHydration": "true" }, properties: { "attr.list": "null" } }, hostDirectives: [{ directive: i1$1.TuiWithNativePicker }], ngImport: i0, template: "@if (host.native) {\n <input\n *tuiTextfieldContent\n type=\"date\"\n [attr.list]=\"list\"\n [max]=\"host.max().toJSON()\"\n [min]=\"host.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}\n", styles: ["tui-textfield input[tuiInputDate]~.t-content input[type=date]{position:absolute;inset:0 0 0 auto;inline-size:2.5rem;padding:0;opacity:0}tui-textfield input[tuiInputDate]~.t-content input[type=date]::-webkit-calendar-picker-indicator{position:absolute;top:0;left:0;inline-size:100%;block-size:100%}\n"], dependencies: [{ kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
193
195
|
}
|
|
194
196
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputDateComponent, decorators: [{
|
|
195
197
|
type: Component,
|
|
@@ -205,6 +207,7 @@ const TuiInputDate = [
|
|
|
205
207
|
TuiInputDateDirective,
|
|
206
208
|
TuiInputDateComponent,
|
|
207
209
|
TuiCalendar,
|
|
210
|
+
TuiTextfield,
|
|
208
211
|
];
|
|
209
212
|
|
|
210
213
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-date.mjs","sources":["../../../projects/kit/components/input-date/date-filler.ts","../../../projects/kit/components/input-date/input-date.options.ts","../../../projects/kit/components/input-date/input-date.directive.ts","../../../projects/kit/components/input-date/input-date.component.ts","../../../projects/kit/components/input-date/input-date.template.html","../../../projects/kit/components/input-date/input-date.ts","../../../projects/kit/components/input-date/taiga-ui-kit-components-input-date.ts"],"sourcesContent":["import {computed, inject, type Signal} from '@angular/core';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/di';\nimport {TuiTextfieldComponent} from '@taiga-ui/core/components/textfield';\nimport {TUI_DATE_FORMAT} from '@taiga-ui/core/tokens';\nimport {TUI_DATE_TEXTS} from '@taiga-ui/kit/tokens';\nimport {identity} from 'rxjs';\n\nfunction changeDateSeparator(dateString: string, newDateSeparator: string): string {\n return dateString.replaceAll(/[^0-9A-Za-zА-Яа-я]/gi, newDateSeparator);\n}\n\nexport function tuiWithDateFiller(\n fn: (dateFiller: string) => string = identity,\n): Signal<string> {\n const texts = inject(TUI_DATE_TEXTS);\n const format = inject(TUI_DATE_FORMAT);\n\n return tuiDirectiveBinding(\n TuiTextfieldComponent,\n 'filler',\n computed(() => {\n const {mode, separator} = format();\n const fillersMap = texts() ?? '';\n const filler = fillersMap && changeDateSeparator(fillersMap[mode], separator);\n\n return fn(filler);\n }),\n {},\n );\n}\n","import {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY, type TuiDay} from '@taiga-ui/cdk/date-time';\nimport {type TuiHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\n\nexport interface TuiInputDateOptionsNew {\n readonly icon: TuiHandler<TuiSizeL | TuiSizeS, string>;\n readonly max: TuiDay;\n readonly min: TuiDay;\n readonly valueTransformer: TuiValueTransformer<TuiDay | null, any>;\n}\n\nexport const TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW = {\n icon: () => '@tui.calendar',\n min: TUI_FIRST_DAY,\n max: TUI_LAST_DAY,\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n} as const;\n\nexport const [TUI_INPUT_DATE_OPTIONS_NEW, tuiInputDateOptionsProviderNew] =\n tuiCreateOptions<TuiInputDateOptionsNew>(TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW);\n","import {\n computed,\n Directive,\n effect,\n inject,\n Input,\n signal,\n untracked,\n} from '@angular/core';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {maskitoDateOptionsGenerator} from '@maskito/kit';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {\n DATE_FILLER_LENGTH,\n TuiDay,\n type TuiDayRange,\n type TuiTime,\n} from '@taiga-ui/cdk/date-time';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {type TuiBooleanHandler} from '@taiga-ui/cdk/types';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TuiCalendar} from '@taiga-ui/core/components/calendar';\nimport {tuiAsOptionContent} from '@taiga-ui/core/components/data-list';\nimport {\n tuiInjectAuxiliary,\n TuiTextfieldDirective,\n tuiTextfieldIcon,\n TuiWithNativePicker,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n TuiDropdownOpen,\n} from '@taiga-ui/core/directives/dropdown';\nimport {\n TUI_ITEMS_HANDLERS,\n type TuiItemsHandlers,\n TuiItemsHandlersDirective,\n TuiItemsHandlersValidator,\n} from '@taiga-ui/core/directives/items-handlers';\nimport {TUI_DATE_FORMAT} from '@taiga-ui/core/tokens';\nimport {TuiCalendarRange} from '@taiga-ui/kit/components/calendar-range';\nimport {TuiSelectOption} from '@taiga-ui/kit/components/select';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {tuiWithDateFiller} from './date-filler';\nimport {\n TUI_INPUT_DATE_OPTIONS_NEW,\n type TuiInputDateOptionsNew,\n} from './input-date.options';\n\n@Directive({\n host: {\n '[attr.inputmode]': 'mobile && open() ? \"none\" : \"numeric\"',\n '[disabled]': 'disabled()',\n '(input)': 'onValueChange($event.target.value)',\n '(click.capture.stop)': 'onClick()',\n },\n})\nexport abstract class TuiInputDateBase<\n T extends TuiDay | TuiDayRange | readonly [TuiDay, TuiTime | null],\n> extends TuiControl<T | null> {\n private readonly calendar = tuiInjectAuxiliary<TuiCalendar | TuiCalendarRange>(\n (x) => x instanceof TuiCalendar || x instanceof TuiCalendarRange,\n );\n\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly textfield = inject(TuiTextfieldDirective);\n protected readonly filler = tuiWithDateFiller();\n protected readonly mobile = inject(TUI_IS_MOBILE);\n protected readonly open = inject(TuiDropdownOpen).open;\n protected readonly icon = tuiTextfieldIcon(TUI_INPUT_DATE_OPTIONS_NEW);\n protected readonly handlers = inject<TuiItemsHandlers<T>>(TuiItemsHandlersDirective);\n protected readonly format = inject(TUI_DATE_FORMAT);\n protected readonly dropdownEnabled = tuiDropdownEnabled(\n computed(() => !this.native && this.interactive()),\n );\n\n protected readonly options: Omit<TuiInputDateOptionsNew, 'valueTransformer'> = inject(\n TUI_INPUT_DATE_OPTIONS_NEW,\n );\n\n protected readonly valueEffect = effect(() => {\n const value =\n this.stringify(this.value()) ||\n (this.filler().length === this.el.value.length ? '' : this.el.value);\n\n this.textfield.value.set(value);\n });\n\n protected readonly calendarIn = effect(() => {\n if (this.calendar()) {\n this.processCalendar(this.calendar()!);\n }\n });\n\n protected readonly calendarOut = effect((onCleanup) => {\n const subscription = this.calendar()?.valueChange.subscribe((value) =>\n this.setDate(value),\n );\n\n onCleanup(() => subscription?.unsubscribe());\n });\n\n public readonly min = signal(this.options.min);\n public readonly max = signal(this.options.max);\n public readonly native =\n !!inject(TuiWithNativePicker, {optional: true}) && this.mobile;\n\n protected abstract onValueChange(value: string): void;\n\n @Input('min')\n public set minSetter(min: Exclude<T, TuiDayRange> | TuiDay | null) {\n this.min.set(min instanceof TuiDay ? min : this.options.min);\n }\n\n @Input('max')\n public set maxSetter(max: Exclude<T, TuiDayRange> | TuiDay | null) {\n this.max.set(max instanceof TuiDay ? max : this.options.max);\n }\n\n public override writeValue(value: T | null): void {\n const reset = this.control.pristine && this.control.untouched && !value;\n const changed = untracked(() => value !== this.value());\n\n if (changed || reset) {\n super.writeValue(value);\n this.textfield.value.set(this.stringify(this.value()));\n }\n }\n\n public setDate(value: TuiDay | TuiDayRange | readonly TuiDay[]): void {\n this.onChange(value as T);\n this.open.set(false);\n\n if (!this.el.closest('tui-dropdown')) {\n this.el.blur();\n }\n }\n\n protected processCalendar(calendar: TuiCalendar | TuiCalendarRange): void {\n const value = this.value();\n\n calendar.value = Array.isArray(value) ? value[0] : value;\n calendar.disabledItemHandler =\n this.handlers.disabledItemHandler() as TuiBooleanHandler<\n TuiDay | TuiDayRange\n >;\n calendar.min = this.min();\n calendar.max = this.max();\n }\n\n protected onClick(): void {\n if (!this.mobile && this.dropdownEnabled()) {\n this.open.update((open) => !open);\n }\n }\n\n protected stringify(value: T | null): string {\n return value?.toString(this.format().mode, this.format().separator) ?? '';\n }\n}\n\n@Directive({\n selector: 'input[tuiInputDate]',\n providers: [\n tuiAsOptionContent(TuiSelectOption),\n tuiAsControl(TuiInputDateDirective),\n tuiValueTransformerFrom(TUI_INPUT_DATE_OPTIONS_NEW),\n ],\n hostDirectives: [\n TuiWithTextfield,\n TuiDropdownAuto,\n TuiItemsHandlersValidator,\n MaskitoDirective,\n ],\n})\nexport class TuiInputDateDirective extends TuiInputDateBase<TuiDay> {\n protected readonly identity = inject<TuiItemsHandlers<TuiDay>>(\n TUI_ITEMS_HANDLERS,\n ).identityMatcher.set((a, b) => a.daySame(b));\n\n protected readonly mask = tuiMaskito(\n computed(() =>\n maskitoDateOptionsGenerator({\n separator: this.format().separator,\n mode: this.format().mode,\n min: this.min().toLocalNativeDate(),\n max: this.max().toLocalNativeDate(),\n }),\n ),\n );\n\n protected override onValueChange(value: string): void {\n this.control?.control?.updateValueAndValidity({emitEvent: false});\n this.onChange(\n value.length === DATE_FILLER_LENGTH\n ? TuiDay.normalizeParse(value, this.format().mode)\n : null,\n );\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TuiDay} from '@taiga-ui/cdk/date-time';\nimport {\n TuiTextfieldContent,\n TuiWithNativePicker,\n} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputDateDirective} from './input-date.directive';\n\n@Component({\n selector: 'input[tuiInputDate][type=\"date\"]',\n imports: [TuiTextfieldContent],\n templateUrl: './input-date.template.html',\n styleUrl: './input-date.style.less',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiWithNativePicker],\n host: {\n ngSkipHydration: 'true',\n '[attr.list]': 'null',\n },\n})\nexport class TuiInputDateComponent {\n protected readonly host = inject(TuiInputDateDirective);\n\n @Input()\n public list: string | null = null;\n\n protected onInput(value: string): void {\n if (!value) {\n return this.host.onChange(null);\n }\n\n const [year = 0, month = 0, day = 0] = value.split('-').map(Number);\n\n this.host.onChange(new TuiDay(year, month - 1, day));\n }\n}\n","@if (host.native) {\n <input\n *tuiTextfieldContent\n type=\"date\"\n [attr.list]=\"list\"\n [max]=\"host.max().toJSON()\"\n [min]=\"host.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}\n","import {TuiCalendar} from '@taiga-ui/core/components/calendar';\n\nimport {TuiInputDateComponent} from './input-date.component';\nimport {TuiInputDateDirective} from './input-date.directive';\n\nexport const TuiInputDate = [\n TuiInputDateDirective,\n TuiInputDateComponent,\n TuiCalendar,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,mBAAmB,CAAC,UAAkB,EAAE,gBAAwB,EAAA;IACrE,OAAO,UAAU,CAAC,UAAU,CAAC,sBAAsB,EAAE,gBAAgB,CAAC;AAC1E;AAEgB,SAAA,iBAAiB,CAC7B,EAAA,GAAqC,QAAQ,EAAA;AAE7C,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AACpC,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;IAEtC,OAAO,mBAAmB,CACtB,qBAAqB,EACrB,QAAQ,EACR,QAAQ,CAAC,MAAK;QACV,MAAM,EAAC,IAAI,EAAE,SAAS,EAAC,GAAG,MAAM,EAAE;AAClC,QAAA,MAAM,UAAU,GAAG,KAAK,EAAE,IAAI,EAAE;AAChC,QAAA,MAAM,MAAM,GAAG,UAAU,IAAI,mBAAmB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;AAE7E,QAAA,OAAO,EAAE,CAAC,MAAM,CAAC;AACrB,KAAC,CAAC,EACF,EAAE,CACL;AACL;;ACba,MAAA,kCAAkC,GAAG;AAC9C,IAAA,IAAI,EAAE,MAAM,eAAe;AAC3B,IAAA,GAAG,EAAE,aAAa;AAClB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B,qBAAqB;IACrB,WAAW;;;ACRf;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-date.mjs","sources":["../../../projects/kit/components/input-date/date-filler.ts","../../../projects/kit/components/input-date/input-date.options.ts","../../../projects/kit/components/input-date/input-date.directive.ts","../../../projects/kit/components/input-date/input-date.component.ts","../../../projects/kit/components/input-date/input-date.template.html","../../../projects/kit/components/input-date/input-date.ts","../../../projects/kit/components/input-date/taiga-ui-kit-components-input-date.ts"],"sourcesContent":["import {computed, inject, type Signal} from '@angular/core';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/di';\nimport {TuiTextfieldComponent} from '@taiga-ui/core/components/textfield';\nimport {TUI_DATE_FORMAT} from '@taiga-ui/core/tokens';\nimport {TUI_DATE_TEXTS} from '@taiga-ui/kit/tokens';\nimport {identity} from 'rxjs';\n\nfunction changeDateSeparator(dateString: string, newDateSeparator: string): string {\n return dateString.replaceAll(/[^0-9A-Za-zА-Яа-я]/gi, newDateSeparator);\n}\n\nexport function tuiWithDateFiller(\n fn: (dateFiller: string) => string = identity,\n): Signal<string> {\n const texts = inject(TUI_DATE_TEXTS);\n const format = inject(TUI_DATE_FORMAT);\n\n return tuiDirectiveBinding(\n TuiTextfieldComponent,\n 'filler',\n computed(() => {\n const {mode, separator} = format();\n const fillersMap = texts() ?? '';\n const filler = fillersMap && changeDateSeparator(fillersMap[mode], separator);\n\n return fn(filler);\n }),\n {},\n );\n}\n","import {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY, type TuiDay} from '@taiga-ui/cdk/date-time';\nimport {type TuiHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\n\nexport interface TuiInputDateOptionsNew {\n readonly icon: TuiHandler<TuiSizeL | TuiSizeS, string>;\n readonly max: TuiDay;\n readonly min: TuiDay;\n readonly valueTransformer: TuiValueTransformer<TuiDay | null, any>;\n}\n\nexport const TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW = {\n icon: () => '@tui.calendar',\n min: TUI_FIRST_DAY,\n max: TUI_LAST_DAY,\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n} as const;\n\nexport const [TUI_INPUT_DATE_OPTIONS_NEW, tuiInputDateOptionsProviderNew] =\n tuiCreateOptions<TuiInputDateOptionsNew>(TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW);\n","import {\n computed,\n Directive,\n effect,\n inject,\n Input,\n signal,\n untracked,\n} from '@angular/core';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {maskitoDateOptionsGenerator} from '@maskito/kit';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {\n DATE_FILLER_LENGTH,\n TuiDay,\n type TuiDayRange,\n type TuiTime,\n} from '@taiga-ui/cdk/date-time';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {type TuiBooleanHandler} from '@taiga-ui/cdk/types';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TuiCalendar} from '@taiga-ui/core/components/calendar';\nimport {tuiAsOptionContent} from '@taiga-ui/core/components/data-list';\nimport {TuiInputDirective, TuiWithInput} from '@taiga-ui/core/components/input';\nimport {\n tuiInjectAuxiliary,\n tuiTextfieldIcon,\n TuiWithNativePicker,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TUI_ITEMS_HANDLERS,\n type TuiItemsHandlers,\n TuiItemsHandlersDirective,\n TuiItemsHandlersValidator,\n} from '@taiga-ui/core/directives/items-handlers';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n TuiDropdownOpen,\n} from '@taiga-ui/core/portals/dropdown';\nimport {TUI_DATE_FORMAT} from '@taiga-ui/core/tokens';\nimport {TuiCalendarRange} from '@taiga-ui/kit/components/calendar-range';\nimport {TuiSelectOption} from '@taiga-ui/kit/components/select';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {tuiWithDateFiller} from './date-filler';\nimport {\n TUI_INPUT_DATE_OPTIONS_NEW,\n type TuiInputDateOptionsNew,\n} from './input-date.options';\n\n@Directive({\n host: {\n '[attr.inputmode]': 'mobile && open() ? \"none\" : \"numeric\"',\n '[disabled]': 'disabled()',\n '(input)': 'onValueChange($event.target.value)',\n '(click.capture.stop)': 'onClick()',\n },\n})\nexport abstract class TuiInputDateBase<\n T extends TuiDay | TuiDayRange | readonly [TuiDay, TuiTime | null],\n> extends TuiControl<T | null> {\n private readonly calendar = tuiInjectAuxiliary<TuiCalendar | TuiCalendarRange>(\n (x) => x instanceof TuiCalendar || x instanceof TuiCalendarRange,\n );\n\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly input = inject(TuiInputDirective);\n protected readonly filler = tuiWithDateFiller();\n protected readonly mobile = inject(TUI_IS_MOBILE);\n protected readonly open = inject(TuiDropdownOpen).open;\n protected readonly icon = tuiTextfieldIcon(TUI_INPUT_DATE_OPTIONS_NEW);\n protected readonly handlers = inject<TuiItemsHandlers<T>>(TuiItemsHandlersDirective);\n protected readonly format = inject(TUI_DATE_FORMAT);\n protected readonly dropdownEnabled = tuiDropdownEnabled(\n computed(() => !this.native && this.interactive()),\n );\n\n protected readonly options: Omit<TuiInputDateOptionsNew, 'valueTransformer'> = inject(\n TUI_INPUT_DATE_OPTIONS_NEW,\n );\n\n protected readonly valueEffect = effect(() => {\n const value =\n this.stringify(this.value()) ||\n (this.filler().length === this.el.value.length ? '' : this.el.value);\n\n this.input.value.set(value);\n });\n\n protected readonly calendarIn = effect(() => {\n if (this.calendar()) {\n this.processCalendar(this.calendar()!);\n }\n });\n\n protected readonly calendarOut = effect((onCleanup) => {\n const subscription = this.calendar()?.valueChange.subscribe((value) =>\n this.setDate(value),\n );\n\n onCleanup(() => subscription?.unsubscribe());\n });\n\n public readonly min = signal(this.options.min);\n public readonly max = signal(this.options.max);\n public readonly native =\n !!inject(TuiWithNativePicker, {optional: true}) && this.mobile;\n\n protected abstract onValueChange(value: string): void;\n\n @Input('min')\n public set minSetter(min: Exclude<T, TuiDayRange> | TuiDay | null) {\n this.min.set(min instanceof TuiDay ? min : this.options.min);\n }\n\n @Input('max')\n public set maxSetter(max: Exclude<T, TuiDayRange> | TuiDay | null) {\n this.max.set(max instanceof TuiDay ? max : this.options.max);\n }\n\n public override writeValue(value: T | null): void {\n const reset = this.control.pristine && this.control.untouched && !value;\n const changed = untracked(() => value !== this.value());\n\n if (changed || reset) {\n super.writeValue(value);\n this.input.value.set(this.stringify(this.value()));\n }\n }\n\n public setDate(value: TuiDay | TuiDayRange | readonly TuiDay[]): void {\n this.onChange(value as T);\n this.open.set(false);\n\n if (!this.el.closest('tui-dropdown')) {\n this.el.blur();\n }\n }\n\n protected processCalendar(calendar: TuiCalendar | TuiCalendarRange): void {\n const value = this.value();\n\n calendar.value = Array.isArray(value) ? value[0] : value;\n calendar.disabledItemHandler =\n this.handlers.disabledItemHandler() as TuiBooleanHandler<\n TuiDay | TuiDayRange\n >;\n calendar.min = this.min();\n calendar.max = this.max();\n }\n\n protected onClick(): void {\n if (!this.mobile && this.dropdownEnabled()) {\n this.open.update((open) => !open);\n }\n }\n\n protected stringify(value: T | null): string {\n return value?.toString(this.format().mode, this.format().separator) ?? '';\n }\n}\n\n@Directive({\n selector: 'input[tuiInputDate]',\n providers: [\n tuiAsOptionContent(TuiSelectOption),\n tuiAsControl(TuiInputDateDirective),\n tuiValueTransformerFrom(TUI_INPUT_DATE_OPTIONS_NEW),\n ],\n hostDirectives: [\n TuiWithInput,\n TuiDropdownAuto,\n TuiItemsHandlersValidator,\n MaskitoDirective,\n ],\n})\nexport class TuiInputDateDirective extends TuiInputDateBase<TuiDay> {\n protected readonly identity = inject<TuiItemsHandlers<TuiDay>>(\n TUI_ITEMS_HANDLERS,\n ).identityMatcher.set((a, b) => a.daySame(b));\n\n protected readonly mask = tuiMaskito(\n computed(() =>\n maskitoDateOptionsGenerator({\n separator: this.format().separator,\n mode: this.format().mode,\n min: this.min().toLocalNativeDate(),\n max: this.max().toLocalNativeDate(),\n }),\n ),\n );\n\n protected override onValueChange(value: string): void {\n this.control?.control?.updateValueAndValidity({emitEvent: false});\n this.onChange(\n value.length === DATE_FILLER_LENGTH\n ? TuiDay.normalizeParse(value, this.format().mode)\n : null,\n );\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TuiDay} from '@taiga-ui/cdk/date-time';\nimport {\n TuiTextfieldContent,\n TuiWithNativePicker,\n} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputDateDirective} from './input-date.directive';\n\n@Component({\n selector: 'input[tuiInputDate][type=\"date\"]',\n imports: [TuiTextfieldContent],\n templateUrl: './input-date.template.html',\n styleUrl: './input-date.style.less',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiWithNativePicker],\n host: {\n ngSkipHydration: 'true',\n '[attr.list]': 'null',\n },\n})\nexport class TuiInputDateComponent {\n protected readonly host = inject(TuiInputDateDirective);\n\n @Input()\n public list: string | null = null;\n\n protected onInput(value: string): void {\n if (!value) {\n return this.host.onChange(null);\n }\n\n const [year = 0, month = 0, day = 0] = value.split('-').map(Number);\n\n this.host.onChange(new TuiDay(year, month - 1, day));\n }\n}\n","@if (host.native) {\n <input\n *tuiTextfieldContent\n type=\"date\"\n [attr.list]=\"list\"\n [max]=\"host.max().toJSON()\"\n [min]=\"host.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}\n","import {TuiCalendar} from '@taiga-ui/core/components/calendar';\nimport {TuiTextfield} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputDateComponent} from './input-date.component';\nimport {TuiInputDateDirective} from './input-date.directive';\n\nexport const TuiInputDate = [\n TuiInputDateDirective,\n TuiInputDateComponent,\n TuiCalendar,\n TuiTextfield,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,mBAAmB,CAAC,UAAkB,EAAE,gBAAwB,EAAA;IACrE,OAAO,UAAU,CAAC,UAAU,CAAC,sBAAsB,EAAE,gBAAgB,CAAC;AAC1E;AAEgB,SAAA,iBAAiB,CAC7B,EAAA,GAAqC,QAAQ,EAAA;AAE7C,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AACpC,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;IAEtC,OAAO,mBAAmB,CACtB,qBAAqB,EACrB,QAAQ,EACR,QAAQ,CAAC,MAAK;QACV,MAAM,EAAC,IAAI,EAAE,SAAS,EAAC,GAAG,MAAM,EAAE;AAClC,QAAA,MAAM,UAAU,GAAG,KAAK,EAAE,IAAI,EAAE;AAChC,QAAA,MAAM,MAAM,GAAG,UAAU,IAAI,mBAAmB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;AAE7E,QAAA,OAAO,EAAE,CAAC,MAAM,CAAC;AACrB,KAAC,CAAC,EACF,EAAE,CACL;AACL;;ACba,MAAA,kCAAkC,GAAG;AAC9C,IAAA,IAAI,EAAE,MAAM,eAAe;AAC3B,IAAA,GAAG,EAAE,aAAa;AAClB,IAAA,GAAG,EAAE,YAAY;AACjB,IAAA,gBAAgB,EAAE,8BAA8B;;AAG7C,MAAM,CAAC,0BAA0B,EAAE,8BAA8B,CAAC,GACrE,gBAAgB,CAAyB,kCAAkC;;ACmCzE,MAAgB,gBAEpB,SAAQ,UAAoB,CAAA;AAV9B,IAAA,WAAA,GAAA;;AAWqB,QAAA,IAAA,CAAA,QAAQ,GAAG,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EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,MAAA,EAAA,EAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAAA,IAAA,CAAA,mBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC5BlC,uYAaA,EAAA,MAAA,EAAA,CAAA,6SAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDIc,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;;4FAWpB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kCAAkC,WACnC,CAAC,mBAAmB,CAAC,EAAA,aAAA,EAGf,iBAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,cAAA,EAC/B,CAAC,mBAAmB,CAAC,EAC/B,IAAA,EAAA;AACF,wBAAA,eAAe,EAAE,MAAM;AACvB,wBAAA,aAAa,EAAE,MAAM;AACxB,qBAAA,EAAA,QAAA,EAAA,uYAAA,EAAA,MAAA,EAAA,CAAA,6SAAA,CAAA,EAAA;8BAMM,IAAI,EAAA,CAAA;sBADV;;;AEzBQ,MAAA,YAAY,GAAG;IACxB,qBAAqB;IACrB,qBAAqB;IACrB,WAAW;IACX,YAAY;;;ACVhB;;AAEG;;;;"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import * as i2 from '@taiga-ui/core/components/textfield';
|
|
2
|
+
import { tuiInjectAuxiliary, tuiTextfieldIcon, TuiSelectLike, TuiTextfield } from '@taiga-ui/core/components/textfield';
|
|
1
3
|
import { TuiCalendarMonth } from '@taiga-ui/kit/components/calendar-month';
|
|
2
4
|
import * as i0 from '@angular/core';
|
|
3
5
|
import { InjectionToken, inject, signal, effect, Directive } from '@angular/core';
|
|
4
6
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
5
7
|
import { TUI_IDENTITY_VALUE_TRANSFORMER, TuiControl, tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
|
|
6
8
|
import { RANGE_SEPARATOR_CHAR, TuiMonthRange } from '@taiga-ui/cdk/date-time';
|
|
7
|
-
import * as i1 from '@taiga-ui/core/components/
|
|
8
|
-
import {
|
|
9
|
-
import * as
|
|
10
|
-
import { TuiDropdownOpen, tuiDropdownEnabled, TuiDropdownAuto } from '@taiga-ui/core/
|
|
9
|
+
import * as i1 from '@taiga-ui/core/components/input';
|
|
10
|
+
import { TuiInputDirective, TuiWithInput } from '@taiga-ui/core/components/input';
|
|
11
|
+
import * as i3 from '@taiga-ui/core/portals/dropdown';
|
|
12
|
+
import { TuiDropdownOpen, tuiDropdownEnabled, TuiDropdownAuto } from '@taiga-ui/core/portals/dropdown';
|
|
11
13
|
import { TUI_MONTH_FORMATTER } from '@taiga-ui/kit/tokens';
|
|
12
14
|
import { tuiProvideOptions } from '@taiga-ui/cdk/utils/di';
|
|
13
15
|
import { TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW } from '@taiga-ui/kit/components/input-date';
|
|
@@ -24,7 +26,7 @@ const tuiInputMonthRangeOptionsProvider = (options) => tuiProvideOptions(TUI_INP
|
|
|
24
26
|
class TuiInputMonthRangeDirective extends TuiControl {
|
|
25
27
|
constructor() {
|
|
26
28
|
super(...arguments);
|
|
27
|
-
this.
|
|
29
|
+
this.input = inject(TuiInputDirective);
|
|
28
30
|
this.formatter = toSignal(inject(TUI_MONTH_FORMATTER));
|
|
29
31
|
this.open = inject(TuiDropdownOpen).open;
|
|
30
32
|
this.intermediateValue = signal(null);
|
|
@@ -37,7 +39,7 @@ class TuiInputMonthRangeDirective extends TuiControl {
|
|
|
37
39
|
const string = value
|
|
38
40
|
? format(value.from) + RANGE_SEPARATOR_CHAR + format(value.to)
|
|
39
41
|
: '';
|
|
40
|
-
this.
|
|
42
|
+
this.input.value.set(string);
|
|
41
43
|
});
|
|
42
44
|
this.calendarInit = effect(() => {
|
|
43
45
|
const calendar = this.calendar();
|
|
@@ -74,7 +76,7 @@ class TuiInputMonthRangeDirective extends TuiControl {
|
|
|
74
76
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiInputMonthRangeDirective, isStandalone: true, selector: "input[tuiInputMonthRange]", host: { listeners: { "input": "$event.inputType?.includes(\"delete\") && clear()" }, properties: { "disabled": "disabled()" } }, providers: [
|
|
75
77
|
tuiAsControl(TuiInputMonthRangeDirective),
|
|
76
78
|
tuiValueTransformerFrom(TUI_INPUT_MONTH_RANGE_OPTIONS),
|
|
77
|
-
], usesInheritance: true, hostDirectives: [{ directive: i1.
|
|
79
|
+
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.TuiSelectLike }, { directive: i3.TuiDropdownAuto }], ngImport: i0 }); }
|
|
78
80
|
}
|
|
79
81
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputMonthRangeDirective, decorators: [{
|
|
80
82
|
type: Directive,
|
|
@@ -84,7 +86,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
84
86
|
tuiAsControl(TuiInputMonthRangeDirective),
|
|
85
87
|
tuiValueTransformerFrom(TUI_INPUT_MONTH_RANGE_OPTIONS),
|
|
86
88
|
],
|
|
87
|
-
hostDirectives: [
|
|
89
|
+
hostDirectives: [TuiWithInput, TuiSelectLike, TuiDropdownAuto],
|
|
88
90
|
host: {
|
|
89
91
|
'[disabled]': 'disabled()',
|
|
90
92
|
'(input)': '$event.inputType?.includes("delete") && clear()',
|
|
@@ -95,6 +97,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
95
97
|
const TuiInputMonthRange = [
|
|
96
98
|
TuiInputMonthRangeDirective,
|
|
97
99
|
TuiCalendarMonth,
|
|
100
|
+
TuiTextfield,
|
|
98
101
|
];
|
|
99
102
|
|
|
100
103
|
/**
|
|
@@ -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, inject, InjectionToken} from '@angular/core';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} 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/di';\nimport {type TuiSizeL, type 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 {\n RANGE_SEPARATOR_CHAR,\n type TuiMonth,\n TuiMonthRange,\n} from '@taiga-ui/cdk/date-time';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n
|
|
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, inject, InjectionToken} from '@angular/core';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} 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/di';\nimport {type TuiSizeL, type 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 {\n RANGE_SEPARATOR_CHAR,\n type TuiMonth,\n TuiMonthRange,\n} from '@taiga-ui/cdk/date-time';\nimport {TuiInputDirective, TuiWithInput} from '@taiga-ui/core/components/input';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n tuiTextfieldIcon,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n TuiDropdownOpen,\n} from '@taiga-ui/core/portals/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 selector: 'input[tuiInputMonthRange]',\n providers: [\n tuiAsControl(TuiInputMonthRangeDirective),\n tuiValueTransformerFrom(TUI_INPUT_MONTH_RANGE_OPTIONS),\n ],\n hostDirectives: [TuiWithInput, 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 input = inject(TuiInputDirective);\n private readonly formatter = toSignal(inject(TUI_MONTH_FORMATTER));\n private readonly open = inject(TuiDropdownOpen).open;\n private readonly intermediateValue = signal<TuiMonth | null>(null);\n private readonly calendar = tuiInjectAuxiliary<TuiCalendarMonth>(\n (x) => x instanceof TuiCalendarMonth,\n );\n\n protected readonly icon = tuiTextfieldIcon(TUI_INPUT_MONTH_RANGE_OPTIONS);\n protected readonly dropdownEnabled = tuiDropdownEnabled(this.interactive);\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.input.value.set(string);\n });\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 });\n\n // TODO: use linked signal (Angular 19+)\n protected readonly resetIntermediateValue = effect(() => {\n this.intermediateValue.set(this.value() && null);\n });\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 {TuiTextfield} from '@taiga-ui/core/components/textfield';\nimport {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 TuiTextfield,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAiBa,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,8BAA8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
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import * as i2 from '@taiga-ui/core/components/textfield';
|
|
2
|
+
import { tuiTextfieldIcon, tuiInjectAuxiliary, TuiWithNativePicker, TuiSelectLike, TuiTextfieldContent, TuiTextfield } from '@taiga-ui/core/components/textfield';
|
|
1
3
|
import { TuiCalendarMonth } from '@taiga-ui/kit/components/calendar-month';
|
|
2
4
|
import * as i0 from '@angular/core';
|
|
3
5
|
import { InjectionToken, inject, computed, effect, Directive, signal, Input, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
4
6
|
import { TUI_FIRST_DAY, TUI_LAST_DAY, TuiMonth } from '@taiga-ui/cdk/date-time';
|
|
5
|
-
import * as i1 from '@taiga-ui/core/components/textfield';
|
|
6
|
-
import { TuiTextfieldDirective, tuiTextfieldIcon, tuiInjectAuxiliary, TuiWithNativePicker, TuiWithTextfield, TuiSelectLike, TuiTextfieldContent } from '@taiga-ui/core/components/textfield';
|
|
7
7
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
8
8
|
import { TUI_IDENTITY_VALUE_TRANSFORMER, TuiControl, tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
|
|
9
9
|
import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
|
|
10
|
-
import * as
|
|
11
|
-
import {
|
|
10
|
+
import * as i1 from '@taiga-ui/core/components/input';
|
|
11
|
+
import { TuiInputDirective, TuiWithInput } from '@taiga-ui/core/components/input';
|
|
12
|
+
import * as i3 from '@taiga-ui/core/portals/dropdown';
|
|
13
|
+
import { TuiDropdownOpen, tuiDropdownEnabled, TuiDropdownAuto } from '@taiga-ui/core/portals/dropdown';
|
|
12
14
|
import { TUI_MONTH_FORMATTER } from '@taiga-ui/kit/tokens';
|
|
13
15
|
import { tuiProvideOptions } from '@taiga-ui/cdk/utils/di';
|
|
14
16
|
import { TUI_INPUT_DATE_OPTIONS_NEW, TUI_INPUT_DATE_DEFAULT_OPTIONS_NEW } from '@taiga-ui/kit/components/input-date';
|
|
@@ -31,13 +33,13 @@ const tuiInputMonthOptionsProvider = (options) => tuiProvideOptions(TUI_INPUT_MO
|
|
|
31
33
|
class TuiInputMonthDirective extends TuiControl {
|
|
32
34
|
constructor() {
|
|
33
35
|
super(...arguments);
|
|
34
|
-
this.
|
|
36
|
+
this.input = inject(TuiInputDirective);
|
|
35
37
|
this.formatter = toSignal(inject(TUI_MONTH_FORMATTER));
|
|
36
38
|
this.open = inject(TuiDropdownOpen).open;
|
|
37
39
|
this.icon = tuiTextfieldIcon(TUI_INPUT_MONTH_OPTIONS);
|
|
38
40
|
this.dropdownEnabled = tuiDropdownEnabled(computed(() => !this.native && this.interactive()));
|
|
39
41
|
this.valueEffect = effect(() => {
|
|
40
|
-
this.
|
|
42
|
+
this.input.value.set(this.formatter()?.(this.value()) || '');
|
|
41
43
|
});
|
|
42
44
|
this.calendarIn = effect(() => {
|
|
43
45
|
this.calendar()?.value.set(this.value());
|
|
@@ -60,7 +62,7 @@ class TuiInputMonthDirective extends TuiControl {
|
|
|
60
62
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiInputMonthDirective, isStandalone: true, selector: "input[tuiInputMonth]", host: { listeners: { "input": "$event.inputType?.includes(\"delete\") && clear()" }, properties: { "disabled": "disabled()" } }, providers: [
|
|
61
63
|
tuiAsControl(TuiInputMonthDirective),
|
|
62
64
|
tuiValueTransformerFrom(TUI_INPUT_MONTH_OPTIONS),
|
|
63
|
-
], usesInheritance: true, hostDirectives: [{ directive: i1.
|
|
65
|
+
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.TuiSelectLike }, { directive: i3.TuiDropdownAuto }], ngImport: i0 }); }
|
|
64
66
|
}
|
|
65
67
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputMonthDirective, decorators: [{
|
|
66
68
|
type: Directive,
|
|
@@ -70,7 +72,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
70
72
|
tuiAsControl(TuiInputMonthDirective),
|
|
71
73
|
tuiValueTransformerFrom(TUI_INPUT_MONTH_OPTIONS),
|
|
72
74
|
],
|
|
73
|
-
hostDirectives: [
|
|
75
|
+
hostDirectives: [TuiWithInput, TuiSelectLike, TuiDropdownAuto],
|
|
74
76
|
host: {
|
|
75
77
|
'[disabled]': 'disabled()',
|
|
76
78
|
'(input)': '$event.inputType?.includes("delete") && clear()',
|
|
@@ -107,7 +109,7 @@ class TuiInputMonthComponent {
|
|
|
107
109
|
this.host.onChange(new TuiMonth(year, month - 1));
|
|
108
110
|
}
|
|
109
111
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputMonthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
110
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiInputMonthComponent, isStandalone: true, selector: "input[tuiInputMonth][type=\"month\"]", inputs: { minSetter: ["min", "minSetter"], maxSetter: ["max", "maxSetter"] }, host: { attributes: { "ngSkipHydration": "true" } }, hostDirectives: [{ directive:
|
|
112
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiInputMonthComponent, isStandalone: true, selector: "input[tuiInputMonth][type=\"month\"]", inputs: { minSetter: ["min", "minSetter"], maxSetter: ["max", "maxSetter"] }, host: { attributes: { "ngSkipHydration": "true" } }, hostDirectives: [{ directive: i2.TuiWithNativePicker }], ngImport: i0, template: "@if (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}\n", styles: ["tui-textfield input[tuiInputMonth]~.t-content input[type=month]{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;opacity:0}tui-textfield input[tuiInputMonth]~.t-content input[type=month]::-webkit-calendar-picker-indicator{position:absolute;top:0;left:0;inline-size:100%;block-size:100%}\n"], dependencies: [{ kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
111
113
|
}
|
|
112
114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputMonthComponent, decorators: [{
|
|
113
115
|
type: Component,
|
|
@@ -126,6 +128,7 @@ const TuiInputMonth = [
|
|
|
126
128
|
TuiInputMonthComponent,
|
|
127
129
|
TuiInputMonthDirective,
|
|
128
130
|
TuiCalendarMonth,
|
|
131
|
+
TuiTextfield,
|
|
129
132
|
];
|
|
130
133
|
|
|
131
134
|
/**
|
|
@@ -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, inject, InjectionToken} from '@angular/core';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} 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/di';\nimport {type TuiSizeL, type 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 {type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n TuiTextfieldDirective,\n tuiTextfieldIcon,\n TuiWithNativePicker,\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 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 = inject(TuiDropdownOpen).open;\n\n protected readonly icon = tuiTextfieldIcon(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 });\n\n protected readonly calendarIn = effect(() => {\n this.calendar()?.value.set(this.value());\n });\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 !!inject(TuiWithNativePicker, {optional: true}) && inject(TUI_IS_MOBILE);\n\n protected clear(): void {\n this.onChange(null);\n this.open.set(this.dropdownEnabled());\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {\n TuiTextfieldContent,\n TuiWithNativePicker,\n} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputMonthDirective} from './input-month.directive';\n\n@Component({\n selector: 'input[tuiInputMonth][type=\"month\"]',\n imports: [TuiTextfieldContent],\n templateUrl: './input-month.template.html',\n styleUrl: './input-month.style.less',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiWithNativePicker],\n host: {\n ngSkipHydration: 'true',\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 });\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","@if (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}\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":";;;;;;;;;;;;;;;AAmBA;;AAEG;AACU,MAAA,+BAA+B,GAAyB;AACjE,IAAA,IAA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Oc,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;;4FAUpB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAZlC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oCAAoC,WACrC,CAAC,mBAAmB,CAAC,EAAA,aAAA,EAGf,iBAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,cAAA,EAC/B,CAAC,mBAAmB,CAAC,EAC/B,IAAA,EAAA;AACF,wBAAA,eAAe,EAAE,MAAM;AAC1B,qBAAA,EAAA,QAAA,EAAA,kWAAA,EAAA,MAAA,EAAA,CAAA,iTAAA,CAAA,EAAA;8BAiBU,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,KAAK;gBAOD,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,KAAK;;;AE5CH,MAAA,aAAa,GAAG;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, inject, InjectionToken} from '@angular/core';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} 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/di';\nimport {type TuiSizeL, type 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 {type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {TuiInputDirective, TuiWithInput} from '@taiga-ui/core/components/input';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n tuiTextfieldIcon,\n TuiWithNativePicker,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n TuiDropdownOpen,\n} from '@taiga-ui/core/portals/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 selector: 'input[tuiInputMonth]',\n providers: [\n tuiAsControl(TuiInputMonthDirective),\n tuiValueTransformerFrom(TUI_INPUT_MONTH_OPTIONS),\n ],\n hostDirectives: [TuiWithInput, 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 input = inject(TuiInputDirective);\n private readonly formatter = toSignal(inject(TUI_MONTH_FORMATTER));\n private readonly open = inject(TuiDropdownOpen).open;\n\n protected readonly icon = tuiTextfieldIcon(TUI_INPUT_MONTH_OPTIONS);\n protected readonly dropdownEnabled = tuiDropdownEnabled(\n computed(() => !this.native && this.interactive()),\n );\n\n protected readonly valueEffect = effect(() => {\n this.input.value.set(this.formatter()?.(this.value()) || '');\n });\n\n protected readonly calendarIn = effect(() => {\n this.calendar()?.value.set(this.value());\n });\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 !!inject(TuiWithNativePicker, {optional: true}) && inject(TUI_IS_MOBILE);\n\n protected clear(): void {\n this.onChange(null);\n this.open.set(this.dropdownEnabled());\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {\n TuiTextfieldContent,\n TuiWithNativePicker,\n} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputMonthDirective} from './input-month.directive';\n\n@Component({\n selector: 'input[tuiInputMonth][type=\"month\"]',\n imports: [TuiTextfieldContent],\n templateUrl: './input-month.template.html',\n styleUrl: './input-month.style.less',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiWithNativePicker],\n host: {\n ngSkipHydration: 'true',\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 });\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","@if (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}\n","import {TuiTextfield} from '@taiga-ui/core/components/textfield';\nimport {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 TuiTextfield,\n] as const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,EAAA,EAAA,EAAA,QAAA,EC7BnC,kWAYA,EAAA,MAAA,EAAA,CAAA,iTAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDOc,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;;4FAUpB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAZlC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oCAAoC,WACrC,CAAC,mBAAmB,CAAC,EAAA,aAAA,EAGf,iBAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,cAAA,EAC/B,CAAC,mBAAmB,CAAC,EAC/B,IAAA,EAAA;AACF,wBAAA,eAAe,EAAE,MAAM;AAC1B,qBAAA,EAAA,QAAA,EAAA,kWAAA,EAAA,MAAA,EAAA,CAAA,iTAAA,CAAA,EAAA;8BAiBU,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,KAAK;gBAOD,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,KAAK;;;AE3CH,MAAA,aAAa,GAAG;IACzB,sBAAsB;IACtB,sBAAsB;IACtB,gBAAgB;IAChB,YAAY;;;ACVhB;;AAEG;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TUI_TEXTFIELD_OPTIONS, TuiTextfieldContent, TuiTextfield } from '@taiga-ui/core/components/textfield';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
3
|
import { inject, computed, effect, input, untracked, Directive, signal, Input, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
4
|
import * as i2 from '@maskito/angular';
|
|
@@ -9,8 +10,8 @@ import { CHAR_MINUS, CHAR_HYPHEN } from '@taiga-ui/cdk/constants';
|
|
|
9
10
|
import { TUI_IS_IOS } from '@taiga-ui/cdk/tokens';
|
|
10
11
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
11
12
|
import { tuiIsSafeToRound, tuiRound, tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
12
|
-
import * as i1 from '@taiga-ui/core/components/
|
|
13
|
-
import {
|
|
13
|
+
import * as i1 from '@taiga-ui/core/components/input';
|
|
14
|
+
import { TuiInputDirective, TuiWithInput } from '@taiga-ui/core/components/input';
|
|
14
15
|
import { TUI_NUMBER_FORMAT } from '@taiga-ui/core/tokens';
|
|
15
16
|
import { tuiFormatNumber, tuiGetFractionPartPadded } from '@taiga-ui/core/utils/format';
|
|
16
17
|
import { tuiMaskito } from '@taiga-ui/kit/utils';
|
|
@@ -40,10 +41,10 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
40
41
|
constructor() {
|
|
41
42
|
super(...arguments);
|
|
42
43
|
this.options = inject(TUI_INPUT_NUMBER_OPTIONS);
|
|
43
|
-
this.
|
|
44
|
+
this.input = inject(TuiInputDirective);
|
|
44
45
|
this.isIOS = inject(TUI_IS_IOS);
|
|
45
46
|
this.numberFormat = inject(TUI_NUMBER_FORMAT);
|
|
46
|
-
this.formatted = computed(() => maskitoParseNumber(this.
|
|
47
|
+
this.formatted = computed(() => maskitoParseNumber(this.input.value(), this.numberFormat()));
|
|
47
48
|
this.precision = computed((precision = this.numberFormat().precision) => Number.isNaN(precision) ? 2 : precision);
|
|
48
49
|
this.unfinished = computed((value = this.formatted()) => value < 0 ? value > this.max() : value < this.min());
|
|
49
50
|
this.element = tuiInjectElement();
|
|
@@ -62,7 +63,7 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
62
63
|
});
|
|
63
64
|
this.defaultMaxLength = computed(() => {
|
|
64
65
|
const { decimalSeparator, thousandSeparator } = this.numberFormat();
|
|
65
|
-
const decimalPart = !!this.precision() && this.
|
|
66
|
+
const decimalPart = !!this.precision() && this.input.value().includes(decimalSeparator);
|
|
66
67
|
const precision = decimalPart ? Math.min(this.precision() + 1, 20) : 0;
|
|
67
68
|
const takeThousand = thousandSeparator.repeat(5).length;
|
|
68
69
|
const affixes = this.prefix().length + this.postfix().length;
|
|
@@ -88,7 +89,7 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
88
89
|
min: Number.MIN_SAFE_INTEGER,
|
|
89
90
|
max: Number.MAX_SAFE_INTEGER,
|
|
90
91
|
});
|
|
91
|
-
this.
|
|
92
|
+
this.input.value.update((x) => maskitoTransform(x, options));
|
|
92
93
|
});
|
|
93
94
|
this.min = computed(() => Math.min(this.minRaw(), this.maxRaw()));
|
|
94
95
|
this.max = computed(() => Math.max(this.minRaw(), this.maxRaw()));
|
|
@@ -112,11 +113,11 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
setValue(value) {
|
|
115
|
-
this.
|
|
116
|
+
this.input.value.set(this.formatNumber(value));
|
|
116
117
|
}
|
|
117
118
|
onFocus() {
|
|
118
119
|
if (Number.isNaN(this.formatted()) && !this.readOnly()) {
|
|
119
|
-
this.
|
|
120
|
+
this.input.value.set(this.prefix() + this.postfix());
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
get maskParams() {
|
|
@@ -169,7 +170,7 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
169
170
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiInputNumberDirective, isStandalone: true, selector: "input[tuiInputNumber]", inputs: { prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, postfix: { classPropertyName: "postfix", publicName: "postfix", isSignal: true, isRequired: false, transformFunction: null }, minRaw: { classPropertyName: "minRaw", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, maxRaw: { classPropertyName: "maxRaw", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusout": "setValue(transformer.fromControlValue(control.value))", "focus": "onFocus()" }, properties: { "disabled": "disabled()", "attr.inputMode": "inputMode()", "attr.maxLength": "element.maxLength > 0 ? element.maxLength : defaultMaxLength()" } }, providers: [
|
|
170
171
|
tuiAsControl(TuiInputNumberDirective),
|
|
171
172
|
tuiValueTransformerFrom(TUI_INPUT_NUMBER_OPTIONS),
|
|
172
|
-
], usesInheritance: true, hostDirectives: [{ directive: i1.
|
|
173
|
+
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.MaskitoDirective }], ngImport: i0 }); }
|
|
173
174
|
}
|
|
174
175
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputNumberDirective, decorators: [{
|
|
175
176
|
type: Directive,
|
|
@@ -179,7 +180,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
179
180
|
tuiAsControl(TuiInputNumberDirective),
|
|
180
181
|
tuiValueTransformerFrom(TUI_INPUT_NUMBER_OPTIONS),
|
|
181
182
|
],
|
|
182
|
-
hostDirectives: [
|
|
183
|
+
hostDirectives: [TuiWithInput, MaskitoDirective],
|
|
183
184
|
host: {
|
|
184
185
|
'[disabled]': 'disabled()',
|
|
185
186
|
'[attr.inputMode]': 'inputMode()',
|
|
@@ -296,6 +297,7 @@ const TuiInputNumber = [
|
|
|
296
297
|
TuiInputNumberDirective,
|
|
297
298
|
TuiInputNumberStep,
|
|
298
299
|
TuiQuantumValueTransformer,
|
|
300
|
+
TuiTextfield,
|
|
299
301
|
];
|
|
300
302
|
|
|
301
303
|
/**
|