@taiga-ui/kit 5.10.0 → 5.11.0-canary.8834a0e
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/calendar-range/calendar-range.component.d.ts +3 -8
- package/components/input-color/input-color-content.component.d.ts +11 -0
- package/components/input-color/input-color.component.d.ts +4 -7
- package/components/input-date/index.d.ts +0 -1
- package/components/input-date/input-date.directive.d.ts +2 -3
- package/components/input-date-multi/input-date-multi.directive.d.ts +4 -4
- package/components/input-date-range/input-date-range.directive.d.ts +2 -1
- package/components/input-date-time/index.d.ts +0 -1
- package/components/input-month/index.d.ts +0 -1
- package/components/input-phone-international/input-phone-international-content.component.d.ts +21 -0
- package/components/input-phone-international/input-phone-international.component.d.ts +10 -20
- package/components/input-pin/index.d.ts +0 -1
- package/components/input-time/index.d.ts +0 -1
- package/components/multi-select/multi-select-group/multi-select-group.component.d.ts +1 -0
- package/components/segmented/segmented.directive.d.ts +2 -1
- package/components/toast/toast.component.d.ts +0 -1
- package/components/toast/toast.directive.d.ts +1 -0
- package/fesm2022/taiga-ui-kit-components-accordion.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-action-bar.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-avatar.mjs +23 -23
- package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badged-content.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-block.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +5 -5
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-button-loading.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-calendar-month.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +10 -15
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-chip.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-comment.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-comment.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-compass.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-compass.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-confirm.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-copy.mjs +11 -11
- package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-counter.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-drawer.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-files.mjs +25 -25
- package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-filter.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-fullscreen.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-input-color.mjs +58 -30
- package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs +15 -17
- package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +9 -7
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +15 -15
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date.mjs +21 -22
- package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-month.mjs +13 -13
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +38 -38
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +99 -69
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs +15 -11
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-range.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-time.mjs +18 -18
- package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-year.mjs +5 -5
- package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +12 -12
- package/fesm2022/taiga-ui-kit-components-like.mjs +5 -5
- package/fesm2022/taiga-ui-kit-components-like.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +9 -9
- package/fesm2022/taiga-ui-kit-components-message.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs +22 -15
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +9 -9
- package/fesm2022/taiga-ui-kit-components-pager.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-pagination.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-pin.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pincode.mjs +13 -7
- package/fesm2022/taiga-ui-kit-components-pincode.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-preview.mjs +26 -26
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-progress.mjs +27 -27
- package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pulse.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-push.mjs +12 -12
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-range.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-rating.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-routable-dialog.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-segmented.mjs +13 -14
- package/fesm2022/taiga-ui-kit-components-segmented.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-select.mjs +9 -9
- package/fesm2022/taiga-ui-kit-components-shrink-wrap.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-shrink-wrap.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-status.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-status.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-stepper.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-switch.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tabs.mjs +19 -19
- package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +12 -12
- package/fesm2022/taiga-ui-kit-components-tiles.mjs +14 -14
- package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-timeline.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-toast.mjs +24 -19
- package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tree.mjs +24 -24
- package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-button-group.mjs +7 -7
- package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-button-select.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs +7 -7
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-connected.mjs +7 -7
- package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-fade.mjs +7 -7
- package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-fluid-typography.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-highlight.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-password.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-present.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-sensitive.mjs +7 -7
- package/fesm2022/taiga-ui-kit-directives-sensitive.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +7 -7
- package/fesm2022/taiga-ui-kit-directives-shimmer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +7 -7
- package/fesm2022/taiga-ui-kit-directives-skeleton.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +7 -7
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-unfinished-validator.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs +3 -3
- package/fesm2022/taiga-ui-kit-pipes-auto-color.mjs +3 -3
- package/fesm2022/taiga-ui-kit-pipes-emails.mjs +3 -3
- package/fesm2022/taiga-ui-kit-pipes-flag.mjs +3 -3
- package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs +3 -3
- package/fesm2022/taiga-ui-kit-pipes-initials.mjs +3 -3
- package/fesm2022/taiga-ui-kit-pipes-sort-countries.mjs +3 -3
- package/fesm2022/taiga-ui-kit-pipes-stringify-content.mjs +3 -3
- package/fesm2022/taiga-ui-kit-pipes-stringify.mjs +3 -3
- package/fesm2022/taiga-ui-kit-utils.mjs +10 -4
- package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
- package/package.json +25 -25
|
@@ -1,32 +1,62 @@
|
|
|
1
1
|
import { TuiLabel } from '@taiga-ui/core/components/label';
|
|
2
|
-
import
|
|
2
|
+
import * as i3 from '@taiga-ui/core/components/textfield';
|
|
3
|
+
import { tuiAsTextfieldContent, TuiTextfieldContent, TuiTextfieldComponent, TuiTextfieldOptionsDirective } from '@taiga-ui/core/components/textfield';
|
|
3
4
|
import { TuiDropdownContent } from '@taiga-ui/core/portals/dropdown';
|
|
4
5
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { inject,
|
|
6
|
-
import * as
|
|
7
|
-
import { FormsModule } from '@angular/forms';
|
|
8
|
-
import * as i1 from '@maskito/angular';
|
|
6
|
+
import { inject, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, HostAttributeToken, input, Directive } from '@angular/core';
|
|
7
|
+
import * as i1$1 from '@maskito/angular';
|
|
9
8
|
import { MaskitoDirective } from '@maskito/angular';
|
|
10
9
|
import { maskitoAddOnFocusPlugin, maskitoRemoveOnBlurPlugin, maskitoPrefixPostprocessorGenerator } from '@maskito/kit';
|
|
11
10
|
import { TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
|
|
12
|
-
import '@taiga-ui/cdk/constants';
|
|
13
11
|
import { tuiFallbackValueProvider } from '@taiga-ui/cdk/tokens';
|
|
14
12
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
15
|
-
import * as i2 from '@taiga-ui/core/components/input';
|
|
13
|
+
import * as i2$1 from '@taiga-ui/core/components/input';
|
|
16
14
|
import { TuiWithInput } from '@taiga-ui/core/components/input';
|
|
17
|
-
import * as i4 from '@taiga-ui/core/components/slider';
|
|
18
|
-
import { TuiSlider } from '@taiga-ui/core/components/slider';
|
|
19
15
|
import { TuiIcons, tuiIconStart } from '@taiga-ui/core/directives/icons';
|
|
20
16
|
import { tuiMaskito } from '@taiga-ui/kit/utils';
|
|
21
17
|
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
18
|
+
import * as i1 from '@angular/forms';
|
|
19
|
+
import { FormsModule } from '@angular/forms';
|
|
20
|
+
import { TUI_VERSION } from '@taiga-ui/cdk/constants';
|
|
21
|
+
import * as i2 from '@taiga-ui/core/components/slider';
|
|
22
|
+
import { TuiSlider } from '@taiga-ui/core/components/slider';
|
|
22
23
|
|
|
23
24
|
const [TUI_INPUT_COLOR_OPTIONS, tuiInputColorOptionsProvider] = tuiCreateOptions({
|
|
24
25
|
format: 'hex',
|
|
25
26
|
align: 'start',
|
|
26
27
|
});
|
|
27
28
|
|
|
29
|
+
class TuiInputColorContent {
|
|
30
|
+
constructor() {
|
|
31
|
+
this.host = inject(TuiInputColorComponent);
|
|
32
|
+
this.filled = computed(() => this.host.format() === 'hex'
|
|
33
|
+
? this.host.value().length === 7
|
|
34
|
+
: this.host.value().length === 9);
|
|
35
|
+
this.opacity = computed(() => this.filled() && this.host.format() === 'hexa'
|
|
36
|
+
? Number.parseInt(this.host.value().slice(-2), 16)
|
|
37
|
+
: 255);
|
|
38
|
+
}
|
|
39
|
+
onInput(value) {
|
|
40
|
+
this.host.onChange(this.host.format() === 'hex' ? value : `${value}${toHex(this.opacity())}`);
|
|
41
|
+
}
|
|
42
|
+
onOpacity(opacity) {
|
|
43
|
+
const value = this.filled() ? this.host.value().slice(0, 7) : '#000000';
|
|
44
|
+
this.host.onChange(`${value}${toHex(opacity)}`);
|
|
45
|
+
}
|
|
46
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputColorContent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
47
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TuiInputColorContent, isStandalone: true, selector: "tui-input-color-content", host: { attributes: { "data-tui-version": "5.11.0-canary.8834a0e" } }, ngImport: i0, template: "<input\n #colorPicker\n tabindex=\"-1\"\n type=\"color\"\n class=\"tui-input-color_picker\"\n [attr.list]=\"host.list\"\n [class.tui-input-color_start]=\"host.align() === 'start'\"\n [disabled]=\"!host.interactive()\"\n [style.--t-opacity]=\"filled() ? opacity() / 255 : 0\"\n [value]=\"host.value().length > 6 ? host.value().slice(0, 7) : ''\"\n (input)=\"onInput(colorPicker.value)\"\n/>\n@if (host.format() === 'hexa' && host.interactive()) {\n <input\n max=\"255\"\n tuiSlider\n type=\"range\"\n [ngModel]=\"opacity()\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"onOpacity($event)\"\n (pointerdown.stop)=\"host.el.focus()\"\n />\n}\n", styles: ["tui-input-color-content:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]){display:contents}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .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;pointer-events:auto;order:100;background:repeating-conic-gradient(var(--tui-border-normal) 0% 25%,transparent 0% 50%);box-shadow:0 0 0 1px var(--tui-border-normal)}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .tui-input-color_picker.tui-input-color_picker:disabled{cursor:default}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .tui-input-color_picker.tui-input-color_start{position:absolute;inset-block-start:50%;inset-inline-start:calc(var(--t-height) / 4);transform:translateY(-50%)}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .tui-input-color_picker::-webkit-color-swatch-wrapper{padding:0}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .tui-input-color_picker::-webkit-color-swatch{border:none;opacity:var(--t-opacity)}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .tui-input-color_picker::-moz-color-swatch{border:none;opacity:var(--t-opacity)}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"])[data-size=s] .tui-input-color_picker{margin-inline-end:.25rem}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"])[data-size=l] .tui-input-color_picker{margin-inline-end:-.25rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.TuiSliderComponent, selector: "input[type=range][tuiSlider]", inputs: ["segments"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputColorContent, decorators: [{
|
|
50
|
+
type: Component,
|
|
51
|
+
args: [{ selector: 'tui-input-color-content', imports: [FormsModule, TuiSlider], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { 'data-tui-version': TUI_VERSION }, template: "<input\n #colorPicker\n tabindex=\"-1\"\n type=\"color\"\n class=\"tui-input-color_picker\"\n [attr.list]=\"host.list\"\n [class.tui-input-color_start]=\"host.align() === 'start'\"\n [disabled]=\"!host.interactive()\"\n [style.--t-opacity]=\"filled() ? opacity() / 255 : 0\"\n [value]=\"host.value().length > 6 ? host.value().slice(0, 7) : ''\"\n (input)=\"onInput(colorPicker.value)\"\n/>\n@if (host.format() === 'hexa' && host.interactive()) {\n <input\n max=\"255\"\n tuiSlider\n type=\"range\"\n [ngModel]=\"opacity()\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"onOpacity($event)\"\n (pointerdown.stop)=\"host.el.focus()\"\n />\n}\n", styles: ["tui-input-color-content:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]){display:contents}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .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;pointer-events:auto;order:100;background:repeating-conic-gradient(var(--tui-border-normal) 0% 25%,transparent 0% 50%);box-shadow:0 0 0 1px var(--tui-border-normal)}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .tui-input-color_picker.tui-input-color_picker:disabled{cursor:default}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .tui-input-color_picker.tui-input-color_start{position:absolute;inset-block-start:50%;inset-inline-start:calc(var(--t-height) / 4);transform:translateY(-50%)}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .tui-input-color_picker::-webkit-color-swatch-wrapper{padding:0}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .tui-input-color_picker::-webkit-color-swatch{border:none;opacity:var(--t-opacity)}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"]) .tui-input-color_picker::-moz-color-swatch{border:none;opacity:var(--t-opacity)}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"])[data-size=s] .tui-input-color_picker{margin-inline-end:.25rem}tui-textfield:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"])[data-size=l] .tui-input-color_picker{margin-inline-end:-.25rem}\n"] }]
|
|
52
|
+
}] });
|
|
53
|
+
function toHex(value) {
|
|
54
|
+
return value.toString(16).padStart(2, '0');
|
|
55
|
+
}
|
|
56
|
+
|
|
28
57
|
const REGEX = /[0-9a-f]/i;
|
|
29
58
|
const EMPTY = '"data:image/svg+xml;utf8,<svg xmlns=http://www.w3.org/2000/svg></svg>"';
|
|
59
|
+
// TODO(v6): rename to TuiInputColorDirective
|
|
30
60
|
class TuiInputColorComponent extends TuiControl {
|
|
31
61
|
constructor() {
|
|
32
62
|
super(...arguments);
|
|
@@ -41,37 +71,35 @@ class TuiInputColorComponent extends TuiControl {
|
|
|
41
71
|
plugins: [maskitoAddOnFocusPlugin('#'), maskitoRemoveOnBlurPlugin('#')],
|
|
42
72
|
overwriteMode: 'replace',
|
|
43
73
|
})));
|
|
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
74
|
this.format = input(this.options.format);
|
|
49
75
|
this.align = input(this.options.align);
|
|
50
76
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: TuiInputColorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
59
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: TuiInputColorComponent, isStandalone: true, selector: "input[tuiInputColor]", inputs: { format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "ngSkipHydration": "true", "spellcheck": "false" }, listeners: { "input": "onChange($event.target.value)" }, properties: { "attr.list": "null", "disabled": "disabled()", "value": "value()" } }, providers: [tuiAsControl(TuiInputColorComponent), tuiFallbackValueProvider('')], usesInheritance: true, hostDirectives: [{ directive: i1.MaskitoDirective }, { directive: i2.TuiWithInput }], 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_start]=\"align() === 'start'\"\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 @if (format() === 'hexa' && interactive()) {\n <input\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 }\n</ng-container>\n", styles: ["tui-textfield:where(*[data-tui-version=\"5.10.0\"]) .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;pointer-events:auto;order:100;background:repeating-conic-gradient(var(--tui-border-normal) 0% 25%,transparent 0% 50%);box-shadow:0 0 0 1px var(--tui-border-normal)}tui-textfield:where(*[data-tui-version=\"5.10.0\"]) .tui-input-color_picker.tui-input-color_picker:disabled{cursor:default}tui-textfield:where(*[data-tui-version=\"5.10.0\"]) .tui-input-color_picker.tui-input-color_start{position:absolute;inset-block-start:50%;inset-inline-start:calc(var(--t-height) / 4);transform:translateY(-50%)}tui-textfield:where(*[data-tui-version=\"5.10.0\"]) .tui-input-color_picker::-webkit-color-swatch-wrapper{padding:0}tui-textfield:where(*[data-tui-version=\"5.10.0\"]) .tui-input-color_picker::-webkit-color-swatch{border:none;opacity:var(--t-opacity)}tui-textfield:where(*[data-tui-version=\"5.10.0\"]) .tui-input-color_picker::-moz-color-swatch{border:none;opacity:var(--t-opacity)}tui-textfield:where(*[data-tui-version=\"5.10.0\"])[data-size=s] .tui-input-color_picker{margin-inline-end:.25rem}tui-textfield:where(*[data-tui-version=\"5.10.0\"])[data-size=l] .tui-input-color_picker{margin-inline-end:-.25rem}\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: "component", type: i4.TuiSliderComponent, selector: "input[type=range][tuiSlider]", inputs: ["segments"] }, { kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
77
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputColorComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
78
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.25", type: TuiInputColorComponent, isStandalone: true, selector: "input[tuiInputColor]", inputs: { format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "spellcheck": "false" }, listeners: { "input": "onChange($event.target.value)" }, properties: { "attr.list": "null", "disabled": "disabled()", "value": "value()" } }, providers: [
|
|
79
|
+
tuiAsControl(TuiInputColorComponent),
|
|
80
|
+
tuiFallbackValueProvider(''),
|
|
81
|
+
tuiAsTextfieldContent(() => TuiInputColorContent),
|
|
82
|
+
], usesInheritance: true, hostDirectives: [{ directive: i1$1.MaskitoDirective }, { directive: i2$1.TuiWithInput }, { directive: i3.TuiTextfieldContent }], ngImport: i0 }); }
|
|
60
83
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
62
|
-
type:
|
|
63
|
-
args: [{
|
|
64
|
-
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputColorComponent, decorators: [{
|
|
85
|
+
type: Directive,
|
|
86
|
+
args: [{
|
|
87
|
+
selector: 'input[tuiInputColor]',
|
|
88
|
+
providers: [
|
|
89
|
+
tuiAsControl(TuiInputColorComponent),
|
|
90
|
+
tuiFallbackValueProvider(''),
|
|
91
|
+
tuiAsTextfieldContent(() => TuiInputColorContent),
|
|
92
|
+
],
|
|
93
|
+
hostDirectives: [MaskitoDirective, TuiWithInput, TuiTextfieldContent],
|
|
94
|
+
host: {
|
|
65
95
|
spellcheck: 'false',
|
|
66
96
|
'[attr.list]': 'null',
|
|
67
97
|
'[disabled]': 'disabled()',
|
|
68
98
|
'[value]': 'value()',
|
|
69
99
|
'(input)': 'onChange($event.target.value)',
|
|
70
|
-
},
|
|
100
|
+
},
|
|
101
|
+
}]
|
|
71
102
|
}] });
|
|
72
|
-
function toHex(value) {
|
|
73
|
-
return value.toString(16).padStart(2, '0');
|
|
74
|
-
}
|
|
75
103
|
|
|
76
104
|
const TuiInputColor = [
|
|
77
105
|
TuiInputColorComponent,
|
|
@@ -1 +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/input-color.ts","../../../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: 'start',\n });\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n HostAttributeToken,\n inject,\n input,\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 {TUI_VERSION} from '@taiga-ui/cdk/constants';\nimport {tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TuiWithInput} from '@taiga-ui/core/components/input';\nimport {TuiSlider} from '@taiga-ui/core/components/slider';\nimport {TuiTextfieldContent} from '@taiga-ui/core/components/textfield';\nimport {TuiIcons, tuiIconStart} from '@taiga-ui/core/directives/icons';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {TUI_INPUT_COLOR_OPTIONS} from './input-color.options';\n\nconst REGEX = /[0-9a-f]/i;\nconst EMPTY = '\"data:image/svg+xml;utf8,<svg xmlns=http://www.w3.org/2000/svg></svg>\"';\n\n@Component({\n selector: 'input[tuiInputColor]',\n imports: [FormsModule, TuiSlider, TuiTextfieldContent],\n templateUrl: './input-color.template.html',\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import './input-color.style.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiAsControl(TuiInputColorComponent), tuiFallbackValueProvider('')],\n hostDirectives: [MaskitoDirective, TuiWithInput],\n host: {\n ngSkipHydration: 'true',\n spellcheck: 'false',\n '[attr.list]': 'null',\n '[disabled]': 'disabled()',\n '[value]': 'value()',\n '(input)': 'onChange($event.target.value)',\n },\n})\nexport class TuiInputColorComponent extends TuiControl<string> {\n protected readonly options = inject(TUI_INPUT_COLOR_OPTIONS);\n protected readonly el = tuiInjectElement<HTMLInputElement>();\n protected readonly list = inject(new HostAttributeToken('list'), {optional: true});\n protected readonly start = inject(TuiIcons).iconStart() || '';\n\n protected readonly icon = tuiIconStart(\n computed(() => (this.align() === 'start' ? EMPTY : this.start)),\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 public readonly format = input(this.options.format);\n public readonly align = input(this.options.align);\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_start]=\"align() === 'start'\"\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 @if (format() === 'hexa' && interactive()) {\n <input\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 }\n</ng-container>\n","import {TuiLabel} from '@taiga-ui/core/components/label';\nimport {\n TuiTextfieldComponent,\n TuiTextfieldOptionsDirective,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiDropdownContent} from '@taiga-ui/core/portals/dropdown';\n\nimport {TuiInputColorComponent} from './input-color.component';\n\nexport const TuiInputColor = [\n TuiInputColorComponent,\n TuiLabel,\n TuiTextfieldComponent,\n TuiTextfieldOptionsDirective,\n TuiDropdownContent,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;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AAM;AACrB,wBAAA,YAAY,EAAE,YAAY;AAC1B,wBAAA,SAAS,EAAE,SAAS;AACpB,wBAAA,SAAS,EAAE,+BAA+B;AAC7C,qBAAA,EAAA,QAAA,EAAA,q0BAAA,EAAA,MAAA,EAAA,CAAA,03CAAA,CAAA,EAAA;;AAgDL,SAAS,KAAK,CAAC,KAAa,EAAA;AACxB,IAAA,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAC9C;;AE5FO,MAAM,aAAa,GAAG;IACzB,sBAAsB;IACtB,QAAQ;IACR,qBAAqB;IACrB,4BAA4B;IAC5B,kBAAkB;;;ACdtB;;AAEG;;;;"}
|
|
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-content.component.ts","../../../projects/kit/components/input-color/input-color-content.template.html","../../../projects/kit/components/input-color/input-color.component.ts","../../../projects/kit/components/input-color/input-color.ts","../../../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: 'start',\n });\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {TUI_VERSION} from '@taiga-ui/cdk/constants';\nimport {TuiSlider} from '@taiga-ui/core/components/slider';\n\nimport {TuiInputColorComponent} from './input-color.component';\n\n@Component({\n selector: 'tui-input-color-content',\n imports: [FormsModule, TuiSlider],\n templateUrl: './input-color-content.template.html',\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import './input-color.style.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {'data-tui-version': TUI_VERSION},\n})\nexport class TuiInputColorContent {\n protected readonly host = inject(TuiInputColorComponent);\n\n protected readonly filled = computed(() =>\n this.host.format() === 'hex'\n ? this.host.value().length === 7\n : this.host.value().length === 9,\n );\n\n protected readonly opacity = computed(() =>\n this.filled() && this.host.format() === 'hexa'\n ? Number.parseInt(this.host.value().slice(-2), 16)\n : 255,\n );\n\n protected onInput(value: string): void {\n this.host.onChange(\n this.host.format() === 'hex' ? value : `${value}${toHex(this.opacity())}`,\n );\n }\n\n protected onOpacity(opacity: number): void {\n const value = this.filled() ? this.host.value().slice(0, 7) : '#000000';\n\n this.host.onChange(`${value}${toHex(opacity)}`);\n }\n}\n\nfunction toHex(value: number): string {\n return value.toString(16).padStart(2, '0');\n}\n","<input\n #colorPicker\n tabindex=\"-1\"\n type=\"color\"\n class=\"tui-input-color_picker\"\n [attr.list]=\"host.list\"\n [class.tui-input-color_start]=\"host.align() === 'start'\"\n [disabled]=\"!host.interactive()\"\n [style.--t-opacity]=\"filled() ? opacity() / 255 : 0\"\n [value]=\"host.value().length > 6 ? host.value().slice(0, 7) : ''\"\n (input)=\"onInput(colorPicker.value)\"\n/>\n@if (host.format() === 'hexa' && host.interactive()) {\n <input\n max=\"255\"\n tuiSlider\n type=\"range\"\n [ngModel]=\"opacity()\"\n [ngModelOptions]=\"{standalone: true}\"\n (ngModelChange)=\"onOpacity($event)\"\n (pointerdown.stop)=\"host.el.focus()\"\n />\n}\n","import {computed, Directive, HostAttributeToken, inject, input} from '@angular/core';\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 {TuiWithInput} from '@taiga-ui/core/components/input';\nimport {\n tuiAsTextfieldContent,\n TuiTextfieldContent,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiIcons, tuiIconStart} from '@taiga-ui/core/directives/icons';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {TUI_INPUT_COLOR_OPTIONS} from './input-color.options';\nimport {TuiInputColorContent} from './input-color-content.component';\n\nconst REGEX = /[0-9a-f]/i;\nconst EMPTY = '\"data:image/svg+xml;utf8,<svg xmlns=http://www.w3.org/2000/svg></svg>\"';\n\n@Directive({\n selector: 'input[tuiInputColor]',\n providers: [\n tuiAsControl(TuiInputColorComponent),\n tuiFallbackValueProvider(''),\n tuiAsTextfieldContent(() => TuiInputColorContent),\n ],\n hostDirectives: [MaskitoDirective, TuiWithInput, TuiTextfieldContent],\n host: {\n spellcheck: 'false',\n '[attr.list]': 'null',\n '[disabled]': 'disabled()',\n '[value]': 'value()',\n '(input)': 'onChange($event.target.value)',\n },\n})\n// TODO(v6): rename to TuiInputColorDirective\nexport class TuiInputColorComponent extends TuiControl<string> {\n protected readonly options = inject(TUI_INPUT_COLOR_OPTIONS);\n\n public readonly el = tuiInjectElement<HTMLInputElement>();\n public readonly list = inject(new HostAttributeToken('list'), {optional: true});\n\n protected readonly start = inject(TuiIcons).iconStart() || '';\n\n protected readonly icon = tuiIconStart(\n computed(() => (this.align() === 'start' ? EMPTY : this.start)),\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 public readonly format = input(this.options.format);\n public readonly align = input(this.options.align);\n}\n","import {TuiLabel} from '@taiga-ui/core/components/label';\nimport {\n TuiTextfieldComponent,\n TuiTextfieldOptionsDirective,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiDropdownContent} from '@taiga-ui/core/portals/dropdown';\n\nimport {TuiInputColorComponent} from './input-color.component';\n\nexport const TuiInputColor = [\n TuiInputColorComponent,\n TuiLabel,\n TuiTextfieldComponent,\n TuiTextfieldOptionsDirective,\n TuiDropdownContent,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;MAQa,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,GAChE,gBAAgB,CAAuB;AACnC,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,KAAK,EAAE,OAAO;AACjB,CAAA;;MCcQ,oBAAoB,CAAA;AAbjC,IAAA,WAAA,GAAA;AAcuB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAErC,QAAA,IAAA,CAAA,MAAM,GAAG,QAAQ,CAAC,MACjC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK;cACjB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,KAAK;AAC/B,cAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,KAAK,CAAC,CACvC;AAEkB,QAAA,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAClC,IAAI,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK;AACpC,cAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;cAC/C,GAAG,CACZ;AAaJ,IAAA;AAXa,IAAA,OAAO,CAAC,KAAa,EAAA;AAC3B,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,CACd,IAAI,CAAC,I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,oBAAA,cAAc,EAAE,CAAC,gBAAgB,EAAE,YAAY,EAAE,mBAAmB,CAAC;AACrE,oBAAA,IAAI,EAAE;AACF,wBAAA,UAAU,EAAE,OAAO;AACnB,wBAAA,aAAa,EAAE,MAAM;AACrB,wBAAA,YAAY,EAAE,YAAY;AAC1B,wBAAA,SAAS,EAAE,SAAS;AACpB,wBAAA,SAAS,EAAE,+BAA+B;AAC7C,qBAAA;AACJ,iBAAA;;;AC9BM,MAAM,aAAa,GAAG;IACzB,sBAAsB;IACtB,QAAQ;IACR,qBAAqB;IACrB,4BAA4B;IAC5B,kBAAkB;;;ACdtB;;AAEG;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { TuiCalendar } from '@taiga-ui/core/components/calendar';
|
|
1
|
+
import { AbstractTuiCalendar, TuiCalendar } from '@taiga-ui/core/components/calendar';
|
|
2
2
|
import { TuiInputChipDirective, TuiInputChip } from '@taiga-ui/kit/components/input-chip';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { InjectionToken, inject, computed, effect, input, Directive } from '@angular/core';
|
|
5
5
|
import * as i2 from '@maskito/angular';
|
|
6
6
|
import { MaskitoDirective } from '@maskito/angular';
|
|
7
|
-
import {
|
|
7
|
+
import { maskitoDate } from '@maskito/kit';
|
|
8
8
|
import { tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
|
|
9
|
-
import {
|
|
9
|
+
import { TuiDay, DATE_FILLER_LENGTH } from '@taiga-ui/cdk/date-time';
|
|
10
10
|
import { tuiFallbackValueProvider } from '@taiga-ui/cdk/tokens';
|
|
11
11
|
import { tuiDirectiveBinding } from '@taiga-ui/cdk/utils/di';
|
|
12
12
|
import { tuiSetSignal, tuiArrayToggle } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
@@ -54,27 +54,25 @@ class TuiInputDateMultiDirective extends TuiInputChipDirective {
|
|
|
54
54
|
this.icon = tuiIconEnd(this.dateMultiOptions.icon);
|
|
55
55
|
this.filler = tuiWithDateFiller();
|
|
56
56
|
this.format = inject(TUI_DATE_FORMAT);
|
|
57
|
-
this.stringify = tuiDirectiveBinding(TuiItemsHandlersDirective, 'stringify', (item) => this.
|
|
58
|
-
|
|
59
|
-
?.toString(this.format().mode, this.format().separator) ?? '', {});
|
|
60
|
-
this.mask = tuiMaskito(computed(() => maskitoDateOptionsGenerator({
|
|
57
|
+
this.stringify = tuiDirectiveBinding(TuiItemsHandlersDirective, 'stringify', (item) => item?.toString(this.format().mode, this.format().separator) ?? '', {});
|
|
58
|
+
this.mask = tuiMaskito(computed(() => maskitoDate({
|
|
61
59
|
separator: this.format().separator,
|
|
62
60
|
mode: this.format().mode,
|
|
63
61
|
min: (this.min() ?? this.dateMultiOptions.min).toLocalNativeDate(),
|
|
64
62
|
max: (this.max() ?? this.dateMultiOptions.max).toLocalNativeDate(),
|
|
65
63
|
})));
|
|
66
|
-
this.calendar = tuiInjectAuxiliary((x) => x instanceof
|
|
64
|
+
this.calendar = tuiInjectAuxiliary((x) => x instanceof AbstractTuiCalendar);
|
|
67
65
|
this.calendarIn = effect(() => {
|
|
68
66
|
const calendar = this.calendar();
|
|
69
67
|
if (calendar) {
|
|
70
68
|
this.processCalendar(calendar);
|
|
71
69
|
}
|
|
72
70
|
});
|
|
73
|
-
this.calendarOut = effect((
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
this.calendarOut = effect(() => {
|
|
72
|
+
const value = this.calendar()?.value();
|
|
73
|
+
if (value instanceof TuiDay) {
|
|
74
|
+
this.updateValue(value);
|
|
75
|
+
}
|
|
78
76
|
});
|
|
79
77
|
this.min = input(this.dateMultiOptions.min);
|
|
80
78
|
this.max = input(this.dateMultiOptions.max);
|
|
@@ -83,7 +81,7 @@ class TuiInputDateMultiDirective extends TuiInputChipDirective {
|
|
|
83
81
|
tuiSetSignal(calendar.value, this.value());
|
|
84
82
|
tuiSetSignal(calendar.min, this.min());
|
|
85
83
|
tuiSetSignal(calendar.max, this.max());
|
|
86
|
-
calendar.month.
|
|
84
|
+
calendar.month.update((m) => this.value()?.[this.value().length - 1] ?? m);
|
|
87
85
|
}
|
|
88
86
|
onClick() {
|
|
89
87
|
this.open.update((open) => !open);
|
|
@@ -103,8 +101,8 @@ class TuiInputDateMultiDirective extends TuiInputChipDirective {
|
|
|
103
101
|
updateValue(day) {
|
|
104
102
|
this.setValue(tuiArrayToggle(this.value(), day, (a, b) => a.daySame(b)));
|
|
105
103
|
}
|
|
106
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
107
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputDateMultiDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
105
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.25", type: TuiInputDateMultiDirective, isStandalone: true, selector: "input[tuiInputDateMulti]", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown.enter.prevent": "0" } }, providers: [
|
|
108
106
|
tuiAsControl(TuiInputDateMultiDirective),
|
|
109
107
|
tuiFallbackValueProvider([]),
|
|
110
108
|
tuiAsTextfieldAccessor(TuiInputDateMultiDirective),
|
|
@@ -119,7 +117,7 @@ class TuiInputDateMultiDirective extends TuiInputChipDirective {
|
|
|
119
117
|
tuiValueTransformerFrom(TUI_INPUT_DATE_MULTI_OPTIONS),
|
|
120
118
|
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiDropdownAuto }, { directive: i2.MaskitoDirective }], ngImport: i0 }); }
|
|
121
119
|
}
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputDateMultiDirective, decorators: [{
|
|
123
121
|
type: Directive,
|
|
124
122
|
args: [{
|
|
125
123
|
selector: 'input[tuiInputDateMulti]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-date-multi.mjs","sources":["../../../projects/kit/components/input-date-multi/input-date-multi.options.ts","../../../projects/kit/components/input-date-multi/input-date-multi.directive.ts","../../../projects/kit/components/input-date-multi/input-date-multi.ts","../../../projects/kit/components/input-date-multi/taiga-ui-kit-components-input-date-multi.ts"],"sourcesContent":["import {type FactoryProvider, inject, InjectionToken} from '@angular/core';\nimport {type TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {type TuiDay} from '@taiga-ui/cdk/date-time';\nimport {\n TUI_INPUT_DATE_OPTIONS,\n type TuiInputDateOptions,\n} from '@taiga-ui/kit/components/input-date';\n\nexport interface TuiInputDateMultiOptions extends Omit<\n TuiInputDateOptions,\n 'valueTransformer'\n> {\n readonly valueTransformer: TuiValueTransformer<TuiDay[]>;\n}\n\nexport const TUI_INPUT_DATE_MULTI_OPTIONS = new InjectionToken<TuiInputDateMultiOptions>(\n ngDevMode ? 'TUI_INPUT_DATE_MULTI_OPTIONS' : '',\n);\n\nexport function tuiInputDateMultiOptionsFactory(): TuiInputDateMultiOptions {\n const options = inject(TUI_INPUT_DATE_OPTIONS);\n\n return {\n ...options,\n valueTransformer: {\n fromControlValue: (value: unknown): TuiDay[] =>\n Array.isArray(value)\n ? value\n .map((item) => options.valueTransformer.fromControlValue(item))\n .filter((item): item is TuiDay => item !== null)\n : [],\n toControlValue: (value: TuiDay[]): unknown =>\n value.map((item) => options.valueTransformer.toControlValue(item)),\n },\n };\n}\n\nexport function tuiInjectInputDateMultiOptions(): TuiInputDateMultiOptions {\n return (\n inject(TUI_INPUT_DATE_MULTI_OPTIONS, {optional: true, skipSelf: true}) ??\n tuiInputDateMultiOptionsFactory()\n );\n}\n\nexport const tuiInputDateMultiOptionsProvider = (\n options: Partial<TuiInputDateMultiOptions>,\n): FactoryProvider => ({\n provide: TUI_INPUT_DATE_MULTI_OPTIONS,\n useFactory: (): TuiInputDateMultiOptions => ({\n ...tuiInjectInputDateMultiOptions(),\n ...options,\n }),\n});\n","import {computed, Directive, effect, inject, input} from '@angular/core';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {maskitoDateOptionsGenerator} from '@maskito/kit';\nimport {tuiAsControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {DATE_FILLER_LENGTH, TuiDay, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/di';\nimport {tuiArrayToggle, tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiCalendar} from '@taiga-ui/core/components/calendar';\nimport {\n tuiAsTextfieldAccessor,\n tuiInjectAuxiliary,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiAppearance} from '@taiga-ui/core/directives/appearance';\nimport {tuiIconEnd} from '@taiga-ui/core/directives/icons';\nimport {TuiItemsHandlersDirective} from '@taiga-ui/core/directives/items-handlers';\nimport {TuiDropdownAuto} from '@taiga-ui/core/portals/dropdown';\nimport {TUI_DATE_FORMAT} from '@taiga-ui/core/tokens';\nimport {TuiInputChipDirective} from '@taiga-ui/kit/components/input-chip';\nimport {tuiWithDateFiller} from '@taiga-ui/kit/components/input-date';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {\n TUI_INPUT_DATE_MULTI_OPTIONS,\n tuiInjectInputDateMultiOptions,\n} from './input-date-multi.options';\n\n@Directive({\n selector: 'input[tuiInputDateMulti]',\n providers: [\n tuiAsControl(TuiInputDateMultiDirective),\n tuiFallbackValueProvider([]),\n tuiAsTextfieldAccessor(TuiInputDateMultiDirective),\n {\n provide: TuiAppearance,\n useFactory: () => inject(TuiAppearance, {skipSelf: true}),\n },\n {\n provide: TUI_INPUT_DATE_MULTI_OPTIONS,\n useFactory: tuiInjectInputDateMultiOptions,\n },\n tuiValueTransformerFrom(TUI_INPUT_DATE_MULTI_OPTIONS),\n ],\n hostDirectives: [TuiDropdownAuto, MaskitoDirective],\n host: {'(keydown.enter.prevent)': '0'},\n})\nexport class TuiInputDateMultiDirective extends TuiInputChipDirective<TuiDay> {\n private readonly dateMultiOptions = inject(TUI_INPUT_DATE_MULTI_OPTIONS);\n\n protected readonly icon = tuiIconEnd(this.dateMultiOptions.icon);\n protected readonly filler = tuiWithDateFiller();\n protected readonly format = inject(TUI_DATE_FORMAT);\n\n protected readonly stringify = tuiDirectiveBinding(\n TuiItemsHandlersDirective,\n 'stringify',\n (item) =>\n this.dateMultiOptions.valueTransformer\n .fromControlValue([item])[0]\n ?.toString(this.format().mode, this.format().separator) ?? '',\n {},\n );\n\n protected readonly mask = tuiMaskito(\n computed(() =>\n maskitoDateOptionsGenerator({\n separator: this.format().separator,\n mode: this.format().mode,\n min: (this.min() ?? this.dateMultiOptions.min).toLocalNativeDate(),\n max: (this.max() ?? this.dateMultiOptions.max).toLocalNativeDate(),\n }),\n ),\n );\n\n protected readonly calendar = tuiInjectAuxiliary<TuiCalendar>(\n (x) => x instanceof TuiCalendar,\n );\n\n protected readonly calendarIn = effect(() => {\n const calendar = this.calendar();\n\n if (calendar) {\n this.processCalendar(calendar);\n }\n });\n\n protected readonly calendarOut = effect((onCleanup) => {\n const subscription = this.calendar()?.dayClick.subscribe((day) => {\n this.updateValue(day);\n });\n\n onCleanup(() => subscription?.unsubscribe());\n });\n\n public readonly min = input<TuiDay | null>(this.dateMultiOptions.min);\n public readonly max = input<TuiDay | null>(this.dateMultiOptions.max);\n\n protected processCalendar(calendar: TuiCalendar): void {\n tuiSetSignal(calendar.value, this.value());\n tuiSetSignal(calendar.min, this.min());\n tuiSetSignal(calendar.max, this.max());\n calendar.month.set(\n this.value()?.[this.value().length - 1] ?? TuiMonth.currentLocal(),\n );\n }\n\n protected onClick(): void {\n this.open.update((open) => !open);\n }\n\n protected onValueChange(value: string): void {\n const newValue =\n value.length === DATE_FILLER_LENGTH\n ? TuiDay.normalizeParse(value, this.format().mode)\n : null;\n\n if (newValue && !this.handlers.disabledItemHandler()(newValue)) {\n this.updateValue(newValue);\n }\n }\n\n protected override onEnter(): void {\n this.onValueChange(this.textfield.value().trim());\n this.scrollTo();\n }\n\n private updateValue(day: TuiDay): void {\n this.setValue(tuiArrayToggle(this.value(), day, (a, b) => a.daySame(b)));\n }\n}\n","import {TuiCalendar} from '@taiga-ui/core/components/calendar';\nimport {TuiInputChip} from '@taiga-ui/kit/components/input-chip';\n\nimport {TuiInputDateMultiDirective} from './input-date-multi.directive';\n\nexport const TuiInputDateMulti = [\n TuiInputDateMultiDirective,\n TuiCalendar,\n ...TuiInputChip,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,4BAA4B,GAAG,IAAI,cAAc,CAC1D,SAAS,GAAG,8BAA8B,GAAG,EAAE;SAGnC,+BAA+B,GAAA;AAC3C,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,sBAAsB,CAAC;IAE9C,OAAO;AACH,QAAA,GAAG,OAAO;AACV,QAAA,gBAAgB,EAAE;YACd,gBAAgB,EAAE,CAAC,KAAc,KAC7B,KAAK,CAAC,OAAO,CAAC,KAAK;AACf,kBAAE;AACK,qBAAA,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,IAAI,CAAC;qBAC7D,MAAM,CAAC,CAAC,IAAI,KAAqB,IAAI,KAAK,IAAI;AACrD,kBAAE,EAAE;YACZ,cAAc,EAAE,CAAC,KAAe,KAC5B,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK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IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,SAAS,EAAE;AACP,wBAAA,YAAY,CAAA,0BAAA,CAA4B;wBACxC,wBAAwB,CAAC,EAAE,CAAC;AAC5B,wBAAA,sBAAsB,CAAA,0BAAA,CAA4B;AAClD,wBAAA;AACI,4BAAA,OAAO,EAAE,aAAa;AACtB,4BAAA,UAAU,EAAE,MAAM,MAAM,CAAC,aAAa,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;AAC5D,yBAAA;AACD,wBAAA;AACI,4BAAA,OAAO,EAAE,4BAA4B;AACrC,4BAAA,UAAU,EAAE,8BAA8B;AAC7C,yBAAA;wBACD,uBAAuB,CAAC,4BAA4B,CAAC;AACxD,qBAAA;AACD,oBAAA,cAAc,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC;AACnD,oBAAA,IAAI,EAAE,EAAC,yBAAyB,EAAE,GAAG,EAAC;AACzC,iBAAA;;;ACxCM,MAAM,iBAAiB,GAAG;IAC7B,0BAA0B;IAC1B,WAAW;AACX,IAAA,GAAG,YAAY;;;ACRnB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-date-multi.mjs","sources":["../../../projects/kit/components/input-date-multi/input-date-multi.options.ts","../../../projects/kit/components/input-date-multi/input-date-multi.directive.ts","../../../projects/kit/components/input-date-multi/input-date-multi.ts","../../../projects/kit/components/input-date-multi/taiga-ui-kit-components-input-date-multi.ts"],"sourcesContent":["import {type FactoryProvider, inject, InjectionToken} from '@angular/core';\nimport {type TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {type TuiDay} from '@taiga-ui/cdk/date-time';\nimport {\n TUI_INPUT_DATE_OPTIONS,\n type TuiInputDateOptions,\n} from '@taiga-ui/kit/components/input-date';\n\nexport interface TuiInputDateMultiOptions extends Omit<\n TuiInputDateOptions,\n 'valueTransformer'\n> {\n readonly valueTransformer: TuiValueTransformer<TuiDay[]>;\n}\n\nexport const TUI_INPUT_DATE_MULTI_OPTIONS = new InjectionToken<TuiInputDateMultiOptions>(\n ngDevMode ? 'TUI_INPUT_DATE_MULTI_OPTIONS' : '',\n);\n\nexport function tuiInputDateMultiOptionsFactory(): TuiInputDateMultiOptions {\n const options = inject(TUI_INPUT_DATE_OPTIONS);\n\n return {\n ...options,\n valueTransformer: {\n fromControlValue: (value: unknown): TuiDay[] =>\n Array.isArray(value)\n ? value\n .map((item) => options.valueTransformer.fromControlValue(item))\n .filter((item): item is TuiDay => item !== null)\n : [],\n toControlValue: (value: TuiDay[]): unknown =>\n value.map((item) => options.valueTransformer.toControlValue(item)),\n },\n };\n}\n\nexport function tuiInjectInputDateMultiOptions(): TuiInputDateMultiOptions {\n return (\n inject(TUI_INPUT_DATE_MULTI_OPTIONS, {optional: true, skipSelf: true}) ??\n tuiInputDateMultiOptionsFactory()\n );\n}\n\nexport const tuiInputDateMultiOptionsProvider = (\n options: Partial<TuiInputDateMultiOptions>,\n): FactoryProvider => ({\n provide: TUI_INPUT_DATE_MULTI_OPTIONS,\n useFactory: (): TuiInputDateMultiOptions => ({\n ...tuiInjectInputDateMultiOptions(),\n ...options,\n }),\n});\n","import {computed, Directive, effect, inject, input} from '@angular/core';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {maskitoDate} from '@maskito/kit';\nimport {tuiAsControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {DATE_FILLER_LENGTH, TuiDay} from '@taiga-ui/cdk/date-time';\nimport {tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/di';\nimport {tuiArrayToggle, tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {AbstractTuiCalendar} from '@taiga-ui/core/components/calendar';\nimport {\n tuiAsTextfieldAccessor,\n tuiInjectAuxiliary,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiAppearance} from '@taiga-ui/core/directives/appearance';\nimport {tuiIconEnd} from '@taiga-ui/core/directives/icons';\nimport {TuiItemsHandlersDirective} from '@taiga-ui/core/directives/items-handlers';\nimport {TuiDropdownAuto} from '@taiga-ui/core/portals/dropdown';\nimport {TUI_DATE_FORMAT} from '@taiga-ui/core/tokens';\nimport {TuiInputChipDirective} from '@taiga-ui/kit/components/input-chip';\nimport {tuiWithDateFiller} from '@taiga-ui/kit/components/input-date';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {\n TUI_INPUT_DATE_MULTI_OPTIONS,\n tuiInjectInputDateMultiOptions,\n} from './input-date-multi.options';\n\n@Directive({\n selector: 'input[tuiInputDateMulti]',\n providers: [\n tuiAsControl(TuiInputDateMultiDirective),\n tuiFallbackValueProvider([]),\n tuiAsTextfieldAccessor(TuiInputDateMultiDirective),\n {\n provide: TuiAppearance,\n useFactory: () => inject(TuiAppearance, {skipSelf: true}),\n },\n {\n provide: TUI_INPUT_DATE_MULTI_OPTIONS,\n useFactory: tuiInjectInputDateMultiOptions,\n },\n tuiValueTransformerFrom(TUI_INPUT_DATE_MULTI_OPTIONS),\n ],\n hostDirectives: [TuiDropdownAuto, MaskitoDirective],\n host: {'(keydown.enter.prevent)': '0'},\n})\nexport class TuiInputDateMultiDirective extends TuiInputChipDirective<TuiDay> {\n private readonly dateMultiOptions = inject(TUI_INPUT_DATE_MULTI_OPTIONS);\n\n protected readonly icon = tuiIconEnd(this.dateMultiOptions.icon);\n protected readonly filler = tuiWithDateFiller();\n protected readonly format = inject(TUI_DATE_FORMAT);\n\n protected readonly stringify = tuiDirectiveBinding(\n TuiItemsHandlersDirective,\n 'stringify',\n (item) => item?.toString(this.format().mode, this.format().separator) ?? '',\n {},\n );\n\n protected readonly mask = tuiMaskito(\n computed(() =>\n maskitoDate({\n separator: this.format().separator,\n mode: this.format().mode,\n min: (this.min() ?? this.dateMultiOptions.min).toLocalNativeDate(),\n max: (this.max() ?? this.dateMultiOptions.max).toLocalNativeDate(),\n }),\n ),\n );\n\n protected readonly calendar = tuiInjectAuxiliary<AbstractTuiCalendar>(\n (x) => x instanceof AbstractTuiCalendar,\n );\n\n protected readonly calendarIn = effect(() => {\n const calendar = this.calendar();\n\n if (calendar) {\n this.processCalendar(calendar);\n }\n });\n\n protected readonly calendarOut = effect(() => {\n const value = this.calendar()?.value();\n\n if (value instanceof TuiDay) {\n this.updateValue(value);\n }\n });\n\n public readonly min = input<TuiDay | null>(this.dateMultiOptions.min);\n public readonly max = input<TuiDay | null>(this.dateMultiOptions.max);\n\n protected processCalendar(calendar: AbstractTuiCalendar): void {\n tuiSetSignal(calendar.value, this.value());\n tuiSetSignal(calendar.min, this.min());\n tuiSetSignal(calendar.max, this.max());\n calendar.month.update((m) => this.value()?.[this.value().length - 1] ?? m);\n }\n\n protected onClick(): void {\n this.open.update((open) => !open);\n }\n\n protected onValueChange(value: string): void {\n const newValue =\n value.length === DATE_FILLER_LENGTH\n ? TuiDay.normalizeParse(value, this.format().mode)\n : null;\n\n if (newValue && !this.handlers.disabledItemHandler()(newValue)) {\n this.updateValue(newValue);\n }\n }\n\n protected override onEnter(): void {\n this.onValueChange(this.textfield.value().trim());\n this.scrollTo();\n }\n\n private updateValue(day: TuiDay): void {\n this.setValue(tuiArrayToggle(this.value(), day, (a, b) => a.daySame(b)));\n }\n}\n","import {TuiCalendar} from '@taiga-ui/core/components/calendar';\nimport {TuiInputChip} from '@taiga-ui/kit/components/input-chip';\n\nimport {TuiInputDateMultiDirective} from './input-date-multi.directive';\n\nexport const TuiInputDateMulti = [\n TuiInputDateMultiDirective,\n TuiCalendar,\n ...TuiInputChip,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,4BAA4B,GAAG,IAAI,cAAc,CAC1D,SAAS,GAAG,8BAA8B,GAAG,EAAE;SAGnC,+BAA+B,GAAA;AAC3C,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,sBAAsB,CAAC;I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,IAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,eAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAIQ,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAnBtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,SAAS,EAAE;AACP,wBAAA,YAAY,CAAA,0BAAA,CAA4B;wBACxC,wBAAwB,CAAC,EAAE,CAAC;AAC5B,wBAAA,sBAAsB,CAAA,0BAAA,CAA4B;AAClD,wBAAA;AACI,4BAAA,OAAO,EAAE,aAAa;AACtB,4BAAA,UAAU,EAAE,MAAM,MAAM,CAAC,aAAa,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;AAC5D,yBAAA;AACD,wBAAA;AACI,4BAAA,OAAO,EAAE,4BAA4B;AACrC,4BAAA,UAAU,EAAE,8BAA8B;AAC7C,yBAAA;wBACD,uBAAuB,CAAC,4BAA4B,CAAC;AACxD,qBAAA;AACD,oBAAA,cAAc,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC;AACnD,oBAAA,IAAI,EAAE,EAAC,yBAAyB,EAAE,GAAG,EAAC;AACzC,iBAAA;;;ACxCM,MAAM,iBAAiB,GAAG;IAC7B,0BAA0B;IAC1B,WAAW;AACX,IAAA,GAAG,YAAY;;;ACRnB;;AAEG;;;;"}
|
|
@@ -7,7 +7,7 @@ import * as i0 from '@angular/core';
|
|
|
7
7
|
import { InjectionToken, inject, input, computed, Directive } from '@angular/core';
|
|
8
8
|
import * as i3 from '@maskito/angular';
|
|
9
9
|
import { MaskitoDirective } from '@maskito/angular';
|
|
10
|
-
import {
|
|
10
|
+
import { maskitoDateRange } from '@maskito/kit';
|
|
11
11
|
import { TUI_IDENTITY_VALUE_TRANSFORMER, tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
|
|
12
12
|
import { TUI_LAST_DAY, TuiDay, TUI_FIRST_DAY, RANGE_SEPARATOR_CHAR, DATE_RANGE_FILLER_LENGTH, TuiDayRange } from '@taiga-ui/cdk/date-time';
|
|
13
13
|
import { tuiProvideOptions, tuiProvide } from '@taiga-ui/cdk/utils/di';
|
|
@@ -35,7 +35,7 @@ class TuiInputDateRangeDirective extends TuiInputDateBase {
|
|
|
35
35
|
transform: (min) => min instanceof TuiDay ? min : TUI_FIRST_DAY,
|
|
36
36
|
});
|
|
37
37
|
this.filler = tuiWithDateFiller((filler) => `${filler}${RANGE_SEPARATOR_CHAR}${filler}`);
|
|
38
|
-
this.mask = tuiMaskito(computed(() =>
|
|
38
|
+
this.mask = tuiMaskito(computed(() => maskitoDateRange({
|
|
39
39
|
dateSeparator: this.format().separator,
|
|
40
40
|
mode: this.format().mode,
|
|
41
41
|
min: this.min().toLocalNativeDate(),
|
|
@@ -48,8 +48,10 @@ class TuiInputDateRangeDirective extends TuiInputDateBase {
|
|
|
48
48
|
}
|
|
49
49
|
processCalendar(calendar) {
|
|
50
50
|
super.processCalendar(calendar);
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
if ('minLength' in calendar && 'maxLength' in calendar) {
|
|
52
|
+
tuiSetSignal(calendar.minLength, this.minLength());
|
|
53
|
+
tuiSetSignal(calendar.maxLength, this.maxLength());
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
onValueChange(value) {
|
|
55
57
|
this.control?.control?.updateValueAndValidity({ emitEvent: false });
|
|
@@ -57,15 +59,15 @@ class TuiInputDateRangeDirective extends TuiInputDateBase {
|
|
|
57
59
|
? TuiDayRange.normalizeParse(value, this.format().mode)
|
|
58
60
|
: null);
|
|
59
61
|
}
|
|
60
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
61
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
62
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputDateRangeDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
63
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.25", type: TuiInputDateRangeDirective, isStandalone: true, selector: "input[tuiInputDateRange]", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
62
64
|
// TODO: Add SelectOption after data-list in calendar-range is refactored
|
|
63
65
|
tuiAsControl(TuiInputDateRangeDirective),
|
|
64
66
|
tuiValueTransformerFrom(TUI_INPUT_DATE_RANGE_OPTIONS),
|
|
65
67
|
tuiProvide(TUI_INPUT_DATE_OPTIONS, TUI_INPUT_DATE_RANGE_OPTIONS),
|
|
66
68
|
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.TuiDropdownAuto }, { directive: i3.MaskitoDirective }], ngImport: i0 }); }
|
|
67
69
|
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputDateRangeDirective, decorators: [{
|
|
69
71
|
type: Directive,
|
|
70
72
|
args: [{
|
|
71
73
|
selector: 'input[tuiInputDateRange]',
|
|
@@ -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, inject, InjectionToken} from '@angular/core';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {type TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/di';\nimport {\n TUI_INPUT_DATE_DEFAULT_OPTIONS,\n TUI_INPUT_DATE_OPTIONS,\n type TuiInputDateOptions,\n} from '@taiga-ui/kit/components/input-date';\n\nexport interface TuiInputDateRangeOptions extends Omit<\n TuiInputDateOptions,\n 'valueTransformer'\n> {\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),\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,\n );\n","import {computed, Directive, input} from '@angular/core';\nimport {MaskitoDirective} from '@maskito/angular';\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, inject, InjectionToken} from '@angular/core';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {type TuiDayRange} from '@taiga-ui/cdk/date-time';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/di';\nimport {\n TUI_INPUT_DATE_DEFAULT_OPTIONS,\n TUI_INPUT_DATE_OPTIONS,\n type TuiInputDateOptions,\n} from '@taiga-ui/kit/components/input-date';\n\nexport interface TuiInputDateRangeOptions extends Omit<\n TuiInputDateOptions,\n 'valueTransformer'\n> {\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),\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,\n );\n","import {computed, Directive, input} from '@angular/core';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {maskitoDateRange} from '@maskito/kit';\nimport {tuiAsControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {\n DATE_RANGE_FILLER_LENGTH,\n RANGE_SEPARATOR_CHAR,\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiDay,\n type TuiDayLike,\n TuiDayRange,\n} from '@taiga-ui/cdk/date-time';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/di';\nimport {tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type AbstractTuiCalendar} from '@taiga-ui/core/components/calendar';\nimport {TuiWithInput} from '@taiga-ui/core/components/input';\nimport {TuiDropdownAuto} from '@taiga-ui/core/portals/dropdown';\nimport {type TuiCalendarRange} from '@taiga-ui/kit/components/calendar-range';\nimport {\n TUI_INPUT_DATE_OPTIONS,\n TuiInputDateBase,\n tuiWithDateFiller,\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 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, TUI_INPUT_DATE_RANGE_OPTIONS),\n ],\n hostDirectives: [TuiWithInput, TuiDropdownAuto, MaskitoDirective],\n})\nexport class TuiInputDateRangeDirective extends TuiInputDateBase<TuiDayRange> {\n public override readonly max = input(this.options.max, {\n transform: (max: TuiDay | null): TuiDay =>\n max instanceof TuiDay ? max : TUI_LAST_DAY,\n });\n\n public override readonly min = input(this.options.min, {\n transform: (min: TuiDay | null): TuiDay =>\n min instanceof TuiDay ? min : TUI_FIRST_DAY,\n });\n\n protected override readonly filler = tuiWithDateFiller(\n (filler) => `${filler}${RANGE_SEPARATOR_CHAR}${filler}`,\n );\n\n protected readonly mask = tuiMaskito(\n computed(() =>\n maskitoDateRange({\n dateSeparator: this.format().separator,\n mode: 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 = input<TuiDayLike | null>(null);\n public readonly maxLength = input<TuiDayLike | null>(null);\n\n protected override processCalendar(\n calendar: AbstractTuiCalendar | TuiCalendarRange,\n ): void {\n super.processCalendar(calendar as AbstractTuiCalendar);\n\n if ('minLength' in calendar && 'maxLength' in calendar) {\n tuiSetSignal(calendar.minLength, this.minLength());\n tuiSetSignal(calendar.maxLength, this.maxLength());\n }\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 {TuiLabel} from '@taiga-ui/core/components/label';\nimport {\n TuiTextfieldComponent,\n TuiTextfieldOptionsDirective,\n} from '@taiga-ui/core/components/textfield';\nimport {TuiDropdownContent} from '@taiga-ui/core/portals/dropdown';\nimport {TuiCalendarRange} from '@taiga-ui/kit/components/calendar-range';\n\nimport {TuiInputDateRangeDirective} from './input-date-range.directive';\n\nexport const TuiInputDateRange = [\n TuiInputDateRangeDirective,\n TuiCalendarRange,\n TuiLabel,\n TuiTextfieldComponent,\n TuiTextfieldOptionsDirective,\n TuiDropdownContent,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAoBO,MAAM,4BAA4B,GAAG,IAAI,cAAc,CAC1D,SAAS,GAAG,8BAA8B,GAAG,EAAE,EAC/C;AACI,IAAA,OAAO,EAAE,OAAO;QACZ,GAAG,MAAM,CAAC,sBAAsB,CAAC;AACjC,QAAA,gBAAgB,EAAE,8BAA8B;KACnD,CAAC;AACL,CAAA;AAGE,MAAM,gCAAgC,GAAG,CAC5C,OAA0C,KAE1C,iBAAiB,CACb,4BAA4B,EAC5B,OAAO,EACP,8BAA8B;;ACEhC,MAAO,0BAA2B,SAAQ,gBAA6B,CAAA;AAV7E,IAAA,WAAA,GAAA;;QAW6B,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AACnD,YAAA,SAAS,EAAE,CAAC,GAAkB,KAC1B,GAAG,YAAY,MAAM,GAAG,GAAG,GAAG,YAAY;AACjD,SAAA,CAAC;QAEuB,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AACnD,YAAA,SAAS,EAAE,CAAC,G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sBAAsB,EAAE,4BAA4B,CAAC;AACnE,SAAA,EAAA,eAAA,EAAA,IAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,YAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,eAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAGQ,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAVtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,SAAS,EAAE;;AAEP,wBAAA,YAAY,CAAA,0BAAA,CAA4B;wBACxC,uBAAuB,CAAC,4BAA4B,CAAC;AACrD,wBAAA,UAAU,CAAC,sBAAsB,EAAE,4BAA4B,CAAC;AACnE,qBAAA;AACD,oBAAA,cAAc,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,CAAC;AACpE,iBAAA;;;AC3BM,MAAM,iBAAiB,GAAG;IAC7B,0BAA0B;IAC1B,gBAAgB;IAChB,QAAQ;IACR,qBAAqB;IACrB,4BAA4B;IAC5B,kBAAkB;;;AChBtB;;AAEG;;;;"}
|
|
@@ -11,7 +11,7 @@ import { TuiNativeTimePicker } from '@taiga-ui/kit/components/input-time';
|
|
|
11
11
|
import { TuiTime, MILLISECONDS_IN_DAY, DATE_FILLER_LENGTH, TuiDay } from '@taiga-ui/cdk/date-time';
|
|
12
12
|
import * as i1 from '@maskito/angular';
|
|
13
13
|
import { MaskitoDirective } from '@maskito/angular';
|
|
14
|
-
import {
|
|
14
|
+
import { maskitoDateTime, maskitoSelectionChangeHandler, maskitoParseTime } from '@maskito/kit';
|
|
15
15
|
import { TUI_IDENTITY_VALUE_TRANSFORMER, tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
|
|
16
16
|
import { tuiProvideOptions, tuiDirectiveBinding } from '@taiga-ui/cdk/utils/di';
|
|
17
17
|
import { tuiSum, tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
@@ -146,7 +146,7 @@ class TuiInputDateTimeDirective extends TuiInputDateBase {
|
|
|
146
146
|
];
|
|
147
147
|
}
|
|
148
148
|
computeMask(params) {
|
|
149
|
-
const options =
|
|
149
|
+
const options = maskitoDateTime(params);
|
|
150
150
|
const { timeMode, dateMode, dateTimeSeparator, dayPeriod } = params;
|
|
151
151
|
const inputModeSwitchPlugin = maskitoSelectionChangeHandler((element) => {
|
|
152
152
|
element.inputMode =
|
|
@@ -169,15 +169,15 @@ class TuiInputDateTimeDirective extends TuiInputDateBase {
|
|
|
169
169
|
const mode = this.timeMode();
|
|
170
170
|
return TuiTime.fromAbsoluteMilliseconds(maskitoParseTime(time, { mode }));
|
|
171
171
|
}
|
|
172
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
173
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
172
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputDateTimeDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
173
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.25", type: TuiInputDateTimeDirective, isStandalone: true, selector: "input[tuiInputDateTime]", inputs: { timeMode: { classPropertyName: "timeMode", publicName: "timeMode", isSignal: true, isRequired: false, transformFunction: null }, minInput: { classPropertyName: "minInput", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, maxInput: { classPropertyName: "maxInput", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "blur": "onBlur($event.target.value)" } }, providers: [
|
|
174
174
|
tuiAsOptionContent(TuiSelectOption),
|
|
175
175
|
tuiAsControl(TuiInputDateTimeDirective),
|
|
176
176
|
tuiAsTextfieldAccessor(TuiInputDateTimeDirective),
|
|
177
177
|
tuiValueTransformerFrom(TUI_INPUT_DATE_TIME_OPTIONS),
|
|
178
178
|
], usesInheritance: true, hostDirectives: [{ directive: i1.MaskitoDirective }, { directive: i2.TuiDropdownAuto }, { directive: i3.TuiItemsHandlersValidator }, { directive: i4.TuiWithInput }], ngImport: i0 }); }
|
|
179
179
|
}
|
|
180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputDateTimeDirective, decorators: [{
|
|
181
181
|
type: Directive,
|
|
182
182
|
args: [{
|
|
183
183
|
selector: 'input[tuiInputDateTime]',
|
|
@@ -215,8 +215,8 @@ class TuiInputDateTimeContent {
|
|
|
215
215
|
const time = TuiTime.fromLocalNativeDate(date);
|
|
216
216
|
this.host.setValue([day, time]);
|
|
217
217
|
}
|
|
218
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
219
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
218
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputDateTimeContent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
219
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TuiInputDateTimeContent, isStandalone: true, selector: "tui-input-date-time-content", ngImport: i0, template: `
|
|
220
220
|
@if (host.native) {
|
|
221
221
|
<input
|
|
222
222
|
type="datetime-local"
|
|
@@ -230,9 +230,9 @@ class TuiInputDateTimeContent {
|
|
|
230
230
|
(pointerdown.stop.zoneless)="(0)"
|
|
231
231
|
/>
|
|
232
232
|
}
|
|
233
|
-
`, isInline: true, styles: ["tui-textfield input[tuiInputDateTime]:where(*[data-tui-version=\"5.
|
|
233
|
+
`, isInline: true, styles: ["tui-textfield input[tuiInputDateTime]:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"])~.t-content input[type=datetime-local]{position:absolute;inset-block-start:0;inset-inline-start:auto;inset-inline-end:0;inset-block-end:0;inline-size:2.5rem;padding:0;opacity:0;pointer-events:auto}tui-textfield input[tuiInputDateTime]:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"])~.t-content input[type=datetime-local]::-webkit-calendar-picker-indicator{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
234
234
|
}
|
|
235
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputDateTimeContent, decorators: [{
|
|
236
236
|
type: Component,
|
|
237
237
|
args: [{ selector: 'tui-input-date-time-content', template: `
|
|
238
238
|
@if (host.native) {
|
|
@@ -248,19 +248,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
248
248
|
(pointerdown.stop.zoneless)="(0)"
|
|
249
249
|
/>
|
|
250
250
|
}
|
|
251
|
-
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["tui-textfield input[tuiInputDateTime]:where(*[data-tui-version=\"5.
|
|
251
|
+
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["tui-textfield input[tuiInputDateTime]:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"])~.t-content input[type=datetime-local]{position:absolute;inset-block-start:0;inset-inline-start:auto;inset-inline-end:0;inset-block-end:0;inline-size:2.5rem;padding:0;opacity:0;pointer-events:auto}tui-textfield input[tuiInputDateTime]:where(*[data-tui-version=\"5.11.0-canary.8834a0e\"])~.t-content input[type=datetime-local]::-webkit-calendar-picker-indicator{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%}\n"] }]
|
|
252
252
|
}] });
|
|
253
253
|
|
|
254
254
|
// TODO(v6): rename to TuiInputDateTimeDirective
|
|
255
255
|
class TuiInputDateTimeComponent extends TuiNativeTimePicker {
|
|
256
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
257
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
256
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputDateTimeComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
257
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: TuiInputDateTimeComponent, isStandalone: true, selector: "input[tuiInputDateTime][type=\"datetime-local\"]", host: { attributes: { "data-tui-version": "5.11.0-canary.8834a0e" } }, providers: [tuiAsTextfieldContent(() => TuiInputDateTimeContent)], usesInheritance: true, hostDirectives: [{ directive: i1$1.TuiWithNativePicker }, { directive: i1$1.TuiTextfieldContent }], ngImport: i0 }); }
|
|
258
258
|
}
|
|
259
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputDateTimeComponent, decorators: [{
|
|
260
260
|
type: Directive,
|
|
261
261
|
args: [{
|
|
262
262
|
selector: 'input[tuiInputDateTime][type="datetime-local"]',
|
|
263
|
-
providers: [tuiAsTextfieldContent(TuiInputDateTimeContent)],
|
|
263
|
+
providers: [tuiAsTextfieldContent(() => TuiInputDateTimeContent)],
|
|
264
264
|
hostDirectives: [TuiWithNativePicker, TuiTextfieldContent],
|
|
265
265
|
host: { 'data-tui-version': TUI_VERSION },
|
|
266
266
|
}]
|
|
@@ -280,5 +280,5 @@ const TuiInputDateTime = [
|
|
|
280
280
|
* Generated bundle index. Do not edit.
|
|
281
281
|
*/
|
|
282
282
|
|
|
283
|
-
export { TUI_INPUT_DATE_TIME_DEFAULT_OPTIONS, TUI_INPUT_DATE_TIME_OPTIONS, TuiInputDateTime, TuiInputDateTimeComponent,
|
|
283
|
+
export { TUI_INPUT_DATE_TIME_DEFAULT_OPTIONS, TUI_INPUT_DATE_TIME_OPTIONS, TuiInputDateTime, TuiInputDateTimeComponent, TuiInputDateTimeDirective, tuiInputDateTimeOptionsProvider };
|
|
284
284
|
//# sourceMappingURL=taiga-ui-kit-components-input-date-time.mjs.map
|