@taiga-ui/core 5.0.0-rc.2 → 5.0.0-rc.4

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.
Files changed (138) hide show
  1. package/components/calendar/calendar-sheet.component.d.ts +8 -15
  2. package/components/calendar/calendar-spin.component.d.ts +5 -8
  3. package/components/calendar/calendar-year.component.d.ts +11 -19
  4. package/components/calendar/calendar.component.d.ts +7 -9
  5. package/components/checkbox/checkbox.component.d.ts +10 -0
  6. package/components/checkbox/checkbox.options.d.ts +10 -0
  7. package/components/checkbox/index.d.ts +2 -0
  8. package/components/data-list/data-list.component.d.ts +1 -0
  9. package/components/index.d.ts +3 -0
  10. package/components/input/input.directive.d.ts +2 -0
  11. package/components/loader/loader.component.d.ts +0 -2
  12. package/components/radio/index.d.ts +4 -0
  13. package/components/radio/radio.component.d.ts +18 -0
  14. package/components/radio/radio.d.ts +3 -0
  15. package/components/radio/radio.directive.d.ts +8 -0
  16. package/components/radio/radio.options.d.ts +7 -0
  17. package/components/slider/helpers/key-steps.d.ts +27 -0
  18. package/components/slider/helpers/slider-key-steps.directive.d.ts +32 -0
  19. package/components/slider/helpers/slider-readonly.directive.d.ts +15 -0
  20. package/components/slider/helpers/slider-thumb-label.component.d.ts +13 -0
  21. package/components/slider/index.d.ts +6 -0
  22. package/components/slider/slider.component.d.ts +22 -0
  23. package/components/slider/slider.d.ts +5 -0
  24. package/components/textfield/index.d.ts +0 -1
  25. package/components/textfield/textfield.component.d.ts +1 -0
  26. package/directives/items-handlers/items-handlers.validator.d.ts +1 -0
  27. package/fesm2022/taiga-ui-core-components-button.mjs +2 -2
  28. package/fesm2022/taiga-ui-core-components-button.mjs.map +1 -1
  29. package/fesm2022/taiga-ui-core-components-calendar.mjs +84 -174
  30. package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
  31. package/fesm2022/taiga-ui-core-components-cell.mjs +2 -2
  32. package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -1
  33. package/fesm2022/taiga-ui-core-components-checkbox.mjs +37 -0
  34. package/fesm2022/taiga-ui-core-components-checkbox.mjs.map +1 -0
  35. package/fesm2022/taiga-ui-core-components-data-list.mjs +10 -4
  36. package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
  37. package/fesm2022/taiga-ui-core-components-error.mjs +3 -3
  38. package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
  39. package/fesm2022/taiga-ui-core-components-icon.mjs +2 -2
  40. package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
  41. package/fesm2022/taiga-ui-core-components-input.mjs +4 -2
  42. package/fesm2022/taiga-ui-core-components-input.mjs.map +1 -1
  43. package/fesm2022/taiga-ui-core-components-label.mjs +3 -3
  44. package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
  45. package/fesm2022/taiga-ui-core-components-link.mjs +2 -2
  46. package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
  47. package/fesm2022/taiga-ui-core-components-loader.mjs +5 -8
  48. package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
  49. package/fesm2022/taiga-ui-core-components-notification.mjs +2 -2
  50. package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
  51. package/fesm2022/taiga-ui-core-components-radio.mjs +91 -0
  52. package/fesm2022/taiga-ui-core-components-radio.mjs.map +1 -0
  53. package/fesm2022/taiga-ui-core-components-root.mjs +2 -2
  54. package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
  55. package/fesm2022/taiga-ui-core-components-slider.mjs +337 -0
  56. package/fesm2022/taiga-ui-core-components-slider.mjs.map +1 -0
  57. package/fesm2022/taiga-ui-core-components-spin-button.mjs +2 -2
  58. package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
  59. package/fesm2022/taiga-ui-core-components-textfield.mjs +20 -21
  60. package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
  61. package/fesm2022/taiga-ui-core-components-title.mjs +3 -3
  62. package/fesm2022/taiga-ui-core-components-title.mjs.map +1 -1
  63. package/fesm2022/taiga-ui-core-components.mjs +3 -0
  64. package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
  65. package/fesm2022/taiga-ui-core-directives-appearance.mjs +3 -3
  66. package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
  67. package/fesm2022/taiga-ui-core-directives-group.mjs +3 -3
  68. package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
  69. package/fesm2022/taiga-ui-core-directives-icons.mjs +3 -3
  70. package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
  71. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +7 -1
  72. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
  73. package/fesm2022/taiga-ui-core-portals-alert.mjs +2 -2
  74. package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -1
  75. package/fesm2022/taiga-ui-core-portals-dialog.mjs +2 -2
  76. package/fesm2022/taiga-ui-core-portals-dialog.mjs.map +1 -1
  77. package/fesm2022/taiga-ui-core-portals-dropdown.mjs +167 -115
  78. package/fesm2022/taiga-ui-core-portals-dropdown.mjs.map +1 -1
  79. package/fesm2022/taiga-ui-core-portals-hint.mjs +3 -3
  80. package/fesm2022/taiga-ui-core-portals-hint.mjs.map +1 -1
  81. package/fesm2022/taiga-ui-core-portals-modal.mjs +2 -2
  82. package/fesm2022/taiga-ui-core-portals-modal.mjs.map +1 -1
  83. package/fesm2022/taiga-ui-core-portals-popup.mjs +2 -2
  84. package/fesm2022/taiga-ui-core-portals-popup.mjs.map +1 -1
  85. package/fesm2022/taiga-ui-core-tokens.mjs +1 -1
  86. package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
  87. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
  88. package/package.json +32 -20
  89. package/portals/dropdown/dropdown-a11y.directive.d.ts +10 -0
  90. package/portals/dropdown/dropdown-close.directive.d.ts +3 -3
  91. package/portals/dropdown/dropdown-open.directive.d.ts +4 -3
  92. package/portals/dropdown/dropdown-selection.directive.d.ts +1 -0
  93. package/portals/dropdown/dropdown.d.ts +2 -1
  94. package/portals/dropdown/dropdown.directive.d.ts +5 -5
  95. package/portals/dropdown/index.d.ts +1 -0
  96. package/utils/miscellaneous/font-scaling.d.ts +2 -2
  97. package/components/textfield/textfield-icon.d.ts +0 -6
  98. package/styles/components/appearance.less +0 -51
  99. package/styles/components/button.less +0 -134
  100. package/styles/components/group.less +0 -172
  101. package/styles/components/icon.less +0 -83
  102. package/styles/components/icons.less +0 -79
  103. package/styles/components/label.less +0 -51
  104. package/styles/components/link.less +0 -69
  105. package/styles/components/notification.less +0 -184
  106. package/styles/components/textfield.less +0 -358
  107. package/styles/components/title.less +0 -80
  108. package/styles/mixins/appearance.less +0 -56
  109. package/styles/mixins/appearance.scss +0 -57
  110. package/styles/mixins/browsers.less +0 -23
  111. package/styles/mixins/browsers.scss +0 -23
  112. package/styles/mixins/date-picker.less +0 -152
  113. package/styles/mixins/mixins.less +0 -168
  114. package/styles/mixins/mixins.scss +0 -161
  115. package/styles/mixins/picker.less +0 -200
  116. package/styles/mixins/picker.scss +0 -199
  117. package/styles/mixins/slider.less +0 -67
  118. package/styles/mixins/slider.scss +0 -67
  119. package/styles/taiga-ui-fonts.less +0 -4
  120. package/styles/taiga-ui-local.less +0 -7
  121. package/styles/taiga-ui-local.scss +0 -6
  122. package/styles/taiga-ui-theme.less +0 -4
  123. package/styles/theme/appearance/accent.less +0 -14
  124. package/styles/theme/appearance/action.less +0 -38
  125. package/styles/theme/appearance/flat.less +0 -23
  126. package/styles/theme/appearance/floating.less +0 -21
  127. package/styles/theme/appearance/glass.less +0 -30
  128. package/styles/theme/appearance/outline.less +0 -78
  129. package/styles/theme/appearance/primary.less +0 -48
  130. package/styles/theme/appearance/secondary.less +0 -77
  131. package/styles/theme/appearance/status.less +0 -125
  132. package/styles/theme/appearance/table.less +0 -68
  133. package/styles/theme/appearance/textfield.less +0 -80
  134. package/styles/theme/appearance.less +0 -12
  135. package/styles/theme/palette.less +0 -161
  136. package/styles/theme/variables.less +0 -42
  137. package/styles/variables/media.less +0 -23
  138. package/styles/variables/media.scss +0 -23
@@ -0,0 +1,337 @@
1
+ import { tuiRound } from '@taiga-ui/cdk/utils/math';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, computed, input, ChangeDetectionStrategy, Component, INJECTOR, signal, effect, Directive, contentChild } from '@angular/core';
4
+ import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { NgControl, NgModel } from '@angular/forms';
6
+ import { TuiControl, TUI_IDENTITY_VALUE_TRANSFORMER } from '@taiga-ui/cdk/classes';
7
+ import { tuiWatch, tuiControlValue, tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
8
+ import { tuiFallbackValueProvider } from '@taiga-ui/cdk/tokens';
9
+ import { take, timer, switchMap, merge, tap, map, combineLatest, filter } from 'rxjs';
10
+ import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
11
+ import { tuiIsNumber } from '@taiga-ui/cdk/utils/miscellaneous';
12
+ import { tuiAsAuxiliary } from '@taiga-ui/core/tokens';
13
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
14
+ import { DOCUMENT, AsyncPipe } from '@angular/common';
15
+ import { TUI_TRUE_HANDLER, TUI_FALSE_HANDLER } from '@taiga-ui/cdk/constants';
16
+ import { tuiHintOptionsProvider } from '@taiga-ui/core/portals/hint';
17
+
18
+ /**
19
+ * Used as a limit for eliminating JS issues with floating point math
20
+ */
21
+ const TUI_FLOATING_PRECISION = 7;
22
+ function tuiFindKeyStepsBoundariesByFn(keySteps, fn) {
23
+ const keyStepUpperIndex = keySteps.findIndex((keyStep, i) => i && fn(keyStep));
24
+ const lowerStep = keySteps[keyStepUpperIndex - 1] || keySteps[0];
25
+ const upperStep = keySteps[keyStepUpperIndex] ||
26
+ keySteps[keySteps.length - 1] || [0, 0];
27
+ return [lowerStep, upperStep];
28
+ }
29
+ function tuiPercentageToKeyStepValue(valuePercentage, keySteps) {
30
+ const [[lowerStepPercent, lowerStepValue], [upperStepPercent, upperStepValue]] = tuiFindKeyStepsBoundariesByFn(keySteps, ([keyStepPercentage, _]) => valuePercentage <= keyStepPercentage);
31
+ const ratio = (valuePercentage - lowerStepPercent) / (upperStepPercent - lowerStepPercent);
32
+ const controlValue = (upperStepValue - lowerStepValue) * ratio + lowerStepValue;
33
+ return tuiRound(controlValue, TUI_FLOATING_PRECISION);
34
+ }
35
+ function tuiKeyStepValueToPercentage(value, keySteps) {
36
+ const [[lowerStepPercent, lowerStepValue], [upperStepPercent, upperStepValue]] = tuiFindKeyStepsBoundariesByFn(keySteps, ([_, keyStepValue]) => value <= keyStepValue);
37
+ const ratio = (value - lowerStepValue) / (upperStepValue - lowerStepValue) || 0;
38
+ return (upperStepPercent - lowerStepPercent) * ratio + lowerStepPercent;
39
+ }
40
+ function tuiCreateKeyStepsTransformer(keySteps) {
41
+ return new (class {
42
+ fromControlValue(controlValue) {
43
+ return tuiKeyStepValueToPercentage(controlValue, keySteps) / 100;
44
+ }
45
+ toControlValue(ratio) {
46
+ return tuiPercentageToKeyStepValue(ratio * 100, keySteps);
47
+ }
48
+ })();
49
+ }
50
+
51
+ class TuiSliderComponent {
52
+ constructor() {
53
+ this.control = inject(NgControl, { self: true, optional: true });
54
+ this.ticksGradient = computed((segments = this.segments()) => this.getTicksGradient(segments));
55
+ this.segments = input([1], {
56
+ alias: 'segments',
57
+ transform: (x) => tuiIsNumber(x) ? Array.from({ length: x }, (_, i) => i / x) : x,
58
+ });
59
+ this.el = tuiInjectElement();
60
+ this.keySteps = inject(TuiSliderKeyStepsBase, {
61
+ self: true,
62
+ optional: true,
63
+ });
64
+ if (this.control instanceof NgModel) {
65
+ /**
66
+ * The ValueAccessor.writeValue method is called twice on any value accessor during component initialization,
67
+ * when a control is bound using [(ngModel)], first time with a phantom null value.
68
+ * With `changeDetection: ChangeDetectionStrategy.OnPush` the second call of writeValue with real value don't re-render the view.
69
+ * ___
70
+ * See this {@link https://github.com/angular/angular/issues/14988 issue}
71
+ */
72
+ this.control.valueChanges?.pipe(tuiWatch(), take(1)).subscribe();
73
+ }
74
+ }
75
+ get valueRatio() {
76
+ return (this.value - this.min) / (this.max - this.min) || 0;
77
+ }
78
+ get min() {
79
+ return Number(this.el.min);
80
+ }
81
+ set min(x) {
82
+ this.el.min = String(x);
83
+ }
84
+ get max() {
85
+ return Number(this.el.max || 100);
86
+ }
87
+ set max(x) {
88
+ this.el.max = String(x);
89
+ }
90
+ get step() {
91
+ if (!this.el.step) {
92
+ return 1;
93
+ }
94
+ return this.el.step === 'any' ? 0 : Number(this.el.step);
95
+ }
96
+ set step(x) {
97
+ this.el.step = String(x);
98
+ }
99
+ get value() {
100
+ /**
101
+ * If developer uses `[(ngModel)]` and programmatically change value,
102
+ * the `el.nativeElement.value` is equal to the previous value at this moment
103
+ * (it will be updated only in next microtask).
104
+ * @see https://github.com/angular/angular/issues/13568
105
+ */
106
+ if (this.control instanceof NgModel) {
107
+ const transformer = this.keySteps?.transformer();
108
+ const value = this.keySteps && transformer
109
+ ? this.keySteps.toSliderValue(transformer.fromControlValue(this.control.value))
110
+ : this.control.viewModel;
111
+ return this.step
112
+ ? tuiRound(Math.round(value / this.step) * this.step, TUI_FLOATING_PRECISION)
113
+ : value;
114
+ }
115
+ return Number(this.el.value) || 0;
116
+ }
117
+ set value(newValue) {
118
+ this.el.value = `${newValue}`;
119
+ }
120
+ getTicksGradient(segments) {
121
+ if (segments.length <= 1) {
122
+ return 'linear-gradient(to right, transparent 0 100%)';
123
+ }
124
+ const percentages = segments
125
+ .filter((segment) => segment > 0 && segment < 1)
126
+ .map((segment) => segment * 100);
127
+ return percentages.reduce((acc, segment, index) => `${acc}
128
+ var(--tui-text-tertiary) ${segment}% calc(${segment}% + var(--t-tick-thickness)),
129
+ transparent ${segment}% ${percentages[index + 1] ?? 100}%${percentages[index + 1] ? ',' : ')'}
130
+ `, `linear-gradient(to right, transparent 0 ${percentages[0]}%,`);
131
+ }
132
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
133
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.18", type: TuiSliderComponent, isStandalone: true, selector: "input[type=range][tuiSlider]", inputs: { segments: { classPropertyName: "segments", publicName: "segments", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "0" }, properties: { "style.--tui-ticks-gradient": "ticksGradient()", "style.--tui-slider-fill-ratio": "valueRatio" } }, providers: [tuiAsAuxiliary(TuiSliderComponent)], ngImport: i0, template: '', isInline: true, styles: [":host{--t-tick-thickness: .25rem;position:relative;display:block;inline-size:100%;color:var(--tui-background-accent-1);cursor:pointer;-webkit-appearance:none;appearance:none;block-size:max(var(--tui-thumb-size, .75rem),1rem);padding:calc((max(var(--tui-thumb-size, .75rem),1rem) - max(calc(calc(var(--tui-thumb-size, .75rem) / 2) - .25rem),.125rem))/2) 0;box-sizing:border-box;outline:none;border-radius:1rem/3rem;background:var(--tui-ticks-gradient) no-repeat calc((var(--tui-thumb-size, .75rem) - var(--t-tick-thickness)) / 2) / calc(100% - var(--tui-thumb-size, .75rem)),linear-gradient(to var(--tui-inline-end),currentColor calc(100% * var(--tui-slider-fill-ratio)),transparent calc(100% * var(--tui-slider-fill-ratio))),var(--tui-background-neutral-2);background-clip:content-box}:host:active{cursor:ew-resize}:host:active:before{opacity:.2;transform:var(--tui-slider-thumb-transform, scale(1)) scale(2.33)}:host:disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}:host:before{transition-property:transform,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:calc(max(calc(1rem - var(--tui-thumb-size, .75rem)),0rem)/2);inset-inline-start:var(--t-left);inline-size:var(--tui-thumb-size, .75rem);block-size:var(--tui-thumb-size, .75rem);border-radius:50%;transform:var(--tui-slider-thumb-transform, scale(1));background:currentColor;opacity:0;--t-left: calc(var(--tui-slider-fill-ratio) * 100% - var(--tui-slider-fill-ratio) * var(--tui-thumb-size, .75rem))}:host:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 2px inset var(--tui-border-focus)}:host:focus-visible::-moz-range-thumb{box-shadow:0 0 0 2px inset var(--tui-border-focus)}:host::-webkit-slider-thumb{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;isolation:isolate;-webkit-appearance:none;appearance:none;background-color:currentColor;box-shadow:none;border-radius:50%;block-size:var(--tui-thumb-size, .75rem);inline-size:var(--tui-thumb-size, .75rem);box-sizing:content-box;background-clip:content-box;border:calc(max(calc(1rem - var(--tui-thumb-size, .75rem)),0rem)/2) solid transparent;border-inline-start:0;border-inline-end:0;transform:var(--tui-slider-thumb-transform, scale(1))}:not(:disabled):host::-webkit-slider-thumb{cursor:ew-resize}:not(:disabled):host::-webkit-slider-thumb:hover,:active:not(:disabled):host::-webkit-slider-thumb{transform:var(--tui-slider-thumb-transform, scale(1)) scale(1.333)}:host::-moz-range-thumb{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;isolation:isolate;-webkit-appearance:none;appearance:none;background-color:currentColor;box-shadow:none;border-radius:50%;block-size:var(--tui-thumb-size, .75rem);inline-size:var(--tui-thumb-size, .75rem);box-sizing:content-box;background-clip:content-box;border:calc(max(calc(1rem - var(--tui-thumb-size, .75rem)),0rem)/2) solid transparent;border-inline-start:0;border-inline-end:0;transform:var(--tui-slider-thumb-transform, scale(1))}:not(:disabled):host::-moz-range-thumb{cursor:ew-resize}:not(:disabled):host::-moz-range-thumb:hover,:active:not(:disabled):host::-moz-range-thumb{transform:var(--tui-slider-thumb-transform, scale(1)) scale(1.333)}:host::-moz-range-progress{opacity:0}:host-context(tui-textfield) :host([type=\"range\"]){position:absolute;inset:100% var(--t-padding) 0;inline-size:auto;margin:calc(-.5*max(calc(calc(var(--tui-thumb-size, .75rem) / 2) - .25rem),.125rem)) 0 0;transform:translateY(-50%);background-color:transparent;pointer-events:auto}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
134
+ }
135
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSliderComponent, decorators: [{
136
+ type: Component,
137
+ args: [{ selector: 'input[type=range][tuiSlider]', template: '', changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsAuxiliary(TuiSliderComponent)], host: {
138
+ /**
139
+ * For change detection.
140
+ * Webkit does not have built-in method for customization of filling progress (as Firefox).
141
+ * We draw filling of progress by `background: linear-gradient(...)` of the track.
142
+ * This function triggers change detection (for {@link valueRatio} getter) when we drag thumb of the input.
143
+ */
144
+ '(input)': '0',
145
+ '[style.--tui-ticks-gradient]': 'ticksGradient()',
146
+ '[style.--tui-slider-fill-ratio]': 'valueRatio',
147
+ }, styles: [":host{--t-tick-thickness: .25rem;position:relative;display:block;inline-size:100%;color:var(--tui-background-accent-1);cursor:pointer;-webkit-appearance:none;appearance:none;block-size:max(var(--tui-thumb-size, .75rem),1rem);padding:calc((max(var(--tui-thumb-size, .75rem),1rem) - max(calc(calc(var(--tui-thumb-size, .75rem) / 2) - .25rem),.125rem))/2) 0;box-sizing:border-box;outline:none;border-radius:1rem/3rem;background:var(--tui-ticks-gradient) no-repeat calc((var(--tui-thumb-size, .75rem) - var(--t-tick-thickness)) / 2) / calc(100% - var(--tui-thumb-size, .75rem)),linear-gradient(to var(--tui-inline-end),currentColor calc(100% * var(--tui-slider-fill-ratio)),transparent calc(100% * var(--tui-slider-fill-ratio))),var(--tui-background-neutral-2);background-clip:content-box}:host:active{cursor:ew-resize}:host:active:before{opacity:.2;transform:var(--tui-slider-thumb-transform, scale(1)) scale(2.33)}:host:disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}:host:before{transition-property:transform,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:calc(max(calc(1rem - var(--tui-thumb-size, .75rem)),0rem)/2);inset-inline-start:var(--t-left);inline-size:var(--tui-thumb-size, .75rem);block-size:var(--tui-thumb-size, .75rem);border-radius:50%;transform:var(--tui-slider-thumb-transform, scale(1));background:currentColor;opacity:0;--t-left: calc(var(--tui-slider-fill-ratio) * 100% - var(--tui-slider-fill-ratio) * var(--tui-thumb-size, .75rem))}:host:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 2px inset var(--tui-border-focus)}:host:focus-visible::-moz-range-thumb{box-shadow:0 0 0 2px inset var(--tui-border-focus)}:host::-webkit-slider-thumb{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;isolation:isolate;-webkit-appearance:none;appearance:none;background-color:currentColor;box-shadow:none;border-radius:50%;block-size:var(--tui-thumb-size, .75rem);inline-size:var(--tui-thumb-size, .75rem);box-sizing:content-box;background-clip:content-box;border:calc(max(calc(1rem - var(--tui-thumb-size, .75rem)),0rem)/2) solid transparent;border-inline-start:0;border-inline-end:0;transform:var(--tui-slider-thumb-transform, scale(1))}:not(:disabled):host::-webkit-slider-thumb{cursor:ew-resize}:not(:disabled):host::-webkit-slider-thumb:hover,:active:not(:disabled):host::-webkit-slider-thumb{transform:var(--tui-slider-thumb-transform, scale(1)) scale(1.333)}:host::-moz-range-thumb{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;isolation:isolate;-webkit-appearance:none;appearance:none;background-color:currentColor;box-shadow:none;border-radius:50%;block-size:var(--tui-thumb-size, .75rem);inline-size:var(--tui-thumb-size, .75rem);box-sizing:content-box;background-clip:content-box;border:calc(max(calc(1rem - var(--tui-thumb-size, .75rem)),0rem)/2) solid transparent;border-inline-start:0;border-inline-end:0;transform:var(--tui-slider-thumb-transform, scale(1))}:not(:disabled):host::-moz-range-thumb{cursor:ew-resize}:not(:disabled):host::-moz-range-thumb:hover,:active:not(:disabled):host::-moz-range-thumb{transform:var(--tui-slider-thumb-transform, scale(1)) scale(1.333)}:host::-moz-range-progress{opacity:0}:host-context(tui-textfield) :host([type=\"range\"]){position:absolute;inset:100% var(--t-padding) 0;inline-size:auto;margin:calc(-.5*max(calc(calc(var(--tui-thumb-size, .75rem) / 2) - .25rem),.125rem)) 0 0;transform:translateY(-50%);background-color:transparent;pointer-events:auto}\n"] }]
148
+ }], ctorParameters: () => [] });
149
+
150
+ class TuiSliderKeyStepsBase {
151
+ constructor() {
152
+ this.injector = inject(INJECTOR);
153
+ this.control = inject(NgControl, { self: true, optional: true });
154
+ this.min = signal(undefined);
155
+ this.max = signal(undefined);
156
+ this.sync = effect(() => {
157
+ const steps = this.keySteps();
158
+ this.transformer.set(steps && tuiCreateKeyStepsTransformer(steps));
159
+ this.min.set(steps?.[0][1]);
160
+ this.max.set(steps?.[steps.length - 1]?.[1]);
161
+ });
162
+ this.step = input(1);
163
+ this.keySteps = input();
164
+ this.transformer = signal(undefined);
165
+ this.controlValue = toSignal(timer(0) // https://github.com/angular/angular/issues/54418
166
+ .pipe(switchMap(() => tuiControlValue(this.control))));
167
+ this.totalSteps = computed(() =>
168
+ /**
169
+ * Not-integer amount of steps is invalid usage of native sliders
170
+ * ```html
171
+ * <input type="range" [max]="100" [step]="3.33" />
172
+ * ```
173
+ * (impossible to select 100; 99.9 is max allowed value)
174
+ */
175
+ Math.round(100 / this.step()));
176
+ }
177
+ ngOnInit() {
178
+ this.slider = this.injector.get(TuiSliderComponent);
179
+ }
180
+ takeStep(coefficient) {
181
+ const newValue = this.slider.value + coefficient;
182
+ return (this.transformer()?.toControlValue((this.slider.value + coefficient) / this.totalSteps()) ?? newValue);
183
+ }
184
+ toSliderValue(fraction) {
185
+ return this.transformer() ? fraction * this.totalSteps() : fraction;
186
+ }
187
+ setControlValue(controlValue) {
188
+ const fraction = this.transformer()?.fromControlValue(controlValue) ?? controlValue;
189
+ this.slider.value = this.toSliderValue(fraction);
190
+ }
191
+ getControlValue() {
192
+ const { value } = this.slider;
193
+ return this.transformer()?.toControlValue(value / this.totalSteps()) ?? value;
194
+ }
195
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSliderKeyStepsBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
196
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.18", type: TuiSliderKeyStepsBase, isStandalone: true, selector: "input[tuiSlider][keySteps]", inputs: { step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, keySteps: { classPropertyName: "keySteps", publicName: "keySteps", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.min": "transformer() ? 0 : slider?.min", "attr.step": "transformer() ? 1 : step()", "attr.max": "transformer() ? totalSteps() : slider?.max", "attr.aria-valuemin": "min()", "attr.aria-valuemax": "max()", "attr.aria-valuenow": "controlValue()" } }, ngImport: i0 }); }
197
+ }
198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSliderKeyStepsBase, decorators: [{
199
+ type: Directive,
200
+ args: [{
201
+ selector: 'input[tuiSlider][keySteps]',
202
+ host: {
203
+ '[attr.min]': 'transformer() ? 0 : slider?.min',
204
+ '[attr.step]': 'transformer() ? 1 : step()',
205
+ '[attr.max]': 'transformer() ? totalSteps() : slider?.max',
206
+ '[attr.aria-valuemin]': 'min()',
207
+ '[attr.aria-valuemax]': 'max()',
208
+ '[attr.aria-valuenow]': 'controlValue()',
209
+ },
210
+ }]
211
+ }] });
212
+ class TuiSliderKeySteps extends TuiControl {
213
+ constructor() {
214
+ super(...arguments);
215
+ this.base = inject(TuiSliderKeyStepsBase);
216
+ }
217
+ set keySteps(steps) {
218
+ this.transformer = steps
219
+ ? tuiCreateKeyStepsTransformer(steps)
220
+ : TUI_IDENTITY_VALUE_TRANSFORMER;
221
+ }
222
+ setValue(sliderValue) {
223
+ this.onChange(this.base.transformer() ? sliderValue / this.base.totalSteps() : sliderValue);
224
+ }
225
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSliderKeySteps, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
226
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.18", type: TuiSliderKeySteps, isStandalone: true, selector: "input[tuiSlider][keySteps][ngModel],input[tuiSlider][keySteps][formControl],input[tuiSlider][keySteps][formControlName]", inputs: { keySteps: "keySteps" }, host: { listeners: { "blur": "onTouched()", "input": "setValue($event.target.value)", "change": "setValue($event.target.value)" }, properties: { "value": "base.toSliderValue(value())", "disabled": "disabled()" } }, providers: [tuiFallbackValueProvider(0)], usesInheritance: true, ngImport: i0 }); }
227
+ }
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSliderKeySteps, decorators: [{
229
+ type: Directive,
230
+ args: [{
231
+ selector: 'input[tuiSlider][keySteps][ngModel],input[tuiSlider][keySteps][formControl],input[tuiSlider][keySteps][formControlName]',
232
+ inputs: ['keySteps'],
233
+ providers: [tuiFallbackValueProvider(0)],
234
+ host: {
235
+ '[value]': 'base.toSliderValue(value())',
236
+ '[disabled]': 'disabled()',
237
+ '(blur)': 'onTouched()',
238
+ '(input)': 'setValue($event.target.value)',
239
+ '(change)': 'setValue($event.target.value)',
240
+ },
241
+ }]
242
+ }] });
243
+
244
+ const SLIDER_INTERACTION_KEYS = new Set([
245
+ 'ArrowDown',
246
+ 'ArrowLeft',
247
+ 'ArrowRight',
248
+ 'ArrowUp',
249
+ 'End',
250
+ 'Home',
251
+ 'PageDown',
252
+ 'PageUp',
253
+ ]);
254
+ /**
255
+ * Native <input type='range' readonly> doesn't work.
256
+ * This directive imitates this native behaviour.
257
+ */
258
+ class TuiSliderReadonly {
259
+ constructor() {
260
+ this.el = tuiInjectElement();
261
+ this.doc = inject(DOCUMENT);
262
+ this.readonly = input(true, { transform: coerceBooleanProperty });
263
+ const touchStart$ = tuiTypedFromEvent(this.el, 'touchstart', { passive: false });
264
+ const touchMove$ = tuiTypedFromEvent(this.doc, 'touchmove', { passive: false });
265
+ const touchEnd$ = tuiTypedFromEvent(this.doc, 'touchend', { passive: true });
266
+ const shouldPreventMove$ = merge(touchStart$.pipe(tap((e) => this.preventEvent(e)), map(TUI_TRUE_HANDLER)), touchEnd$.pipe(map(TUI_FALSE_HANDLER)));
267
+ /**
268
+ * @bad TODO think about another solution.
269
+ * Keep in mind that preventing touch event (on slider) inside `@HostListener('touchstart')` doesn't work for mobile chrome.
270
+ */
271
+ combineLatest([touchMove$, shouldPreventMove$])
272
+ .pipe(filter(([_, shouldPreventMove]) => shouldPreventMove), takeUntilDestroyed())
273
+ .subscribe(([moveEvent]) => this.preventEvent(moveEvent));
274
+ }
275
+ preventEvent(event) {
276
+ if (event.cancelable && this.readonly()) {
277
+ event.preventDefault();
278
+ }
279
+ }
280
+ preventKeyboardInteraction(event) {
281
+ if (SLIDER_INTERACTION_KEYS.has(event.key)) {
282
+ this.preventEvent(event);
283
+ }
284
+ }
285
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSliderReadonly, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
286
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.18", type: TuiSliderReadonly, isStandalone: true, selector: "input[tuiSlider][readonly]", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "preventKeyboardInteraction($event)", "mousedown": "preventEvent($event)" } }, ngImport: i0 }); }
287
+ }
288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSliderReadonly, decorators: [{
289
+ type: Directive,
290
+ args: [{
291
+ selector: 'input[tuiSlider][readonly]',
292
+ host: {
293
+ '(keydown)': 'preventKeyboardInteraction($event)',
294
+ '(mousedown)': 'preventEvent($event)',
295
+ },
296
+ }]
297
+ }], ctorParameters: () => [] });
298
+
299
+ /// <reference types="@taiga-ui/tsconfig/ng-dev-mode" />
300
+ class TuiSliderThumbLabel {
301
+ constructor() {
302
+ this.slider = contentChild(TuiSliderComponent);
303
+ this.control = contentChild(NgControl);
304
+ }
305
+ ngAfterContentInit() {
306
+ ngDevMode &&
307
+ console.assert(Boolean(this.control()?.valueChanges), '\n[tuiSliderThumbLabel] expected <input tuiSlider type="range" /> to use Angular Forms.\n' +
308
+ 'Use [(ngModel)] or [formControl] or formControlName for correct work.');
309
+ }
310
+ get ratio() {
311
+ return this.slider()?.valueRatio || 0;
312
+ }
313
+ get ghostStart() {
314
+ return this.ratio * (this.slider()?.el.offsetWidth || 0);
315
+ }
316
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSliderThumbLabel, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
317
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: TuiSliderThumbLabel, isStandalone: true, selector: "[tuiSliderThumbLabel]", providers: [tuiHintOptionsProvider({ direction: 'top', appearance: 'floating' })], queries: [{ propertyName: "slider", first: true, predicate: TuiSliderComponent, descendants: true, isSignal: true }, { propertyName: "control", first: true, predicate: NgControl, descendants: true, isSignal: true }], ngImport: i0, template: "@if (control()?.valueChanges | async) {}\n\n<div\n class=\"t-ghost\"\n [style.--tui-slider-thumb-ratio]=\"ratio\"\n [style.inset-inline-start.px]=\"ghostStart\"\n>\n <ng-content />\n</div>\n\n<ng-content select=\"input[type=range]\" />\n", styles: [":host{position:relative}.t-ghost{position:absolute;inset-block:0;margin:auto;border-radius:50%;pointer-events:none;inline-size:var(--tui-thumb-size, .75rem);block-size:var(--tui-thumb-size, .75rem);transform:translate(calc(var(--tui-slider-thumb-ratio) * var(--tui-thumb-size, .75rem) * -1 * var(--tui-inline)))}:host-context([dir=\"rtl\"]) .t-ghost{left:unset!important}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
318
+ }
319
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSliderThumbLabel, decorators: [{
320
+ type: Component,
321
+ args: [{ selector: '[tuiSliderThumbLabel]', imports: [AsyncPipe], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiHintOptionsProvider({ direction: 'top', appearance: 'floating' })], template: "@if (control()?.valueChanges | async) {}\n\n<div\n class=\"t-ghost\"\n [style.--tui-slider-thumb-ratio]=\"ratio\"\n [style.inset-inline-start.px]=\"ghostStart\"\n>\n <ng-content />\n</div>\n\n<ng-content select=\"input[type=range]\" />\n", styles: [":host{position:relative}.t-ghost{position:absolute;inset-block:0;margin:auto;border-radius:50%;pointer-events:none;inline-size:var(--tui-thumb-size, .75rem);block-size:var(--tui-thumb-size, .75rem);transform:translate(calc(var(--tui-slider-thumb-ratio) * var(--tui-thumb-size, .75rem) * -1 * var(--tui-inline)))}:host-context([dir=\"rtl\"]) .t-ghost{left:unset!important}\n"] }]
322
+ }] });
323
+
324
+ const TuiSlider = [
325
+ TuiSliderComponent,
326
+ TuiSliderThumbLabel,
327
+ TuiSliderKeyStepsBase,
328
+ TuiSliderKeySteps,
329
+ TuiSliderReadonly,
330
+ ];
331
+
332
+ /**
333
+ * Generated bundle index. Do not edit.
334
+ */
335
+
336
+ export { TUI_FLOATING_PRECISION, TuiSlider, TuiSliderComponent, TuiSliderKeySteps, TuiSliderKeyStepsBase, TuiSliderReadonly, TuiSliderThumbLabel, tuiCreateKeyStepsTransformer, tuiKeyStepValueToPercentage, tuiPercentageToKeyStepValue };
337
+ //# sourceMappingURL=taiga-ui-core-components-slider.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taiga-ui-core-components-slider.mjs","sources":["../../../projects/core/components/slider/helpers/key-steps.ts","../../../projects/core/components/slider/slider.component.ts","../../../projects/core/components/slider/helpers/slider-key-steps.directive.ts","../../../projects/core/components/slider/helpers/slider-readonly.directive.ts","../../../projects/core/components/slider/helpers/slider-thumb-label.component.ts","../../../projects/core/components/slider/helpers/slider-thumb-label.template.html","../../../projects/core/components/slider/slider.ts","../../../projects/core/components/slider/taiga-ui-core-components-slider.ts"],"sourcesContent":["import {type TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport {tuiRound} from '@taiga-ui/cdk/utils/math';\n\n/**\n * Used as a limit for eliminating JS issues with floating point math\n */\nexport const TUI_FLOATING_PRECISION = 7;\n\n/**\n * Steps for splitting sliders into different linear dependencies.\n * Each element of the array has the form [percent, value]\n *\n * Thus, to set a field from 50,000 to 30,000,000 in steps:\n * 1) From 50 000 to 200 000 by 5000 per step (30 steps)\n * 2) From 200 000 to 1 000 000 by 50 000 per step (16 steps)\n * 3) From 1 000 000 to 30 000 000 by 500 000 per step (58 steps)\n *\n * You need to pass the following keyStep (where 104 = 30 + 16 + 58 is the total number of steps):\n * [\n * [0, 50_000],\n * [100 / 104 * 30, 200_000],\n * [100 / 104 * (30 + 16), 1_000_000],\n * [100, 30_000_000],\n * ];\n *\n */\nexport type TuiKeySteps = [[0, number], ...Array<[number, number]>, [100, number]];\n\nfunction tuiFindKeyStepsBoundariesByFn(\n keySteps: TuiKeySteps,\n fn: ([keyStepPercent, keyStepValue]: [number, number]) => boolean,\n): [[number, number], [number, number]] {\n const keyStepUpperIndex = keySteps.findIndex((keyStep, i) => i && fn(keyStep));\n\n const lowerStep = keySteps[keyStepUpperIndex - 1] || keySteps[0];\n const upperStep = keySteps[keyStepUpperIndex] ||\n keySteps[keySteps.length - 1] || [0, 0];\n\n return [lowerStep, upperStep];\n}\n\nexport function tuiPercentageToKeyStepValue(\n valuePercentage: number,\n keySteps: TuiKeySteps,\n): number {\n const [[lowerStepPercent, lowerStepValue], [upperStepPercent, upperStepValue]] =\n tuiFindKeyStepsBoundariesByFn(\n keySteps,\n ([keyStepPercentage, _]) => valuePercentage <= keyStepPercentage,\n );\n const ratio =\n (valuePercentage - lowerStepPercent) / (upperStepPercent - lowerStepPercent);\n const controlValue = (upperStepValue - lowerStepValue) * ratio + lowerStepValue;\n\n return tuiRound(controlValue, TUI_FLOATING_PRECISION);\n}\n\nexport function tuiKeyStepValueToPercentage(\n value: number,\n keySteps: TuiKeySteps,\n): number {\n const [[lowerStepPercent, lowerStepValue], [upperStepPercent, upperStepValue]] =\n tuiFindKeyStepsBoundariesByFn(\n keySteps,\n ([_, keyStepValue]) => value <= keyStepValue,\n );\n const ratio = (value - lowerStepValue) / (upperStepValue - lowerStepValue) || 0;\n\n return (upperStepPercent - lowerStepPercent) * ratio + lowerStepPercent;\n}\n\nexport function tuiCreateKeyStepsTransformer(\n keySteps: TuiKeySteps,\n): TuiValueTransformer<number, number> {\n return new (class implements TuiValueTransformer<number, number> {\n public fromControlValue(controlValue: number): number {\n return tuiKeyStepValueToPercentage(controlValue, keySteps) / 100;\n }\n\n public toControlValue(ratio: number): number {\n return tuiPercentageToKeyStepValue(ratio * 100, keySteps);\n }\n })();\n}\n","import {ChangeDetectionStrategy, Component, computed, inject, input} from '@angular/core';\nimport {NgControl, NgModel} from '@angular/forms';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiRound} from '@taiga-ui/cdk/utils/math';\nimport {tuiIsNumber} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {tuiAsAuxiliary} from '@taiga-ui/core/tokens';\nimport {take} from 'rxjs';\n\nimport {TUI_FLOATING_PRECISION} from './helpers/key-steps';\nimport {TuiSliderKeyStepsBase} from './helpers/slider-key-steps.directive';\n\n@Component({\n selector: 'input[type=range][tuiSlider]',\n template: '',\n styleUrl: './slider.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiAsAuxiliary(TuiSliderComponent)],\n host: {\n /**\n * For change detection.\n * Webkit does not have built-in method for customization of filling progress (as Firefox).\n * We draw filling of progress by `background: linear-gradient(...)` of the track.\n * This function triggers change detection (for {@link valueRatio} getter) when we drag thumb of the input.\n */\n '(input)': '0',\n '[style.--tui-ticks-gradient]': 'ticksGradient()',\n '[style.--tui-slider-fill-ratio]': 'valueRatio',\n },\n})\nexport class TuiSliderComponent {\n private readonly control = inject(NgControl, {self: true, optional: true});\n\n protected readonly ticksGradient = computed((segments = this.segments()) =>\n this.getTicksGradient(segments),\n );\n\n public readonly segments = input([1], {\n alias: 'segments',\n transform: (x: number | readonly number[]): readonly number[] =>\n tuiIsNumber(x) ? Array.from({length: x}, (_, i) => i / x) : x,\n });\n\n public readonly el = tuiInjectElement<HTMLInputElement>();\n public readonly keySteps = inject(TuiSliderKeyStepsBase, {\n self: true,\n optional: true,\n });\n\n constructor() {\n if (this.control instanceof NgModel) {\n /**\n * The ValueAccessor.writeValue method is called twice on any value accessor during component initialization,\n * when a control is bound using [(ngModel)], first time with a phantom null value.\n * With `changeDetection: ChangeDetectionStrategy.OnPush` the second call of writeValue with real value don't re-render the view.\n * ___\n * See this {@link https://github.com/angular/angular/issues/14988 issue}\n */\n this.control.valueChanges?.pipe(tuiWatch(), take(1)).subscribe();\n }\n }\n\n public get valueRatio(): number {\n return (this.value - this.min) / (this.max - this.min) || 0;\n }\n\n public get min(): number {\n return Number(this.el.min);\n }\n\n public set min(x: number) {\n this.el.min = String(x);\n }\n\n public get max(): number {\n return Number(this.el.max || 100);\n }\n\n public set max(x: number) {\n this.el.max = String(x);\n }\n\n public get step(): number {\n if (!this.el.step) {\n return 1;\n }\n\n return this.el.step === 'any' ? 0 : Number(this.el.step);\n }\n\n public set step(x: number) {\n this.el.step = String(x);\n }\n\n public get value(): number {\n /**\n * If developer uses `[(ngModel)]` and programmatically change value,\n * the `el.nativeElement.value` is equal to the previous value at this moment\n * (it will be updated only in next microtask).\n * @see https://github.com/angular/angular/issues/13568\n */\n if (this.control instanceof NgModel) {\n const transformer = this.keySteps?.transformer();\n const value =\n this.keySteps && transformer\n ? this.keySteps.toSliderValue(\n transformer.fromControlValue(this.control.value),\n )\n : this.control.viewModel;\n\n return this.step\n ? tuiRound(\n Math.round(value / this.step) * this.step,\n TUI_FLOATING_PRECISION,\n )\n : value;\n }\n\n return Number(this.el.value) || 0;\n }\n\n public set value(newValue: number) {\n this.el.value = `${newValue}`;\n }\n\n protected getTicksGradient(segments: readonly number[]): string {\n if (segments.length <= 1) {\n return 'linear-gradient(to right, transparent 0 100%)';\n }\n\n const percentages = segments\n .filter((segment) => segment > 0 && segment < 1)\n .map((segment) => segment * 100);\n\n return percentages.reduce(\n (acc, segment, index) =>\n `${acc}\n var(--tui-text-tertiary) ${segment}% calc(${segment}% + var(--t-tick-thickness)),\n transparent ${segment}% ${percentages[index + 1] ?? 100}%${percentages[index + 1] ? ',' : ')'}\n `,\n `linear-gradient(to right, transparent 0 ${percentages[0]}%,`,\n );\n }\n}\n","import {\n computed,\n Directive,\n effect,\n inject,\n INJECTOR,\n input,\n type OnInit,\n signal,\n} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {NgControl} from '@angular/forms';\nimport {\n TUI_IDENTITY_VALUE_TRANSFORMER,\n TuiControl,\n type TuiValueTransformer,\n} from '@taiga-ui/cdk/classes';\nimport {tuiControlValue} from '@taiga-ui/cdk/observables';\nimport {tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {switchMap, timer} from 'rxjs';\n\nimport {TuiSliderComponent} from '../slider.component';\nimport {tuiCreateKeyStepsTransformer, type TuiKeySteps} from './key-steps';\n\n@Directive({\n selector: 'input[tuiSlider][keySteps]',\n host: {\n '[attr.min]': 'transformer() ? 0 : slider?.min',\n '[attr.step]': 'transformer() ? 1 : step()',\n '[attr.max]': 'transformer() ? totalSteps() : slider?.max',\n '[attr.aria-valuemin]': 'min()',\n '[attr.aria-valuemax]': 'max()',\n '[attr.aria-valuenow]': 'controlValue()',\n },\n})\nexport class TuiSliderKeyStepsBase implements OnInit {\n private readonly injector = inject(INJECTOR);\n private readonly control = inject(NgControl, {self: true, optional: true});\n\n protected readonly min = signal<number | undefined>(undefined);\n protected readonly max = signal<number | undefined>(undefined);\n protected readonly sync = effect(() => {\n const steps = this.keySteps();\n\n this.transformer.set(steps && tuiCreateKeyStepsTransformer(steps));\n this.min.set(steps?.[0][1]);\n this.max.set(steps?.[steps.length - 1]?.[1]);\n });\n\n public slider!: TuiSliderComponent;\n public readonly step = input(1);\n public readonly keySteps = input<TuiKeySteps>();\n public readonly transformer = signal<TuiValueTransformer<number, number> | undefined>(\n undefined,\n );\n\n public controlValue = toSignal(\n timer(0) // https://github.com/angular/angular/issues/54418\n .pipe(switchMap(() => tuiControlValue<number>(this.control))),\n );\n\n public readonly totalSteps = computed(() =>\n /**\n * Not-integer amount of steps is invalid usage of native sliders\n * ```html\n * <input type=\"range\" [max]=\"100\" [step]=\"3.33\" />\n * ```\n * (impossible to select 100; 99.9 is max allowed value)\n */\n Math.round(100 / this.step()),\n );\n\n public ngOnInit(): void {\n this.slider = this.injector.get(TuiSliderComponent);\n }\n\n public takeStep(coefficient: number): number {\n const newValue = this.slider.value + coefficient;\n\n return (\n this.transformer()?.toControlValue(\n (this.slider.value + coefficient) / this.totalSteps(),\n ) ?? newValue\n );\n }\n\n public toSliderValue(fraction: number): number {\n return this.transformer() ? fraction * this.totalSteps() : fraction;\n }\n\n public setControlValue(controlValue: number): void {\n const fraction =\n this.transformer()?.fromControlValue(controlValue) ?? controlValue;\n\n this.slider.value = this.toSliderValue(fraction);\n }\n\n public getControlValue(): number {\n const {value} = this.slider;\n\n return this.transformer()?.toControlValue(value / this.totalSteps()) ?? value;\n }\n}\n\n@Directive({\n selector:\n 'input[tuiSlider][keySteps][ngModel],input[tuiSlider][keySteps][formControl],input[tuiSlider][keySteps][formControlName]',\n inputs: ['keySteps'],\n providers: [tuiFallbackValueProvider(0)],\n host: {\n '[value]': 'base.toSliderValue(value())',\n '[disabled]': 'disabled()',\n '(blur)': 'onTouched()',\n '(input)': 'setValue($event.target.value)',\n '(change)': 'setValue($event.target.value)',\n },\n})\nexport class TuiSliderKeySteps extends TuiControl<number> {\n protected readonly base = inject(TuiSliderKeyStepsBase);\n\n public set keySteps(steps: TuiKeySteps | null | undefined) {\n this.transformer = steps\n ? tuiCreateKeyStepsTransformer(steps)\n : TUI_IDENTITY_VALUE_TRANSFORMER;\n }\n\n protected setValue(sliderValue: number): void {\n this.onChange(\n this.base.transformer() ? sliderValue / this.base.totalSteps() : sliderValue,\n );\n }\n}\n","import {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {DOCUMENT} from '@angular/common';\nimport {Directive, inject, input} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TUI_FALSE_HANDLER, TUI_TRUE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {combineLatest, filter, map, merge, tap} from 'rxjs';\n\nconst SLIDER_INTERACTION_KEYS = new Set([\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'End',\n 'Home',\n 'PageDown',\n 'PageUp',\n]);\n\n/**\n * Native <input type='range' readonly> doesn't work.\n * This directive imitates this native behaviour.\n */\n@Directive({\n selector: 'input[tuiSlider][readonly]',\n host: {\n '(keydown)': 'preventKeyboardInteraction($event)',\n '(mousedown)': 'preventEvent($event)',\n },\n})\nexport class TuiSliderReadonly {\n private readonly el = tuiInjectElement<HTMLInputElement>();\n private readonly doc = inject(DOCUMENT);\n\n public readonly readonly = input(true, {transform: coerceBooleanProperty});\n\n constructor() {\n const touchStart$ = tuiTypedFromEvent(this.el, 'touchstart', {passive: false});\n const touchMove$ = tuiTypedFromEvent(this.doc, 'touchmove', {passive: false});\n const touchEnd$ = tuiTypedFromEvent(this.doc, 'touchend', {passive: true});\n\n const shouldPreventMove$ = merge(\n touchStart$.pipe(\n tap((e) => this.preventEvent(e)),\n map(TUI_TRUE_HANDLER),\n ),\n touchEnd$.pipe(map(TUI_FALSE_HANDLER)),\n );\n\n /**\n * @bad TODO think about another solution.\n * Keep in mind that preventing touch event (on slider) inside `@HostListener('touchstart')` doesn't work for mobile chrome.\n */\n combineLatest([touchMove$, shouldPreventMove$])\n .pipe(\n filter(([_, shouldPreventMove]) => shouldPreventMove),\n takeUntilDestroyed(),\n )\n .subscribe(([moveEvent]) => this.preventEvent(moveEvent));\n }\n\n protected preventEvent(event: Event): void {\n if (event.cancelable && this.readonly()) {\n event.preventDefault();\n }\n }\n\n protected preventKeyboardInteraction(event: KeyboardEvent): void {\n if (SLIDER_INTERACTION_KEYS.has(event.key)) {\n this.preventEvent(event);\n }\n }\n}\n","/// <reference types=\"@taiga-ui/tsconfig/ng-dev-mode\" />\nimport {AsyncPipe} from '@angular/common';\nimport {\n type AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {tuiHintOptionsProvider} from '@taiga-ui/core/portals/hint';\n\nimport {TuiSliderComponent} from '../slider.component';\n\n@Component({\n selector: '[tuiSliderThumbLabel]',\n imports: [AsyncPipe],\n templateUrl: './slider-thumb-label.template.html',\n styleUrl: './slider-thumb-label.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiHintOptionsProvider({direction: 'top', appearance: 'floating'})],\n})\nexport class TuiSliderThumbLabel implements AfterContentInit {\n protected readonly slider = contentChild(TuiSliderComponent);\n protected readonly control = contentChild(NgControl);\n\n public ngAfterContentInit(): void {\n ngDevMode &&\n console.assert(\n Boolean(this.control()?.valueChanges),\n '\\n[tuiSliderThumbLabel] expected <input tuiSlider type=\"range\" /> to use Angular Forms.\\n' +\n 'Use [(ngModel)] or [formControl] or formControlName for correct work.',\n );\n }\n\n protected get ratio(): number {\n return this.slider()?.valueRatio || 0;\n }\n\n protected get ghostStart(): number {\n return this.ratio * (this.slider()?.el.offsetWidth || 0);\n }\n}\n","@if (control()?.valueChanges | async) {}\n\n<div\n class=\"t-ghost\"\n [style.--tui-slider-thumb-ratio]=\"ratio\"\n [style.inset-inline-start.px]=\"ghostStart\"\n>\n <ng-content />\n</div>\n\n<ng-content select=\"input[type=range]\" />\n","import {\n TuiSliderKeySteps,\n TuiSliderKeyStepsBase,\n} from './helpers/slider-key-steps.directive';\nimport {TuiSliderReadonly} from './helpers/slider-readonly.directive';\nimport {TuiSliderThumbLabel} from './helpers/slider-thumb-label.component';\nimport {TuiSliderComponent} from './slider.component';\n\nexport const TuiSlider = [\n TuiSliderComponent,\n TuiSliderThumbLabel,\n TuiSliderKeyStepsBase,\n TuiSliderKeySteps,\n TuiSliderReadonly,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGA;;AAEG;AACI,MAAM,sBAAsB,GAAG;AAsBtC,SAAS,6BAA6B,CAClC,QAAqB,EACrB,EAAiE,EAAA;IAEjE,MAAM,iBAAiB,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC;AAE9E,IAAA,MAAM,SAAS,GAAG,QAAQ,CAAC,iBAAiB,GAAG,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC;AAChE,IAAA,MAAM,SAAS,GAAG,QAAQ,CAAC,iBAAiB,CAAC;AACzC,QAAA,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;AAE3C,IAAA,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;AACjC;AAEgB,SAAA,2BAA2B,CACvC,eAAuB,EACvB,QAAqB,EAAA;AAErB,IAAA,MAAM,CAAC,CAAC,gBAAgB,EAAE,cAAc,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AA,EAAA,IAAA,EDIc,SAAS,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAMV,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAR/B,SAAS;+BACI,uBAAuB,EAAA,OAAA,EACxB,CAAC,SAAS,CAAC,mBAGH,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC,CAAC,sBAAsB,CAAC,EAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,EAAA,QAAA,EAAA,2PAAA,EAAA,MAAA,EAAA,CAAA,uXAAA,CAAA,EAAA;;;AEXtE,MAAA,SAAS,GAAG;IACrB,kBAAkB;IAClB,mBAAmB;IACnB,qBAAqB;IACrB,iBAAiB;IACjB,iBAAiB;;;ACbrB;;AAEG;;;;"}
@@ -25,7 +25,7 @@ class TuiSpinButton {
25
25
  }
26
26
  }
27
27
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSpinButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
28
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: TuiSpinButton, isStandalone: true, selector: "tui-spin-button", inputs: { focusable: { classPropertyName: "focusable", publicName: "focusable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, leftDisabled: { classPropertyName: "leftDisabled", publicName: "leftDisabled", isSignal: true, isRequired: false, transformFunction: null }, rightDisabled: { classPropertyName: "rightDisabled", publicName: "rightDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { leftClick: "leftClick", rightClick: "rightClick" }, host: { listeners: { "mousedown.zoneless.prevent": "(0)", "keydown.arrowLeft.prevent": "onLeftClick()", "keydown.arrowRight.prevent": "onRightClick()" } }, ngImport: i0, template: "@if (spinTexts(); as texts) {\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__left\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || leftDisabled()\"\n [iconStart]=\"icons.decrement\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onLeftClick()\"\n >\n {{ texts[0] }}\n </button>\n <span class=\"t-content t-calendar-title\">\n <ng-content />\n </span>\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__right\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || rightDisabled()\"\n [iconStart]=\"icons.increment\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onRightClick()\"\n >\n {{ texts[1] }}\n </button>\n}\n", styles: [":host{display:flex;align-items:center;justify-content:space-between;font:var(--tui-font-body-l);text-align:center;font-weight:700}.t-button{transform:scaleX(var(--tui-inline))}.t-button_hidden{visibility:hidden}.t-content{padding:0 .5rem}\n"], dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
28
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: TuiSpinButton, isStandalone: true, selector: "tui-spin-button", inputs: { focusable: { classPropertyName: "focusable", publicName: "focusable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, leftDisabled: { classPropertyName: "leftDisabled", publicName: "leftDisabled", isSignal: true, isRequired: false, transformFunction: null }, rightDisabled: { classPropertyName: "rightDisabled", publicName: "rightDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { leftClick: "leftClick", rightClick: "rightClick" }, host: { listeners: { "mousedown.zoneless.prevent": "(0)", "keydown.arrowLeft.prevent": "onLeftClick()", "keydown.arrowRight.prevent": "onRightClick()" } }, ngImport: i0, template: "@if (spinTexts(); as texts) {\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__left\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || leftDisabled()\"\n [iconStart]=\"icons.decrement\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onLeftClick()\"\n >\n {{ texts[0] }}\n </button>\n <span class=\"t-content t-calendar-title\">\n <ng-content />\n </span>\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__right\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || rightDisabled()\"\n [iconStart]=\"icons.increment\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onRightClick()\"\n >\n {{ texts[1] }}\n </button>\n}\n", styles: [":host{display:flex;align-items:center;justify-content:space-between;font:var(--tui-typography-body-l);text-align:center;font-weight:700}.t-button{transform:scaleX(var(--tui-inline))}.t-button_hidden{visibility:hidden}.t-content{padding:0 .5rem}\n"], dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
29
29
  }
30
30
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiSpinButton, decorators: [{
31
31
  type: Component,
@@ -33,7 +33,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
33
33
  '(mousedown.zoneless.prevent)': '(0)',
34
34
  '(keydown.arrowLeft.prevent)': 'onLeftClick()',
35
35
  '(keydown.arrowRight.prevent)': 'onRightClick()',
36
- }, template: "@if (spinTexts(); as texts) {\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__left\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || leftDisabled()\"\n [iconStart]=\"icons.decrement\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onLeftClick()\"\n >\n {{ texts[0] }}\n </button>\n <span class=\"t-content t-calendar-title\">\n <ng-content />\n </span>\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__right\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || rightDisabled()\"\n [iconStart]=\"icons.increment\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onRightClick()\"\n >\n {{ texts[1] }}\n </button>\n}\n", styles: [":host{display:flex;align-items:center;justify-content:space-between;font:var(--tui-font-body-l);text-align:center;font-weight:700}.t-button{transform:scaleX(var(--tui-inline))}.t-button_hidden{visibility:hidden}.t-content{padding:0 .5rem}\n"] }]
36
+ }, template: "@if (spinTexts(); as texts) {\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__left\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || leftDisabled()\"\n [iconStart]=\"icons.decrement\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onLeftClick()\"\n >\n {{ texts[0] }}\n </button>\n <span class=\"t-content t-calendar-title\">\n <ng-content />\n </span>\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__right\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || rightDisabled()\"\n [iconStart]=\"icons.increment\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onRightClick()\"\n >\n {{ texts[1] }}\n </button>\n}\n", styles: [":host{display:flex;align-items:center;justify-content:space-between;font:var(--tui-typography-body-l);text-align:center;font-weight:700}.t-button{transform:scaleX(var(--tui-inline))}.t-button_hidden{visibility:hidden}.t-content{padding:0 .5rem}\n"] }]
37
37
  }] });
38
38
 
39
39
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-spin-button.mjs","sources":["../../../projects/core/components/spin-button/spin-button.component.ts","../../../projects/core/components/spin-button/spin-button.template.html","../../../projects/core/components/spin-button/taiga-ui-core-components-spin-button.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, inject, input, output} from '@angular/core';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TUI_COMMON_ICONS, TUI_SPIN_TEXTS} from '@taiga-ui/core/tokens';\n\n@Component({\n selector: 'tui-spin-button',\n imports: [TuiButton],\n templateUrl: './spin-button.template.html',\n styleUrl: './spin-button.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(mousedown.zoneless.prevent)': '(0)',\n '(keydown.arrowLeft.prevent)': 'onLeftClick()',\n '(keydown.arrowRight.prevent)': 'onRightClick()',\n },\n})\nexport class TuiSpinButton {\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly spinTexts = inject(TUI_SPIN_TEXTS);\n\n public readonly focusable = input(true);\n public readonly disabled = input(false);\n public readonly leftDisabled = input(false);\n public readonly rightDisabled = input(false);\n public readonly leftClick = output();\n public readonly rightClick = output();\n\n public onLeftClick(): void {\n if (!this.disabled() && !this.leftDisabled()) {\n this.leftClick.emit();\n }\n }\n\n public onRightClick(): void {\n if (!this.disabled() && !this.rightDisabled()) {\n this.rightClick.emit();\n }\n }\n}\n","@if (spinTexts(); as texts) {\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__left\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || leftDisabled()\"\n [iconStart]=\"icons.decrement\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onLeftClick()\"\n >\n {{ texts[0] }}\n </button>\n <span class=\"t-content t-calendar-title\">\n <ng-content />\n </span>\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__right\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || rightDisabled()\"\n [iconStart]=\"icons.increment\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onRightClick()\"\n >\n {{ texts[1] }}\n </button>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAgBa,aAAa,CAAA;AAZ1B,IAAA,WAAA,GAAA;AAauB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAChC,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AAErC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;AACvB,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;AAC3B,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC;QAC5B,IAAS,CAAA,SAAA,GAAG,MAAM,EAAE;QACpB,IAAU,CAAA,UAAA,GAAG,MAAM,EAAE;AAaxC;IAXU,WAAW,GAAA;AACd,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE;AAC1C,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;;;IAItB,YAAY,GAAA;AACf,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE;AAC3C,YAAA,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;;;+GAnBrB,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAA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uB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,8BAA8B,EAAE,KAAK;AACrC,wBAAA,6BAA6B,EAAE,eAAe;AAC9C,wBAAA,8BAA8B,EAAE,gBAAgB;AACnD,qBAAA,EAAA,QAAA,EAAA,u8BAAA,EAAA,MAAA,EAAA,CAAA,kPAAA,CAAA,EAAA;;;AEdL;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-spin-button.mjs","sources":["../../../projects/core/components/spin-button/spin-button.component.ts","../../../projects/core/components/spin-button/spin-button.template.html","../../../projects/core/components/spin-button/taiga-ui-core-components-spin-button.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, inject, input, output} from '@angular/core';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TUI_COMMON_ICONS, TUI_SPIN_TEXTS} from '@taiga-ui/core/tokens';\n\n@Component({\n selector: 'tui-spin-button',\n imports: [TuiButton],\n templateUrl: './spin-button.template.html',\n styleUrl: './spin-button.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(mousedown.zoneless.prevent)': '(0)',\n '(keydown.arrowLeft.prevent)': 'onLeftClick()',\n '(keydown.arrowRight.prevent)': 'onRightClick()',\n },\n})\nexport class TuiSpinButton {\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly spinTexts = inject(TUI_SPIN_TEXTS);\n\n public readonly focusable = input(true);\n public readonly disabled = input(false);\n public readonly leftDisabled = input(false);\n public readonly rightDisabled = input(false);\n public readonly leftClick = output();\n public readonly rightClick = output();\n\n public onLeftClick(): void {\n if (!this.disabled() && !this.leftDisabled()) {\n this.leftClick.emit();\n }\n }\n\n public onRightClick(): void {\n if (!this.disabled() && !this.rightDisabled()) {\n this.rightClick.emit();\n }\n }\n}\n","@if (spinTexts(); as texts) {\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__left\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || leftDisabled()\"\n [iconStart]=\"icons.decrement\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onLeftClick()\"\n >\n {{ texts[0] }}\n </button>\n <span class=\"t-content t-calendar-title\">\n <ng-content />\n </span>\n <button\n appearance=\"flat\"\n automation-id=\"tui-spin-button__right\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [class.t-button_hidden]=\"disabled() || rightDisabled()\"\n [iconStart]=\"icons.increment\"\n [tabIndex]=\"focusable() ? 0 : -1\"\n (click)=\"onRightClick()\"\n >\n {{ texts[1] }}\n </button>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAgBa,aAAa,CAAA;AAZ1B,IAAA,WAAA,GAAA;AAauB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAChC,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AAErC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;AACvB,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;AAC3B,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC;QAC5B,IAAS,CAAA,SAAA,GAAG,MAAM,EAAE;QACpB,IAAU,CAAA,UAAA,GAAG,MAAM,EAAE;AAaxC;IAXU,WAAW,GAAA;AACd,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE;AAC1C,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;;;IAItB,YAAY,GAAA;AACf,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE;AAC3C,YAAA,IAA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