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