@taiga-ui/kit 5.0.0-rc.5 → 5.1.0
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/copy/copy.component.d.ts +3 -1
- package/components/copy/copy.options.d.ts +7 -1
- package/components/counter/counter.component.d.ts +1 -1
- package/components/files/input-files/input-files.component.d.ts +4 -1
- package/components/files/input-files/input-files.directive.d.ts +1 -0
- package/components/input-number/index.d.ts +1 -0
- package/components/input-number/input-number.d.ts +1 -1
- package/components/input-number/step/input-number-step.component.d.ts +9 -11
- package/components/input-number/step/input-number-step.directive.d.ts +12 -0
- package/components/input-number/step/input-number-step.service.d.ts +0 -1
- package/components/input-pin/input-pin.component.d.ts +0 -1
- package/components/radio-list/radio-list.component.d.ts +1 -5
- package/components/tree/components/tree/tree.component.d.ts +1 -3
- package/directives/password/password.options.d.ts +16 -1
- 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 +3 -3
- 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-badged-content.mjs.map +1 -1
- 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 +3 -3
- 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 +4 -4
- 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 +4 -4
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-comment.mjs +8 -7
- package/fesm2022/taiga-ui-kit-components-comment.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-compass.mjs +5 -5
- 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 +14 -12
- package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-counter.mjs +13 -14
- package/fesm2022/taiga-ui-kit-components-counter.mjs.map +1 -1
- 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 +38 -27
- 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-fullscreen.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-input-color.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-multi.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date.mjs +10 -10
- 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 +10 -8
- package/fesm2022/taiga-ui-kit-components-input-month-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month.mjs +7 -7
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +82 -61
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +9 -10
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs +5 -5
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs +4 -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 +11 -11
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-time.mjs +13 -13
- package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-year.mjs +3 -3
- 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 +12 -12
- 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-preview.mjs +26 -26
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-progress.mjs +29 -29
- 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 +7 -9
- package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
- 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 +8 -8
- 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 +7 -7
- package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
- 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 +24 -21
- 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 +16 -16
- 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-components-tree.mjs.map +1 -1
- 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 +4 -4
- package/fesm2022/taiga-ui-kit-directives-data-list-dropdown-manager.mjs.map +1 -1
- 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-password.mjs.map +1 -1
- 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 +8 -8
- package/fesm2022/taiga-ui-kit-directives-shimmer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +8 -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 +4 -4
- package/fesm2022/taiga-ui-kit-pipes-emails.mjs.map +1 -1
- 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/package.json +19 -19
|
@@ -11,12 +11,12 @@ class TuiInputInline {
|
|
|
11
11
|
this.control = contentChild(NgControl);
|
|
12
12
|
this.value = toSignal(toObservable(this.control).pipe(switchMap(tuiControlValue)));
|
|
13
13
|
}
|
|
14
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
15
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputInline, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TuiInputInline, isStandalone: true, selector: "tui-input-inline", host: { attributes: { "data-tui-version": "5.1.0" } }, queries: [{ propertyName: "control", first: true, predicate: NgControl, descendants: true, isSignal: true }], ngImport: i0, template: "<span\n class=\"t-before\"\n [textContent]=\"value()\"\n></span>\n\n@if (!value()) {\n <span\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n}\n<ng-content select=\"input\" />\n", styles: ["tui-input-inline:where(*[data-tui-version=\"5.1.0\"]){position:relative;display:inline-block;white-space:nowrap;box-sizing:border-box}tui-input-inline:where(*[data-tui-version=\"5.1.0\"])>.t-before{padding-inline-end:.02em;margin-inline-start:1px;white-space:pre;visibility:hidden}tui-input-inline:where(*[data-tui-version=\"5.1.0\"])>.t-placeholder{display:inline-block;min-inline-size:1px;margin-inline-start:-1px}tui-input-inline:where(*[data-tui-version=\"5.1.0\"])>input{position:absolute;inset-block-start:0;inset-inline-start:0;background-color:transparent;padding:inherit;font:inherit;color:inherit;box-sizing:border-box;inline-size:100%;block-size:100%;border-width:0;text-align:inherit;letter-spacing:inherit;text-indent:inherit;text-transform:inherit;outline:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
16
16
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputInline, decorators: [{
|
|
18
18
|
type: Component,
|
|
19
|
-
args: [{ selector: 'tui-input-inline', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { 'data-tui-version': TUI_VERSION }, template: "<span\n class=\"t-before\"\n [textContent]=\"value()\"\n></span>\n\n@if (!value()) {\n <span\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n}\n<ng-content select=\"input\" />\n", styles: ["tui-input-inline:where(*[data-tui-version=\"5.
|
|
19
|
+
args: [{ selector: 'tui-input-inline', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { 'data-tui-version': TUI_VERSION }, template: "<span\n class=\"t-before\"\n [textContent]=\"value()\"\n></span>\n\n@if (!value()) {\n <span\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n}\n<ng-content select=\"input\" />\n", styles: ["tui-input-inline:where(*[data-tui-version=\"5.1.0\"]){position:relative;display:inline-block;white-space:nowrap;box-sizing:border-box}tui-input-inline:where(*[data-tui-version=\"5.1.0\"])>.t-before{padding-inline-end:.02em;margin-inline-start:1px;white-space:pre;visibility:hidden}tui-input-inline:where(*[data-tui-version=\"5.1.0\"])>.t-placeholder{display:inline-block;min-inline-size:1px;margin-inline-start:-1px}tui-input-inline:where(*[data-tui-version=\"5.1.0\"])>input{position:absolute;inset-block-start:0;inset-inline-start:0;background-color:transparent;padding:inherit;font:inherit;color:inherit;box-sizing:border-box;inline-size:100%;block-size:100%;border-width:0;text-align:inherit;letter-spacing:inherit;text-indent:inherit;text-transform:inherit;outline:none}\n"] }]
|
|
20
20
|
}] });
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-inline.mjs","sources":["../../../projects/kit/components/input-inline/input-inline.component.ts","../../../projects/kit/components/input-inline/input-inline.template.html","../../../projects/kit/components/input-inline/taiga-ui-kit-components-input-inline.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n contentChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {toObservable, toSignal} from '@angular/core/rxjs-interop';\nimport {NgControl} from '@angular/forms';\nimport {TUI_VERSION} from '@taiga-ui/cdk/constants';\nimport {tuiControlValue} from '@taiga-ui/cdk/observables';\nimport {switchMap} from 'rxjs';\n\n@Component({\n selector: 'tui-input-inline',\n templateUrl: './input-inline.template.html',\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import './input-inline.style.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {'data-tui-version': TUI_VERSION},\n})\nexport class TuiInputInline {\n protected readonly control = contentChild(NgControl);\n protected readonly value = toSignal(\n toObservable(this.control).pipe(switchMap(tuiControlValue)),\n );\n}\n","<span\n class=\"t-before\"\n [textContent]=\"value()\"\n></span>\n\n@if (!value()) {\n <span\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n}\n<ng-content select=\"input\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAwBa,cAAc,CAAA;AAZ3B,IAAA,WAAA,GAAA;AAauB,QAAA,IAAA,CAAA,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC;AACjC,QAAA,IAAA,CAAA,KAAK,GAAG,QAAQ,CAC/B,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAC9D;AACJ,IAAA;+GALY,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,kBAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-inline.mjs","sources":["../../../projects/kit/components/input-inline/input-inline.component.ts","../../../projects/kit/components/input-inline/input-inline.template.html","../../../projects/kit/components/input-inline/taiga-ui-kit-components-input-inline.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n contentChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {toObservable, toSignal} from '@angular/core/rxjs-interop';\nimport {NgControl} from '@angular/forms';\nimport {TUI_VERSION} from '@taiga-ui/cdk/constants';\nimport {tuiControlValue} from '@taiga-ui/cdk/observables';\nimport {switchMap} from 'rxjs';\n\n@Component({\n selector: 'tui-input-inline',\n templateUrl: './input-inline.template.html',\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import './input-inline.style.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {'data-tui-version': TUI_VERSION},\n})\nexport class TuiInputInline {\n protected readonly control = contentChild(NgControl);\n protected readonly value = toSignal(\n toObservable(this.control).pipe(switchMap(tuiControlValue)),\n );\n}\n","<span\n class=\"t-before\"\n [textContent]=\"value()\"\n></span>\n\n@if (!value()) {\n <span\n automation-id=\"tui-input-inline__placeholder\"\n class=\"t-placeholder\"\n >\n <ng-content />\n </span>\n}\n<ng-content select=\"input\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAwBa,cAAc,CAAA;AAZ3B,IAAA,WAAA,GAAA;AAauB,QAAA,IAAA,CAAA,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC;AACjC,QAAA,IAAA,CAAA,KAAK,GAAG,QAAQ,CAC/B,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAC9D;AACJ,IAAA;+GALY,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,kBAAA,EAAA,OAAA,EAAA,EAAA,EAAA,OAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EACmB,SAAS,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECzBvD,mRAcA,EAAA,MAAA,EAAA,CAAA,2wBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;4FDUa,cAAc,EAAA,UAAA,EAAA,CAAA;kBAZ1B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,aAAA,EAOb,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC,EAAC,kBAAkB,EAAE,WAAW,EAAC,EAAA,QAAA,EAAA,mRAAA,EAAA,MAAA,EAAA,CAAA,2wBAAA,CAAA,EAAA;;;AEtB3C;;AAEG;;;;"}
|
|
@@ -39,7 +39,9 @@ class TuiInputMonthRangeDirective extends TuiControl {
|
|
|
39
39
|
const value = this.value();
|
|
40
40
|
const months = this.months();
|
|
41
41
|
const format = ({ month, formattedYear }) => `${months[month] ?? ''} ${formattedYear}`;
|
|
42
|
-
this.input.value.set(value
|
|
42
|
+
this.input.value.set(value
|
|
43
|
+
? `${format(value.from)}${RANGE_SEPARATOR_CHAR}${format(value.to)}`
|
|
44
|
+
: '');
|
|
43
45
|
});
|
|
44
46
|
this.calendarInit = effect(() => {
|
|
45
47
|
const calendar = this.calendar();
|
|
@@ -59,13 +61,13 @@ class TuiInputMonthRangeDirective extends TuiControl {
|
|
|
59
61
|
this.onMonthClickEffect = effect((onCleanup) => {
|
|
60
62
|
const subscription = this.calendar()?.monthClick.subscribe((month) => {
|
|
61
63
|
const intermediateValue = this.intermediateValue();
|
|
62
|
-
if (
|
|
63
|
-
this.intermediateValue.set(month);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
64
|
+
if (intermediateValue) {
|
|
66
65
|
this.onChange(TuiMonthRange.sort(intermediateValue, month));
|
|
67
66
|
this.open.set(false);
|
|
68
67
|
}
|
|
68
|
+
else {
|
|
69
|
+
this.intermediateValue.set(month);
|
|
70
|
+
}
|
|
69
71
|
});
|
|
70
72
|
onCleanup(() => subscription?.unsubscribe());
|
|
71
73
|
});
|
|
@@ -74,13 +76,13 @@ class TuiInputMonthRangeDirective extends TuiControl {
|
|
|
74
76
|
this.onChange(null);
|
|
75
77
|
this.open.set(true);
|
|
76
78
|
}
|
|
77
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
78
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
79
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputMonthRangeDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
80
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.20", type: TuiInputMonthRangeDirective, isStandalone: true, selector: "input[tuiInputMonthRange]", host: { listeners: { "input": "$event.inputType?.includes(\"delete\") && clear()" }, properties: { "disabled": "disabled()" } }, providers: [
|
|
79
81
|
tuiAsControl(TuiInputMonthRangeDirective),
|
|
80
82
|
tuiValueTransformerFrom(TUI_INPUT_MONTH_RANGE_OPTIONS),
|
|
81
83
|
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.TuiSelectLike }, { directive: i3.TuiDropdownAuto }], ngImport: i0 }); }
|
|
82
84
|
}
|
|
83
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
85
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputMonthRangeDirective, decorators: [{
|
|
84
86
|
type: Directive,
|
|
85
87
|
args: [{
|
|
86
88
|
selector: 'input[tuiInputMonthRange]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-month-range.mjs","sources":["../../../projects/kit/components/input-month-range/input-month-range.options.ts","../../../projects/kit/components/input-month-range/input-month-range.directive.ts","../../../projects/kit/components/input-month-range/input-month-range.ts","../../../projects/kit/components/input-month-range/taiga-ui-kit-components-input-month-range.ts"],"sourcesContent":["import {type FactoryProvider, inject, InjectionToken} from '@angular/core';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {type TuiMonthRange} from '@taiga-ui/cdk/date-time';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/di';\nimport {TUI_INPUT_DATE_DEFAULT_OPTIONS} from '@taiga-ui/kit/components/input-date';\nimport {TUI_INPUT_MONTH_OPTIONS} from '@taiga-ui/kit/components/input-month';\n\nexport interface TuiInputMonthRangeOptions {\n readonly icon: string;\n readonly valueTransformer: TuiValueTransformer<TuiMonthRange | null, any>;\n}\n\nexport const TUI_INPUT_MONTH_RANGE_OPTIONS =\n new InjectionToken<TuiInputMonthRangeOptions>(\n ngDevMode ? 'TUI_INPUT_MONTH_RANGE_OPTIONS' : '',\n {\n factory: () => ({\n ...inject(TUI_INPUT_MONTH_OPTIONS),\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n }),\n },\n );\n\nexport const tuiInputMonthRangeOptionsProvider = (\n options: Partial<TuiInputMonthRangeOptions>,\n): FactoryProvider =>\n tuiProvideOptions(\n TUI_INPUT_MONTH_RANGE_OPTIONS,\n options,\n TUI_INPUT_DATE_DEFAULT_OPTIONS,\n );\n","import {Directive, effect, inject, signal} from '@angular/core';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {\n RANGE_SEPARATOR_CHAR,\n type TuiMonth,\n TuiMonthRange,\n} from '@taiga-ui/cdk/date-time';\nimport {tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiInputDirective, TuiWithInput} from '@taiga-ui/core/components/input';\nimport {tuiInjectAuxiliary, TuiSelectLike} from '@taiga-ui/core/components/textfield';\nimport {tuiIconEnd} from '@taiga-ui/core/directives/icons';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n TuiDropdownOpen,\n} from '@taiga-ui/core/portals/dropdown';\nimport {TUI_MONTHS} from '@taiga-ui/core/tokens';\nimport {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TUI_INPUT_MONTH_RANGE_OPTIONS} from './input-month-range.options';\n\n@Directive({\n selector: 'input[tuiInputMonthRange]',\n providers: [\n tuiAsControl(TuiInputMonthRangeDirective),\n tuiValueTransformerFrom(TUI_INPUT_MONTH_RANGE_OPTIONS),\n ],\n hostDirectives: [TuiWithInput, TuiSelectLike, TuiDropdownAuto],\n host: {\n '[disabled]': 'disabled()',\n '(input)': '$event.inputType?.includes(\"delete\") && clear()',\n },\n})\nexport class TuiInputMonthRangeDirective extends TuiControl<TuiMonthRange | null> {\n private readonly input = inject(TuiInputDirective);\n private readonly months = inject(TUI_MONTHS);\n private readonly open = inject(TuiDropdownOpen).open;\n private readonly intermediateValue = signal<TuiMonth | null>(null);\n private readonly calendar = tuiInjectAuxiliary<TuiCalendarMonth>(\n (x) => x instanceof TuiCalendarMonth,\n );\n\n protected readonly icon = tuiIconEnd(inject(TUI_INPUT_MONTH_RANGE_OPTIONS).icon);\n protected readonly dropdownEnabled = tuiDropdownEnabled(this.interactive);\n protected readonly valueEffect = effect(() => {\n const value = this.value();\n const months = this.months();\n const format = ({month, formattedYear}: TuiMonth): string =>\n `${months[month] ?? ''} ${formattedYear}`;\n\n this.input.value.set(\n value
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-month-range.mjs","sources":["../../../projects/kit/components/input-month-range/input-month-range.options.ts","../../../projects/kit/components/input-month-range/input-month-range.directive.ts","../../../projects/kit/components/input-month-range/input-month-range.ts","../../../projects/kit/components/input-month-range/taiga-ui-kit-components-input-month-range.ts"],"sourcesContent":["import {type FactoryProvider, inject, InjectionToken} from '@angular/core';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {type TuiMonthRange} from '@taiga-ui/cdk/date-time';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/di';\nimport {TUI_INPUT_DATE_DEFAULT_OPTIONS} from '@taiga-ui/kit/components/input-date';\nimport {TUI_INPUT_MONTH_OPTIONS} from '@taiga-ui/kit/components/input-month';\n\nexport interface TuiInputMonthRangeOptions {\n readonly icon: string;\n readonly valueTransformer: TuiValueTransformer<TuiMonthRange | null, any>;\n}\n\nexport const TUI_INPUT_MONTH_RANGE_OPTIONS =\n new InjectionToken<TuiInputMonthRangeOptions>(\n ngDevMode ? 'TUI_INPUT_MONTH_RANGE_OPTIONS' : '',\n {\n factory: () => ({\n ...inject(TUI_INPUT_MONTH_OPTIONS),\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n }),\n },\n );\n\nexport const tuiInputMonthRangeOptionsProvider = (\n options: Partial<TuiInputMonthRangeOptions>,\n): FactoryProvider =>\n tuiProvideOptions(\n TUI_INPUT_MONTH_RANGE_OPTIONS,\n options,\n TUI_INPUT_DATE_DEFAULT_OPTIONS,\n );\n","import {Directive, effect, inject, signal} from '@angular/core';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {\n RANGE_SEPARATOR_CHAR,\n type TuiMonth,\n TuiMonthRange,\n} from '@taiga-ui/cdk/date-time';\nimport {tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiInputDirective, TuiWithInput} from '@taiga-ui/core/components/input';\nimport {tuiInjectAuxiliary, TuiSelectLike} from '@taiga-ui/core/components/textfield';\nimport {tuiIconEnd} from '@taiga-ui/core/directives/icons';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n TuiDropdownOpen,\n} from '@taiga-ui/core/portals/dropdown';\nimport {TUI_MONTHS} from '@taiga-ui/core/tokens';\nimport {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TUI_INPUT_MONTH_RANGE_OPTIONS} from './input-month-range.options';\n\n@Directive({\n selector: 'input[tuiInputMonthRange]',\n providers: [\n tuiAsControl(TuiInputMonthRangeDirective),\n tuiValueTransformerFrom(TUI_INPUT_MONTH_RANGE_OPTIONS),\n ],\n hostDirectives: [TuiWithInput, TuiSelectLike, TuiDropdownAuto],\n host: {\n '[disabled]': 'disabled()',\n '(input)': '$event.inputType?.includes(\"delete\") && clear()',\n },\n})\nexport class TuiInputMonthRangeDirective extends TuiControl<TuiMonthRange | null> {\n private readonly input = inject(TuiInputDirective);\n private readonly months = inject(TUI_MONTHS);\n private readonly open = inject(TuiDropdownOpen).open;\n private readonly intermediateValue = signal<TuiMonth | null>(null);\n private readonly calendar = tuiInjectAuxiliary<TuiCalendarMonth>(\n (x) => x instanceof TuiCalendarMonth,\n );\n\n protected readonly icon = tuiIconEnd(inject(TUI_INPUT_MONTH_RANGE_OPTIONS).icon);\n protected readonly dropdownEnabled = tuiDropdownEnabled(this.interactive);\n protected readonly valueEffect = effect(() => {\n const value = this.value();\n const months = this.months();\n const format = ({month, formattedYear}: TuiMonth): string =>\n `${months[month] ?? ''} ${formattedYear}`;\n\n this.input.value.set(\n value\n ? `${format(value.from)}${RANGE_SEPARATOR_CHAR}${format(value.to)}`\n : '',\n );\n });\n\n protected readonly calendarInit = effect(() => {\n const calendar = this.calendar();\n\n if (calendar) {\n calendar.options.rangeMode = true;\n }\n });\n\n protected readonly calendarSync = effect(() => {\n const calendar = this.calendar();\n\n calendar &&\n tuiSetSignal(calendar.value, this.intermediateValue() ?? this.value());\n });\n\n // TODO: use linked signal (Angular 19+)\n protected readonly resetIntermediateValue = effect(() => {\n this.intermediateValue.set(this.value() && null);\n });\n\n protected onMonthClickEffect = effect((onCleanup) => {\n const subscription = this.calendar()?.monthClick.subscribe((month) => {\n const intermediateValue = this.intermediateValue();\n\n if (intermediateValue) {\n this.onChange(TuiMonthRange.sort(intermediateValue, month));\n this.open.set(false);\n } else {\n this.intermediateValue.set(month);\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 {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 {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 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":";;;;;;;;;;;;;;;;;;;AAeO,MAAM,6BAA6B,GACtC,IAAI,cAAc,CACd,SAAS,GAAG,+BAA+B,GAAG,EAAE,EAChD;AACI,IAAA,OAAO,EAAE,OAAO;QACZ,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAClC,QAAA,gBAAgB,EAAE,8BAA8B;KACnD,CAAC;AACL,CAAA;AAGF,MAAM,iCAAiC,GAAG,CAC7C,OAA2C,KAE3C,iBAAiB,CACb,6BAA6B,EAC7B,OAAO,EACP,8BAA8B;;ACChC,MAAO,2BAA4B,SAAQ,UAAgC,CAAA;AAZjF,IAAA,WAAA,GAAA;;AAaqB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACjC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;AAC3B,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI;AACnC,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAkB,IAAI,CAAC;AACjD,QAAA,IAAA,CAAA,QAAQ,GA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,EAAA,QAAA,EAAA,2BAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,mDAAA,EAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,EAAA,SAAA,EAVzB;YACP,YAAY,CAAC,2BAA2B,CAAC;YACzC,uBAAuB,CAAC,6BAA6B,CAAC;AACzD,SAAA,EAAA,eAAA,EAAA,IAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,YAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,aAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,eAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAOQ,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAZvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,2BAA2B;AACrC,oBAAA,SAAS,EAAE;AACP,wBAAA,YAAY,CAAA,2BAAA,CAA6B;wBACzC,uBAAuB,CAAC,6BAA6B,CAAC;AACzD,qBAAA;AACD,oBAAA,cAAc,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC;AAC9D,oBAAA,IAAI,EAAE;AACF,wBAAA,YAAY,EAAE,YAAY;AAC1B,wBAAA,SAAS,EAAE,iDAAiD;AAC/D,qBAAA;AACJ,iBAAA;;;ACtBM,MAAM,kBAAkB,GAAG;IAC9B,2BAA2B;IAC3B,gBAAgB;IAChB,QAAQ;IACR,qBAAqB;IACrB,4BAA4B;IAC5B,kBAAkB;;;AChBtB;;AAEG;;;;"}
|
|
@@ -59,13 +59,13 @@ class TuiInputMonthDirective extends TuiControl {
|
|
|
59
59
|
this.onChange(null);
|
|
60
60
|
this.open.set(this.dropdownEnabled());
|
|
61
61
|
}
|
|
62
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
63
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
62
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputMonthDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
63
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.20", type: TuiInputMonthDirective, isStandalone: true, selector: "input[tuiInputMonth]", host: { listeners: { "input": "$event.inputType?.includes(\"delete\") && clear()" }, properties: { "disabled": "disabled()" } }, providers: [
|
|
64
64
|
tuiAsControl(TuiInputMonthDirective),
|
|
65
65
|
tuiValueTransformerFrom(TUI_INPUT_MONTH_OPTIONS),
|
|
66
66
|
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }, { directive: i2.TuiSelectLike }, { directive: i3.TuiDropdownAuto }], ngImport: i0 }); }
|
|
67
67
|
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputMonthDirective, decorators: [{
|
|
69
69
|
type: Directive,
|
|
70
70
|
args: [{
|
|
71
71
|
selector: 'input[tuiInputMonth]',
|
|
@@ -101,12 +101,12 @@ class TuiInputMonthComponent {
|
|
|
101
101
|
const [year = 0, month = 0] = value.split('-').map(Number);
|
|
102
102
|
this.host.onChange(new TuiMonth(year, month - 1));
|
|
103
103
|
}
|
|
104
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
105
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputMonthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
105
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TuiInputMonthComponent, isStandalone: true, selector: "input[tuiInputMonth][type=\"month\"]", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-tui-version": "5.1.0", "ngSkipHydration": "true" } }, hostDirectives: [{ directive: i2.TuiWithNativePicker }], ngImport: i0, template: "@if (host.native) {\n <input\n *tuiTextfieldContent\n type=\"month\"\n [max]=\"max()?.toJSON()\"\n [min]=\"min()?.toJSON()\"\n [value]=\"host.value()?.toJSON()\"\n (click.stop.zoneless)=\"(0)\"\n (input)=\"onInput($any($event.target).value)\"\n (pointerdown.stop.zoneless)=\"(0)\"\n />\n}\n", styles: ["tui-textfield input[tuiInputMonth]:where(*[data-tui-version=\"5.1.0\"])~.t-content input[type=month]{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%;opacity:0;pointer-events:auto}tui-textfield input[tuiInputMonth]:where(*[data-tui-version=\"5.1.0\"])~.t-content input[type=month]::-webkit-calendar-picker-indicator{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%}\n"], dependencies: [{ kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
106
106
|
}
|
|
107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputMonthComponent, decorators: [{
|
|
108
108
|
type: Component,
|
|
109
|
-
args: [{ selector: 'input[tuiInputMonth][type="month"]', imports: [TuiTextfieldContent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiWithNativePicker], host: { 'data-tui-version': TUI_VERSION, ngSkipHydration: 'true' }, template: "@if (host.native) {\n <input\n *tuiTextfieldContent\n type=\"month\"\n [max]=\"max()?.toJSON()\"\n [min]=\"min()?.toJSON()\"\n [value]=\"host.value()?.toJSON()\"\n (click.stop.zoneless)=\"(0)\"\n (input)=\"onInput($any($event.target).value)\"\n (pointerdown.stop.zoneless)=\"(0)\"\n />\n}\n", styles: ["tui-textfield input[tuiInputMonth]:where(*[data-tui-version=\"5.
|
|
109
|
+
args: [{ selector: 'input[tuiInputMonth][type="month"]', imports: [TuiTextfieldContent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiWithNativePicker], host: { 'data-tui-version': TUI_VERSION, ngSkipHydration: 'true' }, template: "@if (host.native) {\n <input\n *tuiTextfieldContent\n type=\"month\"\n [max]=\"max()?.toJSON()\"\n [min]=\"min()?.toJSON()\"\n [value]=\"host.value()?.toJSON()\"\n (click.stop.zoneless)=\"(0)\"\n (input)=\"onInput($any($event.target).value)\"\n (pointerdown.stop.zoneless)=\"(0)\"\n />\n}\n", styles: ["tui-textfield input[tuiInputMonth]:where(*[data-tui-version=\"5.1.0\"])~.t-content input[type=month]{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%;opacity:0;pointer-events:auto}tui-textfield input[tuiInputMonth]:where(*[data-tui-version=\"5.1.0\"])~.t-content input[type=month]::-webkit-calendar-picker-indicator{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%}\n"] }]
|
|
110
110
|
}] });
|
|
111
111
|
|
|
112
112
|
const TuiInputMonth = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-month.mjs","sources":["../../../projects/kit/components/input-month/input-month.options.ts","../../../projects/kit/components/input-month/input-month.directive.ts","../../../projects/kit/components/input-month/input-month.component.ts","../../../projects/kit/components/input-month/input-month.template.html","../../../projects/kit/components/input-month/input-month.ts","../../../projects/kit/components/input-month/taiga-ui-kit-components-input-month.ts"],"sourcesContent":["import {type FactoryProvider, inject, InjectionToken} from '@angular/core';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/di';\nimport {\n TUI_INPUT_DATE_DEFAULT_OPTIONS,\n TUI_INPUT_DATE_OPTIONS,\n} from '@taiga-ui/kit/components/input-date';\n\nexport interface TuiInputMonthOptions {\n readonly icon: string;\n readonly valueTransformer: TuiValueTransformer<TuiMonth | null, any>;\n}\n\nexport const TUI_INPUT_MONTH_OPTIONS = new InjectionToken<TuiInputMonthOptions>(\n ngDevMode ? 'TUI_INPUT_MONTH_OPTIONS' : '',\n {\n factory: () => ({\n ...inject(TUI_INPUT_DATE_OPTIONS),\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n }),\n },\n);\n\nexport const tuiInputMonthOptionsProvider = (\n options: Partial<TuiInputMonthOptions>,\n): FactoryProvider =>\n tuiProvideOptions(TUI_INPUT_MONTH_OPTIONS, options, TUI_INPUT_DATE_DEFAULT_OPTIONS);\n","import {computed, Directive, effect, inject} from '@angular/core';\nimport {WA_IS_MOBILE} from '@ng-web-apis/platform';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiInputDirective, TuiWithInput} from '@taiga-ui/core/components/input';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n TuiWithNativePicker,\n} from '@taiga-ui/core/components/textfield';\nimport {tuiIconEnd} from '@taiga-ui/core/directives/icons';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n TuiDropdownOpen,\n} from '@taiga-ui/core/portals/dropdown';\nimport {TUI_MONTHS} from '@taiga-ui/core/tokens';\nimport {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TUI_INPUT_MONTH_OPTIONS} from './input-month.options';\n\n@Directive({\n selector: 'input[tuiInputMonth]',\n providers: [\n tuiAsControl(TuiInputMonthDirective),\n tuiValueTransformerFrom(TUI_INPUT_MONTH_OPTIONS),\n ],\n hostDirectives: [TuiWithInput, TuiSelectLike, TuiDropdownAuto],\n host: {\n '[disabled]': 'disabled()',\n '(input)': '$event.inputType?.includes(\"delete\") && clear()',\n },\n})\nexport class TuiInputMonthDirective extends TuiControl<TuiMonth | null> {\n private readonly input = inject(TuiInputDirective);\n private readonly months = inject(TUI_MONTHS);\n private readonly open = inject(TuiDropdownOpen).open;\n\n protected readonly icon = tuiIconEnd(inject(TUI_INPUT_MONTH_OPTIONS).icon);\n protected readonly dropdownEnabled = tuiDropdownEnabled(\n computed(() => !this.native && this.interactive()),\n );\n\n protected readonly valueEffect = effect(() => {\n const value = this.value();\n const formatted = value\n ? `${this.months()[value.month] ?? ''} ${value.formattedYear}`\n : '';\n\n this.input.value.set(formatted);\n });\n\n protected readonly calendarIn = effect(() => {\n const calendar = this.calendar();\n\n calendar && tuiSetSignal(calendar.value, this.value());\n });\n\n protected readonly calendarOut = effect((onCleanup) => {\n const subscription = this.calendar()?.monthClick.subscribe((month) => {\n this.onChange(month);\n this.open.set(false);\n });\n\n onCleanup(() => subscription?.unsubscribe());\n });\n\n public readonly calendar = tuiInjectAuxiliary<TuiCalendarMonth>(\n (x) => x instanceof TuiCalendarMonth,\n );\n\n public readonly native =\n !!inject(TuiWithNativePicker, {optional: true}) && inject(WA_IS_MOBILE);\n\n protected clear(): void {\n this.onChange(null);\n this.open.set(this.dropdownEnabled());\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_VERSION} from '@taiga-ui/cdk/constants';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiTextfieldContent,\n TuiWithNativePicker,\n} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputMonthDirective} from './input-month.directive';\n\n@Component({\n selector: 'input[tuiInputMonth][type=\"month\"]',\n imports: [TuiTextfieldContent],\n templateUrl: './input-month.template.html',\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import './input-month.style.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiWithNativePicker],\n host: {'data-tui-version': TUI_VERSION, ngSkipHydration: 'true'},\n})\nexport class TuiInputMonthComponent {\n protected readonly host = inject(TuiInputMonthDirective);\n protected readonly calendarSync = effect(() => {\n const calendar = this.host.calendar();\n\n if (calendar) {\n tuiSetSignal(calendar.min, this.min() ?? TUI_FIRST_DAY);\n tuiSetSignal(calendar.max, this.max() ?? TUI_LAST_DAY);\n }\n });\n\n protected readonly min = input<TuiMonth | null>(null);\n protected readonly max = input<TuiMonth | null>(null);\n\n protected onInput(value: string): void {\n if (!value) {\n return this.host.onChange(null);\n }\n\n const [year = 0, month = 0] = value.split('-').map(Number);\n\n this.host.onChange(new TuiMonth(year, month - 1));\n }\n}\n","@if (host.native) {\n <input\n *tuiTextfieldContent\n type=\"month\"\n [max]=\"max()?.toJSON()\"\n [min]=\"min()?.toJSON()\"\n [value]=\"host.value()?.toJSON()\"\n (click.stop.zoneless)=\"(0)\"\n (input)=\"onInput($any($event.target).value)\"\n (pointerdown.stop.zoneless)=\"(0)\"\n />\n}\n","import {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 {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthComponent} from './input-month.component';\nimport {TuiInputMonthDirective} from './input-month.directive';\n\nexport const TuiInputMonth = [\n TuiInputMonthComponent,\n TuiInputMonthDirective,\n TuiCalendarMonth,\n 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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiBO,MAAM,uBAAuB,GAAG,IAAI,cAAc,CACrD,SAAS,GAAG,yBAAyB,GAAG,EAAE,EAC1C;AACI,IAAA,OAAO,EAAE,OAAO;QACZ,GAAG,MAAM,CAAC,sBAAsB,CAAC;AACjC,QAAA,gBAAgB,EAAE,8BAA8B;KACnD,CAAC;AACL,CAAA;AAGE,MAAM,4BAA4B,GAAG,CACxC,OAAsC,KAEtC,iBAAiB,CAAC,uBAAuB,EAAE,OAAO,EAAE,8BAA8B;;ACIhF,MAAO,sBAAuB,SAAQ,UAA2B,CAAA;AAZvE,IAAA,WAAA,GAAA;;AAaqB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACjC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;AAC3B,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI;QAEjC,IAAA,CAAA,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC;AACvD,QAAA,IAAA,CAAA,eAAe,GAAG,kBAAkB,CACnD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,CACrD;AAEkB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,MAAK;AACzC,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;YAC1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"version":3,"file":"taiga-ui-kit-components-input-month.mjs","sources":["../../../projects/kit/components/input-month/input-month.options.ts","../../../projects/kit/components/input-month/input-month.directive.ts","../../../projects/kit/components/input-month/input-month.component.ts","../../../projects/kit/components/input-month/input-month.template.html","../../../projects/kit/components/input-month/input-month.ts","../../../projects/kit/components/input-month/taiga-ui-kit-components-input-month.ts"],"sourcesContent":["import {type FactoryProvider, inject, InjectionToken} from '@angular/core';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/di';\nimport {\n TUI_INPUT_DATE_DEFAULT_OPTIONS,\n TUI_INPUT_DATE_OPTIONS,\n} from '@taiga-ui/kit/components/input-date';\n\nexport interface TuiInputMonthOptions {\n readonly icon: string;\n readonly valueTransformer: TuiValueTransformer<TuiMonth | null, any>;\n}\n\nexport const TUI_INPUT_MONTH_OPTIONS = new InjectionToken<TuiInputMonthOptions>(\n ngDevMode ? 'TUI_INPUT_MONTH_OPTIONS' : '',\n {\n factory: () => ({\n ...inject(TUI_INPUT_DATE_OPTIONS),\n valueTransformer: TUI_IDENTITY_VALUE_TRANSFORMER,\n }),\n },\n);\n\nexport const tuiInputMonthOptionsProvider = (\n options: Partial<TuiInputMonthOptions>,\n): FactoryProvider =>\n tuiProvideOptions(TUI_INPUT_MONTH_OPTIONS, options, TUI_INPUT_DATE_DEFAULT_OPTIONS);\n","import {computed, Directive, effect, inject} from '@angular/core';\nimport {WA_IS_MOBILE} from '@ng-web-apis/platform';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {type TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiInputDirective, TuiWithInput} from '@taiga-ui/core/components/input';\nimport {\n tuiInjectAuxiliary,\n TuiSelectLike,\n TuiWithNativePicker,\n} from '@taiga-ui/core/components/textfield';\nimport {tuiIconEnd} from '@taiga-ui/core/directives/icons';\nimport {\n TuiDropdownAuto,\n tuiDropdownEnabled,\n TuiDropdownOpen,\n} from '@taiga-ui/core/portals/dropdown';\nimport {TUI_MONTHS} from '@taiga-ui/core/tokens';\nimport {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TUI_INPUT_MONTH_OPTIONS} from './input-month.options';\n\n@Directive({\n selector: 'input[tuiInputMonth]',\n providers: [\n tuiAsControl(TuiInputMonthDirective),\n tuiValueTransformerFrom(TUI_INPUT_MONTH_OPTIONS),\n ],\n hostDirectives: [TuiWithInput, TuiSelectLike, TuiDropdownAuto],\n host: {\n '[disabled]': 'disabled()',\n '(input)': '$event.inputType?.includes(\"delete\") && clear()',\n },\n})\nexport class TuiInputMonthDirective extends TuiControl<TuiMonth | null> {\n private readonly input = inject(TuiInputDirective);\n private readonly months = inject(TUI_MONTHS);\n private readonly open = inject(TuiDropdownOpen).open;\n\n protected readonly icon = tuiIconEnd(inject(TUI_INPUT_MONTH_OPTIONS).icon);\n protected readonly dropdownEnabled = tuiDropdownEnabled(\n computed(() => !this.native && this.interactive()),\n );\n\n protected readonly valueEffect = effect(() => {\n const value = this.value();\n const formatted = value\n ? `${this.months()[value.month] ?? ''} ${value.formattedYear}`\n : '';\n\n this.input.value.set(formatted);\n });\n\n protected readonly calendarIn = effect(() => {\n const calendar = this.calendar();\n\n calendar && tuiSetSignal(calendar.value, this.value());\n });\n\n protected readonly calendarOut = effect((onCleanup) => {\n const subscription = this.calendar()?.monthClick.subscribe((month) => {\n this.onChange(month);\n this.open.set(false);\n });\n\n onCleanup(() => subscription?.unsubscribe());\n });\n\n public readonly calendar = tuiInjectAuxiliary<TuiCalendarMonth>(\n (x) => x instanceof TuiCalendarMonth,\n );\n\n public readonly native =\n !!inject(TuiWithNativePicker, {optional: true}) && inject(WA_IS_MOBILE);\n\n protected clear(): void {\n this.onChange(null);\n this.open.set(this.dropdownEnabled());\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_VERSION} from '@taiga-ui/cdk/constants';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiTextfieldContent,\n TuiWithNativePicker,\n} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputMonthDirective} from './input-month.directive';\n\n@Component({\n selector: 'input[tuiInputMonth][type=\"month\"]',\n imports: [TuiTextfieldContent],\n templateUrl: './input-month.template.html',\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import './input-month.style.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiWithNativePicker],\n host: {'data-tui-version': TUI_VERSION, ngSkipHydration: 'true'},\n})\nexport class TuiInputMonthComponent {\n protected readonly host = inject(TuiInputMonthDirective);\n protected readonly calendarSync = effect(() => {\n const calendar = this.host.calendar();\n\n if (calendar) {\n tuiSetSignal(calendar.min, this.min() ?? TUI_FIRST_DAY);\n tuiSetSignal(calendar.max, this.max() ?? TUI_LAST_DAY);\n }\n });\n\n protected readonly min = input<TuiMonth | null>(null);\n protected readonly max = input<TuiMonth | null>(null);\n\n protected onInput(value: string): void {\n if (!value) {\n return this.host.onChange(null);\n }\n\n const [year = 0, month = 0] = value.split('-').map(Number);\n\n this.host.onChange(new TuiMonth(year, month - 1));\n }\n}\n","@if (host.native) {\n <input\n *tuiTextfieldContent\n type=\"month\"\n [max]=\"max()?.toJSON()\"\n [min]=\"min()?.toJSON()\"\n [value]=\"host.value()?.toJSON()\"\n (click.stop.zoneless)=\"(0)\"\n (input)=\"onInput($any($event.target).value)\"\n (pointerdown.stop.zoneless)=\"(0)\"\n />\n}\n","import {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 {TuiCalendarMonth} from '@taiga-ui/kit/components/calendar-month';\n\nimport {TuiInputMonthComponent} from './input-month.component';\nimport {TuiInputMonthDirective} from './input-month.directive';\n\nexport const TuiInputMonth = [\n TuiInputMonthComponent,\n TuiInputMonthDirective,\n TuiCalendarMonth,\n 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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiBO,MAAM,uBAAuB,GAAG,IAAI,cAAc,CACrD,SAAS,GAAG,yBAAyB,GAAG,EAAE,EAC1C;AACI,IAAA,OAAO,EAAE,OAAO;QACZ,GAAG,MAAM,CAAC,sBAAsB,CAAC;AACjC,QAAA,gBAAgB,EAAE,8BAA8B;KACnD,CAAC;AACL,CAAA;AAGE,MAAM,4BAA4B,GAAG,CACxC,OAAsC,KAEtC,iBAAiB,CAAC,uBAAuB,EAAE,OAAO,EAAE,8BAA8B;;ACIhF,MAAO,sBAAuB,SAAQ,UAA2B,CAAA;AAZvE,IAAA,WAAA,GAAA;;AAaqB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACjC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;AAC3B,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI;QAEjC,IAAA,CAAA,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC;AACvD,QAAA,IAAA,CAAA,eAAe,GAAG,kBAAkB,CACnD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC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AAG;IACzB,sBAAsB;IACtB,sBAAsB;IACtB,gBAAgB;IAChB,QAAQ;IACR,qBAAqB;IACrB,4BAA4B;IAC5B,kBAAkB;;;AClBtB;;AAEG;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { TuiLabel } from '@taiga-ui/core/components/label';
|
|
2
|
-
import
|
|
2
|
+
import * as i2 from '@taiga-ui/core/components/textfield';
|
|
3
|
+
import { TUI_TEXTFIELD_OPTIONS, 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, input, computed, effect, Directive, untracked,
|
|
6
|
+
import { inject, input, computed, effect, Directive, untracked, Injectable, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
6
7
|
import { maskitoNumberOptionsGenerator, maskitoStringifyNumber, maskitoCaretGuard, maskitoParseNumber } from '@maskito/kit';
|
|
7
8
|
import { WA_IS_IOS } from '@ng-web-apis/platform';
|
|
8
9
|
import { TuiValueTransformer, TUI_IDENTITY_VALUE_TRANSFORMER, TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
|
|
@@ -12,19 +13,19 @@ import { TuiInputDirective, TuiWithInput } from '@taiga-ui/core/components/input
|
|
|
12
13
|
import * as i1 from '@maskito/angular';
|
|
13
14
|
import { MaskitoDirective } from '@maskito/angular';
|
|
14
15
|
import { maskitoTransform } from '@maskito/core';
|
|
15
|
-
import { tuiIsSafeToRound, tuiRoundWith, tuiRound,
|
|
16
|
+
import { tuiIsSafeToRound, tuiRoundWith, tuiRound, tuiSum, tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
16
17
|
import { TUI_NUMBER_FORMAT } from '@taiga-ui/core/tokens';
|
|
17
18
|
import { tuiMaskito } from '@taiga-ui/kit/utils';
|
|
18
19
|
import { CHAR_MINUS, TUI_VERSION } from '@taiga-ui/cdk/constants';
|
|
19
20
|
import { tuiCreateOptions, tuiProvide } from '@taiga-ui/cdk/utils/di';
|
|
20
21
|
import { TUI_FLOATING_PRECISION } from '@taiga-ui/core/components/slider';
|
|
21
22
|
import { tuiGetFractionPartPadded } from '@taiga-ui/core/utils/format';
|
|
22
|
-
import { identity, Subject, merge, fromEvent, switchMap, timer, expand, map, takeUntil
|
|
23
|
-
import { TuiButton } from '@taiga-ui/core/components/button';
|
|
23
|
+
import { identity, Subject, merge, fromEvent, switchMap, timer, expand, map, takeUntil } from 'rxjs';
|
|
24
24
|
import * as i1$2 from '@taiga-ui/kit/directives/appearance-proxy';
|
|
25
25
|
import { TuiAppearanceProxy } from '@taiga-ui/kit/directives/appearance-proxy';
|
|
26
|
-
import { DOCUMENT } from '@angular/common';
|
|
27
26
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
27
|
+
import { TuiButton } from '@taiga-ui/core/components/button';
|
|
28
|
+
import { DOCUMENT } from '@angular/common';
|
|
28
29
|
|
|
29
30
|
const TUI_INPUT_NUMBER_DEFAULT_OPTIONS = {
|
|
30
31
|
min: Number.MIN_SAFE_INTEGER,
|
|
@@ -109,18 +110,18 @@ class TuiNumberMask {
|
|
|
109
110
|
],
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
113
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
113
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiNumberMask, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
114
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.20", type: TuiNumberMask, isStandalone: true, inputs: { prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, postfix: { classPropertyName: "postfix", publicName: "postfix", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.MaskitoDirective }], ngImport: i0 }); }
|
|
114
115
|
}
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiNumberMask, decorators: [{
|
|
116
117
|
type: Directive,
|
|
117
118
|
args: [{ hostDirectives: [MaskitoDirective] }]
|
|
118
119
|
}] });
|
|
119
120
|
class TuiWithNumberMask {
|
|
120
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
121
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
121
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiWithNumberMask, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
122
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.20", type: TuiWithNumberMask, isStandalone: true, hostDirectives: [{ directive: TuiNumberMask, inputs: ["min", "min", "max", "max", "prefix", "prefix", "postfix", "postfix"] }], ngImport: i0 }); }
|
|
122
123
|
}
|
|
123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiWithNumberMask, decorators: [{
|
|
124
125
|
type: Directive,
|
|
125
126
|
args: [{
|
|
126
127
|
hostDirectives: [
|
|
@@ -146,20 +147,20 @@ class TuiQuantumValueTransformerBase extends TuiValueTransformer {
|
|
|
146
147
|
? tuiRound(Math.round(value / this.quantum) * this.quantum, TUI_FLOATING_PRECISION)
|
|
147
148
|
: value;
|
|
148
149
|
}
|
|
149
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
150
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
150
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiQuantumValueTransformerBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
|
|
151
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.20", type: TuiQuantumValueTransformerBase, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
|
|
151
152
|
}
|
|
152
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiQuantumValueTransformerBase, decorators: [{
|
|
153
154
|
type: Directive
|
|
154
155
|
}], ctorParameters: () => [{ type: undefined }] });
|
|
155
156
|
class TuiQuantumValueTransformer extends TuiQuantumValueTransformerBase {
|
|
156
157
|
constructor() {
|
|
157
158
|
super(0);
|
|
158
159
|
}
|
|
159
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
160
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
160
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiQuantumValueTransformer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
161
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.20", type: TuiQuantumValueTransformer, isStandalone: true, selector: "[tuiInputNumber][quantum]:not([bigint])", inputs: { quantum: "quantum" }, usesInheritance: true, ngImport: i0 }); }
|
|
161
162
|
}
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiQuantumValueTransformer, decorators: [{
|
|
163
164
|
type: Directive,
|
|
164
165
|
args: [{
|
|
165
166
|
selector: '[tuiInputNumber][quantum]:not([bigint])',
|
|
@@ -180,10 +181,10 @@ class TuiBigIntQuantumValueTransformer extends TuiValueTransformer {
|
|
|
180
181
|
const remainder = value % this.quantum();
|
|
181
182
|
return (floor + (BigInt(2) * remainder >= this.quantum() ? this.quantum() : BigInt(0)));
|
|
182
183
|
}
|
|
183
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
184
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
184
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiBigIntQuantumValueTransformer, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
185
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.20", type: TuiBigIntQuantumValueTransformer, isStandalone: true, selector: "[tuiInputNumber][bigint][quantum]", inputs: { quantum: { classPropertyName: "quantum", publicName: "quantum", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
185
186
|
}
|
|
186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiBigIntQuantumValueTransformer, decorators: [{
|
|
187
188
|
type: Directive,
|
|
188
189
|
args: [{ selector: '[tuiInputNumber][bigint][quantum]' }]
|
|
189
190
|
}] });
|
|
@@ -204,10 +205,10 @@ class TuiNumberValueTransformer extends TuiValueTransformer {
|
|
|
204
205
|
fromControlValue(controlValue) {
|
|
205
206
|
return this.mask.stringify(this.optionsTransformer.fromControlValue(controlValue));
|
|
206
207
|
}
|
|
207
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
208
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
208
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiNumberValueTransformer, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
209
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.20", type: TuiNumberValueTransformer, isStandalone: true, providers: [tuiProvide(TuiValueTransformer, TuiNumberValueTransformer)], usesInheritance: true, ngImport: i0 }); }
|
|
209
210
|
}
|
|
210
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiNumberValueTransformer, decorators: [{
|
|
211
212
|
type: Directive,
|
|
212
213
|
args: [{ providers: [tuiProvide(TuiValueTransformer, TuiNumberValueTransformer)] }]
|
|
213
214
|
}] });
|
|
@@ -245,7 +246,8 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
245
246
|
});
|
|
246
247
|
this.parsed = computed(() => this.parse(this.input.value()));
|
|
247
248
|
this.onChangeEffect = effect(() => {
|
|
248
|
-
const
|
|
249
|
+
const decorations = untracked(({ decimalSeparator, minusSign } = this.mask.params()) => new RegExp(`[^\\d\\${minusSign}\\${decimalSeparator}]`, 'g'));
|
|
250
|
+
const changed = !Object.is(this.input.value().replaceAll(decorations, ''), untracked(() => this.value()?.replaceAll(decorations, '')) ?? '');
|
|
249
251
|
const value = this.parsed();
|
|
250
252
|
const valid = Number.isNaN(value) || (value >= this.mask.min() && value <= this.mask.max());
|
|
251
253
|
if (changed && valid) {
|
|
@@ -266,7 +268,7 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
266
268
|
}
|
|
267
269
|
onFocus() {
|
|
268
270
|
if (!this.input.value() && !this.readOnly()) {
|
|
269
|
-
this.input.value.set(this.mask.prefix()
|
|
271
|
+
this.input.value.set(`${this.mask.prefix()}${this.mask.postfix()}`);
|
|
270
272
|
}
|
|
271
273
|
}
|
|
272
274
|
onBlur() {
|
|
@@ -278,12 +280,12 @@ class TuiInputNumberDirective extends TuiControl {
|
|
|
278
280
|
return (maskitoParseNumber(value, {
|
|
279
281
|
...params,
|
|
280
282
|
bigint: !value.includes(params.decimalSeparator) && possibleTooBig,
|
|
281
|
-
}) ?? NaN);
|
|
283
|
+
}) ?? Number.NaN);
|
|
282
284
|
}
|
|
283
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
284
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
285
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputNumberDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
286
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.20", type: TuiInputNumberDirective, isStandalone: true, selector: "input[tuiInputNumber]", host: { listeners: { "focus": "onFocus()", "blur": "onBlur()" }, properties: { "disabled": "disabled()", "attr.inputMode": "inputMode()", "attr.maxLength": "element.maxLength > 0 ? element.maxLength : defaultMaxLength()" } }, providers: [tuiAsControl(TuiInputNumberDirective)], usesInheritance: true, hostDirectives: [{ directive: i1$1.TuiWithInput }, { directive: TuiWithNumberMask }, { directive: TuiNumberValueTransformer }], ngImport: i0 }); }
|
|
285
287
|
}
|
|
286
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputNumberDirective, decorators: [{
|
|
287
289
|
type: Directive,
|
|
288
290
|
args: [{
|
|
289
291
|
selector: 'input[tuiInputNumber]',
|
|
@@ -308,58 +310,77 @@ function getDelay(index) {
|
|
|
308
310
|
class TuiInputNumberStepService {
|
|
309
311
|
constructor() {
|
|
310
312
|
this.doc = inject(DOCUMENT);
|
|
311
|
-
this.destroyRef = inject(DestroyRef);
|
|
312
313
|
this.start$ = new Subject();
|
|
313
314
|
this.stop$ = merge(fromEvent(this.doc, 'pointerup'), fromEvent(this.doc, 'pointerleave'), fromEvent(this.doc, 'pointercancel'));
|
|
314
|
-
this.steps$ = this.start$.pipe(switchMap((value) => timer(INITIAL_DELAY).pipe(expand((_, index) => timer(getDelay(index))), map(() => value), takeUntil(this.stop$)))
|
|
315
|
+
this.steps$ = this.start$.pipe(switchMap((value) => timer(INITIAL_DELAY).pipe(expand((_, index) => timer(getDelay(index))), map(() => value), takeUntil(this.stop$))));
|
|
315
316
|
}
|
|
316
317
|
next(value) {
|
|
317
318
|
this.start$.next(value);
|
|
318
319
|
}
|
|
319
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
320
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
320
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputNumberStepService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
321
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputNumberStepService }); }
|
|
321
322
|
}
|
|
322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
323
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputNumberStepService, decorators: [{
|
|
323
324
|
type: Injectable
|
|
324
325
|
}] });
|
|
325
326
|
|
|
327
|
+
class TuiInputNumberStepButtons {
|
|
328
|
+
constructor() {
|
|
329
|
+
this.mask = inject(TuiNumberMask);
|
|
330
|
+
this.input = inject(TuiInputNumberDirective);
|
|
331
|
+
this.options = inject(TUI_INPUT_NUMBER_OPTIONS);
|
|
332
|
+
this.directive = inject(TuiInputNumberStep);
|
|
333
|
+
this.appearance = inject(TUI_TEXTFIELD_OPTIONS).appearance;
|
|
334
|
+
this.hold = inject((TuiInputNumberStepService));
|
|
335
|
+
this.$ = this.hold.steps$
|
|
336
|
+
.pipe(takeUntilDestroyed())
|
|
337
|
+
.subscribe((value) => this.directive.onStep(value));
|
|
338
|
+
}
|
|
339
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputNumberStepButtons, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
340
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TuiInputNumberStepButtons, isStandalone: true, selector: "ng-component", host: { attributes: { "data-tui-version": "5.1.0" }, properties: { "style.display": "\"contents\"", "style.border-radius": "\"inherit\"" } }, providers: [TuiInputNumberStepService], ngImport: i0, template: "@if (directive.step()) {\n <section class=\"t-input-number-buttons\">\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || input.parsed() >= mask.max()\"\n [iconStart]=\"options.icons.increase\"\n (click.prevent)=\"directive.onStep(directive.step())\"\n (pointerdown.prevent)=\"hold.next(directive.step())\"\n >\n +\n </button>\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || input.parsed() <= mask.min()\"\n [iconStart]=\"options.icons.decrease\"\n (click.prevent)=\"directive.onStep(-directive.step())\"\n (pointerdown.prevent)=\"hold.next(-directive.step())\"\n >\n -\n </button>\n </section>\n}\n", styles: ["tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons{position:absolute;display:flex;inset-inline-end:0;block-size:var(--t-height);flex-direction:column;gap:.125rem;border-radius:inherit}tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons>*{flex:1 1 0;border-radius:0}tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit}tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons>*:last-child{border-bottom-right-radius:inherit}[dir=rtl] tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons>*:first-child{border-radius:0;border-top-left-radius:inherit}[dir=rtl] tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0;border-bottom-left-radius:inherit}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[data-size=l]{--t-input-number-offset-end: calc(var(--tui-height-m) + .125rem)}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[data-size=l] .t-input-number-buttons.t-input-number-buttons>*{inline-size:var(--tui-height-m)}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[data-size=m]{--t-input-number-offset-end: calc(var(--tui-height-s) + .125rem)}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[data-size=s]{--t-input-number-offset-end: calc(2 * var(--tui-height-s) + .25rem)}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[data-size=s] .t-input-number-buttons.t-input-number-buttons{flex-direction:row-reverse}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[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:where(*[data-tui-version=\"5.1.0\"])[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0}[tuiInputNumber]._with-buttons:where(*[data-tui-version=\"5.1.0\"]){border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] [tuiInputNumber]._with-buttons:where(*[data-tui-version=\"5.1.0\"]){border-radius:inherit;border-top-left-radius:0;border-bottom-left-radius:0}[tuiInputNumber]._with-buttons:where(*[data-tui-version=\"5.1.0\"]),[data-tui-version=\"5.1.0\"] [tuiInputNumber]._with-buttons~.t-template{inline-size:calc(100% - var(--t-input-number-offset-end));margin-inline-end:var(--t-input-number-offset-end)}[tuiInputNumber]:where(*[data-tui-version=\"5.1.0\"])._with-buttons~.t-content{margin-inline-end:var(--t-input-number-offset-end)}\n"], dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
341
|
+
}
|
|
342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputNumberStepButtons, decorators: [{
|
|
343
|
+
type: Component,
|
|
344
|
+
args: [{ imports: [TuiButton], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [TuiInputNumberStepService], host: {
|
|
345
|
+
'data-tui-version': TUI_VERSION,
|
|
346
|
+
'[style.display]': '"contents"',
|
|
347
|
+
'[style.border-radius]': '"inherit"',
|
|
348
|
+
}, template: "@if (directive.step()) {\n <section class=\"t-input-number-buttons\">\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || input.parsed() >= mask.max()\"\n [iconStart]=\"options.icons.increase\"\n (click.prevent)=\"directive.onStep(directive.step())\"\n (pointerdown.prevent)=\"hold.next(directive.step())\"\n >\n +\n </button>\n <button\n size=\"s\"\n tabindex=\"-1\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"!input.interactive() || input.parsed() <= mask.min()\"\n [iconStart]=\"options.icons.decrease\"\n (click.prevent)=\"directive.onStep(-directive.step())\"\n (pointerdown.prevent)=\"hold.next(-directive.step())\"\n >\n -\n </button>\n </section>\n}\n", styles: ["tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons{position:absolute;display:flex;inset-inline-end:0;block-size:var(--t-height);flex-direction:column;gap:.125rem;border-radius:inherit}tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons>*{flex:1 1 0;border-radius:0}tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons>*:first-child{border-top-right-radius:inherit}tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons>*:last-child{border-bottom-right-radius:inherit}[dir=rtl] tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons>*:first-child{border-radius:0;border-top-left-radius:inherit}[dir=rtl] tui-textfield:where(*[data-tui-version=\"5.1.0\"]) .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0;border-bottom-left-radius:inherit}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[data-size=l]{--t-input-number-offset-end: calc(var(--tui-height-m) + .125rem)}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[data-size=l] .t-input-number-buttons.t-input-number-buttons>*{inline-size:var(--tui-height-m)}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[data-size=m]{--t-input-number-offset-end: calc(var(--tui-height-s) + .125rem)}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[data-size=s]{--t-input-number-offset-end: calc(2 * var(--tui-height-s) + .25rem)}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[data-size=s] .t-input-number-buttons.t-input-number-buttons{flex-direction:row-reverse}tui-textfield:where(*[data-tui-version=\"5.1.0\"])[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:where(*[data-tui-version=\"5.1.0\"])[data-size=s] .t-input-number-buttons.t-input-number-buttons>*:last-child{border-radius:0}[tuiInputNumber]._with-buttons:where(*[data-tui-version=\"5.1.0\"]){border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] [tuiInputNumber]._with-buttons:where(*[data-tui-version=\"5.1.0\"]){border-radius:inherit;border-top-left-radius:0;border-bottom-left-radius:0}[tuiInputNumber]._with-buttons:where(*[data-tui-version=\"5.1.0\"]),[data-tui-version=\"5.1.0\"] [tuiInputNumber]._with-buttons~.t-template{inline-size:calc(100% - var(--t-input-number-offset-end));margin-inline-end:var(--t-input-number-offset-end)}[tuiInputNumber]:where(*[data-tui-version=\"5.1.0\"])._with-buttons~.t-content{margin-inline-end:var(--t-input-number-offset-end)}\n"] }]
|
|
349
|
+
}] });
|
|
350
|
+
|
|
326
351
|
class TuiInputNumberStep {
|
|
327
352
|
constructor() {
|
|
328
353
|
this.el = tuiInjectElement();
|
|
329
|
-
this.hold = inject((TuiInputNumberStepService));
|
|
330
|
-
this.$ = this.hold.steps$.subscribe((value) => this.onStep(value));
|
|
331
|
-
this.appearance = inject(TUI_TEXTFIELD_OPTIONS).appearance;
|
|
332
|
-
this.options = inject(TUI_INPUT_NUMBER_OPTIONS);
|
|
333
|
-
this.mask = inject(TuiNumberMask, { self: true });
|
|
334
354
|
this.input = inject(TuiInputNumberDirective, { self: true });
|
|
335
|
-
this.
|
|
355
|
+
this.mask = inject(TuiNumberMask, { self: true });
|
|
356
|
+
this.step = input(inject(TUI_INPUT_NUMBER_OPTIONS).step);
|
|
336
357
|
}
|
|
337
358
|
onStep(step) {
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
*/
|
|
344
|
-
typeof value === 'bigint'
|
|
345
|
-
? value + BigInt(step)
|
|
346
|
-
: tuiSum(value, Number(step)), this.mask.min(), this.mask.max()));
|
|
359
|
+
const current = this.input.parsed() || 0;
|
|
360
|
+
const updated = typeof current === 'bigint'
|
|
361
|
+
? current + BigInt(step)
|
|
362
|
+
: tuiSum(current, Number(step));
|
|
363
|
+
this.input.setValue(tuiClamp(updated, this.mask.min(), this.mask.max()));
|
|
347
364
|
setTimeout((end = Number.MAX_SAFE_INTEGER) => {
|
|
348
365
|
this.el.setSelectionRange(end, end);
|
|
349
366
|
});
|
|
350
367
|
}
|
|
351
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
352
|
-
static { this.ɵ
|
|
368
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputNumberStep, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
369
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.20", type: TuiInputNumberStep, isStandalone: true, selector: "input[tuiInputNumber][step]", inputs: { step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-tui-version": "5.1.0" }, listeners: { "keydown.arrowDown.prevent": "onStep(-step())", "keydown.arrowUp.prevent": "onStep(step())" }, properties: { "class._with-buttons": "step()" } }, providers: [tuiAsTextfieldContent(TuiInputNumberStepButtons)], hostDirectives: [{ directive: i1$2.TuiAppearanceProxy }, { directive: i2.TuiTextfieldContent }], ngImport: i0 }); }
|
|
353
370
|
}
|
|
354
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
355
|
-
type:
|
|
356
|
-
args: [{
|
|
357
|
-
|
|
371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiInputNumberStep, decorators: [{
|
|
372
|
+
type: Directive,
|
|
373
|
+
args: [{
|
|
374
|
+
selector: 'input[tuiInputNumber][step]',
|
|
375
|
+
providers: [tuiAsTextfieldContent(TuiInputNumberStepButtons)],
|
|
376
|
+
hostDirectives: [TuiAppearanceProxy, TuiTextfieldContent],
|
|
377
|
+
host: {
|
|
358
378
|
'data-tui-version': TUI_VERSION,
|
|
359
379
|
'(keydown.arrowDown.prevent)': 'onStep(-step())',
|
|
360
380
|
'(keydown.arrowUp.prevent)': 'onStep(step())',
|
|
361
381
|
'[class._with-buttons]': 'step()',
|
|
362
|
-
},
|
|
382
|
+
},
|
|
383
|
+
}]
|
|
363
384
|
}] });
|
|
364
385
|
|
|
365
386
|
class TuiBigIntValueTransformer extends TuiValueTransformer {
|
|
@@ -380,10 +401,10 @@ class TuiBigIntValueTransformer extends TuiValueTransformer {
|
|
|
380
401
|
fromControlValue(controlValue) {
|
|
381
402
|
return this.mask.stringify(this.optionsTransformer.fromControlValue(controlValue));
|
|
382
403
|
}
|
|
383
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
384
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
404
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiBigIntValueTransformer, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
405
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.20", type: TuiBigIntValueTransformer, isStandalone: true, selector: "[tuiInputNumber][bigint]", providers: [tuiProvide(TuiValueTransformer, TuiBigIntValueTransformer)], usesInheritance: true, ngImport: i0 }); }
|
|
385
406
|
}
|
|
386
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TuiBigIntValueTransformer, decorators: [{
|
|
387
408
|
type: Directive,
|
|
388
409
|
args: [{
|
|
389
410
|
selector: '[tuiInputNumber][bigint]',
|
|
@@ -408,5 +429,5 @@ const TuiInputNumber = [
|
|
|
408
429
|
* Generated bundle index. Do not edit.
|
|
409
430
|
*/
|
|
410
431
|
|
|
411
|
-
export { TUI_INPUT_NUMBER_DEFAULT_OPTIONS, TUI_INPUT_NUMBER_OPTIONS, TuiBigIntQuantumValueTransformer, TuiBigIntValueTransformer, TuiInputNumber, TuiInputNumberDirective, TuiInputNumberStep, TuiInputNumberStepService, TuiNumberMask, TuiNumberValueTransformer, TuiQuantumValueTransformer, TuiQuantumValueTransformerBase, TuiWithNumberMask, tuiInputNumberOptionsProvider };
|
|
432
|
+
export { TUI_INPUT_NUMBER_DEFAULT_OPTIONS, TUI_INPUT_NUMBER_OPTIONS, TuiBigIntQuantumValueTransformer, TuiBigIntValueTransformer, TuiInputNumber, TuiInputNumberDirective, TuiInputNumberStep, TuiInputNumberStepButtons, TuiInputNumberStepService, TuiNumberMask, TuiNumberValueTransformer, TuiQuantumValueTransformer, TuiQuantumValueTransformerBase, TuiWithNumberMask, tuiInputNumberOptionsProvider };
|
|
412
433
|
//# sourceMappingURL=taiga-ui-kit-components-input-number.mjs.map
|