@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,32 +1,29 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, DestroyRef, ElementRef, signal, computed, input, effect, Directive, viewChild, booleanAttribute, output, model, afterNextRender, untracked, Component } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import { ButtonDirective } from '@nanahoshi/mona-ui/button';
5
- import { PreventableEvent } from '@nanahoshi/mona-ui/common';
6
- import { TimeLimiterPipe, TimeSelectorService, getLocaleHourFormat, generateMinuteSet, generateSecondSet, generateHourSet } from '@nanahoshi/mona-ui/date-input';
7
- import { injectComponentDirection, MonaI18nService, formatNumber } from '@nanahoshi/mona-ui/i18n';
8
- import { themeSelectionBarClasses, rxTimeout, injectEffectiveDisabled, createElementControlId } from '@nanahoshi/mona-ui/internal';
9
- import { DateTime } from 'luxon';
10
- import { fromEvent, filter } from 'rxjs';
11
- import { cva } from 'class-variance-authority';
12
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, DestroyRef, Directive, ElementRef, afterNextRender, booleanAttribute, computed, effect, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
3
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
4
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
5
+ import { PreventableEvent } from "@nanahoshi/mona-ui/common";
6
+ import { TimeLimiterPipe, TimeSelectorService, generateHourSet, generateMinuteSet, generateSecondSet, getLocaleHourFormat } from "@nanahoshi/mona-ui/date-input";
7
+ import { MonaI18nService, formatNumber, injectComponentDirection } from "@nanahoshi/mona-ui/i18n";
8
+ import { createElementControlId, injectEffectiveDisabled, rxTimeout, themeSelectionBarClasses } from "@nanahoshi/mona-ui/internal";
9
+ import { DateTime } from "luxon";
10
+ import { filter, fromEvent } from "rxjs";
11
+ import { cva } from "class-variance-authority";
13
12
  const timeSelectorBaseThemeVariants = cva(`
14
13
  flex h-full w-full flex-col overflow-hidden
15
14
  data-[invalid='true']:border data-[invalid='true']:border-error
16
15
  data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
17
- `, {
18
- variants: {
19
- disabled: {
20
- true: "pointer-events-none cursor-not-allowed text-disabled-foreground",
21
- false: ""
22
- },
23
- size: {
24
- small: "text-xs",
25
- medium: "text-sm",
26
- large: "text-base"
27
- }
28
- }
29
- });
16
+ `, { variants: {
17
+ disabled: {
18
+ true: "pointer-events-none cursor-not-allowed text-disabled-foreground",
19
+ false: ""
20
+ },
21
+ size: {
22
+ small: "text-xs",
23
+ medium: "text-sm",
24
+ large: "text-base"
25
+ }
26
+ } });
30
27
  const timeSelectorFooterThemeVariants = cva(`
31
28
  flex w-full items-center justify-end px-1 py-1
32
29
  bg-surface-muted
@@ -58,691 +55,1091 @@ const timeSelectorListThemeVariants = cva(`
58
55
  [&::-webkit-scrollbar]:hidden
59
56
  focus-visible:bg-(--color-focus-surface)
60
57
  focus-within:bg-(--color-focus-surface)
61
- `, {
62
- variants: {
63
- size: {
64
- small: "h-24",
65
- medium: "h-32",
66
- large: "h-40"
67
- }
68
- }
69
- });
58
+ `, { variants: { size: {
59
+ small: "h-24",
60
+ medium: "h-32",
61
+ large: "h-40"
62
+ } } });
70
63
  const timeSelectorListItemThemeVariants = cva(`
71
64
  relative z-10 flex cursor-pointer snap-center items-center justify-center
72
65
  text-foreground
73
66
  hover:bg-hover active:bg-active
74
67
  `, {
75
- variants: {
76
- selected: {
77
- true: `bg-active font-medium text-foreground hover:bg-active ${themeSelectionBarClasses}`,
78
- false: ""
79
- },
80
- size: {
81
- small: "h-6",
82
- medium: "h-7",
83
- large: "h-8"
84
- }
85
- },
86
- defaultVariants: {
87
- selected: false
88
- }
68
+ variants: {
69
+ selected: {
70
+ true: `bg-active font-medium text-foreground hover:bg-active ${themeSelectionBarClasses}`,
71
+ false: ""
72
+ },
73
+ size: {
74
+ small: "h-6",
75
+ medium: "h-7",
76
+ large: "h-8"
77
+ }
78
+ },
79
+ defaultVariants: { selected: false }
80
+ });
81
+ var TimeSelectorItemDirective = class TimeSelectorItemDirective {
82
+ #destroyRef;
83
+ #host;
84
+ #scrollBehavior;
85
+ constructor() {
86
+ this.#destroyRef = inject(DestroyRef);
87
+ this.#host = inject(ElementRef);
88
+ this.#scrollBehavior = signal("instant", ...ngDevMode ? [{ debugName: "#scrollBehavior" }] : /* istanbul ignore next */ []);
89
+ this.baseClass = computed(() => {
90
+ const selected = this.selected();
91
+ const size = this.size();
92
+ return timeSelectorListItemThemeVariants({
93
+ selected,
94
+ size
95
+ });
96
+ }, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
97
+ this.selected = input.required(...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
98
+ this.size = input.required(...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
99
+ this.value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
100
+ effect(() => {
101
+ const selected = this.selected();
102
+ rxTimeout(this.#destroyRef, () => {
103
+ if (selected) this.#host.nativeElement.scrollIntoView({
104
+ block: "center",
105
+ behavior: this.#scrollBehavior()
106
+ });
107
+ if (this.#scrollBehavior() === "instant") this.#scrollBehavior.set("auto");
108
+ });
109
+ });
110
+ }
111
+ static {
112
+ this.ɵfac = i0.ɵɵngDeclareFactory({
113
+ minVersion: "12.0.0",
114
+ version: "22.2.6",
115
+ ngImport: i0,
116
+ type: TimeSelectorItemDirective,
117
+ deps: [],
118
+ target: i0.ɵɵFactoryTarget.Directive
119
+ });
120
+ }
121
+ static {
122
+ this.ɵdir = i0.ɵɵngDeclareDirective({
123
+ minVersion: "17.1.0",
124
+ version: "22.2.6",
125
+ type: TimeSelectorItemDirective,
126
+ isStandalone: true,
127
+ selector: "li[monaTimeSelectorItem]",
128
+ inputs: {
129
+ selected: {
130
+ classPropertyName: "selected",
131
+ publicName: "selected",
132
+ isSignal: true,
133
+ isRequired: true,
134
+ transformFunction: null
135
+ },
136
+ size: {
137
+ classPropertyName: "size",
138
+ publicName: "size",
139
+ isSignal: true,
140
+ isRequired: true,
141
+ transformFunction: null
142
+ },
143
+ value: {
144
+ classPropertyName: "value",
145
+ publicName: "value",
146
+ isSignal: true,
147
+ isRequired: true,
148
+ transformFunction: null
149
+ }
150
+ },
151
+ host: {
152
+ attributes: { "role": "option" },
153
+ properties: {
154
+ "attr.aria-selected": "selected()",
155
+ "attr.data-value": "value()",
156
+ "class": "baseClass()"
157
+ }
158
+ },
159
+ ngImport: i0
160
+ });
161
+ }
162
+ };
163
+ i0.ɵɵngDeclareClassMetadata({
164
+ minVersion: "12.0.0",
165
+ version: "22.2.6",
166
+ ngImport: i0,
167
+ type: TimeSelectorItemDirective,
168
+ decorators: [{
169
+ type: Directive,
170
+ args: [{
171
+ selector: "li[monaTimeSelectorItem]",
172
+ host: {
173
+ role: "option",
174
+ "[attr.aria-selected]": "selected()",
175
+ "[attr.data-value]": "value()",
176
+ "[class]": "baseClass()"
177
+ }
178
+ }]
179
+ }],
180
+ ctorParameters: () => [],
181
+ propDecorators: {
182
+ selected: [{
183
+ type: i0.Input,
184
+ args: [{
185
+ isSignal: true,
186
+ alias: "selected",
187
+ required: true
188
+ }]
189
+ }],
190
+ size: [{
191
+ type: i0.Input,
192
+ args: [{
193
+ isSignal: true,
194
+ alias: "size",
195
+ required: true
196
+ }]
197
+ }],
198
+ value: [{
199
+ type: i0.Input,
200
+ args: [{
201
+ isSignal: true,
202
+ alias: "value",
203
+ required: true
204
+ }]
205
+ }]
206
+ }
207
+ });
208
+ var TimeSelectorListDirective = class TimeSelectorListDirective {
209
+ constructor() {
210
+ this.#itemHeight = computed(() => {
211
+ const size = this.size();
212
+ return size === "small" ? 24 : size === "medium" ? 28 : 32;
213
+ }, ...ngDevMode ? [{ debugName: "#itemHeight" }] : /* istanbul ignore next */ []);
214
+ this.baseClass = computed(() => {
215
+ const size = this.size();
216
+ return timeSelectorListThemeVariants({ size });
217
+ }, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
218
+ this.listPadding = computed(() => {
219
+ const itemHeight = this.#itemHeight();
220
+ return this.popupHeight() / 2 - itemHeight / 2;
221
+ }, ...ngDevMode ? [{ debugName: "listPadding" }] : /* istanbul ignore next */ []);
222
+ this.active = input.required(...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
223
+ this.popupHeight = input.required(...ngDevMode ? [{ debugName: "popupHeight" }] : /* istanbul ignore next */ []);
224
+ this.size = input.required(...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
225
+ }
226
+ #itemHeight;
227
+ static {
228
+ this.ɵfac = i0.ɵɵngDeclareFactory({
229
+ minVersion: "12.0.0",
230
+ version: "22.2.6",
231
+ ngImport: i0,
232
+ type: TimeSelectorListDirective,
233
+ deps: [],
234
+ target: i0.ɵɵFactoryTarget.Directive
235
+ });
236
+ }
237
+ static {
238
+ this.ɵdir = i0.ɵɵngDeclareDirective({
239
+ minVersion: "17.1.0",
240
+ version: "22.2.6",
241
+ type: TimeSelectorListDirective,
242
+ isStandalone: true,
243
+ selector: "ol[monaTimeSelectorList]",
244
+ inputs: {
245
+ active: {
246
+ classPropertyName: "active",
247
+ publicName: "active",
248
+ isSignal: true,
249
+ isRequired: true,
250
+ transformFunction: null
251
+ },
252
+ popupHeight: {
253
+ classPropertyName: "popupHeight",
254
+ publicName: "popupHeight",
255
+ isSignal: true,
256
+ isRequired: true,
257
+ transformFunction: null
258
+ },
259
+ size: {
260
+ classPropertyName: "size",
261
+ publicName: "size",
262
+ isSignal: true,
263
+ isRequired: true,
264
+ transformFunction: null
265
+ }
266
+ },
267
+ host: {
268
+ attributes: { "role": "listbox" },
269
+ properties: {
270
+ "class": "baseClass()",
271
+ "style.padding-top.px": "listPadding()",
272
+ "style.padding-bottom.px": "listPadding()",
273
+ "attr.tabindex": "active() ? 0 : -1"
274
+ }
275
+ },
276
+ ngImport: i0
277
+ });
278
+ }
279
+ };
280
+ i0.ɵɵngDeclareClassMetadata({
281
+ minVersion: "12.0.0",
282
+ version: "22.2.6",
283
+ ngImport: i0,
284
+ type: TimeSelectorListDirective,
285
+ decorators: [{
286
+ type: Directive,
287
+ args: [{
288
+ selector: "ol[monaTimeSelectorList]",
289
+ host: {
290
+ role: "listbox",
291
+ "[class]": "baseClass()",
292
+ "[style.padding-top.px]": "listPadding()",
293
+ "[style.padding-bottom.px]": "listPadding()",
294
+ "[attr.tabindex]": "active() ? 0 : -1"
295
+ }
296
+ }]
297
+ }],
298
+ propDecorators: {
299
+ active: [{
300
+ type: i0.Input,
301
+ args: [{
302
+ isSignal: true,
303
+ alias: "active",
304
+ required: true
305
+ }]
306
+ }],
307
+ popupHeight: [{
308
+ type: i0.Input,
309
+ args: [{
310
+ isSignal: true,
311
+ alias: "popupHeight",
312
+ required: true
313
+ }]
314
+ }],
315
+ size: [{
316
+ type: i0.Input,
317
+ args: [{
318
+ isSignal: true,
319
+ alias: "size",
320
+ required: true
321
+ }]
322
+ }]
323
+ }
89
324
  });
90
-
91
- class TimeSelectorItemDirective {
92
- #destroyRef;
93
- #host;
94
- #scrollBehavior;
95
- constructor() {
96
- this.#destroyRef = inject(DestroyRef);
97
- this.#host = inject((ElementRef));
98
- this.#scrollBehavior = signal("instant", /* @ts-ignore */
99
- ...(ngDevMode ? [{ debugName: "#scrollBehavior" }] : /* istanbul ignore next */ []));
100
- this.baseClass = computed(() => {
101
- const selected = this.selected();
102
- const size = this.size();
103
- return timeSelectorListItemThemeVariants({ selected, size });
104
- }, /* @ts-ignore */
105
- ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
106
- this.selected = input.required(/* @ts-ignore */
107
- ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
108
- this.size = input.required(/* @ts-ignore */
109
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
110
- this.value = input.required(/* @ts-ignore */
111
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
112
- effect(() => {
113
- const selected = this.selected();
114
- rxTimeout(this.#destroyRef, () => {
115
- if (selected) {
116
- this.#host.nativeElement.scrollIntoView({ block: "center", behavior: this.#scrollBehavior() });
117
- }
118
- if (this.#scrollBehavior() === "instant") {
119
- this.#scrollBehavior.set("auto");
120
- }
121
- });
122
- });
123
- }
124
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
125
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TimeSelectorItemDirective, isStandalone: true, selector: "li[monaTimeSelectorItem]", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "option" }, properties: { "attr.aria-selected": "selected()", "attr.data-value": "value()", "class": "baseClass()" } }, ngImport: i0 }); }
126
- }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorItemDirective, decorators: [{
128
- type: Directive,
129
- args: [{
130
- selector: "li[monaTimeSelectorItem]",
131
- host: {
132
- role: "option",
133
- "[attr.aria-selected]": "selected()",
134
- "[attr.data-value]": "value()",
135
- "[class]": "baseClass()"
136
- }
137
- }]
138
- }], ctorParameters: () => [], propDecorators: { selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
139
-
140
- class TimeSelectorListDirective {
141
- constructor() {
142
- this.#itemHeight = computed(() => {
143
- const size = this.size();
144
- return size === "small" ? 24 : size === "medium" ? 28 : 32; // TODO: Get rid of magic numbers
145
- }, /* @ts-ignore */
146
- ...(ngDevMode ? [{ debugName: "#itemHeight" }] : /* istanbul ignore next */ []));
147
- this.baseClass = computed(() => {
148
- const size = this.size();
149
- return timeSelectorListThemeVariants({ size });
150
- }, /* @ts-ignore */
151
- ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
152
- this.listPadding = computed(() => {
153
- const itemHeight = this.#itemHeight();
154
- const popupHeight = this.popupHeight();
155
- return popupHeight / 2 - itemHeight / 2;
156
- }, /* @ts-ignore */
157
- ...(ngDevMode ? [{ debugName: "listPadding" }] : /* istanbul ignore next */ []));
158
- this.active = input.required(/* @ts-ignore */
159
- ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
160
- this.popupHeight = input.required(/* @ts-ignore */
161
- ...(ngDevMode ? [{ debugName: "popupHeight" }] : /* istanbul ignore next */ []));
162
- this.size = input.required(/* @ts-ignore */
163
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
164
- }
165
- #itemHeight;
166
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
167
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TimeSelectorListDirective, isStandalone: true, selector: "ol[monaTimeSelectorList]", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: true, transformFunction: null }, popupHeight: { classPropertyName: "popupHeight", publicName: "popupHeight", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "listbox" }, properties: { "class": "baseClass()", "style.padding-top.px": "listPadding()", "style.padding-bottom.px": "listPadding()", "attr.tabindex": "active() ? 0 : -1" } }, ngImport: i0 }); }
168
- }
169
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorListDirective, decorators: [{
170
- type: Directive,
171
- args: [{
172
- selector: "ol[monaTimeSelectorList]",
173
- host: {
174
- role: "listbox",
175
- "[class]": "baseClass()",
176
- "[style.padding-top.px]": "listPadding()",
177
- "[style.padding-bottom.px]": "listPadding()",
178
- "[attr.tabindex]": "active() ? 0 : -1"
179
- }
180
- }]
181
- }], propDecorators: { active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: true }] }], popupHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupHeight", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }] } });
182
-
183
- // Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
184
- // Edit the JSON file and run `npm run generate:locale-catalogs`.
185
325
  const TIME_SELECTOR_DEFAULT_MESSAGES = {
186
- am: "AM",
187
- amPm: "AM/PM",
188
- headerHours: "Hr",
189
- headerMinutes: "Min",
190
- headerSeconds: "Sec",
191
- hours: "Hours",
192
- minutes: "Minutes",
193
- now: "Now",
194
- pm: "PM",
195
- seconds: "Seconds",
196
- set: "Set",
197
- timeSelector: "Time selector"
326
+ am: "AM",
327
+ amPm: "AM/PM",
328
+ headerHours: "Hr",
329
+ headerMinutes: "Min",
330
+ headerSeconds: "Sec",
331
+ hours: "Hours",
332
+ minutes: "Minutes",
333
+ now: "Now",
334
+ pm: "PM",
335
+ seconds: "Seconds",
336
+ set: "Set",
337
+ timeSelector: "Time selector"
198
338
  };
199
-
200
339
  const TIME_LIMITER = new TimeLimiterPipe();
201
- class TimeSelectorComponent {
202
- #destroyRef;
203
- #direction;
204
- #height;
205
- #hostElementRef;
206
- #i18n;
207
- #timeSelectorService;
208
- constructor() {
209
- this.#destroyRef = inject(DestroyRef);
210
- this.#direction = injectComponentDirection();
211
- this.#height = signal(0, /* @ts-ignore */
212
- ...(ngDevMode ? [{ debugName: "#height" }] : /* istanbul ignore next */ []));
213
- this.#hostElementRef = inject((ElementRef));
214
- this.#i18n = inject(MonaI18nService);
215
- this.#timeSelectorService = inject(TimeSelectorService, { optional: true });
216
- this.amMeridiemVisible = computed(() => {
217
- const min = this.min();
218
- return !(min && min.getHours() >= 12);
219
- }, /* @ts-ignore */
220
- ...(ngDevMode ? [{ debugName: "amMeridiemVisible" }] : /* istanbul ignore next */ []));
221
- this.baseClass = computed(() => {
222
- const disabled = this.effectiveDisabled();
223
- return timeSelectorBaseThemeVariants({ disabled });
224
- }, /* @ts-ignore */
225
- ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
226
- this.computedPopupHeight = this.#height.asReadonly();
227
- /** The clock in use: the `hourFormat` input, or the locale's own when it isn't set. */
228
- this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
229
- this.effectiveHourFormat = computed(() => this.hourFormat() ?? getLocaleHourFormat(this.#i18n.localeId()), /* @ts-ignore */
230
- ...(ngDevMode ? [{ debugName: "effectiveHourFormat" }] : /* istanbul ignore next */ []));
231
- this.focusedList = signal("hours", /* @ts-ignore */
232
- ...(ngDevMode ? [{ debugName: "focusedList" }] : /* istanbul ignore next */ []));
233
- this.footerClass = computed(() => {
234
- return timeSelectorFooterThemeVariants();
235
- }, /* @ts-ignore */
236
- ...(ngDevMode ? [{ debugName: "footerClass" }] : /* istanbul ignore next */ []));
237
- this.headerClass = computed(() => {
238
- return timeSelectorHeaderThemeVariants();
239
- }, /* @ts-ignore */
240
- ...(ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []));
241
- this.hour = computed(() => {
242
- const hour = this.navigatedDate().hour;
243
- if (this.effectiveHourFormat() === "24") {
244
- return hour;
245
- }
246
- return hour % 12 || 12;
247
- }, /* @ts-ignore */
248
- ...(ngDevMode ? [{ debugName: "hour" }] : /* istanbul ignore next */ []));
249
- this.hourListId = createElementControlId();
250
- this.hourListRef = viewChild.required("hourList", /* @ts-ignore */
251
- ...(ngDevMode ? [{ debugName: "hourListRef" }] : /* istanbul ignore next */ []));
252
- /** The hours shown and reachable with the keyboard: on the step, within min and max. */
253
- this.hourOptions = computed(() => this.limit(this.viewHours(), "h"), /* @ts-ignore */
254
- ...(ngDevMode ? [{ debugName: "hourOptions" }] : /* istanbul ignore next */ []));
255
- this.infoContainerClass = computed(() => {
256
- return timeSelectorInfoContainerThemeVariants();
257
- }, /* @ts-ignore */
258
- ...(ngDevMode ? [{ debugName: "infoContainerClass" }] : /* istanbul ignore next */ []));
259
- this.invalidState = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
260
- ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
261
- this.isRtl = computed(() => this.#direction() === "rtl", /* @ts-ignore */
262
- ...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
263
- this.listContainerClass = computed(() => {
264
- return timeSelectorListContainerThemeVariants();
265
- }, /* @ts-ignore */
266
- ...(ngDevMode ? [{ debugName: "listContainerClass" }] : /* istanbul ignore next */ []));
267
- this.maxDate = computed(() => {
268
- const max = this.max();
269
- const locale = this.#i18n.localeId();
270
- return max ? DateTime.fromJSDate(max).setLocale(locale) : null;
271
- }, /* @ts-ignore */
272
- ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
273
- this.meridiem = signal("AM", /* @ts-ignore */
274
- ...(ngDevMode ? [{ debugName: "meridiem" }] : /* istanbul ignore next */ []));
275
- this.meridiemListId = createElementControlId();
276
- this.meridiemListRef = viewChild("meridiemList", /* @ts-ignore */
277
- ...(ngDevMode ? [{ debugName: "meridiemListRef" }] : /* istanbul ignore next */ []));
278
- this.messages = this.#i18n.componentMessages("timeSelector", TIME_SELECTOR_DEFAULT_MESSAGES);
279
- this.minDate = computed(() => {
280
- const min = this.min();
281
- const locale = this.#i18n.localeId();
282
- return min ? DateTime.fromJSDate(min).setLocale(locale) : null;
283
- }, /* @ts-ignore */
284
- ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
285
- this.minute = computed(() => this.navigatedDate().minute, /* @ts-ignore */
286
- ...(ngDevMode ? [{ debugName: "minute" }] : /* istanbul ignore next */ []));
287
- this.minuteListId = createElementControlId();
288
- this.minuteListRef = viewChild.required("minuteList", /* @ts-ignore */
289
- ...(ngDevMode ? [{ debugName: "minuteListRef" }] : /* istanbul ignore next */ []));
290
- this.minuteOptions = computed(() => this.limit(generateMinuteSet(this.minuteStep()), "m"), /* @ts-ignore */
291
- ...(ngDevMode ? [{ debugName: "minuteOptions" }] : /* istanbul ignore next */ []));
292
- this.navigatedDate = signal(DateTime.now(), /* @ts-ignore */
293
- ...(ngDevMode ? [{ debugName: "navigatedDate" }] : /* istanbul ignore next */ []));
294
- this.navigatedDateText = computed(() => {
295
- const locale = this.#i18n.localeId();
296
- return this.navigatedDate()
297
- .setLocale(locale)
298
- .toLocaleString({ hour: "numeric", minute: "numeric", hour12: this.effectiveHourFormat() === "12" });
299
- }, /* @ts-ignore */
300
- ...(ngDevMode ? [{ debugName: "navigatedDateText" }] : /* istanbul ignore next */ []));
301
- this.pmMeridiemVisible = computed(() => {
302
- const max = this.max();
303
- return !(max && max.getHours() < 12);
304
- }, /* @ts-ignore */
305
- ...(ngDevMode ? [{ debugName: "pmMeridiemVisible" }] : /* istanbul ignore next */ []));
306
- this.second = computed(() => this.navigatedDate().second, /* @ts-ignore */
307
- ...(ngDevMode ? [{ debugName: "second" }] : /* istanbul ignore next */ []));
308
- this.secondListId = createElementControlId();
309
- this.secondListRef = viewChild("secondList", /* @ts-ignore */
310
- ...(ngDevMode ? [{ debugName: "secondListRef" }] : /* istanbul ignore next */ []));
311
- this.secondOptions = computed(() => this.limit(generateSecondSet(this.secondStep()), "s"), /* @ts-ignore */
312
- ...(ngDevMode ? [{ debugName: "secondOptions" }] : /* istanbul ignore next */ []));
313
- this.viewHours = computed(() => generateHourSet(this.effectiveHourFormat(), this.meridiem(), this.hourStep()), /* @ts-ignore */
314
- ...(ngDevMode ? [{ debugName: "viewHours" }] : /* istanbul ignore next */ []));
315
- /**
316
- * @description Accessible label for the time selector group.
317
- * @default ""
318
- */
319
- this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
320
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
321
- /**
322
- * @description Moves focus to the hour list when the selector first renders. The pickers set it for their popups;
323
- * an inline selector leaves focus where it is, so the page doesn't jump to it on load.
324
- * @default false
325
- */
326
- this.focusOnMount = input(false, { ...(ngDevMode ? { debugName: "focusOnMount" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
327
- /**
328
- * @description Shows the Set button. Without it, every change of hour, minute, second or AM/PM made by the user
329
- * is written to the value at once.
330
- * @default true
331
- */
332
- this.footer = input(true, { ...(ngDevMode ? { debugName: "footer" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
333
- /**
334
- * @description The clock to show: "12" with an AM/PM list, or "24". When not set, the active locale's own clock
335
- * is used (12-hour for en-US, 24-hour for de-DE).
336
- * @default null
337
- */
338
- this.hourFormat = input(null, /* @ts-ignore */
339
- ...(ngDevMode ? [{ debugName: "hourFormat" }] : /* istanbul ignore next */ []));
340
- this.hourStep = input(1, /* @ts-ignore */
341
- ...(ngDevMode ? [{ debugName: "hourStep" }] : /* istanbul ignore next */ []));
342
- /**
343
- * @description Marks the time selector as invalid. When bound to a signal form field via `[formField]`,
344
- * this is written by the `FormField` directive.
345
- * @default false
346
- */
347
- this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
348
- this.max = input(undefined, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: value => (value instanceof Date ? value : undefined) });
349
- this.min = input(undefined, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: value => (value instanceof Date ? value : undefined) });
350
- this.minuteStep = input(1, /* @ts-ignore */
351
- ...(ngDevMode ? [{ debugName: "minuteStep" }] : /* istanbul ignore next */ []));
352
- /**
353
- * @description Prevents value changes while preserving the component's visual state.
354
- * @default false
355
- */
356
- this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
357
- /**
358
- * @description Sets whether the time selector is required. When bound to a signal form field via `[formField]`,
359
- * this is written by the `FormField` directive.
360
- * @default false
361
- */
362
- this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
363
- this.rounded = input("medium", /* @ts-ignore */
364
- ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
365
- this.secondStep = input(1, /* @ts-ignore */
366
- ...(ngDevMode ? [{ debugName: "secondStep" }] : /* istanbul ignore next */ []));
367
- this.showSeconds = input(false, { ...(ngDevMode ? { debugName: "showSeconds" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
368
- this.size = input("medium", /* @ts-ignore */
369
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
370
- /**
371
- * @description Emitted when focus leaves the time selector, as a native input is touched on blur. Moving between
372
- * its lists and buttons doesn't count. The `FormField` directive listens to this to mark the field as touched.
373
- */
374
- this.touch = output();
375
- /**
376
- * @description Sets the touched state of the time selector. When bound to a signal form field via `[formField]`,
377
- * this is written by the `FormField` directive.
378
- * @default false
379
- */
380
- this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
381
- /**
382
- * @description Two-way bindable current time value. It is written by the Set button and Enter, or, without a
383
- * footer, by each change the user makes; never on its own.
384
- * @default null
385
- */
386
- this.value = model(null, /* @ts-ignore */
387
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
388
- afterNextRender({
389
- read: () => {
390
- this.#height.set(this.#hostElementRef.nativeElement.offsetHeight);
391
- this.setDateValues();
392
- const value = this.value();
393
- if (value) {
394
- const dt = DateTime.fromJSDate(value).setLocale(this.#i18n.localeId());
395
- if (dt.isValid) {
396
- this.navigatedDate.set(dt);
397
- }
398
- else {
399
- this.initializeNavigatedDate(value);
400
- }
401
- }
402
- this.setupKeyboardNavigation();
403
- if (this.focusOnMount()) {
404
- this.focusList(this.focusedList());
405
- }
406
- }
407
- });
408
- effect(() => {
409
- const value = this.value();
410
- untracked(() => this.setDateValues(value));
411
- });
412
- }
413
- /**
414
- * Moves focus to the active list.
415
- * @param options passed to the native `focus()` call, for example `{ preventScroll: true }`.
416
- */
417
- focus(options) {
418
- this.focusList(this.focusedList(), options);
419
- }
420
- /** The id of the active option, or null while the time isn't one of the options (between steps, say). */
421
- activeOptionId(listId, options, value) {
422
- for (const option of options) {
423
- if (option.value === value) {
424
- return `${listId}${value}`;
425
- }
426
- }
427
- return null;
428
- }
429
- formatTwoDigit(value) {
430
- return formatNumber(value, this.#i18n.localeId(), {
431
- minimumIntegerDigits: 2,
432
- useGrouping: false
433
- });
434
- }
435
- onFocusOut(event) {
436
- // Removing a focused selector from the page fires focusout after it is destroyed.
437
- if (this.#destroyRef.destroyed) {
438
- return;
439
- }
440
- const nextTarget = event.relatedTarget;
441
- if (nextTarget instanceof Node && this.#hostElementRef.nativeElement.contains(nextTarget)) {
442
- return;
443
- }
444
- this.touch.emit();
445
- }
446
- onHourChange(hour) {
447
- if (this.effectiveDisabled() || this.readonly()) {
448
- return;
449
- }
450
- this.navigateTo(this.navigatedDate().set({ hour }));
451
- }
452
- onMeridiemClick(meridiem) {
453
- if (this.effectiveDisabled() || this.readonly()) {
454
- return;
455
- }
456
- if (this.meridiem() === meridiem) {
457
- return;
458
- }
459
- const hour = this.navigatedDate().hour;
460
- if (meridiem === "PM" && hour < 12) {
461
- this.navigateTo(this.navigatedDate().set({ hour: hour + 12 }));
462
- }
463
- else if (meridiem === "AM" && hour >= 12) {
464
- this.navigateTo(this.navigatedDate().set({ hour: hour - 12 }));
465
- }
466
- }
467
- onMinuteChange(minute) {
468
- if (this.effectiveDisabled() || this.readonly()) {
469
- return;
470
- }
471
- this.navigateTo(this.navigatedDate().set({ minute }));
472
- }
473
- onNowClick() {
474
- if (this.effectiveDisabled() || this.readonly()) {
475
- return;
476
- }
477
- const now = DateTime.now();
478
- this.navigateTo(this.navigatedDate().set({
479
- hour: now.hour,
480
- minute: now.minute,
481
- second: now.second,
482
- millisecond: now.millisecond
483
- }));
484
- }
485
- onSecondChange(second) {
486
- if (this.effectiveDisabled() || this.readonly()) {
487
- return;
488
- }
489
- this.navigateTo(this.navigatedDate().set({ second }));
490
- }
491
- onSetTimeClick() {
492
- if (this.effectiveDisabled() || this.readonly()) {
493
- return;
494
- }
495
- this.updateValue(this.clampToRange(this.navigatedDate()).toJSDate());
496
- }
497
- /** Moves a time inside min and max, on the same day. */
498
- clampToRange(date) {
499
- const day = { year: date.year, month: date.month, day: date.day };
500
- const min = this.minDate()?.set(day);
501
- const max = this.maxDate()?.set(day);
502
- const timeOf = (bound) => ({
503
- hour: bound.hour,
504
- minute: bound.minute,
505
- second: bound.second,
506
- millisecond: bound.millisecond
507
- });
508
- if (min && date < min) {
509
- return date.set(timeOf(min));
510
- }
511
- if (max && date > max) {
512
- return date.set(timeOf(max));
513
- }
514
- return date;
515
- }
516
- dateValuesEqual(date1, date2) {
517
- return date1?.getTime() === date2?.getTime();
518
- }
519
- focusList(listType, options) {
520
- const listRef = this.getListRef(listType);
521
- listRef?.nativeElement.focus(options);
522
- }
523
- getListRef(listType) {
524
- switch (listType) {
525
- case "hours":
526
- return this.hourListRef();
527
- case "minutes":
528
- return this.minuteListRef();
529
- case "seconds":
530
- return this.secondListRef();
531
- case "meridiem":
532
- return this.meridiemListRef();
533
- }
534
- }
535
- getNextList(current, direction) {
536
- const lists = ["hours", "minutes"];
537
- if (this.showSeconds()) {
538
- lists.push("seconds");
539
- }
540
- if (this.effectiveHourFormat() === "12") {
541
- lists.push("meridiem");
542
- }
543
- const currentIndex = lists.indexOf(current);
544
- const isRtl = this.isRtl();
545
- const effectiveDirection = isRtl ? (direction === "left" ? "right" : "left") : direction;
546
- if (effectiveDirection === "right") {
547
- return lists[(currentIndex + 1) % lists.length];
548
- }
549
- else {
550
- return lists[(currentIndex - 1 + lists.length) % lists.length];
551
- }
552
- }
553
- getOptions(listType) {
554
- const options = listType === "hours" ? this.hourOptions : listType === "minutes" ? this.minuteOptions : this.secondOptions;
555
- return Array.from(options());
556
- }
557
- handleKeydown(event) {
558
- if (this.effectiveDisabled() || this.readonly()) {
559
- return;
560
- }
561
- const preventableEvent = new PreventableEvent("calendarKeydown", event);
562
- this.#timeSelectorService?.keydown$.next(preventableEvent);
563
- if (preventableEvent.isDefaultPrevented()) {
564
- return;
565
- }
566
- // Keys pressed on the Now and Set buttons belong to the buttons, which act on click.
567
- if (event.target.closest("button")) {
568
- return;
569
- }
570
- const focusedList = this.focusedList();
571
- switch (event.key) {
572
- case "ArrowUp":
573
- event.preventDefault();
574
- this.navigateItem(focusedList, -1);
575
- break;
576
- case "ArrowDown":
577
- event.preventDefault();
578
- this.navigateItem(focusedList, 1);
579
- break;
580
- case "ArrowLeft":
581
- if (event.altKey) {
582
- return;
583
- }
584
- event.preventDefault();
585
- this.focusedList.set(this.getNextList(focusedList, "left"));
586
- this.focusList(this.focusedList());
587
- break;
588
- case "ArrowRight":
589
- if (event.altKey) {
590
- return;
591
- }
592
- event.preventDefault();
593
- this.focusedList.set(this.getNextList(focusedList, "right"));
594
- this.focusList(this.focusedList());
595
- break;
596
- case "Home":
597
- event.preventDefault();
598
- this.navigateToEdge(focusedList, "first");
599
- break;
600
- case "End":
601
- event.preventDefault();
602
- this.navigateToEdge(focusedList, "last");
603
- break;
604
- case "Enter":
605
- case " ":
606
- // Space would otherwise scroll the focused list.
607
- event.preventDefault();
608
- this.updateValue(this.clampToRange(this.navigatedDate()).toJSDate());
609
- break;
610
- }
611
- }
612
- initializeNavigatedDate(date) {
613
- const min = this.min();
614
- const max = this.max();
615
- const locale = this.#i18n.localeId();
616
- if (!date) {
617
- this.navigatedDate.set(DateTime.now().setLocale(locale));
618
- }
619
- else if (min && date < min) {
620
- const minDate = DateTime.fromJSDate(min).setLocale(locale);
621
- if (minDate.isValid) {
622
- this.navigatedDate.set(minDate);
623
- }
624
- }
625
- else if (max && date > max) {
626
- const maxDate = DateTime.fromJSDate(max).setLocale(locale);
627
- if (maxDate.isValid) {
628
- this.navigatedDate.set(maxDate);
629
- }
630
- }
631
- else {
632
- const dateToSet = DateTime.fromJSDate(date).setLocale(locale);
633
- if (dateToSet.isValid) {
634
- this.navigatedDate.set(dateToSet);
635
- }
636
- }
637
- }
638
- /** The options of a list that pass the step and the min/max bounds for the time being edited. */
639
- limit(values, type) {
640
- return TIME_LIMITER.transform(values, type, this.navigatedDate(), this.minDate(), this.maxDate());
641
- }
642
- /** Moves through the options of a list, so the keyboard reaches what the mouse can: steps within min and max. */
643
- navigateItem(listType, direction) {
644
- if (listType === "meridiem") {
645
- const target = this.meridiem() === "AM" ? "PM" : "AM";
646
- if (target === "AM" ? this.amMeridiemVisible() : this.pmMeridiemVisible()) {
647
- this.onMeridiemClick(target);
648
- }
649
- return;
650
- }
651
- const options = this.getOptions(listType);
652
- if (options.length === 0) {
653
- return;
654
- }
655
- const current = listType === "hours" ? this.navigatedDate().hour : listType === "minutes" ? this.minute() : this.second();
656
- const index = options.findIndex(option => option.value === current);
657
- let target;
658
- if (index >= 0) {
659
- target = options[Math.max(0, Math.min(options.length - 1, index + direction))];
660
- }
661
- else {
662
- // Between steps: go to the nearest option in the direction of the key.
663
- target =
664
- direction > 0
665
- ? (options.find(option => option.value > current) ?? options[options.length - 1])
666
- : ([...options].reverse().find(option => option.value < current) ?? options[0]);
667
- }
668
- this.setUnit(listType, target.value);
669
- }
670
- navigateTo(date) {
671
- const clamped = this.clampToRange(date);
672
- this.navigatedDate.set(clamped);
673
- this.meridiem.set(clamped.hour >= 12 ? "PM" : "AM");
674
- if (!this.footer()) {
675
- this.updateValue(clamped.toJSDate());
676
- }
677
- }
678
- navigateToEdge(listType, edge) {
679
- if (listType === "meridiem") {
680
- this.onMeridiemClick(edge === "first" ? "AM" : "PM");
681
- return;
682
- }
683
- const options = this.getOptions(listType);
684
- const target = edge === "first" ? options[0] : options[options.length - 1];
685
- if (target) {
686
- this.setUnit(listType, target.value);
687
- }
688
- }
689
- setDateValues(value = this.value()) {
690
- const currentDate = this.navigatedDate().toJSDate();
691
- if (!this.dateValuesEqual(currentDate, value)) {
692
- this.initializeNavigatedDate(value);
693
- }
694
- const meridiem = this.navigatedDate().hour >= 12 ? "PM" : "AM";
695
- this.meridiem.set(meridiem);
696
- }
697
- setUnit(listType, value) {
698
- switch (listType) {
699
- case "hours":
700
- this.onHourChange(value);
701
- break;
702
- case "minutes":
703
- this.onMinuteChange(value);
704
- break;
705
- case "seconds":
706
- this.onSecondChange(value);
707
- break;
708
- }
709
- }
710
- setupKeyboardNavigation() {
711
- fromEvent(this.#hostElementRef.nativeElement, "keydown")
712
- .pipe(takeUntilDestroyed(this.#destroyRef), filter(() => !this.effectiveDisabled()))
713
- .subscribe(event => this.handleKeydown(event));
714
- }
715
- updateValue(date) {
716
- if (this.dateValuesEqual(this.value(), date)) {
717
- return;
718
- }
719
- this.value.set(date);
720
- }
721
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
722
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TimeSelectorComponent, isStandalone: true, selector: "mona-time-selector", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, focusOnMount: { classPropertyName: "focusOnMount", publicName: "focusOnMount", isSignal: true, isRequired: false, transformFunction: null }, footer: { classPropertyName: "footer", publicName: "footer", isSignal: true, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: true, isRequired: false, transformFunction: null }, hourStep: { classPropertyName: "hourStep", publicName: "hourStep", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, secondStep: { classPropertyName: "secondStep", publicName: "secondStep", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange" }, host: { attributes: { "role": "group" }, listeners: { "focusout": "onFocusOut($event)" }, properties: { "attr.aria-label": "ariaLabel() || messages().timeSelector", "attr.aria-disabled": "effectiveDisabled() || null", "attr.aria-invalid": "invalidState() ? 'true' : null", "attr.data-invalid": "invalidState() || null", "attr.data-readonly": "readonly() || null", "attr.data-required": "required() || null", "class": "baseClass()" } }, viewQueries: [{ propertyName: "hourListRef", first: true, predicate: ["hourList"], descendants: true, isSignal: true }, { propertyName: "meridiemListRef", first: true, predicate: ["meridiemList"], descendants: true, isSignal: true }, { propertyName: "minuteListRef", first: true, predicate: ["minuteList"], descendants: true, isSignal: true }, { propertyName: "secondListRef", first: true, predicate: ["secondList"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"headerClass()\">\n <div>{{ messages().headerHours }}</div>\n <div>{{ messages().headerMinutes }}</div>\n @if (showSeconds()) {\n <div>{{ messages().headerSeconds }}</div>\n }\n</div>\n\n<div [class]=\"infoContainerClass()\">\n <span>{{ navigatedDateText() }}</span>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n (click)=\"onNowClick()\">\n {{ messages().now }}\n </button>\n</div>\n\n<div [class]=\"listContainerClass()\">\n <ol\n #hourList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().hours\"\n [attr.aria-activedescendant]=\"activeOptionId(hourListId, hourOptions(), navigatedDate().hour)\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'hours'\"\n [id]=\"hourListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (h of hourOptions(); track h.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"h.viewValue === hour()\"\n [value]=\"h.value\"\n [id]=\"`${hourListId}${h.value}`\"\n (click)=\"onHourChange(h.value)\">\n {{ formatTwoDigit(h.viewValue) }}\n </li>\n }\n </ol>\n <ol\n #minuteList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().minutes\"\n [attr.aria-activedescendant]=\"activeOptionId(minuteListId, minuteOptions(), minute())\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'minutes'\"\n [id]=\"minuteListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (m of minuteOptions(); track m.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"m.value === minute()\"\n [value]=\"m.value\"\n [id]=\"`${minuteListId}${m.value}`\"\n (click)=\"onMinuteChange(m.value)\">\n {{ formatTwoDigit(m.viewValue) }}\n </li>\n }\n </ol>\n @if (showSeconds()) {\n <ol\n #secondList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().seconds\"\n [attr.aria-activedescendant]=\"activeOptionId(secondListId, secondOptions(), second())\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'seconds'\"\n [id]=\"secondListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (s of secondOptions(); track s.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"s.value === second()\"\n [value]=\"s.value\"\n [id]=\"`${secondListId}${s.value}`\"\n (click)=\"onSecondChange(s.value)\">\n {{ formatTwoDigit(s.value) }}\n </li>\n }\n </ol>\n }\n @if (effectiveHourFormat() === \"12\") {\n <ol\n #meridiemList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().amPm\"\n [attr.aria-activedescendant]=\"`${meridiemListId}${meridiem()}`\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'meridiem'\"\n [id]=\"meridiemListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @if (amMeridiemVisible()) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"meridiem() === 'AM'\"\n [value]=\"'AM'\"\n (click)=\"onMeridiemClick('AM')\"\n [id]=\"`${meridiemListId}AM`\">\n {{ messages().am }}\n </li>\n }\n @if (pmMeridiemVisible()) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"meridiem() === 'PM'\"\n [value]=\"'PM'\"\n (click)=\"onMeridiemClick('PM')\"\n [id]=\"`${meridiemListId}PM`\">\n {{ messages().pm }}\n </li>\n }\n </ol>\n }\n</div>\n\n@if (footer()) {\n <div [class]=\"footerClass()\">\n <button monaButton look=\"primary\" [rounded]=\"rounded()\" [size]=\"size()\" (click)=\"onSetTimeClick()\">\n {{ messages().set }}\n </button>\n </div>\n}\n", dependencies: [{ kind: "directive", type: TimeSelectorItemDirective, selector: "li[monaTimeSelectorItem]", inputs: ["selected", "size", "value"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "type", "class", "value"], outputs: ["lookChange", "selectedChange"] }, { kind: "directive", type: TimeSelectorListDirective, selector: "ol[monaTimeSelectorList]", inputs: ["active", "popupHeight", "size"] }] }); }
723
- }
724
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TimeSelectorComponent, decorators: [{
725
- type: Component,
726
- args: [{ selector: "mona-time-selector", imports: [TimeSelectorItemDirective, ButtonDirective, TimeSelectorListDirective], host: {
727
- role: "group",
728
- "[attr.aria-label]": "ariaLabel() || messages().timeSelector",
729
- "[attr.aria-disabled]": "effectiveDisabled() || null",
730
- "[attr.aria-invalid]": "invalidState() ? 'true' : null",
731
- "[attr.data-invalid]": "invalidState() || null",
732
- "[attr.data-readonly]": "readonly() || null",
733
- "[attr.data-required]": "required() || null",
734
- "[class]": "baseClass()",
735
- "(focusout)": "onFocusOut($event)"
736
- }, template: "<div [class]=\"headerClass()\">\n <div>{{ messages().headerHours }}</div>\n <div>{{ messages().headerMinutes }}</div>\n @if (showSeconds()) {\n <div>{{ messages().headerSeconds }}</div>\n }\n</div>\n\n<div [class]=\"infoContainerClass()\">\n <span>{{ navigatedDateText() }}</span>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n (click)=\"onNowClick()\">\n {{ messages().now }}\n </button>\n</div>\n\n<div [class]=\"listContainerClass()\">\n <ol\n #hourList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().hours\"\n [attr.aria-activedescendant]=\"activeOptionId(hourListId, hourOptions(), navigatedDate().hour)\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'hours'\"\n [id]=\"hourListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (h of hourOptions(); track h.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"h.viewValue === hour()\"\n [value]=\"h.value\"\n [id]=\"`${hourListId}${h.value}`\"\n (click)=\"onHourChange(h.value)\">\n {{ formatTwoDigit(h.viewValue) }}\n </li>\n }\n </ol>\n <ol\n #minuteList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().minutes\"\n [attr.aria-activedescendant]=\"activeOptionId(minuteListId, minuteOptions(), minute())\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'minutes'\"\n [id]=\"minuteListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (m of minuteOptions(); track m.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"m.value === minute()\"\n [value]=\"m.value\"\n [id]=\"`${minuteListId}${m.value}`\"\n (click)=\"onMinuteChange(m.value)\">\n {{ formatTwoDigit(m.viewValue) }}\n </li>\n }\n </ol>\n @if (showSeconds()) {\n <ol\n #secondList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().seconds\"\n [attr.aria-activedescendant]=\"activeOptionId(secondListId, secondOptions(), second())\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'seconds'\"\n [id]=\"secondListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (s of secondOptions(); track s.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"s.value === second()\"\n [value]=\"s.value\"\n [id]=\"`${secondListId}${s.value}`\"\n (click)=\"onSecondChange(s.value)\">\n {{ formatTwoDigit(s.value) }}\n </li>\n }\n </ol>\n }\n @if (effectiveHourFormat() === \"12\") {\n <ol\n #meridiemList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().amPm\"\n [attr.aria-activedescendant]=\"`${meridiemListId}${meridiem()}`\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'meridiem'\"\n [id]=\"meridiemListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @if (amMeridiemVisible()) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"meridiem() === 'AM'\"\n [value]=\"'AM'\"\n (click)=\"onMeridiemClick('AM')\"\n [id]=\"`${meridiemListId}AM`\">\n {{ messages().am }}\n </li>\n }\n @if (pmMeridiemVisible()) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"meridiem() === 'PM'\"\n [value]=\"'PM'\"\n (click)=\"onMeridiemClick('PM')\"\n [id]=\"`${meridiemListId}PM`\">\n {{ messages().pm }}\n </li>\n }\n </ol>\n }\n</div>\n\n@if (footer()) {\n <div [class]=\"footerClass()\">\n <button monaButton look=\"primary\" [rounded]=\"rounded()\" [size]=\"size()\" (click)=\"onSetTimeClick()\">\n {{ messages().set }}\n </button>\n </div>\n}\n" }]
737
- }], ctorParameters: () => [], propDecorators: { hourListRef: [{ type: i0.ViewChild, args: ["hourList", { isSignal: true }] }], meridiemListRef: [{ type: i0.ViewChild, args: ["meridiemList", { isSignal: true }] }], minuteListRef: [{ type: i0.ViewChild, args: ["minuteList", { isSignal: true }] }], secondListRef: [{ type: i0.ViewChild, args: ["secondList", { isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], focusOnMount: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusOnMount", required: false }] }], footer: [{ type: i0.Input, args: [{ isSignal: true, alias: "footer", required: false }] }], hourFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourFormat", required: false }] }], hourStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourStep", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], secondStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondStep", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
738
-
739
- /*
740
- * Public API Surface of @nanahoshi/mona-ui/time-selector
741
- */
742
-
743
- /**
744
- * Generated bundle index. Do not edit.
745
- */
746
-
340
+ var TimeSelectorComponent = class TimeSelectorComponent {
341
+ #destroyRef;
342
+ #direction;
343
+ #height;
344
+ #hostElementRef;
345
+ #i18n;
346
+ #timeSelectorService;
347
+ constructor() {
348
+ this.#destroyRef = inject(DestroyRef);
349
+ this.#direction = injectComponentDirection();
350
+ this.#height = signal(0, ...ngDevMode ? [{ debugName: "#height" }] : /* istanbul ignore next */ []);
351
+ this.#hostElementRef = inject(ElementRef);
352
+ this.#i18n = inject(MonaI18nService);
353
+ this.#timeSelectorService = inject(TimeSelectorService, { optional: true });
354
+ this.amMeridiemVisible = computed(() => {
355
+ const min = this.min();
356
+ return !(min && min.getHours() >= 12);
357
+ }, ...ngDevMode ? [{ debugName: "amMeridiemVisible" }] : /* istanbul ignore next */ []);
358
+ this.baseClass = computed(() => {
359
+ const disabled = this.effectiveDisabled();
360
+ return timeSelectorBaseThemeVariants({ disabled });
361
+ }, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
362
+ this.computedPopupHeight = this.#height.asReadonly();
363
+ this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
364
+ this.effectiveHourFormat = computed(() => this.hourFormat() ?? getLocaleHourFormat(this.#i18n.localeId()), ...ngDevMode ? [{ debugName: "effectiveHourFormat" }] : /* istanbul ignore next */ []);
365
+ this.focusedList = signal("hours", ...ngDevMode ? [{ debugName: "focusedList" }] : /* istanbul ignore next */ []);
366
+ this.footerClass = computed(() => {
367
+ return timeSelectorFooterThemeVariants();
368
+ }, ...ngDevMode ? [{ debugName: "footerClass" }] : /* istanbul ignore next */ []);
369
+ this.headerClass = computed(() => {
370
+ return timeSelectorHeaderThemeVariants();
371
+ }, ...ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []);
372
+ this.hour = computed(() => {
373
+ const hour = this.navigatedDate().hour;
374
+ if (this.effectiveHourFormat() === "24") return hour;
375
+ return hour % 12 || 12;
376
+ }, ...ngDevMode ? [{ debugName: "hour" }] : /* istanbul ignore next */ []);
377
+ this.hourListId = createElementControlId();
378
+ this.hourListRef = viewChild.required("hourList", ...ngDevMode ? [{ debugName: "hourListRef" }] : /* istanbul ignore next */ []);
379
+ this.hourOptions = computed(() => this.limit(this.viewHours(), "h"), ...ngDevMode ? [{ debugName: "hourOptions" }] : /* istanbul ignore next */ []);
380
+ this.infoContainerClass = computed(() => {
381
+ return timeSelectorInfoContainerThemeVariants();
382
+ }, ...ngDevMode ? [{ debugName: "infoContainerClass" }] : /* istanbul ignore next */ []);
383
+ this.invalidState = computed(() => this.touched() && this.invalid(), ...ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []);
384
+ this.isRtl = computed(() => this.#direction() === "rtl", ...ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []);
385
+ this.listContainerClass = computed(() => {
386
+ return timeSelectorListContainerThemeVariants();
387
+ }, ...ngDevMode ? [{ debugName: "listContainerClass" }] : /* istanbul ignore next */ []);
388
+ this.maxDate = computed(() => {
389
+ const max = this.max();
390
+ const locale = this.#i18n.localeId();
391
+ return max ? DateTime.fromJSDate(max).setLocale(locale) : null;
392
+ }, ...ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []);
393
+ this.meridiem = signal("AM", ...ngDevMode ? [{ debugName: "meridiem" }] : /* istanbul ignore next */ []);
394
+ this.meridiemListId = createElementControlId();
395
+ this.meridiemListRef = viewChild("meridiemList", ...ngDevMode ? [{ debugName: "meridiemListRef" }] : /* istanbul ignore next */ []);
396
+ this.messages = this.#i18n.componentMessages("timeSelector", TIME_SELECTOR_DEFAULT_MESSAGES);
397
+ this.minDate = computed(() => {
398
+ const min = this.min();
399
+ const locale = this.#i18n.localeId();
400
+ return min ? DateTime.fromJSDate(min).setLocale(locale) : null;
401
+ }, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
402
+ this.minute = computed(() => this.navigatedDate().minute, ...ngDevMode ? [{ debugName: "minute" }] : /* istanbul ignore next */ []);
403
+ this.minuteListId = createElementControlId();
404
+ this.minuteListRef = viewChild.required("minuteList", ...ngDevMode ? [{ debugName: "minuteListRef" }] : /* istanbul ignore next */ []);
405
+ this.minuteOptions = computed(() => this.limit(generateMinuteSet(this.minuteStep()), "m"), ...ngDevMode ? [{ debugName: "minuteOptions" }] : /* istanbul ignore next */ []);
406
+ this.navigatedDate = signal(DateTime.now(), ...ngDevMode ? [{ debugName: "navigatedDate" }] : /* istanbul ignore next */ []);
407
+ this.navigatedDateText = computed(() => {
408
+ const locale = this.#i18n.localeId();
409
+ return this.navigatedDate().setLocale(locale).toLocaleString({
410
+ hour: "numeric",
411
+ minute: "numeric",
412
+ hour12: this.effectiveHourFormat() === "12"
413
+ });
414
+ }, ...ngDevMode ? [{ debugName: "navigatedDateText" }] : /* istanbul ignore next */ []);
415
+ this.pmMeridiemVisible = computed(() => {
416
+ const max = this.max();
417
+ return !(max && max.getHours() < 12);
418
+ }, ...ngDevMode ? [{ debugName: "pmMeridiemVisible" }] : /* istanbul ignore next */ []);
419
+ this.second = computed(() => this.navigatedDate().second, ...ngDevMode ? [{ debugName: "second" }] : /* istanbul ignore next */ []);
420
+ this.secondListId = createElementControlId();
421
+ this.secondListRef = viewChild("secondList", ...ngDevMode ? [{ debugName: "secondListRef" }] : /* istanbul ignore next */ []);
422
+ this.secondOptions = computed(() => this.limit(generateSecondSet(this.secondStep()), "s"), ...ngDevMode ? [{ debugName: "secondOptions" }] : /* istanbul ignore next */ []);
423
+ this.viewHours = computed(() => generateHourSet(this.effectiveHourFormat(), this.meridiem(), this.hourStep()), ...ngDevMode ? [{ debugName: "viewHours" }] : /* istanbul ignore next */ []);
424
+ this.ariaLabel = input("", {
425
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
426
+ alias: "aria-label"
427
+ });
428
+ this.disabled = input(false, {
429
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
430
+ transform: booleanAttribute
431
+ });
432
+ this.focusOnMount = input(false, {
433
+ ...ngDevMode ? { debugName: "focusOnMount" } : /* istanbul ignore next */ {},
434
+ transform: booleanAttribute
435
+ });
436
+ this.footer = input(true, {
437
+ ...ngDevMode ? { debugName: "footer" } : /* istanbul ignore next */ {},
438
+ transform: booleanAttribute
439
+ });
440
+ this.hourFormat = input(null, ...ngDevMode ? [{ debugName: "hourFormat" }] : /* istanbul ignore next */ []);
441
+ this.hourStep = input(1, ...ngDevMode ? [{ debugName: "hourStep" }] : /* istanbul ignore next */ []);
442
+ this.invalid = input(false, {
443
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
444
+ transform: booleanAttribute
445
+ });
446
+ this.max = input(void 0, {
447
+ ...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
448
+ transform: (value) => value instanceof Date ? value : void 0
449
+ });
450
+ this.min = input(void 0, {
451
+ ...ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {},
452
+ transform: (value) => value instanceof Date ? value : void 0
453
+ });
454
+ this.minuteStep = input(1, ...ngDevMode ? [{ debugName: "minuteStep" }] : /* istanbul ignore next */ []);
455
+ this.readonly = input(false, {
456
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
457
+ transform: booleanAttribute
458
+ });
459
+ this.required = input(false, {
460
+ ...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
461
+ transform: booleanAttribute
462
+ });
463
+ this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
464
+ this.secondStep = input(1, ...ngDevMode ? [{ debugName: "secondStep" }] : /* istanbul ignore next */ []);
465
+ this.showSeconds = input(false, {
466
+ ...ngDevMode ? { debugName: "showSeconds" } : /* istanbul ignore next */ {},
467
+ transform: booleanAttribute
468
+ });
469
+ this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
470
+ this.touch = output();
471
+ this.touched = input(false, {
472
+ ...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
473
+ transform: booleanAttribute
474
+ });
475
+ this.value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
476
+ afterNextRender({ read: () => {
477
+ this.#height.set(this.#hostElementRef.nativeElement.offsetHeight);
478
+ this.setDateValues();
479
+ const value = this.value();
480
+ if (value) {
481
+ const dt = DateTime.fromJSDate(value).setLocale(this.#i18n.localeId());
482
+ if (dt.isValid) this.navigatedDate.set(dt);
483
+ else this.initializeNavigatedDate(value);
484
+ }
485
+ this.setupKeyboardNavigation();
486
+ if (this.focusOnMount()) this.focusList(this.focusedList());
487
+ } });
488
+ effect(() => {
489
+ const value = this.value();
490
+ untracked(() => this.setDateValues(value));
491
+ });
492
+ }
493
+ focus(options) {
494
+ this.focusList(this.focusedList(), options);
495
+ }
496
+ activeOptionId(listId, options, value) {
497
+ for (const option of options) if (option.value === value) return `${listId}${value}`;
498
+ return null;
499
+ }
500
+ formatTwoDigit(value) {
501
+ return formatNumber(value, this.#i18n.localeId(), {
502
+ minimumIntegerDigits: 2,
503
+ useGrouping: false
504
+ });
505
+ }
506
+ onFocusOut(event) {
507
+ if (this.#destroyRef.destroyed) return;
508
+ const nextTarget = event.relatedTarget;
509
+ if (nextTarget instanceof Node && this.#hostElementRef.nativeElement.contains(nextTarget)) return;
510
+ this.touch.emit();
511
+ }
512
+ onHourChange(hour) {
513
+ if (this.effectiveDisabled() || this.readonly()) return;
514
+ this.navigateTo(this.navigatedDate().set({ hour }));
515
+ }
516
+ onMeridiemClick(meridiem) {
517
+ if (this.effectiveDisabled() || this.readonly()) return;
518
+ if (this.meridiem() === meridiem) return;
519
+ const hour = this.navigatedDate().hour;
520
+ if (meridiem === "PM" && hour < 12) this.navigateTo(this.navigatedDate().set({ hour: hour + 12 }));
521
+ else if (meridiem === "AM" && hour >= 12) this.navigateTo(this.navigatedDate().set({ hour: hour - 12 }));
522
+ }
523
+ onMinuteChange(minute) {
524
+ if (this.effectiveDisabled() || this.readonly()) return;
525
+ this.navigateTo(this.navigatedDate().set({ minute }));
526
+ }
527
+ onNowClick() {
528
+ if (this.effectiveDisabled() || this.readonly()) return;
529
+ const now = DateTime.now();
530
+ this.navigateTo(this.navigatedDate().set({
531
+ hour: now.hour,
532
+ minute: now.minute,
533
+ second: now.second,
534
+ millisecond: now.millisecond
535
+ }));
536
+ }
537
+ onSecondChange(second) {
538
+ if (this.effectiveDisabled() || this.readonly()) return;
539
+ this.navigateTo(this.navigatedDate().set({ second }));
540
+ }
541
+ onSetTimeClick() {
542
+ if (this.effectiveDisabled() || this.readonly()) return;
543
+ this.updateValue(this.clampToRange(this.navigatedDate()).toJSDate());
544
+ }
545
+ clampToRange(date) {
546
+ const day = {
547
+ year: date.year,
548
+ month: date.month,
549
+ day: date.day
550
+ };
551
+ const min = this.minDate()?.set(day);
552
+ const max = this.maxDate()?.set(day);
553
+ const timeOf = (bound) => ({
554
+ hour: bound.hour,
555
+ minute: bound.minute,
556
+ second: bound.second,
557
+ millisecond: bound.millisecond
558
+ });
559
+ if (min && date < min) return date.set(timeOf(min));
560
+ if (max && date > max) return date.set(timeOf(max));
561
+ return date;
562
+ }
563
+ dateValuesEqual(date1, date2) {
564
+ return date1?.getTime() === date2?.getTime();
565
+ }
566
+ focusList(listType, options) {
567
+ this.getListRef(listType)?.nativeElement.focus(options);
568
+ }
569
+ getListRef(listType) {
570
+ switch (listType) {
571
+ case "hours": return this.hourListRef();
572
+ case "minutes": return this.minuteListRef();
573
+ case "seconds": return this.secondListRef();
574
+ case "meridiem": return this.meridiemListRef();
575
+ }
576
+ }
577
+ getNextList(current, direction) {
578
+ const lists = ["hours", "minutes"];
579
+ if (this.showSeconds()) lists.push("seconds");
580
+ if (this.effectiveHourFormat() === "12") lists.push("meridiem");
581
+ const currentIndex = lists.indexOf(current);
582
+ if ((this.isRtl() ? direction === "left" ? "right" : "left" : direction) === "right") return lists[(currentIndex + 1) % lists.length];
583
+ else return lists[(currentIndex - 1 + lists.length) % lists.length];
584
+ }
585
+ getOptions(listType) {
586
+ const options = listType === "hours" ? this.hourOptions : listType === "minutes" ? this.minuteOptions : this.secondOptions;
587
+ return Array.from(options());
588
+ }
589
+ handleKeydown(event) {
590
+ if (this.effectiveDisabled() || this.readonly()) return;
591
+ const preventableEvent = new PreventableEvent("calendarKeydown", event);
592
+ this.#timeSelectorService?.keydown$.next(preventableEvent);
593
+ if (preventableEvent.isDefaultPrevented()) return;
594
+ if (event.target.closest("button")) return;
595
+ const focusedList = this.focusedList();
596
+ switch (event.key) {
597
+ case "ArrowUp":
598
+ event.preventDefault();
599
+ this.navigateItem(focusedList, -1);
600
+ break;
601
+ case "ArrowDown":
602
+ event.preventDefault();
603
+ this.navigateItem(focusedList, 1);
604
+ break;
605
+ case "ArrowLeft":
606
+ if (event.altKey) return;
607
+ event.preventDefault();
608
+ this.focusedList.set(this.getNextList(focusedList, "left"));
609
+ this.focusList(this.focusedList());
610
+ break;
611
+ case "ArrowRight":
612
+ if (event.altKey) return;
613
+ event.preventDefault();
614
+ this.focusedList.set(this.getNextList(focusedList, "right"));
615
+ this.focusList(this.focusedList());
616
+ break;
617
+ case "Home":
618
+ event.preventDefault();
619
+ this.navigateToEdge(focusedList, "first");
620
+ break;
621
+ case "End":
622
+ event.preventDefault();
623
+ this.navigateToEdge(focusedList, "last");
624
+ break;
625
+ case "Enter":
626
+ case " ":
627
+ event.preventDefault();
628
+ this.updateValue(this.clampToRange(this.navigatedDate()).toJSDate());
629
+ }
630
+ }
631
+ initializeNavigatedDate(date) {
632
+ const min = this.min();
633
+ const max = this.max();
634
+ const locale = this.#i18n.localeId();
635
+ if (!date) this.navigatedDate.set(DateTime.now().setLocale(locale));
636
+ else if (min && date < min) {
637
+ const minDate = DateTime.fromJSDate(min).setLocale(locale);
638
+ if (minDate.isValid) this.navigatedDate.set(minDate);
639
+ } else if (max && date > max) {
640
+ const maxDate = DateTime.fromJSDate(max).setLocale(locale);
641
+ if (maxDate.isValid) this.navigatedDate.set(maxDate);
642
+ } else {
643
+ const dateToSet = DateTime.fromJSDate(date).setLocale(locale);
644
+ if (dateToSet.isValid) this.navigatedDate.set(dateToSet);
645
+ }
646
+ }
647
+ limit(values, type) {
648
+ return TIME_LIMITER.transform(values, type, this.navigatedDate(), this.minDate(), this.maxDate());
649
+ }
650
+ navigateItem(listType, direction) {
651
+ if (listType === "meridiem") {
652
+ const target = this.meridiem() === "AM" ? "PM" : "AM";
653
+ if (target === "AM" ? this.amMeridiemVisible() : this.pmMeridiemVisible()) this.onMeridiemClick(target);
654
+ return;
655
+ }
656
+ const options = this.getOptions(listType);
657
+ if (options.length === 0) return;
658
+ const current = listType === "hours" ? this.navigatedDate().hour : listType === "minutes" ? this.minute() : this.second();
659
+ const index = options.findIndex((option) => option.value === current);
660
+ let target;
661
+ if (index >= 0) target = options[Math.max(0, Math.min(options.length - 1, index + direction))];
662
+ else target = direction > 0 ? options.find((option) => option.value > current) ?? options[options.length - 1] : [...options].reverse().find((option) => option.value < current) ?? options[0];
663
+ this.setUnit(listType, target.value);
664
+ }
665
+ navigateTo(date) {
666
+ const clamped = this.clampToRange(date);
667
+ this.navigatedDate.set(clamped);
668
+ this.meridiem.set(clamped.hour >= 12 ? "PM" : "AM");
669
+ if (!this.footer()) this.updateValue(clamped.toJSDate());
670
+ }
671
+ navigateToEdge(listType, edge) {
672
+ if (listType === "meridiem") {
673
+ this.onMeridiemClick(edge === "first" ? "AM" : "PM");
674
+ return;
675
+ }
676
+ const options = this.getOptions(listType);
677
+ const target = edge === "first" ? options[0] : options[options.length - 1];
678
+ if (target) this.setUnit(listType, target.value);
679
+ }
680
+ setDateValues(value = this.value()) {
681
+ const currentDate = this.navigatedDate().toJSDate();
682
+ if (!this.dateValuesEqual(currentDate, value)) this.initializeNavigatedDate(value);
683
+ const meridiem = this.navigatedDate().hour >= 12 ? "PM" : "AM";
684
+ this.meridiem.set(meridiem);
685
+ }
686
+ setUnit(listType, value) {
687
+ switch (listType) {
688
+ case "hours":
689
+ this.onHourChange(value);
690
+ break;
691
+ case "minutes":
692
+ this.onMinuteChange(value);
693
+ break;
694
+ case "seconds": this.onSecondChange(value);
695
+ }
696
+ }
697
+ setupKeyboardNavigation() {
698
+ fromEvent(this.#hostElementRef.nativeElement, "keydown").pipe(takeUntilDestroyed(this.#destroyRef), filter(() => !this.effectiveDisabled())).subscribe((event) => this.handleKeydown(event));
699
+ }
700
+ updateValue(date) {
701
+ if (this.dateValuesEqual(this.value(), date)) return;
702
+ this.value.set(date);
703
+ }
704
+ static {
705
+ this.ɵfac = i0.ɵɵngDeclareFactory({
706
+ minVersion: "12.0.0",
707
+ version: "22.2.6",
708
+ ngImport: i0,
709
+ type: TimeSelectorComponent,
710
+ deps: [],
711
+ target: i0.ɵɵFactoryTarget.Component
712
+ });
713
+ }
714
+ static {
715
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
716
+ minVersion: "17.0.0",
717
+ version: "22.2.6",
718
+ type: TimeSelectorComponent,
719
+ isStandalone: true,
720
+ selector: "mona-time-selector",
721
+ inputs: {
722
+ ariaLabel: {
723
+ classPropertyName: "ariaLabel",
724
+ publicName: "aria-label",
725
+ isSignal: true,
726
+ isRequired: false,
727
+ transformFunction: null
728
+ },
729
+ disabled: {
730
+ classPropertyName: "disabled",
731
+ publicName: "disabled",
732
+ isSignal: true,
733
+ isRequired: false,
734
+ transformFunction: null
735
+ },
736
+ focusOnMount: {
737
+ classPropertyName: "focusOnMount",
738
+ publicName: "focusOnMount",
739
+ isSignal: true,
740
+ isRequired: false,
741
+ transformFunction: null
742
+ },
743
+ footer: {
744
+ classPropertyName: "footer",
745
+ publicName: "footer",
746
+ isSignal: true,
747
+ isRequired: false,
748
+ transformFunction: null
749
+ },
750
+ hourFormat: {
751
+ classPropertyName: "hourFormat",
752
+ publicName: "hourFormat",
753
+ isSignal: true,
754
+ isRequired: false,
755
+ transformFunction: null
756
+ },
757
+ hourStep: {
758
+ classPropertyName: "hourStep",
759
+ publicName: "hourStep",
760
+ isSignal: true,
761
+ isRequired: false,
762
+ transformFunction: null
763
+ },
764
+ invalid: {
765
+ classPropertyName: "invalid",
766
+ publicName: "invalid",
767
+ isSignal: true,
768
+ isRequired: false,
769
+ transformFunction: null
770
+ },
771
+ max: {
772
+ classPropertyName: "max",
773
+ publicName: "max",
774
+ isSignal: true,
775
+ isRequired: false,
776
+ transformFunction: null
777
+ },
778
+ min: {
779
+ classPropertyName: "min",
780
+ publicName: "min",
781
+ isSignal: true,
782
+ isRequired: false,
783
+ transformFunction: null
784
+ },
785
+ minuteStep: {
786
+ classPropertyName: "minuteStep",
787
+ publicName: "minuteStep",
788
+ isSignal: true,
789
+ isRequired: false,
790
+ transformFunction: null
791
+ },
792
+ readonly: {
793
+ classPropertyName: "readonly",
794
+ publicName: "readonly",
795
+ isSignal: true,
796
+ isRequired: false,
797
+ transformFunction: null
798
+ },
799
+ required: {
800
+ classPropertyName: "required",
801
+ publicName: "required",
802
+ isSignal: true,
803
+ isRequired: false,
804
+ transformFunction: null
805
+ },
806
+ rounded: {
807
+ classPropertyName: "rounded",
808
+ publicName: "rounded",
809
+ isSignal: true,
810
+ isRequired: false,
811
+ transformFunction: null
812
+ },
813
+ secondStep: {
814
+ classPropertyName: "secondStep",
815
+ publicName: "secondStep",
816
+ isSignal: true,
817
+ isRequired: false,
818
+ transformFunction: null
819
+ },
820
+ showSeconds: {
821
+ classPropertyName: "showSeconds",
822
+ publicName: "showSeconds",
823
+ isSignal: true,
824
+ isRequired: false,
825
+ transformFunction: null
826
+ },
827
+ size: {
828
+ classPropertyName: "size",
829
+ publicName: "size",
830
+ isSignal: true,
831
+ isRequired: false,
832
+ transformFunction: null
833
+ },
834
+ touched: {
835
+ classPropertyName: "touched",
836
+ publicName: "touched",
837
+ isSignal: true,
838
+ isRequired: false,
839
+ transformFunction: null
840
+ },
841
+ value: {
842
+ classPropertyName: "value",
843
+ publicName: "value",
844
+ isSignal: true,
845
+ isRequired: false,
846
+ transformFunction: null
847
+ }
848
+ },
849
+ outputs: {
850
+ touch: "touch",
851
+ value: "valueChange"
852
+ },
853
+ host: {
854
+ attributes: { "role": "group" },
855
+ listeners: { "focusout": "onFocusOut($event)" },
856
+ properties: {
857
+ "attr.aria-label": "ariaLabel() || messages().timeSelector",
858
+ "attr.aria-disabled": "effectiveDisabled() || null",
859
+ "attr.aria-invalid": "invalidState() ? 'true' : null",
860
+ "attr.data-invalid": "invalidState() || null",
861
+ "attr.data-readonly": "readonly() || null",
862
+ "attr.data-required": "required() || null",
863
+ "class": "baseClass()"
864
+ }
865
+ },
866
+ viewQueries: [
867
+ {
868
+ propertyName: "hourListRef",
869
+ first: true,
870
+ predicate: ["hourList"],
871
+ descendants: true,
872
+ isSignal: true
873
+ },
874
+ {
875
+ propertyName: "meridiemListRef",
876
+ first: true,
877
+ predicate: ["meridiemList"],
878
+ descendants: true,
879
+ isSignal: true
880
+ },
881
+ {
882
+ propertyName: "minuteListRef",
883
+ first: true,
884
+ predicate: ["minuteList"],
885
+ descendants: true,
886
+ isSignal: true
887
+ },
888
+ {
889
+ propertyName: "secondListRef",
890
+ first: true,
891
+ predicate: ["secondList"],
892
+ descendants: true,
893
+ isSignal: true
894
+ }
895
+ ],
896
+ ngImport: i0,
897
+ template: "<div [class]=\"headerClass()\">\n <div>{{ messages().headerHours }}</div>\n <div>{{ messages().headerMinutes }}</div>\n @if (showSeconds()) {\n <div>{{ messages().headerSeconds }}</div>\n }\n</div>\n\n<div [class]=\"infoContainerClass()\">\n <span>{{ navigatedDateText() }}</span>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n (click)=\"onNowClick()\">\n {{ messages().now }}\n </button>\n</div>\n\n<div [class]=\"listContainerClass()\">\n <ol\n #hourList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().hours\"\n [attr.aria-activedescendant]=\"activeOptionId(hourListId, hourOptions(), navigatedDate().hour)\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'hours'\"\n [id]=\"hourListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (h of hourOptions(); track h.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"h.viewValue === hour()\"\n [value]=\"h.value\"\n [id]=\"`${hourListId}${h.value}`\"\n (click)=\"onHourChange(h.value)\">\n {{ formatTwoDigit(h.viewValue) }}\n </li>\n }\n </ol>\n <ol\n #minuteList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().minutes\"\n [attr.aria-activedescendant]=\"activeOptionId(minuteListId, minuteOptions(), minute())\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'minutes'\"\n [id]=\"minuteListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (m of minuteOptions(); track m.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"m.value === minute()\"\n [value]=\"m.value\"\n [id]=\"`${minuteListId}${m.value}`\"\n (click)=\"onMinuteChange(m.value)\">\n {{ formatTwoDigit(m.viewValue) }}\n </li>\n }\n </ol>\n @if (showSeconds()) {\n <ol\n #secondList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().seconds\"\n [attr.aria-activedescendant]=\"activeOptionId(secondListId, secondOptions(), second())\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'seconds'\"\n [id]=\"secondListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (s of secondOptions(); track s.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"s.value === second()\"\n [value]=\"s.value\"\n [id]=\"`${secondListId}${s.value}`\"\n (click)=\"onSecondChange(s.value)\">\n {{ formatTwoDigit(s.value) }}\n </li>\n }\n </ol>\n }\n @if (effectiveHourFormat() === \"12\") {\n <ol\n #meridiemList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().amPm\"\n [attr.aria-activedescendant]=\"`${meridiemListId}${meridiem()}`\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'meridiem'\"\n [id]=\"meridiemListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @if (amMeridiemVisible()) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"meridiem() === 'AM'\"\n [value]=\"'AM'\"\n (click)=\"onMeridiemClick('AM')\"\n [id]=\"`${meridiemListId}AM`\">\n {{ messages().am }}\n </li>\n }\n @if (pmMeridiemVisible()) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"meridiem() === 'PM'\"\n [value]=\"'PM'\"\n (click)=\"onMeridiemClick('PM')\"\n [id]=\"`${meridiemListId}PM`\">\n {{ messages().pm }}\n </li>\n }\n </ol>\n }\n</div>\n\n@if (footer()) {\n <div [class]=\"footerClass()\">\n <button monaButton look=\"primary\" [rounded]=\"rounded()\" [size]=\"size()\" (click)=\"onSetTimeClick()\">\n {{ messages().set }}\n </button>\n </div>\n}\n",
898
+ dependencies: [
899
+ {
900
+ kind: "directive",
901
+ type: TimeSelectorItemDirective,
902
+ selector: "li[monaTimeSelectorItem]",
903
+ inputs: [
904
+ "selected",
905
+ "size",
906
+ "value"
907
+ ]
908
+ },
909
+ {
910
+ kind: "directive",
911
+ type: ButtonDirective,
912
+ selector: "button[monaButton]",
913
+ inputs: [
914
+ "aria-haspopup",
915
+ "disabled",
916
+ "iconOnly",
917
+ "loading",
918
+ "look",
919
+ "rounded",
920
+ "selected",
921
+ "size",
922
+ "tabindex",
923
+ "toggleable",
924
+ "type",
925
+ "class",
926
+ "value"
927
+ ],
928
+ outputs: ["lookChange", "selectedChange"]
929
+ },
930
+ {
931
+ kind: "directive",
932
+ type: TimeSelectorListDirective,
933
+ selector: "ol[monaTimeSelectorList]",
934
+ inputs: [
935
+ "active",
936
+ "popupHeight",
937
+ "size"
938
+ ]
939
+ }
940
+ ]
941
+ });
942
+ }
943
+ };
944
+ i0.ɵɵngDeclareClassMetadata({
945
+ minVersion: "12.0.0",
946
+ version: "22.2.6",
947
+ ngImport: i0,
948
+ type: TimeSelectorComponent,
949
+ decorators: [{
950
+ type: Component,
951
+ args: [{
952
+ selector: "mona-time-selector",
953
+ imports: [
954
+ TimeSelectorItemDirective,
955
+ ButtonDirective,
956
+ TimeSelectorListDirective
957
+ ],
958
+ host: {
959
+ role: "group",
960
+ "[attr.aria-label]": "ariaLabel() || messages().timeSelector",
961
+ "[attr.aria-disabled]": "effectiveDisabled() || null",
962
+ "[attr.aria-invalid]": "invalidState() ? 'true' : null",
963
+ "[attr.data-invalid]": "invalidState() || null",
964
+ "[attr.data-readonly]": "readonly() || null",
965
+ "[attr.data-required]": "required() || null",
966
+ "[class]": "baseClass()",
967
+ "(focusout)": "onFocusOut($event)"
968
+ },
969
+ template: "<div [class]=\"headerClass()\">\n <div>{{ messages().headerHours }}</div>\n <div>{{ messages().headerMinutes }}</div>\n @if (showSeconds()) {\n <div>{{ messages().headerSeconds }}</div>\n }\n</div>\n\n<div [class]=\"infoContainerClass()\">\n <span>{{ navigatedDateText() }}</span>\n <button\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"'small'\"\n (click)=\"onNowClick()\">\n {{ messages().now }}\n </button>\n</div>\n\n<div [class]=\"listContainerClass()\">\n <ol\n #hourList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().hours\"\n [attr.aria-activedescendant]=\"activeOptionId(hourListId, hourOptions(), navigatedDate().hour)\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'hours'\"\n [id]=\"hourListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (h of hourOptions(); track h.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"h.viewValue === hour()\"\n [value]=\"h.value\"\n [id]=\"`${hourListId}${h.value}`\"\n (click)=\"onHourChange(h.value)\">\n {{ formatTwoDigit(h.viewValue) }}\n </li>\n }\n </ol>\n <ol\n #minuteList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().minutes\"\n [attr.aria-activedescendant]=\"activeOptionId(minuteListId, minuteOptions(), minute())\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'minutes'\"\n [id]=\"minuteListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (m of minuteOptions(); track m.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"m.value === minute()\"\n [value]=\"m.value\"\n [id]=\"`${minuteListId}${m.value}`\"\n (click)=\"onMinuteChange(m.value)\">\n {{ formatTwoDigit(m.viewValue) }}\n </li>\n }\n </ol>\n @if (showSeconds()) {\n <ol\n #secondList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().seconds\"\n [attr.aria-activedescendant]=\"activeOptionId(secondListId, secondOptions(), second())\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'seconds'\"\n [id]=\"secondListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @for (s of secondOptions(); track s.value) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"s.value === second()\"\n [value]=\"s.value\"\n [id]=\"`${secondListId}${s.value}`\"\n (click)=\"onSecondChange(s.value)\">\n {{ formatTwoDigit(s.value) }}\n </li>\n }\n </ol>\n }\n @if (effectiveHourFormat() === \"12\") {\n <ol\n #meridiemList\n monaTimeSelectorList\n [attr.aria-label]=\"messages().amPm\"\n [attr.aria-activedescendant]=\"`${meridiemListId}${meridiem()}`\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-required]=\"required() || null\"\n [active]=\"focusedList() === 'meridiem'\"\n [id]=\"meridiemListId\"\n [popupHeight]=\"computedPopupHeight()\"\n [size]=\"size()\">\n @if (amMeridiemVisible()) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"meridiem() === 'AM'\"\n [value]=\"'AM'\"\n (click)=\"onMeridiemClick('AM')\"\n [id]=\"`${meridiemListId}AM`\">\n {{ messages().am }}\n </li>\n }\n @if (pmMeridiemVisible()) {\n <li\n monaTimeSelectorItem\n [size]=\"size()\"\n [selected]=\"meridiem() === 'PM'\"\n [value]=\"'PM'\"\n (click)=\"onMeridiemClick('PM')\"\n [id]=\"`${meridiemListId}PM`\">\n {{ messages().pm }}\n </li>\n }\n </ol>\n }\n</div>\n\n@if (footer()) {\n <div [class]=\"footerClass()\">\n <button monaButton look=\"primary\" [rounded]=\"rounded()\" [size]=\"size()\" (click)=\"onSetTimeClick()\">\n {{ messages().set }}\n </button>\n </div>\n}\n"
970
+ }]
971
+ }],
972
+ ctorParameters: () => [],
973
+ propDecorators: {
974
+ hourListRef: [{
975
+ type: i0.ViewChild,
976
+ args: ["hourList", { isSignal: true }]
977
+ }],
978
+ meridiemListRef: [{
979
+ type: i0.ViewChild,
980
+ args: ["meridiemList", { isSignal: true }]
981
+ }],
982
+ minuteListRef: [{
983
+ type: i0.ViewChild,
984
+ args: ["minuteList", { isSignal: true }]
985
+ }],
986
+ secondListRef: [{
987
+ type: i0.ViewChild,
988
+ args: ["secondList", { isSignal: true }]
989
+ }],
990
+ ariaLabel: [{
991
+ type: i0.Input,
992
+ args: [{
993
+ isSignal: true,
994
+ alias: "aria-label",
995
+ required: false
996
+ }]
997
+ }],
998
+ disabled: [{
999
+ type: i0.Input,
1000
+ args: [{
1001
+ isSignal: true,
1002
+ alias: "disabled",
1003
+ required: false
1004
+ }]
1005
+ }],
1006
+ focusOnMount: [{
1007
+ type: i0.Input,
1008
+ args: [{
1009
+ isSignal: true,
1010
+ alias: "focusOnMount",
1011
+ required: false
1012
+ }]
1013
+ }],
1014
+ footer: [{
1015
+ type: i0.Input,
1016
+ args: [{
1017
+ isSignal: true,
1018
+ alias: "footer",
1019
+ required: false
1020
+ }]
1021
+ }],
1022
+ hourFormat: [{
1023
+ type: i0.Input,
1024
+ args: [{
1025
+ isSignal: true,
1026
+ alias: "hourFormat",
1027
+ required: false
1028
+ }]
1029
+ }],
1030
+ hourStep: [{
1031
+ type: i0.Input,
1032
+ args: [{
1033
+ isSignal: true,
1034
+ alias: "hourStep",
1035
+ required: false
1036
+ }]
1037
+ }],
1038
+ invalid: [{
1039
+ type: i0.Input,
1040
+ args: [{
1041
+ isSignal: true,
1042
+ alias: "invalid",
1043
+ required: false
1044
+ }]
1045
+ }],
1046
+ max: [{
1047
+ type: i0.Input,
1048
+ args: [{
1049
+ isSignal: true,
1050
+ alias: "max",
1051
+ required: false
1052
+ }]
1053
+ }],
1054
+ min: [{
1055
+ type: i0.Input,
1056
+ args: [{
1057
+ isSignal: true,
1058
+ alias: "min",
1059
+ required: false
1060
+ }]
1061
+ }],
1062
+ minuteStep: [{
1063
+ type: i0.Input,
1064
+ args: [{
1065
+ isSignal: true,
1066
+ alias: "minuteStep",
1067
+ required: false
1068
+ }]
1069
+ }],
1070
+ readonly: [{
1071
+ type: i0.Input,
1072
+ args: [{
1073
+ isSignal: true,
1074
+ alias: "readonly",
1075
+ required: false
1076
+ }]
1077
+ }],
1078
+ required: [{
1079
+ type: i0.Input,
1080
+ args: [{
1081
+ isSignal: true,
1082
+ alias: "required",
1083
+ required: false
1084
+ }]
1085
+ }],
1086
+ rounded: [{
1087
+ type: i0.Input,
1088
+ args: [{
1089
+ isSignal: true,
1090
+ alias: "rounded",
1091
+ required: false
1092
+ }]
1093
+ }],
1094
+ secondStep: [{
1095
+ type: i0.Input,
1096
+ args: [{
1097
+ isSignal: true,
1098
+ alias: "secondStep",
1099
+ required: false
1100
+ }]
1101
+ }],
1102
+ showSeconds: [{
1103
+ type: i0.Input,
1104
+ args: [{
1105
+ isSignal: true,
1106
+ alias: "showSeconds",
1107
+ required: false
1108
+ }]
1109
+ }],
1110
+ size: [{
1111
+ type: i0.Input,
1112
+ args: [{
1113
+ isSignal: true,
1114
+ alias: "size",
1115
+ required: false
1116
+ }]
1117
+ }],
1118
+ touch: [{
1119
+ type: i0.Output,
1120
+ args: ["touch"]
1121
+ }],
1122
+ touched: [{
1123
+ type: i0.Input,
1124
+ args: [{
1125
+ isSignal: true,
1126
+ alias: "touched",
1127
+ required: false
1128
+ }]
1129
+ }],
1130
+ value: [{
1131
+ type: i0.Input,
1132
+ args: [{
1133
+ isSignal: true,
1134
+ alias: "value",
1135
+ required: false
1136
+ }]
1137
+ }, {
1138
+ type: i0.Output,
1139
+ args: ["valueChange"]
1140
+ }]
1141
+ }
1142
+ });
747
1143
  export { TIME_SELECTOR_DEFAULT_MESSAGES, TimeSelectorComponent };
748
- //# sourceMappingURL=nanahoshi-mona-ui-time-selector.mjs.map
1144
+
1145
+ //# sourceMappingURL=nanahoshi-mona-ui-time-selector.mjs.map