@taiga-ui/kit 4.37.0 → 4.38.0-canary.507d44d
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/action-bar/action-bar.component.d.ts +2 -2
- package/components/badge-notification/badge-notification.component.d.ts +2 -2
- package/components/calendar-range/day-caps-mapper.d.ts +2 -2
- package/components/drawer/drawer.component.d.ts +3 -6
- package/components/input-month/input-month.directive.d.ts +3 -2
- package/components/input-month-range/input-month-range.directive.d.ts +3 -2
- package/components/input-number/input-number.directive.d.ts +3 -2
- package/components/input-number/step/input-number-step.component.d.ts +4 -3
- package/components/line-clamp/line-clamp-box.component.d.ts +2 -1
- package/components/pdf-viewer/pdf-viewer.component.d.ts +2 -2
- package/components/preview/preview-dialog/preview-dialog.component.d.ts +2 -8
- package/components/pulse/pulse.component.d.ts +2 -2
- package/components/push/push-alert.component.d.ts +2 -2
- package/components/select/native-select/native-select.component.d.ts +2 -0
- package/components/select/select.directive.d.ts +2 -1
- package/esm2022/components/action-bar/action-bar.component.mjs +8 -12
- package/esm2022/components/badge-notification/badge-notification.component.mjs +6 -9
- package/esm2022/components/calendar-range/calendar-range.component.mjs +4 -4
- package/esm2022/components/calendar-range/day-caps-mapper.mjs +10 -4
- package/esm2022/components/drawer/drawer.component.mjs +13 -16
- package/esm2022/components/input-month/input-month.directive.mjs +8 -7
- package/esm2022/components/input-month-range/input-month-range.directive.mjs +13 -8
- package/esm2022/components/input-number/input-number.directive.mjs +15 -19
- package/esm2022/components/input-number/step/input-number-step.component.mjs +14 -13
- package/esm2022/components/line-clamp/line-clamp-box.component.mjs +7 -6
- package/esm2022/components/pdf-viewer/pdf-viewer.component.mjs +8 -11
- package/esm2022/components/preview/preview-dialog/preview-dialog.component.mjs +10 -20
- package/esm2022/components/preview/preview.component.mjs +3 -4
- package/esm2022/components/pulse/pulse.component.mjs +6 -10
- package/esm2022/components/push/push-alert.component.mjs +8 -21
- package/esm2022/components/select/native-select/native-select.component.mjs +9 -5
- package/esm2022/components/select/select.directive.mjs +10 -5
- package/esm2022/components/slider/helpers/slider-key-steps.directive.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-action-bar.mjs +7 -11
- package/fesm2022/taiga-ui-kit-components-action-bar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +5 -8
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +12 -6
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-drawer.mjs +12 -15
- package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs +12 -7
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month.mjs +7 -6
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +26 -29
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +8 -7
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs +7 -10
- package/fesm2022/taiga-ui-kit-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-preview-preview-dialog.mjs +9 -19
- package/fesm2022/taiga-ui-kit-components-preview-preview-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-preview.mjs +10 -20
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pulse.mjs +5 -9
- package/fesm2022/taiga-ui-kit-components-pulse.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-push.mjs +6 -18
- package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-select.mjs +14 -6
- package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-slider.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
- package/package.json +46 -46
|
@@ -1,44 +1,41 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
|
|
3
|
+
import * as i1 from '@taiga-ui/cdk/directives/animated';
|
|
4
|
+
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
|
|
5
|
+
import { tuiButtonOptionsProvider } from '@taiga-ui/core/components/button';
|
|
5
6
|
import { TuiScrollbar } from '@taiga-ui/core/components/scrollbar';
|
|
6
|
-
import { TUI_ANIMATIONS_SPEED } from '@taiga-ui/core/tokens';
|
|
7
|
-
import { tuiToAnimationOptions } from '@taiga-ui/core/utils/miscellaneous';
|
|
8
7
|
|
|
9
8
|
class TuiDrawer {
|
|
10
9
|
constructor() {
|
|
11
|
-
this.options = tuiToAnimationOptions(inject(TUI_ANIMATIONS_SPEED));
|
|
12
10
|
this.direction = 'right';
|
|
13
11
|
this.overlay = false;
|
|
14
12
|
}
|
|
15
|
-
get
|
|
16
|
-
return
|
|
13
|
+
get from() {
|
|
14
|
+
return this.direction === 'right' ? 'translateX(100%)' : 'translateX(-100%)';
|
|
17
15
|
}
|
|
18
16
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
19
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiDrawer, isStandalone: true, selector: "tui-drawer", inputs: { direction: "direction", overlay: "overlay" }, host: { properties: { "
|
|
17
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiDrawer, isStandalone: true, selector: "tui-drawer", inputs: { direction: "direction", overlay: "overlay" }, host: { properties: { "class._overlay": "overlay", "style.border-top-left-radius": "direction === \"left\" ? 0 : null", "style.border-top-right-radius": "direction === \"right\" ? 0 : null", "style.left": "direction === \"left\" ? 0 : null", "style.right": "direction === \"right\" ? 0 : null", "style.--tui-from": "from" } }, providers: [
|
|
20
18
|
tuiButtonOptionsProvider({
|
|
21
19
|
appearance: 'secondary',
|
|
22
20
|
size: 's',
|
|
23
21
|
}),
|
|
24
|
-
], ngImport: i0, template: "<aside class=\"t-aside\">\n <tui-scrollbar class=\"t-scrollbar\">\n <ng-content select=\"header\" />\n <div class=\"t-content\"><ng-content /></div>\n </tui-scrollbar>\n <tui-scrollbar\n class=\"t-footer\"\n [hidden]=\"true\"\n >\n <ng-content select=\"footer\" />\n </tui-scrollbar>\n</aside>\n", styles: [":host{position:fixed;top:3rem;bottom:0;inline-size:36.25rem;max-inline-size:calc(100vw - 3rem);background:var(--tui-background-elevation-1);box-shadow:var(--tui-shadow-medium);border-top-left-radius:1.25rem;border-top-right-radius:1.25rem}:host._overlay:before{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:fixed;top:-100vh;left:-100vw;right:-100vw;bottom:-100vh;background:var(--tui-service-backdrop);transition-timing-function:ease-out}tui-root:has(tui-dialogs .t-overlay_visible) :host._overlay:before{opacity:0;transition-timing-function:ease-in}.t-aside{position:relative;display:flex;block-size:100%;flex-direction:column;border-radius:inherit;overflow:hidden;background:inherit}.t-scrollbar{flex:1;overscroll-behavior:contain}.t-scrollbar ::ng-deep>.t-content>header{top:0;z-index:1;display:flex;flex-direction:column;gap:.75rem;padding:1.5rem 1.5rem .75rem;box-shadow:inset 0 -1px var(--tui-border-normal);background:var(--tui-background-elevation-1)}.t-scrollbar ::ng-deep>.t-content>header>*{display:flex;gap:.5rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiTitle]{font:var(--tui-font-text-xl);font-weight:700}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiSubtitle]{color:var(--tui-text-primary);font:var(--tui-font-text-s)}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiAccessories]{gap:.5rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiAccessories] [tuiIconButton][data-appearance=icon]:last-child{margin-inline-start:.25rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiAccessories] [tuiIconButton][data-appearance=icon]:last-child:before{font-size:1rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiNavigationNav]{min-block-size:var(--tui-height-m);margin-block-end:-.75rem;padding:0;border-image:none}.t-content{padding:1.25rem 1.5rem}.t-footer ::ng-deep footer{scrollbar-width:none;-ms-overflow-style:none;display:flex;min-inline-size:-webkit-min-content;min-inline-size:min-content;justify-content:flex-end;gap:.75rem;padding:.5rem 1.5rem;box-shadow:inset 0 1px var(--tui-border-normal);background:var(--tui-background-elevation-1)}.t-footer ::ng-deep footer::-webkit-scrollbar,.t-footer ::ng-deep footer::-webkit-scrollbar-thumb{display:none}\n"], dependencies: [{ kind: "component", type: TuiScrollbar, selector: "tui-scrollbar", inputs: ["hidden"] }],
|
|
22
|
+
], hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: "<aside class=\"t-aside\">\n <tui-scrollbar class=\"t-scrollbar\">\n <ng-content select=\"header\" />\n <div class=\"t-content\"><ng-content /></div>\n </tui-scrollbar>\n <tui-scrollbar\n class=\"t-footer\"\n [hidden]=\"true\"\n >\n <ng-content select=\"footer\" />\n </tui-scrollbar>\n</aside>\n", styles: [":host{position:fixed;top:3rem;bottom:0;inline-size:36.25rem;max-inline-size:calc(100vw - 3rem);background:var(--tui-background-elevation-1);box-shadow:var(--tui-shadow-medium);border-top-left-radius:1.25rem;border-top-right-radius:1.25rem}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}:host._overlay:before{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:fixed;top:-100vh;left:-100vw;right:-100vw;bottom:-100vh;background:var(--tui-service-backdrop);transition-timing-function:ease-out}tui-root:has(tui-dialogs .t-overlay_visible) :host._overlay:before{opacity:0;transition-timing-function:ease-in}.t-aside{position:relative;display:flex;block-size:100%;flex-direction:column;border-radius:inherit;overflow:hidden;background:inherit}.t-scrollbar{flex:1;overscroll-behavior:contain}.t-scrollbar ::ng-deep>.t-content>header{top:0;z-index:1;display:flex;flex-direction:column;gap:.75rem;padding:1.5rem 1.5rem .75rem;box-shadow:inset 0 -1px var(--tui-border-normal);background:var(--tui-background-elevation-1)}.t-scrollbar ::ng-deep>.t-content>header>*{display:flex;gap:.5rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiTitle]{font:var(--tui-font-text-xl);font-weight:700}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiSubtitle]{color:var(--tui-text-primary);font:var(--tui-font-text-s)}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiAccessories]{gap:.5rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiAccessories] [tuiIconButton][data-appearance=icon]:last-child{margin-inline-start:.25rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiAccessories] [tuiIconButton][data-appearance=icon]:last-child:before{font-size:1rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiNavigationNav]{min-block-size:var(--tui-height-m);margin-block-end:-.75rem;padding:0;border-image:none}.t-content{padding:1.25rem 1.5rem}.t-footer ::ng-deep footer{scrollbar-width:none;-ms-overflow-style:none;display:flex;min-inline-size:-webkit-min-content;min-inline-size:min-content;justify-content:flex-end;gap:.75rem;padding:.5rem 1.5rem;box-shadow:inset 0 1px var(--tui-border-normal);background:var(--tui-background-elevation-1)}.t-footer ::ng-deep footer::-webkit-scrollbar,.t-footer ::ng-deep footer::-webkit-scrollbar-thumb{display:none}\n"], dependencies: [{ kind: "component", type: TuiScrollbar, selector: "tui-scrollbar", inputs: ["hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
25
23
|
}
|
|
26
24
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDrawer, decorators: [{
|
|
27
25
|
type: Component,
|
|
28
|
-
args: [{ standalone: true, selector: 'tui-drawer', imports: [
|
|
26
|
+
args: [{ standalone: true, selector: 'tui-drawer', imports: [TuiScrollbar], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
29
27
|
tuiButtonOptionsProvider({
|
|
30
28
|
appearance: 'secondary',
|
|
31
29
|
size: 's',
|
|
32
30
|
}),
|
|
33
|
-
],
|
|
34
|
-
'[@tuiFadeIn]': 'options',
|
|
35
|
-
'[@tuiSlideIn]': 'animation',
|
|
31
|
+
], hostDirectives: [TuiAnimated], host: {
|
|
36
32
|
'[class._overlay]': 'overlay',
|
|
37
33
|
'[style.border-top-left-radius]': 'direction === "left" ? 0 : null',
|
|
38
34
|
'[style.border-top-right-radius]': 'direction === "right" ? 0 : null',
|
|
39
35
|
'[style.left]': 'direction === "left" ? 0 : null',
|
|
40
36
|
'[style.right]': 'direction === "right" ? 0 : null',
|
|
41
|
-
|
|
37
|
+
'[style.--tui-from]': 'from',
|
|
38
|
+
}, template: "<aside class=\"t-aside\">\n <tui-scrollbar class=\"t-scrollbar\">\n <ng-content select=\"header\" />\n <div class=\"t-content\"><ng-content /></div>\n </tui-scrollbar>\n <tui-scrollbar\n class=\"t-footer\"\n [hidden]=\"true\"\n >\n <ng-content select=\"footer\" />\n </tui-scrollbar>\n</aside>\n", styles: [":host{position:fixed;top:3rem;bottom:0;inline-size:36.25rem;max-inline-size:calc(100vw - 3rem);background:var(--tui-background-elevation-1);box-shadow:var(--tui-shadow-medium);border-top-left-radius:1.25rem;border-top-right-radius:1.25rem}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}:host._overlay:before{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:fixed;top:-100vh;left:-100vw;right:-100vw;bottom:-100vh;background:var(--tui-service-backdrop);transition-timing-function:ease-out}tui-root:has(tui-dialogs .t-overlay_visible) :host._overlay:before{opacity:0;transition-timing-function:ease-in}.t-aside{position:relative;display:flex;block-size:100%;flex-direction:column;border-radius:inherit;overflow:hidden;background:inherit}.t-scrollbar{flex:1;overscroll-behavior:contain}.t-scrollbar ::ng-deep>.t-content>header{top:0;z-index:1;display:flex;flex-direction:column;gap:.75rem;padding:1.5rem 1.5rem .75rem;box-shadow:inset 0 -1px var(--tui-border-normal);background:var(--tui-background-elevation-1)}.t-scrollbar ::ng-deep>.t-content>header>*{display:flex;gap:.5rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiTitle]{font:var(--tui-font-text-xl);font-weight:700}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiSubtitle]{color:var(--tui-text-primary);font:var(--tui-font-text-s)}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiAccessories]{gap:.5rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiAccessories] [tuiIconButton][data-appearance=icon]:last-child{margin-inline-start:.25rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiHeader] [tuiAccessories] [tuiIconButton][data-appearance=icon]:last-child:before{font-size:1rem}.t-scrollbar ::ng-deep>.t-content>header>[tuiNavigationNav]{min-block-size:var(--tui-height-m);margin-block-end:-.75rem;padding:0;border-image:none}.t-content{padding:1.25rem 1.5rem}.t-footer ::ng-deep footer{scrollbar-width:none;-ms-overflow-style:none;display:flex;min-inline-size:-webkit-min-content;min-inline-size:min-content;justify-content:flex-end;gap:.75rem;padding:.5rem 1.5rem;box-shadow:inset 0 1px var(--tui-border-normal);background:var(--tui-background-elevation-1)}.t-footer ::ng-deep footer::-webkit-scrollbar,.t-footer ::ng-deep footer::-webkit-scrollbar-thumb{display:none}\n"] }]
|
|
42
39
|
}], propDecorators: { direction: [{
|
|
43
40
|
type: Input
|
|
44
41
|
}], overlay: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-drawer.mjs","sources":["../../../projects/kit/components/drawer/drawer.component.ts","../../../projects/kit/components/drawer/drawer.template.html","../../../projects/kit/components/drawer/taiga-ui-kit-components-drawer.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-drawer.mjs","sources":["../../../projects/kit/components/drawer/drawer.component.ts","../../../projects/kit/components/drawer/drawer.template.html","../../../projects/kit/components/drawer/taiga-ui-kit-components-drawer.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {tuiButtonOptionsProvider} from '@taiga-ui/core/components/button';\nimport {TuiScrollbar} from '@taiga-ui/core/components/scrollbar';\nimport type {TuiHorizontalDirection} from '@taiga-ui/core/types';\n\n@Component({\n standalone: true,\n selector: 'tui-drawer',\n imports: [TuiScrollbar],\n templateUrl: './drawer.template.html',\n styleUrls: ['./drawer.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiButtonOptionsProvider({\n appearance: 'secondary',\n size: 's',\n }),\n ],\n hostDirectives: [TuiAnimated],\n host: {\n '[class._overlay]': 'overlay',\n '[style.border-top-left-radius]': 'direction === \"left\" ? 0 : null',\n '[style.border-top-right-radius]': 'direction === \"right\" ? 0 : null',\n '[style.left]': 'direction === \"left\" ? 0 : null',\n '[style.right]': 'direction === \"right\" ? 0 : null',\n '[style.--tui-from]': 'from',\n },\n})\nexport class TuiDrawer {\n @Input()\n public direction: TuiHorizontalDirection = 'right';\n\n @Input()\n public overlay = false;\n\n public get from(): string {\n return this.direction === 'right' ? 'translateX(100%)' : 'translateX(-100%)';\n }\n}\n","<aside class=\"t-aside\">\n <tui-scrollbar class=\"t-scrollbar\">\n <ng-content select=\"header\" />\n <div class=\"t-content\"><ng-content /></div>\n </tui-scrollbar>\n <tui-scrollbar\n class=\"t-footer\"\n [hidden]=\"true\"\n >\n <ng-content select=\"footer\" />\n </tui-scrollbar>\n</aside>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA,MAuBa,SAAS,CAAA;AAvBtB,IAAA,WAAA,GAAA;QAyBW,IAAS,CAAA,SAAA,GAA2B,OAAO,CAAC;QAG5C,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC;AAK1B,KAAA;AAHG,IAAA,IAAW,IAAI,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;KAChF;+GATQ,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,SAAS,EAhBP,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,SAAA,EAAA,8BAAA,EAAA,mCAAA,EAAA,+BAAA,EAAA,oCAAA,EAAA,YAAA,EAAA,mCAAA,EAAA,aAAA,EAAA,oCAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,EAAA,SAAA,EAAA;AACP,YAAA,wBAAwB,CAAC;AACrB,gBAAA,UAAU,EAAE,WAAW;AACvB,gBAAA,IAAI,EAAE,GAAG;aACZ,CAAC;SACL,EClBL,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,2VAYA,83EDHc,YAAY,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;4FAoBb,SAAS,EAAA,UAAA,EAAA,CAAA;kBAvBrB,SAAS;iCACM,IAAI,EAAA,QAAA,EACN,YAAY,EAAA,OAAA,EACb,CAAC,YAAY,CAAC,EAGN,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACpC,SAAA,EAAA;AACP,wBAAA,wBAAwB,CAAC;AACrB,4BAAA,UAAU,EAAE,WAAW;AACvB,4BAAA,IAAI,EAAE,GAAG;yBACZ,CAAC;qBACL,EACe,cAAA,EAAA,CAAC,WAAW,CAAC,EACvB,IAAA,EAAA;AACF,wBAAA,kBAAkB,EAAE,SAAS;AAC7B,wBAAA,gCAAgC,EAAE,iCAAiC;AACnE,wBAAA,iCAAiC,EAAE,kCAAkC;AACrE,wBAAA,cAAc,EAAE,iCAAiC;AACjD,wBAAA,eAAe,EAAE,kCAAkC;AACnD,wBAAA,oBAAoB,EAAE,MAAM;AAC/B,qBAAA,EAAA,QAAA,EAAA,2VAAA,EAAA,MAAA,EAAA,CAAA,s0EAAA,CAAA,EAAA,CAAA;8BAIM,SAAS,EAAA,CAAA;sBADf,KAAK;gBAIC,OAAO,EAAA,CAAA;sBADb,KAAK;;;AEjCV;;AAEG;;;;"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { TuiCalendarMonth } from '@taiga-ui/kit/components/calendar-month';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { inject, signal, effect, Directive } from '@angular/core';
|
|
4
4
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
|
|
6
6
|
import { TUI_ALLOW_SIGNAL_WRITES } from '@taiga-ui/cdk/constants';
|
|
7
7
|
import { RANGE_SEPARATOR_CHAR, TuiMonthRange } from '@taiga-ui/cdk/date-time';
|
|
8
|
-
import { tuiValueBinding } from '@taiga-ui/cdk/utils/dom';
|
|
9
8
|
import * as i1 from '@taiga-ui/core/components/textfield';
|
|
10
|
-
import { tuiInjectAuxiliary, tuiTextfieldIconBinding, TuiWithTextfield, TuiSelectLike } from '@taiga-ui/core/components/textfield';
|
|
9
|
+
import { TuiTextfieldDirective, tuiInjectAuxiliary, tuiTextfieldIconBinding, TuiWithTextfield, TuiSelectLike } from '@taiga-ui/core/components/textfield';
|
|
11
10
|
import * as i2 from '@taiga-ui/core/directives/dropdown';
|
|
12
11
|
import { tuiDropdownOpen, tuiDropdownEnabled, TuiDropdownAuto } from '@taiga-ui/core/directives/dropdown';
|
|
13
12
|
import { TUI_MONTH_FORMATTER, TUI_INPUT_DATE_OPTIONS } from '@taiga-ui/kit/tokens';
|
|
@@ -15,15 +14,21 @@ import { TUI_MONTH_FORMATTER, TUI_INPUT_DATE_OPTIONS } from '@taiga-ui/kit/token
|
|
|
15
14
|
class TuiInputMonthRangeDirective extends TuiControl {
|
|
16
15
|
constructor() {
|
|
17
16
|
super(...arguments);
|
|
17
|
+
this.textfield = inject(TuiTextfieldDirective);
|
|
18
|
+
this.formatter = toSignal(inject(TUI_MONTH_FORMATTER));
|
|
18
19
|
this.open = tuiDropdownOpen();
|
|
19
20
|
this.intermediateValue = signal(null);
|
|
20
21
|
this.calendar = tuiInjectAuxiliary((x) => x instanceof TuiCalendarMonth);
|
|
21
|
-
this.formatter = toSignal(inject(TUI_MONTH_FORMATTER), {
|
|
22
|
-
initialValue: () => '',
|
|
23
|
-
});
|
|
24
22
|
this.icon = tuiTextfieldIconBinding(TUI_INPUT_DATE_OPTIONS);
|
|
25
23
|
this.dropdownEnabled = tuiDropdownEnabled(this.interactive);
|
|
26
|
-
this.
|
|
24
|
+
this.valueEffect = effect(() => {
|
|
25
|
+
const value = this.value();
|
|
26
|
+
const format = this.formatter() || (() => '');
|
|
27
|
+
const string = value
|
|
28
|
+
? format(value.from) + RANGE_SEPARATOR_CHAR + format(value.to)
|
|
29
|
+
: '';
|
|
30
|
+
this.textfield.value.set(string);
|
|
31
|
+
}, TUI_ALLOW_SIGNAL_WRITES);
|
|
27
32
|
this.calendarInit = effect(() => {
|
|
28
33
|
const calendar = this.calendar();
|
|
29
34
|
if (calendar) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-month-range.mjs","sources":["../../../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 {
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-month-range.mjs","sources":["../../../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 {Directive, effect, inject, signal} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {tuiAsControl, TuiControl} from '@taiga-ui/cdk/classes';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport type {TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {RANGE_SEPARATOR_CHAR, TuiMonthRange} from '@taiga-ui/cdk/date-time';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n TuiTextfieldDirective,\n tuiTextfieldIconBinding,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n tuiDropdownOpen,\n} from '@taiga-ui/core/directives/dropdown';\nimport {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\nimport {TUI_INPUT_DATE_OPTIONS, TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens';\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputMonthRange]',\n providers: [tuiAsControl(TuiInputMonthRangeDirective)],\n hostDirectives: [TuiWithTextfield, TuiSelectLike, TuiDropdownAuto],\n host: {\n '[disabled]': 'disabled()',\n '(blur)': 'onTouched()',\n '(input)': '$event.inputType?.includes(\"delete\") && clear()',\n },\n})\nexport class TuiInputMonthRangeDirective extends TuiControl<TuiMonthRange | null> {\n private readonly textfield = inject(TuiTextfieldDirective);\n private readonly formatter = toSignal(inject(TUI_MONTH_FORMATTER));\n private readonly open = tuiDropdownOpen();\n private readonly intermediateValue = signal<TuiMonth | null>(null);\n\n private readonly calendar = tuiInjectAuxiliary<TuiCalendarMonth>(\n (x) => x instanceof TuiCalendarMonth,\n );\n\n protected readonly icon = tuiTextfieldIconBinding(TUI_INPUT_DATE_OPTIONS);\n protected readonly dropdownEnabled = tuiDropdownEnabled(this.interactive);\n\n protected readonly valueEffect = effect(() => {\n const value = this.value();\n const format = this.formatter() || (() => '');\n const string = value\n ? format(value.from) + RANGE_SEPARATOR_CHAR + format(value.to)\n : '';\n\n this.textfield.value.set(string);\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly calendarInit = effect(() => {\n const calendar = this.calendar();\n\n if (calendar) {\n calendar.options.rangeMode = true;\n }\n });\n\n protected readonly calendarSync = effect(() => {\n this.calendar()?.value.set(this.intermediateValue() ?? this.value());\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n // TODO: use linked signal (Angular 19+)\n protected readonly resetIntermediateValue = effect(() => {\n this.intermediateValue.set(this.value() && null);\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected onMonthClickEffect = effect((onCleanup) => {\n const subscription = this.calendar()?.monthClick.subscribe((month) => {\n const intermediateValue = this.intermediateValue();\n\n if (!intermediateValue) {\n this.intermediateValue.set(month);\n } else {\n this.onChange(TuiMonthRange.sort(intermediateValue, month));\n this.open.set(false);\n }\n });\n\n onCleanup(() => subscription?.unsubscribe());\n });\n\n protected clear(): void {\n this.onChange(null);\n this.open.set(true);\n }\n}\n","import {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthRangeDirective} from './input-month-range.directive';\n\nexport const TuiInputMonthRange = [\n TuiInputMonthRangeDirective,\n TuiCalendarMonth,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAqBA,MAWa,2BAA4B,SAAQ,UAAgC,CAAA;AAXjF,IAAA,WAAA,GAAA;;AAYqB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC1C,IAAS,CAAA,SAAA,GAAG,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAClD,IAAI,CAAA,IAAA,GAAG,eAAe,EAAE,CAAC;AACzB,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;AAElD,QAAA,IAAA,CAAA,QAAQ,GAAG,kBAAkB,CAC1C,CAAC,CAAC,KAAK,CAAC,YAAY,gBAAgB,CACvC,CAAC;AAEiB,QAAA,IAAA,CAAA,IAAI,GAAG,uBAAuB,CAAC,sBAAsB,CAAC,CAAC;AACvD,QAAA,IAAA,CAAA,eAAe,GAAG,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAEvD,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,MAAK;AACzC,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;AAC3B,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC,CAAC;YAC9C,MAAM,MAAM,GAAG,KAAK;AAChB,kBAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,oBAAoB,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;kBAC5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Y,EAAE,YAAY;AAC1B,wBAAA,QAAQ,EAAE,aAAa;AACvB,wBAAA,SAAS,EAAE,iDAAiD;AAC/D,qBAAA;AACJ,iBAAA,CAAA;;;AC3BY,MAAA,kBAAkB,GAAG;IAC9B,2BAA2B;IAC3B,gBAAgB;;;ACNpB;;AAEG;;;;"}
|
|
@@ -5,9 +5,9 @@ import { toSignal } from '@angular/core/rxjs-interop';
|
|
|
5
5
|
import { TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
|
|
6
6
|
import { TUI_ALLOW_SIGNAL_WRITES } from '@taiga-ui/cdk/constants';
|
|
7
7
|
import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
|
|
8
|
-
import {
|
|
8
|
+
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
9
9
|
import * as i1 from '@taiga-ui/core/components/textfield';
|
|
10
|
-
import { tuiTextfieldIconBinding, tuiInjectAuxiliary, TuiWithTextfield, TuiSelectLike, TuiTextfieldContent } from '@taiga-ui/core/components/textfield';
|
|
10
|
+
import { TuiTextfieldDirective, tuiTextfieldIconBinding, tuiInjectAuxiliary, TuiWithTextfield, TuiSelectLike, TuiTextfieldContent } from '@taiga-ui/core/components/textfield';
|
|
11
11
|
import * as i2 from '@taiga-ui/core/directives/dropdown';
|
|
12
12
|
import { tuiDropdownOpen, tuiDropdownEnabled, TuiDropdownAuto } from '@taiga-ui/core/directives/dropdown';
|
|
13
13
|
import { TUI_MONTH_FORMATTER, TUI_INPUT_DATE_OPTIONS } from '@taiga-ui/kit/tokens';
|
|
@@ -18,13 +18,14 @@ import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
|
18
18
|
class TuiInputMonthDirective extends TuiControl {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
|
+
this.textfield = inject(TuiTextfieldDirective);
|
|
22
|
+
this.formatter = toSignal(inject(TUI_MONTH_FORMATTER));
|
|
21
23
|
this.open = tuiDropdownOpen();
|
|
22
|
-
this.formatter = toSignal(inject(TUI_MONTH_FORMATTER), {
|
|
23
|
-
initialValue: () => '',
|
|
24
|
-
});
|
|
25
24
|
this.icon = tuiTextfieldIconBinding(TUI_INPUT_DATE_OPTIONS);
|
|
26
25
|
this.dropdownEnabled = tuiDropdownEnabled(computed(() => !this.nativePickerEnabled && this.interactive()));
|
|
27
|
-
this.
|
|
26
|
+
this.valueEffect = effect(() => {
|
|
27
|
+
this.textfield.value.set(this.formatter()?.(this.value()) || '');
|
|
28
|
+
}, TUI_ALLOW_SIGNAL_WRITES);
|
|
28
29
|
this.calendarSync = effect(() => {
|
|
29
30
|
this.calendar()?.value.set(this.value());
|
|
30
31
|
}, TUI_ALLOW_SIGNAL_WRITES);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-month.mjs","sources":["../../../projects/kit/components/input-month/input-month.directive.ts","../../../projects/kit/components/input-month/native-month-picker/native-month-picker.component.ts","../../../projects/kit/components/input-month/native-month-picker/native-month-picker.template.html","../../../projects/kit/components/input-month/input-month.ts","../../../projects/kit/components/input-month/input-month.options.ts","../../../projects/kit/components/input-month/taiga-ui-kit-components-input-month.ts"],"sourcesContent":["import {computed, Directive, effect, inject} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {tuiAsControl, TuiControl} from '@taiga-ui/cdk/classes';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport type {TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {tuiInjectElement, tuiValueBinding} from '@taiga-ui/cdk/utils/dom';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n tuiTextfieldIconBinding,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n tuiDropdownOpen,\n} from '@taiga-ui/core/directives/dropdown';\nimport {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\nimport {TUI_INPUT_DATE_OPTIONS, TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens';\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputMonth]',\n providers: [tuiAsControl(TuiInputMonthDirective)],\n hostDirectives: [TuiWithTextfield, TuiSelectLike, TuiDropdownAuto],\n host: {\n '[disabled]': 'disabled()',\n '(blur)': 'onTouched()',\n '(input)': '$event.inputType?.includes(\"delete\") && clear()',\n },\n})\nexport class TuiInputMonthDirective extends TuiControl<TuiMonth | null> {\n private readonly open = tuiDropdownOpen();\n private readonly formatter = toSignal(inject(TUI_MONTH_FORMATTER), {\n initialValue: () => '',\n });\n\n protected readonly icon = tuiTextfieldIconBinding(TUI_INPUT_DATE_OPTIONS);\n protected readonly dropdownEnabled = tuiDropdownEnabled(\n computed(() => !this.nativePickerEnabled && this.interactive()),\n );\n\n protected readonly textfieldValue = tuiValueBinding(\n computed(() => this.formatter()(this.value())),\n );\n\n protected readonly calendarSync = effect(() => {\n this.calendar()?.value.set(this.value());\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected onMonthClickEffect = 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 nativePickerEnabled =\n tuiInjectElement<HTMLInputElement>().type === 'month' && inject(TUI_IS_MOBILE);\n\n protected clear(): void {\n this.onChange(null);\n this.open.set(this.dropdownEnabled());\n }\n}\n","import {NgIf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TuiControl} from '@taiga-ui/cdk/classes';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TuiTextfieldContent} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputMonthDirective} from '../input-month.directive';\n\n@Component({\n standalone: true,\n selector: 'input[tuiInputMonth][type=\"month\"]',\n imports: [NgIf, TuiTextfieldContent],\n templateUrl: './native-month-picker.template.html',\n styleUrls: ['./native-month-picker.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n ngSkipHydration: 'true',\n '[type]': '\"text\"',\n },\n})\nexport class TuiNativeMonthPicker {\n private readonly control = inject(TuiControl);\n\n protected readonly host = inject(TuiInputMonthDirective);\n protected readonly min = signal<TuiMonth | null>(null);\n protected readonly max = signal<TuiMonth | null>(null);\n protected readonly calendarSync = effect(() => {\n const calendar = this.host.calendar();\n\n if (calendar) {\n calendar.min.set(this.min() ?? TUI_FIRST_DAY); // TODO(v5): remove TUI_FIRST_DAY fallback\n calendar.max.set(this.max() ?? TUI_LAST_DAY); // TODO(v5): remove TUI_LAST_DAY fallback\n }\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n // TODO(v5): use signal inputs\n @Input('min')\n public set minSetter(x: TuiMonth | null) {\n this.min.set(x);\n }\n\n // TODO(v5): use signal inputs\n @Input('max')\n public set maxSetter(x: TuiMonth | null) {\n this.max.set(x);\n }\n\n protected onInput(value: string): void {\n if (!value) {\n return this.control.onChange(null);\n }\n\n const [year = 0, month = 0] = value.split('-').map(Number);\n\n this.control.onChange(new TuiMonth(year, month - 1));\n }\n}\n","<ng-container *ngIf=\"host.nativePickerEnabled\">\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 (mousedown.stop.zoneless)=\"(0)\"\n />\n</ng-container>\n","import {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthDirective} from './input-month.directive';\nimport {TuiNativeMonthPicker} from './native-month-picker/native-month-picker.component';\n\nexport const TuiInputMonth = [\n TuiInputMonthDirective,\n TuiCalendarMonth,\n TuiNativeMonthPicker,\n] as const;\n","import type {InjectionToken} from '@angular/core';\nimport type {TuiHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';\n\n/**\n * @deprecated use {@link TuiInputDateOptions} instead\n */\nexport interface TuiInputMonthOptions {\n readonly icon: TuiHandler<TuiSizeL | TuiSizeS, string>;\n}\n\n/**\n * @deprecated use {@link TUI_INPUT_DATE_DEFAULT_OPTIONS} instead\n */\nexport const TUI_INPUT_MONTH_DEFAULT_OPTIONS: TuiInputMonthOptions = {\n icon: () => '@tui.calendar',\n};\n\nconst options = tuiCreateOptions(TUI_INPUT_MONTH_DEFAULT_OPTIONS);\n\n/**\n * @deprecated use {@link TUI_INPUT_DATE_OPTIONS} instead\n */\nexport const TUI_INPUT_MONTH_OPTIONS: InjectionToken<TuiInputMonthOptions> = options[0];\n\n/**\n * @deprecated use {@link tuiInputDateOptionsProvider} instead\n */\nexport const tuiInputMonthOptionsProvider = options[1];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqBA,MAWa,sBAAuB,SAAQ,UAA2B,CAAA;AAXvE,IAAA,WAAA,GAAA;;QAYqB,IAAI,CAAA,IAAA,GAAG,eAAe,EAAE,CAAC;AACzB,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE;AAC/D,YAAA,YAAY,EAAE,MAAM,EAAE;AACzB,SAAA,CAAC,CAAC;AAEgB,QAAA,IAAA,CAAA,IAAI,GAAG,uBAAuB,CAAC,sBAAsB,CAAC,CAAC;AACvD,QAAA,IA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AAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,KAAK,CAAA;gBAOD,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,KAAK,CAAA;;;AE/CH,MAAA,aAAa,GAAG;IACzB,sBAAsB;IACtB,gBAAgB;IAChB,oBAAoB;;;ACIxB;;AAEG;AACU,MAAA,+BAA+B,GAAyB;AACjE,IAAA,IAAI,EAAE,MAAM,eAAe;EAC7B;AAEF,MAAM,OAAO,GAAG,gBAAgB,CAAC,+BAA+B,CAAC,CAAC;AAElE;;AAEG;MACU,uBAAuB,GAAyC,OAAO,CAAC,CAAC,EAAE;AAExF;;AAEG;MACU,4BAA4B,GAAG,OAAO,CAAC,CAAC;;AC7BrD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-month.mjs","sources":["../../../projects/kit/components/input-month/input-month.directive.ts","../../../projects/kit/components/input-month/native-month-picker/native-month-picker.component.ts","../../../projects/kit/components/input-month/native-month-picker/native-month-picker.template.html","../../../projects/kit/components/input-month/input-month.ts","../../../projects/kit/components/input-month/input-month.options.ts","../../../projects/kit/components/input-month/taiga-ui-kit-components-input-month.ts"],"sourcesContent":["import {computed, Directive, effect, inject} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {tuiAsControl, TuiControl} from '@taiga-ui/cdk/classes';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport type {TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n TuiTextfieldDirective,\n tuiTextfieldIconBinding,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n tuiDropdownOpen,\n} from '@taiga-ui/core/directives/dropdown';\nimport {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\nimport {TUI_INPUT_DATE_OPTIONS, TUI_MONTH_FORMATTER} from '@taiga-ui/kit/tokens';\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputMonth]',\n providers: [tuiAsControl(TuiInputMonthDirective)],\n hostDirectives: [TuiWithTextfield, TuiSelectLike, TuiDropdownAuto],\n host: {\n '[disabled]': 'disabled()',\n '(blur)': 'onTouched()',\n '(input)': '$event.inputType?.includes(\"delete\") && clear()',\n },\n})\nexport class TuiInputMonthDirective extends TuiControl<TuiMonth | null> {\n private readonly textfield = inject(TuiTextfieldDirective);\n private readonly formatter = toSignal(inject(TUI_MONTH_FORMATTER));\n private readonly open = tuiDropdownOpen();\n\n protected readonly icon = tuiTextfieldIconBinding(TUI_INPUT_DATE_OPTIONS);\n protected readonly dropdownEnabled = tuiDropdownEnabled(\n computed(() => !this.nativePickerEnabled && this.interactive()),\n );\n\n protected readonly valueEffect = effect(() => {\n this.textfield.value.set(this.formatter()?.(this.value()) || '');\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected readonly calendarSync = effect(() => {\n this.calendar()?.value.set(this.value());\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n protected onMonthClickEffect = 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 nativePickerEnabled =\n tuiInjectElement<HTMLInputElement>().type === 'month' && inject(TUI_IS_MOBILE);\n\n protected clear(): void {\n this.onChange(null);\n this.open.set(this.dropdownEnabled());\n }\n}\n","import {NgIf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TuiControl} from '@taiga-ui/cdk/classes';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TuiTextfieldContent} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputMonthDirective} from '../input-month.directive';\n\n@Component({\n standalone: true,\n selector: 'input[tuiInputMonth][type=\"month\"]',\n imports: [NgIf, TuiTextfieldContent],\n templateUrl: './native-month-picker.template.html',\n styleUrls: ['./native-month-picker.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n ngSkipHydration: 'true',\n '[type]': '\"text\"',\n },\n})\nexport class TuiNativeMonthPicker {\n private readonly control = inject(TuiControl);\n\n protected readonly host = inject(TuiInputMonthDirective);\n protected readonly min = signal<TuiMonth | null>(null);\n protected readonly max = signal<TuiMonth | null>(null);\n protected readonly calendarSync = effect(() => {\n const calendar = this.host.calendar();\n\n if (calendar) {\n calendar.min.set(this.min() ?? TUI_FIRST_DAY); // TODO(v5): remove TUI_FIRST_DAY fallback\n calendar.max.set(this.max() ?? TUI_LAST_DAY); // TODO(v5): remove TUI_LAST_DAY fallback\n }\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n // TODO(v5): use signal inputs\n @Input('min')\n public set minSetter(x: TuiMonth | null) {\n this.min.set(x);\n }\n\n // TODO(v5): use signal inputs\n @Input('max')\n public set maxSetter(x: TuiMonth | null) {\n this.max.set(x);\n }\n\n protected onInput(value: string): void {\n if (!value) {\n return this.control.onChange(null);\n }\n\n const [year = 0, month = 0] = value.split('-').map(Number);\n\n this.control.onChange(new TuiMonth(year, month - 1));\n }\n}\n","<ng-container *ngIf=\"host.nativePickerEnabled\">\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 (mousedown.stop.zoneless)=\"(0)\"\n />\n</ng-container>\n","import {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthDirective} from './input-month.directive';\nimport {TuiNativeMonthPicker} from './native-month-picker/native-month-picker.component';\n\nexport const TuiInputMonth = [\n TuiInputMonthDirective,\n TuiCalendarMonth,\n TuiNativeMonthPicker,\n] as const;\n","import type {InjectionToken} from '@angular/core';\nimport type {TuiHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';\n\n/**\n * @deprecated use {@link TuiInputDateOptions} instead\n */\nexport interface TuiInputMonthOptions {\n readonly icon: TuiHandler<TuiSizeL | TuiSizeS, string>;\n}\n\n/**\n * @deprecated use {@link TUI_INPUT_DATE_DEFAULT_OPTIONS} instead\n */\nexport const TUI_INPUT_MONTH_DEFAULT_OPTIONS: TuiInputMonthOptions = {\n icon: () => '@tui.calendar',\n};\n\nconst options = tuiCreateOptions(TUI_INPUT_MONTH_DEFAULT_OPTIONS);\n\n/**\n * @deprecated use {@link TUI_INPUT_DATE_OPTIONS} instead\n */\nexport const TUI_INPUT_MONTH_OPTIONS: InjectionToken<TuiInputMonthOptions> = options[0];\n\n/**\n * @deprecated use {@link tuiInputDateOptionsProvider} instead\n */\nexport const tuiInputMonthOptionsProvider = options[1];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAsBA,MAWa,sBAAuB,SAAQ,UAA2B,CAAA;AAXvE,IAAA,WAAA,GAAA;;AAYqB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC1C,IAAS,CAAA,SAAA,GAAG,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAClD,IAAI,CAAA,IAAA,GAAG,eAAe,EAAE,CAAC;AAEvB,QAAA,IAAA,CAAA,IAAI,GAAG,uBAAu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BAAA,QAAQ,EAAE,QAAQ;AACrB,qBAAA,EAAA,QAAA,EAAA,4YAAA,EAAA,MAAA,EAAA,CAAA,yXAAA,CAAA,EAAA,CAAA;8BAmBU,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,KAAK,CAAA;gBAOD,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,KAAK,CAAA;;;AE/CH,MAAA,aAAa,GAAG;IACzB,sBAAsB;IACtB,gBAAgB;IAChB,oBAAoB;;;ACIxB;;AAEG;AACU,MAAA,+BAA+B,GAAyB;AACjE,IAAA,IAAI,EAAE,MAAM,eAAe;EAC7B;AAEF,MAAM,OAAO,GAAG,gBAAgB,CAAC,+BAA+B,CAAC,CAAC;AAElE;;AAEG;MACU,uBAAuB,GAAyC,OAAO,CAAC,CAAC,EAAE;AAExF;;AAEG;MACU,4BAA4B,GAAG,OAAO,CAAC,CAAC;;AC7BrD;;AAEG;;;;"}
|
|
@@ -8,10 +8,10 @@ import { maskitoParseNumber, maskitoNumberOptionsGenerator, maskitoCaretGuard }
|
|
|
8
8
|
import { TuiControl, tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
|
|
9
9
|
import { TUI_ALLOW_SIGNAL_WRITES, CHAR_MINUS, CHAR_HYPHEN } from '@taiga-ui/cdk/constants';
|
|
10
10
|
import { TUI_IS_IOS, tuiFallbackValueProvider } from '@taiga-ui/cdk/tokens';
|
|
11
|
-
import { tuiInjectElement
|
|
11
|
+
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
12
12
|
import { tuiIsSafeToRound, tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
13
13
|
import * as i1 from '@taiga-ui/core/components/textfield';
|
|
14
|
-
import { TuiWithTextfield, TUI_TEXTFIELD_OPTIONS, TuiTextfieldContent } from '@taiga-ui/core/components/textfield';
|
|
14
|
+
import { TuiTextfieldDirective, TuiWithTextfield, TUI_TEXTFIELD_OPTIONS, TuiTextfieldContent } from '@taiga-ui/core/components/textfield';
|
|
15
15
|
import { TUI_NUMBER_FORMAT, TUI_DEFAULT_NUMBER_FORMAT } from '@taiga-ui/core/tokens';
|
|
16
16
|
import { tuiFormatNumber } from '@taiga-ui/core/utils/format';
|
|
17
17
|
import { tuiMaskito } from '@taiga-ui/kit/utils';
|
|
@@ -39,22 +39,21 @@ const DEFAULT_MAX_LENGTH = 18;
|
|
|
39
39
|
class TuiInputNumberDirective extends TuiControl {
|
|
40
40
|
constructor() {
|
|
41
41
|
super(...arguments);
|
|
42
|
+
this.textfield = inject(TuiTextfieldDirective);
|
|
42
43
|
this.isIOS = inject(TUI_IS_IOS);
|
|
43
44
|
this.numberFormat = toSignal(inject(TUI_NUMBER_FORMAT), {
|
|
44
45
|
initialValue: TUI_DEFAULT_NUMBER_FORMAT,
|
|
45
46
|
});
|
|
47
|
+
this.formatted = computed(() => maskitoParseNumber(this.textfield.value(), this.numberFormat().decimalSeparator));
|
|
46
48
|
this.precision = computed(() => Number.isNaN(this.numberFormat().precision) ? 2 : this.numberFormat().precision);
|
|
47
|
-
this.
|
|
48
|
-
const value = maskitoParseNumber(this.textfieldValue(), this.numberFormat().decimalSeparator);
|
|
49
|
-
return value < 0 ? value > this.max() : value < this.min();
|
|
50
|
-
});
|
|
49
|
+
this.unfinished = computed((value = this.formatted()) => value < 0 ? value > this.max() : value < this.min());
|
|
51
50
|
this.onChangeEffect = effect(() => {
|
|
52
|
-
const value =
|
|
51
|
+
const value = this.formatted();
|
|
53
52
|
if (Number.isNaN(value)) {
|
|
54
53
|
this.onChange(null);
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
|
-
if (this.
|
|
56
|
+
if (this.unfinished() ||
|
|
58
57
|
value < this.min() ||
|
|
59
58
|
value > this.max() ||
|
|
60
59
|
this.value() === value) {
|
|
@@ -64,7 +63,6 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
64
63
|
}, TUI_ALLOW_SIGNAL_WRITES);
|
|
65
64
|
this.options = inject(TUI_INPUT_NUMBER_OPTIONS);
|
|
66
65
|
this.element = tuiInjectElement();
|
|
67
|
-
this.textfieldValue = tuiValueBinding();
|
|
68
66
|
this.inputMode = computed(() => {
|
|
69
67
|
if (this.isIOS && this.min() < 0) {
|
|
70
68
|
// iPhone does not have minus sign if inputMode is equal to 'numeric' / 'decimal'
|
|
@@ -74,7 +72,7 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
74
72
|
});
|
|
75
73
|
this.defaultMaxLength = computed(() => {
|
|
76
74
|
const { decimalSeparator, thousandSeparator } = this.numberFormat();
|
|
77
|
-
const decimalPart = !!this.precision() && this.
|
|
75
|
+
const decimalPart = !!this.precision() && this.textfield.value().includes(decimalSeparator);
|
|
78
76
|
const precision = decimalPart ? Math.min(this.precision() + 1, 20) : 0;
|
|
79
77
|
const takeThousand = thousandSeparator.repeat(5).length;
|
|
80
78
|
return DEFAULT_MAX_LENGTH + precision + takeThousand;
|
|
@@ -108,22 +106,21 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
108
106
|
this.postfix.set(x);
|
|
109
107
|
}
|
|
110
108
|
writeValue(value) {
|
|
111
|
-
super.writeValue(
|
|
109
|
+
super.writeValue(value);
|
|
112
110
|
this.setValue(this.value());
|
|
113
111
|
}
|
|
114
112
|
setValue(value) {
|
|
115
|
-
this.
|
|
113
|
+
this.textfield.value.set(this.formatNumber(value));
|
|
116
114
|
}
|
|
117
115
|
onBlur() {
|
|
118
116
|
this.onTouched();
|
|
119
|
-
if (!this.
|
|
117
|
+
if (!this.unfinished()) {
|
|
120
118
|
this.setValue(this.value());
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
onFocus() {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.textfieldValue.set(this.prefix() + this.postfix());
|
|
122
|
+
if (Number.isNaN(this.formatted()) && !this.readOnly()) {
|
|
123
|
+
this.textfield.value.set(this.prefix() + this.postfix());
|
|
127
124
|
}
|
|
128
125
|
}
|
|
129
126
|
formatNumber(value) {
|
|
@@ -176,7 +173,7 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
176
173
|
};
|
|
177
174
|
}
|
|
178
175
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputNumberDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
179
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputNumberDirective, isStandalone: true, selector: "input[tuiInputNumber]", inputs: { minSetter: ["min", "minSetter"], maxSetter: ["max", "maxSetter"], prefixSetter: ["prefix", "prefixSetter"], postfixSetter: ["postfix", "postfixSetter"] }, host: { listeners: { "
|
|
176
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputNumberDirective, isStandalone: true, selector: "input[tuiInputNumber]", inputs: { minSetter: ["min", "minSetter"], maxSetter: ["max", "maxSetter"], prefixSetter: ["prefix", "prefixSetter"], postfixSetter: ["postfix", "postfixSetter"] }, host: { listeners: { "blur": "onBlur()", "focus": "onFocus()" }, properties: { "disabled": "disabled()", "attr.inputMode": "inputMode()", "attr.maxLength": "element.maxLength > 0 ? element.maxLength : defaultMaxLength()" } }, providers: [
|
|
180
177
|
tuiAsControl(TuiInputNumberDirective),
|
|
181
178
|
tuiFallbackValueProvider(null),
|
|
182
179
|
tuiValueTransformerFrom(TUI_INPUT_NUMBER_OPTIONS),
|
|
@@ -197,7 +194,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
197
194
|
'[disabled]': 'disabled()',
|
|
198
195
|
'[attr.inputMode]': 'inputMode()',
|
|
199
196
|
'[attr.maxLength]': 'element.maxLength > 0 ? element.maxLength : defaultMaxLength()',
|
|
200
|
-
'(input)': 'textfieldValue.set(element.value)',
|
|
201
197
|
'(blur)': 'onBlur()',
|
|
202
198
|
'(focus)': 'onFocus()',
|
|
203
199
|
},
|
|
@@ -220,31 +216,32 @@ class TuiInputNumberStep {
|
|
|
220
216
|
constructor() {
|
|
221
217
|
this.destroyRef = inject(DestroyRef);
|
|
222
218
|
this.zone = inject(NgZone);
|
|
223
|
-
this.
|
|
224
|
-
this.
|
|
219
|
+
this.el = tuiInjectElement();
|
|
220
|
+
this.appearance = inject(TUI_TEXTFIELD_OPTIONS).appearance;
|
|
225
221
|
this.options = inject(TUI_INPUT_NUMBER_OPTIONS);
|
|
226
|
-
this.
|
|
222
|
+
this.input = inject(TuiInputNumberDirective, { self: true });
|
|
227
223
|
this.step = signal(this.options.step);
|
|
224
|
+
this.value = computed(() => this.input.value() ?? NaN);
|
|
228
225
|
}
|
|
229
226
|
// TODO(v5): replace with signal input
|
|
230
227
|
set stepSetter(x) {
|
|
231
228
|
this.step.set(x);
|
|
232
229
|
}
|
|
233
230
|
onStep(step) {
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
if (this.
|
|
231
|
+
const current = Number.isNaN(this.value()) ? 0 : this.value();
|
|
232
|
+
const value = tuiClamp(current + step, this.input.min(), this.input.max());
|
|
233
|
+
if (Number.isNaN(this.value())) {
|
|
237
234
|
timer(0)
|
|
238
235
|
.pipe(tuiZonefree(this.zone), takeUntilDestroyed(this.destroyRef))
|
|
239
236
|
.subscribe(() => {
|
|
240
|
-
const caretIndex = this.
|
|
241
|
-
this.
|
|
237
|
+
const caretIndex = this.el.value.length - this.input.postfix().length;
|
|
238
|
+
this.el.setSelectionRange(caretIndex, caretIndex);
|
|
242
239
|
});
|
|
243
240
|
}
|
|
244
|
-
this.
|
|
241
|
+
this.input.setValue(value);
|
|
245
242
|
}
|
|
246
243
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputNumberStep, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
247
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputNumberStep, isStandalone: true, selector: "input[tuiInputNumber][step]", inputs: { stepSetter: ["step", "stepSetter"] }, host: { attributes: { "ngSkipHydration": "true" }, listeners: { "keydown.arrowDown.prevent": "onStep(-step())", "keydown.arrowUp.prevent": "onStep(step())" }, properties: { "class._with-buttons": "step()" } }, ngImport: i0, template: "<ng-container *tuiTextfieldContent>\n <section\n *ngIf=\"step()\"\n class=\"t-input-number-buttons\"\n >\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"
|
|
244
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputNumberStep, isStandalone: true, selector: "input[tuiInputNumber][step]", inputs: { stepSetter: ["step", "stepSetter"] }, host: { attributes: { "ngSkipHydration": "true" }, listeners: { "keydown.arrowDown.prevent": "onStep(-step())", "keydown.arrowUp.prevent": "onStep(step())" }, properties: { "class._with-buttons": "step()" } }, ngImport: i0, template: "<ng-container *tuiTextfieldContent>\n <section\n *ngIf=\"step()\"\n class=\"t-input-number-buttons\"\n >\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() >= input.max()\"\n [iconStart]=\"options.icons.increase\"\n (click.prevent)=\"onStep(step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n +\n </button>\n\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() <= input.min()\"\n [iconStart]=\"options.icons.decrease\"\n (click.prevent)=\"onStep(-step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n -\n </button>\n </section>\n</ng-container>\n", styles: [".t-input-number-buttons.t-input-number-buttons{position:absolute;right:0;display:flex;block-size:var(--t-height);flex-direction:column;gap:.125rem;border-radius:inherit}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons{flex-direction:row-reverse}.t-input-number-buttons.t-input-number-buttons>*{flex:1 1 0;border-radius:0}.t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit}.t-input-number-buttons.t-input-number-buttons>*:last-child{border-bottom-right-radius:inherit}tui-textfield[data-size=l] .t-input-number-buttons.t-input-number-buttons>*{inline-size:var(--tui-height-m)}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0}[tuiInputNumber]._with-buttons{border-top-right-radius:0;border-bottom-right-radius:0}tui-textfield[data-size=l]{--t-input-number-offset-end: calc(var(--tui-height-m) + .125rem)}tui-textfield[data-size=m]{--t-input-number-offset-end: calc(var(--tui-height-s) + .125rem)}tui-textfield[data-size=s]{--t-input-number-offset-end: calc(2 * var(--tui-height-s) + .25rem)}[tuiInputNumber]._with-buttons,[tuiInputNumber]._with-buttons~.t-template{inline-size:calc(100% - var(--t-input-number-offset-end))}[tuiInputNumber]._with-buttons~.t-content{margin-inline-end:var(--t-input-number-offset-end)}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
248
245
|
}
|
|
249
246
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputNumberStep, decorators: [{
|
|
250
247
|
type: Component,
|
|
@@ -253,7 +250,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
253
250
|
'(keydown.arrowDown.prevent)': 'onStep(-step())',
|
|
254
251
|
'(keydown.arrowUp.prevent)': 'onStep(step())',
|
|
255
252
|
'[class._with-buttons]': 'step()',
|
|
256
|
-
}, template: "<ng-container *tuiTextfieldContent>\n <section\n *ngIf=\"step()\"\n class=\"t-input-number-buttons\"\n >\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"
|
|
253
|
+
}, template: "<ng-container *tuiTextfieldContent>\n <section\n *ngIf=\"step()\"\n class=\"t-input-number-buttons\"\n >\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() >= input.max()\"\n [iconStart]=\"options.icons.increase\"\n (click.prevent)=\"onStep(step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n +\n </button>\n\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || value() <= input.min()\"\n [iconStart]=\"options.icons.decrease\"\n (click.prevent)=\"onStep(-step())\"\n (mousedown.prevent)=\"el.focus()\"\n >\n -\n </button>\n </section>\n</ng-container>\n", styles: [".t-input-number-buttons.t-input-number-buttons{position:absolute;right:0;display:flex;block-size:var(--t-height);flex-direction:column;gap:.125rem;border-radius:inherit}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons{flex-direction:row-reverse}.t-input-number-buttons.t-input-number-buttons>*{flex:1 1 0;border-radius:0}.t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit}.t-input-number-buttons.t-input-number-buttons>*:last-child{border-bottom-right-radius:inherit}tui-textfield[data-size=l] .t-input-number-buttons.t-input-number-buttons>*{inline-size:var(--tui-height-m)}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit;border-bottom-right-radius:inherit}tui-textfield[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0}[tuiInputNumber]._with-buttons{border-top-right-radius:0;border-bottom-right-radius:0}tui-textfield[data-size=l]{--t-input-number-offset-end: calc(var(--tui-height-m) + .125rem)}tui-textfield[data-size=m]{--t-input-number-offset-end: calc(var(--tui-height-s) + .125rem)}tui-textfield[data-size=s]{--t-input-number-offset-end: calc(2 * var(--tui-height-s) + .25rem)}[tuiInputNumber]._with-buttons,[tuiInputNumber]._with-buttons~.t-template{inline-size:calc(100% - var(--t-input-number-offset-end))}[tuiInputNumber]._with-buttons~.t-content{margin-inline-end:var(--t-input-number-offset-end)}\n"] }]
|
|
257
254
|
}], propDecorators: { stepSetter: [{
|
|
258
255
|
type: Input,
|
|
259
256
|
args: ['step']
|