@vonage/vivid 4.4.0 → 4.6.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 (235) hide show
  1. package/custom-elements.json +7181 -6876
  2. package/elevation/index.cjs +1 -1
  3. package/elevation/index.js +1 -1
  4. package/index.cjs +80 -74
  5. package/index.js +23 -22
  6. package/lib/components.d.ts +1 -0
  7. package/lib/fab/fab.d.ts +1 -1
  8. package/lib/icon/icon.d.ts +1 -1
  9. package/lib/menu/menu.d.ts +2 -1
  10. package/lib/number-field/number-field.d.ts +3 -1
  11. package/lib/searchable-select/definition.d.ts +4 -0
  12. package/lib/searchable-select/locale.d.ts +6 -0
  13. package/lib/searchable-select/option-tag.d.ts +14 -0
  14. package/lib/searchable-select/option-tag.template.d.ts +4 -0
  15. package/lib/searchable-select/searchable-select.d.ts +29 -0
  16. package/lib/searchable-select/searchable-select.form-associated.d.ts +10 -0
  17. package/lib/searchable-select/searchable-select.template.d.ts +4 -0
  18. package/lib/select/select.d.ts +4 -1
  19. package/lib/tab/locale.d.ts +3 -0
  20. package/lib/tab/tab.d.ts +5 -1
  21. package/lib/tabs/tabs.d.ts +2 -0
  22. package/lib/tag/definition.d.ts +1 -0
  23. package/lib/text-field/text-field.d.ts +3 -1
  24. package/lib/video-player/video-player.d.ts +0 -1
  25. package/listbox/index.cjs +1 -1
  26. package/listbox/index.js +1 -1
  27. package/locales/de-DE.cjs +12 -0
  28. package/locales/de-DE.js +12 -0
  29. package/locales/en-GB.cjs +12 -0
  30. package/locales/en-GB.js +12 -0
  31. package/locales/en-US.cjs +12 -0
  32. package/locales/en-US.js +12 -0
  33. package/locales/ja-JP.cjs +12 -0
  34. package/locales/ja-JP.js +12 -0
  35. package/locales/zh-CN.cjs +12 -0
  36. package/locales/zh-CN.js +12 -0
  37. package/package.json +6 -1
  38. package/popup/index.cjs +1 -1
  39. package/popup/index.js +1 -1
  40. package/searchable-select/index.cjs +5 -0
  41. package/searchable-select/index.js +3 -0
  42. package/select/index.cjs +1 -1
  43. package/select/index.js +1 -1
  44. package/selectable-box/index.cjs +1 -1
  45. package/selectable-box/index.js +1 -1
  46. package/shared/anchored.js +1 -1
  47. package/shared/calendar-event.js +1 -1
  48. package/shared/definition.cjs +2 -2
  49. package/shared/definition.js +2 -2
  50. package/shared/definition11.cjs +1 -1
  51. package/shared/definition11.js +1 -1
  52. package/shared/definition12.cjs +1 -1
  53. package/shared/definition12.js +1 -1
  54. package/shared/definition13.js +1 -1
  55. package/shared/definition14.cjs +1 -1
  56. package/shared/definition14.js +1 -1
  57. package/shared/definition15.cjs +7 -8
  58. package/shared/definition15.js +2 -3
  59. package/shared/definition16.cjs +11 -7
  60. package/shared/definition16.js +10 -6
  61. package/shared/definition17.cjs +2 -2
  62. package/shared/definition17.js +2 -2
  63. package/shared/definition18.cjs +5 -6
  64. package/shared/definition18.js +3 -4
  65. package/shared/definition19.cjs +5 -6
  66. package/shared/definition19.js +3 -4
  67. package/shared/definition20.cjs +16 -38
  68. package/shared/definition20.js +17 -39
  69. package/shared/definition21.cjs +7 -6
  70. package/shared/definition21.js +8 -7
  71. package/shared/definition23.cjs +1 -1
  72. package/shared/definition23.js +2 -2
  73. package/shared/definition24.cjs +2 -2
  74. package/shared/definition24.js +2 -2
  75. package/shared/definition25.cjs +6 -7
  76. package/shared/definition25.js +2 -3
  77. package/shared/definition26.cjs +1 -1
  78. package/shared/definition26.js +2 -2
  79. package/shared/definition27.cjs +1 -1
  80. package/shared/definition27.js +1 -1
  81. package/shared/definition28.js +1 -1
  82. package/shared/definition29.cjs +8 -4
  83. package/shared/definition29.js +8 -4
  84. package/shared/definition3.cjs +1 -1
  85. package/shared/definition3.js +2 -2
  86. package/shared/definition30.cjs +4 -2
  87. package/shared/definition30.js +4 -2
  88. package/shared/definition31.cjs +1 -1
  89. package/shared/definition31.js +2 -2
  90. package/shared/definition32.cjs +1 -1
  91. package/shared/definition32.js +1 -1
  92. package/shared/definition34.cjs +2 -3
  93. package/shared/definition34.js +2 -3
  94. package/shared/definition35.cjs +21 -16
  95. package/shared/definition35.js +16 -11
  96. package/shared/definition36.cjs +50 -207
  97. package/shared/definition36.js +51 -207
  98. package/shared/definition37.js +1 -1
  99. package/shared/definition38.cjs +1 -1
  100. package/shared/definition38.js +1 -1
  101. package/shared/definition4.cjs +6 -4
  102. package/shared/definition4.js +7 -5
  103. package/shared/definition41.cjs +1 -1
  104. package/shared/definition41.js +1 -1
  105. package/shared/definition42.cjs +6 -7
  106. package/shared/definition42.js +6 -7
  107. package/shared/definition43.cjs +998 -643
  108. package/shared/definition43.js +992 -638
  109. package/shared/definition44.cjs +723 -112
  110. package/shared/definition44.js +722 -111
  111. package/shared/definition45.cjs +121 -79
  112. package/shared/definition45.js +120 -78
  113. package/shared/definition46.cjs +81 -616
  114. package/shared/definition46.js +80 -614
  115. package/shared/definition47.cjs +609 -116
  116. package/shared/definition47.js +607 -115
  117. package/shared/definition48.cjs +116 -134
  118. package/shared/definition48.js +115 -133
  119. package/shared/definition49.cjs +149 -19
  120. package/shared/definition49.js +148 -18
  121. package/shared/definition5.cjs +5 -6
  122. package/shared/definition5.js +5 -6
  123. package/shared/definition50.cjs +21 -82
  124. package/shared/definition50.js +20 -81
  125. package/shared/definition51.cjs +78 -494
  126. package/shared/definition51.js +77 -493
  127. package/shared/definition52.cjs +568 -28
  128. package/shared/definition52.js +567 -27
  129. package/shared/definition53.cjs +28 -123
  130. package/shared/definition53.js +27 -123
  131. package/shared/definition54.cjs +115 -296
  132. package/shared/definition54.js +114 -295
  133. package/shared/definition55.cjs +258 -318
  134. package/shared/definition55.js +252 -312
  135. package/shared/definition56.cjs +303 -784
  136. package/shared/definition56.js +298 -779
  137. package/shared/definition57.cjs +802 -95
  138. package/shared/definition57.js +801 -94
  139. package/shared/definition58.cjs +95 -60
  140. package/shared/definition58.js +94 -59
  141. package/shared/definition59.cjs +117 -75
  142. package/shared/definition59.js +116 -74
  143. package/shared/definition6.cjs +1 -1
  144. package/shared/definition6.js +1 -1
  145. package/shared/definition60.cjs +70 -285
  146. package/shared/definition60.js +71 -286
  147. package/shared/definition61.cjs +296 -325
  148. package/shared/definition61.js +295 -324
  149. package/shared/definition62.cjs +66160 -27
  150. package/shared/definition62.js +66159 -26
  151. package/shared/definition63.cjs +24 -1952
  152. package/shared/definition63.js +23 -1950
  153. package/shared/definition64.cjs +1976 -0
  154. package/shared/definition64.js +1971 -0
  155. package/shared/definition7.cjs +1 -1
  156. package/shared/definition7.js +1 -1
  157. package/shared/definition8.cjs +2 -3
  158. package/shared/definition8.js +3 -4
  159. package/shared/definition9.cjs +1 -1
  160. package/shared/definition9.js +1 -1
  161. package/shared/dialog/index.d.ts +1 -0
  162. package/shared/form-elements.cjs +236 -0
  163. package/shared/form-elements.js +229 -0
  164. package/shared/icon.js +1 -1
  165. package/shared/index2.cjs +6 -256
  166. package/shared/index2.js +6 -249
  167. package/shared/listbox-option.cjs +204 -0
  168. package/shared/listbox-option.js +201 -0
  169. package/shared/listbox.cjs +3 -3
  170. package/shared/listbox.js +1 -1
  171. package/shared/localization/Locale.d.ts +4 -0
  172. package/shared/localized.cjs +26 -2
  173. package/shared/localized.js +25 -2
  174. package/shared/playbackRates.cjs +13 -0
  175. package/shared/playbackRates.js +11 -0
  176. package/shared/presentationDate.cjs +11 -11
  177. package/shared/presentationDate.js +11 -11
  178. package/shared/scrollIntoView.cjs +51 -0
  179. package/shared/scrollIntoView.js +49 -0
  180. package/shared/slider.template.cjs +1 -1
  181. package/shared/slider.template.js +1 -1
  182. package/shared/text-anchor.cjs +1 -1
  183. package/shared/text-anchor.js +1 -1
  184. package/shared/text-field.cjs +1 -1
  185. package/shared/text-field.js +1 -1
  186. package/shared/utils/playbackRates.d.ts +1 -0
  187. package/shared/utils/scrollIntoView.d.ts +1 -0
  188. package/side-drawer/index.cjs +1 -1
  189. package/side-drawer/index.js +1 -1
  190. package/slider/index.cjs +1 -1
  191. package/slider/index.js +1 -1
  192. package/split-button/index.cjs +1 -1
  193. package/split-button/index.js +1 -1
  194. package/styles/core/all.css +1 -1
  195. package/styles/core/theme.css +1 -1
  196. package/styles/core/typography.css +1 -1
  197. package/styles/tokens/theme-dark.css +4 -4
  198. package/styles/tokens/theme-light.css +4 -4
  199. package/styles/tokens/vivid-2-compat.css +1 -1
  200. package/switch/index.cjs +1 -1
  201. package/switch/index.js +1 -1
  202. package/tab/index.cjs +1 -1
  203. package/tab/index.js +1 -1
  204. package/tab-panel/index.cjs +1 -1
  205. package/tab-panel/index.js +1 -1
  206. package/tabs/index.cjs +1 -1
  207. package/tabs/index.js +1 -1
  208. package/tag/index.cjs +1 -1
  209. package/tag/index.js +1 -1
  210. package/tag-group/index.cjs +1 -1
  211. package/tag-group/index.js +1 -1
  212. package/text-area/index.cjs +1 -1
  213. package/text-area/index.js +1 -1
  214. package/text-field/index.cjs +1 -1
  215. package/text-field/index.js +1 -1
  216. package/time-picker/index.cjs +1 -1
  217. package/time-picker/index.js +1 -1
  218. package/toggletip/index.cjs +1 -1
  219. package/toggletip/index.js +1 -1
  220. package/tooltip/index.cjs +1 -1
  221. package/tooltip/index.js +1 -1
  222. package/tree-item/index.cjs +1 -1
  223. package/tree-item/index.js +1 -1
  224. package/tree-view/index.cjs +1 -1
  225. package/tree-view/index.js +1 -1
  226. package/video-player/index.cjs +1 -1
  227. package/video-player/index.js +1 -1
  228. package/vivid.api.json +312 -8
  229. package/appearance-ui/index.cjs +0 -102
  230. package/appearance-ui/index.js +0 -100
  231. package/lib/appearance-ui/appearance-ui.d.ts +0 -12
  232. package/lib/appearance-ui/appearance-ui.template.d.ts +0 -4
  233. package/lib/appearance-ui/definition.d.ts +0 -3
  234. package/shared/video-player.cjs +0 -65860
  235. package/shared/video-player.js +0 -65857
@@ -1,10 +1,219 @@
1
- import { a as attr, F as FoundationElement, D as DOM, h as html, r as registerFactory } from './index.js';
2
- import { P as Popup, p as popupRegistries } from './definition63.js';
3
- import { b as anchored, a as anchorSlotTemplateFactory } from './anchored.js';
1
+ import { F as FoundationElement, D as DOM, a as attr, n as nullableNumberConverter, o as observable, h as html, r as registerFactory } from './index.js';
2
+ import { T as TextField, a as textFieldRegistries } from './definition56.js';
3
+ import { P as Popup, p as popupRegistries } from './definition64.js';
4
+ import { B as Button, a as buttonRegistries } from './definition11.js';
5
+ import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
6
+ import { h as handleEscapeKeyAndStopPropogation } from './index2.js';
7
+ import { s as scrollIntoView } from './scrollIntoView.js';
8
+ import { F as FormAssociated } from './form-associated.js';
9
+ import { e as errorText, f as formElements, a as FormElementHelperText } from './form-elements.js';
10
+ import { T as TrappedFocus } from './trapped-focus.js';
11
+ import { L as Localized } from './localized.js';
12
+ import { r as ref } from './ref.js';
13
+ import { s as slotted } from './slotted.js';
4
14
  import { w as when } from './when.js';
15
+ import { r as repeat } from './repeat.js';
5
16
  import { c as classNames } from './class-names.js';
6
17
 
7
- const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.content-wrapper{width:var(--toggletip-inline-size, auto);padding:16px;max-inline-size:var(--toggletip-max-inline-size, 30ch)}.headline{font:var(--vvd-typography-base-bold)}.action-items{display:flex;justify-content:flex-end;gap:10px}::slotted([slot=action-items]){margin-block-start:16px}";
18
+ const styles = ":host{display:inline-block}.base,.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;border-top:1px solid var(--vvd-color-neutral-200);gap:8px}.time-pickers{display:flex;overflow:hidden;justify-content:center;padding:4px;block-size:188px;gap:4px}.time-pickers .picker{position:relative;display:flex;overflow:hidden;flex-direction:column;padding:0;border-radius:4px;margin:0;gap:4px;inline-size:50px;list-style:none;scrollbar-width:thin}.time-pickers .picker:hover{overflow-y:auto}.time-pickers .picker:after{display:block;flex-shrink:0;block-size:156px;content:\"\"}.time-pickers .picker:focus-visible{--focus-stroke-gap-color: transparent;--focus-inset: -2px;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.time-pickers .item{--_connotation-color-primary: var(--vvd-time-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-time-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-time-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-time-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-time-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-time-picker-accent-pale, var(--vvd-color-neutral-300))}.time-pickers .item{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.time-pickers .item:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.time-pickers .item:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .item:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .item:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.time-pickers .item:where(.selected):where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .item{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:28px;color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);inline-size:50px}";
19
+
20
+ class _TimePicker extends FoundationElement {
21
+ }
22
+ class FormAssociatedTimePicker extends FormAssociated(_TimePicker) {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.proxy = document.createElement("input");
26
+ }
27
+ }
28
+
29
+ const isValidTimeStr = (timeStr) => {
30
+ const parts = timeStr.split(":");
31
+ if (parts.length !== 3) {
32
+ return false;
33
+ }
34
+ const [hours, minutes, seconds] = parts;
35
+ if (hours.length !== 2 || minutes.length !== 2 || seconds.length !== 2) {
36
+ return false;
37
+ }
38
+ const hoursNum = parseInt(hours, 10);
39
+ const minutesNum = parseInt(minutes, 10);
40
+ const secondsNum = parseInt(seconds, 10);
41
+ if (isNaN(hoursNum) || isNaN(minutesNum) || isNaN(secondsNum)) {
42
+ return false;
43
+ }
44
+ if (hoursNum < 0 || hoursNum > 23) {
45
+ return false;
46
+ }
47
+ if (minutesNum < 0 || minutesNum > 59) {
48
+ return false;
49
+ }
50
+ if (secondsNum < 0 || secondsNum > 59) {
51
+ return false;
52
+ }
53
+ return true;
54
+ };
55
+ const parseTimePart = (partStr) => Number.parseInt(partStr, 10);
56
+ const formatTimePart = (part) => part.toString().padStart(2, "0");
57
+ const parseTimeStr = (timeStr) => {
58
+ const [hoursStr, minutesStr, secondsStr] = timeStr.split(":");
59
+ const hours = parseTimePart(hoursStr);
60
+ const minutes = parseTimePart(minutesStr);
61
+ const seconds = parseTimePart(secondsStr);
62
+ return {
63
+ hourStr: hoursStr,
64
+ hours,
65
+ minuteStr: minutesStr,
66
+ minutes,
67
+ secondStr: secondsStr,
68
+ seconds,
69
+ meridiem: hours < 12 ? "AM" : "PM"
70
+ };
71
+ };
72
+ const hoursAs12hClock = (hour) => hour % 12 || 12;
73
+
74
+ const formatPresentationTime = (timeStr, includeSeconds, use12HourClock) => {
75
+ const time = parseTimeStr(timeStr);
76
+ const hoursStr = formatTimePart(
77
+ use12HourClock ? hoursAs12hClock(time.hours) : time.hours
78
+ );
79
+ let result = `${hoursStr}:${time.minuteStr}`;
80
+ if (includeSeconds) {
81
+ result += `:${time.secondStr}`;
82
+ }
83
+ if (use12HourClock) {
84
+ result += ` ${time.meridiem}`;
85
+ }
86
+ return result;
87
+ };
88
+ const isDigit = (char) => char >= "0" && char <= "9";
89
+ const parsePresentationTime = (input, use12HourClock) => {
90
+ const cleanedInput = input.toLowerCase();
91
+ const numerals = [];
92
+ let meridiem;
93
+ for (let i = 0; i < cleanedInput.length; i++) {
94
+ const char = cleanedInput[i];
95
+ if (char === "a" && cleanedInput[i + 1] === "m") {
96
+ i++;
97
+ meridiem = "AM";
98
+ }
99
+ if (char === "p" && cleanedInput[i + 1] === "m") {
100
+ i++;
101
+ meridiem = "PM";
102
+ }
103
+ if (isDigit(char)) {
104
+ let numeral = char;
105
+ while (isDigit(cleanedInput[i + 1])) {
106
+ i++;
107
+ numeral += cleanedInput[i];
108
+ }
109
+ numerals.push(Number.parseInt(numeral, 10));
110
+ }
111
+ }
112
+ if (numerals.length === 0 || numerals.length > 3) {
113
+ throw new Error("Invalid time format");
114
+ }
115
+ if (meridiem && (numerals[0] < 1 || numerals[0] > 12)) {
116
+ throw new Error("Invalid time format");
117
+ }
118
+ if (meridiem || use12HourClock) {
119
+ if (numerals[0] === 12) {
120
+ numerals[0] = 0;
121
+ }
122
+ }
123
+ if (meridiem === "PM") {
124
+ numerals[0] = numerals[0] + 12;
125
+ }
126
+ const [hours, minutes = 0, seconds = 0] = numerals;
127
+ if (hours > 23 || minutes > 59 || seconds > 59) {
128
+ throw new Error("Invalid value");
129
+ }
130
+ return [hours, minutes, seconds].map(formatTimePart).join(":");
131
+ };
132
+
133
+ const fallsIntoMeridiem = (meridiem, hour) => meridiem === "AM" && hour < 12 || meridiem === "PM" && hour >= 12;
134
+ const getHoursOptions = (min, max, forMeridiem) => {
135
+ const result = [];
136
+ const minHour = min ? parseTimeStr(min).hours : 0;
137
+ const maxHour = max ? parseTimeStr(max).hours : 23;
138
+ for (let i = minHour; i <= maxHour; i++) {
139
+ if (forMeridiem && !fallsIntoMeridiem(forMeridiem, i)) {
140
+ continue;
141
+ }
142
+ result.push({
143
+ value: formatTimePart(i),
144
+ label: formatTimePart(forMeridiem ? hoursAs12hClock(i) : i)
145
+ });
146
+ }
147
+ return result;
148
+ };
149
+ const getMinutesOptions = (step, value, min, max) => {
150
+ const result = [];
151
+ let minMinute = 0;
152
+ let maxMinute = 59;
153
+ if (min) {
154
+ const { hourStr: minHourStr, minutes: minMinutes } = parseTimeStr(min);
155
+ if (value && parseTimeStr(value).hourStr === minHourStr) {
156
+ minMinute = minMinutes;
157
+ }
158
+ }
159
+ if (max) {
160
+ const { hourStr: maxHourStr, minutes: maxMinutes } = parseTimeStr(max);
161
+ if (value && parseTimeStr(value).hourStr === maxHourStr) {
162
+ maxMinute = maxMinutes;
163
+ }
164
+ }
165
+ for (let i = minMinute; i <= maxMinute; i += Math.max(1, step ?? 1)) {
166
+ const minutes = formatTimePart(i);
167
+ result.push({
168
+ value: minutes,
169
+ label: minutes
170
+ });
171
+ }
172
+ return result;
173
+ };
174
+ const getSecondsOptions = (step, value, min, max) => {
175
+ const result = [];
176
+ let minSecond = 0;
177
+ let maxSecond = 59;
178
+ if (min) {
179
+ const minTime = parseTimeStr(min);
180
+ if (value && (parseTimeStr(value).hourStr === minTime.hourStr && parseTimeStr(value).minuteStr) === minTime.minuteStr) {
181
+ minSecond = minTime.seconds;
182
+ }
183
+ }
184
+ if (max) {
185
+ const maxTime = parseTimeStr(max);
186
+ if (value && (parseTimeStr(value).hourStr === maxTime.hourStr && parseTimeStr(value).minuteStr) === maxTime.minuteStr) {
187
+ maxSecond = maxTime.seconds;
188
+ }
189
+ }
190
+ for (let i = minSecond; i <= maxSecond; i += Math.max(1, step)) {
191
+ const seconds = formatTimePart(i);
192
+ result.push({
193
+ value: seconds,
194
+ label: seconds
195
+ });
196
+ }
197
+ return result;
198
+ };
199
+ const getMeridiesOptions = (min, max) => {
200
+ const result = [];
201
+ const hideAM = min ? parseTimeStr(min).meridiem === "PM" : false;
202
+ if (!hideAM) {
203
+ result.push({
204
+ value: "AM",
205
+ label: "AM"
206
+ });
207
+ }
208
+ const hidePM = max ? parseTimeStr(max).meridiem === "AM" : false;
209
+ if (!hidePM) {
210
+ result.push({
211
+ value: "PM",
212
+ label: "PM"
213
+ });
214
+ }
215
+ return result;
216
+ };
8
217
 
9
218
  var __defProp = Object.defineProperty;
10
219
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -23,130 +232,628 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
23
232
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
24
233
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
25
234
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
26
- var _ANCHOR_ARIA_LABEL_SUFFIX, _Toggletip_instances, setupAnchor_fn, updateAnchor_fn, cleanupAnchor_fn, _openIfClosed, updateListeners_fn, _closeOnClickOutside, _closeOnEscape;
27
- let Toggletip = class extends FoundationElement {
235
+ var _getFocusableEls, _TimePicker_instances, updateValueDueToUserInteraction_fn, _onFocusIn, _onFocusOut, _dismissOnClickOutside, openPopupIfPossible_fn, scrollToItem_fn;
236
+ const ValidTimeFilter = {
237
+ fromView: (value) => {
238
+ if (value && isValidTimeStr(value)) {
239
+ return value;
240
+ }
241
+ return "";
242
+ },
243
+ toView(value) {
244
+ return value;
245
+ }
246
+ };
247
+ let TimePicker = class extends FormAssociatedTimePicker {
28
248
  constructor() {
29
- super(...arguments);
30
- __privateAdd(this, _Toggletip_instances);
31
- __privateAdd(this, _ANCHOR_ARIA_LABEL_SUFFIX, " ; Show more information");
32
- this.alternate = false;
33
- this.placement = "right";
34
- this.open = false;
35
- __privateAdd(this, _openIfClosed, () => {
36
- if (!this.open) DOM.queueUpdate(() => this.open = true);
249
+ super();
250
+ __privateAdd(this, _TimePicker_instances);
251
+ this.readOnly = false;
252
+ this.minutesStep = null;
253
+ this.secondsStep = null;
254
+ __privateAdd(this, _getFocusableEls, () => this.shadowRoot.querySelectorAll(`
255
+ .dialog [tabindex="0"],
256
+ .dialog .vwc-button:not(:disabled)
257
+ `));
258
+ __privateAdd(this, _onFocusIn, () => {
259
+ this.$emit("focus", void 0, { bubbles: false });
37
260
  });
38
- __privateAdd(this, _closeOnClickOutside, (e) => {
39
- const clickedOutside = !this.contains(e.target);
40
- const clickedOnAnchor = this._anchorEl?.contains(e.target);
41
- if (clickedOutside || clickedOnAnchor) this.open = false;
261
+ __privateAdd(this, _onFocusOut, () => {
262
+ this.$emit("blur", void 0, { bubbles: false });
42
263
  });
43
- __privateAdd(this, _closeOnEscape, (e) => {
44
- if (e.key === "Escape") this.open = false;
264
+ this._popupOpen = false;
265
+ __privateAdd(this, _dismissOnClickOutside, (event) => {
266
+ if (!this._popupOpen) {
267
+ return;
268
+ }
269
+ const path = event.composedPath();
270
+ const elementsToIgnoreClicksOn = [this._dialogEl, this._clockButtonEl];
271
+ if (!elementsToIgnoreClicksOn.some((element) => path.includes(element))) {
272
+ this._closePopup(false);
273
+ }
45
274
  });
275
+ this._presentationValue = "";
276
+ this.value = "";
277
+ this.min = "";
278
+ this.max = "";
279
+ this.proxy.type = "time";
280
+ this.proxy.step = "1";
46
281
  }
47
- openChanged(oldValue, newValue) {
48
- if (oldValue === void 0) return;
49
- if (newValue) {
50
- this.setAttribute("role", "status");
51
- } else {
52
- this.removeAttribute("role");
282
+ /**
283
+ * @internal
284
+ */
285
+ readOnlyChanged() {
286
+ if (this.proxy instanceof HTMLInputElement) {
287
+ this.proxy.readOnly = this.readOnly;
288
+ this.validate();
53
289
  }
54
- __privateMethod(this, _Toggletip_instances, updateListeners_fn).call(this);
55
- if (this._anchorEl) {
56
- __privateMethod(this, _Toggletip_instances, updateAnchor_fn).call(this, this._anchorEl);
290
+ }
291
+ /**
292
+ * @internal
293
+ */
294
+ minChanged(_, newMin) {
295
+ if (this.proxy instanceof HTMLInputElement) {
296
+ this.proxy.min = newMin;
297
+ this.validate();
298
+ }
299
+ }
300
+ /**
301
+ * @internal
302
+ */
303
+ maxChanged(_, newMax) {
304
+ if (this.proxy instanceof HTMLInputElement) {
305
+ this.proxy.max = newMax;
306
+ this.validate();
307
+ }
308
+ }
309
+ // --- Core ---
310
+ /**
311
+ * @internal
312
+ */
313
+ get _displaySeconds() {
314
+ return this.secondsStep !== null;
315
+ }
316
+ /**
317
+ * @internal
318
+ */
319
+ get _use12hClock() {
320
+ return this.clock ? this.clock === "12h" : this.locale.timePicker.defaultTo12HourClock;
321
+ }
322
+ /**
323
+ * @internal
324
+ */
325
+ valueChanged(previous, next) {
326
+ super.valueChanged(previous, next);
327
+ if (this.value) {
328
+ if (!isValidTimeStr(this.value)) {
329
+ this.value = "";
330
+ return;
331
+ }
332
+ this._presentationValue = formatPresentationTime(
333
+ this.value,
334
+ this._displaySeconds,
335
+ this._use12hClock
336
+ );
337
+ } else {
338
+ this._presentationValue = "";
57
339
  }
58
340
  }
59
341
  connectedCallback() {
60
342
  super.connectedCallback();
61
- __privateMethod(this, _Toggletip_instances, updateListeners_fn).call(this);
343
+ document.addEventListener("click", __privateGet(this, _dismissOnClickOutside));
344
+ this.addEventListener("focusin", __privateGet(this, _onFocusIn));
345
+ this.addEventListener("focusout", __privateGet(this, _onFocusOut));
62
346
  }
63
347
  disconnectedCallback() {
64
348
  super.disconnectedCallback();
65
- __privateMethod(this, _Toggletip_instances, updateListeners_fn).call(this);
349
+ document.removeEventListener("click", __privateGet(this, _dismissOnClickOutside));
350
+ this.removeEventListener("focusin", __privateGet(this, _onFocusIn));
351
+ this.removeEventListener("focusout", __privateGet(this, _onFocusOut));
66
352
  }
67
353
  /**
68
354
  * @internal
69
355
  */
70
- _anchorElChanged(oldValue, newValue) {
71
- if (oldValue) __privateMethod(this, _Toggletip_instances, cleanupAnchor_fn).call(this, oldValue);
72
- if (newValue) __privateMethod(this, _Toggletip_instances, setupAnchor_fn).call(this, newValue);
356
+ _closePopup(restoreFocusToTextField = true) {
357
+ this._popupOpen = false;
358
+ if (restoreFocusToTextField) {
359
+ this._textFieldEl.focus();
360
+ }
361
+ }
362
+ /**
363
+ * On keydown anywhere in the time picker.
364
+ * @internal
365
+ */
366
+ _onBaseKeyDown(event) {
367
+ if (handleEscapeKeyAndStopPropogation(event)) {
368
+ this._closePopup();
369
+ return false;
370
+ }
371
+ if (this._trappedFocus(event, __privateGet(this, _getFocusableEls))) {
372
+ return false;
373
+ }
374
+ return true;
375
+ }
376
+ /**
377
+ * @internal
378
+ */
379
+ _presentationValueChanged() {
380
+ this.dirtyValue = true;
381
+ this.validate();
382
+ }
383
+ /**
384
+ * @internal
385
+ */
386
+ get _textFieldPlaceholder() {
387
+ let format = "hh:mm";
388
+ if (this._displaySeconds) {
389
+ format += ":ss";
390
+ }
391
+ if (this._use12hClock) {
392
+ format += " aa";
393
+ }
394
+ return format;
395
+ }
396
+ /**
397
+ * @internal
398
+ */
399
+ _onTextFieldInput(event) {
400
+ const textField = event.currentTarget;
401
+ this._presentationValue = textField.value;
402
+ }
403
+ /**
404
+ * @internal
405
+ */
406
+ _onTextFieldChange() {
407
+ if (this._presentationValue === "") {
408
+ __privateMethod(this, _TimePicker_instances, updateValueDueToUserInteraction_fn).call(this, "");
409
+ return;
410
+ }
411
+ try {
412
+ __privateMethod(this, _TimePicker_instances, updateValueDueToUserInteraction_fn).call(this, parsePresentationTime(this._presentationValue, this._use12hClock));
413
+ } catch (_) {
414
+ return;
415
+ }
416
+ }
417
+ // --- Clock button ---
418
+ /**
419
+ * @internal
420
+ */
421
+ get _clockButtonLabel() {
422
+ if (this.value) {
423
+ return this.locale.timePicker.changeTimeLabel(
424
+ formatPresentationTime(
425
+ this.value,
426
+ this._displaySeconds,
427
+ this._use12hClock
428
+ )
429
+ );
430
+ }
431
+ return this.locale.timePicker.chooseTimeLabel;
432
+ }
433
+ /**
434
+ * @internal
435
+ */
436
+ _onClockButtonClick() {
437
+ if (this._popupOpen) {
438
+ this._closePopup();
439
+ } else {
440
+ __privateMethod(this, _TimePicker_instances, openPopupIfPossible_fn).call(this);
441
+ DOM.processUpdates();
442
+ if (this._selectedHour) {
443
+ __privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, "hours", this._selectedHour, "start");
444
+ }
445
+ if (this._selectedMinute) {
446
+ __privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, "minutes", this._selectedMinute, "start");
447
+ }
448
+ if (this._displaySeconds && this._selectedSecond) {
449
+ __privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, "seconds", this._selectedSecond, "start");
450
+ }
451
+ if (this._use12hClock && this._selectedMeridiem) {
452
+ __privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, "meridies", this._selectedMeridiem, "start");
453
+ }
454
+ __privateGet(this, _getFocusableEls).call(this)[0].focus();
455
+ }
456
+ }
457
+ // --- Pickers ---
458
+ /**
459
+ * @internal
460
+ */
461
+ get _hours() {
462
+ return getHoursOptions(
463
+ this.min,
464
+ this.max,
465
+ this._use12hClock ? this._selectedMeridiem ?? this._meridies[0].value : void 0
466
+ );
467
+ }
468
+ /**
469
+ * @internal
470
+ */
471
+ get _selectedHour() {
472
+ return this.value ? parseTimeStr(this.value).hourStr : void 0;
473
+ }
474
+ /**
475
+ * @internal
476
+ */
477
+ set _selectedHour(value) {
478
+ if (this.value) {
479
+ const { minuteStr, secondStr } = parseTimeStr(this.value);
480
+ this.value = `${value}:${minuteStr}:${secondStr}`;
481
+ } else {
482
+ this.value = `${value}:00:00`;
483
+ }
484
+ }
485
+ /**
486
+ * @internal
487
+ */
488
+ get _minutes() {
489
+ return getMinutesOptions(this.minutesStep, this.value, this.min, this.max);
490
+ }
491
+ /**
492
+ * @internal
493
+ */
494
+ get _selectedMinute() {
495
+ return this.value ? parseTimeStr(this.value).minuteStr : void 0;
496
+ }
497
+ /**
498
+ * @internal
499
+ */
500
+ set _selectedMinute(value) {
501
+ if (this.value) {
502
+ const { hourStr, secondStr } = parseTimeStr(this.value);
503
+ this.value = `${hourStr}:${value}:${secondStr}`;
504
+ } else {
505
+ this.value = `00:${value}:00`;
506
+ }
507
+ }
508
+ /**
509
+ * @internal
510
+ */
511
+ get _seconds() {
512
+ return getSecondsOptions(this.secondsStep, this.value, this.min, this.max);
513
+ }
514
+ /**
515
+ * @internal
516
+ */
517
+ get _selectedSecond() {
518
+ return this.value ? parseTimeStr(this.value).secondStr : void 0;
519
+ }
520
+ /**
521
+ * @internal
522
+ */
523
+ set _selectedSecond(value) {
524
+ if (this.value) {
525
+ const { hourStr, minuteStr } = parseTimeStr(this.value);
526
+ this.value = `${hourStr}:${minuteStr}:${value}`;
527
+ } else {
528
+ this.value = `00:00:${value}`;
529
+ }
530
+ }
531
+ /**
532
+ * @internal
533
+ */
534
+ get _meridies() {
535
+ return getMeridiesOptions(this.min, this.max);
536
+ }
537
+ /**
538
+ * @internal
539
+ */
540
+ get _selectedMeridiem() {
541
+ return this.value ? parseTimeStr(this.value).meridiem : void 0;
542
+ }
543
+ /**
544
+ * @internal
545
+ */
546
+ set _selectedMeridiem(value) {
547
+ if (this.value) {
548
+ const { hours, minuteStr, secondStr } = parseTimeStr(this.value);
549
+ let adjustedHours = hours;
550
+ if (value === "AM" && hours >= 12) {
551
+ adjustedHours -= 12;
552
+ } else if (value === "PM" && hours < 12) {
553
+ adjustedHours += 12;
554
+ }
555
+ this.value = `${formatTimePart(adjustedHours)}:${minuteStr}:${secondStr}`;
556
+ } else {
557
+ if (value === "AM") {
558
+ this.value = "00:00:00";
559
+ } else {
560
+ this.value = "12:00:00";
561
+ }
562
+ }
563
+ }
564
+ /**
565
+ * @internal
566
+ */
567
+ _onPickerKeyDown(picker, options, selectedValue, setSelectedValue, event) {
568
+ const offset = {
569
+ ArrowUp: -1,
570
+ ArrowDown: 1
571
+ }[event.key];
572
+ if (offset) {
573
+ event.preventDefault();
574
+ const index = options.findIndex((h) => h.value === selectedValue);
575
+ const newRawIndex = index === -1 ? 0 : index + offset;
576
+ const newIndex = (newRawIndex + options.length) % options.length;
577
+ const newValue = options[newIndex].value;
578
+ setSelectedValue(newValue);
579
+ __privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, picker, newValue, "nearest");
580
+ __privateMethod(this, _TimePicker_instances, updateValueDueToUserInteraction_fn).call(this, this.value);
581
+ }
582
+ return true;
583
+ }
584
+ /**
585
+ * @internal
586
+ */
587
+ _onPickerItemClick(picker, setSelectedValue, value) {
588
+ setSelectedValue(value);
589
+ __privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, picker, value, "start");
590
+ __privateMethod(this, _TimePicker_instances, updateValueDueToUserInteraction_fn).call(this, this.value);
591
+ const nextPickerEl = this.shadowRoot.querySelector(
592
+ `#${picker} + .picker`
593
+ );
594
+ if (nextPickerEl) {
595
+ nextPickerEl.focus();
596
+ } else {
597
+ this._closePopup();
598
+ }
599
+ }
600
+ // --- Dialog footer ---
601
+ /**
602
+ * @internal
603
+ */
604
+ _onOkClick() {
605
+ this._closePopup();
606
+ }
607
+ /**
608
+ * @internal
609
+ */
610
+ _onClearClick() {
611
+ __privateMethod(this, _TimePicker_instances, updateValueDueToUserInteraction_fn).call(this, "");
612
+ this._closePopup();
613
+ }
614
+ // --- Validation ---
615
+ /**
616
+ * @internal
617
+ */
618
+ validate() {
619
+ if (this.proxy) {
620
+ this.proxy.setCustomValidity(this._getCustomValidationError() ?? "");
621
+ }
622
+ super.validate(this._textFieldEl?.querySelector("input") ?? void 0);
623
+ }
624
+ /**
625
+ * @internal
626
+ */
627
+ _getCustomValidationError() {
628
+ if (this._isPresentationValueInvalid()) {
629
+ return this.locale.timePicker.invalidTimeError;
630
+ }
631
+ return null;
632
+ }
633
+ /**
634
+ * @internal
635
+ */
636
+ _isPresentationValueInvalid() {
637
+ if (this._presentationValue === "") {
638
+ return false;
639
+ }
640
+ try {
641
+ parsePresentationTime(this._presentationValue, this._use12hClock);
642
+ return false;
643
+ } catch (_) {
644
+ return true;
645
+ }
73
646
  }
74
647
  };
75
- _ANCHOR_ARIA_LABEL_SUFFIX = new WeakMap();
76
- _Toggletip_instances = new WeakSet();
77
- setupAnchor_fn = function(a) {
78
- a.addEventListener("click", __privateGet(this, _openIfClosed), true);
79
- a.ariaLabel = (a.ariaLabel ?? "") + __privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX);
80
- __privateMethod(this, _Toggletip_instances, updateAnchor_fn).call(this, a);
81
- };
82
- updateAnchor_fn = function(a) {
83
- a.setAttribute("aria-expanded", this.open.toString());
648
+ _getFocusableEls = new WeakMap();
649
+ _TimePicker_instances = new WeakSet();
650
+ updateValueDueToUserInteraction_fn = function(newValue) {
651
+ this.value = newValue;
652
+ this.$emit("change");
653
+ this.$emit("input");
84
654
  };
85
- cleanupAnchor_fn = function(a) {
86
- a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
87
- if (a.ariaLabel)
88
- a.ariaLabel = a.ariaLabel.replace(__privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX), "");
655
+ _onFocusIn = new WeakMap();
656
+ _onFocusOut = new WeakMap();
657
+ _dismissOnClickOutside = new WeakMap();
658
+ openPopupIfPossible_fn = function() {
659
+ if (!this.readOnly) {
660
+ this._popupOpen = true;
661
+ }
89
662
  };
90
- _openIfClosed = new WeakMap();
91
- updateListeners_fn = function() {
92
- document.removeEventListener("click", __privateGet(this, _closeOnClickOutside));
93
- document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
94
- if (this.open && this.isConnected) {
95
- document.addEventListener("click", __privateGet(this, _closeOnClickOutside));
96
- document.addEventListener("keydown", __privateGet(this, _closeOnEscape));
663
+ scrollToItem_fn = function(picker, selectedValue, position) {
664
+ const element = this.shadowRoot.querySelector(
665
+ `#${picker}-${selectedValue}`
666
+ );
667
+ if (!element) {
668
+ return;
97
669
  }
670
+ scrollIntoView(element, element.parentElement, position);
98
671
  };
99
- _closeOnClickOutside = new WeakMap();
100
- _closeOnEscape = new WeakMap();
672
+ __decorateClass([
673
+ attr({ attribute: "readonly", mode: "boolean" })
674
+ ], TimePicker.prototype, "readOnly", 2);
675
+ __decorateClass([
676
+ attr({ attribute: "minutes-step", converter: nullableNumberConverter })
677
+ ], TimePicker.prototype, "minutesStep", 2);
678
+ __decorateClass([
679
+ attr({ attribute: "seconds-step", converter: nullableNumberConverter })
680
+ ], TimePicker.prototype, "secondsStep", 2);
101
681
  __decorateClass([
102
682
  attr
103
- ], Toggletip.prototype, "headline", 2);
683
+ ], TimePicker.prototype, "clock", 2);
104
684
  __decorateClass([
105
- attr({ mode: "boolean" })
106
- ], Toggletip.prototype, "alternate", 2);
685
+ attr({ converter: ValidTimeFilter })
686
+ ], TimePicker.prototype, "min", 2);
107
687
  __decorateClass([
108
- attr({ mode: "fromView" })
109
- ], Toggletip.prototype, "placement", 2);
688
+ attr({ converter: ValidTimeFilter })
689
+ ], TimePicker.prototype, "max", 2);
110
690
  __decorateClass([
111
- attr({ mode: "boolean" })
112
- ], Toggletip.prototype, "open", 2);
113
- Toggletip = __decorateClass([
114
- anchored
115
- ], Toggletip);
691
+ observable
692
+ ], TimePicker.prototype, "_popupOpen", 2);
693
+ __decorateClass([
694
+ observable
695
+ ], TimePicker.prototype, "_presentationValue", 2);
696
+ TimePicker = __decorateClass([
697
+ errorText,
698
+ formElements
699
+ ], TimePicker);
700
+ applyMixinsWithObservables(
701
+ TimePicker,
702
+ Localized,
703
+ FormElementHelperText,
704
+ TrappedFocus
705
+ );
116
706
 
117
- const getClasses = (_) => classNames("control");
118
- const ToggletipTemplate = (context) => {
119
- const popup = context.tagFor(Popup);
120
- const anchorSlotTemplate = anchorSlotTemplateFactory();
707
+ const renderPicker = (id, getLabel, getSelected, setSelected, getOptions) => {
121
708
  return html`
122
- ${anchorSlotTemplate}
123
- <${popup}
124
- class="${getClasses}"
125
- arrow
126
- :anchor="${(x) => x._anchorEl}"
127
- :open="${(x) => x.open}"
128
- ?alternate="${(x) => !x.alternate}"
129
- placement="${(x) => x.placement}"
130
- exportparts="vvd-theme-alternate"
709
+ <ul
710
+ id="${id}"
711
+ class="picker"
712
+ role="listbox"
713
+ tabindex="0"
714
+ aria-label="${getLabel}"
715
+ aria-activedescendant="${(x) => getSelected(x) ? `${id}-${getSelected(x)}` : void 0}"
716
+ @keydown="${(x, c) => x._onPickerKeyDown(
717
+ id,
718
+ getOptions(x),
719
+ getSelected(x),
720
+ setSelected(x),
721
+ c.event
722
+ )}"
131
723
  >
132
- <div class="content-wrapper">
133
- ${when(
134
- (x) => x.headline,
135
- html`<header class="headline">${(x) => x.headline}</header>`
724
+ ${repeat(
725
+ getOptions,
726
+ html`
727
+ <li
728
+ id="${(x) => `${id}-${x.value}`}"
729
+ class="${(x, c) => classNames("item", [
730
+ "selected",
731
+ getSelected(c.parent) === x.value
732
+ ])}"
733
+ role="option"
734
+ aria-selected="${(x, c) => getSelected(c.parent) === x.value}"
735
+ @click="${(x, c) => c.parent._onPickerItemClick(id, setSelected(c.parent), x.value)}"
736
+ >
737
+ ${(x) => x.label}
738
+ </li>
739
+ `
136
740
  )}
137
- <slot></slot>
138
- <footer class="action-items"><slot name="action-items"></slot></footer>
139
- </div>
140
- </${popup}>
741
+ </ul>
141
742
  `;
142
743
  };
744
+ const TimePickerTemplate = (context, _) => {
745
+ const popupTag = context.tagFor(Popup);
746
+ const textFieldTag = context.tagFor(TextField);
747
+ const buttonTag = context.tagFor(Button);
748
+ return html`<div class="base" @keydown="${(x, { event }) => x._onBaseKeyDown(event)}">
749
+ <${textFieldTag} id="text-field"
750
+ ${ref("_textFieldEl")}
751
+ class="control"
752
+ label="${(x) => x.label}"
753
+ helper-text="${(x) => x.helperText}"
754
+ error-text="${(x) => x.errorValidationMessage}"
755
+ placeholder="${(x) => x._textFieldPlaceholder}"
756
+ current-value="${(x) => x._presentationValue}"
757
+ ?disabled="${(x) => x.disabled}"
758
+ ?readonly="${(x) => x.readOnly}"
759
+ @input="${(x, c) => x._onTextFieldInput(c.event)}"
760
+ @change="${(x) => x._onTextFieldChange()}"
761
+ >
762
+ <slot
763
+ slot="${(x) => x._helperTextSlottedContent?.length ? "helper-text" : void 0}"
764
+ name="helper-text"
765
+ ${slotted("_helperTextSlottedContent")}
766
+ ></slot>
767
+ <${buttonTag}
768
+ id="clock-button"
769
+ ${ref("_clockButtonEl")}
770
+ slot="action-items"
771
+ size="condensed"
772
+ icon="clock-line"
773
+ appearance="ghost"
774
+ ?disabled="${(x) => x.disabled || x.readOnly}"
775
+ aria-label="${(x) => x._clockButtonLabel}"
776
+ @click="${(x) => x._onClockButtonClick()}"
777
+ ></${buttonTag}>
778
+ </${textFieldTag}>
779
+ <${popupTag}
780
+ ?open="${(x) => x._popupOpen}"
781
+ :anchor="${(x) => x._textFieldEl}"
782
+ placement="bottom-start"
783
+ class="popup">
784
+ <div class="dialog" role="dialog" ${ref(
785
+ "_dialogEl"
786
+ )} aria-modal="true" aria-label="${(x) => x.locale.timePicker.chooseTimeLabel}">
787
+ <div class="time-pickers">
788
+ ${renderPicker(
789
+ "hours",
790
+ (x) => x.locale.timePicker.hoursLabel,
791
+ (x) => x._selectedHour,
792
+ (x) => (v) => x._selectedHour = v,
793
+ (x) => x._hours
794
+ )}
795
+ ${renderPicker(
796
+ "minutes",
797
+ (x) => x.locale.timePicker.minutesLabel,
798
+ (x) => x._selectedMinute,
799
+ (x) => (v) => x._selectedMinute = v,
800
+ (x) => x._minutes
801
+ )}
802
+ ${when(
803
+ (x) => x._displaySeconds,
804
+ renderPicker(
805
+ "seconds",
806
+ (x) => x.locale.timePicker.secondsLabel,
807
+ (x) => x._selectedSecond,
808
+ (x) => (v) => x._selectedSecond = v,
809
+ (x) => x._seconds
810
+ )
811
+ )}
812
+ ${when(
813
+ (x) => x._use12hClock,
814
+ renderPicker(
815
+ "meridies",
816
+ (x) => x.locale.timePicker.meridiesLabel,
817
+ (x) => x._selectedMeridiem,
818
+ (x) => (v) => x._selectedMeridiem = v,
819
+ (x) => x._meridies
820
+ )
821
+ )}
822
+ </div>
823
+ <div class="footer">
824
+ <${buttonTag}
825
+ class="vwc-button"
826
+ size="condensed"
827
+ label="${(x) => x.locale.timePicker.clearLabel}"
828
+ @click="${(x) => x._onClearClick()}"
829
+ ></${buttonTag}>
830
+ <${buttonTag}
831
+ class="vwc-button"
832
+ size="condensed"
833
+ appearance="filled"
834
+ label="${(x) => x.locale.timePicker.okLabel}"
835
+ @click="${(x) => x._onOkClick()}"
836
+ ></${buttonTag}>
837
+ </div>
838
+ </div>
839
+ </${popupTag}>
840
+ </div>`;
841
+ };
143
842
 
144
- const toggletipDefinition = Toggletip.compose({
145
- baseName: "toggletip",
146
- template: ToggletipTemplate,
147
- styles
843
+ const timePickerDefinition = TimePicker.compose({
844
+ baseName: "time-picker",
845
+ template: TimePickerTemplate,
846
+ styles,
847
+ shadowOptions: {
848
+ delegatesFocus: true
849
+ }
148
850
  });
149
- const toggletipRegistries = [toggletipDefinition(), ...popupRegistries];
150
- const registerToggletip = registerFactory(toggletipRegistries);
851
+ const timePickerRegistries = [
852
+ timePickerDefinition(),
853
+ ...textFieldRegistries,
854
+ ...popupRegistries,
855
+ ...buttonRegistries
856
+ ];
857
+ const registerTimePicker = registerFactory(timePickerRegistries);
151
858
 
152
- export { toggletipRegistries as a, registerToggletip as r, toggletipDefinition as t };
859
+ export { timePickerRegistries as a, registerTimePicker as r, timePickerDefinition as t };