@vonage/vivid 4.5.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 (170) hide show
  1. package/custom-elements.json +1091 -187
  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/menu/menu.d.ts +2 -1
  8. package/lib/number-field/number-field.d.ts +3 -1
  9. package/lib/searchable-select/definition.d.ts +4 -0
  10. package/lib/searchable-select/locale.d.ts +6 -0
  11. package/lib/searchable-select/option-tag.d.ts +14 -0
  12. package/lib/searchable-select/option-tag.template.d.ts +4 -0
  13. package/lib/searchable-select/searchable-select.d.ts +29 -0
  14. package/lib/searchable-select/searchable-select.form-associated.d.ts +10 -0
  15. package/lib/searchable-select/searchable-select.template.d.ts +4 -0
  16. package/lib/select/select.d.ts +3 -1
  17. package/lib/tab/locale.d.ts +3 -0
  18. package/lib/tab/tab.d.ts +5 -1
  19. package/lib/tag/definition.d.ts +1 -0
  20. package/lib/text-field/text-field.d.ts +3 -1
  21. package/locales/de-DE.cjs +12 -0
  22. package/locales/de-DE.js +12 -0
  23. package/locales/en-GB.cjs +12 -0
  24. package/locales/en-GB.js +12 -0
  25. package/locales/en-US.cjs +12 -0
  26. package/locales/en-US.js +12 -0
  27. package/locales/ja-JP.cjs +12 -0
  28. package/locales/ja-JP.js +12 -0
  29. package/locales/zh-CN.cjs +12 -0
  30. package/locales/zh-CN.js +12 -0
  31. package/package.json +1 -1
  32. package/popup/index.cjs +1 -1
  33. package/popup/index.js +1 -1
  34. package/searchable-select/index.cjs +5 -0
  35. package/searchable-select/index.js +3 -0
  36. package/select/index.cjs +1 -1
  37. package/select/index.js +1 -1
  38. package/selectable-box/index.cjs +1 -1
  39. package/selectable-box/index.js +1 -1
  40. package/shared/definition11.cjs +1 -1
  41. package/shared/definition11.js +1 -1
  42. package/shared/definition14.cjs +1 -1
  43. package/shared/definition14.js +1 -1
  44. package/shared/definition16.cjs +1 -1
  45. package/shared/definition16.js +1 -1
  46. package/shared/definition18.cjs +2 -2
  47. package/shared/definition18.js +2 -2
  48. package/shared/definition19.cjs +2 -2
  49. package/shared/definition19.js +2 -2
  50. package/shared/definition20.cjs +14 -34
  51. package/shared/definition20.js +14 -34
  52. package/shared/definition21.cjs +1 -1
  53. package/shared/definition21.js +1 -1
  54. package/shared/definition26.cjs +1 -1
  55. package/shared/definition26.js +1 -1
  56. package/shared/definition29.cjs +4 -0
  57. package/shared/definition29.js +4 -0
  58. package/shared/definition30.cjs +2 -1
  59. package/shared/definition30.js +2 -1
  60. package/shared/definition35.cjs +12 -7
  61. package/shared/definition35.js +12 -7
  62. package/shared/definition36.cjs +50 -207
  63. package/shared/definition36.js +51 -207
  64. package/shared/definition4.cjs +1 -1
  65. package/shared/definition4.js +1 -1
  66. package/shared/definition42.cjs +1 -1
  67. package/shared/definition42.js +1 -1
  68. package/shared/definition43.cjs +993 -645
  69. package/shared/definition43.js +989 -642
  70. package/shared/definition44.cjs +723 -112
  71. package/shared/definition44.js +722 -111
  72. package/shared/definition45.cjs +121 -80
  73. package/shared/definition45.js +119 -78
  74. package/shared/definition46.cjs +81 -614
  75. package/shared/definition46.js +80 -612
  76. package/shared/definition47.cjs +608 -114
  77. package/shared/definition47.js +606 -113
  78. package/shared/definition48.cjs +116 -134
  79. package/shared/definition48.js +115 -133
  80. package/shared/definition49.cjs +149 -19
  81. package/shared/definition49.js +148 -18
  82. package/shared/definition5.cjs +1 -1
  83. package/shared/definition5.js +1 -1
  84. package/shared/definition50.cjs +21 -82
  85. package/shared/definition50.js +20 -81
  86. package/shared/definition51.cjs +77 -539
  87. package/shared/definition51.js +76 -538
  88. package/shared/definition52.cjs +568 -28
  89. package/shared/definition52.js +567 -27
  90. package/shared/definition53.cjs +28 -123
  91. package/shared/definition53.js +26 -122
  92. package/shared/definition54.cjs +115 -295
  93. package/shared/definition54.js +114 -294
  94. package/shared/definition55.cjs +251 -311
  95. package/shared/definition55.js +251 -311
  96. package/shared/definition56.cjs +299 -780
  97. package/shared/definition56.js +298 -779
  98. package/shared/definition57.cjs +800 -102
  99. package/shared/definition57.js +799 -101
  100. package/shared/definition58.cjs +92 -63
  101. package/shared/definition58.js +91 -62
  102. package/shared/definition59.cjs +117 -75
  103. package/shared/definition59.js +116 -74
  104. package/shared/definition60.cjs +70 -285
  105. package/shared/definition60.js +71 -286
  106. package/shared/definition61.cjs +274 -66146
  107. package/shared/definition61.js +273 -66145
  108. package/shared/definition62.cjs +66160 -27
  109. package/shared/definition62.js +66158 -25
  110. package/shared/definition63.cjs +24 -1952
  111. package/shared/definition63.js +23 -1950
  112. package/shared/definition64.cjs +1976 -0
  113. package/shared/definition64.js +1971 -0
  114. package/shared/listbox-option.cjs +204 -0
  115. package/shared/listbox-option.js +201 -0
  116. package/shared/listbox.cjs +3 -3
  117. package/shared/listbox.js +1 -1
  118. package/shared/localization/Locale.d.ts +4 -0
  119. package/shared/presentationDate.cjs +2 -2
  120. package/shared/presentationDate.js +2 -2
  121. package/shared/scrollIntoView.cjs +51 -0
  122. package/shared/scrollIntoView.js +49 -0
  123. package/shared/slider.template.cjs +1 -1
  124. package/shared/slider.template.js +1 -1
  125. package/shared/text-field.cjs +1 -1
  126. package/shared/text-field.js +1 -1
  127. package/shared/utils/scrollIntoView.d.ts +1 -0
  128. package/side-drawer/index.cjs +1 -1
  129. package/side-drawer/index.js +1 -1
  130. package/slider/index.cjs +1 -1
  131. package/slider/index.js +1 -1
  132. package/split-button/index.cjs +1 -1
  133. package/split-button/index.js +1 -1
  134. package/styles/core/all.css +1 -1
  135. package/styles/core/theme.css +1 -1
  136. package/styles/core/typography.css +1 -1
  137. package/styles/tokens/theme-dark.css +4 -4
  138. package/styles/tokens/theme-light.css +4 -4
  139. package/styles/tokens/vivid-2-compat.css +1 -1
  140. package/switch/index.cjs +1 -1
  141. package/switch/index.js +1 -1
  142. package/tab/index.cjs +1 -1
  143. package/tab/index.js +1 -1
  144. package/tab-panel/index.cjs +1 -1
  145. package/tab-panel/index.js +1 -1
  146. package/tabs/index.cjs +1 -1
  147. package/tabs/index.js +1 -1
  148. package/tag/index.cjs +1 -1
  149. package/tag/index.js +1 -1
  150. package/tag-group/index.cjs +1 -1
  151. package/tag-group/index.js +1 -1
  152. package/text-area/index.cjs +1 -1
  153. package/text-area/index.js +1 -1
  154. package/text-field/index.cjs +1 -1
  155. package/text-field/index.js +1 -1
  156. package/time-picker/index.cjs +1 -1
  157. package/time-picker/index.js +1 -1
  158. package/toggletip/index.cjs +1 -1
  159. package/toggletip/index.js +1 -1
  160. package/tooltip/index.cjs +1 -1
  161. package/tooltip/index.js +1 -1
  162. package/tree-item/index.cjs +1 -1
  163. package/tree-item/index.js +1 -1
  164. package/tree-view/index.cjs +1 -1
  165. package/tree-view/index.js +1 -1
  166. package/video-player/index.cjs +1 -1
  167. package/video-player/index.js +1 -1
  168. package/vivid.api.json +295 -0
  169. package/api-extractor.json +0 -25
  170. package/tsdoc-metadata.json +0 -11
@@ -1,11 +1,219 @@
1
- import { F as FoundationElement, a as attr, 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';
4
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';
5
14
  import { w as when } from './when.js';
15
+ import { r as repeat } from './repeat.js';
6
16
  import { c as classNames } from './class-names.js';
7
17
 
8
- 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
+ };
9
217
 
10
218
  var __defProp = Object.defineProperty;
11
219
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -24,138 +232,628 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
24
232
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
25
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);
26
234
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
27
- var _ANCHOR_ARIA_LABEL_SUFFIX, _Toggletip_instances, setupAnchor_fn, updateAnchor_fn, cleanupAnchor_fn, _openIfClosed, updateListeners_fn, _closeOnClickOutside, _closeOnEscape;
28
- 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 {
29
248
  constructor() {
30
- super(...arguments);
31
- __privateAdd(this, _Toggletip_instances);
32
- __privateAdd(this, _ANCHOR_ARIA_LABEL_SUFFIX, " ; Show more information");
33
- this.alternate = false;
34
- this.placement = "right";
35
- this.open = false;
36
- __privateAdd(this, _openIfClosed, () => {
37
- 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 });
38
260
  });
39
- __privateAdd(this, _closeOnClickOutside, (e) => {
40
- const clickedOutside = !this.contains(e.target);
41
- const clickedOnAnchor = this._anchorEl?.contains(e.target);
42
- if (clickedOutside || clickedOnAnchor) this.open = false;
261
+ __privateAdd(this, _onFocusOut, () => {
262
+ this.$emit("blur", void 0, { bubbles: false });
43
263
  });
44
- __privateAdd(this, _closeOnEscape, (e) => {
45
- if (e.key === "Escape") {
46
- 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);
47
273
  }
48
274
  });
275
+ this._presentationValue = "";
276
+ this.value = "";
277
+ this.min = "";
278
+ this.max = "";
279
+ this.proxy.type = "time";
280
+ this.proxy.step = "1";
49
281
  }
50
- openChanged(oldValue, newValue) {
51
- if (oldValue === void 0) return;
52
- if (newValue) {
53
- this.setAttribute("role", "status");
54
- } else {
55
- this.removeAttribute("role");
282
+ /**
283
+ * @internal
284
+ */
285
+ readOnlyChanged() {
286
+ if (this.proxy instanceof HTMLInputElement) {
287
+ this.proxy.readOnly = this.readOnly;
288
+ this.validate();
289
+ }
290
+ }
291
+ /**
292
+ * @internal
293
+ */
294
+ minChanged(_, newMin) {
295
+ if (this.proxy instanceof HTMLInputElement) {
296
+ this.proxy.min = newMin;
297
+ this.validate();
56
298
  }
57
- __privateMethod(this, _Toggletip_instances, updateListeners_fn).call(this);
58
- if (this._anchorEl) {
59
- __privateMethod(this, _Toggletip_instances, updateAnchor_fn).call(this, this._anchorEl);
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 = "";
60
339
  }
61
340
  }
62
341
  connectedCallback() {
63
342
  super.connectedCallback();
64
- __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));
65
346
  }
66
347
  disconnectedCallback() {
67
348
  super.disconnectedCallback();
68
- __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));
69
352
  }
70
353
  /**
71
354
  * @internal
72
355
  */
73
- _anchorElChanged(oldValue, newValue) {
74
- if (oldValue) __privateMethod(this, _Toggletip_instances, cleanupAnchor_fn).call(this, oldValue);
75
- 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
+ }
76
646
  }
77
647
  };
78
- _ANCHOR_ARIA_LABEL_SUFFIX = new WeakMap();
79
- _Toggletip_instances = new WeakSet();
80
- setupAnchor_fn = function(a) {
81
- a.addEventListener("click", __privateGet(this, _openIfClosed), true);
82
- a.ariaLabel = (a.ariaLabel ?? "") + __privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX);
83
- __privateMethod(this, _Toggletip_instances, updateAnchor_fn).call(this, a);
84
- };
85
- updateAnchor_fn = function(a) {
86
- 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");
87
654
  };
88
- cleanupAnchor_fn = function(a) {
89
- a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
90
- if (a.ariaLabel)
91
- 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
+ }
92
662
  };
93
- _openIfClosed = new WeakMap();
94
- updateListeners_fn = function() {
95
- document.removeEventListener("click", __privateGet(this, _closeOnClickOutside));
96
- document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
97
- if (this.open && this.isConnected) {
98
- document.addEventListener("click", __privateGet(this, _closeOnClickOutside));
99
- 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;
100
669
  }
670
+ scrollIntoView(element, element.parentElement, position);
101
671
  };
102
- _closeOnClickOutside = new WeakMap();
103
- _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);
104
681
  __decorateClass([
105
682
  attr
106
- ], Toggletip.prototype, "headline", 2);
683
+ ], TimePicker.prototype, "clock", 2);
107
684
  __decorateClass([
108
- attr({ mode: "boolean" })
109
- ], Toggletip.prototype, "alternate", 2);
685
+ attr({ converter: ValidTimeFilter })
686
+ ], TimePicker.prototype, "min", 2);
110
687
  __decorateClass([
111
- attr({ mode: "fromView" })
112
- ], Toggletip.prototype, "placement", 2);
688
+ attr({ converter: ValidTimeFilter })
689
+ ], TimePicker.prototype, "max", 2);
113
690
  __decorateClass([
114
- attr({ mode: "boolean" })
115
- ], Toggletip.prototype, "open", 2);
116
- Toggletip = __decorateClass([
117
- anchored
118
- ], 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
+ );
119
706
 
120
- const getClasses = (_) => classNames("control");
121
- const ToggletipTemplate = (context) => {
122
- const popup = context.tagFor(Popup);
123
- const anchorSlotTemplate = anchorSlotTemplateFactory();
707
+ const renderPicker = (id, getLabel, getSelected, setSelected, getOptions) => {
124
708
  return html`
125
- ${anchorSlotTemplate}
126
- <${popup}
127
- @keydown="${(x, { event }) => {
128
- if (x.open && handleEscapeKeyAndStopPropogation(event)) {
129
- return false;
130
- }
131
- return true;
132
- }}"
133
- class="${getClasses}"
134
- arrow
135
- :anchor="${(x) => x._anchorEl}"
136
- :open="${(x) => x.open}"
137
- ?alternate="${(x) => !x.alternate}"
138
- placement="${(x) => x.placement}"
139
- 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
+ )}"
140
723
  >
141
- <div class="content-wrapper">
142
- ${when(
143
- (x) => x.headline,
144
- 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
+ `
145
740
  )}
146
- <slot></slot>
147
- <footer class="action-items"><slot name="action-items"></slot></footer>
148
- </div>
149
- </${popup}>
741
+ </ul>
150
742
  `;
151
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
+ };
152
842
 
153
- const toggletipDefinition = Toggletip.compose({
154
- baseName: "toggletip",
155
- template: ToggletipTemplate,
156
- styles
843
+ const timePickerDefinition = TimePicker.compose({
844
+ baseName: "time-picker",
845
+ template: TimePickerTemplate,
846
+ styles,
847
+ shadowOptions: {
848
+ delegatesFocus: true
849
+ }
157
850
  });
158
- const toggletipRegistries = [toggletipDefinition(), ...popupRegistries];
159
- const registerToggletip = registerFactory(toggletipRegistries);
851
+ const timePickerRegistries = [
852
+ timePickerDefinition(),
853
+ ...textFieldRegistries,
854
+ ...popupRegistries,
855
+ ...buttonRegistries
856
+ ];
857
+ const registerTimePicker = registerFactory(timePickerRegistries);
160
858
 
161
- export { toggletipRegistries as a, registerToggletip as r, toggletipDefinition as t };
859
+ export { timePickerRegistries as a, registerTimePicker as r, timePickerDefinition as t };