@nanahoshi/mona-ui 0.27.2 → 0.28.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.
Files changed (208) hide show
  1. package/docs/api/chart.md +2 -2
  2. package/docs/api/popup.md +1 -1
  3. package/docs/api/theme.md +2 -2
  4. package/docs/chart.md +14 -0
  5. package/docs/editor.md +2 -0
  6. package/docs/installation.md +147 -15
  7. package/docs/introduction.md +37 -15
  8. package/docs/theming-built-in-themes.md +67 -0
  9. package/docs/theming-custom-colors.md +274 -0
  10. package/docs/theming-custom-themes.md +168 -0
  11. package/docs/theming.md +164 -248
  12. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  13. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  14. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  15. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  16. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  17. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
  18. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  19. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  20. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  21. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  22. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  23. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
  24. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  25. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  26. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  27. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  28. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  29. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
  30. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  31. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
  32. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  33. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  34. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  35. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  36. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  37. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
  38. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  39. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  40. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  41. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  42. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  43. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  44. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  45. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  46. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  47. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  48. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  49. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  50. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
  51. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  52. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  53. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  54. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  55. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  56. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  57. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  58. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  59. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  60. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  61. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  62. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  63. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  64. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  65. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  66. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  67. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  68. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  69. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  70. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  71. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  72. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  73. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  74. package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
  75. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  76. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  77. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  78. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  79. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  80. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  81. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  82. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  83. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  84. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  85. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  86. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  87. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  88. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  89. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  90. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  91. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  92. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  93. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  94. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  95. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  96. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  97. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  98. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  99. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  100. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  101. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  102. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  103. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  104. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  105. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  106. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  107. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  108. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  109. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  110. package/llms.txt +6 -2
  111. package/package.json +62 -23
  112. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  113. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  114. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  115. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  116. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  117. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  118. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  119. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  120. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  121. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  122. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  123. package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
  124. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  125. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  126. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  127. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  128. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  129. package/types/nanahoshi-mona-ui-common.d.ts +354 -385
  130. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  131. package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
  132. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  133. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  134. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  135. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  136. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  137. package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
  138. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  139. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  140. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  141. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  142. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  143. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  144. package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
  145. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  146. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  147. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  148. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  149. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  150. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  151. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  152. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  153. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  154. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  155. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  156. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  157. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  158. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  159. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  160. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  161. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  162. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  163. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  164. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  165. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  166. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  167. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  168. package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
  169. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  170. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  171. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  172. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  173. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  174. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  175. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  176. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  177. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  178. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  179. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  180. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  181. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  182. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  183. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  184. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  185. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  186. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  187. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  188. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  189. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  190. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  191. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  192. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  193. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  194. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  195. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  196. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  197. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  198. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  199. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  200. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  201. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  202. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  203. package/types/nanahoshi-mona-ui.d.ts +1 -2
  204. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  205. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  206. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  207. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  208. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,171 +1,221 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Pipe, Directive, inject, DOCUMENT, computed, DestroyRef, signal, contentChild, TemplateRef, ElementRef, NgZone, input, booleanAttribute, output, afterNextRender, isDevMode, effect, viewChild, model, Component } from '@angular/core';
4
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import { fromEvent, filter, tap, switchMap, merge, takeUntil } from 'rxjs';
6
- import { themeRaisedSurfaceClasses, injectLabelAssociation, injectEffectiveDisabled, createElementControlId } from '@nanahoshi/mona-ui/internal';
7
- import { twMerge } from 'tailwind-merge';
8
- import { injectComponentDirection, MonaI18nService, formatNumber } from '@nanahoshi/mona-ui/i18n';
9
- import { cva } from 'class-variance-authority';
10
-
1
+ import { NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, DOCUMENT, DestroyRef, Directive, ElementRef, NgZone, Pipe, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, effect, inject, input, isDevMode, model, output, signal, viewChild } from "@angular/core";
4
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
5
+ import { filter, fromEvent, merge, switchMap, takeUntil, tap } from "rxjs";
6
+ import { createElementControlId, injectEffectiveDisabled, injectLabelAssociation, themeRaisedSurfaceClasses } from "@nanahoshi/mona-ui/internal";
7
+ import { twMerge } from "tailwind-merge";
8
+ import { MonaI18nService, formatNumber, injectComponentDirection } from "@nanahoshi/mona-ui/i18n";
9
+ import { cva } from "class-variance-authority";
11
10
  const valueToPosition = (value, min, max) => {
12
- if (value <= min) {
13
- return 0;
14
- }
15
- if (value >= max) {
16
- return 100;
17
- }
18
- if (max === min) {
19
- return 0;
20
- }
21
- return ((value - min) / (max - min)) * 100;
11
+ if (value <= min) return 0;
12
+ if (value >= max) return 100;
13
+ if (max === min) return 0;
14
+ return (value - min) / (max - min) * 100;
22
15
  };
23
-
24
- class LabelStylePipe {
25
- transform(tick, args) {
26
- const styles = {};
27
- const { labelPosition, min, max, orientation } = args;
28
- const valuePosition = valueToPosition(tick.value, min, max);
29
- const isRtl = args.direction === "rtl";
30
- if (orientation === "horizontal") {
31
- if (isRtl) {
32
- styles.right = `${valuePosition}%`;
33
- styles.transform = "translateX(50%)";
34
- }
35
- else {
36
- styles.left = `${valuePosition}%`;
37
- styles.transform = "translateX(-50%)";
38
- }
39
- styles[labelPosition === "before" ? "bottom" : "top"] = "100%";
40
- }
41
- else {
42
- styles.bottom = `${valuePosition}%`;
43
- const side = isRtl
44
- ? labelPosition === "before"
45
- ? "left"
46
- : "right"
47
- : labelPosition === "before"
48
- ? "right"
49
- : "left";
50
- styles[side] = "100%";
51
- styles.transform = "translateY(50%)";
52
- }
53
- return styles;
54
- }
55
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelStylePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
56
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: LabelStylePipe, isStandalone: true, name: "labelStyle" }); }
57
- }
58
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LabelStylePipe, decorators: [{
59
- type: Pipe,
60
- args: [{
61
- name: "labelStyle"
62
- }]
63
- }] });
64
-
65
- class TickStylePipe {
66
- transform(tick, args) {
67
- const { largeTickStep, min, max, orientation, smallTickStep } = args;
68
- const position = valueToPosition(tick.value, min, max);
69
- const height = this.getHeight(tick, smallTickStep, largeTickStep, orientation);
70
- const width = this.getWidth(tick, smallTickStep, largeTickStep, orientation);
71
- if (orientation === "horizontal") {
72
- const isRtl = args.direction === "rtl";
73
- return {
74
- position: "absolute",
75
- ...(isRtl ? { right: `${position}%` } : { left: `${position}%` }),
76
- top: "50%",
77
- transform: `${isRtl ? "translateX(50%)" : "translateX(-50%)"} translateY(-50%) translateZ(0)`,
78
- width: "1px",
79
- height: `${height}px`,
80
- backfaceVisibility: "hidden",
81
- willChange: "transform"
82
- };
83
- }
84
- else {
85
- return {
86
- position: "absolute",
87
- bottom: `${position}%`,
88
- left: "50%",
89
- transform: "translateX(-50%) translateY(50%) translateZ(0)",
90
- width: `${width}px`,
91
- height: "1px",
92
- backfaceVisibility: "hidden"
93
- };
94
- }
95
- }
96
- getHeight(tick, smallStep, largeStep, orientation) {
97
- if (orientation === "vertical") {
98
- return 8;
99
- }
100
- if (smallStep === 1 && largeStep === null) {
101
- return 16;
102
- }
103
- if (smallStep === 1 && largeStep !== null) {
104
- return tick.index % largeStep !== 0 ? 16 : 24;
105
- }
106
- if (smallStep > 1 && largeStep === null) {
107
- return tick.index % smallStep !== 0 ? 0 : 16;
108
- }
109
- if (smallStep > 1 && largeStep !== null) {
110
- return tick.index % smallStep !== 0 ? 0 : tick.index % largeStep !== 0 ? 16 : 24;
111
- }
112
- return 8;
113
- }
114
- getWidth(tick, smallStep, largeStep, orientation) {
115
- if (orientation === "vertical") {
116
- if (smallStep === 1) {
117
- return 16; // Default width for vertical orientation with no step
118
- }
119
- return tick.index % smallStep !== 0 ? 0 : 16;
120
- }
121
- return 8; // Default width for horizontal orientation
122
- }
123
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TickStylePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
124
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: TickStylePipe, isStandalone: true, name: "tickStyle" }); }
125
- }
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TickStylePipe, decorators: [{
127
- type: Pipe,
128
- args: [{
129
- name: "tickStyle"
130
- }]
131
- }] });
132
-
133
- // Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
134
- // Edit the JSON file and run `npm run generate:locale-catalogs`.
16
+ var LabelStylePipe = class LabelStylePipe {
17
+ transform(tick, args) {
18
+ const styles = {};
19
+ const { labelPosition, min, max, orientation } = args;
20
+ const valuePosition = valueToPosition(tick.value, min, max);
21
+ const isRtl = args.direction === "rtl";
22
+ if (orientation === "horizontal") {
23
+ if (isRtl) {
24
+ styles.right = `${valuePosition}%`;
25
+ styles.transform = "translateX(50%)";
26
+ } else {
27
+ styles.left = `${valuePosition}%`;
28
+ styles.transform = "translateX(-50%)";
29
+ }
30
+ styles[labelPosition === "before" ? "bottom" : "top"] = "100%";
31
+ } else {
32
+ styles.bottom = `${valuePosition}%`;
33
+ const side = isRtl ? labelPosition === "before" ? "left" : "right" : labelPosition === "before" ? "right" : "left";
34
+ styles[side] = "100%";
35
+ styles.transform = "translateY(50%)";
36
+ }
37
+ return styles;
38
+ }
39
+ static {
40
+ this.ɵfac = i0.ɵɵngDeclareFactory({
41
+ minVersion: "12.0.0",
42
+ version: "22.2.6",
43
+ ngImport: i0,
44
+ type: LabelStylePipe,
45
+ deps: [],
46
+ target: i0.ɵɵFactoryTarget.Pipe
47
+ });
48
+ }
49
+ static {
50
+ this.ɵpipe = i0.ɵɵngDeclarePipe({
51
+ minVersion: "14.0.0",
52
+ version: "22.2.6",
53
+ ngImport: i0,
54
+ type: LabelStylePipe,
55
+ isStandalone: true,
56
+ name: "labelStyle"
57
+ });
58
+ }
59
+ };
60
+ i0.ɵɵngDeclareClassMetadata({
61
+ minVersion: "12.0.0",
62
+ version: "22.2.6",
63
+ ngImport: i0,
64
+ type: LabelStylePipe,
65
+ decorators: [{
66
+ type: Pipe,
67
+ args: [{ name: "labelStyle" }]
68
+ }]
69
+ });
70
+ var TickStylePipe = class TickStylePipe {
71
+ transform(tick, args) {
72
+ const { largeTickStep, min, max, orientation, smallTickStep } = args;
73
+ const position = valueToPosition(tick.value, min, max);
74
+ const height = this.getHeight(tick, smallTickStep, largeTickStep, orientation);
75
+ const width = this.getWidth(tick, smallTickStep, largeTickStep, orientation);
76
+ if (orientation === "horizontal") {
77
+ const isRtl = args.direction === "rtl";
78
+ return {
79
+ position: "absolute",
80
+ ...isRtl ? { right: `${position}%` } : { left: `${position}%` },
81
+ top: "50%",
82
+ transform: `${isRtl ? "translateX(50%)" : "translateX(-50%)"} translateY(-50%) translateZ(0)`,
83
+ width: "1px",
84
+ height: `${height}px`,
85
+ backfaceVisibility: "hidden",
86
+ willChange: "transform"
87
+ };
88
+ } else return {
89
+ position: "absolute",
90
+ bottom: `${position}%`,
91
+ left: "50%",
92
+ transform: "translateX(-50%) translateY(50%) translateZ(0)",
93
+ width: `${width}px`,
94
+ height: "1px",
95
+ backfaceVisibility: "hidden"
96
+ };
97
+ }
98
+ getHeight(tick, smallStep, largeStep, orientation) {
99
+ if (orientation === "vertical") return 8;
100
+ if (smallStep === 1 && largeStep === null) return 16;
101
+ if (smallStep === 1 && largeStep !== null) return tick.index % largeStep !== 0 ? 16 : 24;
102
+ if (smallStep > 1 && largeStep === null) return tick.index % smallStep !== 0 ? 0 : 16;
103
+ if (smallStep > 1 && largeStep !== null) return tick.index % smallStep !== 0 ? 0 : tick.index % largeStep !== 0 ? 16 : 24;
104
+ return 8;
105
+ }
106
+ getWidth(tick, smallStep, largeStep, orientation) {
107
+ if (orientation === "vertical") {
108
+ if (smallStep === 1) return 16;
109
+ return tick.index % smallStep !== 0 ? 0 : 16;
110
+ }
111
+ return 8;
112
+ }
113
+ static {
114
+ this.ɵfac = i0.ɵɵngDeclareFactory({
115
+ minVersion: "12.0.0",
116
+ version: "22.2.6",
117
+ ngImport: i0,
118
+ type: TickStylePipe,
119
+ deps: [],
120
+ target: i0.ɵɵFactoryTarget.Pipe
121
+ });
122
+ }
123
+ static {
124
+ this.ɵpipe = i0.ɵɵngDeclarePipe({
125
+ minVersion: "14.0.0",
126
+ version: "22.2.6",
127
+ ngImport: i0,
128
+ type: TickStylePipe,
129
+ isStandalone: true,
130
+ name: "tickStyle"
131
+ });
132
+ }
133
+ };
134
+ i0.ɵɵngDeclareClassMetadata({
135
+ minVersion: "12.0.0",
136
+ version: "22.2.6",
137
+ ngImport: i0,
138
+ type: TickStylePipe,
139
+ decorators: [{
140
+ type: Pipe,
141
+ args: [{ name: "tickStyle" }]
142
+ }]
143
+ });
135
144
  const SLIDER_DEFAULT_MESSAGES = {
136
- maximumValue: "Maximum value",
137
- minimumValue: "Minimum value",
138
- sliderValue: "Slider value"
145
+ maximumValue: "Maximum value",
146
+ minimumValue: "Minimum value",
147
+ sliderValue: "Slider value"
139
148
  };
140
-
141
- class SliderHandleTemplateDirective {
142
- static ngTemplateContextGuard(_directive, _context) {
143
- return true;
144
- }
145
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderHandleTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
146
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: SliderHandleTemplateDirective, isStandalone: true, selector: "ng-template[monaSliderHandleTemplate]", ngImport: i0 }); }
147
- }
148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderHandleTemplateDirective, decorators: [{
149
- type: Directive,
150
- args: [{
151
- selector: "ng-template[monaSliderHandleTemplate]"
152
- }]
153
- }] });
154
-
155
- class SliderTickValueTemplateDirective {
156
- static ngTemplateContextGuard(_directive, _context) {
157
- return true;
158
- }
159
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderTickValueTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
160
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: SliderTickValueTemplateDirective, isStandalone: true, selector: "ng-template[monaSliderTickValueTemplate]", ngImport: i0 }); }
161
- }
162
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderTickValueTemplateDirective, decorators: [{
163
- type: Directive,
164
- args: [{
165
- selector: "ng-template[monaSliderTickValueTemplate]"
166
- }]
167
- }] });
168
-
149
+ var SliderHandleTemplateDirective = class SliderHandleTemplateDirective {
150
+ static ngTemplateContextGuard(_directive, _context) {
151
+ return true;
152
+ }
153
+ static {
154
+ this.ɵfac = i0.ɵɵngDeclareFactory({
155
+ minVersion: "12.0.0",
156
+ version: "22.2.6",
157
+ ngImport: i0,
158
+ type: SliderHandleTemplateDirective,
159
+ deps: [],
160
+ target: i0.ɵɵFactoryTarget.Directive
161
+ });
162
+ }
163
+ static {
164
+ this.ɵdir = i0.ɵɵngDeclareDirective({
165
+ minVersion: "14.0.0",
166
+ version: "22.2.6",
167
+ type: SliderHandleTemplateDirective,
168
+ isStandalone: true,
169
+ selector: "ng-template[monaSliderHandleTemplate]",
170
+ ngImport: i0
171
+ });
172
+ }
173
+ };
174
+ i0.ɵɵngDeclareClassMetadata({
175
+ minVersion: "12.0.0",
176
+ version: "22.2.6",
177
+ ngImport: i0,
178
+ type: SliderHandleTemplateDirective,
179
+ decorators: [{
180
+ type: Directive,
181
+ args: [{ selector: "ng-template[monaSliderHandleTemplate]" }]
182
+ }]
183
+ });
184
+ var SliderTickValueTemplateDirective = class SliderTickValueTemplateDirective {
185
+ static ngTemplateContextGuard(_directive, _context) {
186
+ return true;
187
+ }
188
+ static {
189
+ this.ɵfac = i0.ɵɵngDeclareFactory({
190
+ minVersion: "12.0.0",
191
+ version: "22.2.6",
192
+ ngImport: i0,
193
+ type: SliderTickValueTemplateDirective,
194
+ deps: [],
195
+ target: i0.ɵɵFactoryTarget.Directive
196
+ });
197
+ }
198
+ static {
199
+ this.ɵdir = i0.ɵɵngDeclareDirective({
200
+ minVersion: "14.0.0",
201
+ version: "22.2.6",
202
+ type: SliderTickValueTemplateDirective,
203
+ isStandalone: true,
204
+ selector: "ng-template[monaSliderTickValueTemplate]",
205
+ ngImport: i0
206
+ });
207
+ }
208
+ };
209
+ i0.ɵɵngDeclareClassMetadata({
210
+ minVersion: "12.0.0",
211
+ version: "22.2.6",
212
+ ngImport: i0,
213
+ type: SliderTickValueTemplateDirective,
214
+ decorators: [{
215
+ type: Directive,
216
+ args: [{ selector: "ng-template[monaSliderTickValueTemplate]" }]
217
+ }]
218
+ });
169
219
  const sliderBaseThemeVariants = cva(`
170
220
  relative flex select-none
171
221
 
@@ -197,17 +247,13 @@ const sliderTrackThemeVariants = cva(`
197
247
  data-[orientation="vertical"]:h-full
198
248
  data-[orientation="vertical"]:w-1.5
199
249
 
200
- `, {
201
- variants: {
202
- rounded: {
203
- full: "rounded-full",
204
- large: "rounded-lg",
205
- medium: "rounded-md",
206
- none: "rounded-none",
207
- small: "rounded-sm"
208
- }
209
- }
210
- });
250
+ `, { variants: { rounded: {
251
+ full: "rounded-full",
252
+ large: "rounded-lg",
253
+ medium: "rounded-md",
254
+ none: "rounded-none",
255
+ small: "rounded-sm"
256
+ } } });
211
257
  const sliderSelectionThemeVariants = cva(`
212
258
  absolute
213
259
  bg-[var(--mona-indicator-color,var(--color-primary))]
@@ -277,936 +323,1350 @@ const sliderHandleThemeVariants = cva(`
277
323
  data-[invalid="true"]:ring-2 data-[invalid="true"]:ring-error/35
278
324
  data-[invalid="true"]:data-[focused="true"]:border-error
279
325
  data-[invalid="true"]:data-[focused="true"]:ring-error/35
280
- `, {
281
- variants: {
282
- rounded: {
283
- full: "rounded-full",
284
- large: "rounded-lg",
285
- medium: "rounded-md",
286
- none: "rounded-none",
287
- small: "rounded-sm"
288
- }
289
- }
290
- });
291
-
292
- /**
293
- * @description Counts the decimal places a number is written with, including those of exponent notation such as `1e-7`.
294
- */
326
+ `, { variants: { rounded: {
327
+ full: "rounded-full",
328
+ large: "rounded-lg",
329
+ medium: "rounded-md",
330
+ none: "rounded-none",
331
+ small: "rounded-sm"
332
+ } } });
295
333
  function decimalPlaces(value) {
296
- if (!Number.isFinite(value)) {
297
- return 0;
298
- }
299
- const [mantissa, exponent] = value.toString().split("e");
300
- const decimals = mantissa.split(".")[1]?.length ?? 0;
301
- return Math.max(0, decimals - Number(exponent ?? 0));
334
+ if (!Number.isFinite(value)) return 0;
335
+ const [mantissa, exponent] = value.toString().split("e");
336
+ const decimals = mantissa.split(".")[1]?.length ?? 0;
337
+ return Math.max(0, decimals - Number(exponent ?? 0));
302
338
  }
303
- /**
304
- * @description Rounds a number to a number of decimal places, which removes floating point noise such as
305
- * `0.30000000000000004`.
306
- */
307
339
  function roundToPlaces(value, places) {
308
- return Number(value.toFixed(Math.min(places, 100)));
309
- }
310
-
311
- class SliderBaseComponent {
312
- #document;
313
- #label;
314
- #stepPlaces;
315
- constructor() {
316
- this.#document = inject(DOCUMENT);
317
- this.#label = injectLabelAssociation({
318
- activate: () => this.focus(),
319
- ariaLabel: () => this.ariaLabel(),
320
- ariaLabelledBy: () => this.ariaLabelledBy()
321
- });
322
- this.#stepPlaces = computed(() => Math.max(decimalPlaces(this.step()), decimalPlaces(this.effectiveMin())), /* @ts-ignore */
323
- ...(ngDevMode ? [{ debugName: "#stepPlaces" }] : /* istanbul ignore next */ []));
324
- this.baseClasses = computed(() => sliderBaseThemeVariants(), /* @ts-ignore */
325
- ...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
326
- this.destroyRef = inject(DestroyRef);
327
- this.direction = injectComponentDirection();
328
- this.dragging = signal(false, /* @ts-ignore */
329
- ...(ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []));
330
- this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
331
- this.effectiveMax = computed(() => this.getMaxOverride() ?? this.maxValue(), /* @ts-ignore */
332
- ...(ngDevMode ? [{ debugName: "effectiveMax" }] : /* istanbul ignore next */ []));
333
- this.effectiveMin = computed(() => this.getMinOverride() ?? this.minValue(), /* @ts-ignore */
334
- ...(ngDevMode ? [{ debugName: "effectiveMin" }] : /* istanbul ignore next */ []));
335
- this.handleTemplate = contentChild(SliderHandleTemplateDirective, { ...(ngDevMode ? { debugName: "handleTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
336
- this.handleTemplateStyles = computed(() => {
337
- const template = this.handleTemplate();
338
- if (!template) {
339
- return {};
340
- }
341
- return { background: "transparent", border: "none", boxShadow: "none" };
342
- }, /* @ts-ignore */
343
- ...(ngDevMode ? [{ debugName: "handleTemplateStyles" }] : /* istanbul ignore next */ []));
344
- this.horizontalSelectionLeft = computed(() => {
345
- if (this.orientation() !== "horizontal") {
346
- return undefined;
347
- }
348
- return this.isRtl() ? 100 - this.selectionRight() : this.selectionLeft();
349
- }, /* @ts-ignore */
350
- ...(ngDevMode ? [{ debugName: "horizontalSelectionLeft" }] : /* istanbul ignore next */ []));
351
- this.horizontalSelectionRight = computed(() => {
352
- if (this.orientation() !== "horizontal") {
353
- return undefined;
354
- }
355
- return this.isRtl() ? this.selectionLeft() : 100 - this.selectionRight();
356
- }, /* @ts-ignore */
357
- ...(ngDevMode ? [{ debugName: "horizontalSelectionRight" }] : /* istanbul ignore next */ []));
358
- this.hostElementRef = inject(ElementRef);
359
- this.i18n = inject(MonaI18nService);
360
- this.interactionDisabled = computed(() => this.effectiveDisabled() || this.readonly(), /* @ts-ignore */
361
- ...(ngDevMode ? [{ debugName: "interactionDisabled" }] : /* istanbul ignore next */ []));
362
- this.invalidState = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
363
- ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
364
- this.isRtl = computed(() => this.direction() === "rtl", /* @ts-ignore */
365
- ...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
366
- this.labelStyleArgs = computed(() => {
367
- const direction = this.direction();
368
- const labelPosition = this.labelPosition();
369
- const max = this.effectiveMax();
370
- const min = this.effectiveMin();
371
- const orientation = this.orientation();
372
- const tickCount = this.labelTicks().length;
373
- return { direction, labelPosition, max, min, orientation, tickCount };
374
- }, /* @ts-ignore */
375
- ...(ngDevMode ? [{ debugName: "labelStyleArgs" }] : /* istanbul ignore next */ []));
376
- this.labelTicks = computed(() => {
377
- const allTicks = this.ticks();
378
- if (allTicks.length === 0) {
379
- return [];
380
- }
381
- const tickStep = this.labelStep();
382
- const lastTick = allTicks[allTicks.length - 1];
383
- const labels = allTicks.filter(t => t.index % tickStep === 0);
384
- if (labels.length === 0 || labels[labels.length - 1].value !== lastTick.value) {
385
- labels.push(lastTick);
386
- }
387
- if (labels.length >= 2) {
388
- const penultimate = labels[labels.length - 2];
389
- const last = labels[labels.length - 1];
390
- const penultimatePos = valueToPosition(penultimate.value, this.effectiveMin(), this.effectiveMax());
391
- const lastPos = valueToPosition(last.value, this.effectiveMin(), this.effectiveMax());
392
- if (this.step() !== 1 && lastPos - penultimatePos < 4) {
393
- labels.splice(labels.length - 2, 1);
394
- }
395
- }
396
- const localeId = this.i18n.localeId();
397
- return labels.map(tick => ({
398
- ...tick,
399
- label: formatNumber(tick.value, localeId, { maximumFractionDigits: decimalPlaces(tick.value) })
400
- }));
401
- }, /* @ts-ignore */
402
- ...(ngDevMode ? [{ debugName: "labelTicks" }] : /* istanbul ignore next */ []));
403
- this.labelledBy = this.#label.labelledBy;
404
- this.renderTicks = computed(() => {
405
- const ticks = this.ticks();
406
- if (this.orientation() === "vertical") {
407
- return ticks.slice().reverse();
408
- }
409
- return ticks;
410
- }, /* @ts-ignore */
411
- ...(ngDevMode ? [{ debugName: "renderTicks" }] : /* istanbul ignore next */ []));
412
- this.selectionBackgroundStyle = computed(() => {
413
- const bg = this.selectionBackground();
414
- if (!bg) {
415
- return {};
416
- }
417
- return typeof bg === "string" ? { background: bg } : bg;
418
- }, /* @ts-ignore */
419
- ...(ngDevMode ? [{ debugName: "selectionBackgroundStyle" }] : /* istanbul ignore next */ []));
420
- this.selectionClasses = computed(() => sliderSelectionThemeVariants(), /* @ts-ignore */
421
- ...(ngDevMode ? [{ debugName: "selectionClasses" }] : /* istanbul ignore next */ []));
422
- this.sliderHandleClasses = computed(() => {
423
- const rounded = this.rounded();
424
- const handleClasses = this.handleClasses();
425
- const variants = sliderHandleThemeVariants({ rounded });
426
- return twMerge(variants ?? "", Array.isArray(handleClasses) ? handleClasses.join(" ") : handleClasses);
427
- }, /* @ts-ignore */
428
- ...(ngDevMode ? [{ debugName: "sliderHandleClasses" }] : /* istanbul ignore next */ []));
429
- this.sliderTrackSize = computed(() => {
430
- const trackSize = this.trackSize();
431
- if (trackSize == null || trackSize === "") {
432
- return null;
433
- }
434
- if (typeof trackSize === "number") {
435
- return `${trackSize}px`;
436
- }
437
- const number = Number(trackSize);
438
- if (isNaN(number)) {
439
- return trackSize;
440
- }
441
- return `${number}px`;
442
- }, /* @ts-ignore */
443
- ...(ngDevMode ? [{ debugName: "sliderTrackSize" }] : /* istanbul ignore next */ []));
444
- this.tickClasses = computed(() => sliderTickThemeVariants(), /* @ts-ignore */
445
- ...(ngDevMode ? [{ debugName: "tickClasses" }] : /* istanbul ignore next */ []));
446
- this.tickLabelClasses = computed(() => sliderTickLabelThemeVariants(), /* @ts-ignore */
447
- ...(ngDevMode ? [{ debugName: "tickLabelClasses" }] : /* istanbul ignore next */ []));
448
- this.tickLabelListClasses = computed(() => sliderTickLabelListThemeVariants(), /* @ts-ignore */
449
- ...(ngDevMode ? [{ debugName: "tickLabelListClasses" }] : /* istanbul ignore next */ []));
450
- this.tickListClasses = computed(() => sliderTickListThemeVariants(), /* @ts-ignore */
451
- ...(ngDevMode ? [{ debugName: "tickListClasses" }] : /* istanbul ignore next */ []));
452
- this.tickStyleArgs = computed(() => {
453
- const direction = this.direction();
454
- const largeTickStep = this.largeTickStep();
455
- const max = this.effectiveMax();
456
- const min = this.effectiveMin();
457
- const orientation = this.orientation();
458
- const smallTickStep = this.smallTickStep();
459
- return { direction, largeTickStep, max, min, orientation, smallTickStep };
460
- }, /* @ts-ignore */
461
- ...(ngDevMode ? [{ debugName: "tickStyleArgs" }] : /* istanbul ignore next */ []));
462
- this.tickValueTemplate = contentChild(SliderTickValueTemplateDirective, { ...(ngDevMode ? { debugName: "tickValueTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
463
- this.ticks = computed(() => {
464
- const min = this.effectiveMin();
465
- const max = this.effectiveMax();
466
- const step = this.step();
467
- const ticks = [];
468
- const count = this.#stepCount();
469
- for (let i = 0; i <= count; i++) {
470
- ticks.push({ index: i, value: this.#roundToStep(min + i * step) });
471
- }
472
- if (ticks.length === 0 || ticks[ticks.length - 1].value < max) {
473
- ticks.push({ index: ticks.length, value: max });
474
- }
475
- return ticks;
476
- }, /* @ts-ignore */
477
- ...(ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []));
478
- this.trackBackgroundStyle = computed(() => {
479
- const bg = this.trackBackground();
480
- if (!bg) {
481
- return {};
482
- }
483
- return typeof bg === "string" ? { background: bg } : bg;
484
- }, /* @ts-ignore */
485
- ...(ngDevMode ? [{ debugName: "trackBackgroundStyle" }] : /* istanbul ignore next */ []));
486
- this.trackClasses = computed(() => {
487
- const rounded = this.rounded();
488
- return sliderTrackThemeVariants({ rounded });
489
- }, /* @ts-ignore */
490
- ...(ngDevMode ? [{ debugName: "trackClasses" }] : /* istanbul ignore next */ []));
491
- this.zone = inject(NgZone);
492
- /**
493
- * @description Id of an element that describes the control, such as an error message. On a range slider it describes
494
- * each handle.
495
- * @default null
496
- */
497
- this.ariaDescribedBy = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {}), alias: "aria-describedby" });
498
- /**
499
- * @description Accessible name of the control. On a range slider it names the group holding both handles.
500
- * @default null
501
- */
502
- this.ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
503
- /**
504
- * @description Id of the element that labels the control. On a range slider each handle reads it before its own
505
- * name.
506
- * @default null
507
- */
508
- this.ariaLabelledBy = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
509
- /**
510
- * @description Human-readable override for the `aria-valuenow` announcement. Pass a function that receives the current value and returns the string to announce.
511
- * @default null
512
- */
513
- this.ariaValueText = input(null, /* @ts-ignore */
514
- ...(ngDevMode ? [{ debugName: "ariaValueText" }] : /* istanbul ignore next */ []));
515
- /**
516
- * @description Renders the component with reduced visual emphasis and removes pointer interaction.
517
- * @default false
518
- */
519
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
520
- /**
521
- * @description Additional CSS classes to apply to the slider handle.
522
- * @default []
523
- */
524
- this.handleClasses = input([], /* @ts-ignore */
525
- ...(ngDevMode ? [{ debugName: "handleClasses" }] : /* istanbul ignore next */ []));
526
- /**
527
- * @description Additional inline styles to apply to the slider handle.
528
- * @default {}
529
- */
530
- this.handleStyles = input({}, /* @ts-ignore */
531
- ...(ngDevMode ? [{ debugName: "handleStyles" }] : /* istanbul ignore next */ []));
532
- /**
533
- * @description Marks the control as invalid for form validation purposes, reflecting `aria-invalid` on the handle
534
- * element once the control is touched.
535
- * @default false
536
- */
537
- this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
538
- /**
539
- * @description Position of the label relative to the component.
540
- * @default "after"
541
- */
542
- this.labelPosition = input("after", /* @ts-ignore */
543
- ...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
544
- /**
545
- * @description Controls which tick labels are shown — only every n<sup>th</sup> label is rendered.
546
- * @default 1
547
- */
548
- this.labelStep = input(1, /* @ts-ignore */
549
- ...(ngDevMode ? [{ debugName: "labelStep" }] : /* istanbul ignore next */ []));
550
- /**
551
- * @description Controls which ticks render at large size — only every n<sup>th</sup> tick is enlarged. Pass `null` to disable large ticks.
552
- * @default null
553
- */
554
- this.largeTickStep = input(null, /* @ts-ignore */
555
- ...(ngDevMode ? [{ debugName: "largeTickStep" }] : /* istanbul ignore next */ []));
556
- /**
557
- * @description Upper bound of the value range. Must be greater than `minValue`.
558
- * @default 10
559
- */
560
- this.maxValue = input(10, /* @ts-ignore */
561
- ...(ngDevMode ? [{ debugName: "maxValue" }] : /* istanbul ignore next */ []));
562
- /**
563
- * @description Lower bound of the value range.
564
- * @default 0
565
- */
566
- this.minValue = input(0, /* @ts-ignore */
567
- ...(ngDevMode ? [{ debugName: "minValue" }] : /* istanbul ignore next */ []));
568
- /**
569
- * @description Layout orientation of the component.
570
- * @default "horizontal"
571
- */
572
- this.orientation = input("horizontal", /* @ts-ignore */
573
- ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
574
- /**
575
- * @description Prevents value changes while the control stays focusable and readable. When bound to a signal form
576
- * field via `[formField]`, this is written by the `FormField` directive.
577
- * @default false
578
- */
579
- this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
580
- /**
581
- * @description Border-radius preset applied to the slider handle.
582
- * @default "full"
583
- */
584
- this.rounded = input("full", /* @ts-ignore */
585
- ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
586
- /**
587
- * @description Background color of the filled selection area between the minimum and the current value. Accepts a CSS color string or a `CSSStyleDeclaration` partial.
588
- * @default null
589
- */
590
- this.selectionBackground = input(null, /* @ts-ignore */
591
- ...(ngDevMode ? [{ debugName: "selectionBackground" }] : /* istanbul ignore next */ []));
592
- /**
593
- * @description Multiplier applied to the step when the user holds Shift while pressing an arrow key.
594
- * @default 10
595
- */
596
- this.shiftMultiplier = input(10, /* @ts-ignore */
597
- ...(ngDevMode ? [{ debugName: "shiftMultiplier" }] : /* istanbul ignore next */ []));
598
- /**
599
- * @description Displays value labels alongside tick marks. Only takes effect when `showTicks` is `true`.
600
- * @default false
601
- */
602
- this.showLabels = input(false, { ...(ngDevMode ? { debugName: "showLabels" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
603
- /**
604
- * @description Displays tick marks at each step position along the track.
605
- * @default false
606
- */
607
- this.showTicks = input(false, { ...(ngDevMode ? { debugName: "showTicks" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
608
- /**
609
- * @description Controls how many ticks are visible — only every n<sup>th</sup> tick is rendered.
610
- * @default 1
611
- */
612
- this.smallTickStep = input(1, { ...(ngDevMode ? { debugName: "smallTickStep" } : /* istanbul ignore next */ {}), transform: (value) => Math.max(value, 1) });
613
- /**
614
- * @description Distance between the values the control can take. `maxValue` can always be reached, even when it
615
- * isn't a whole number of steps from `minValue`.
616
- * @default 1
617
- */
618
- this.step = input(1, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: (value) => (value <= 0 ? 1 : value) });
619
- /**
620
- * @description Emitted when a handle loses focus. A click on the track moves focus to the handle first.
621
- */
622
- this.touch = output();
623
- /**
624
- * @description Marks the slider as touched. Error styling requires both `invalid` and `touched` to be `true`.
625
- * When bound to a signal form field via `[formField]`, this is written by the `FormField` directive.
626
- * @default false
627
- */
628
- this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
629
- /**
630
- * @description Background color of the unfilled track portion. Accepts a CSS color string or a `CSSStyleDeclaration` partial.
631
- * @default null
632
- */
633
- this.trackBackground = input(null, /* @ts-ignore */
634
- ...(ngDevMode ? [{ debugName: "trackBackground" }] : /* istanbul ignore next */ []));
635
- /**
636
- * @description Width (vertical orientation) or height (horizontal orientation) of the track. Accepts a pixel number or any CSS length string.
637
- * @default undefined
638
- */
639
- this.trackSize = input(/* @ts-ignore */
640
- ...(ngDevMode ? [undefined, { debugName: "trackSize" }] : /* istanbul ignore next */ []));
641
- afterNextRender({
642
- read: () => this.zone.runOutsideAngular(() => this.setSubscriptions())
643
- });
644
- if (isDevMode()) {
645
- this.#warnWhenMisconfigured();
646
- }
647
- }
648
- /**
649
- * @internal
650
- */
651
- setLabelledBy(id) {
652
- this.#label.setLabelledBy(id);
653
- }
654
- calculateNewValue(currentValue, event) {
655
- const min = this.effectiveMin();
656
- const max = this.effectiveMax();
657
- const step = this.step();
658
- const isRtl = this.isRtl();
659
- const amount = event.shiftKey ? step * this.shiftMultiplier() : step;
660
- const page = Math.max((max - min) * 0.1, step);
661
- // Max can sit off the step grid, and stepping down from it lands on the last value of the grid.
662
- const lastGridValue = this.#roundToStep(min + this.#stepCount() * step);
663
- const decreaseFrom = currentValue > lastGridValue ? lastGridValue + step : currentValue;
664
- const decreaseKey = isRtl ? "ArrowRight" : "ArrowLeft";
665
- const increaseKey = isRtl ? "ArrowLeft" : "ArrowRight";
666
- let newValue = currentValue;
667
- switch (event.key) {
668
- case decreaseKey:
669
- case "ArrowDown":
670
- newValue = decreaseFrom - amount;
671
- break;
672
- case increaseKey:
673
- case "ArrowUp":
674
- newValue = currentValue + amount;
675
- break;
676
- case "Home":
677
- newValue = min;
678
- break;
679
- case "End":
680
- newValue = max;
681
- break;
682
- case "PageDown":
683
- newValue = decreaseFrom - page;
684
- break;
685
- case "PageUp":
686
- newValue = currentValue + page;
687
- break;
688
- }
689
- return this.snapValue(newValue);
690
- }
691
- clampValue(value) {
692
- return Math.max(this.effectiveMin(), Math.min(this.effectiveMax(), value));
693
- }
694
- getMaxOverride() {
695
- return undefined;
696
- }
697
- getMinOverride() {
698
- return undefined;
699
- }
700
- getValueFromPointerEvent(event) {
701
- const containerRect = this.hostElementRef.nativeElement.getBoundingClientRect();
702
- let normalizedHandlePos;
703
- if (this.orientation() === "horizontal") {
704
- const handlePos = this.isRtl()
705
- ? containerRect.right - event.clientX
706
- : event.clientX - containerRect.left;
707
- normalizedHandlePos = (handlePos / containerRect.width) * 100;
708
- }
709
- else {
710
- const handlePos = event.clientY - containerRect.top;
711
- normalizedHandlePos = 100 - (handlePos / containerRect.height) * 100;
712
- }
713
- normalizedHandlePos = Math.max(0, Math.min(normalizedHandlePos, 100));
714
- return this.getValueFromPosition(normalizedHandlePos);
715
- }
716
- getValueFromPosition(position) {
717
- const min = this.effectiveMin();
718
- const max = this.effectiveMax();
719
- if (position >= 100) {
720
- return max;
721
- }
722
- if (position <= 0) {
723
- return min;
724
- }
725
- const range = max - min;
726
- const rawValue = min + (position / 100) * range;
727
- return this.snapValue(rawValue);
728
- }
729
- isNavigationKey(event) {
730
- return ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(event.key);
731
- }
732
- positionFromValue(value) {
733
- return valueToPosition(value, this.effectiveMin(), this.effectiveMax());
734
- }
735
- snapValue(value) {
736
- const min = this.effectiveMin();
737
- const max = this.effectiveMax();
738
- if (Number.isNaN(value) || max <= min) {
739
- return min;
740
- }
741
- const step = this.step();
742
- const clampedValue = this.clampValue(value);
743
- const snappedValue = this.clampValue(this.#roundToStep(Math.round((clampedValue - min) / step) * step + min));
744
- // Max counts as a value of the grid even when it's off it, as the last tick does.
745
- return max - clampedValue < Math.abs(clampedValue - snappedValue) ? max : snappedValue;
746
- }
747
- /**
748
- * Moves a value while the given handle is dragged with the primary button, one finger or a pen. The pointer is
749
- * captured, so a release outside the page still ends the drag.
750
- */
751
- trackHandleDrag(handle, startDrag) {
752
- fromEvent(handle, "pointerdown")
753
- .pipe(filter(event => event.button === 0 && event.isPrimary && !event.ctrlKey), filter(() => !this.dragging() && !this.interactionDisabled()), tap(event => {
754
- this.zone.run(() => this.dragging.set(true));
755
- handle.setPointerCapture?.(event.pointerId);
756
- // A touch doesn't focus the element by itself, and touch only fires when focus leaves.
757
- handle.focus({ preventScroll: true });
758
- }), switchMap(down => {
759
- const pointerEvents = (target, name) => fromEvent(target, name).pipe(filter(event => event.pointerId === down.pointerId));
760
- const end$ = merge(pointerEvents(this.#document, "pointerup"), pointerEvents(this.#document, "pointercancel"), pointerEvents(handle, "lostpointercapture")).pipe(tap(() => this.zone.run(() => this.dragging.set(false))));
761
- return pointerEvents(this.#document, "pointermove").pipe(tap(startDrag()), takeUntil(end$));
762
- }), takeUntilDestroyed(this.destroyRef))
763
- .subscribe();
764
- }
765
- #roundToStep(value) {
766
- return roundToPlaces(value, this.#stepPlaces());
767
- }
768
- #stepCount() {
769
- return Math.floor((this.effectiveMax() - this.effectiveMin()) / this.step());
770
- }
771
- #warnWhenMisconfigured() {
772
- const host = this.hostElementRef.nativeElement;
773
- let warnedAboutBounds = false;
774
- let warnedAboutValue = false;
775
- effect(() => {
776
- if (!warnedAboutBounds && this.effectiveMin() >= this.effectiveMax()) {
777
- warnedAboutBounds = true;
778
- console.warn(`[Mona Slider] The minimum (${this.effectiveMin()}) must be lower than the maximum ` +
779
- `(${this.effectiveMax()}).`, host);
780
- }
781
- });
782
- effect(() => {
783
- if (!warnedAboutValue && !this.valueIsShown()) {
784
- warnedAboutValue = true;
785
- console.warn("[Mona Slider] The value is out of range or off the step grid. The slider shows the nearest " +
786
- "valid value, and the model keeps its own until the user changes it.", host);
787
- }
788
- });
789
- }
790
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
791
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.6", type: SliderBaseComponent, isStandalone: true, inputs: { ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaValueText: { classPropertyName: "ariaValueText", publicName: "ariaValueText", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, handleClasses: { classPropertyName: "handleClasses", publicName: "handleClasses", isSignal: true, isRequired: false, transformFunction: null }, handleStyles: { classPropertyName: "handleStyles", publicName: "handleStyles", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, labelStep: { classPropertyName: "labelStep", publicName: "labelStep", isSignal: true, isRequired: false, transformFunction: null }, largeTickStep: { classPropertyName: "largeTickStep", publicName: "largeTickStep", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, selectionBackground: { classPropertyName: "selectionBackground", publicName: "selectionBackground", isSignal: true, isRequired: false, transformFunction: null }, shiftMultiplier: { classPropertyName: "shiftMultiplier", publicName: "shiftMultiplier", isSignal: true, isRequired: false, transformFunction: null }, showLabels: { classPropertyName: "showLabels", publicName: "showLabels", isSignal: true, isRequired: false, transformFunction: null }, showTicks: { classPropertyName: "showTicks", publicName: "showTicks", isSignal: true, isRequired: false, transformFunction: null }, smallTickStep: { classPropertyName: "smallTickStep", publicName: "smallTickStep", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, trackBackground: { classPropertyName: "trackBackground", publicName: "trackBackground", isSignal: true, isRequired: false, transformFunction: null }, trackSize: { classPropertyName: "trackSize", publicName: "trackSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch" }, queries: [{ propertyName: "handleTemplate", first: true, predicate: SliderHandleTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "tickValueTemplate", first: true, predicate: SliderTickValueTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0 }); }
340
+ return Number(value.toFixed(Math.min(places, 100)));
792
341
  }
793
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderBaseComponent, decorators: [{
794
- type: Directive
795
- }], ctorParameters: () => [], propDecorators: { handleTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SliderHandleTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], tickValueTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SliderTickValueTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaValueText: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaValueText", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], handleClasses: [{ type: i0.Input, args: [{ isSignal: true, alias: "handleClasses", required: false }] }], handleStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "handleStyles", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], labelStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelStep", required: false }] }], largeTickStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "largeTickStep", required: false }] }], maxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxValue", required: false }] }], minValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "minValue", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], selectionBackground: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionBackground", required: false }] }], shiftMultiplier: [{ type: i0.Input, args: [{ isSignal: true, alias: "shiftMultiplier", required: false }] }], showLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabels", required: false }] }], showTicks: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTicks", required: false }] }], smallTickStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "smallTickStep", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], trackBackground: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBackground", required: false }] }], trackSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackSize", required: false }] }] } });
796
-
797
- class SliderComponent extends SliderBaseComponent {
798
- constructor() {
799
- super(...arguments);
800
- this.computedAriaLabel = computed(() => this.ariaLabel() ?? (this.labelledBy() ? null : this.messages().sliderValue), /* @ts-ignore */
801
- ...(ngDevMode ? [{ debugName: "computedAriaLabel" }] : /* istanbul ignore next */ []));
802
- this.handleFocused = signal(false, /* @ts-ignore */
803
- ...(ngDevMode ? [{ debugName: "handleFocused" }] : /* istanbul ignore next */ []));
804
- this.handlePosition = computed(() => this.positionFromValue(this.normalizedValue()), /* @ts-ignore */
805
- ...(ngDevMode ? [{ debugName: "handlePosition" }] : /* istanbul ignore next */ []));
806
- this.handleStyle = computed(() => ({
807
- ...this.handleTemplateStyles(),
808
- ...this.handleStyles()
809
- }), /* @ts-ignore */
810
- ...(ngDevMode ? [{ debugName: "handleStyle" }] : /* istanbul ignore next */ []));
811
- this.messages = this.i18n.componentMessages("slider", SLIDER_DEFAULT_MESSAGES);
812
- this.normalizedValue = computed(() => this.snapValue(this.value()), /* @ts-ignore */
813
- ...(ngDevMode ? [{ debugName: "normalizedValue" }] : /* istanbul ignore next */ []));
814
- this.selectionLeft = computed(() => 0, /* @ts-ignore */
815
- ...(ngDevMode ? [{ debugName: "selectionLeft" }] : /* istanbul ignore next */ []));
816
- this.selectionRight = computed(() => this.handlePosition(), /* @ts-ignore */
817
- ...(ngDevMode ? [{ debugName: "selectionRight" }] : /* istanbul ignore next */ []));
818
- this.sliderHandle = viewChild.required("sliderHandle", /* @ts-ignore */
819
- ...(ngDevMode ? [{ debugName: "sliderHandle" }] : /* istanbul ignore next */ []));
820
- this.valueIsShown = computed(() => this.normalizedValue() === this.value(), /* @ts-ignore */
821
- ...(ngDevMode ? [{ debugName: "valueIsShown" }] : /* istanbul ignore next */ []));
822
- /**
823
- * @description Upper bound that wins over `maxValue`. When bound to a signal form field via `[formField]`, this is
824
- * written from the field's `max` rule.
825
- * @default undefined
826
- */
827
- this.max = input(undefined, /* @ts-ignore */
828
- ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
829
- /**
830
- * @description Lower bound that wins over `minValue`. When bound to a signal form field via `[formField]`, this is
831
- * written from the field's `min` rule.
832
- * @default undefined
833
- */
834
- this.min = input(undefined, /* @ts-ignore */
835
- ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
836
- /**
837
- * @description Current value. A value out of range or off the step grid is shown at the nearest valid value, and
838
- * the model keeps its own until the user changes it, so a `maxValue` that loads late can't overwrite saved data. A
839
- * development warning reports it.
840
- * @default 0
841
- */
842
- this.value = model(0, /* @ts-ignore */
843
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
844
- }
845
- /** Moves focus to the handle. Does nothing while disabled. */
846
- focus(options) {
847
- if (!this.effectiveDisabled()) {
848
- this.sliderHandle().nativeElement.focus(options);
849
- }
850
- }
851
- getMaxOverride() {
852
- return this.max();
853
- }
854
- getMinOverride() {
855
- return this.min();
856
- }
857
- handleHandleMove(event) {
858
- this.updateValue(this.getValueFromPointerEvent(event));
859
- }
860
- setSubscriptions() {
861
- this.setClickSubscription();
862
- this.setKeydownSubscription();
863
- this.setPointerMoveSubscription();
864
- this.setFocusSubscription();
865
- }
866
- setClickSubscription() {
867
- fromEvent(this.hostElementRef.nativeElement, "click")
868
- .pipe(takeUntilDestroyed(this.destroyRef), tap(() => this.dragging.set(false)), filter(() => !this.interactionDisabled()))
869
- .subscribe((event) => {
870
- const handle = this.sliderHandle().nativeElement;
871
- // A drag ends with a click on the handle, and the drag has already placed the value.
872
- if (!handle.contains(event.target)) {
873
- this.handleHandleMove(event);
874
- }
875
- handle.focus({ preventScroll: true });
876
- });
877
- }
878
- setFocusSubscription() {
879
- fromEvent(this.sliderHandle().nativeElement, "focus")
880
- .pipe(takeUntilDestroyed(this.destroyRef))
881
- .subscribe(() => this.zone.run(() => this.handleFocused.set(true)));
882
- fromEvent(this.sliderHandle().nativeElement, "blur")
883
- .pipe(takeUntilDestroyed(this.destroyRef))
884
- .subscribe(() => {
885
- this.zone.run(() => {
886
- this.handleFocused.set(false);
887
- this.touch.emit();
888
- });
889
- });
890
- }
891
- setKeydownSubscription() {
892
- fromEvent(this.sliderHandle().nativeElement, "keydown")
893
- .pipe(takeUntilDestroyed(this.destroyRef), filter(() => !this.interactionDisabled()), filter(event => this.isNavigationKey(event)), tap(event => {
894
- event.preventDefault();
895
- event.stopPropagation();
896
- }))
897
- .subscribe(event => this.updateValue(this.calculateNewValue(this.normalizedValue(), event)));
898
- }
899
- setPointerMoveSubscription() {
900
- this.trackHandleDrag(this.sliderHandle().nativeElement, () => event => this.handleHandleMove(event));
901
- }
902
- updateValue(value) {
903
- const nextValue = this.snapValue(value);
904
- if (nextValue === this.normalizedValue()) {
905
- return;
906
- }
907
- this.zone.run(() => this.value.set(nextValue));
908
- }
909
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
910
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SliderComponent, isStandalone: true, selector: "mona-slider", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.aria-describedby": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "class": "baseClasses()", "class.mona-slider": "true", "attr.data-disabled": "effectiveDisabled() || null", "attr.data-orientation": "orientation()", "attr.data-readonly": "readonly() || null" } }, viewQueries: [{ propertyName: "sliderHandle", first: true, predicate: ["sliderHandle"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n data-slider-tick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.label }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"handleFocused()\"\n [style]=\"handleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? handlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? handlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? handlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"effectiveMin()\"\n [attr.aria-valuemax]=\"effectiveMax()\"\n [attr.aria-valuenow]=\"normalizedValue()\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue() }\"></ng-container>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: LabelStylePipe, name: "labelStyle" }, { kind: "pipe", type: TickStylePipe, name: "tickStyle" }] }); }
911
- }
912
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SliderComponent, decorators: [{
913
- type: Component,
914
- args: [{ selector: "mona-slider", imports: [NgTemplateOutlet, LabelStylePipe, TickStylePipe], host: {
915
- // The ARIA inputs are applied to the handle, so the host must not keep the static attributes.
916
- "[attr.aria-describedby]": "null",
917
- "[attr.aria-label]": "null",
918
- "[attr.aria-labelledby]": "null",
919
- "[class]": "baseClasses()",
920
- "[class.mona-slider]": "true",
921
- "[attr.data-disabled]": "effectiveDisabled() || null",
922
- "[attr.data-orientation]": "orientation()",
923
- "[attr.data-readonly]": "readonly() || null"
924
- }, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n data-slider-tick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.label }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"handleFocused()\"\n [style]=\"handleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? handlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? handlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? handlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"effectiveMin()\"\n [attr.aria-valuemax]=\"effectiveMax()\"\n [attr.aria-valuenow]=\"normalizedValue()\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue() }\"></ng-container>\n }\n</div>\n" }]
925
- }], propDecorators: { sliderHandle: [{ type: i0.ViewChild, args: ["sliderHandle", { isSignal: true }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
926
-
927
- class RangeSliderComponent extends SliderBaseComponent {
928
- constructor() {
929
- super(...arguments);
930
- this.computedAriaLabelEnd = computed(() => this.ariaLabelEnd() ?? this.messages().maximumValue, /* @ts-ignore */
931
- ...(ngDevMode ? [{ debugName: "computedAriaLabelEnd" }] : /* istanbul ignore next */ []));
932
- this.computedAriaLabelStart = computed(() => this.ariaLabelStart() ?? this.messages().minimumValue, /* @ts-ignore */
933
- ...(ngDevMode ? [{ debugName: "computedAriaLabelStart" }] : /* istanbul ignore next */ []));
934
- this.endHandleId = createElementControlId();
935
- // Each handle reads the group's label and then its own, so two range sliders on a page sound different.
936
- this.endLabelledBy = computed(() => {
937
- const labelledBy = this.labelledBy();
938
- return labelledBy ? `${labelledBy} ${this.endHandleId}` : null;
939
- }, /* @ts-ignore */
940
- ...(ngDevMode ? [{ debugName: "endLabelledBy" }] : /* istanbul ignore next */ []));
941
- this.handlePositions = computed(() => [
942
- this.positionFromValue(this.normalizedValue()[0]),
943
- this.positionFromValue(this.normalizedValue()[1])
944
- ], /* @ts-ignore */
945
- ...(ngDevMode ? [{ debugName: "handlePositions" }] : /* istanbul ignore next */ []));
946
- this.handlesOverlap = computed(() => {
947
- const values = this.normalizedValue();
948
- return values[0] === values[1];
949
- }, /* @ts-ignore */
950
- ...(ngDevMode ? [{ debugName: "handlesOverlap" }] : /* istanbul ignore next */ []));
951
- this.messages = this.i18n.componentMessages("slider", SLIDER_DEFAULT_MESSAGES);
952
- this.normalizedValue = computed(() => {
953
- const value = this.value();
954
- const minValue = this.snapValue(value[0]);
955
- const maxValue = this.snapValue(value[1]);
956
- return [Math.min(minValue, maxValue), Math.max(minValue, maxValue)];
957
- }, /* @ts-ignore */
958
- ...(ngDevMode ? [{ debugName: "normalizedValue" }] : /* istanbul ignore next */ []));
959
- this.primaryHandleFocused = signal(false, /* @ts-ignore */
960
- ...(ngDevMode ? [{ debugName: "primaryHandleFocused" }] : /* istanbul ignore next */ []));
961
- this.primaryHandlePosition = computed(() => this.handlePositions()[0], /* @ts-ignore */
962
- ...(ngDevMode ? [{ debugName: "primaryHandlePosition" }] : /* istanbul ignore next */ []));
963
- this.primaryHandleStyle = computed(() => {
964
- const style = { ...this.handleTemplateStyles(), ...this.handleStyles() };
965
- if (this.handlesOverlap()) {
966
- return { ...style, zIndex: this.secondaryHandleOnTop() ? "1" : "2" };
967
- }
968
- return style;
969
- }, /* @ts-ignore */
970
- ...(ngDevMode ? [{ debugName: "primaryHandleStyle" }] : /* istanbul ignore next */ []));
971
- this.secondaryHandleFocused = signal(false, /* @ts-ignore */
972
- ...(ngDevMode ? [{ debugName: "secondaryHandleFocused" }] : /* istanbul ignore next */ []));
973
- this.secondaryHandleOnTop = signal(true, /* @ts-ignore */
974
- ...(ngDevMode ? [{ debugName: "secondaryHandleOnTop" }] : /* istanbul ignore next */ []));
975
- this.secondaryHandlePosition = computed(() => this.handlePositions()[1], /* @ts-ignore */
976
- ...(ngDevMode ? [{ debugName: "secondaryHandlePosition" }] : /* istanbul ignore next */ []));
977
- this.secondaryHandleStyle = computed(() => {
978
- const style = { ...this.handleTemplateStyles(), ...this.handleStyles() };
979
- if (this.handlesOverlap()) {
980
- return { ...style, zIndex: this.secondaryHandleOnTop() ? "2" : "1" };
981
- }
982
- return style;
983
- }, /* @ts-ignore */
984
- ...(ngDevMode ? [{ debugName: "secondaryHandleStyle" }] : /* istanbul ignore next */ []));
985
- this.secondarySliderHandle = viewChild.required("secondarySliderHandle", /* @ts-ignore */
986
- ...(ngDevMode ? [{ debugName: "secondarySliderHandle" }] : /* istanbul ignore next */ []));
987
- this.selectionLeft = computed(() => this.handlePositions()[0], /* @ts-ignore */
988
- ...(ngDevMode ? [{ debugName: "selectionLeft" }] : /* istanbul ignore next */ []));
989
- this.selectionRight = computed(() => this.handlePositions()[1], /* @ts-ignore */
990
- ...(ngDevMode ? [{ debugName: "selectionRight" }] : /* istanbul ignore next */ []));
991
- this.sliderHandle = viewChild.required("sliderHandle", /* @ts-ignore */
992
- ...(ngDevMode ? [{ debugName: "sliderHandle" }] : /* istanbul ignore next */ []));
993
- this.startHandleId = createElementControlId();
994
- this.startLabelledBy = computed(() => {
995
- const labelledBy = this.labelledBy();
996
- return labelledBy ? `${labelledBy} ${this.startHandleId}` : null;
997
- }, /* @ts-ignore */
998
- ...(ngDevMode ? [{ debugName: "startLabelledBy" }] : /* istanbul ignore next */ []));
999
- this.valueIsShown = computed(() => {
1000
- const [lower, upper] = this.normalizedValue();
1001
- const [first, second] = this.value();
1002
- return lower === first && upper === second;
1003
- }, /* @ts-ignore */
1004
- ...(ngDevMode ? [{ debugName: "valueIsShown" }] : /* istanbul ignore next */ []));
1005
- /**
1006
- * @description Accessible name for the upper-value (secondary) handle.
1007
- * @default null
1008
- */
1009
- this.ariaLabelEnd = input(null, { ...(ngDevMode ? { debugName: "ariaLabelEnd" } : /* istanbul ignore next */ {}), alias: "aria-label-end" });
1010
- /**
1011
- * @description Accessible name for the lower-value (primary) handle.
1012
- * @default null
1013
- */
1014
- this.ariaLabelStart = input(null, { ...(ngDevMode ? { debugName: "ariaLabelStart" } : /* istanbul ignore next */ {}), alias: "aria-label-start" });
1015
- /**
1016
- * @description Selected range as `[minimum, maximum]`.
1017
- * A value out of range, off the step grid or unsorted is shown at the nearest valid values, and the model keeps its
1018
- * own until the user changes it. A development warning reports it.
1019
- * @default [0, 10]
1020
- */
1021
- this.value = model([0, 10], /* @ts-ignore */
1022
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
1023
- }
1024
- /** Moves focus to the lower handle. Does nothing while disabled. */
1025
- focus(options) {
1026
- if (!this.effectiveDisabled()) {
1027
- this.sliderHandle().nativeElement.focus(options);
1028
- }
1029
- }
1030
- handleHandleMove(event, isSecondary = false) {
1031
- this.updateRangedValue(this.getValueFromPointerEvent(event), isSecondary);
1032
- }
1033
- setSubscriptions() {
1034
- this.setClickSubscription();
1035
- this.setKeydownSubscription();
1036
- this.setPointerMoveSubscription();
1037
- this.setFocusSubscription();
1038
- }
1039
- getClosestHandle(event) {
1040
- const currentValues = this.normalizedValue();
1041
- if (currentValues[0] === currentValues[1]) {
1042
- const containerRect = this.hostElementRef.nativeElement.getBoundingClientRect();
1043
- let normalizedClickPos;
1044
- if (this.orientation() === "horizontal") {
1045
- const clickPos = this.isRtl()
1046
- ? containerRect.right - event.clientX
1047
- : event.clientX - containerRect.left;
1048
- normalizedClickPos = (clickPos / containerRect.width) * 100;
1049
- }
1050
- else {
1051
- const clickPos = event.clientY - containerRect.top;
1052
- normalizedClickPos = 100 - (clickPos / containerRect.height) * 100;
1053
- }
1054
- const clickValue = this.getValueFromPosition(normalizedClickPos);
1055
- return clickValue > currentValues[0];
1056
- }
1057
- const primaryRect = this.sliderHandle().nativeElement.getBoundingClientRect();
1058
- const secondaryRect = this.secondarySliderHandle().nativeElement.getBoundingClientRect();
1059
- const primaryDistance = Math.sqrt(Math.pow(primaryRect.left + primaryRect.width / 2 - event.clientX, 2) +
1060
- Math.pow(primaryRect.top + primaryRect.height / 2 - event.clientY, 2));
1061
- const secondaryDistance = Math.sqrt(Math.pow(secondaryRect.left + secondaryRect.width / 2 - event.clientX, 2) +
1062
- Math.pow(secondaryRect.top + secondaryRect.height / 2 - event.clientY, 2));
1063
- return secondaryDistance < primaryDistance;
1064
- }
1065
- setClickSubscription() {
1066
- fromEvent(this.hostElementRef.nativeElement, "click")
1067
- .pipe(takeUntilDestroyed(this.destroyRef), tap(() => this.dragging.set(false)), filter(() => !this.interactionDisabled()))
1068
- .subscribe((event) => {
1069
- const target = event.target;
1070
- // A drag ends with a click on the handle, and moving the closest handle would move the other one.
1071
- if (this.sliderHandle().nativeElement.contains(target) ||
1072
- this.secondarySliderHandle().nativeElement.contains(target)) {
1073
- return;
1074
- }
1075
- const isSecondary = this.getClosestHandle(event);
1076
- this.handleHandleMove(event, isSecondary);
1077
- const handle = isSecondary ? this.secondarySliderHandle() : this.sliderHandle();
1078
- handle.nativeElement.focus({ preventScroll: true });
1079
- });
1080
- }
1081
- setFocusSubscription() {
1082
- fromEvent(this.sliderHandle().nativeElement, "focus")
1083
- .pipe(takeUntilDestroyed(this.destroyRef))
1084
- .subscribe(() => {
1085
- this.zone.run(() => {
1086
- this.primaryHandleFocused.set(true);
1087
- this.secondaryHandleFocused.set(false);
1088
- });
1089
- });
1090
- fromEvent(this.sliderHandle().nativeElement, "blur")
1091
- .pipe(takeUntilDestroyed(this.destroyRef))
1092
- .subscribe(() => {
1093
- this.zone.run(() => {
1094
- this.primaryHandleFocused.set(false);
1095
- this.touch.emit();
1096
- });
1097
- });
1098
- fromEvent(this.secondarySliderHandle().nativeElement, "focus")
1099
- .pipe(takeUntilDestroyed(this.destroyRef))
1100
- .subscribe(() => {
1101
- this.zone.run(() => {
1102
- this.secondaryHandleFocused.set(true);
1103
- this.primaryHandleFocused.set(false);
1104
- });
1105
- });
1106
- fromEvent(this.secondarySliderHandle().nativeElement, "blur")
1107
- .pipe(takeUntilDestroyed(this.destroyRef))
1108
- .subscribe(() => {
1109
- this.zone.run(() => {
1110
- this.secondaryHandleFocused.set(false);
1111
- this.touch.emit();
1112
- });
1113
- });
1114
- }
1115
- setKeydownSubscription() {
1116
- fromEvent(this.sliderHandle().nativeElement, "keydown")
1117
- .pipe(takeUntilDestroyed(this.destroyRef), filter(() => !this.interactionDisabled()), filter(event => this.isNavigationKey(event)), tap(event => {
1118
- event.preventDefault();
1119
- event.stopPropagation();
1120
- }))
1121
- .subscribe(event => {
1122
- const newValue = this.calculateNewValue(this.normalizedValue()[0], event);
1123
- this.updateRangedValue(newValue, false);
1124
- });
1125
- fromEvent(this.secondarySliderHandle().nativeElement, "keydown")
1126
- .pipe(takeUntilDestroyed(this.destroyRef), filter(() => !this.interactionDisabled()), filter(event => this.isNavigationKey(event)), tap(event => {
1127
- event.preventDefault();
1128
- event.stopPropagation();
1129
- }))
1130
- .subscribe(event => {
1131
- const newValue = this.calculateNewValue(this.normalizedValue()[1], event);
1132
- this.updateRangedValue(newValue, true);
1133
- });
1134
- }
1135
- setPointerMoveSubscription() {
1136
- this.trackRangeHandle(this.sliderHandle().nativeElement, false);
1137
- this.trackRangeHandle(this.secondarySliderHandle().nativeElement, true);
1138
- }
1139
- trackRangeHandle(handle, startsSecondary) {
1140
- this.trackHandleDrag(handle, () => {
1141
- let isSecondary = startsSecondary;
1142
- return event => {
1143
- const value = this.getValueFromPointerEvent(event);
1144
- const [lower, upper] = this.normalizedValue();
1145
- // Handles stop at each other, so stacked ones are told apart by the way the pointer moves. Otherwise
1146
- // the one on top could be stuck.
1147
- if (lower === upper && value !== lower && isSecondary !== value > lower) {
1148
- isSecondary = value > lower;
1149
- const active = isSecondary ? this.secondarySliderHandle() : this.sliderHandle();
1150
- active.nativeElement.focus({ preventScroll: true });
1151
- }
1152
- this.updateRangedValue(value, isSecondary);
1153
- };
1154
- });
1155
- }
1156
- updateRangedValue(value, isSecondary) {
1157
- const currentValues = this.normalizedValue();
1158
- const currentMinValue = currentValues[0];
1159
- const currentMaxValue = currentValues[1];
1160
- let newMinValue = currentMinValue;
1161
- let newMaxValue = currentMaxValue;
1162
- if (isSecondary) {
1163
- newMaxValue = Math.max(value, currentMinValue);
1164
- if (newMaxValue === currentMinValue) {
1165
- this.secondaryHandleOnTop.set(true);
1166
- }
1167
- }
1168
- else {
1169
- newMinValue = Math.min(value, currentMaxValue);
1170
- if (newMinValue === currentMaxValue) {
1171
- this.secondaryHandleOnTop.set(false);
1172
- }
1173
- }
1174
- newMinValue = this.snapValue(newMinValue);
1175
- newMaxValue = this.snapValue(newMaxValue);
1176
- if (newMinValue === currentMinValue && newMaxValue === currentMaxValue) {
1177
- return;
1178
- }
1179
- this.zone.run(() => this.value.set([newMinValue, newMaxValue]));
1180
- }
1181
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RangeSliderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1182
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: RangeSliderComponent, isStandalone: true, selector: "mona-range-slider", inputs: { ariaLabelEnd: { classPropertyName: "ariaLabelEnd", publicName: "aria-label-end", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelStart: { classPropertyName: "ariaLabelStart", publicName: "aria-label-start", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.aria-describedby": "null", "attr.aria-label-end": "null", "attr.aria-label-start": "null", "class": "baseClasses()", "class.mona-slider": "true", "attr.data-disabled": "effectiveDisabled() || null", "attr.data-orientation": "orientation()", "attr.data-readonly": "readonly() || null", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "labelledBy()", "attr.role": "'group'" } }, viewQueries: [{ propertyName: "secondarySliderHandle", first: true, predicate: ["secondarySliderHandle"], descendants: true, isSignal: true }, { propertyName: "sliderHandle", first: true, predicate: ["sliderHandle"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n data-slider-tick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.label }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"primaryHandleFocused()\"\n [style]=\"primaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? primaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? primaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? primaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"effectiveMin()\"\n [attr.aria-valuemax]=\"normalizedValue()[1]\"\n [attr.aria-valuenow]=\"normalizedValue()[0]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[0]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabelStart()\"\n [attr.aria-labelledby]=\"startLabelledBy()\"\n [attr.id]=\"startHandleId\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[0] }\"></ng-container>\n }\n</div>\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"secondaryHandleFocused()\"\n [style]=\"secondaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? secondaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? secondaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? secondaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"normalizedValue()[0]\"\n [attr.aria-valuemax]=\"effectiveMax()\"\n [attr.aria-valuenow]=\"normalizedValue()[1]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[1]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabelEnd()\"\n [attr.aria-labelledby]=\"endLabelledBy()\"\n [attr.id]=\"endHandleId\"\n #secondarySliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[1] }\"></ng-container>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: LabelStylePipe, name: "labelStyle" }, { kind: "pipe", type: TickStylePipe, name: "tickStyle" }] }); }
1183
- }
1184
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RangeSliderComponent, decorators: [{
1185
- type: Component,
1186
- args: [{ selector: "mona-range-slider", imports: [NgTemplateOutlet, LabelStylePipe, TickStylePipe], host: {
1187
- // The description and the handles' names are applied to the handles, so the host must not keep the static
1188
- // attributes. aria-label-start and aria-label-end aren't ARIA attributes at all.
1189
- "[attr.aria-describedby]": "null",
1190
- "[attr.aria-label-end]": "null",
1191
- "[attr.aria-label-start]": "null",
1192
- "[class]": "baseClasses()",
1193
- "[class.mona-slider]": "true",
1194
- "[attr.data-disabled]": "effectiveDisabled() || null",
1195
- "[attr.data-orientation]": "orientation()",
1196
- "[attr.data-readonly]": "readonly() || null",
1197
- "[attr.aria-label]": "ariaLabel()",
1198
- "[attr.aria-labelledby]": "labelledBy()",
1199
- "[attr.role]": "'group'"
1200
- }, template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n data-slider-tick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.label }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"primaryHandleFocused()\"\n [style]=\"primaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? primaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? primaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? primaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"effectiveMin()\"\n [attr.aria-valuemax]=\"normalizedValue()[1]\"\n [attr.aria-valuenow]=\"normalizedValue()[0]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[0]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabelStart()\"\n [attr.aria-labelledby]=\"startLabelledBy()\"\n [attr.id]=\"startHandleId\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[0] }\"></ng-container>\n }\n</div>\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"secondaryHandleFocused()\"\n [style]=\"secondaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? secondaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? secondaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? secondaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"normalizedValue()[0]\"\n [attr.aria-valuemax]=\"effectiveMax()\"\n [attr.aria-valuenow]=\"normalizedValue()[1]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[1]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabelEnd()\"\n [attr.aria-labelledby]=\"endLabelledBy()\"\n [attr.id]=\"endHandleId\"\n #secondarySliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[1] }\"></ng-container>\n }\n</div>\n" }]
1201
- }], propDecorators: { secondarySliderHandle: [{ type: i0.ViewChild, args: ["secondarySliderHandle", { isSignal: true }] }], sliderHandle: [{ type: i0.ViewChild, args: ["sliderHandle", { isSignal: true }] }], ariaLabelEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label-end", required: false }] }], ariaLabelStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label-start", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
1202
-
1203
- /*
1204
- * Public API Surface of @nanahoshi/mona-ui/slider
1205
- */
1206
-
1207
- /**
1208
- * Generated bundle index. Do not edit.
1209
- */
1210
-
342
+ var SliderBaseComponent = class SliderBaseComponent {
343
+ #document;
344
+ #label;
345
+ #stepPlaces;
346
+ constructor() {
347
+ this.#document = inject(DOCUMENT);
348
+ this.#label = injectLabelAssociation({
349
+ activate: () => this.focus(),
350
+ ariaLabel: () => this.ariaLabel(),
351
+ ariaLabelledBy: () => this.ariaLabelledBy()
352
+ });
353
+ this.#stepPlaces = computed(() => Math.max(decimalPlaces(this.step()), decimalPlaces(this.effectiveMin())), ...ngDevMode ? [{ debugName: "#stepPlaces" }] : /* istanbul ignore next */ []);
354
+ this.baseClasses = computed(() => sliderBaseThemeVariants(), ...ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []);
355
+ this.destroyRef = inject(DestroyRef);
356
+ this.direction = injectComponentDirection();
357
+ this.dragging = signal(false, ...ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []);
358
+ this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
359
+ this.effectiveMax = computed(() => this.getMaxOverride() ?? this.maxValue(), ...ngDevMode ? [{ debugName: "effectiveMax" }] : /* istanbul ignore next */ []);
360
+ this.effectiveMin = computed(() => this.getMinOverride() ?? this.minValue(), ...ngDevMode ? [{ debugName: "effectiveMin" }] : /* istanbul ignore next */ []);
361
+ this.handleTemplate = contentChild(SliderHandleTemplateDirective, {
362
+ ...ngDevMode ? { debugName: "handleTemplate" } : /* istanbul ignore next */ {},
363
+ read: TemplateRef
364
+ });
365
+ this.handleTemplateStyles = computed(() => {
366
+ if (!this.handleTemplate()) return {};
367
+ return {
368
+ background: "transparent",
369
+ border: "none",
370
+ boxShadow: "none"
371
+ };
372
+ }, ...ngDevMode ? [{ debugName: "handleTemplateStyles" }] : /* istanbul ignore next */ []);
373
+ this.horizontalSelectionLeft = computed(() => {
374
+ if (this.orientation() !== "horizontal") return;
375
+ return this.isRtl() ? 100 - this.selectionRight() : this.selectionLeft();
376
+ }, ...ngDevMode ? [{ debugName: "horizontalSelectionLeft" }] : /* istanbul ignore next */ []);
377
+ this.horizontalSelectionRight = computed(() => {
378
+ if (this.orientation() !== "horizontal") return;
379
+ return this.isRtl() ? this.selectionLeft() : 100 - this.selectionRight();
380
+ }, ...ngDevMode ? [{ debugName: "horizontalSelectionRight" }] : /* istanbul ignore next */ []);
381
+ this.hostElementRef = inject(ElementRef);
382
+ this.i18n = inject(MonaI18nService);
383
+ this.interactionDisabled = computed(() => this.effectiveDisabled() || this.readonly(), ...ngDevMode ? [{ debugName: "interactionDisabled" }] : /* istanbul ignore next */ []);
384
+ this.invalidState = computed(() => this.touched() && this.invalid(), ...ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []);
385
+ this.isRtl = computed(() => this.direction() === "rtl", ...ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []);
386
+ this.labelStyleArgs = computed(() => {
387
+ return {
388
+ direction: this.direction(),
389
+ labelPosition: this.labelPosition(),
390
+ max: this.effectiveMax(),
391
+ min: this.effectiveMin(),
392
+ orientation: this.orientation(),
393
+ tickCount: this.labelTicks().length
394
+ };
395
+ }, ...ngDevMode ? [{ debugName: "labelStyleArgs" }] : /* istanbul ignore next */ []);
396
+ this.labelTicks = computed(() => {
397
+ const allTicks = this.ticks();
398
+ if (allTicks.length === 0) return [];
399
+ const tickStep = this.labelStep();
400
+ const lastTick = allTicks[allTicks.length - 1];
401
+ const labels = allTicks.filter((t) => t.index % tickStep === 0);
402
+ if (labels.length === 0 || labels[labels.length - 1].value !== lastTick.value) labels.push(lastTick);
403
+ if (labels.length >= 2) {
404
+ const penultimate = labels[labels.length - 2];
405
+ const last = labels[labels.length - 1];
406
+ const penultimatePos = valueToPosition(penultimate.value, this.effectiveMin(), this.effectiveMax());
407
+ const lastPos = valueToPosition(last.value, this.effectiveMin(), this.effectiveMax());
408
+ if (this.step() !== 1 && lastPos - penultimatePos < 4) labels.splice(labels.length - 2, 1);
409
+ }
410
+ const localeId = this.i18n.localeId();
411
+ return labels.map((tick) => ({
412
+ ...tick,
413
+ label: formatNumber(tick.value, localeId, { maximumFractionDigits: decimalPlaces(tick.value) })
414
+ }));
415
+ }, ...ngDevMode ? [{ debugName: "labelTicks" }] : /* istanbul ignore next */ []);
416
+ this.labelledBy = this.#label.labelledBy;
417
+ this.renderTicks = computed(() => {
418
+ const ticks = this.ticks();
419
+ if (this.orientation() === "vertical") return ticks.slice().reverse();
420
+ return ticks;
421
+ }, ...ngDevMode ? [{ debugName: "renderTicks" }] : /* istanbul ignore next */ []);
422
+ this.selectionBackgroundStyle = computed(() => {
423
+ const bg = this.selectionBackground();
424
+ if (!bg) return {};
425
+ return typeof bg === "string" ? { background: bg } : bg;
426
+ }, ...ngDevMode ? [{ debugName: "selectionBackgroundStyle" }] : /* istanbul ignore next */ []);
427
+ this.selectionClasses = computed(() => sliderSelectionThemeVariants(), ...ngDevMode ? [{ debugName: "selectionClasses" }] : /* istanbul ignore next */ []);
428
+ this.sliderHandleClasses = computed(() => {
429
+ const rounded = this.rounded();
430
+ const handleClasses = this.handleClasses();
431
+ const variants = sliderHandleThemeVariants({ rounded });
432
+ return twMerge(variants ?? "", Array.isArray(handleClasses) ? handleClasses.join(" ") : handleClasses);
433
+ }, ...ngDevMode ? [{ debugName: "sliderHandleClasses" }] : /* istanbul ignore next */ []);
434
+ this.sliderTrackSize = computed(() => {
435
+ const trackSize = this.trackSize();
436
+ if (trackSize == null || trackSize === "") return null;
437
+ if (typeof trackSize === "number") return `${trackSize}px`;
438
+ const number = Number(trackSize);
439
+ if (isNaN(number)) return trackSize;
440
+ return `${number}px`;
441
+ }, ...ngDevMode ? [{ debugName: "sliderTrackSize" }] : /* istanbul ignore next */ []);
442
+ this.tickClasses = computed(() => sliderTickThemeVariants(), ...ngDevMode ? [{ debugName: "tickClasses" }] : /* istanbul ignore next */ []);
443
+ this.tickLabelClasses = computed(() => sliderTickLabelThemeVariants(), ...ngDevMode ? [{ debugName: "tickLabelClasses" }] : /* istanbul ignore next */ []);
444
+ this.tickLabelListClasses = computed(() => sliderTickLabelListThemeVariants(), ...ngDevMode ? [{ debugName: "tickLabelListClasses" }] : /* istanbul ignore next */ []);
445
+ this.tickListClasses = computed(() => sliderTickListThemeVariants(), ...ngDevMode ? [{ debugName: "tickListClasses" }] : /* istanbul ignore next */ []);
446
+ this.tickStyleArgs = computed(() => {
447
+ return {
448
+ direction: this.direction(),
449
+ largeTickStep: this.largeTickStep(),
450
+ max: this.effectiveMax(),
451
+ min: this.effectiveMin(),
452
+ orientation: this.orientation(),
453
+ smallTickStep: this.smallTickStep()
454
+ };
455
+ }, ...ngDevMode ? [{ debugName: "tickStyleArgs" }] : /* istanbul ignore next */ []);
456
+ this.tickValueTemplate = contentChild(SliderTickValueTemplateDirective, {
457
+ ...ngDevMode ? { debugName: "tickValueTemplate" } : /* istanbul ignore next */ {},
458
+ read: TemplateRef
459
+ });
460
+ this.ticks = computed(() => {
461
+ const min = this.effectiveMin();
462
+ const max = this.effectiveMax();
463
+ const step = this.step();
464
+ const ticks = [];
465
+ const count = this.#stepCount();
466
+ for (let i = 0; i <= count; i++) ticks.push({
467
+ index: i,
468
+ value: this.#roundToStep(min + i * step)
469
+ });
470
+ if (ticks.length === 0 || ticks[ticks.length - 1].value < max) ticks.push({
471
+ index: ticks.length,
472
+ value: max
473
+ });
474
+ return ticks;
475
+ }, ...ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []);
476
+ this.trackBackgroundStyle = computed(() => {
477
+ const bg = this.trackBackground();
478
+ if (!bg) return {};
479
+ return typeof bg === "string" ? { background: bg } : bg;
480
+ }, ...ngDevMode ? [{ debugName: "trackBackgroundStyle" }] : /* istanbul ignore next */ []);
481
+ this.trackClasses = computed(() => {
482
+ const rounded = this.rounded();
483
+ return sliderTrackThemeVariants({ rounded });
484
+ }, ...ngDevMode ? [{ debugName: "trackClasses" }] : /* istanbul ignore next */ []);
485
+ this.zone = inject(NgZone);
486
+ this.ariaDescribedBy = input(null, {
487
+ ...ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {},
488
+ alias: "aria-describedby"
489
+ });
490
+ this.ariaLabel = input(null, {
491
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
492
+ alias: "aria-label"
493
+ });
494
+ this.ariaLabelledBy = input(null, {
495
+ ...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
496
+ alias: "aria-labelledby"
497
+ });
498
+ this.ariaValueText = input(null, ...ngDevMode ? [{ debugName: "ariaValueText" }] : /* istanbul ignore next */ []);
499
+ this.disabled = input(false, {
500
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
501
+ transform: booleanAttribute
502
+ });
503
+ this.handleClasses = input([], ...ngDevMode ? [{ debugName: "handleClasses" }] : /* istanbul ignore next */ []);
504
+ this.handleStyles = input({}, ...ngDevMode ? [{ debugName: "handleStyles" }] : /* istanbul ignore next */ []);
505
+ this.invalid = input(false, {
506
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
507
+ transform: booleanAttribute
508
+ });
509
+ this.labelPosition = input("after", ...ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []);
510
+ this.labelStep = input(1, ...ngDevMode ? [{ debugName: "labelStep" }] : /* istanbul ignore next */ []);
511
+ this.largeTickStep = input(null, ...ngDevMode ? [{ debugName: "largeTickStep" }] : /* istanbul ignore next */ []);
512
+ this.maxValue = input(10, ...ngDevMode ? [{ debugName: "maxValue" }] : /* istanbul ignore next */ []);
513
+ this.minValue = input(0, ...ngDevMode ? [{ debugName: "minValue" }] : /* istanbul ignore next */ []);
514
+ this.orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
515
+ this.readonly = input(false, {
516
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
517
+ transform: booleanAttribute
518
+ });
519
+ this.rounded = input("full", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
520
+ this.selectionBackground = input(null, ...ngDevMode ? [{ debugName: "selectionBackground" }] : /* istanbul ignore next */ []);
521
+ this.shiftMultiplier = input(10, ...ngDevMode ? [{ debugName: "shiftMultiplier" }] : /* istanbul ignore next */ []);
522
+ this.showLabels = input(false, {
523
+ ...ngDevMode ? { debugName: "showLabels" } : /* istanbul ignore next */ {},
524
+ transform: booleanAttribute
525
+ });
526
+ this.showTicks = input(false, {
527
+ ...ngDevMode ? { debugName: "showTicks" } : /* istanbul ignore next */ {},
528
+ transform: booleanAttribute
529
+ });
530
+ this.smallTickStep = input(1, {
531
+ ...ngDevMode ? { debugName: "smallTickStep" } : /* istanbul ignore next */ {},
532
+ transform: (value) => Math.max(value, 1)
533
+ });
534
+ this.step = input(1, {
535
+ ...ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {},
536
+ transform: (value) => value <= 0 ? 1 : value
537
+ });
538
+ this.touch = output();
539
+ this.touched = input(false, {
540
+ ...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
541
+ transform: booleanAttribute
542
+ });
543
+ this.trackBackground = input(null, ...ngDevMode ? [{ debugName: "trackBackground" }] : /* istanbul ignore next */ []);
544
+ this.trackSize = input(...ngDevMode ? [void 0, { debugName: "trackSize" }] : /* istanbul ignore next */ []);
545
+ afterNextRender({ read: () => this.zone.runOutsideAngular(() => this.setSubscriptions()) });
546
+ if (isDevMode()) this.#warnWhenMisconfigured();
547
+ }
548
+ setLabelledBy(id) {
549
+ this.#label.setLabelledBy(id);
550
+ }
551
+ calculateNewValue(currentValue, event) {
552
+ const min = this.effectiveMin();
553
+ const max = this.effectiveMax();
554
+ const step = this.step();
555
+ const isRtl = this.isRtl();
556
+ const amount = event.shiftKey ? step * this.shiftMultiplier() : step;
557
+ const page = Math.max((max - min) * .1, step);
558
+ const lastGridValue = this.#roundToStep(min + this.#stepCount() * step);
559
+ const decreaseFrom = currentValue > lastGridValue ? lastGridValue + step : currentValue;
560
+ const decreaseKey = isRtl ? "ArrowRight" : "ArrowLeft";
561
+ const increaseKey = isRtl ? "ArrowLeft" : "ArrowRight";
562
+ let newValue = currentValue;
563
+ switch (event.key) {
564
+ case decreaseKey:
565
+ case "ArrowDown":
566
+ newValue = decreaseFrom - amount;
567
+ break;
568
+ case increaseKey:
569
+ case "ArrowUp":
570
+ newValue = currentValue + amount;
571
+ break;
572
+ case "Home":
573
+ newValue = min;
574
+ break;
575
+ case "End":
576
+ newValue = max;
577
+ break;
578
+ case "PageDown":
579
+ newValue = decreaseFrom - page;
580
+ break;
581
+ case "PageUp": newValue = currentValue + page;
582
+ }
583
+ return this.snapValue(newValue);
584
+ }
585
+ clampValue(value) {
586
+ return Math.max(this.effectiveMin(), Math.min(this.effectiveMax(), value));
587
+ }
588
+ getMaxOverride() {}
589
+ getMinOverride() {}
590
+ getValueFromPointerEvent(event) {
591
+ const containerRect = this.hostElementRef.nativeElement.getBoundingClientRect();
592
+ let normalizedHandlePos;
593
+ if (this.orientation() === "horizontal") normalizedHandlePos = (this.isRtl() ? containerRect.right - event.clientX : event.clientX - containerRect.left) / containerRect.width * 100;
594
+ else normalizedHandlePos = 100 - (event.clientY - containerRect.top) / containerRect.height * 100;
595
+ normalizedHandlePos = Math.max(0, Math.min(normalizedHandlePos, 100));
596
+ return this.getValueFromPosition(normalizedHandlePos);
597
+ }
598
+ getValueFromPosition(position) {
599
+ const min = this.effectiveMin();
600
+ const max = this.effectiveMax();
601
+ if (position >= 100) return max;
602
+ if (position <= 0) return min;
603
+ const range = max - min;
604
+ const rawValue = min + position / 100 * range;
605
+ return this.snapValue(rawValue);
606
+ }
607
+ isNavigationKey(event) {
608
+ return [
609
+ "ArrowLeft",
610
+ "ArrowRight",
611
+ "ArrowUp",
612
+ "ArrowDown",
613
+ "Home",
614
+ "End",
615
+ "PageUp",
616
+ "PageDown"
617
+ ].includes(event.key);
618
+ }
619
+ positionFromValue(value) {
620
+ return valueToPosition(value, this.effectiveMin(), this.effectiveMax());
621
+ }
622
+ snapValue(value) {
623
+ const min = this.effectiveMin();
624
+ const max = this.effectiveMax();
625
+ if (Number.isNaN(value) || max <= min) return min;
626
+ const step = this.step();
627
+ const clampedValue = this.clampValue(value);
628
+ const snappedValue = this.clampValue(this.#roundToStep(Math.round((clampedValue - min) / step) * step + min));
629
+ return max - clampedValue < Math.abs(clampedValue - snappedValue) ? max : snappedValue;
630
+ }
631
+ trackHandleDrag(handle, startDrag) {
632
+ fromEvent(handle, "pointerdown").pipe(filter((event) => event.button === 0 && event.isPrimary && !event.ctrlKey), filter(() => !this.dragging() && !this.interactionDisabled()), tap((event) => {
633
+ this.zone.run(() => this.dragging.set(true));
634
+ handle.setPointerCapture?.(event.pointerId);
635
+ handle.focus({ preventScroll: true });
636
+ }), switchMap((down) => {
637
+ const pointerEvents = (target, name) => fromEvent(target, name).pipe(filter((event) => event.pointerId === down.pointerId));
638
+ const end$ = merge(pointerEvents(this.#document, "pointerup"), pointerEvents(this.#document, "pointercancel"), pointerEvents(handle, "lostpointercapture")).pipe(tap(() => this.zone.run(() => this.dragging.set(false))));
639
+ return pointerEvents(this.#document, "pointermove").pipe(tap(startDrag()), takeUntil(end$));
640
+ }), takeUntilDestroyed(this.destroyRef)).subscribe();
641
+ }
642
+ #roundToStep(value) {
643
+ return roundToPlaces(value, this.#stepPlaces());
644
+ }
645
+ #stepCount() {
646
+ return Math.floor((this.effectiveMax() - this.effectiveMin()) / this.step());
647
+ }
648
+ #warnWhenMisconfigured() {
649
+ const host = this.hostElementRef.nativeElement;
650
+ let warnedAboutBounds = false;
651
+ let warnedAboutValue = false;
652
+ effect(() => {
653
+ if (!warnedAboutBounds && this.effectiveMin() >= this.effectiveMax()) {
654
+ warnedAboutBounds = true;
655
+ console.warn(`[Mona Slider] The minimum (${this.effectiveMin()}) must be lower than the maximum (${this.effectiveMax()}).`, host);
656
+ }
657
+ });
658
+ effect(() => {
659
+ if (!warnedAboutValue && !this.valueIsShown()) {
660
+ warnedAboutValue = true;
661
+ console.warn("[Mona Slider] The value is out of range or off the step grid. The slider shows the nearest valid value, and the model keeps its own until the user changes it.", host);
662
+ }
663
+ });
664
+ }
665
+ static {
666
+ this.ɵfac = i0.ɵɵngDeclareFactory({
667
+ minVersion: "12.0.0",
668
+ version: "22.2.6",
669
+ ngImport: i0,
670
+ type: SliderBaseComponent,
671
+ deps: [],
672
+ target: i0.ɵɵFactoryTarget.Directive
673
+ });
674
+ }
675
+ static {
676
+ this.ɵdir = i0.ɵɵngDeclareDirective({
677
+ minVersion: "17.2.0",
678
+ version: "22.2.6",
679
+ type: SliderBaseComponent,
680
+ isStandalone: true,
681
+ inputs: {
682
+ ariaDescribedBy: {
683
+ classPropertyName: "ariaDescribedBy",
684
+ publicName: "aria-describedby",
685
+ isSignal: true,
686
+ isRequired: false,
687
+ transformFunction: null
688
+ },
689
+ ariaLabel: {
690
+ classPropertyName: "ariaLabel",
691
+ publicName: "aria-label",
692
+ isSignal: true,
693
+ isRequired: false,
694
+ transformFunction: null
695
+ },
696
+ ariaLabelledBy: {
697
+ classPropertyName: "ariaLabelledBy",
698
+ publicName: "aria-labelledby",
699
+ isSignal: true,
700
+ isRequired: false,
701
+ transformFunction: null
702
+ },
703
+ ariaValueText: {
704
+ classPropertyName: "ariaValueText",
705
+ publicName: "ariaValueText",
706
+ isSignal: true,
707
+ isRequired: false,
708
+ transformFunction: null
709
+ },
710
+ disabled: {
711
+ classPropertyName: "disabled",
712
+ publicName: "disabled",
713
+ isSignal: true,
714
+ isRequired: false,
715
+ transformFunction: null
716
+ },
717
+ handleClasses: {
718
+ classPropertyName: "handleClasses",
719
+ publicName: "handleClasses",
720
+ isSignal: true,
721
+ isRequired: false,
722
+ transformFunction: null
723
+ },
724
+ handleStyles: {
725
+ classPropertyName: "handleStyles",
726
+ publicName: "handleStyles",
727
+ isSignal: true,
728
+ isRequired: false,
729
+ transformFunction: null
730
+ },
731
+ invalid: {
732
+ classPropertyName: "invalid",
733
+ publicName: "invalid",
734
+ isSignal: true,
735
+ isRequired: false,
736
+ transformFunction: null
737
+ },
738
+ labelPosition: {
739
+ classPropertyName: "labelPosition",
740
+ publicName: "labelPosition",
741
+ isSignal: true,
742
+ isRequired: false,
743
+ transformFunction: null
744
+ },
745
+ labelStep: {
746
+ classPropertyName: "labelStep",
747
+ publicName: "labelStep",
748
+ isSignal: true,
749
+ isRequired: false,
750
+ transformFunction: null
751
+ },
752
+ largeTickStep: {
753
+ classPropertyName: "largeTickStep",
754
+ publicName: "largeTickStep",
755
+ isSignal: true,
756
+ isRequired: false,
757
+ transformFunction: null
758
+ },
759
+ maxValue: {
760
+ classPropertyName: "maxValue",
761
+ publicName: "maxValue",
762
+ isSignal: true,
763
+ isRequired: false,
764
+ transformFunction: null
765
+ },
766
+ minValue: {
767
+ classPropertyName: "minValue",
768
+ publicName: "minValue",
769
+ isSignal: true,
770
+ isRequired: false,
771
+ transformFunction: null
772
+ },
773
+ orientation: {
774
+ classPropertyName: "orientation",
775
+ publicName: "orientation",
776
+ isSignal: true,
777
+ isRequired: false,
778
+ transformFunction: null
779
+ },
780
+ readonly: {
781
+ classPropertyName: "readonly",
782
+ publicName: "readonly",
783
+ isSignal: true,
784
+ isRequired: false,
785
+ transformFunction: null
786
+ },
787
+ rounded: {
788
+ classPropertyName: "rounded",
789
+ publicName: "rounded",
790
+ isSignal: true,
791
+ isRequired: false,
792
+ transformFunction: null
793
+ },
794
+ selectionBackground: {
795
+ classPropertyName: "selectionBackground",
796
+ publicName: "selectionBackground",
797
+ isSignal: true,
798
+ isRequired: false,
799
+ transformFunction: null
800
+ },
801
+ shiftMultiplier: {
802
+ classPropertyName: "shiftMultiplier",
803
+ publicName: "shiftMultiplier",
804
+ isSignal: true,
805
+ isRequired: false,
806
+ transformFunction: null
807
+ },
808
+ showLabels: {
809
+ classPropertyName: "showLabels",
810
+ publicName: "showLabels",
811
+ isSignal: true,
812
+ isRequired: false,
813
+ transformFunction: null
814
+ },
815
+ showTicks: {
816
+ classPropertyName: "showTicks",
817
+ publicName: "showTicks",
818
+ isSignal: true,
819
+ isRequired: false,
820
+ transformFunction: null
821
+ },
822
+ smallTickStep: {
823
+ classPropertyName: "smallTickStep",
824
+ publicName: "smallTickStep",
825
+ isSignal: true,
826
+ isRequired: false,
827
+ transformFunction: null
828
+ },
829
+ step: {
830
+ classPropertyName: "step",
831
+ publicName: "step",
832
+ isSignal: true,
833
+ isRequired: false,
834
+ transformFunction: null
835
+ },
836
+ touched: {
837
+ classPropertyName: "touched",
838
+ publicName: "touched",
839
+ isSignal: true,
840
+ isRequired: false,
841
+ transformFunction: null
842
+ },
843
+ trackBackground: {
844
+ classPropertyName: "trackBackground",
845
+ publicName: "trackBackground",
846
+ isSignal: true,
847
+ isRequired: false,
848
+ transformFunction: null
849
+ },
850
+ trackSize: {
851
+ classPropertyName: "trackSize",
852
+ publicName: "trackSize",
853
+ isSignal: true,
854
+ isRequired: false,
855
+ transformFunction: null
856
+ }
857
+ },
858
+ outputs: { touch: "touch" },
859
+ queries: [{
860
+ propertyName: "handleTemplate",
861
+ first: true,
862
+ predicate: SliderHandleTemplateDirective,
863
+ descendants: true,
864
+ read: TemplateRef,
865
+ isSignal: true
866
+ }, {
867
+ propertyName: "tickValueTemplate",
868
+ first: true,
869
+ predicate: SliderTickValueTemplateDirective,
870
+ descendants: true,
871
+ read: TemplateRef,
872
+ isSignal: true
873
+ }],
874
+ ngImport: i0
875
+ });
876
+ }
877
+ };
878
+ i0.ɵɵngDeclareClassMetadata({
879
+ minVersion: "12.0.0",
880
+ version: "22.2.6",
881
+ ngImport: i0,
882
+ type: SliderBaseComponent,
883
+ decorators: [{ type: Directive }],
884
+ ctorParameters: () => [],
885
+ propDecorators: {
886
+ handleTemplate: [{
887
+ type: i0.ContentChild,
888
+ args: [i0.forwardRef(() => SliderHandleTemplateDirective), {
889
+ read: TemplateRef,
890
+ isSignal: true
891
+ }]
892
+ }],
893
+ tickValueTemplate: [{
894
+ type: i0.ContentChild,
895
+ args: [i0.forwardRef(() => SliderTickValueTemplateDirective), {
896
+ read: TemplateRef,
897
+ isSignal: true
898
+ }]
899
+ }],
900
+ ariaDescribedBy: [{
901
+ type: i0.Input,
902
+ args: [{
903
+ isSignal: true,
904
+ alias: "aria-describedby",
905
+ required: false
906
+ }]
907
+ }],
908
+ ariaLabel: [{
909
+ type: i0.Input,
910
+ args: [{
911
+ isSignal: true,
912
+ alias: "aria-label",
913
+ required: false
914
+ }]
915
+ }],
916
+ ariaLabelledBy: [{
917
+ type: i0.Input,
918
+ args: [{
919
+ isSignal: true,
920
+ alias: "aria-labelledby",
921
+ required: false
922
+ }]
923
+ }],
924
+ ariaValueText: [{
925
+ type: i0.Input,
926
+ args: [{
927
+ isSignal: true,
928
+ alias: "ariaValueText",
929
+ required: false
930
+ }]
931
+ }],
932
+ disabled: [{
933
+ type: i0.Input,
934
+ args: [{
935
+ isSignal: true,
936
+ alias: "disabled",
937
+ required: false
938
+ }]
939
+ }],
940
+ handleClasses: [{
941
+ type: i0.Input,
942
+ args: [{
943
+ isSignal: true,
944
+ alias: "handleClasses",
945
+ required: false
946
+ }]
947
+ }],
948
+ handleStyles: [{
949
+ type: i0.Input,
950
+ args: [{
951
+ isSignal: true,
952
+ alias: "handleStyles",
953
+ required: false
954
+ }]
955
+ }],
956
+ invalid: [{
957
+ type: i0.Input,
958
+ args: [{
959
+ isSignal: true,
960
+ alias: "invalid",
961
+ required: false
962
+ }]
963
+ }],
964
+ labelPosition: [{
965
+ type: i0.Input,
966
+ args: [{
967
+ isSignal: true,
968
+ alias: "labelPosition",
969
+ required: false
970
+ }]
971
+ }],
972
+ labelStep: [{
973
+ type: i0.Input,
974
+ args: [{
975
+ isSignal: true,
976
+ alias: "labelStep",
977
+ required: false
978
+ }]
979
+ }],
980
+ largeTickStep: [{
981
+ type: i0.Input,
982
+ args: [{
983
+ isSignal: true,
984
+ alias: "largeTickStep",
985
+ required: false
986
+ }]
987
+ }],
988
+ maxValue: [{
989
+ type: i0.Input,
990
+ args: [{
991
+ isSignal: true,
992
+ alias: "maxValue",
993
+ required: false
994
+ }]
995
+ }],
996
+ minValue: [{
997
+ type: i0.Input,
998
+ args: [{
999
+ isSignal: true,
1000
+ alias: "minValue",
1001
+ required: false
1002
+ }]
1003
+ }],
1004
+ orientation: [{
1005
+ type: i0.Input,
1006
+ args: [{
1007
+ isSignal: true,
1008
+ alias: "orientation",
1009
+ required: false
1010
+ }]
1011
+ }],
1012
+ readonly: [{
1013
+ type: i0.Input,
1014
+ args: [{
1015
+ isSignal: true,
1016
+ alias: "readonly",
1017
+ required: false
1018
+ }]
1019
+ }],
1020
+ rounded: [{
1021
+ type: i0.Input,
1022
+ args: [{
1023
+ isSignal: true,
1024
+ alias: "rounded",
1025
+ required: false
1026
+ }]
1027
+ }],
1028
+ selectionBackground: [{
1029
+ type: i0.Input,
1030
+ args: [{
1031
+ isSignal: true,
1032
+ alias: "selectionBackground",
1033
+ required: false
1034
+ }]
1035
+ }],
1036
+ shiftMultiplier: [{
1037
+ type: i0.Input,
1038
+ args: [{
1039
+ isSignal: true,
1040
+ alias: "shiftMultiplier",
1041
+ required: false
1042
+ }]
1043
+ }],
1044
+ showLabels: [{
1045
+ type: i0.Input,
1046
+ args: [{
1047
+ isSignal: true,
1048
+ alias: "showLabels",
1049
+ required: false
1050
+ }]
1051
+ }],
1052
+ showTicks: [{
1053
+ type: i0.Input,
1054
+ args: [{
1055
+ isSignal: true,
1056
+ alias: "showTicks",
1057
+ required: false
1058
+ }]
1059
+ }],
1060
+ smallTickStep: [{
1061
+ type: i0.Input,
1062
+ args: [{
1063
+ isSignal: true,
1064
+ alias: "smallTickStep",
1065
+ required: false
1066
+ }]
1067
+ }],
1068
+ step: [{
1069
+ type: i0.Input,
1070
+ args: [{
1071
+ isSignal: true,
1072
+ alias: "step",
1073
+ required: false
1074
+ }]
1075
+ }],
1076
+ touch: [{
1077
+ type: i0.Output,
1078
+ args: ["touch"]
1079
+ }],
1080
+ touched: [{
1081
+ type: i0.Input,
1082
+ args: [{
1083
+ isSignal: true,
1084
+ alias: "touched",
1085
+ required: false
1086
+ }]
1087
+ }],
1088
+ trackBackground: [{
1089
+ type: i0.Input,
1090
+ args: [{
1091
+ isSignal: true,
1092
+ alias: "trackBackground",
1093
+ required: false
1094
+ }]
1095
+ }],
1096
+ trackSize: [{
1097
+ type: i0.Input,
1098
+ args: [{
1099
+ isSignal: true,
1100
+ alias: "trackSize",
1101
+ required: false
1102
+ }]
1103
+ }]
1104
+ }
1105
+ });
1106
+ var SliderComponent = class SliderComponent extends SliderBaseComponent {
1107
+ constructor() {
1108
+ super(...arguments);
1109
+ this.computedAriaLabel = computed(() => this.ariaLabel() ?? (this.labelledBy() ? null : this.messages().sliderValue), ...ngDevMode ? [{ debugName: "computedAriaLabel" }] : /* istanbul ignore next */ []);
1110
+ this.handleFocused = signal(false, ...ngDevMode ? [{ debugName: "handleFocused" }] : /* istanbul ignore next */ []);
1111
+ this.handlePosition = computed(() => this.positionFromValue(this.normalizedValue()), ...ngDevMode ? [{ debugName: "handlePosition" }] : /* istanbul ignore next */ []);
1112
+ this.handleStyle = computed(() => ({
1113
+ ...this.handleTemplateStyles(),
1114
+ ...this.handleStyles()
1115
+ }), ...ngDevMode ? [{ debugName: "handleStyle" }] : /* istanbul ignore next */ []);
1116
+ this.messages = this.i18n.componentMessages("slider", SLIDER_DEFAULT_MESSAGES);
1117
+ this.normalizedValue = computed(() => this.snapValue(this.value()), ...ngDevMode ? [{ debugName: "normalizedValue" }] : /* istanbul ignore next */ []);
1118
+ this.selectionLeft = computed(() => 0, ...ngDevMode ? [{ debugName: "selectionLeft" }] : /* istanbul ignore next */ []);
1119
+ this.selectionRight = computed(() => this.handlePosition(), ...ngDevMode ? [{ debugName: "selectionRight" }] : /* istanbul ignore next */ []);
1120
+ this.sliderHandle = viewChild.required("sliderHandle", ...ngDevMode ? [{ debugName: "sliderHandle" }] : /* istanbul ignore next */ []);
1121
+ this.valueIsShown = computed(() => this.normalizedValue() === this.value(), ...ngDevMode ? [{ debugName: "valueIsShown" }] : /* istanbul ignore next */ []);
1122
+ this.max = input(void 0, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
1123
+ this.min = input(void 0, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
1124
+ this.value = model(0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
1125
+ }
1126
+ focus(options) {
1127
+ if (!this.effectiveDisabled()) this.sliderHandle().nativeElement.focus(options);
1128
+ }
1129
+ getMaxOverride() {
1130
+ return this.max();
1131
+ }
1132
+ getMinOverride() {
1133
+ return this.min();
1134
+ }
1135
+ handleHandleMove(event) {
1136
+ this.updateValue(this.getValueFromPointerEvent(event));
1137
+ }
1138
+ setSubscriptions() {
1139
+ this.setClickSubscription();
1140
+ this.setKeydownSubscription();
1141
+ this.setPointerMoveSubscription();
1142
+ this.setFocusSubscription();
1143
+ }
1144
+ setClickSubscription() {
1145
+ fromEvent(this.hostElementRef.nativeElement, "click").pipe(takeUntilDestroyed(this.destroyRef), tap(() => this.dragging.set(false)), filter(() => !this.interactionDisabled())).subscribe((event) => {
1146
+ const handle = this.sliderHandle().nativeElement;
1147
+ if (!handle.contains(event.target)) this.handleHandleMove(event);
1148
+ handle.focus({ preventScroll: true });
1149
+ });
1150
+ }
1151
+ setFocusSubscription() {
1152
+ fromEvent(this.sliderHandle().nativeElement, "focus").pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.zone.run(() => this.handleFocused.set(true)));
1153
+ fromEvent(this.sliderHandle().nativeElement, "blur").pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
1154
+ this.zone.run(() => {
1155
+ this.handleFocused.set(false);
1156
+ this.touch.emit();
1157
+ });
1158
+ });
1159
+ }
1160
+ setKeydownSubscription() {
1161
+ fromEvent(this.sliderHandle().nativeElement, "keydown").pipe(takeUntilDestroyed(this.destroyRef), filter(() => !this.interactionDisabled()), filter((event) => this.isNavigationKey(event)), tap((event) => {
1162
+ event.preventDefault();
1163
+ event.stopPropagation();
1164
+ })).subscribe((event) => this.updateValue(this.calculateNewValue(this.normalizedValue(), event)));
1165
+ }
1166
+ setPointerMoveSubscription() {
1167
+ this.trackHandleDrag(this.sliderHandle().nativeElement, () => (event) => this.handleHandleMove(event));
1168
+ }
1169
+ updateValue(value) {
1170
+ const nextValue = this.snapValue(value);
1171
+ if (nextValue === this.normalizedValue()) return;
1172
+ this.zone.run(() => this.value.set(nextValue));
1173
+ }
1174
+ static {
1175
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1176
+ minVersion: "12.0.0",
1177
+ version: "22.2.6",
1178
+ ngImport: i0,
1179
+ type: SliderComponent,
1180
+ deps: null,
1181
+ target: i0.ɵɵFactoryTarget.Component
1182
+ });
1183
+ }
1184
+ static {
1185
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1186
+ minVersion: "17.0.0",
1187
+ version: "22.2.6",
1188
+ type: SliderComponent,
1189
+ isStandalone: true,
1190
+ selector: "mona-slider",
1191
+ inputs: {
1192
+ max: {
1193
+ classPropertyName: "max",
1194
+ publicName: "max",
1195
+ isSignal: true,
1196
+ isRequired: false,
1197
+ transformFunction: null
1198
+ },
1199
+ min: {
1200
+ classPropertyName: "min",
1201
+ publicName: "min",
1202
+ isSignal: true,
1203
+ isRequired: false,
1204
+ transformFunction: null
1205
+ },
1206
+ value: {
1207
+ classPropertyName: "value",
1208
+ publicName: "value",
1209
+ isSignal: true,
1210
+ isRequired: false,
1211
+ transformFunction: null
1212
+ }
1213
+ },
1214
+ outputs: { value: "valueChange" },
1215
+ host: { properties: {
1216
+ "attr.aria-describedby": "null",
1217
+ "attr.aria-label": "null",
1218
+ "attr.aria-labelledby": "null",
1219
+ "class": "baseClasses()",
1220
+ "class.mona-slider": "true",
1221
+ "attr.data-disabled": "effectiveDisabled() || null",
1222
+ "attr.data-orientation": "orientation()",
1223
+ "attr.data-readonly": "readonly() || null"
1224
+ } },
1225
+ viewQueries: [{
1226
+ propertyName: "sliderHandle",
1227
+ first: true,
1228
+ predicate: ["sliderHandle"],
1229
+ descendants: true,
1230
+ isSignal: true
1231
+ }],
1232
+ usesInheritance: true,
1233
+ ngImport: i0,
1234
+ template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n data-slider-tick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.label }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"handleFocused()\"\n [style]=\"handleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? handlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? handlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? handlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"effectiveMin()\"\n [attr.aria-valuemax]=\"effectiveMax()\"\n [attr.aria-valuenow]=\"normalizedValue()\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue() }\"></ng-container>\n }\n</div>\n",
1235
+ dependencies: [
1236
+ {
1237
+ kind: "directive",
1238
+ type: NgTemplateOutlet,
1239
+ selector: "[ngTemplateOutlet]",
1240
+ inputs: [
1241
+ "ngTemplateOutletContext",
1242
+ "ngTemplateOutlet",
1243
+ "ngTemplateOutletInjector"
1244
+ ]
1245
+ },
1246
+ {
1247
+ kind: "pipe",
1248
+ type: LabelStylePipe,
1249
+ name: "labelStyle"
1250
+ },
1251
+ {
1252
+ kind: "pipe",
1253
+ type: TickStylePipe,
1254
+ name: "tickStyle"
1255
+ }
1256
+ ]
1257
+ });
1258
+ }
1259
+ };
1260
+ i0.ɵɵngDeclareClassMetadata({
1261
+ minVersion: "12.0.0",
1262
+ version: "22.2.6",
1263
+ ngImport: i0,
1264
+ type: SliderComponent,
1265
+ decorators: [{
1266
+ type: Component,
1267
+ args: [{
1268
+ selector: "mona-slider",
1269
+ imports: [
1270
+ NgTemplateOutlet,
1271
+ LabelStylePipe,
1272
+ TickStylePipe
1273
+ ],
1274
+ host: {
1275
+ "[attr.aria-describedby]": "null",
1276
+ "[attr.aria-label]": "null",
1277
+ "[attr.aria-labelledby]": "null",
1278
+ "[class]": "baseClasses()",
1279
+ "[class.mona-slider]": "true",
1280
+ "[attr.data-disabled]": "effectiveDisabled() || null",
1281
+ "[attr.data-orientation]": "orientation()",
1282
+ "[attr.data-readonly]": "readonly() || null"
1283
+ },
1284
+ template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n data-slider-tick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.label }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"handleFocused()\"\n [style]=\"handleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? handlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? handlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? handlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"effectiveMin()\"\n [attr.aria-valuemax]=\"effectiveMax()\"\n [attr.aria-valuenow]=\"normalizedValue()\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue() }\"></ng-container>\n }\n</div>\n"
1285
+ }]
1286
+ }],
1287
+ propDecorators: {
1288
+ sliderHandle: [{
1289
+ type: i0.ViewChild,
1290
+ args: ["sliderHandle", { isSignal: true }]
1291
+ }],
1292
+ max: [{
1293
+ type: i0.Input,
1294
+ args: [{
1295
+ isSignal: true,
1296
+ alias: "max",
1297
+ required: false
1298
+ }]
1299
+ }],
1300
+ min: [{
1301
+ type: i0.Input,
1302
+ args: [{
1303
+ isSignal: true,
1304
+ alias: "min",
1305
+ required: false
1306
+ }]
1307
+ }],
1308
+ value: [{
1309
+ type: i0.Input,
1310
+ args: [{
1311
+ isSignal: true,
1312
+ alias: "value",
1313
+ required: false
1314
+ }]
1315
+ }, {
1316
+ type: i0.Output,
1317
+ args: ["valueChange"]
1318
+ }]
1319
+ }
1320
+ });
1321
+ var RangeSliderComponent = class RangeSliderComponent extends SliderBaseComponent {
1322
+ constructor() {
1323
+ super(...arguments);
1324
+ this.computedAriaLabelEnd = computed(() => this.ariaLabelEnd() ?? this.messages().maximumValue, ...ngDevMode ? [{ debugName: "computedAriaLabelEnd" }] : /* istanbul ignore next */ []);
1325
+ this.computedAriaLabelStart = computed(() => this.ariaLabelStart() ?? this.messages().minimumValue, ...ngDevMode ? [{ debugName: "computedAriaLabelStart" }] : /* istanbul ignore next */ []);
1326
+ this.endHandleId = createElementControlId();
1327
+ this.endLabelledBy = computed(() => {
1328
+ const labelledBy = this.labelledBy();
1329
+ return labelledBy ? `${labelledBy} ${this.endHandleId}` : null;
1330
+ }, ...ngDevMode ? [{ debugName: "endLabelledBy" }] : /* istanbul ignore next */ []);
1331
+ this.handlePositions = computed(() => [this.positionFromValue(this.normalizedValue()[0]), this.positionFromValue(this.normalizedValue()[1])], ...ngDevMode ? [{ debugName: "handlePositions" }] : /* istanbul ignore next */ []);
1332
+ this.handlesOverlap = computed(() => {
1333
+ const values = this.normalizedValue();
1334
+ return values[0] === values[1];
1335
+ }, ...ngDevMode ? [{ debugName: "handlesOverlap" }] : /* istanbul ignore next */ []);
1336
+ this.messages = this.i18n.componentMessages("slider", SLIDER_DEFAULT_MESSAGES);
1337
+ this.normalizedValue = computed(() => {
1338
+ const value = this.value();
1339
+ const minValue = this.snapValue(value[0]);
1340
+ const maxValue = this.snapValue(value[1]);
1341
+ return [Math.min(minValue, maxValue), Math.max(minValue, maxValue)];
1342
+ }, ...ngDevMode ? [{ debugName: "normalizedValue" }] : /* istanbul ignore next */ []);
1343
+ this.primaryHandleFocused = signal(false, ...ngDevMode ? [{ debugName: "primaryHandleFocused" }] : /* istanbul ignore next */ []);
1344
+ this.primaryHandlePosition = computed(() => this.handlePositions()[0], ...ngDevMode ? [{ debugName: "primaryHandlePosition" }] : /* istanbul ignore next */ []);
1345
+ this.primaryHandleStyle = computed(() => {
1346
+ const style = {
1347
+ ...this.handleTemplateStyles(),
1348
+ ...this.handleStyles()
1349
+ };
1350
+ if (this.handlesOverlap()) return {
1351
+ ...style,
1352
+ zIndex: this.secondaryHandleOnTop() ? "1" : "2"
1353
+ };
1354
+ return style;
1355
+ }, ...ngDevMode ? [{ debugName: "primaryHandleStyle" }] : /* istanbul ignore next */ []);
1356
+ this.secondaryHandleFocused = signal(false, ...ngDevMode ? [{ debugName: "secondaryHandleFocused" }] : /* istanbul ignore next */ []);
1357
+ this.secondaryHandleOnTop = signal(true, ...ngDevMode ? [{ debugName: "secondaryHandleOnTop" }] : /* istanbul ignore next */ []);
1358
+ this.secondaryHandlePosition = computed(() => this.handlePositions()[1], ...ngDevMode ? [{ debugName: "secondaryHandlePosition" }] : /* istanbul ignore next */ []);
1359
+ this.secondaryHandleStyle = computed(() => {
1360
+ const style = {
1361
+ ...this.handleTemplateStyles(),
1362
+ ...this.handleStyles()
1363
+ };
1364
+ if (this.handlesOverlap()) return {
1365
+ ...style,
1366
+ zIndex: this.secondaryHandleOnTop() ? "2" : "1"
1367
+ };
1368
+ return style;
1369
+ }, ...ngDevMode ? [{ debugName: "secondaryHandleStyle" }] : /* istanbul ignore next */ []);
1370
+ this.secondarySliderHandle = viewChild.required("secondarySliderHandle", ...ngDevMode ? [{ debugName: "secondarySliderHandle" }] : /* istanbul ignore next */ []);
1371
+ this.selectionLeft = computed(() => this.handlePositions()[0], ...ngDevMode ? [{ debugName: "selectionLeft" }] : /* istanbul ignore next */ []);
1372
+ this.selectionRight = computed(() => this.handlePositions()[1], ...ngDevMode ? [{ debugName: "selectionRight" }] : /* istanbul ignore next */ []);
1373
+ this.sliderHandle = viewChild.required("sliderHandle", ...ngDevMode ? [{ debugName: "sliderHandle" }] : /* istanbul ignore next */ []);
1374
+ this.startHandleId = createElementControlId();
1375
+ this.startLabelledBy = computed(() => {
1376
+ const labelledBy = this.labelledBy();
1377
+ return labelledBy ? `${labelledBy} ${this.startHandleId}` : null;
1378
+ }, ...ngDevMode ? [{ debugName: "startLabelledBy" }] : /* istanbul ignore next */ []);
1379
+ this.valueIsShown = computed(() => {
1380
+ const [lower, upper] = this.normalizedValue();
1381
+ const [first, second] = this.value();
1382
+ return lower === first && upper === second;
1383
+ }, ...ngDevMode ? [{ debugName: "valueIsShown" }] : /* istanbul ignore next */ []);
1384
+ this.ariaLabelEnd = input(null, {
1385
+ ...ngDevMode ? { debugName: "ariaLabelEnd" } : /* istanbul ignore next */ {},
1386
+ alias: "aria-label-end"
1387
+ });
1388
+ this.ariaLabelStart = input(null, {
1389
+ ...ngDevMode ? { debugName: "ariaLabelStart" } : /* istanbul ignore next */ {},
1390
+ alias: "aria-label-start"
1391
+ });
1392
+ this.value = model([0, 10], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
1393
+ }
1394
+ focus(options) {
1395
+ if (!this.effectiveDisabled()) this.sliderHandle().nativeElement.focus(options);
1396
+ }
1397
+ handleHandleMove(event, isSecondary = false) {
1398
+ this.updateRangedValue(this.getValueFromPointerEvent(event), isSecondary);
1399
+ }
1400
+ setSubscriptions() {
1401
+ this.setClickSubscription();
1402
+ this.setKeydownSubscription();
1403
+ this.setPointerMoveSubscription();
1404
+ this.setFocusSubscription();
1405
+ }
1406
+ getClosestHandle(event) {
1407
+ const currentValues = this.normalizedValue();
1408
+ if (currentValues[0] === currentValues[1]) {
1409
+ const containerRect = this.hostElementRef.nativeElement.getBoundingClientRect();
1410
+ let normalizedClickPos;
1411
+ if (this.orientation() === "horizontal") normalizedClickPos = (this.isRtl() ? containerRect.right - event.clientX : event.clientX - containerRect.left) / containerRect.width * 100;
1412
+ else normalizedClickPos = 100 - (event.clientY - containerRect.top) / containerRect.height * 100;
1413
+ return this.getValueFromPosition(normalizedClickPos) > currentValues[0];
1414
+ }
1415
+ const primaryRect = this.sliderHandle().nativeElement.getBoundingClientRect();
1416
+ const secondaryRect = this.secondarySliderHandle().nativeElement.getBoundingClientRect();
1417
+ const primaryDistance = Math.sqrt(Math.pow(primaryRect.left + primaryRect.width / 2 - event.clientX, 2) + Math.pow(primaryRect.top + primaryRect.height / 2 - event.clientY, 2));
1418
+ return Math.sqrt(Math.pow(secondaryRect.left + secondaryRect.width / 2 - event.clientX, 2) + Math.pow(secondaryRect.top + secondaryRect.height / 2 - event.clientY, 2)) < primaryDistance;
1419
+ }
1420
+ setClickSubscription() {
1421
+ fromEvent(this.hostElementRef.nativeElement, "click").pipe(takeUntilDestroyed(this.destroyRef), tap(() => this.dragging.set(false)), filter(() => !this.interactionDisabled())).subscribe((event) => {
1422
+ const target = event.target;
1423
+ if (this.sliderHandle().nativeElement.contains(target) || this.secondarySliderHandle().nativeElement.contains(target)) return;
1424
+ const isSecondary = this.getClosestHandle(event);
1425
+ this.handleHandleMove(event, isSecondary);
1426
+ (isSecondary ? this.secondarySliderHandle() : this.sliderHandle()).nativeElement.focus({ preventScroll: true });
1427
+ });
1428
+ }
1429
+ setFocusSubscription() {
1430
+ fromEvent(this.sliderHandle().nativeElement, "focus").pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
1431
+ this.zone.run(() => {
1432
+ this.primaryHandleFocused.set(true);
1433
+ this.secondaryHandleFocused.set(false);
1434
+ });
1435
+ });
1436
+ fromEvent(this.sliderHandle().nativeElement, "blur").pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
1437
+ this.zone.run(() => {
1438
+ this.primaryHandleFocused.set(false);
1439
+ this.touch.emit();
1440
+ });
1441
+ });
1442
+ fromEvent(this.secondarySliderHandle().nativeElement, "focus").pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
1443
+ this.zone.run(() => {
1444
+ this.secondaryHandleFocused.set(true);
1445
+ this.primaryHandleFocused.set(false);
1446
+ });
1447
+ });
1448
+ fromEvent(this.secondarySliderHandle().nativeElement, "blur").pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
1449
+ this.zone.run(() => {
1450
+ this.secondaryHandleFocused.set(false);
1451
+ this.touch.emit();
1452
+ });
1453
+ });
1454
+ }
1455
+ setKeydownSubscription() {
1456
+ fromEvent(this.sliderHandle().nativeElement, "keydown").pipe(takeUntilDestroyed(this.destroyRef), filter(() => !this.interactionDisabled()), filter((event) => this.isNavigationKey(event)), tap((event) => {
1457
+ event.preventDefault();
1458
+ event.stopPropagation();
1459
+ })).subscribe((event) => {
1460
+ const newValue = this.calculateNewValue(this.normalizedValue()[0], event);
1461
+ this.updateRangedValue(newValue, false);
1462
+ });
1463
+ fromEvent(this.secondarySliderHandle().nativeElement, "keydown").pipe(takeUntilDestroyed(this.destroyRef), filter(() => !this.interactionDisabled()), filter((event) => this.isNavigationKey(event)), tap((event) => {
1464
+ event.preventDefault();
1465
+ event.stopPropagation();
1466
+ })).subscribe((event) => {
1467
+ const newValue = this.calculateNewValue(this.normalizedValue()[1], event);
1468
+ this.updateRangedValue(newValue, true);
1469
+ });
1470
+ }
1471
+ setPointerMoveSubscription() {
1472
+ this.trackRangeHandle(this.sliderHandle().nativeElement, false);
1473
+ this.trackRangeHandle(this.secondarySliderHandle().nativeElement, true);
1474
+ }
1475
+ trackRangeHandle(handle, startsSecondary) {
1476
+ this.trackHandleDrag(handle, () => {
1477
+ let isSecondary = startsSecondary;
1478
+ return (event) => {
1479
+ const value = this.getValueFromPointerEvent(event);
1480
+ const [lower, upper] = this.normalizedValue();
1481
+ if (lower === upper && value !== lower && isSecondary !== value > lower) {
1482
+ isSecondary = value > lower;
1483
+ (isSecondary ? this.secondarySliderHandle() : this.sliderHandle()).nativeElement.focus({ preventScroll: true });
1484
+ }
1485
+ this.updateRangedValue(value, isSecondary);
1486
+ };
1487
+ });
1488
+ }
1489
+ updateRangedValue(value, isSecondary) {
1490
+ const currentValues = this.normalizedValue();
1491
+ const currentMinValue = currentValues[0];
1492
+ const currentMaxValue = currentValues[1];
1493
+ let newMinValue = currentMinValue;
1494
+ let newMaxValue = currentMaxValue;
1495
+ if (isSecondary) {
1496
+ newMaxValue = Math.max(value, currentMinValue);
1497
+ if (newMaxValue === currentMinValue) this.secondaryHandleOnTop.set(true);
1498
+ } else {
1499
+ newMinValue = Math.min(value, currentMaxValue);
1500
+ if (newMinValue === currentMaxValue) this.secondaryHandleOnTop.set(false);
1501
+ }
1502
+ newMinValue = this.snapValue(newMinValue);
1503
+ newMaxValue = this.snapValue(newMaxValue);
1504
+ if (newMinValue === currentMinValue && newMaxValue === currentMaxValue) return;
1505
+ this.zone.run(() => this.value.set([newMinValue, newMaxValue]));
1506
+ }
1507
+ static {
1508
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1509
+ minVersion: "12.0.0",
1510
+ version: "22.2.6",
1511
+ ngImport: i0,
1512
+ type: RangeSliderComponent,
1513
+ deps: null,
1514
+ target: i0.ɵɵFactoryTarget.Component
1515
+ });
1516
+ }
1517
+ static {
1518
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1519
+ minVersion: "17.0.0",
1520
+ version: "22.2.6",
1521
+ type: RangeSliderComponent,
1522
+ isStandalone: true,
1523
+ selector: "mona-range-slider",
1524
+ inputs: {
1525
+ ariaLabelEnd: {
1526
+ classPropertyName: "ariaLabelEnd",
1527
+ publicName: "aria-label-end",
1528
+ isSignal: true,
1529
+ isRequired: false,
1530
+ transformFunction: null
1531
+ },
1532
+ ariaLabelStart: {
1533
+ classPropertyName: "ariaLabelStart",
1534
+ publicName: "aria-label-start",
1535
+ isSignal: true,
1536
+ isRequired: false,
1537
+ transformFunction: null
1538
+ },
1539
+ value: {
1540
+ classPropertyName: "value",
1541
+ publicName: "value",
1542
+ isSignal: true,
1543
+ isRequired: false,
1544
+ transformFunction: null
1545
+ }
1546
+ },
1547
+ outputs: { value: "valueChange" },
1548
+ host: { properties: {
1549
+ "attr.aria-describedby": "null",
1550
+ "attr.aria-label-end": "null",
1551
+ "attr.aria-label-start": "null",
1552
+ "class": "baseClasses()",
1553
+ "class.mona-slider": "true",
1554
+ "attr.data-disabled": "effectiveDisabled() || null",
1555
+ "attr.data-orientation": "orientation()",
1556
+ "attr.data-readonly": "readonly() || null",
1557
+ "attr.aria-label": "ariaLabel()",
1558
+ "attr.aria-labelledby": "labelledBy()",
1559
+ "attr.role": "'group'"
1560
+ } },
1561
+ viewQueries: [{
1562
+ propertyName: "secondarySliderHandle",
1563
+ first: true,
1564
+ predicate: ["secondarySliderHandle"],
1565
+ descendants: true,
1566
+ isSignal: true
1567
+ }, {
1568
+ propertyName: "sliderHandle",
1569
+ first: true,
1570
+ predicate: ["sliderHandle"],
1571
+ descendants: true,
1572
+ isSignal: true
1573
+ }],
1574
+ usesInheritance: true,
1575
+ ngImport: i0,
1576
+ template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n data-slider-tick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.label }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"primaryHandleFocused()\"\n [style]=\"primaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? primaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? primaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? primaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"effectiveMin()\"\n [attr.aria-valuemax]=\"normalizedValue()[1]\"\n [attr.aria-valuenow]=\"normalizedValue()[0]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[0]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabelStart()\"\n [attr.aria-labelledby]=\"startLabelledBy()\"\n [attr.id]=\"startHandleId\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[0] }\"></ng-container>\n }\n</div>\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"secondaryHandleFocused()\"\n [style]=\"secondaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? secondaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? secondaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? secondaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"normalizedValue()[0]\"\n [attr.aria-valuemax]=\"effectiveMax()\"\n [attr.aria-valuenow]=\"normalizedValue()[1]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[1]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabelEnd()\"\n [attr.aria-labelledby]=\"endLabelledBy()\"\n [attr.id]=\"endHandleId\"\n #secondarySliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[1] }\"></ng-container>\n }\n</div>\n",
1577
+ dependencies: [
1578
+ {
1579
+ kind: "directive",
1580
+ type: NgTemplateOutlet,
1581
+ selector: "[ngTemplateOutlet]",
1582
+ inputs: [
1583
+ "ngTemplateOutletContext",
1584
+ "ngTemplateOutlet",
1585
+ "ngTemplateOutletInjector"
1586
+ ]
1587
+ },
1588
+ {
1589
+ kind: "pipe",
1590
+ type: LabelStylePipe,
1591
+ name: "labelStyle"
1592
+ },
1593
+ {
1594
+ kind: "pipe",
1595
+ type: TickStylePipe,
1596
+ name: "tickStyle"
1597
+ }
1598
+ ]
1599
+ });
1600
+ }
1601
+ };
1602
+ i0.ɵɵngDeclareClassMetadata({
1603
+ minVersion: "12.0.0",
1604
+ version: "22.2.6",
1605
+ ngImport: i0,
1606
+ type: RangeSliderComponent,
1607
+ decorators: [{
1608
+ type: Component,
1609
+ args: [{
1610
+ selector: "mona-range-slider",
1611
+ imports: [
1612
+ NgTemplateOutlet,
1613
+ LabelStylePipe,
1614
+ TickStylePipe
1615
+ ],
1616
+ host: {
1617
+ "[attr.aria-describedby]": "null",
1618
+ "[attr.aria-label-end]": "null",
1619
+ "[attr.aria-label-start]": "null",
1620
+ "[class]": "baseClasses()",
1621
+ "[class.mona-slider]": "true",
1622
+ "[attr.data-disabled]": "effectiveDisabled() || null",
1623
+ "[attr.data-orientation]": "orientation()",
1624
+ "[attr.data-readonly]": "readonly() || null",
1625
+ "[attr.aria-label]": "ariaLabel()",
1626
+ "[attr.aria-labelledby]": "labelledBy()",
1627
+ "[attr.role]": "'group'"
1628
+ },
1629
+ template: "<div\n [class]=\"trackClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style.height]=\"orientation() === 'horizontal' ? sliderTrackSize() : undefined\"\n [style.width]=\"orientation() === 'vertical' ? sliderTrackSize() : undefined\"\n [style]=\"trackBackgroundStyle()\">\n <div\n [class]=\"selectionClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [style.left.%]=\"horizontalSelectionLeft()\"\n [style.right.%]=\"horizontalSelectionRight()\"\n [style.bottom.%]=\"orientation() === 'vertical' ? selectionLeft() : undefined\"\n [style.top.%]=\"orientation() === 'vertical' ? 100 - selectionRight() : undefined\"\n [style]=\"selectionBackgroundStyle()\"></div>\n</div>\n@if (showTicks()) {\n <div [class]=\"tickListClasses()\" [attr.data-orientation]=\"orientation()\">\n @for (tick of renderTicks(); track tick.index) {\n <span\n [class]=\"tickClasses()\"\n [style]=\"tick | tickStyle: tickStyleArgs()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-value]=\"tick.value\"\n data-slider-tick>\n </span>\n }\n </div>\n}\n@if (showTicks() && showLabels()) {\n <div\n [class]=\"tickLabelListClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-label-position]=\"labelPosition()\">\n @for (tick of labelTicks(); track tick.index) {\n <span\n [class]=\"tickLabelClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [style]=\"tick | labelStyle: labelStyleArgs()\">\n @if (!tickValueTemplate()) {\n <span>{{ tick.label }}</span>\n } @else {\n <span>\n <ng-container\n *ngTemplateOutlet=\"\n tickValueTemplate() ?? null;\n context: { $implicit: tick.value }\n \"></ng-container>\n </span>\n }\n </span>\n }\n </div>\n}\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"primaryHandleFocused()\"\n [style]=\"primaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? primaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? primaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? primaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"effectiveMin()\"\n [attr.aria-valuemax]=\"normalizedValue()[1]\"\n [attr.aria-valuenow]=\"normalizedValue()[0]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[0]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabelStart()\"\n [attr.aria-labelledby]=\"startLabelledBy()\"\n [attr.id]=\"startHandleId\"\n #sliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[0] }\"></ng-container>\n }\n</div>\n<div\n [class]=\"sliderHandleClasses()\"\n [attr.data-orientation]=\"orientation()\"\n [attr.data-dragging]=\"dragging()\"\n [attr.data-rtl]=\"isRtl() || null\"\n [attr.data-focused]=\"secondaryHandleFocused()\"\n [style]=\"secondaryHandleStyle()\"\n [style.left.%]=\"orientation() === 'horizontal' && !isRtl() ? secondaryHandlePosition() : undefined\"\n [style.right.%]=\"orientation() === 'horizontal' && isRtl() ? secondaryHandlePosition() : undefined\"\n [style.bottom.%]=\"orientation() === 'vertical' ? secondaryHandlePosition() : undefined\"\n [attr.tabindex]=\"effectiveDisabled() ? -1 : 0\"\n [attr.role]=\"'slider'\"\n [attr.aria-valuemin]=\"normalizedValue()[0]\"\n [attr.aria-valuemax]=\"effectiveMax()\"\n [attr.aria-valuenow]=\"normalizedValue()[1]\"\n [attr.aria-valuetext]=\"ariaValueText() ? ariaValueText()!(normalizedValue()[1]) : null\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-label]=\"computedAriaLabelEnd()\"\n [attr.aria-labelledby]=\"endLabelledBy()\"\n [attr.id]=\"endHandleId\"\n #secondarySliderHandle>\n @if (handleTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"handleTemplate() ?? null; context: { $implicit: normalizedValue()[1] }\"></ng-container>\n }\n</div>\n"
1630
+ }]
1631
+ }],
1632
+ propDecorators: {
1633
+ secondarySliderHandle: [{
1634
+ type: i0.ViewChild,
1635
+ args: ["secondarySliderHandle", { isSignal: true }]
1636
+ }],
1637
+ sliderHandle: [{
1638
+ type: i0.ViewChild,
1639
+ args: ["sliderHandle", { isSignal: true }]
1640
+ }],
1641
+ ariaLabelEnd: [{
1642
+ type: i0.Input,
1643
+ args: [{
1644
+ isSignal: true,
1645
+ alias: "aria-label-end",
1646
+ required: false
1647
+ }]
1648
+ }],
1649
+ ariaLabelStart: [{
1650
+ type: i0.Input,
1651
+ args: [{
1652
+ isSignal: true,
1653
+ alias: "aria-label-start",
1654
+ required: false
1655
+ }]
1656
+ }],
1657
+ value: [{
1658
+ type: i0.Input,
1659
+ args: [{
1660
+ isSignal: true,
1661
+ alias: "value",
1662
+ required: false
1663
+ }]
1664
+ }, {
1665
+ type: i0.Output,
1666
+ args: ["valueChange"]
1667
+ }]
1668
+ }
1669
+ });
1211
1670
  export { RangeSliderComponent, SLIDER_DEFAULT_MESSAGES, SliderComponent, SliderHandleTemplateDirective, SliderTickValueTemplateDirective };
1212
- //# sourceMappingURL=nanahoshi-mona-ui-slider.mjs.map
1671
+
1672
+ //# sourceMappingURL=nanahoshi-mona-ui-slider.mjs.map