@vonage/vivid 5.3.0 → 5.5.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 (263) hide show
  1. package/accordion-item/definition.js +1 -1
  2. package/alert/definition.cjs +1 -1
  3. package/alert/definition.js +2 -2
  4. package/badge/definition.js +1 -1
  5. package/banner/definition.js +1 -1
  6. package/bundled/base-color-picker.cjs +18 -13
  7. package/bundled/base-color-picker.js +98 -81
  8. package/bundled/calendar-picker.template.cjs +7 -7
  9. package/bundled/calendar-picker.template.js +102 -102
  10. package/bundled/char-count.cjs +1 -1
  11. package/bundled/char-count.js +1 -1
  12. package/bundled/definition10.cjs +1 -1
  13. package/bundled/definition10.js +2 -2
  14. package/bundled/definition11.cjs +12 -19
  15. package/bundled/definition11.js +87 -66
  16. package/bundled/definition12.cjs +19 -10
  17. package/bundled/definition12.js +217 -36
  18. package/bundled/definition13.cjs +10 -1
  19. package/bundled/definition13.js +38 -14
  20. package/bundled/definition14.cjs +1 -5
  21. package/bundled/definition14.js +15 -24
  22. package/bundled/definition15.cjs +5 -30
  23. package/bundled/definition15.js +22 -73
  24. package/bundled/definition16.cjs +30 -19
  25. package/bundled/definition16.js +74 -97
  26. package/bundled/definition17.cjs +19 -13
  27. package/bundled/definition17.js +83 -117
  28. package/bundled/definition18.cjs +13 -12
  29. package/bundled/definition18.js +114 -71
  30. package/bundled/definition19.cjs +26 -27
  31. package/bundled/definition19.js +171 -180
  32. package/bundled/definition2.cjs +9 -9
  33. package/bundled/definition2.js +84 -129
  34. package/bundled/definition3.cjs +1 -1
  35. package/bundled/definition3.js +1 -1
  36. package/bundled/definition6.cjs +3 -3
  37. package/bundled/definition6.js +19 -19
  38. package/bundled/definition9.cjs +5 -5
  39. package/bundled/definition9.js +394 -392
  40. package/bundled/listbox.cjs +1 -1
  41. package/bundled/listbox.js +82 -102
  42. package/bundled/localized.cjs +1 -1
  43. package/bundled/localized.js +48 -31
  44. package/bundled/mixins.cjs +1 -1
  45. package/bundled/mixins.js +1 -1
  46. package/bundled/picker-field.template.cjs +14 -14
  47. package/bundled/picker-field.template.js +35 -56
  48. package/bundled/time-selection-picker.template.cjs +12 -12
  49. package/bundled/time-selection-picker.template.js +13 -12
  50. package/bundled/trapped-focus.cjs +1 -0
  51. package/bundled/trapped-focus.js +26 -0
  52. package/bundled/vivid-element.cjs +5 -1
  53. package/bundled/vivid-element.js +401 -358
  54. package/calendar/index.cjs +13 -13
  55. package/calendar/index.js +171 -143
  56. package/card/definition.cjs +1 -1
  57. package/card/definition.js +1 -1
  58. package/color-picker/definition.cjs +209 -113
  59. package/color-picker/definition.js +209 -113
  60. package/color-picker/index.cjs +104 -75
  61. package/color-picker/index.js +412 -326
  62. package/combobox/definition.cjs +7 -27
  63. package/combobox/definition.js +8 -28
  64. package/combobox/index.cjs +6 -6
  65. package/combobox/index.js +57 -71
  66. package/contextual-help/index.cjs +1 -1
  67. package/contextual-help/index.js +1 -1
  68. package/custom-elements.json +354 -2
  69. package/data-grid/index.cjs +1 -1
  70. package/data-grid/index.js +1 -1
  71. package/date-picker/definition.cjs +1 -1
  72. package/date-picker/definition.js +1 -1
  73. package/date-picker/index.cjs +1 -1
  74. package/date-picker/index.js +2 -2
  75. package/date-range-picker/definition.cjs +1 -1
  76. package/date-range-picker/definition.js +1 -1
  77. package/date-range-picker/index.cjs +1 -1
  78. package/date-range-picker/index.js +2 -2
  79. package/date-time-picker/definition.cjs +1 -1
  80. package/date-time-picker/definition.js +1 -1
  81. package/date-time-picker/index.cjs +1 -1
  82. package/date-time-picker/index.js +2 -2
  83. package/dial-pad/definition.cjs +139 -0
  84. package/dial-pad/definition.js +139 -0
  85. package/dial-pad/index.cjs +27 -20
  86. package/dial-pad/index.js +177 -100
  87. package/dialog/definition.cjs +2 -2
  88. package/dialog/definition.js +2 -2
  89. package/dialog/index.cjs +7 -7
  90. package/dialog/index.js +6 -6
  91. package/divider/index.cjs +1 -1
  92. package/divider/index.js +1 -1
  93. package/elevation/definition.cjs +1 -1
  94. package/elevation/definition.js +1 -1
  95. package/fab/definition.js +1 -1
  96. package/header/definition.cjs +1 -1
  97. package/header/definition.js +1 -1
  98. package/icon/definition.cjs +56 -22
  99. package/icon/definition.js +56 -22
  100. package/index.cjs +3 -4
  101. package/index.js +2 -3
  102. package/lib/accordion/accordion.d.ts +1 -1
  103. package/lib/accordion/definition.d.ts +1 -1
  104. package/lib/audio-player/audio-player.d.ts +1 -1
  105. package/lib/color-picker/color-picker.d.ts +390 -12
  106. package/lib/color-picker/locale.d.ts +4 -0
  107. package/lib/combobox/combobox.d.ts +1 -0
  108. package/lib/combobox/combobox.options.d.ts +1 -1
  109. package/lib/date-picker/date-picker.d.ts +38 -38
  110. package/lib/date-range-picker/date-range-picker.d.ts +20 -20
  111. package/lib/date-time-picker/date-time-picker.d.ts +40 -40
  112. package/lib/dial-pad/dial-pad.d.ts +1 -0
  113. package/lib/divider/divider.d.ts +1 -1
  114. package/lib/icon/icon.d.ts +1 -0
  115. package/lib/menu-item/menu-item-role.d.ts +1 -1
  116. package/lib/popup/popup.d.ts +1 -1
  117. package/lib/searchable-select/locale.d.ts +4 -0
  118. package/lib/searchable-select/searchable-select.d.ts +3 -0
  119. package/lib/select/select.d.ts +3 -1
  120. package/lib/simple-color-picker/simple-color-picker.d.ts +2 -1
  121. package/lib/slider/slider.d.ts +1 -1
  122. package/lib/tabs/tabs.d.ts +2 -2
  123. package/lib/text-area/text-area.d.ts +1 -1
  124. package/lib/text-field/text-field.d.ts +1 -1
  125. package/lib/time-picker/time-picker.d.ts +20 -20
  126. package/locales/de-DE.cjs +20 -3
  127. package/locales/de-DE.js +20 -3
  128. package/locales/en-GB.cjs +21 -4
  129. package/locales/en-GB.js +21 -4
  130. package/locales/en-US.cjs +21 -4
  131. package/locales/en-US.js +21 -4
  132. package/locales/ja-JP.cjs +20 -3
  133. package/locales/ja-JP.js +20 -3
  134. package/locales/zh-CN.cjs +19 -2
  135. package/locales/zh-CN.js +19 -2
  136. package/menu/definition.cjs +4 -4
  137. package/menu/definition.js +4 -4
  138. package/nav-disclosure/definition.js +1 -1
  139. package/nav-item/definition.js +1 -1
  140. package/note/definition.js +1 -1
  141. package/number-field/definition.js +1 -1
  142. package/number-field/index.cjs +1 -1
  143. package/number-field/index.js +3 -3
  144. package/option/definition.cjs +6 -77
  145. package/option/definition.js +3 -78
  146. package/option/index.cjs +1 -1
  147. package/option/index.js +1 -1
  148. package/package.json +31 -5
  149. package/popup/definition.cjs +2 -2
  150. package/popup/definition.js +2 -2
  151. package/progress-ring/index.cjs +1 -1
  152. package/progress-ring/index.js +1 -1
  153. package/radio/index.cjs +1 -1
  154. package/radio/index.js +1 -1
  155. package/radio-group/index.cjs +1 -1
  156. package/radio-group/index.js +1 -1
  157. package/range-slider/definition.cjs +1 -1
  158. package/range-slider/definition.js +1 -1
  159. package/rich-text-editor/definition.cjs +2 -3
  160. package/rich-text-editor/definition.js +1 -2
  161. package/rich-text-editor/index.cjs +27 -27
  162. package/rich-text-editor/index.js +1209 -1199
  163. package/searchable-select/definition.cjs +103 -11
  164. package/searchable-select/definition.js +103 -11
  165. package/searchable-select/index.cjs +81 -69
  166. package/searchable-select/index.js +359 -273
  167. package/select/definition.cjs +30 -44
  168. package/select/definition.js +30 -44
  169. package/selectable-box/definition.cjs +1 -1
  170. package/selectable-box/definition.js +1 -1
  171. package/selectable-box/index.cjs +1 -1
  172. package/selectable-box/index.js +2 -2
  173. package/shared/aria/aria-mixin.d.ts +1 -1
  174. package/shared/color-picker/base-color-picker.d.ts +2 -1
  175. package/shared/foundation/listbox/listbox.d.ts +4 -0
  176. package/shared/picker-field/mixins/calendar-picker.d.ts +10 -10
  177. package/shared/picker-field/mixins/calendar-picker.template.d.ts +10 -10
  178. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +20 -20
  179. package/shared/picker-field/mixins/single-date-picker.d.ts +28 -28
  180. package/shared/picker-field/mixins/single-value-picker.d.ts +8 -8
  181. package/shared/picker-field/mixins/time-selection-picker.d.ts +20 -20
  182. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +20 -20
  183. package/simple-color-picker/definition.cjs +9 -7
  184. package/simple-color-picker/definition.js +9 -7
  185. package/simple-color-picker/index.cjs +6 -6
  186. package/simple-color-picker/index.js +41 -39
  187. package/slider/definition.cjs +1 -1
  188. package/slider/definition.js +1 -1
  189. package/split-button/definition.js +1 -1
  190. package/styles/core/all.css +1 -1
  191. package/styles/core/theme.css +1 -1
  192. package/styles/core/typography.css +1 -1
  193. package/styles/tokens/theme-dark.css +4 -4
  194. package/styles/tokens/theme-light.css +4 -4
  195. package/styles/tokens/vivid-2-compat.css +1 -1
  196. package/tab/definition.js +1 -1
  197. package/tag/definition.cjs +34 -14
  198. package/tag/definition.js +35 -15
  199. package/tag/index.cjs +25 -12
  200. package/tag/index.js +64 -47
  201. package/tag-group/definition.cjs +1 -2
  202. package/tag-group/definition.js +1 -2
  203. package/tag-group/index.cjs +1 -1
  204. package/tag-group/index.js +11 -12
  205. package/text-area/index.cjs +1 -1
  206. package/text-area/index.js +2 -2
  207. package/text-field/definition.js +1 -1
  208. package/time-picker/definition.cjs +1 -1
  209. package/time-picker/definition.js +1 -1
  210. package/time-picker/index.cjs +1 -1
  211. package/time-picker/index.js +1 -1
  212. package/toggletip/definition.cjs +1 -1
  213. package/toggletip/definition.js +1 -1
  214. package/toggletip/index.cjs +1 -1
  215. package/toggletip/index.js +1 -1
  216. package/tooltip/definition.cjs +3 -3
  217. package/tooltip/definition.js +3 -3
  218. package/tooltip/index.cjs +1 -1
  219. package/tooltip/index.js +1 -1
  220. package/tree-item/definition.cjs +1 -1
  221. package/tree-item/definition.js +1 -1
  222. package/tree-view/definition.cjs +1 -1
  223. package/tree-view/definition.js +1 -1
  224. package/unbundled/affix.js +1 -1
  225. package/unbundled/base-color-picker.cjs +36 -18
  226. package/unbundled/base-color-picker.js +36 -18
  227. package/unbundled/calendar-picker.template.cjs +2 -2
  228. package/unbundled/calendar-picker.template.js +2 -2
  229. package/unbundled/definition.js +1 -1
  230. package/unbundled/definition2.js +1 -1
  231. package/unbundled/definition3.cjs +222 -141
  232. package/unbundled/definition3.js +220 -139
  233. package/unbundled/definition4.cjs +145 -235
  234. package/unbundled/definition4.js +143 -233
  235. package/unbundled/definition5.cjs +269 -27
  236. package/unbundled/definition5.js +267 -26
  237. package/unbundled/definition6.cjs +56 -0
  238. package/unbundled/definition6.js +52 -0
  239. package/unbundled/listbox.cjs +41 -63
  240. package/unbundled/listbox.js +39 -61
  241. package/unbundled/picker-field.template.cjs +3 -36
  242. package/unbundled/picker-field.template.js +3 -35
  243. package/unbundled/slider.template.cjs +1 -1
  244. package/unbundled/slider.template.js +1 -1
  245. package/unbundled/time-selection-picker.template.cjs +2 -1
  246. package/unbundled/time-selection-picker.template.js +2 -1
  247. package/unbundled/trapped-focus.cjs +37 -0
  248. package/unbundled/trapped-focus.js +34 -0
  249. package/unbundled/vivid-element.cjs +1 -1
  250. package/unbundled/vivid-element.js +1 -1
  251. package/video-player/definition.cjs +56 -16
  252. package/video-player/definition.js +56 -16
  253. package/video-player/index.cjs +36 -36
  254. package/video-player/index.js +2461 -2445
  255. package/visually-hidden/index.cjs +1 -1
  256. package/visually-hidden/index.js +1 -1
  257. package/vivid.api.json +285 -38
  258. package/bundled/_has.cjs +0 -1
  259. package/bundled/_has.js +0 -34
  260. package/bundled/option.cjs +0 -1
  261. package/bundled/option.js +0 -158
  262. package/unbundled/option.cjs +0 -217
  263. package/unbundled/option.js +0 -214
@@ -1,4 +1,4 @@
1
- "use strict";const P=require("../bundled/definition9.cjs"),D=require("../bundled/definition3.cjs"),k=require("../bundled/definition10.cjs"),v=require("../bundled/definition14.cjs"),p=require("../bundled/picker-field.template.cjs"),i=require("../bundled/calendar-picker.template.cjs"),s=require("../bundled/vivid-element.cjs"),r=require("../bundled/time-selection-picker.template.cjs"),f=require("../bundled/definition13.cjs"),x=require("../bundled/single-value-picker.cjs"),V=require("../bundled/single-date-picker.cjs"),S=".date-time-picker{display:flex;gap:28px;padding-inline-start:12px}.time-picker{padding-block:4px 12px}",c=e=>e.split("T")[0]||"",u=e=>e.split("T")[1]||"",T=e=>{const[t="",n=""]=e.split("T");return i.isValidDateStr(t)&&r.isValidTimeStr(n)},g=(e,t,n,d)=>{const[a,l]=e.split("T");return`${i.formatPresentationDate(a,t)} ${r.formatPresentationTime(l,n,d)}`},M=(e,t,n)=>{const[d,...a]=e.split(" "),l=i.parsePresentationDate(d,t),h=r.parsePresentationTime(a.join(" "),n);return`${l}T${h}`};var y=Object.defineProperty,m=(e,t,n,d)=>{for(var a=void 0,l=e.length-1,h;l>=0;l--)(h=e[l])&&(a=h(t,n,a)||a);return a&&y(t,n,a),a};const _={fromView:e=>e&&T(e)?e:"",toView(e){return e}};class o extends r.TimeSelectionPicker(V.SingleDatePickerMixin(x.SingleValuePicker(i.CalendarPicker(p.PickerField)))){constructor(){super(),this._isValidValue=T,this._textFieldSize="30",this.proxy.type="datetime-local",this.proxy.step="1",this.min="",this.minDate="",this.minTime="",this.max="",this.maxDate="",this.maxTime=""}get _resolvedMinDate(){return this.minDate||c(this.min)}get _resolvedMaxDate(){return this.maxDate||c(this.max)}get _resolvedMinTime(){return this.minTime||this.min&&c(this.min)===this._dateValue()&&u(this.min)||""}get _resolvedMaxTime(){return this.maxTime||this.max&&c(this.max)===this._dateValue()&&u(this.max)||""}_toPresentationValue(t){return g(t,this.locale.calendarPicker,this._displaySeconds,this._use12hClock)}_parsePresentationValue(t){return M(t,this.locale.calendarPicker,this._use12hClock)}_dateValue(){return c(this.value)}_withUpdatedDate(t){return`${t}T${u(this.value)||"00:00:00"}`}get _timeValue(){return u(this.value)}_withUpdatedTime(t){return`${c(this.value)||i.currentDateStr()}T${t}`}_getCustomValidationError(){return this._isPresentationValueInvalid()?this.locale.dateTimePicker.invalidDateTimeError:this._dateValue()&&this._resolvedMinDate&&i.compareDateStr(this._dateValue(),this._resolvedMinDate)<0?this.locale.dateTimePicker.dateBeforeMinDateError(i.formatPresentationDate(this._resolvedMinDate,this.locale.calendarPicker)):this._dateValue()&&this._resolvedMaxDate&&i.compareDateStr(this._dateValue(),this._resolvedMaxDate)>0?this.locale.dateTimePicker.dateAfterMaxDateError(i.formatPresentationDate(this._resolvedMaxDate,this.locale.calendarPicker)):this._timeValue&&this._resolvedMinTime&&r.compareTimeStr(this._timeValue,this._resolvedMinTime)<0?this.locale.dateTimePicker.timeBeforeMinTimeError(r.formatPresentationTime(this._resolvedMinTime,this._displaySeconds,this._use12hClock)):this._timeValue&&this._resolvedMaxTime&&r.compareTimeStr(this._timeValue,this._resolvedMaxTime)>0?this.locale.dateTimePicker.timeAfterMaxTimeError(r.formatPresentationTime(this._resolvedMaxTime,this._displaySeconds,this._use12hClock)):null}get _textFieldPlaceholder(){return`${this.locale.calendarPicker.dateFormatPlaceholder} ${this._timePlaceholder}`}get _pickerButtonLabel(){return this.value?this.locale.dateTimePicker.changeDateTimeLabel(this._toPresentationValue(this.value)):this.locale.dateTimePicker.chooseDateTimeLabel}_focusableElsWithinDialog(){return this._dialogEl.querySelectorAll("#inline-time-picker, button, .vwc-button")}get _pickerButtonIcon(){return"calendar-clock-line"}get _dialogLabel(){return this.locale.dateTimePicker.chooseDateTimeLabel}}m([s.attr({converter:_})],o.prototype,"min");m([s.attr({converter:r.ValidTimeFilter,attribute:"min-time"})],o.prototype,"minTime");m([s.attr({converter:i.ValidDateFilter,attribute:"min-date"})],o.prototype,"minDate");m([s.attr({converter:_})],o.prototype,"max");m([s.attr({converter:r.ValidTimeFilter,attribute:"max-time"})],o.prototype,"maxTime");m([s.attr({converter:i.ValidDateFilter,attribute:"max-date"})],o.prototype,"maxDate");const $=e=>p.PickerFieldTemplate(e,s.html`
1
+ "use strict";const P=require("../bundled/definition9.cjs"),D=require("../bundled/definition3.cjs"),k=require("../bundled/definition10.cjs"),v=require("../bundled/definition15.cjs"),p=require("../bundled/picker-field.template.cjs"),i=require("../bundled/calendar-picker.template.cjs"),s=require("../bundled/vivid-element.cjs"),r=require("../bundled/time-selection-picker.template.cjs"),f=require("../bundled/definition14.cjs"),x=require("../bundled/single-value-picker.cjs"),V=require("../bundled/single-date-picker.cjs"),S=".date-time-picker{display:flex;gap:28px;padding-inline-start:12px}.time-picker{padding-block:4px 12px}",c=e=>e.split("T")[0]||"",u=e=>e.split("T")[1]||"",T=e=>{const[t="",n=""]=e.split("T");return i.isValidDateStr(t)&&r.isValidTimeStr(n)},g=(e,t,n,d)=>{const[a,l]=e.split("T");return`${i.formatPresentationDate(a,t)} ${r.formatPresentationTime(l,n,d)}`},M=(e,t,n)=>{const[d,...a]=e.split(" "),l=i.parsePresentationDate(d,t),h=r.parsePresentationTime(a.join(" "),n);return`${l}T${h}`};var y=Object.defineProperty,m=(e,t,n,d)=>{for(var a=void 0,l=e.length-1,h;l>=0;l--)(h=e[l])&&(a=h(t,n,a)||a);return a&&y(t,n,a),a};const _={fromView:e=>e&&T(e)?e:"",toView(e){return e}};class o extends r.TimeSelectionPicker(V.SingleDatePickerMixin(x.SingleValuePicker(i.CalendarPicker(p.PickerField)))){constructor(){super(),this._isValidValue=T,this._textFieldSize="30",this.proxy.type="datetime-local",this.proxy.step="1",this.min="",this.minDate="",this.minTime="",this.max="",this.maxDate="",this.maxTime=""}get _resolvedMinDate(){return this.minDate||c(this.min)}get _resolvedMaxDate(){return this.maxDate||c(this.max)}get _resolvedMinTime(){return this.minTime||this.min&&c(this.min)===this._dateValue()&&u(this.min)||""}get _resolvedMaxTime(){return this.maxTime||this.max&&c(this.max)===this._dateValue()&&u(this.max)||""}_toPresentationValue(t){return g(t,this.locale.calendarPicker,this._displaySeconds,this._use12hClock)}_parsePresentationValue(t){return M(t,this.locale.calendarPicker,this._use12hClock)}_dateValue(){return c(this.value)}_withUpdatedDate(t){return`${t}T${u(this.value)||"00:00:00"}`}get _timeValue(){return u(this.value)}_withUpdatedTime(t){return`${c(this.value)||i.currentDateStr()}T${t}`}_getCustomValidationError(){return this._isPresentationValueInvalid()?this.locale.dateTimePicker.invalidDateTimeError:this._dateValue()&&this._resolvedMinDate&&i.compareDateStr(this._dateValue(),this._resolvedMinDate)<0?this.locale.dateTimePicker.dateBeforeMinDateError(i.formatPresentationDate(this._resolvedMinDate,this.locale.calendarPicker)):this._dateValue()&&this._resolvedMaxDate&&i.compareDateStr(this._dateValue(),this._resolvedMaxDate)>0?this.locale.dateTimePicker.dateAfterMaxDateError(i.formatPresentationDate(this._resolvedMaxDate,this.locale.calendarPicker)):this._timeValue&&this._resolvedMinTime&&r.compareTimeStr(this._timeValue,this._resolvedMinTime)<0?this.locale.dateTimePicker.timeBeforeMinTimeError(r.formatPresentationTime(this._resolvedMinTime,this._displaySeconds,this._use12hClock)):this._timeValue&&this._resolvedMaxTime&&r.compareTimeStr(this._timeValue,this._resolvedMaxTime)>0?this.locale.dateTimePicker.timeAfterMaxTimeError(r.formatPresentationTime(this._resolvedMaxTime,this._displaySeconds,this._use12hClock)):null}get _textFieldPlaceholder(){return`${this.locale.calendarPicker.dateFormatPlaceholder} ${this._timePlaceholder}`}get _pickerButtonLabel(){return this.value?this.locale.dateTimePicker.changeDateTimeLabel(this._toPresentationValue(this.value)):this.locale.dateTimePicker.chooseDateTimeLabel}_focusableElsWithinDialog(){return this._dialogEl.querySelectorAll("#inline-time-picker, button, .vwc-button")}get _pickerButtonIcon(){return"calendar-clock-line"}get _dialogLabel(){return this.locale.dateTimePicker.chooseDateTimeLabel}}m([s.attr({converter:_})],o.prototype,"min");m([s.attr({converter:r.ValidTimeFilter,attribute:"min-time"})],o.prototype,"minTime");m([s.attr({converter:i.ValidDateFilter,attribute:"min-date"})],o.prototype,"minDate");m([s.attr({converter:_})],o.prototype,"max");m([s.attr({converter:r.ValidTimeFilter,attribute:"max-time"})],o.prototype,"maxTime");m([s.attr({converter:i.ValidDateFilter,attribute:"max-date"})],o.prototype,"maxDate");const $=e=>p.PickerFieldTemplate(e,s.html`
2
2
  <div class="date-time-picker">
3
3
  ${()=>i.CalendarPickerTemplate(e)}
4
4
  <div class="time-picker">
@@ -1,12 +1,12 @@
1
1
  import { p as v } from "../bundled/definition9.js";
2
2
  import { b as k } from "../bundled/definition3.js";
3
3
  import { t as x } from "../bundled/definition10.js";
4
- import { d as V } from "../bundled/definition14.js";
4
+ import { d as V } from "../bundled/definition15.js";
5
5
  import { P as S, a as g, p as M } from "../bundled/picker-field.template.js";
6
6
  import { i as y, f as h, p as b, C as F, d as $, b as u, V as _, a as C, c as E } from "../bundled/calendar-picker.template.js";
7
7
  import { a as l, h as w, c as L, d as B } from "../bundled/vivid-element.js";
8
8
  import { i as A, f as p, p as j, T as I, c as T, V as P, a as O, b as U } from "../bundled/time-selection-picker.template.js";
9
- import { v as q } from "../bundled/definition13.js";
9
+ import { v as q } from "../bundled/definition14.js";
10
10
  import { S as z } from "../bundled/single-value-picker.js";
11
11
  import { S as H } from "../bundled/single-date-picker.js";
12
12
  const R = ".date-time-picker{display:flex;gap:28px;padding-inline-start:12px}.time-picker{padding-block:4px 12px}", o = (e) => e.split("T")[0] || "", d = (e) => e.split("T")[1] || "", f = (e) => {
@@ -37,6 +37,21 @@ class DialPad extends localized.Localized(vividElement.VividElement) {
37
37
  this.endCallButtonLabel = null;
38
38
  this.callButtonLabel = null;
39
39
  this.deleteAriaLabel = null;
40
+ /**
41
+ * Long-press handling for digit '0' to insert '+'
42
+ * @internal
43
+ */
44
+ this._longPressTimeoutId = null;
45
+ /**
46
+ * Suppresses the next click handler after a long press has already handled input
47
+ * @internal
48
+ */
49
+ this._suppressNextClick = false;
50
+ /**
51
+ * Tracks if long press completed for keyboard events
52
+ * @internal
53
+ */
54
+ this._keyboardLongPressCompleted = false;
40
55
  /**
41
56
  *
42
57
  * @internal
@@ -65,6 +80,70 @@ class DialPad extends localized.Localized(vividElement.VividElement) {
65
80
  this._textFieldEl.reportValidity();
66
81
  }
67
82
  }
83
+ /**
84
+ * @internal
85
+ */
86
+ _startLongPress(digit, event) {
87
+ if (this.disabled || this.callActive || digit !== "0") return;
88
+ this._clearLongPressTimer();
89
+ const target = event.currentTarget;
90
+ this._longPressTimeoutId = window.setTimeout(() => {
91
+ this._suppressNextClick = true;
92
+ this.value += "+";
93
+ this.$emit("keypad-click", target);
94
+ this.$emit("input");
95
+ this.$emit("change");
96
+ }, 600);
97
+ }
98
+ /**
99
+ * @internal
100
+ */
101
+ _startKeyboardLongPress() {
102
+ if (this.disabled || this.callActive) return;
103
+ if (this._longPressTimeoutId !== null) return;
104
+ this._keyboardLongPressCompleted = false;
105
+ this._longPressTimeoutId = window.setTimeout(() => {
106
+ this._keyboardLongPressCompleted = true;
107
+ this.value += "+";
108
+ this.$emit("input");
109
+ this.$emit("change");
110
+ }, 650);
111
+ }
112
+ /**
113
+ * @internal
114
+ */
115
+ _endLongPress() {
116
+ this._clearLongPressTimer();
117
+ window.setTimeout(() => {
118
+ if (this._suppressNextClick) {
119
+ this._suppressNextClick = false;
120
+ }
121
+ }, 0);
122
+ }
123
+ /**
124
+ * @internal
125
+ * @returns true if long press completed (timer fired), false otherwise
126
+ */
127
+ _endKeyboardLongPress() {
128
+ const wasLongPress = this._keyboardLongPressCompleted;
129
+ this._clearLongPressTimer();
130
+ window.setTimeout(() => {
131
+ this._keyboardLongPressCompleted = false;
132
+ }, 0);
133
+ return wasLongPress;
134
+ }
135
+ /**
136
+ * @internal
137
+ */
138
+ _cancelLongPress() {
139
+ this._clearLongPressTimer();
140
+ }
141
+ _clearLongPressTimer() {
142
+ if (this._longPressTimeoutId !== null) {
143
+ clearTimeout(this._longPressTimeoutId);
144
+ this._longPressTimeoutId = null;
145
+ }
146
+ }
68
147
  /**
69
148
  * Moves focus into the diapl-pad.
70
149
  *
@@ -179,6 +258,13 @@ const getClasses = ({ noInput }) => fastWebUtilities.classNames("base", ["no-inp
179
258
  function handleKeyDown(x, e) {
180
259
  if (e.key === fastWebUtilities.keyEnter && !x.pending && !x.disabled && !x.callActive && !x.noCall && x.value.length > 0 && e.target instanceof HTMLInputElement) {
181
260
  x._onDial();
261
+ } else if (e.key === " " || e.key === "Space") {
262
+ if (e.target instanceof HTMLInputElement) {
263
+ e.preventDefault();
264
+ if (!e.repeat) {
265
+ x._startKeyboardLongPress();
266
+ }
267
+ }
182
268
  } else {
183
269
  const elementIndex = DIAL_PAD_BUTTONS.findIndex((x2) => x2.value === e.key);
184
270
  if (elementIndex > -1) {
@@ -193,6 +279,42 @@ function handleKeyDown(x, e) {
193
279
  }
194
280
  return true;
195
281
  }
282
+ function handleKeyUp(x, e) {
283
+ if (e.key === " " || e.key === "Space") {
284
+ if (e.target instanceof HTMLInputElement) {
285
+ e.preventDefault();
286
+ const wasLongPress = x._endKeyboardLongPress();
287
+ if (!wasLongPress && !x.disabled && !x.callActive) {
288
+ x.value += " ";
289
+ x.$emit("input");
290
+ x.$emit("change");
291
+ }
292
+ }
293
+ }
294
+ return true;
295
+ }
296
+ function handleButtonKeyDown(digit, { parent: dialPad, event }) {
297
+ if ((event.key === " " || event.key === "Space") && digit.value === "0") {
298
+ event.preventDefault();
299
+ if (!event.repeat) {
300
+ dialPad._startKeyboardLongPress();
301
+ }
302
+ }
303
+ return true;
304
+ }
305
+ function handleButtonKeyUp(digit, { parent: dialPad, event }) {
306
+ if ((event.key === " " || event.key === "Space") && digit.value === "0") {
307
+ event.preventDefault();
308
+ const wasLongPress = dialPad._endKeyboardLongPress();
309
+ if (!wasLongPress && !dialPad.disabled && !dialPad.callActive) {
310
+ onDigitClick(digit, {
311
+ parent: dialPad,
312
+ event: new MouseEvent("click", { bubbles: true })
313
+ });
314
+ }
315
+ }
316
+ return true;
317
+ }
196
318
  function syncFieldAndPadValues(x) {
197
319
  x.value = x._textFieldEl.value;
198
320
  }
@@ -215,6 +337,7 @@ function renderTextField(textFieldTag, buttonTag) {
215
337
  ?disabled="${(x) => x.disabled}" helper-text="${(x) => x.helperText}" pattern="${(x) => x.pattern}"
216
338
  aria-label="${(x) => x.locale.dialPad.inputLabel}"
217
339
  @keydown="${(x, c) => handleKeyDown(x, c.event)}"
340
+ @keyup="${(x, c) => handleKeyUp(x, c.event)}"
218
341
  @input="${syncFieldAndPadValues}"
219
342
  @change="${syncFieldAndPadValues}"
220
343
  @focus="${stopPropagation}"
@@ -236,6 +359,10 @@ function renderTextField(textFieldTag, buttonTag) {
236
359
  </${textFieldTag}>`;
237
360
  }
238
361
  function onDigitClick(digit, { parent: dialPad, event }) {
362
+ if (dialPad._suppressNextClick) {
363
+ dialPad._suppressNextClick = false;
364
+ return;
365
+ }
239
366
  dialPad.value += digit.value;
240
367
  dialPad.$emit("keypad-click", event.currentTarget);
241
368
  dialPad.$emit("input");
@@ -258,6 +385,18 @@ function renderDigits(buttonTag, iconTag) {
258
385
  ?autofocus="${(_, c) => c.parent.autofocus && c.parent.noInput && c.index === 0}"
259
386
  aria-label="${(x, c) => c.parent.locale.dialPad[x.ariaLabel]}"
260
387
  ?disabled="${(_, c) => c.parent.disabled}"
388
+ @pointerdown="${(x, c) => c.parent._startLongPress(x.value, c.event)}"
389
+ @pointerup="${(_, c) => c.parent._endLongPress()}"
390
+ @pointercancel="${(_, c) => c.parent._cancelLongPress()}"
391
+ @pointerleave="${(_, c) => c.parent._cancelLongPress()}"
392
+ @keydown="${(x, c) => handleButtonKeyDown(x, {
393
+ parent: c.parent,
394
+ event: c.event
395
+ })}"
396
+ @keyup="${(x, c) => handleButtonKeyUp(x, {
397
+ parent: c.parent,
398
+ event: c.event
399
+ })}"
261
400
  @click="${onDigitClick}">
262
401
  <${iconTag} slot="icon"
263
402
  name="${(x) => x.icon}"
@@ -33,6 +33,21 @@ class DialPad extends Localized(VividElement) {
33
33
  this.endCallButtonLabel = null;
34
34
  this.callButtonLabel = null;
35
35
  this.deleteAriaLabel = null;
36
+ /**
37
+ * Long-press handling for digit '0' to insert '+'
38
+ * @internal
39
+ */
40
+ this._longPressTimeoutId = null;
41
+ /**
42
+ * Suppresses the next click handler after a long press has already handled input
43
+ * @internal
44
+ */
45
+ this._suppressNextClick = false;
46
+ /**
47
+ * Tracks if long press completed for keyboard events
48
+ * @internal
49
+ */
50
+ this._keyboardLongPressCompleted = false;
36
51
  /**
37
52
  *
38
53
  * @internal
@@ -61,6 +76,70 @@ class DialPad extends Localized(VividElement) {
61
76
  this._textFieldEl.reportValidity();
62
77
  }
63
78
  }
79
+ /**
80
+ * @internal
81
+ */
82
+ _startLongPress(digit, event) {
83
+ if (this.disabled || this.callActive || digit !== "0") return;
84
+ this._clearLongPressTimer();
85
+ const target = event.currentTarget;
86
+ this._longPressTimeoutId = window.setTimeout(() => {
87
+ this._suppressNextClick = true;
88
+ this.value += "+";
89
+ this.$emit("keypad-click", target);
90
+ this.$emit("input");
91
+ this.$emit("change");
92
+ }, 600);
93
+ }
94
+ /**
95
+ * @internal
96
+ */
97
+ _startKeyboardLongPress() {
98
+ if (this.disabled || this.callActive) return;
99
+ if (this._longPressTimeoutId !== null) return;
100
+ this._keyboardLongPressCompleted = false;
101
+ this._longPressTimeoutId = window.setTimeout(() => {
102
+ this._keyboardLongPressCompleted = true;
103
+ this.value += "+";
104
+ this.$emit("input");
105
+ this.$emit("change");
106
+ }, 650);
107
+ }
108
+ /**
109
+ * @internal
110
+ */
111
+ _endLongPress() {
112
+ this._clearLongPressTimer();
113
+ window.setTimeout(() => {
114
+ if (this._suppressNextClick) {
115
+ this._suppressNextClick = false;
116
+ }
117
+ }, 0);
118
+ }
119
+ /**
120
+ * @internal
121
+ * @returns true if long press completed (timer fired), false otherwise
122
+ */
123
+ _endKeyboardLongPress() {
124
+ const wasLongPress = this._keyboardLongPressCompleted;
125
+ this._clearLongPressTimer();
126
+ window.setTimeout(() => {
127
+ this._keyboardLongPressCompleted = false;
128
+ }, 0);
129
+ return wasLongPress;
130
+ }
131
+ /**
132
+ * @internal
133
+ */
134
+ _cancelLongPress() {
135
+ this._clearLongPressTimer();
136
+ }
137
+ _clearLongPressTimer() {
138
+ if (this._longPressTimeoutId !== null) {
139
+ clearTimeout(this._longPressTimeoutId);
140
+ this._longPressTimeoutId = null;
141
+ }
142
+ }
64
143
  /**
65
144
  * Moves focus into the diapl-pad.
66
145
  *
@@ -175,6 +254,13 @@ const getClasses = ({ noInput }) => classNames("base", ["no-input", Boolean(noIn
175
254
  function handleKeyDown(x, e) {
176
255
  if (e.key === keyEnter && !x.pending && !x.disabled && !x.callActive && !x.noCall && x.value.length > 0 && e.target instanceof HTMLInputElement) {
177
256
  x._onDial();
257
+ } else if (e.key === " " || e.key === "Space") {
258
+ if (e.target instanceof HTMLInputElement) {
259
+ e.preventDefault();
260
+ if (!e.repeat) {
261
+ x._startKeyboardLongPress();
262
+ }
263
+ }
178
264
  } else {
179
265
  const elementIndex = DIAL_PAD_BUTTONS.findIndex((x2) => x2.value === e.key);
180
266
  if (elementIndex > -1) {
@@ -189,6 +275,42 @@ function handleKeyDown(x, e) {
189
275
  }
190
276
  return true;
191
277
  }
278
+ function handleKeyUp(x, e) {
279
+ if (e.key === " " || e.key === "Space") {
280
+ if (e.target instanceof HTMLInputElement) {
281
+ e.preventDefault();
282
+ const wasLongPress = x._endKeyboardLongPress();
283
+ if (!wasLongPress && !x.disabled && !x.callActive) {
284
+ x.value += " ";
285
+ x.$emit("input");
286
+ x.$emit("change");
287
+ }
288
+ }
289
+ }
290
+ return true;
291
+ }
292
+ function handleButtonKeyDown(digit, { parent: dialPad, event }) {
293
+ if ((event.key === " " || event.key === "Space") && digit.value === "0") {
294
+ event.preventDefault();
295
+ if (!event.repeat) {
296
+ dialPad._startKeyboardLongPress();
297
+ }
298
+ }
299
+ return true;
300
+ }
301
+ function handleButtonKeyUp(digit, { parent: dialPad, event }) {
302
+ if ((event.key === " " || event.key === "Space") && digit.value === "0") {
303
+ event.preventDefault();
304
+ const wasLongPress = dialPad._endKeyboardLongPress();
305
+ if (!wasLongPress && !dialPad.disabled && !dialPad.callActive) {
306
+ onDigitClick(digit, {
307
+ parent: dialPad,
308
+ event: new MouseEvent("click", { bubbles: true })
309
+ });
310
+ }
311
+ }
312
+ return true;
313
+ }
192
314
  function syncFieldAndPadValues(x) {
193
315
  x.value = x._textFieldEl.value;
194
316
  }
@@ -211,6 +333,7 @@ function renderTextField(textFieldTag, buttonTag) {
211
333
  ?disabled="${(x) => x.disabled}" helper-text="${(x) => x.helperText}" pattern="${(x) => x.pattern}"
212
334
  aria-label="${(x) => x.locale.dialPad.inputLabel}"
213
335
  @keydown="${(x, c) => handleKeyDown(x, c.event)}"
336
+ @keyup="${(x, c) => handleKeyUp(x, c.event)}"
214
337
  @input="${syncFieldAndPadValues}"
215
338
  @change="${syncFieldAndPadValues}"
216
339
  @focus="${stopPropagation}"
@@ -232,6 +355,10 @@ function renderTextField(textFieldTag, buttonTag) {
232
355
  </${textFieldTag}>`;
233
356
  }
234
357
  function onDigitClick(digit, { parent: dialPad, event }) {
358
+ if (dialPad._suppressNextClick) {
359
+ dialPad._suppressNextClick = false;
360
+ return;
361
+ }
235
362
  dialPad.value += digit.value;
236
363
  dialPad.$emit("keypad-click", event.currentTarget);
237
364
  dialPad.$emit("input");
@@ -254,6 +381,18 @@ function renderDigits(buttonTag, iconTag) {
254
381
  ?autofocus="${(_, c) => c.parent.autofocus && c.parent.noInput && c.index === 0}"
255
382
  aria-label="${(x, c) => c.parent.locale.dialPad[x.ariaLabel]}"
256
383
  ?disabled="${(_, c) => c.parent.disabled}"
384
+ @pointerdown="${(x, c) => c.parent._startLongPress(x.value, c.event)}"
385
+ @pointerup="${(_, c) => c.parent._endLongPress()}"
386
+ @pointercancel="${(_, c) => c.parent._cancelLongPress()}"
387
+ @pointerleave="${(_, c) => c.parent._cancelLongPress()}"
388
+ @keydown="${(x, c) => handleButtonKeyDown(x, {
389
+ parent: c.parent,
390
+ event: c.event
391
+ })}"
392
+ @keyup="${(x, c) => handleButtonKeyUp(x, {
393
+ parent: c.parent,
394
+ event: c.event
395
+ })}"
257
396
  @click="${onDigitClick}">
258
397
  <${iconTag} slot="icon"
259
398
  name="${(x) => x.icon}"
@@ -1,26 +1,27 @@
1
- "use strict";const b=require("../bundled/definition3.cjs"),f=require("../bundled/definition10.cjs"),n=require("../bundled/vivid-element.cjs"),h=require("../bundled/definition2.cjs"),g=require("../bundled/definition13.cjs"),_=require("../bundled/localized.cjs"),d=require("../bundled/when.cjs"),$=require("../bundled/repeat.cjs"),y=require("../bundled/ref.cjs"),A=require("../bundled/class-names.cjs"),L=require("../bundled/key-codes.cjs"),w=":host{display:inline-block;margin:16px;inline-size:230px}.base{display:grid;box-sizing:border-box;grid-template-rows:80px 1fr auto}.base.no-input{grid-template-rows:1fr auto}.digits{display:grid;gap:16px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr);inline-size:100%}.phone-field{align-self:flex-start;grid-column:1/-1}.digit-btn{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-pale)}@media (hover: hover){.digit-btn:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-firm-all)}}.digit-btn.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-firm-all)}.digit-btn:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--vvd-color-neutral-100)}.digit-btn.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--vvd-color-neutral-100)}.digit-btn{--_connotation-color-contrast: var(--vvd-dial-pad-accent-contrast, var(--vvd-color-neutral-800));--_connotation-color-soft: var(--vvd-dial-pad-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-pale: var(--vvd-dial-pad-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-fierce: var(--vvd-dial-pad-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-firm-all: var(--vvd-dial-pad-accent-firm-all, var(--vvd-color-neutral-600));--_connotation-color-faint: var(--vvd-dial-pad-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-dim: var(--vvd-dial-pad-accent-dim, var(--vvd-color-neutral-200))}.digit-btn{--vvd-button-accent-firm: var(--_appearance-color-text);display:flex;overflow:hidden;flex-direction:column;border-radius:16px;box-shadow:0 0 0 1px var(--_appearance-color-outline);inline-size:100%}.digit-btn:not(.disabled) .digit-btn-num{color:var(--vvd-color-canvas-text)}.digit-btn:focus-within{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.call-btn{margin-top:32px;grid-column:1/-1}";var x=Object.defineProperty,i=(a,t,e,l)=>{for(var c=void 0,s=a.length-1,u;s>=0;s--)(u=a[s])&&(c=u(t,e,c)||c);return c&&x(t,e,c),c};class o extends _.Localized(n.VividElement){constructor(){super(...arguments),this.helperText=null,this.placeholder=null,this.value="",this.pattern="^[0-9#*]*$",this.disabled=!1,this.pending=!1,this.callActive=!1,this.noCall=!1,this.noInput=!1,this.endCallButtonLabel=null,this.callButtonLabel=null,this.deleteAriaLabel=null,this._onDial=()=>{!this._textFieldEl.checkValidity()?this._announceValidationError(this._textFieldEl.errorValidationMessage??""):this._clearErrorAnnouncement(),this.callActive?this.$emit("end-call"):this.$emit("dial")},this.autofocus=!1,this._errorAnnouncement="",this._forceAnnouncementToggle=!1}valueChanged(t,e){e!=null&&this._textFieldEl&&e!==this._textFieldEl.value&&(this._textFieldEl.value=e,this._textFieldEl.reportValidity())}focus(){const t=this.shadowRoot?.querySelectorAll(".digits .digit-btn");(this._textFieldEl||t?.[0])?.focus()}_announceValidationError(t){this._errorAnnouncement="",window.queueMicrotask(()=>{t?(this._forceAnnouncementToggle=!this._forceAnnouncementToggle,this._errorAnnouncement=`${t}${this._forceAnnouncementToggle?"​":""}`):this._clearErrorAnnouncement()})}_clearErrorAnnouncement(){this._errorAnnouncement="",this._forceAnnouncementToggle=!1}}i([n.attr({attribute:"helper-text"})],o.prototype,"helperText");i([n.attr],o.prototype,"placeholder");i([n.attr({mode:"fromView"})],o.prototype,"value");i([n.attr({mode:"fromView"})],o.prototype,"pattern");i([n.attr({mode:"boolean"})],o.prototype,"disabled");i([n.attr({mode:"boolean"})],o.prototype,"pending");i([n.attr({attribute:"call-active",mode:"boolean"})],o.prototype,"callActive");i([n.attr({mode:"boolean",attribute:"no-call"})],o.prototype,"noCall");i([n.attr({mode:"boolean",attribute:"no-input"})],o.prototype,"noInput");i([n.attr({attribute:"end-call-button-label"})],o.prototype,"endCallButtonLabel");i([n.attr({attribute:"call-button-label"})],o.prototype,"callButtonLabel");i([n.attr({attribute:"delete-aria-label"})],o.prototype,"deleteAriaLabel");i([n.attr({mode:"boolean"})],o.prototype,"autofocus");i([n.observable],o.prototype,"_errorAnnouncement");class r{constructor(t,e,l,c,s){this.value=t,this.label=e,this.ariaLabel=l,this.icon=c,this.id=s}}const m=[new r("1","&nbsp;","digitOneLabel","one-solid","btn1"),new r("2","ABC","digitTwoLabel","two-solid","btn2"),new r("3","DEF","digitThreeLabel","three-solid","btn3"),new r("4","GHI","digitFourLabel","four-solid","btn4"),new r("5","JKL","digitFiveLabel","five-solid","btn5"),new r("6","MNO","digitSixLabel","six-solid","btn6"),new r("7","PQRS","digitSevenLabel","seven-solid","btn7"),new r("8","TUV","digitEightLabel","eight-solid","btn8"),new r("9","WXYZ","digitNineLabel","nine-solid","btn9"),new r("*",null,"digitAsteriskLabel","asterisk-2-solid","btnAsterisk"),new r("0","+","digitZeroLabel","zero-solid","btn0"),new r("#",null,"digitHashtagLabel","hashtag-solid","btnHashtag")],E=({noInput:a})=>A.classNames("base",["no-input",!!a]);function F(a,t){if(t.key===L.keyEnter&&!a.pending&&!a.disabled&&!a.callActive&&!a.noCall&&a.value.length>0&&t.target instanceof HTMLInputElement)a._onDial();else{const e=m.findIndex(l=>l.value===t.key);if(e>-1){const l=a.shadowRoot.querySelector(".digits").children[e];l&&(l.active=!0,setTimeout(()=>{l.active=!1},200))}}return!0}function p(a){a.value=a._textFieldEl.value}function v(a,{event:t}){t.stopImmediatePropagation()}function k(a){a.value=a.value.slice(0,-1),a.$emit("input"),a.$emit("change"),a.value===""&&a._textFieldEl?.focus()}function D(a,t){return n.html`<${a} ${y.ref("_textFieldEl")} class="phone-field" internal-part type="tel"
1
+ "use strict";const b=require("../bundled/definition3.cjs"),h=require("../bundled/definition10.cjs"),o=require("../bundled/vivid-element.cjs"),f=require("../bundled/definition2.cjs"),g=require("../bundled/definition14.cjs"),$=require("../bundled/localized.cjs"),d=require("../bundled/when.cjs"),L=require("../bundled/repeat.cjs"),y=require("../bundled/ref.cjs"),w=require("../bundled/class-names.cjs"),k=require("../bundled/key-codes.cjs"),P=":host{display:inline-block;margin:16px;inline-size:230px}.base{display:grid;box-sizing:border-box;grid-template-rows:80px 1fr auto}.base.no-input{grid-template-rows:1fr auto}.digits{display:grid;gap:16px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr);inline-size:100%}.phone-field{align-self:flex-start;grid-column:1/-1}.digit-btn{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-pale)}@media (hover: hover){.digit-btn:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-firm-all)}}.digit-btn.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-firm-all)}.digit-btn:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--vvd-color-neutral-100)}.digit-btn.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--vvd-color-neutral-100)}.digit-btn{--_connotation-color-contrast: var(--vvd-dial-pad-accent-contrast, var(--vvd-color-neutral-800));--_connotation-color-soft: var(--vvd-dial-pad-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-pale: var(--vvd-dial-pad-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-fierce: var(--vvd-dial-pad-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-firm-all: var(--vvd-dial-pad-accent-firm-all, var(--vvd-color-neutral-600));--_connotation-color-faint: var(--vvd-dial-pad-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-dim: var(--vvd-dial-pad-accent-dim, var(--vvd-color-neutral-200))}.digit-btn{--vvd-button-accent-firm: var(--_appearance-color-text);display:flex;overflow:hidden;flex-direction:column;border-radius:16px;box-shadow:0 0 0 1px var(--_appearance-color-outline);inline-size:100%}.digit-btn:not(.disabled) .digit-btn-num{color:var(--vvd-color-canvas-text)}.digit-btn:focus-within{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.call-btn{margin-top:32px;grid-column:1/-1}";var A=Object.defineProperty,i=(n,t,e,a)=>{for(var s=void 0,c=n.length-1,u;c>=0;c--)(u=n[c])&&(s=u(t,e,s)||s);return s&&A(t,e,s),s};class l extends $.Localized(o.VividElement){constructor(){super(...arguments),this.helperText=null,this.placeholder=null,this.value="",this.pattern="^[0-9#*]*$",this.disabled=!1,this.pending=!1,this.callActive=!1,this.noCall=!1,this.noInput=!1,this.endCallButtonLabel=null,this.callButtonLabel=null,this.deleteAriaLabel=null,this._longPressTimeoutId=null,this._suppressNextClick=!1,this._keyboardLongPressCompleted=!1,this._onDial=()=>{!this._textFieldEl.checkValidity()?this._announceValidationError(this._textFieldEl.errorValidationMessage??""):this._clearErrorAnnouncement(),this.callActive?this.$emit("end-call"):this.$emit("dial")},this.autofocus=!1,this._errorAnnouncement="",this._forceAnnouncementToggle=!1}valueChanged(t,e){e!=null&&this._textFieldEl&&e!==this._textFieldEl.value&&(this._textFieldEl.value=e,this._textFieldEl.reportValidity())}_startLongPress(t,e){if(this.disabled||this.callActive||t!=="0")return;this._clearLongPressTimer();const a=e.currentTarget;this._longPressTimeoutId=window.setTimeout(()=>{this._suppressNextClick=!0,this.value+="+",this.$emit("keypad-click",a),this.$emit("input"),this.$emit("change")},600)}_startKeyboardLongPress(){this.disabled||this.callActive||this._longPressTimeoutId===null&&(this._keyboardLongPressCompleted=!1,this._longPressTimeoutId=window.setTimeout(()=>{this._keyboardLongPressCompleted=!0,this.value+="+",this.$emit("input"),this.$emit("change")},650))}_endLongPress(){this._clearLongPressTimer(),window.setTimeout(()=>{this._suppressNextClick&&(this._suppressNextClick=!1)},0)}_endKeyboardLongPress(){const t=this._keyboardLongPressCompleted;return this._clearLongPressTimer(),window.setTimeout(()=>{this._keyboardLongPressCompleted=!1},0),t}_cancelLongPress(){this._clearLongPressTimer()}_clearLongPressTimer(){this._longPressTimeoutId!==null&&(clearTimeout(this._longPressTimeoutId),this._longPressTimeoutId=null)}focus(){const t=this.shadowRoot?.querySelectorAll(".digits .digit-btn");(this._textFieldEl||t?.[0])?.focus()}_announceValidationError(t){this._errorAnnouncement="",window.queueMicrotask(()=>{t?(this._forceAnnouncementToggle=!this._forceAnnouncementToggle,this._errorAnnouncement=`${t}${this._forceAnnouncementToggle?"​":""}`):this._clearErrorAnnouncement()})}_clearErrorAnnouncement(){this._errorAnnouncement="",this._forceAnnouncementToggle=!1}}i([o.attr({attribute:"helper-text"})],l.prototype,"helperText");i([o.attr],l.prototype,"placeholder");i([o.attr({mode:"fromView"})],l.prototype,"value");i([o.attr({mode:"fromView"})],l.prototype,"pattern");i([o.attr({mode:"boolean"})],l.prototype,"disabled");i([o.attr({mode:"boolean"})],l.prototype,"pending");i([o.attr({attribute:"call-active",mode:"boolean"})],l.prototype,"callActive");i([o.attr({mode:"boolean",attribute:"no-call"})],l.prototype,"noCall");i([o.attr({mode:"boolean",attribute:"no-input"})],l.prototype,"noInput");i([o.attr({attribute:"end-call-button-label"})],l.prototype,"endCallButtonLabel");i([o.attr({attribute:"call-button-label"})],l.prototype,"callButtonLabel");i([o.attr({attribute:"delete-aria-label"})],l.prototype,"deleteAriaLabel");i([o.attr({mode:"boolean"})],l.prototype,"autofocus");i([o.observable],l.prototype,"_errorAnnouncement");class r{constructor(t,e,a,s,c){this.value=t,this.label=e,this.ariaLabel=a,this.icon=s,this.id=c}}const _=[new r("1","&nbsp;","digitOneLabel","one-solid","btn1"),new r("2","ABC","digitTwoLabel","two-solid","btn2"),new r("3","DEF","digitThreeLabel","three-solid","btn3"),new r("4","GHI","digitFourLabel","four-solid","btn4"),new r("5","JKL","digitFiveLabel","five-solid","btn5"),new r("6","MNO","digitSixLabel","six-solid","btn6"),new r("7","PQRS","digitSevenLabel","seven-solid","btn7"),new r("8","TUV","digitEightLabel","eight-solid","btn8"),new r("9","WXYZ","digitNineLabel","nine-solid","btn9"),new r("*",null,"digitAsteriskLabel","asterisk-2-solid","btnAsterisk"),new r("0","+","digitZeroLabel","zero-solid","btn0"),new r("#",null,"digitHashtagLabel","hashtag-solid","btnHashtag")],T=({noInput:n})=>w.classNames("base",["no-input",!!n]);function x(n,t){if(t.key===k.keyEnter&&!n.pending&&!n.disabled&&!n.callActive&&!n.noCall&&n.value.length>0&&t.target instanceof HTMLInputElement)n._onDial();else if(t.key===" "||t.key==="Space")t.target instanceof HTMLInputElement&&(t.preventDefault(),t.repeat||n._startKeyboardLongPress());else{const e=_.findIndex(a=>a.value===t.key);if(e>-1){const a=n.shadowRoot.querySelector(".digits").children[e];a&&(a.active=!0,setTimeout(()=>{a.active=!1},200))}}return!0}function C(n,t){return(t.key===" "||t.key==="Space")&&t.target instanceof HTMLInputElement&&(t.preventDefault(),!n._endKeyboardLongPress()&&!n.disabled&&!n.callActive&&(n.value+=" ",n.$emit("input"),n.$emit("change"))),!0}function E(n,{parent:t,event:e}){return(e.key===" "||e.key==="Space")&&n.value==="0"&&(e.preventDefault(),e.repeat||t._startKeyboardLongPress()),!0}function D(n,{parent:t,event:e}){return(e.key===" "||e.key==="Space")&&n.value==="0"&&(e.preventDefault(),!t._endKeyboardLongPress()&&!t.disabled&&!t.callActive&&m(n,{parent:t,event:new MouseEvent("click",{bubbles:!0})})),!0}function p(n){n.value=n._textFieldEl.value}function v(n,{event:t}){t.stopImmediatePropagation()}function F(n){n.value=n.value.slice(0,-1),n.$emit("input"),n.$emit("change"),n.value===""&&n._textFieldEl?.focus()}function I(n,t){return o.html`<${n} ${y.ref("_textFieldEl")} class="phone-field" internal-part type="tel"
2
2
  value="${e=>e.value}" placeholder="${e=>e.placeholder}"
3
3
  ?disabled="${e=>e.disabled}" helper-text="${e=>e.helperText}" pattern="${e=>e.pattern}"
4
4
  aria-label="${e=>e.locale.dialPad.inputLabel}"
5
- @keydown="${(e,l)=>F(e,l.event)}"
5
+ @keydown="${(e,a)=>x(e,a.event)}"
6
+ @keyup="${(e,a)=>C(e,a.event)}"
6
7
  @input="${p}"
7
8
  @change="${p}"
8
9
  @focus="${v}"
9
10
  @blur="${v}"
10
11
  ?autofocus="${e=>e.autofocus}"
11
12
  >
12
- ${d.when(e=>e.value&&e.value.length&&e.value.length>0,n.html`<${t}
13
+ ${d.when(e=>e.value&&e.value.length&&e.value.length>0,o.html`<${t}
13
14
  slot="action-items"
14
15
  size='super-condensed'
15
16
  icon="backspace-line"
16
17
  aria-label="${e=>e.deleteAriaLabel||e.locale.dialPad.deleteButtonLabel}"
17
18
  appearance='ghost'
18
19
  ?disabled="${e=>e.disabled||e.callActive}"
19
- @click="${e=>k(e)}">
20
+ @click="${e=>F(e)}">
20
21
  </${t}>`)}
21
- </${a}>`}function C(a,{parent:t,event:e}){t.value+=a.value,t.$emit("keypad-click",e.currentTarget),t.$emit("input"),t.$emit("change")}function T(a,t){return n.html`
22
- ${$.repeat(e=>m,n.html`
23
- <${a}
22
+ </${n}>`}function m(n,{parent:t,event:e}){if(t._suppressNextClick){t._suppressNextClick=!1;return}t.value+=n.value,t.$emit("keypad-click",e.currentTarget),t.$emit("input"),t.$emit("change")}function B(n,t){return o.html`
23
+ ${L.repeat(e=>_,o.html`
24
+ <${n}
24
25
  id="${e=>e.id}"
25
26
  value="${e=>e.value}"
26
27
  stacked
@@ -29,16 +30,22 @@
29
30
  label="${e=>e.label==="&nbsp;"?" ":e.label}"
30
31
  size='condensed'
31
32
  class="digit-btn"
32
- ?autofocus="${(e,l)=>l.parent.autofocus&&l.parent.noInput&&l.index===0}"
33
- aria-label="${(e,l)=>l.parent.locale.dialPad[e.ariaLabel]}"
34
- ?disabled="${(e,l)=>l.parent.disabled}"
35
- @click="${C}">
33
+ ?autofocus="${(e,a)=>a.parent.autofocus&&a.parent.noInput&&a.index===0}"
34
+ aria-label="${(e,a)=>a.parent.locale.dialPad[e.ariaLabel]}"
35
+ ?disabled="${(e,a)=>a.parent.disabled}"
36
+ @pointerdown="${(e,a)=>a.parent._startLongPress(e.value,a.event)}"
37
+ @pointerup="${(e,a)=>a.parent._endLongPress()}"
38
+ @pointercancel="${(e,a)=>a.parent._cancelLongPress()}"
39
+ @pointerleave="${(e,a)=>a.parent._cancelLongPress()}"
40
+ @keydown="${(e,a)=>E(e,{parent:a.parent,event:a.event})}"
41
+ @keyup="${(e,a)=>D(e,{parent:a.parent,event:a.event})}"
42
+ @click="${m}">
36
43
  <${t} slot="icon"
37
44
  name="${e=>e.icon}"
38
45
  class="digit-btn-num"></${t}>
39
- </${a}>
46
+ </${n}>
40
47
  `,{positioning:!0})}
41
- `}function B(a){return n.html`<${a} class="call-btn"
48
+ `}function q(n){return o.html`<${n} class="call-btn"
42
49
  size="expanded"
43
50
  appearance="filled"
44
51
  icon="${t=>t.callActive?"disable-call-line":"call-line"}"
@@ -47,11 +54,11 @@
47
54
  ?pending="${t=>t.pending}"
48
55
  @click="${t=>t._onDial()}"
49
56
  label="${t=>t.callActive?t.endCallButtonLabel||t.locale.dialPad.endCallButtonLabel:t.callButtonLabel||t.locale.dialPad.callButtonLabel}">
50
- </${a}>`}function q(a){return n.html`<${a} role="alert" aria-atomic="true">
57
+ </${n}>`}function K(n){return o.html`<${n} role="alert" aria-atomic="true">
51
58
  ${t=>`${t.locale.dialPad.errorLabel} ${t._errorAnnouncement}`}
52
- </${a}>`}const I=a=>{const t=a.tagFor(b.Button),e=a.tagFor(h.Icon),l=a.tagFor(f.TextField),c=a.tagFor(g.VisuallyHidden);return n.html` <div class="${E}">
53
- ${d.when(s=>!s.noInput,D(l,t))}
54
- <div class="digits">${T(t,e)}</div>
55
- ${d.when(s=>!s.noCall,B(t))}
56
- ${q(c)}
57
- </div>`},z=n.defineVividComponent("dial-pad",o,I,[b.buttonDefinition,f.textFieldDefinition,h.iconDefinition,g.visuallyHiddenDefinition],{styles:w}),P=n.createRegisterFunction(z);P();
59
+ </${n}>`}const N=n=>{const t=n.tagFor(b.Button),e=n.tagFor(f.Icon),a=n.tagFor(h.TextField),s=n.tagFor(g.VisuallyHidden);return o.html` <div class="${T}">
60
+ ${d.when(c=>!c.noInput,I(a,t))}
61
+ <div class="digits">${B(t,e)}</div>
62
+ ${d.when(c=>!c.noCall,q(t))}
63
+ ${K(s)}
64
+ </div>`},z=o.defineVividComponent("dial-pad",l,N,[b.buttonDefinition,h.textFieldDefinition,f.iconDefinition,g.visuallyHiddenDefinition],{styles:P}),S=o.createRegisterFunction(z);S();