@salesforce/design-system-react 11.0.0-alpha.8 → 11.0.0-alpha.9

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 (383) hide show
  1. package/dist/cjs/components/accordion/index.cjs +1 -1
  2. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  3. package/dist/cjs/components/alert/container.cjs +1 -1
  4. package/dist/cjs/components/alert/container.cjs.map +1 -1
  5. package/dist/cjs/components/avatar/index.cjs +1 -1
  6. package/dist/cjs/components/avatar/index.cjs.map +1 -1
  7. package/dist/cjs/components/button-stateful/check-props.cjs +2 -0
  8. package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -0
  9. package/dist/cjs/components/button-stateful/component.cjs +2 -0
  10. package/dist/cjs/components/button-stateful/component.cjs.map +1 -0
  11. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  12. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  13. package/dist/cjs/components/carousel/index.cjs +1 -1
  14. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  15. package/dist/cjs/components/checkbox/check-props.cjs +1 -1
  16. package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
  17. package/dist/cjs/components/checkbox/index.cjs +1 -1
  18. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  19. package/dist/cjs/components/color-picker/check-props.cjs +1 -1
  20. package/dist/cjs/components/color-picker/check-props.cjs.map +1 -1
  21. package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
  22. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  23. package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs +2 -0
  24. package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs.map +1 -0
  25. package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
  26. package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
  27. package/dist/cjs/components/combobox/check-props.cjs +1 -1
  28. package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
  29. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  30. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  31. package/dist/cjs/components/combobox/index.cjs +1 -1
  32. package/dist/cjs/components/date-picker/check-props.cjs +1 -1
  33. package/dist/cjs/components/date-picker/check-props.cjs.map +1 -1
  34. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  35. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  36. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  37. package/dist/cjs/components/date-picker/private/calendar-wrapper.cjs.map +1 -1
  38. package/dist/cjs/components/expandable-section/index.cjs +1 -1
  39. package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
  40. package/dist/cjs/components/icon/input-icon/index.cjs +1 -1
  41. package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
  42. package/dist/cjs/components/index.cjs +1 -1
  43. package/dist/cjs/components/input/check-props.cjs +1 -1
  44. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  45. package/dist/cjs/components/input/index.cjs +1 -1
  46. package/dist/cjs/components/input/index.cjs.map +1 -1
  47. package/dist/cjs/components/input/private/inner-input.cjs +1 -1
  48. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  49. package/dist/cjs/components/menu-dropdown/button-trigger.cjs +1 -1
  50. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  51. package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
  52. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  53. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  54. package/dist/cjs/components/modal/index.cjs +1 -1
  55. package/dist/cjs/components/modal/index.cjs.map +1 -1
  56. package/dist/cjs/components/popover/index.cjs.map +1 -1
  57. package/dist/cjs/components/popover/popover.cjs +1 -1
  58. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  59. package/dist/cjs/components/radio/check-props.cjs +1 -1
  60. package/dist/cjs/components/radio/check-props.cjs.map +1 -1
  61. package/dist/cjs/components/radio/index.cjs +1 -1
  62. package/dist/cjs/components/radio/index.cjs.map +1 -1
  63. package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
  64. package/dist/cjs/components/radio-button-group/radio.cjs.map +1 -1
  65. package/dist/cjs/components/radio-group/check-props.cjs +2 -0
  66. package/dist/cjs/components/radio-group/check-props.cjs.map +1 -0
  67. package/dist/cjs/components/radio-group/component.cjs +2 -0
  68. package/dist/cjs/components/radio-group/component.cjs.map +1 -0
  69. package/dist/cjs/components/radio-group/index.cjs +1 -1
  70. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  71. package/dist/cjs/components/setup-assistant/step.cjs +1 -1
  72. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  73. package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
  74. package/dist/cjs/components/simple-data-table/check-props.cjs.map +1 -1
  75. package/dist/cjs/components/simple-data-table/column.cjs.map +1 -1
  76. package/dist/cjs/components/simple-data-table/index.cjs +1 -1
  77. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
  78. package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
  79. package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
  80. package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
  81. package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
  82. package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
  83. package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
  84. package/dist/cjs/components/slider/check-props.cjs +1 -1
  85. package/dist/cjs/components/slider/check-props.cjs.map +1 -1
  86. package/dist/cjs/components/slider/index.cjs +1 -1
  87. package/dist/cjs/components/slider/index.cjs.map +1 -1
  88. package/dist/cjs/components/split-view/index.cjs +1 -1
  89. package/dist/cjs/components/split-view/index.cjs.map +1 -1
  90. package/dist/cjs/components/split-view/listbox-check-props.cjs +1 -1
  91. package/dist/cjs/components/split-view/listbox-check-props.cjs.map +1 -1
  92. package/dist/cjs/components/split-view/listbox.cjs +1 -1
  93. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  94. package/dist/cjs/components/tabs/check-props.cjs +2 -0
  95. package/dist/cjs/components/tabs/check-props.cjs.map +1 -0
  96. package/dist/cjs/components/tabs/component.cjs +2 -0
  97. package/dist/cjs/components/tabs/component.cjs.map +1 -0
  98. package/dist/cjs/components/tabs/index.cjs +1 -1
  99. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  100. package/dist/cjs/components/tabs/panel.cjs.map +1 -1
  101. package/dist/cjs/components/textarea/check-props.cjs +1 -1
  102. package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
  103. package/dist/cjs/components/textarea/index.cjs +1 -1
  104. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  105. package/dist/cjs/components/toast/container.cjs +1 -1
  106. package/dist/cjs/components/toast/container.cjs.map +1 -1
  107. package/dist/cjs/components/tooltip/index.cjs +2 -2
  108. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  109. package/dist/cjs/components/tree/check-props.cjs +1 -1
  110. package/dist/cjs/components/tree/check-props.cjs.map +1 -1
  111. package/dist/cjs/components/tree/private/branch.cjs +1 -1
  112. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  113. package/dist/cjs/components/tree/private/item.cjs +1 -1
  114. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  115. package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
  116. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  117. package/dist/cjs/components/tree/tree.cjs +1 -1
  118. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  119. package/dist/cjs/components/vertical-navigation/check-props.cjs +2 -0
  120. package/dist/cjs/components/vertical-navigation/check-props.cjs.map +1 -0
  121. package/dist/cjs/components/vertical-navigation/component.cjs +2 -0
  122. package/dist/cjs/components/vertical-navigation/component.cjs.map +1 -0
  123. package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
  124. package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
  125. package/dist/cjs/components/welcome-mat/info-badge.cjs +1 -1
  126. package/dist/cjs/components/welcome-mat/info-badge.cjs.map +1 -1
  127. package/dist/cjs/utilities/hooks/index.cjs +1 -1
  128. package/dist/cjs/utilities/hooks/use-controllable-state.cjs +2 -0
  129. package/dist/cjs/utilities/hooks/use-controllable-state.cjs.map +1 -0
  130. package/dist/cjs/utilities/warning/required-property.cjs +2 -0
  131. package/dist/cjs/utilities/warning/required-property.cjs.map +1 -0
  132. package/dist/es/components/accordion/index.js +10 -8
  133. package/dist/es/components/accordion/index.js.map +1 -1
  134. package/dist/es/components/alert/container.js +1 -1
  135. package/dist/es/components/alert/container.js.map +1 -1
  136. package/dist/es/components/avatar/index.js +2 -1
  137. package/dist/es/components/avatar/index.js.map +1 -1
  138. package/dist/es/components/button-stateful/check-props.js +14 -0
  139. package/dist/es/components/button-stateful/check-props.js.map +1 -0
  140. package/dist/es/components/button-stateful/component.js +20 -0
  141. package/dist/es/components/button-stateful/component.js.map +1 -0
  142. package/dist/es/components/button-stateful/index.js +102 -94
  143. package/dist/es/components/button-stateful/index.js.map +1 -1
  144. package/dist/es/components/carousel/index.js +112 -130
  145. package/dist/es/components/carousel/index.js.map +1 -1
  146. package/dist/es/components/checkbox/check-props.js +14 -8
  147. package/dist/es/components/checkbox/check-props.js.map +1 -1
  148. package/dist/es/components/checkbox/index.js +40 -33
  149. package/dist/es/components/checkbox/index.js.map +1 -1
  150. package/dist/es/components/color-picker/check-props.js +16 -11
  151. package/dist/es/components/color-picker/check-props.js.map +1 -1
  152. package/dist/es/components/color-picker/color-picker.js +185 -169
  153. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  154. package/dist/es/components/color-picker/private/color-picker-tabs.js +17 -0
  155. package/dist/es/components/color-picker/private/color-picker-tabs.js.map +1 -0
  156. package/dist/es/components/color-picker/private/hsv-color.js +1 -0
  157. package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
  158. package/dist/es/components/combobox/check-props.js +15 -14
  159. package/dist/es/components/combobox/check-props.js.map +1 -1
  160. package/dist/es/components/combobox/combobox.js +399 -399
  161. package/dist/es/components/combobox/combobox.js.map +1 -1
  162. package/dist/es/components/combobox/index.js +4 -4
  163. package/dist/es/components/date-picker/check-props.js +15 -9
  164. package/dist/es/components/date-picker/check-props.js.map +1 -1
  165. package/dist/es/components/date-picker/date-picker.js +144 -138
  166. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  167. package/dist/es/components/date-picker/index.js.map +1 -1
  168. package/dist/es/components/date-picker/private/calendar-wrapper.js.map +1 -1
  169. package/dist/es/components/expandable-section/index.js +32 -26
  170. package/dist/es/components/expandable-section/index.js.map +1 -1
  171. package/dist/es/components/icon/input-icon/index.js +7 -2
  172. package/dist/es/components/icon/input-icon/index.js.map +1 -1
  173. package/dist/es/components/index.js +3 -3
  174. package/dist/es/components/input/check-props.js +19 -17
  175. package/dist/es/components/input/check-props.js.map +1 -1
  176. package/dist/es/components/input/index.js +153 -156
  177. package/dist/es/components/input/index.js.map +1 -1
  178. package/dist/es/components/input/private/inner-input.js +18 -18
  179. package/dist/es/components/input/private/inner-input.js.map +1 -1
  180. package/dist/es/components/menu-dropdown/button-trigger.js +7 -1
  181. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  182. package/dist/es/components/menu-dropdown/index.js.map +1 -1
  183. package/dist/es/components/menu-dropdown/menu-dropdown.js +294 -269
  184. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  185. package/dist/es/components/modal/index.js +1 -1
  186. package/dist/es/components/modal/index.js.map +1 -1
  187. package/dist/es/components/popover/index.js.map +1 -1
  188. package/dist/es/components/popover/popover.js +209 -205
  189. package/dist/es/components/popover/popover.js.map +1 -1
  190. package/dist/es/components/radio/check-props.js +8 -8
  191. package/dist/es/components/radio/check-props.js.map +1 -1
  192. package/dist/es/components/radio/index.js +15 -13
  193. package/dist/es/components/radio/index.js.map +1 -1
  194. package/dist/es/components/radio-button-group/index.js.map +1 -1
  195. package/dist/es/components/radio-button-group/radio.js.map +1 -1
  196. package/dist/es/components/radio-group/check-props.js +14 -0
  197. package/dist/es/components/radio-group/check-props.js.map +1 -0
  198. package/dist/es/components/radio-group/component.js +21 -0
  199. package/dist/es/components/radio-group/component.js.map +1 -0
  200. package/dist/es/components/radio-group/index.js +62 -38
  201. package/dist/es/components/radio-group/index.js.map +1 -1
  202. package/dist/es/components/setup-assistant/step.js +5 -4
  203. package/dist/es/components/setup-assistant/step.js.map +1 -1
  204. package/dist/es/components/simple-data-table/check-props.js +7 -6
  205. package/dist/es/components/simple-data-table/check-props.js.map +1 -1
  206. package/dist/es/components/simple-data-table/column.js.map +1 -1
  207. package/dist/es/components/simple-data-table/index.js +67 -49
  208. package/dist/es/components/simple-data-table/index.js.map +1 -1
  209. package/dist/es/components/simple-data-table/private/head.js +1 -1
  210. package/dist/es/components/simple-data-table/private/head.js.map +1 -1
  211. package/dist/es/components/simple-data-table/private/header-cell.js +50 -52
  212. package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
  213. package/dist/es/components/simple-data-table/private/row.js +43 -57
  214. package/dist/es/components/simple-data-table/private/row.js.map +1 -1
  215. package/dist/es/components/slider/check-props.js +14 -12
  216. package/dist/es/components/slider/check-props.js.map +1 -1
  217. package/dist/es/components/slider/index.js +54 -48
  218. package/dist/es/components/slider/index.js.map +1 -1
  219. package/dist/es/components/split-view/index.js +23 -22
  220. package/dist/es/components/split-view/index.js.map +1 -1
  221. package/dist/es/components/split-view/listbox-check-props.js +10 -2
  222. package/dist/es/components/split-view/listbox-check-props.js.map +1 -1
  223. package/dist/es/components/split-view/listbox.js +67 -50
  224. package/dist/es/components/split-view/listbox.js.map +1 -1
  225. package/dist/es/components/tabs/check-props.js +15 -0
  226. package/dist/es/components/tabs/check-props.js.map +1 -0
  227. package/dist/es/components/tabs/component.js +28 -0
  228. package/dist/es/components/tabs/component.js.map +1 -0
  229. package/dist/es/components/tabs/index.js +84 -69
  230. package/dist/es/components/tabs/index.js.map +1 -1
  231. package/dist/es/components/tabs/panel.js.map +1 -1
  232. package/dist/es/components/textarea/check-props.js +1 -1
  233. package/dist/es/components/textarea/check-props.js.map +1 -1
  234. package/dist/es/components/textarea/index.js +3 -2
  235. package/dist/es/components/textarea/index.js.map +1 -1
  236. package/dist/es/components/toast/container.js +1 -1
  237. package/dist/es/components/toast/container.js.map +1 -1
  238. package/dist/es/components/tooltip/index.js +120 -109
  239. package/dist/es/components/tooltip/index.js.map +1 -1
  240. package/dist/es/components/tree/check-props.js +14 -9
  241. package/dist/es/components/tree/check-props.js.map +1 -1
  242. package/dist/es/components/tree/private/branch.js +38 -35
  243. package/dist/es/components/tree/private/branch.js.map +1 -1
  244. package/dist/es/components/tree/private/item.js +6 -8
  245. package/dist/es/components/tree/private/item.js.map +1 -1
  246. package/dist/es/components/tree/private/render-branch.js +9 -10
  247. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  248. package/dist/es/components/tree/tree.js +126 -97
  249. package/dist/es/components/tree/tree.js.map +1 -1
  250. package/dist/es/components/vertical-navigation/check-props.js +13 -0
  251. package/dist/es/components/vertical-navigation/check-props.js.map +1 -0
  252. package/dist/es/components/vertical-navigation/component.js +27 -0
  253. package/dist/es/components/vertical-navigation/component.js.map +1 -0
  254. package/dist/es/components/vertical-navigation/index.js +27 -26
  255. package/dist/es/components/vertical-navigation/index.js.map +1 -1
  256. package/dist/es/components/welcome-mat/info-badge.js +14 -4
  257. package/dist/es/components/welcome-mat/info-badge.js.map +1 -1
  258. package/dist/es/utilities/hooks/index.js +2 -1
  259. package/dist/es/utilities/hooks/use-controllable-state.js +20 -0
  260. package/dist/es/utilities/hooks/use-controllable-state.js.map +1 -0
  261. package/dist/es/utilities/warning/required-property.js +15 -0
  262. package/dist/es/utilities/warning/required-property.js.map +1 -0
  263. package/dist/types/components/accordion/index.d.ts.map +1 -1
  264. package/dist/types/components/avatar/index.d.ts.map +1 -1
  265. package/dist/types/components/button-stateful/check-props.d.ts +3 -0
  266. package/dist/types/components/button-stateful/check-props.d.ts.map +1 -0
  267. package/dist/types/components/button-stateful/index.d.ts +34 -6
  268. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  269. package/dist/types/components/carousel/index.d.ts +26 -7
  270. package/dist/types/components/carousel/index.d.ts.map +1 -1
  271. package/dist/types/components/checkbox/check-props.d.ts +1 -0
  272. package/dist/types/components/checkbox/check-props.d.ts.map +1 -1
  273. package/dist/types/components/checkbox/index.d.ts +38 -9
  274. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  275. package/dist/types/components/color-picker/check-props.d.ts.map +1 -1
  276. package/dist/types/components/color-picker/color-picker.d.ts +50 -11
  277. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  278. package/dist/types/components/color-picker/index.d.ts +2 -2
  279. package/dist/types/components/color-picker/index.d.ts.map +1 -1
  280. package/dist/types/components/color-picker/private/color-picker-tabs.d.ts +14 -0
  281. package/dist/types/components/color-picker/private/color-picker-tabs.d.ts.map +1 -0
  282. package/dist/types/components/color-picker/private/hsv-color.d.ts.map +1 -1
  283. package/dist/types/components/color-picker/types.d.ts +9 -5
  284. package/dist/types/components/color-picker/types.d.ts.map +1 -1
  285. package/dist/types/components/combobox/check-props.d.ts.map +1 -1
  286. package/dist/types/components/combobox/combobox.d.ts +41 -6
  287. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  288. package/dist/types/components/date-picker/check-props.d.ts.map +1 -1
  289. package/dist/types/components/date-picker/date-picker.d.ts +52 -17
  290. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  291. package/dist/types/components/date-picker/index.d.ts +1 -1
  292. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  293. package/dist/types/components/date-picker/private/calendar-wrapper.d.ts +3 -1
  294. package/dist/types/components/date-picker/private/calendar-wrapper.d.ts.map +1 -1
  295. package/dist/types/components/expandable-section/index.d.ts +15 -3
  296. package/dist/types/components/expandable-section/index.d.ts.map +1 -1
  297. package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
  298. package/dist/types/components/input/check-props.d.ts.map +1 -1
  299. package/dist/types/components/input/index.d.ts +10 -4
  300. package/dist/types/components/input/index.d.ts.map +1 -1
  301. package/dist/types/components/input/private/inner-input.d.ts +2 -4
  302. package/dist/types/components/input/private/inner-input.d.ts.map +1 -1
  303. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  304. package/dist/types/components/menu-dropdown/index.d.ts +1 -1
  305. package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
  306. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +78 -15
  307. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  308. package/dist/types/components/popover/index.d.ts +1 -1
  309. package/dist/types/components/popover/index.d.ts.map +1 -1
  310. package/dist/types/components/popover/popover.d.ts +30 -3
  311. package/dist/types/components/popover/popover.d.ts.map +1 -1
  312. package/dist/types/components/radio/check-props.d.ts.map +1 -1
  313. package/dist/types/components/radio/index.d.ts +42 -9
  314. package/dist/types/components/radio/index.d.ts.map +1 -1
  315. package/dist/types/components/radio-button-group/index.d.ts +20 -10
  316. package/dist/types/components/radio-button-group/index.d.ts.map +1 -1
  317. package/dist/types/components/radio-button-group/radio.d.ts +7 -2
  318. package/dist/types/components/radio-button-group/radio.d.ts.map +1 -1
  319. package/dist/types/components/radio-group/check-props.d.ts +3 -0
  320. package/dist/types/components/radio-group/check-props.d.ts.map +1 -0
  321. package/dist/types/components/radio-group/index.d.ts +51 -8
  322. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  323. package/dist/types/components/radio-group/radio.d.ts +7 -2
  324. package/dist/types/components/radio-group/radio.d.ts.map +1 -1
  325. package/dist/types/components/setup-assistant/step.d.ts +10 -2
  326. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  327. package/dist/types/components/simple-data-table/check-props.d.ts.map +1 -1
  328. package/dist/types/components/simple-data-table/column.d.ts +4 -1
  329. package/dist/types/components/simple-data-table/column.d.ts.map +1 -1
  330. package/dist/types/components/simple-data-table/index.d.ts +10 -2
  331. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  332. package/dist/types/components/simple-data-table/private/header-cell.d.ts.map +1 -1
  333. package/dist/types/components/simple-data-table/private/row.d.ts +4 -2
  334. package/dist/types/components/simple-data-table/private/row.d.ts.map +1 -1
  335. package/dist/types/components/simple-data-table/types.d.ts +40 -13
  336. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  337. package/dist/types/components/slider/check-props.d.ts.map +1 -1
  338. package/dist/types/components/slider/index.d.ts +23 -10
  339. package/dist/types/components/slider/index.d.ts.map +1 -1
  340. package/dist/types/components/split-view/index.d.ts +12 -3
  341. package/dist/types/components/split-view/index.d.ts.map +1 -1
  342. package/dist/types/components/split-view/listbox-check-props.d.ts +1 -0
  343. package/dist/types/components/split-view/listbox-check-props.d.ts.map +1 -1
  344. package/dist/types/components/split-view/listbox.d.ts +41 -10
  345. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  346. package/dist/types/components/tabs/check-props.d.ts +3 -0
  347. package/dist/types/components/tabs/check-props.d.ts.map +1 -0
  348. package/dist/types/components/tabs/index.d.ts +46 -12
  349. package/dist/types/components/tabs/index.d.ts.map +1 -1
  350. package/dist/types/components/tabs/panel.d.ts +4 -0
  351. package/dist/types/components/tabs/panel.d.ts.map +1 -1
  352. package/dist/types/components/textarea/check-props.d.ts.map +1 -1
  353. package/dist/types/components/textarea/index.d.ts +14 -6
  354. package/dist/types/components/textarea/index.d.ts.map +1 -1
  355. package/dist/types/components/toast/container.d.ts +1 -1
  356. package/dist/types/components/tooltip/index.d.ts +49 -3
  357. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  358. package/dist/types/components/tree/check-props.d.ts +1 -0
  359. package/dist/types/components/tree/check-props.d.ts.map +1 -1
  360. package/dist/types/components/tree/private/branch.d.ts +6 -1
  361. package/dist/types/components/tree/private/branch.d.ts.map +1 -1
  362. package/dist/types/components/tree/private/item.d.ts +3 -1
  363. package/dist/types/components/tree/private/item.d.ts.map +1 -1
  364. package/dist/types/components/tree/private/render-branch.d.ts +3 -1
  365. package/dist/types/components/tree/private/render-branch.d.ts.map +1 -1
  366. package/dist/types/components/tree/tree.d.ts +33 -6
  367. package/dist/types/components/tree/tree.d.ts.map +1 -1
  368. package/dist/types/components/tree/types.d.ts +23 -4
  369. package/dist/types/components/tree/types.d.ts.map +1 -1
  370. package/dist/types/components/vertical-navigation/check-props.d.ts +1 -0
  371. package/dist/types/components/vertical-navigation/check-props.d.ts.map +1 -1
  372. package/dist/types/components/vertical-navigation/index.d.ts +9 -4
  373. package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
  374. package/dist/types/components/welcome-mat/info-badge.d.ts.map +1 -1
  375. package/dist/types/types/components.d.ts +0 -2
  376. package/dist/types/types/components.d.ts.map +1 -1
  377. package/dist/types/utilities/hooks/index.d.ts +1 -0
  378. package/dist/types/utilities/hooks/index.d.ts.map +1 -1
  379. package/dist/types/utilities/hooks/use-controllable-state.d.ts +23 -0
  380. package/dist/types/utilities/hooks/use-controllable-state.d.ts.map +1 -0
  381. package/dist/types/utilities/warning/required-property.d.ts +3 -0
  382. package/dist/types/utilities/warning/required-property.d.ts.map +1 -0
  383. package/package.json +1 -1
@@ -1,20 +1,21 @@
1
1
  import { DATE_PICKER as e } from "../../utilities/constants.js";
2
2
  import { IconSettingsContext as t } from "../icon-settings/index.js";
3
3
  import n from "../../utilities/event.js";
4
+ import r from "../../utilities/hooks/use-click-outside.js";
5
+ import { useControllableState as i } from "../../utilities/hooks/use-controllable-state.js";
4
6
  import ee from "../../utilities/generate-id.js";
5
- import r from "../../utilities/key-code.js";
7
+ import a from "../../utilities/key-code.js";
6
8
  import te from "../utilities/dialog/index.js";
7
9
  import ne from "../input/index.js";
8
10
  import re from "../icon/input-icon/index.js";
9
- import ie from "../../utilities/hooks/use-click-outside.js";
10
- import ae from "./private/calendar-wrapper.js";
11
- import i from "./check-props.js";
11
+ import ie from "./private/calendar-wrapper.js";
12
+ import ae from "./check-props.js";
12
13
  import oe from "./component.js";
13
- import a from "../../utilities/warning/low-priority-warning.js";
14
- import se, { useCallback as o, useContext as ce, useEffect as le, useRef as s, useState as c } from "react";
15
- import ue from "classnames";
16
- import { jsx as l, jsxs as de } from "react/jsx-runtime";
17
- import u from "lodash.assign";
14
+ import o from "../../utilities/warning/low-priority-warning.js";
15
+ import se, { useCallback as s, useContext as ce, useEffect as le, useRef as c, useState as l } from "react";
16
+ import u from "classnames";
17
+ import { jsx as d, jsxs as ue } from "react/jsx-runtime";
18
+ import de from "lodash.assign";
18
19
  //#region components/date-picker/date-picker.tsx
19
20
  var fe = {
20
21
  nextMonth: "Next month",
@@ -57,174 +58,181 @@ var fe = {
57
58
  "Friday",
58
59
  "Saturday"
59
60
  ]
60
- }, me = (e) => e ? `${e.getMonth() + 1}/${e.getDate()}/${e.getFullYear()}` : "", he = (e) => (a(!1, "Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser."), new Date(e)), d = (a) => {
61
- let { assistiveText: d = {}, align: f = "left", className: p, children: m, disabled: h, dateDisabled: ge = () => !1, formatter: g = me, formattedValue: _e, hasError: ve, hasStaticAlignment: ye, id: be, input: _, isOpen: v, isIsoWeekday: y, labels: xe = {}, menuPosition: b = "absolute", onCalendarFocus: x, onChange: S, onClose: C, onOpen: w, onRequestClose: T, onRequestOpen: E, parser: D = he, portalMount: O, relativeYearFrom: k = -10, relativeYearTo: A = 10, triggerClassName: Se, value: j, label: M, placeholder: N, assistiveTextOpenCalendar: P, required: F, onBlur: I, onFocus: L, onKeyDown: R } = a, z = u({}, fe, d), B = u({}, pe, xe), V = ce(t), Ce = s(null), H = s(null), U = s(null), we = s(ee()), [W, G] = c(!1), [K, q] = c(!1), [Te, Ee] = c(j), [J, De] = c(() => {
62
- let e = g(j);
63
- return j ? e : _e || "";
64
- }), [Oe, ke] = c(() => {
65
- let e = g(j);
66
- return j ? e : _e || "";
67
- }), [Ae, je] = c(!1);
61
+ }, me = (e) => e ? `${e.getMonth() + 1}/${e.getDate()}/${e.getFullYear()}` : "", he = (e) => (o(!1, "Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser."), new Date(e)), ge = (e) => Object.prototype.toString.call(e) === "[object Date]", _e = (e) => e ? String(e.getTime()) : "null", f = (o) => {
62
+ let { assistiveText: f = {}, align: p = "left", className: ve, children: m, disabled: h, dateDisabled: ye = () => !1, defaultIsOpen: be = !1, formatter: g = me, hasError: xe, hasStaticAlignment: _, id: v, input: y, isOpen: Se, isIsoWeekday: b, labels: Ce = {}, menuPosition: x = "absolute", onCalendarFocus: S, onChange: C, onClose: w, onOpen: T, onRequestClose: E, onRequestOpen: D, parser: O = he, portalMount: k, relativeYearFrom: A = -10, relativeYearTo: j = 10, triggerClassName: we, value: Te, label: M, placeholder: N, assistiveTextOpenCalendar: P, required: F, onBlur: I, onFocus: L, onKeyDown: R } = o, z = de({}, fe, f), B = de({}, pe, Ce), Ee = ce(t), De = c(null), V = c(null), H = c(null), Oe = c(ee()), U = Te ?? null, W = _e(U), [ke, G] = i(Se, be), [K, q] = l(!1), [J, Ae] = l(() => ({
63
+ text: g(U),
64
+ valueKey: W,
65
+ typedKey: null
66
+ })), [je, Me] = l(!1);
67
+ J.valueKey !== W && Ae({
68
+ text: J.typedKey === W ? J.text : g(U),
69
+ valueKey: W,
70
+ typedKey: null
71
+ });
72
+ let Ne = J.text;
68
73
  le(() => {
69
- typeof i == "function" && i(e, a, oe);
74
+ typeof ae == "function" && ae(e, o, oe);
70
75
  }, []);
71
- let Y = o(() => be || we.current, [be]), X = o(() => !!(typeof v == "boolean" ? v : W), [v, W]), Z = o((e) => {
72
- let t = D(e);
73
- return (Object.prototype.toString.call(t) !== "[object Date]" || isNaN(t.getTime())) && (t = /* @__PURE__ */ new Date()), t;
74
- }, [D]), Q = o((e, t) => {
75
- X() && (T?.(e, t), G(!1), q(!1), H.current && H.current.focus());
76
- }, [T, X]), Me = o((e) => {
77
- Q(e, { trigger: "escape" });
78
- }, [Q]), Ne = o((e, t) => {
79
- C?.(e, { componentWillUnmount: !!t?.componentWillUnmount });
80
- }, [C]), Pe = o((e, t) => {
81
- w && w(e, t), U.current && K && U.current.focus();
82
- }, [w, K]), $ = o((e, t, n = !1) => {
83
- n || q(!1), E ? E(e, t) : G(!0);
84
- }, [E]), Fe = o((e) => {
85
- q(!0), $(e, { trigger: "icon-click" }, !0);
86
- }, [$]), Ie = o((e, { date: t }) => {
87
- j || (Ee(t), De(g(t)), ke(g(t))), Q(e, { trigger: "date-select" }), S && S(e, {
76
+ let Y = s(() => v || Oe.current, [v]), X = s(() => !!ke, [ke]), Pe = s((e) => {
77
+ let t = O(e);
78
+ return (!ge(t) || isNaN(t.getTime())) && (t = /* @__PURE__ */ new Date()), t;
79
+ }, [O]), Z = s((e, t) => {
80
+ X() && (E?.(e, t), G(!1), q(!1), V.current && V.current.focus());
81
+ }, [
82
+ E,
83
+ X,
84
+ G
85
+ ]), Fe = s((e) => {
86
+ Z(e, { trigger: "escape" });
87
+ }, [Z]), Ie = s((e, t) => {
88
+ w?.(e, { componentWillUnmount: !!t?.componentWillUnmount });
89
+ }, [w]), Le = s((e, t) => {
90
+ T && T(e, t), H.current && K && H.current.focus();
91
+ }, [T, K]), Q = s((e, t, n = !1) => {
92
+ n || q(!1), G(!0), D?.(e, t);
93
+ }, [D, G]), Re = s((e) => {
94
+ q(!0), Q(e, { trigger: "icon-click" }, !0);
95
+ }, [Q]), ze = s((e, { date: t }) => {
96
+ Z(e, { trigger: "date-select" }), C && C(e, {
88
97
  date: t,
89
98
  formattedDate: g(t),
90
99
  timezoneOffset: t.getTimezoneOffset()
91
100
  });
92
101
  }, [
93
- j,
94
102
  g,
95
- Q,
96
- S
97
- ]), Le = o((e) => {
98
- typeof v != "boolean" && W && G(!1), De(e.target.value), ke(e.target.value);
99
- let t = D(e.target.value);
100
- S && S(e, {
101
- date: t,
102
- formattedDate: e.target.value,
103
- timezoneOffset: t.getTimezoneOffset()
103
+ Z,
104
+ C
105
+ ]), Be = s((e) => {
106
+ let t = e.target.value, n = t === "" ? null : O(t), r = ge(n) ? n : null;
107
+ Ae((e) => ({
108
+ ...e,
109
+ text: t,
110
+ typedKey: _e(r)
111
+ })), Z(e, { trigger: "input-change" }), C && C(e, {
112
+ date: r,
113
+ formattedDate: t,
114
+ timezoneOffset: (r ?? /* @__PURE__ */ new Date()).getTimezoneOffset()
104
115
  });
105
116
  }, [
106
- v,
107
- W,
108
- D,
109
- S
110
- ]), Re = o((e) => {
111
- e.keyCode && !e.shiftKey && (e.keyCode === r.DOWN || e.keyCode === r.UP) && (n.trapEvent(e), X() || $(e, { trigger: "keyboard" })), (e.keyCode === r.ESCAPE || e.keyCode === r.ENTER) && (n.trapEvent(e), Q(e, { trigger: e.keyCode === r.ESCAPE ? "escape" : "enter" })), R && R(e, {});
117
+ Z,
118
+ O,
119
+ C
120
+ ]), Ve = s((e) => {
121
+ e.keyCode && !e.shiftKey && (e.keyCode === a.DOWN || e.keyCode === a.UP) && (n.trapEvent(e), X() || Q(e, { trigger: "keyboard" })), (e.keyCode === a.ESCAPE || e.keyCode === a.ENTER) && (n.trapEvent(e), Z(e, { trigger: e.keyCode === a.ESCAPE ? "escape" : "enter" })), R && R(e, {});
112
122
  }, [
113
123
  X,
114
- $,
115
124
  Q,
125
+ Z,
116
126
  R
117
- ]), ze = o((e) => {
118
- Q(e, { trigger: "click-outside" });
119
- }, [Q]);
120
- ie(Ce, ze, {
127
+ ]), He = s((e) => {
128
+ Z(e, { trigger: "click-outside" });
129
+ }, [Z]);
130
+ r(De, He, {
121
131
  enabled: X(),
122
132
  ignoreClass: "ignore-react-onclickoutside"
123
133
  });
124
- let Be = o((e) => {
125
- H.current = e, Ae || je(!0);
126
- }, [Ae]), Ve = o(() => {
134
+ let Ue = s((e) => {
135
+ V.current = e, je || Me(!0);
136
+ }, [je]), We = s(() => {
127
137
  let e;
128
- if (j) {
129
- let t = g(j);
130
- e = t ? Z(t) : j;
131
- } else e = J ? Z(J) : Te || /* @__PURE__ */ new Date();
132
- return /* @__PURE__ */ l(ae, {
138
+ if (U) {
139
+ let t = g(U);
140
+ e = t ? Pe(t) : U;
141
+ } else e = /* @__PURE__ */ new Date();
142
+ return /* @__PURE__ */ d(ie, {
133
143
  abbreviatedWeekDayLabels: B.abbreviatedWeekDays,
134
144
  assistiveTextNextMonth: z.nextMonth,
135
145
  assistiveTextPreviousMonth: z.previousMonth,
136
146
  assistiveTextYear: z.year,
137
147
  canFocusCalendar: K,
138
148
  id: Y(),
139
- isIsoWeekday: y,
149
+ isIsoWeekday: b,
140
150
  monthLabels: B.months,
141
- onCalendarFocus: x,
142
- dateDisabled: ge,
143
- onRequestClose: Me,
144
- onSelectDate: Ie,
145
- relativeYearFrom: k,
146
- relativeYearTo: A,
151
+ onCalendarFocus: S,
152
+ dateDisabled: ye,
153
+ onRequestClose: Fe,
154
+ onSelectDate: ze,
155
+ relativeYearFrom: A,
156
+ relativeYearTo: j,
147
157
  selectedDate: e,
148
158
  selectedDateRef: (e) => {
149
- U.current = e;
159
+ H.current = e;
150
160
  },
151
161
  todayLabel: B.today,
152
162
  weekDayLabels: B.weekDays
153
163
  });
154
164
  }, [
155
- j,
165
+ U,
156
166
  g,
157
- Z,
158
- J,
159
- Te,
167
+ Pe,
160
168
  B,
161
169
  z,
162
170
  K,
163
171
  Y,
164
- y,
165
- x,
166
- ge,
167
- Me,
168
- Ie,
169
- k,
170
- A
171
- ]), He = o(() => {
172
- let e = b === "relative" ? {} : { transform: "none" };
172
+ b,
173
+ S,
174
+ ye,
175
+ Fe,
176
+ ze,
177
+ A,
178
+ j
179
+ ]), Ge = s(() => {
180
+ let e = x === "relative" ? {} : { transform: "none" };
173
181
  if (h || !X()) return null;
174
182
  let t = {
175
- align: `bottom ${f}`,
176
- contentsClassName: ue("slds-datepicker slds-dropdown", {
177
- "slds-dropdown_right": b === "relative" && f === "right",
178
- "slds-dropdown_left": b === "relative" && f === "left"
179
- }, p),
180
- context: V,
181
- hasStaticAlignment: ye,
183
+ align: `bottom ${p}`,
184
+ contentsClassName: u("slds-datepicker slds-dropdown", {
185
+ "slds-dropdown_right": x === "relative" && p === "right",
186
+ "slds-dropdown_left": x === "relative" && p === "left"
187
+ }, ve),
188
+ context: Ee,
189
+ hasStaticAlignment: _,
182
190
  style: e,
183
- onClose: Ne,
184
- onOpen: Pe,
185
- onRequestTargetElement: () => H.current,
186
- position: b,
187
- portalMount: O
191
+ onClose: Ie,
192
+ onOpen: Le,
193
+ onRequestTargetElement: () => V.current,
194
+ position: x,
195
+ portalMount: k
188
196
  };
189
- return /* @__PURE__ */ l(te, {
197
+ return /* @__PURE__ */ d(te, {
190
198
  ...t,
191
- children: Ve()
199
+ children: We()
192
200
  });
193
201
  }, [
194
- b,
202
+ x,
195
203
  h,
196
204
  X,
197
- f,
198
205
  p,
199
- V,
200
- ye,
201
- Ne,
202
- Pe,
203
- O,
204
- Ve
205
- ]), Ue = o(() => {
206
+ ve,
207
+ Ee,
208
+ _,
209
+ Ie,
210
+ Le,
211
+ k,
212
+ We
213
+ ]), $ = s(() => {
206
214
  let e = {
207
- iconRight: /* @__PURE__ */ l(re, {
215
+ iconRight: /* @__PURE__ */ d(re, {
208
216
  assistiveText: { icon: P || z.openCalendar },
209
217
  "aria-haspopup": !0,
210
218
  "aria-expanded": X(),
211
219
  category: "utility",
212
220
  name: "event",
213
221
  onClick: (e) => {
214
- Fe(e);
222
+ Re(e);
215
223
  },
216
224
  type: "button"
217
225
  }),
218
226
  inputRef: (e) => {
219
- Be(e);
227
+ Ue(e);
220
228
  },
221
229
  id: Y(),
222
- onChange: Le,
230
+ onChange: Be,
223
231
  onClick: (e) => {
224
- $(e, { trigger: "input-click" });
232
+ Q(e, { trigger: "input-click" });
225
233
  },
226
- onKeyDown: Re,
227
- value: j ? g(j) : Oe
234
+ onKeyDown: Ve,
235
+ value: Ne
228
236
  }, t = {
229
237
  disabled: h,
230
238
  label: M || B.label,
@@ -232,31 +240,29 @@ var fe = {
232
240
  onFocus: L,
233
241
  placeholder: N || B.placeholder,
234
242
  required: F
235
- }, n = m?.props || {}, ee = {
243
+ }, n = m?.props || {}, r = {
236
244
  ...n,
237
245
  onClick: (e) => {
238
- $(e, { trigger: "input-click" }), typeof n.onClick == "function" && n.onClick();
246
+ Q(e, { trigger: "input-click" }), typeof n.onClick == "function" && n.onClick();
239
247
  }
240
- }, r = _?.props || {};
248
+ }, i = y?.props || {};
241
249
  return {
242
250
  ...e,
243
251
  ...t,
244
- ...ee,
245
- ...r
252
+ ...r,
253
+ ...i
246
254
  };
247
255
  }, [
248
256
  P,
249
257
  z.openCalendar,
250
258
  X,
251
- Fe,
252
- Be,
253
- Y,
254
- Le,
255
- $,
256
259
  Re,
257
- j,
258
- g,
259
- Oe,
260
+ Ue,
261
+ Y,
262
+ Be,
263
+ Q,
264
+ Ve,
265
+ Ne,
260
266
  h,
261
267
  M,
262
268
  B.label,
@@ -266,19 +272,19 @@ var fe = {
266
272
  N,
267
273
  F,
268
274
  m,
269
- _
270
- ])(), We = m ? se.cloneElement(m, Ue) : /* @__PURE__ */ l(ne, { ...Ue });
271
- return /* @__PURE__ */ de("div", {
272
- ref: Ce,
273
- className: ue("slds-dropdown-trigger", "slds-dropdown-trigger_click", "ignore-react-onclickoutside", {
274
- "slds-has-error": ve,
275
+ y
276
+ ])(), Ke = m ? se.cloneElement(m, $) : /* @__PURE__ */ d(ne, { ...$ });
277
+ return /* @__PURE__ */ ue("div", {
278
+ ref: De,
279
+ className: u("slds-dropdown-trigger", "slds-dropdown-trigger_click", "ignore-react-onclickoutside", {
280
+ "slds-has-error": xe,
275
281
  "slds-is-open": X()
276
- }, Se),
277
- children: [We, He()]
282
+ }, we),
283
+ children: [Ke, Ge()]
278
284
  });
279
285
  };
280
- d.displayName = e;
286
+ f.displayName = e;
281
287
  //#endregion
282
- export { d as default };
288
+ export { f as default };
283
289
 
284
290
  //# sourceMappingURL=date-picker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.js","names":[],"sources":["../../../../components/date-picker/date-picker.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype KeyboardEvent,\n\ttype ChangeEvent,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport classNames from 'classnames';\n\nimport Dialog from '../utilities/dialog';\nimport CalendarWrapper from './private/calendar-wrapper';\nimport InputIcon from '../icon/input-icon';\nimport Input from '../input';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport KEYS from '../../utilities/key-code';\nimport lowPriorityWarning from '../../utilities/warning/low-priority-warning';\n\nimport { DATE_PICKER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { IconSettingsContext } from '../icon-settings';\nimport { useClickOutside } from '../../utilities/hooks/use-click-outside';\n\n// ===== Types =====\n\nexport interface DatePickerAssistiveText {\n\tnextMonth?: string;\n\topenCalendar?: string;\n\tpreviousMonth?: string;\n\tyear?: string;\n}\n\nexport interface DatePickerLabels {\n\tabbreviatedWeekDays?: string[];\n\tlabel?: string;\n\tmonths?: string[];\n\tplaceholder?: string;\n\ttoday?: string;\n\tweekDays?: string[];\n}\n\nexport interface DatePickerChangeData {\n\tdate: Date;\n\tformattedDate: string;\n\ttimezoneOffset: number;\n}\n\n/**\n * What caused the DatePicker to request opening its calendar.\n * - `input-click`: the input (or deprecated `children` input) was clicked\n * - `icon-click`: the calendar icon button was clicked\n * - `keyboard`: Down or Up arrow was pressed in the input\n */\nexport type DatePickerRequestOpenTrigger =\n\t'input-click' | 'icon-click' | 'keyboard';\n\n/** Data passed to `onRequestOpen` */\nexport interface DatePickerRequestOpenData {\n\t/** What caused the open request */\n\ttrigger: DatePickerRequestOpenTrigger;\n}\n\n/**\n * What caused the DatePicker to request closing its calendar.\n * - `date-select`: a date was selected in the calendar (click, Space, or Enter)\n * - `escape`: Escape was pressed in the input or in the calendar\n * - `enter`: Enter was pressed in the input\n * - `click-outside`: a mousedown/touchstart happened outside the DatePicker\n */\nexport type DatePickerRequestCloseTrigger =\n\t'date-select' | 'escape' | 'enter' | 'click-outside';\n\n/** Data passed to `onRequestClose` */\nexport interface DatePickerRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: DatePickerRequestCloseTrigger;\n}\n\n/** Data passed to `onClose` */\nexport interface DatePickerCloseData {\n\t/**\n\t * `true` when the close was reported by the calendar dialog unmounting. The calendar\n\t * dialog is unmounted whenever the DatePicker closes, so this is currently always `true`.\n\t */\n\tcomponentWillUnmount: boolean;\n}\n\nexport interface DatePickerProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: DatePickerAssistiveText;\n\t/** Alignment of dropdown */\n\talign?: 'left' | 'right';\n\t/** CSS classes for datepicker */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Children (deprecated - use input prop) */\n\tchildren?: ReactElement;\n\t/** Whether component is disabled */\n\tdisabled?: boolean;\n\t/** Function to determine if a date should be disabled */\n\tdateDisabled?: (date: Date) => boolean;\n\t/** Date formatting function */\n\tformatter?: (date: Date | null | undefined) => string;\n\t/** Initial formatted value (deprecated) */\n\tformattedValue?: string;\n\t/** Whether to show error state */\n\thasError?: boolean;\n\t/** Prevent dropdown position flipping */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Custom input component */\n\tinput?: ReactElement;\n\t/** Whether dropdown is open (controlled) */\n\tisOpen?: boolean;\n\t/** Make Monday first day of week */\n\tisIsoWeekday?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: DatePickerLabels;\n\t/** Menu position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Called when calendar focus changes */\n\tonCalendarFocus?: (\n\t\tevent: React.SyntheticEvent | null,\n\t\tdata: { date?: Date; ref?: HTMLElement; direction?: string }\n\t) => void;\n\t/** Called when date changes */\n\tonChange?: (event: React.SyntheticEvent, data: DatePickerChangeData) => void;\n\t/**\n\t * Called after the calendar has closed. `event` is `undefined` because the close\n\t * is reported when the calendar dialog unmounts, not by a user event.\n\t */\n\tonClose?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: DatePickerCloseData\n\t) => void;\n\t/** Called when calendar opens */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: { portal?: HTMLElement }\n\t) => void;\n\t/**\n\t * Called when the calendar requests to close. Only fires while the calendar is open.\n\t * `event` is the triggering React event; for `trigger: 'click-outside'` it is the\n\t * native `mousedown`/`touchstart` event from the document listener. It is typed as\n\t * possibly `undefined` because the internal calendar's close request has an optional event.\n\t * In uncontrolled mode the calendar also closes itself; in controlled mode (`isOpen`)\n\t * set `isOpen` to `false` here.\n\t */\n\tonRequestClose?: (\n\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\tdata: DatePickerRequestCloseData\n\t) => void;\n\t/**\n\t * Called when the calendar requests to open. If provided, the calendar does not open\n\t * itself: set `isOpen` to `true` here. Not fired by the arrow keys while already open.\n\t */\n\tonRequestOpen?: (\n\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\tdata: DatePickerRequestOpenData\n\t) => void;\n\t/** Date parsing function */\n\tparser?: (str: string) => Date;\n\t/** Portal mount function */\n\tportalMount?: (element: ReactNode, container: HTMLElement) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom?: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo?: number;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Selected date value */\n\tvalue?: Date;\n\t/** @deprecated Use labels.label */\n\tlabel?: string;\n\t/** @deprecated Use labels.placeholder */\n\tplaceholder?: string;\n\t/** @deprecated Use assistiveText.openCalendar */\n\tassistiveTextOpenCalendar?: string;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/** Blur handler */\n\tonBlur?: (event: React.FocusEvent) => void;\n\t/** Focus handler */\n\tonFocus?: (event: React.FocusEvent) => void;\n\t/** Keydown handler */\n\tonKeyDown?: (event: KeyboardEvent, data: Record<string, unknown>) => void;\n}\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<DatePickerAssistiveText> = {\n\tnextMonth: 'Next month',\n\topenCalendar: 'Open Calendar',\n\tpreviousMonth: 'Previous month',\n\tyear: 'Year',\n};\n\nconst defaultLabels: Required<DatePickerLabels> = {\n\tabbreviatedWeekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\tlabel: '',\n\tmonths: [\n\t\t'January',\n\t\t'February',\n\t\t'March',\n\t\t'April',\n\t\t'May',\n\t\t'June',\n\t\t'July',\n\t\t'August',\n\t\t'September',\n\t\t'October',\n\t\t'November',\n\t\t'December',\n\t],\n\tplaceholder: 'Pick a Date',\n\ttoday: 'Today',\n\tweekDays: [\n\t\t'Sunday',\n\t\t'Monday',\n\t\t'Tuesday',\n\t\t'Wednesday',\n\t\t'Thursday',\n\t\t'Friday',\n\t\t'Saturday',\n\t],\n};\n\nconst defaultFormatter = (date: Date | null | undefined): string => {\n\treturn date\n\t\t? `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`\n\t\t: '';\n};\n\nconst defaultParser = (str: string): Date => {\n\tlowPriorityWarning(\n\t\tfalse,\n\t\t`Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser.`\n\t);\n\treturn new Date(str);\n};\n\n// ===== Component =====\n\nconst Datepicker: React.FC<DatePickerProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\talign = 'left',\n\t\tclassName,\n\t\tchildren,\n\t\tdisabled,\n\t\tdateDisabled = () => false,\n\t\tformatter = defaultFormatter,\n\t\tformattedValue: formattedValueProp,\n\t\thasError,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinput,\n\t\tisOpen: isOpenProp,\n\t\tisIsoWeekday,\n\t\tlabels: labelsProp = {},\n\t\tmenuPosition = 'absolute',\n\t\tonCalendarFocus,\n\t\tonChange,\n\t\tonClose,\n\t\tonOpen,\n\t\tonRequestClose,\n\t\tonRequestOpen,\n\t\tparser = defaultParser,\n\t\tportalMount,\n\t\trelativeYearFrom = -10,\n\t\trelativeYearTo = 10,\n\t\ttriggerClassName,\n\t\tvalue,\n\t\t// Deprecated props\n\t\tlabel,\n\t\tplaceholder,\n\t\tassistiveTextOpenCalendar,\n\t\trequired,\n\t\tonBlur,\n\t\tonFocus,\n\t\tonKeyDown,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement | null>(null);\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst selectedDateCellRef = useRef<HTMLElement | null>(null);\n\tconst generatedId = useRef(generateId());\n\n\t// State\n\tconst [isOpenState, setIsOpenState] = useState(false);\n\tconst [isOpenFromIcon, setIsOpenFromIcon] = useState(false);\n\tconst [internalValue, setInternalValue] = useState<Date | undefined>(value);\n\tconst [formattedValue, setFormattedValue] = useState(() => {\n\t\tconst dateString = formatter(value);\n\t\treturn value ? dateString : formattedValueProp || '';\n\t});\n\tconst [inputValue, setInputValue] = useState(() => {\n\t\tconst dateString = formatter(value);\n\t\treturn value ? dateString : formattedValueProp || '';\n\t});\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Check props on mount (only in development)\n\tuseEffect(() => {\n\t\tif (typeof checkProps === 'function') {\n\t\t\tcheckProps(\n\t\t\t\tDATE_PICKER,\n\t\t\t\tprops as unknown as Record<string, unknown>,\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\tconst getId = useCallback(() => idProp || generatedId.current, [idProp]);\n\n\tconst getIsOpen = useCallback(() => {\n\t\treturn !!(typeof isOpenProp === 'boolean' ? isOpenProp : isOpenState);\n\t}, [isOpenProp, isOpenState]);\n\n\tconst parseDate = useCallback(\n\t\t(dateString: string): Date => {\n\t\t\tlet parsedDate = parser(dateString);\n\t\t\tif (\n\t\t\t\tObject.prototype.toString.call(parsedDate) !== '[object Date]' ||\n\t\t\t\tisNaN(parsedDate.getTime())\n\t\t\t) {\n\t\t\t\tparsedDate = new Date();\n\t\t\t}\n\t\t\treturn parsedDate;\n\t\t},\n\t\t[parser]\n\t);\n\n\t// ===== Event Handlers =====\n\n\tconst handleRequestClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\t\tdata: DatePickerRequestCloseData\n\t\t) => {\n\t\t\t// Only request a close while open, so `onRequestClose` never fires when\n\t\t\t// the calendar is already closed (e.g. Escape in a closed input).\n\t\t\tif (!getIsOpen()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonRequestClose?.(event, data);\n\n\t\t\tsetIsOpenState(false);\n\t\t\tsetIsOpenFromIcon(false);\n\n\t\t\tif (inputRef.current) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onRequestClose, getIsOpen]\n\t);\n\n\tconst handleCalendarRequestClose = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\t// The calendar's only close request is Escape (see `CalendarWrapper#handleKeyDown`)\n\t\t\thandleRequestClose(event, { trigger: 'escape' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tonClose?.(event, {\n\t\t\t\tcomponentWillUnmount: !!data?.componentWillUnmount,\n\t\t\t});\n\t\t},\n\t\t[onClose]\n\t);\n\n\tconst handleOpen = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata: { portal?: HTMLElement }\n\t\t) => {\n\t\t\tif (onOpen) {\n\t\t\t\tonOpen(event, data);\n\t\t\t}\n\n\t\t\tif (selectedDateCellRef.current && isOpenFromIcon) {\n\t\t\t\tselectedDateCellRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onOpen, isOpenFromIcon]\n\t);\n\n\tconst openDialog = useCallback(\n\t\t(\n\t\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\t\tdata: DatePickerRequestOpenData,\n\t\t\tfromIcon = false\n\t\t) => {\n\t\t\tif (!fromIcon) {\n\t\t\t\tsetIsOpenFromIcon(false);\n\t\t\t}\n\t\t\tif (onRequestOpen) {\n\t\t\t\tonRequestOpen(event, data);\n\t\t\t} else {\n\t\t\t\tsetIsOpenState(true);\n\t\t\t}\n\t\t},\n\t\t[onRequestOpen]\n\t);\n\n\tconst openDialogFromIcon = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\tsetIsOpenFromIcon(true);\n\t\t\topenDialog(event, { trigger: 'icon-click' }, true);\n\t\t},\n\t\t[openDialog]\n\t);\n\n\tconst handleCalendarChange = useCallback(\n\t\t(event: React.SyntheticEvent, { date }: { date: Date }) => {\n\t\t\tif (!value) {\n\t\t\t\tsetInternalValue(date);\n\t\t\t\tsetFormattedValue(formatter(date));\n\t\t\t\tsetInputValue(formatter(date));\n\t\t\t}\n\n\t\t\thandleRequestClose(event, { trigger: 'date-select' });\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: formatter(date),\n\t\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[value, formatter, handleRequestClose, onChange]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t// Typing in the input closes the calendar when it's used as an uncontrolled component\n\t\t\tif (typeof isOpenProp !== 'boolean' && isOpenState) {\n\t\t\t\tsetIsOpenState(false);\n\t\t\t}\n\n\t\t\tsetFormattedValue(event.target.value);\n\t\t\tsetInputValue(event.target.value);\n\n\t\t\tconst date = parser(event.target.value);\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: event.target.value,\n\t\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[isOpenProp, isOpenState, parser, onChange]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLInputElement>) => {\n\t\t\t// Don't open if user is selecting text\n\t\t\tif (\n\t\t\t\tevent.keyCode &&\n\t\t\t\t!event.shiftKey &&\n\t\t\t\t(event.keyCode === KEYS.DOWN || event.keyCode === KEYS.UP)\n\t\t\t) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\t// Go through the same request path as clicking, so a controlled\n\t\t\t\t// DatePicker hears about keyboard opens via `onRequestOpen`\n\t\t\t\tif (!getIsOpen()) {\n\t\t\t\t\topenDialog(event, { trigger: 'keyboard' });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.keyCode === KEYS.ESCAPE || event.keyCode === KEYS.ENTER) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\thandleRequestClose(event, {\n\t\t\t\t\ttrigger: event.keyCode === KEYS.ESCAPE ? 'escape' : 'enter',\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (onKeyDown) {\n\t\t\t\tonKeyDown(event, {});\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, openDialog, handleRequestClose, onKeyDown]\n\t);\n\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent | TouchEvent) => {\n\t\t\thandleRequestClose(event, { trigger: 'click-outside' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\t// Detect clicks outside the trigger/calendar and close the dialog. Anchored\n\t// on the trigger element so this works whether the DatePicker is controlled\n\t// (`onRequestClose` is invoked via `handleRequestClose`) or uncontrolled\n\t// (internal open state is reset). The trigger carries the\n\t// `ignore-react-onclickoutside` class and, in `overflowBoundaryElement`\n\t// mode, so does the portaled calendar, so clicks within the calendar are\n\t// treated as inside.\n\tuseClickOutside(triggerRef, handleClickOutside, {\n\t\tenabled: getIsOpen(),\n\t\tignoreClass: 'ignore-react-onclickoutside',\n\t});\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback(\n\t\t(component: HTMLInputElement | null) => {\n\t\t\tinputRef.current = component;\n\t\t\tif (!inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t},\n\t\t[inputRendered]\n\t);\n\n\t// ===== Render Helpers =====\n\n\tconst getDatePicker = useCallback(() => {\n\t\tlet date: Date;\n\t\t// Use props if present. Otherwise, use state.\n\t\tif (value) {\n\t\t\tconst formattedDate = formatter(value);\n\t\t\tdate = formattedDate ? parseDate(formattedDate) : value;\n\t\t} else {\n\t\t\tdate = formattedValue\n\t\t\t\t? parseDate(formattedValue)\n\t\t\t\t: internalValue || new Date();\n\t\t}\n\n\t\treturn (\n\t\t\t<CalendarWrapper\n\t\t\t\tabbreviatedWeekDayLabels={labels.abbreviatedWeekDays}\n\t\t\t\tassistiveTextNextMonth={assistiveText.nextMonth}\n\t\t\t\tassistiveTextPreviousMonth={assistiveText.previousMonth}\n\t\t\t\tassistiveTextYear={assistiveText.year}\n\t\t\t\tcanFocusCalendar={isOpenFromIcon}\n\t\t\t\tid={getId()}\n\t\t\t\tisIsoWeekday={isIsoWeekday}\n\t\t\t\tmonthLabels={labels.months}\n\t\t\t\tonCalendarFocus={onCalendarFocus}\n\t\t\t\tdateDisabled={dateDisabled}\n\t\t\t\tonRequestClose={handleCalendarRequestClose}\n\t\t\t\tonSelectDate={handleCalendarChange}\n\t\t\t\trelativeYearFrom={relativeYearFrom}\n\t\t\t\trelativeYearTo={relativeYearTo}\n\t\t\t\tselectedDate={date}\n\t\t\t\tselectedDateRef={(component: HTMLElement | null) => {\n\t\t\t\t\tselectedDateCellRef.current = component;\n\t\t\t\t}}\n\t\t\t\ttodayLabel={labels.today}\n\t\t\t\tweekDayLabels={labels.weekDays}\n\t\t\t/>\n\t\t);\n\t}, [\n\t\tvalue,\n\t\tformatter,\n\t\tparseDate,\n\t\tformattedValue,\n\t\tinternalValue,\n\t\tlabels,\n\t\tassistiveText,\n\t\tisOpenFromIcon,\n\t\tgetId,\n\t\tisIsoWeekday,\n\t\tonCalendarFocus,\n\t\tdateDisabled,\n\t\thandleCalendarRequestClose,\n\t\thandleCalendarChange,\n\t\trelativeYearFrom,\n\t\trelativeYearTo,\n\t]);\n\n\tconst getDialog = useCallback(() => {\n\t\t// SLDS override\n\t\tconst style = menuPosition !== 'relative' ? { transform: 'none' } : {};\n\n\t\tif (disabled || !getIsOpen()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst dialogProps = {\n\t\t\talign: `bottom ${align}` as const,\n\t\t\tcontentsClassName: classNames(\n\t\t\t\t'slds-datepicker slds-dropdown',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_right':\n\t\t\t\t\t\tmenuPosition === 'relative' && align === 'right',\n\t\t\t\t\t'slds-dropdown_left': menuPosition === 'relative' && align === 'left',\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t),\n\t\t\tcontext: iconSettingsContext,\n\t\t\thasStaticAlignment,\n\t\t\tstyle,\n\t\t\tonClose: handleClose,\n\t\t\tonOpen: handleOpen,\n\t\t\tonRequestTargetElement: () => inputRef.current,\n\t\t\tposition: menuPosition,\n\t\t\tportalMount,\n\t\t};\n\n\t\treturn (\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t<Dialog {...(dialogProps as any)}>{getDatePicker()}</Dialog>\n\t\t);\n\t}, [\n\t\tmenuPosition,\n\t\tdisabled,\n\t\tgetIsOpen,\n\t\talign,\n\t\tclassName,\n\t\ticonSettingsContext,\n\t\thasStaticAlignment,\n\t\thandleClose,\n\t\thandleOpen,\n\t\tportalMount,\n\t\tgetDatePicker,\n\t]);\n\n\tconst getInputProps = useCallback(() => {\n\t\tconst defaultInputProps = {\n\t\t\ticonRight: (\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveTextOpenCalendar || assistiveText.openCalendar,\n\t\t\t\t\t}}\n\t\t\t\t\taria-haspopup\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"event\"\n\t\t\t\t\tonClick={(event: React.MouseEvent) => {\n\t\t\t\t\t\topenDialogFromIcon(event);\n\t\t\t\t\t}}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t),\n\t\t\tinputRef: (component: HTMLInputElement | null) => {\n\t\t\t\tsetInputRefCallback(component);\n\t\t\t},\n\t\t\tid: getId(),\n\t\t\tonChange: handleInputChange,\n\t\t\tonClick: (event: React.MouseEvent<HTMLInputElement>) => {\n\t\t\t\topenDialog(event, { trigger: 'input-click' });\n\t\t\t},\n\t\t\tonKeyDown: handleKeyDown,\n\t\t\tvalue: value ? formatter(value) : inputValue,\n\t\t};\n\n\t\tconst topLevelDeprecatedComponentProps = {\n\t\t\tdisabled,\n\t\t\tlabel: label || labels.label,\n\t\t\tonBlur,\n\t\t\tonFocus,\n\t\t\tplaceholder: placeholder || labels.placeholder,\n\t\t\trequired,\n\t\t};\n\n\t\tconst childrenProps = (children?.props || {}) as Record<string, unknown>;\n\t\tconst childrenPropInputProps = {\n\t\t\t...childrenProps,\n\t\t\tonClick: (event: React.MouseEvent<HTMLInputElement>) => {\n\t\t\t\topenDialog(event, { trigger: 'input-click' });\n\t\t\t\tif (typeof childrenProps.onClick === 'function') {\n\t\t\t\t\tchildrenProps.onClick();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\n\t\tconst inputRenderProps = input?.props || {};\n\n\t\treturn {\n\t\t\t...defaultInputProps,\n\t\t\t...topLevelDeprecatedComponentProps,\n\t\t\t...childrenPropInputProps,\n\t\t\t...inputRenderProps,\n\t\t};\n\t}, [\n\t\tassistiveTextOpenCalendar,\n\t\tassistiveText.openCalendar,\n\t\tgetIsOpen,\n\t\topenDialogFromIcon,\n\t\tsetInputRefCallback,\n\t\tgetId,\n\t\thandleInputChange,\n\t\topenDialog,\n\t\thandleKeyDown,\n\t\tvalue,\n\t\tformatter,\n\t\tinputValue,\n\t\tdisabled,\n\t\tlabel,\n\t\tlabels.label,\n\t\tlabels.placeholder,\n\t\tonBlur,\n\t\tonFocus,\n\t\tplaceholder,\n\t\trequired,\n\t\tchildren,\n\t\tinput,\n\t]);\n\n\t// ===== Main Render =====\n\n\tconst inputProps = getInputProps();\n\n\t// `children` prop is a deprecated API\n\tconst inputToRender = children ? (\n\t\tReact.cloneElement(children, inputProps as Record<string, unknown>)\n\t) : (\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t<Input {...(inputProps as any)} />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={triggerRef}\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t{\n\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t},\n\t\t\t\ttriggerClassName\n\t\t\t)}\n\t\t>\n\t\t\t{inputToRender}\n\t\t\t{getDialog()}\n\t\t</div>\n\t);\n};\n\nDatepicker.displayName = DATE_PICKER;\n\nexport default Datepicker;\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0MA,IAAM,KAA0D;CAC/D,WAAW;CACX,cAAc;CACd,eAAe;CACf,MAA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;GAClB,gBAAgB,EAAU;EAC3B,GACA,EACD;EAXD,UAAA,CAaE,IACA,GAAU,CACP;;AAEP;AAEA,EAAW,cAAc"}
1
+ {"version":3,"file":"date-picker.js","names":[],"sources":["../../../../components/date-picker/date-picker.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype KeyboardEvent,\n\ttype ChangeEvent,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport classNames from 'classnames';\n\nimport Dialog from '../utilities/dialog';\nimport CalendarWrapper from './private/calendar-wrapper';\nimport InputIcon from '../icon/input-icon';\nimport Input from '../input';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport KEYS from '../../utilities/key-code';\nimport lowPriorityWarning from '../../utilities/warning/low-priority-warning';\n\nimport { DATE_PICKER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { IconSettingsContext } from '../icon-settings';\nimport { useClickOutside, useControllableState } from '../../utilities/hooks';\n\n// ===== Types =====\n\nexport interface DatePickerAssistiveText {\n\tnextMonth?: string;\n\topenCalendar?: string;\n\tpreviousMonth?: string;\n\tyear?: string;\n}\n\nexport interface DatePickerLabels {\n\tabbreviatedWeekDays?: string[];\n\tlabel?: string;\n\tmonths?: string[];\n\tplaceholder?: string;\n\ttoday?: string;\n\tweekDays?: string[];\n}\n\nexport interface DatePickerChangeData {\n\t/**\n\t * The requested date: the selected calendar date, or the result of `parser` for typed text.\n\t * `null` when the input is cleared.\n\t */\n\tdate: Date | null;\n\t/** The formatted date, or the typed text */\n\tformattedDate: string;\n\t/** `date.getTimezoneOffset()`, or the current offset when `date` is `null` */\n\ttimezoneOffset: number;\n}\n\n/**\n * What caused the DatePicker to request opening its calendar.\n * - `input-click`: the input (or deprecated `children` input) was clicked\n * - `icon-click`: the calendar icon button was clicked\n * - `keyboard`: Down or Up arrow was pressed in the input\n */\nexport type DatePickerRequestOpenTrigger =\n\t'input-click' | 'icon-click' | 'keyboard';\n\n/** Data passed to `onRequestOpen` */\nexport interface DatePickerRequestOpenData {\n\t/** What caused the open request */\n\ttrigger: DatePickerRequestOpenTrigger;\n}\n\n/**\n * What caused the DatePicker to request closing its calendar.\n * - `date-select`: a date was selected in the calendar (click, Space, or Enter)\n * - `escape`: Escape was pressed in the input or in the calendar\n * - `enter`: Enter was pressed in the input\n * - `click-outside`: a mousedown/touchstart happened outside the DatePicker\n * - `input-change`: the user typed in the input\n */\nexport type DatePickerRequestCloseTrigger =\n\t'date-select' | 'escape' | 'enter' | 'click-outside' | 'input-change';\n\n/** Data passed to `onRequestClose` */\nexport interface DatePickerRequestCloseData {\n\t/** What caused the close request */\n\ttrigger: DatePickerRequestCloseTrigger;\n}\n\n/** Data passed to `onClose` */\nexport interface DatePickerCloseData {\n\t/**\n\t * `true` when the close was reported by the calendar dialog unmounting. The calendar\n\t * dialog is unmounted whenever the DatePicker closes, so this is currently always `true`.\n\t */\n\tcomponentWillUnmount: boolean;\n}\n\nexport type DatePickerChangeHandler = (\n\tevent: React.SyntheticEvent,\n\tdata: DatePickerChangeData\n) => void;\n\n/**\n * `onChange` is required unless the date picker is `disabled`: DatePicker is\n * controlled, so without it picking a date does nothing.\n */\nexport type DatePickerChangeProps =\n\t| {\n\t\t\t/**\n\t\t\t * Called when the user selects a date in the calendar or types in the input. `value` is\n\t\t\t * controlled: set it to `data.date` here (or keep the old value to reject the change).\n\t\t\t * Clearing the input reports `date: null`. Required unless `disabled` is set.\n\t\t\t */\n\t\t\tonChange: DatePickerChangeHandler;\n\t }\n\t| { disabled: true; onChange?: DatePickerChangeHandler };\n\ninterface DatePickerBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: DatePickerAssistiveText;\n\t/** Alignment of dropdown */\n\talign?: 'left' | 'right';\n\t/** CSS classes for datepicker */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Children (deprecated - use input prop) */\n\tchildren?: ReactElement;\n\t/** Whether component is disabled */\n\tdisabled?: boolean;\n\t/** Function to determine if a date should be disabled. Receives `{ date }`. */\n\tdateDisabled?: (data: { date: Date }) => boolean;\n\t/** Date formatting function. Called with `null` when there is no date. */\n\tformatter?: (date: Date | null | undefined) => string;\n\t/** Whether to show error state */\n\thasError?: boolean;\n\t/** Prevent dropdown position flipping */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Custom input component */\n\tinput?: ReactElement;\n\t/**\n\t * Initial open state of the calendar when `isOpen` is not set (uncontrolled). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * Whether the calendar is open. When set, the calendar is controlled: it never opens or closes\n\t * itself, so update it from `onRequestOpen` and `onRequestClose`. When `undefined`, the calendar\n\t * manages its own open state (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/** Make Monday first day of week */\n\tisIsoWeekday?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: DatePickerLabels;\n\t/** Menu position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Called when calendar focus changes */\n\tonCalendarFocus?: (\n\t\tevent: React.SyntheticEvent | null,\n\t\tdata: { date?: Date; ref?: HTMLElement; direction?: string }\n\t) => void;\n\t/**\n\t * Called after the calendar has closed. `event` is `undefined` because the close\n\t * is reported when the calendar dialog unmounts, not by a user event.\n\t */\n\tonClose?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: DatePickerCloseData\n\t) => void;\n\t/** Called when calendar opens */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: { portal?: HTMLElement }\n\t) => void;\n\t/**\n\t * Called when the calendar requests to close. Only fires while the calendar is open.\n\t * `event` is the triggering React event; for `trigger: 'click-outside'` it is the\n\t * native `mousedown`/`touchstart` event from the document listener. It is typed as\n\t * possibly `undefined` because the internal calendar's close request has an optional event.\n\t * When `isOpen` is `undefined` the calendar also closes itself; when `isOpen` is set,\n\t * set it to `false` here.\n\t */\n\tonRequestClose?: (\n\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\tdata: DatePickerRequestCloseData\n\t) => void;\n\t/**\n\t * Called when the calendar requests to open (input click, icon click, or Down/Up arrow).\n\t * When `isOpen` is `undefined` the calendar also opens itself; when `isOpen` is set, set it\n\t * to `true` here. Not fired by the arrow keys while already open.\n\t */\n\tonRequestOpen?: (\n\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\tdata: DatePickerRequestOpenData\n\t) => void;\n\t/** Date parsing function */\n\tparser?: (str: string) => Date;\n\t/** Portal mount function */\n\tportalMount?: (element: ReactNode, container: HTMLElement) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom?: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo?: number;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Selected date, or `null` for no date. Required and controlled: the input and calendar\n\t * always reflect it, and the input's typed text is reset from it whenever it changes.\n\t * Update it from `onChange`. (`undefined` is treated as `null` and warns in development.)\n\t */\n\tvalue: Date | null;\n\t/** @deprecated Use labels.label */\n\tlabel?: string;\n\t/** @deprecated Use labels.placeholder */\n\tplaceholder?: string;\n\t/** @deprecated Use assistiveText.openCalendar */\n\tassistiveTextOpenCalendar?: string;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/** Blur handler */\n\tonBlur?: (event: React.FocusEvent) => void;\n\t/** Focus handler */\n\tonFocus?: (event: React.FocusEvent) => void;\n\t/** Keydown handler */\n\tonKeyDown?: (event: KeyboardEvent, data: Record<string, unknown>) => void;\n}\n\nexport type DatePickerProps = DatePickerBaseProps & DatePickerChangeProps;\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<DatePickerAssistiveText> = {\n\tnextMonth: 'Next month',\n\topenCalendar: 'Open Calendar',\n\tpreviousMonth: 'Previous month',\n\tyear: 'Year',\n};\n\nconst defaultLabels: Required<DatePickerLabels> = {\n\tabbreviatedWeekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\tlabel: '',\n\tmonths: [\n\t\t'January',\n\t\t'February',\n\t\t'March',\n\t\t'April',\n\t\t'May',\n\t\t'June',\n\t\t'July',\n\t\t'August',\n\t\t'September',\n\t\t'October',\n\t\t'November',\n\t\t'December',\n\t],\n\tplaceholder: 'Pick a Date',\n\ttoday: 'Today',\n\tweekDays: [\n\t\t'Sunday',\n\t\t'Monday',\n\t\t'Tuesday',\n\t\t'Wednesday',\n\t\t'Thursday',\n\t\t'Friday',\n\t\t'Saturday',\n\t],\n};\n\nconst defaultFormatter = (date: Date | null | undefined): string => {\n\treturn date\n\t\t? `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`\n\t\t: '';\n};\n\nconst defaultParser = (str: string): Date => {\n\tlowPriorityWarning(\n\t\tfalse,\n\t\t`Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser.`\n\t);\n\treturn new Date(str);\n};\n\nconst isDate = (date: unknown): date is Date =>\n\tObject.prototype.toString.call(date) === '[object Date]';\n\n/**\n * Stable identity of a `value`, so a parent passing `new Date(...)` on every render does not\n * re-sync the typed text. Invalid dates share one key.\n */\nconst getDateKey = (date: Date | null): string =>\n\tdate ? String(date.getTime()) : 'null';\n\n// ===== Component =====\n\nconst Datepicker: React.FC<DatePickerProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\talign = 'left',\n\t\tclassName,\n\t\tchildren,\n\t\tdisabled,\n\t\tdateDisabled = () => false,\n\t\tdefaultIsOpen = false,\n\t\tformatter = defaultFormatter,\n\t\thasError,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinput,\n\t\tisOpen: isOpenProp,\n\t\tisIsoWeekday,\n\t\tlabels: labelsProp = {},\n\t\tmenuPosition = 'absolute',\n\t\tonCalendarFocus,\n\t\tonChange,\n\t\tonClose,\n\t\tonOpen,\n\t\tonRequestClose,\n\t\tonRequestOpen,\n\t\tparser = defaultParser,\n\t\tportalMount,\n\t\trelativeYearFrom = -10,\n\t\trelativeYearTo = 10,\n\t\ttriggerClassName,\n\t\tvalue: valueProp,\n\t\t// Deprecated props\n\t\tlabel,\n\t\tplaceholder,\n\t\tassistiveTextOpenCalendar,\n\t\trequired,\n\t\tonBlur,\n\t\tonFocus,\n\t\tonKeyDown,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement | null>(null);\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst selectedDateCellRef = useRef<HTMLElement | null>(null);\n\tconst generatedId = useRef(generateId());\n\n\t// `value` is controlled data; `undefined` (warned in `checkProps`) means no date\n\tconst value = valueProp ?? null;\n\tconst valueKey = getDateKey(value);\n\n\t// State\n\t// The calendar's open state is ephemeral UI: controlled when `isOpen` is set\n\tconst [isOpen, setIsOpen] = useControllableState(isOpenProp, defaultIsOpen);\n\tconst [isOpenFromIcon, setIsOpenFromIcon] = useState(false);\n\t// The input's text is a buffer so it can hold partial input. `valueKey` is the `value` it was\n\t// last synced from, and `typedKey` the date reported for the typed text.\n\tconst [inputBuffer, setInputBuffer] = useState<{\n\t\ttext: string;\n\t\tvalueKey: string;\n\t\ttypedKey: string | null;\n\t}>(() => ({ text: formatter(value), valueKey, typedKey: null }));\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Re-sync the typed text whenever `value` changes, unless the change is the parent accepting\n\t// the date that was just typed (so the user's text is not reformatted mid-typing)\n\tif (inputBuffer.valueKey !== valueKey) {\n\t\tsetInputBuffer({\n\t\t\ttext:\n\t\t\t\tinputBuffer.typedKey === valueKey ? inputBuffer.text : formatter(value),\n\t\t\tvalueKey,\n\t\t\ttypedKey: null,\n\t\t});\n\t}\n\tconst inputValue = inputBuffer.text;\n\n\t// Check props on mount (only in development)\n\tuseEffect(() => {\n\t\tif (typeof checkProps === 'function') {\n\t\t\tcheckProps(\n\t\t\t\tDATE_PICKER,\n\t\t\t\tprops as unknown as Record<string, unknown>,\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\tconst getId = useCallback(() => idProp || generatedId.current, [idProp]);\n\n\tconst getIsOpen = useCallback(() => !!isOpen, [isOpen]);\n\n\tconst parseDate = useCallback(\n\t\t(dateString: string): Date => {\n\t\t\tlet parsedDate = parser(dateString);\n\t\t\tif (!isDate(parsedDate) || isNaN(parsedDate.getTime())) {\n\t\t\t\tparsedDate = new Date();\n\t\t\t}\n\t\t\treturn parsedDate;\n\t\t},\n\t\t[parser]\n\t);\n\n\t// ===== Event Handlers =====\n\n\tconst handleRequestClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | MouseEvent | TouchEvent | undefined,\n\t\t\tdata: DatePickerRequestCloseData\n\t\t) => {\n\t\t\t// Only request a close while open, so `onRequestClose` never fires when\n\t\t\t// the calendar is already closed (e.g. Escape in a closed input).\n\t\t\tif (!getIsOpen()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonRequestClose?.(event, data);\n\n\t\t\t// No-op when `isOpen` is controlled: the parent decides\n\t\t\tsetIsOpen(false);\n\t\t\tsetIsOpenFromIcon(false);\n\n\t\t\tif (inputRef.current) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onRequestClose, getIsOpen, setIsOpen]\n\t);\n\n\tconst handleCalendarRequestClose = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\t// The calendar's only close request is Escape (see `CalendarWrapper#handleKeyDown`)\n\t\t\thandleRequestClose(event, { trigger: 'escape' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tonClose?.(event, {\n\t\t\t\tcomponentWillUnmount: !!data?.componentWillUnmount,\n\t\t\t});\n\t\t},\n\t\t[onClose]\n\t);\n\n\tconst handleOpen = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata: { portal?: HTMLElement }\n\t\t) => {\n\t\t\tif (onOpen) {\n\t\t\t\tonOpen(event, data);\n\t\t\t}\n\n\t\t\tif (selectedDateCellRef.current && isOpenFromIcon) {\n\t\t\t\tselectedDateCellRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onOpen, isOpenFromIcon]\n\t);\n\n\tconst openDialog = useCallback(\n\t\t(\n\t\t\tevent: React.MouseEvent | KeyboardEvent,\n\t\t\tdata: DatePickerRequestOpenData,\n\t\t\tfromIcon = false\n\t\t) => {\n\t\t\tif (!fromIcon) {\n\t\t\t\tsetIsOpenFromIcon(false);\n\t\t\t}\n\n\t\t\t// No-op when `isOpen` is controlled: the parent decides\n\t\t\tsetIsOpen(true);\n\t\t\tonRequestOpen?.(event, data);\n\t\t},\n\t\t[onRequestOpen, setIsOpen]\n\t);\n\n\tconst openDialogFromIcon = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\tsetIsOpenFromIcon(true);\n\t\t\topenDialog(event, { trigger: 'icon-click' }, true);\n\t\t},\n\t\t[openDialog]\n\t);\n\n\tconst handleCalendarChange = useCallback(\n\t\t(event: React.SyntheticEvent, { date }: { date: Date }) => {\n\t\t\thandleRequestClose(event, { trigger: 'date-select' });\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: formatter(date),\n\t\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[formatter, handleRequestClose, onChange]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst text = event.target.value;\n\t\t\t// Clearing the input requests no date. `parser` is typed to return a `Date`, but guard\n\t\t\t// against parsers that return `null` for partial input.\n\t\t\tconst parsedDate = text === '' ? null : parser(text);\n\t\t\tconst date = isDate(parsedDate) ? parsedDate : null;\n\n\t\t\tsetInputBuffer((buffer) => ({\n\t\t\t\t...buffer,\n\t\t\t\ttext,\n\t\t\t\ttypedKey: getDateKey(date),\n\t\t\t}));\n\n\t\t\t// Typing closes the calendar, through the same request path as the keyboard and mouse\n\t\t\thandleRequestClose(event, { trigger: 'input-change' });\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: text,\n\t\t\t\t\ttimezoneOffset: (date ?? new Date()).getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[handleRequestClose, parser, onChange]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLInputElement>) => {\n\t\t\t// Don't open if user is selecting text\n\t\t\tif (\n\t\t\t\tevent.keyCode &&\n\t\t\t\t!event.shiftKey &&\n\t\t\t\t(event.keyCode === KEYS.DOWN || event.keyCode === KEYS.UP)\n\t\t\t) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\t// Go through the same request path as clicking, so a controlled\n\t\t\t\t// DatePicker hears about keyboard opens via `onRequestOpen`\n\t\t\t\tif (!getIsOpen()) {\n\t\t\t\t\topenDialog(event, { trigger: 'keyboard' });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.keyCode === KEYS.ESCAPE || event.keyCode === KEYS.ENTER) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\thandleRequestClose(event, {\n\t\t\t\t\ttrigger: event.keyCode === KEYS.ESCAPE ? 'escape' : 'enter',\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (onKeyDown) {\n\t\t\t\tonKeyDown(event, {});\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, openDialog, handleRequestClose, onKeyDown]\n\t);\n\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent | TouchEvent) => {\n\t\t\thandleRequestClose(event, { trigger: 'click-outside' });\n\t\t},\n\t\t[handleRequestClose]\n\t);\n\n\t// Detect clicks outside the trigger/calendar and close the dialog. Anchored\n\t// on the trigger element so this works whether the DatePicker is controlled\n\t// (`onRequestClose` is invoked via `handleRequestClose`) or uncontrolled\n\t// (internal open state is reset). The trigger carries the\n\t// `ignore-react-onclickoutside` class and, in `overflowBoundaryElement`\n\t// mode, so does the portaled calendar, so clicks within the calendar are\n\t// treated as inside.\n\tuseClickOutside(triggerRef, handleClickOutside, {\n\t\tenabled: getIsOpen(),\n\t\tignoreClass: 'ignore-react-onclickoutside',\n\t});\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback(\n\t\t(component: HTMLInputElement | null) => {\n\t\t\tinputRef.current = component;\n\t\t\tif (!inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t},\n\t\t[inputRendered]\n\t);\n\n\t// ===== Render Helpers =====\n\n\tconst getDatePicker = useCallback(() => {\n\t\tlet date: Date;\n\t\tif (value) {\n\t\t\tconst formattedDate = formatter(value);\n\t\t\tdate = formattedDate ? parseDate(formattedDate) : value;\n\t\t} else {\n\t\t\tdate = new Date();\n\t\t}\n\n\t\treturn (\n\t\t\t<CalendarWrapper\n\t\t\t\tabbreviatedWeekDayLabels={labels.abbreviatedWeekDays}\n\t\t\t\tassistiveTextNextMonth={assistiveText.nextMonth}\n\t\t\t\tassistiveTextPreviousMonth={assistiveText.previousMonth}\n\t\t\t\tassistiveTextYear={assistiveText.year}\n\t\t\t\tcanFocusCalendar={isOpenFromIcon}\n\t\t\t\tid={getId()}\n\t\t\t\tisIsoWeekday={isIsoWeekday}\n\t\t\t\tmonthLabels={labels.months}\n\t\t\t\tonCalendarFocus={onCalendarFocus}\n\t\t\t\tdateDisabled={dateDisabled}\n\t\t\t\tonRequestClose={handleCalendarRequestClose}\n\t\t\t\tonSelectDate={handleCalendarChange}\n\t\t\t\trelativeYearFrom={relativeYearFrom}\n\t\t\t\trelativeYearTo={relativeYearTo}\n\t\t\t\tselectedDate={date}\n\t\t\t\tselectedDateRef={(component: HTMLElement | null) => {\n\t\t\t\t\tselectedDateCellRef.current = component;\n\t\t\t\t}}\n\t\t\t\ttodayLabel={labels.today}\n\t\t\t\tweekDayLabels={labels.weekDays}\n\t\t\t/>\n\t\t);\n\t}, [\n\t\tvalue,\n\t\tformatter,\n\t\tparseDate,\n\t\tlabels,\n\t\tassistiveText,\n\t\tisOpenFromIcon,\n\t\tgetId,\n\t\tisIsoWeekday,\n\t\tonCalendarFocus,\n\t\tdateDisabled,\n\t\thandleCalendarRequestClose,\n\t\thandleCalendarChange,\n\t\trelativeYearFrom,\n\t\trelativeYearTo,\n\t]);\n\n\tconst getDialog = useCallback(() => {\n\t\t// SLDS override\n\t\tconst style = menuPosition !== 'relative' ? { transform: 'none' } : {};\n\n\t\tif (disabled || !getIsOpen()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst dialogProps = {\n\t\t\talign: `bottom ${align}` as const,\n\t\t\tcontentsClassName: classNames(\n\t\t\t\t'slds-datepicker slds-dropdown',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_right':\n\t\t\t\t\t\tmenuPosition === 'relative' && align === 'right',\n\t\t\t\t\t'slds-dropdown_left': menuPosition === 'relative' && align === 'left',\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t),\n\t\t\tcontext: iconSettingsContext,\n\t\t\thasStaticAlignment,\n\t\t\tstyle,\n\t\t\tonClose: handleClose,\n\t\t\tonOpen: handleOpen,\n\t\t\tonRequestTargetElement: () => inputRef.current,\n\t\t\tposition: menuPosition,\n\t\t\tportalMount,\n\t\t};\n\n\t\treturn (\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t<Dialog {...(dialogProps as any)}>{getDatePicker()}</Dialog>\n\t\t);\n\t}, [\n\t\tmenuPosition,\n\t\tdisabled,\n\t\tgetIsOpen,\n\t\talign,\n\t\tclassName,\n\t\ticonSettingsContext,\n\t\thasStaticAlignment,\n\t\thandleClose,\n\t\thandleOpen,\n\t\tportalMount,\n\t\tgetDatePicker,\n\t]);\n\n\tconst getInputProps = useCallback(() => {\n\t\tconst defaultInputProps = {\n\t\t\ticonRight: (\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveTextOpenCalendar || assistiveText.openCalendar,\n\t\t\t\t\t}}\n\t\t\t\t\taria-haspopup\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"event\"\n\t\t\t\t\tonClick={(event: React.MouseEvent) => {\n\t\t\t\t\t\topenDialogFromIcon(event);\n\t\t\t\t\t}}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t),\n\t\t\tinputRef: (component: HTMLInputElement | null) => {\n\t\t\t\tsetInputRefCallback(component);\n\t\t\t},\n\t\t\tid: getId(),\n\t\t\tonChange: handleInputChange,\n\t\t\tonClick: (event: React.MouseEvent<HTMLInputElement>) => {\n\t\t\t\topenDialog(event, { trigger: 'input-click' });\n\t\t\t},\n\t\t\tonKeyDown: handleKeyDown,\n\t\t\tvalue: inputValue,\n\t\t};\n\n\t\tconst topLevelDeprecatedComponentProps = {\n\t\t\tdisabled,\n\t\t\tlabel: label || labels.label,\n\t\t\tonBlur,\n\t\t\tonFocus,\n\t\t\tplaceholder: placeholder || labels.placeholder,\n\t\t\trequired,\n\t\t};\n\n\t\tconst childrenProps = (children?.props || {}) as Record<string, unknown>;\n\t\tconst childrenPropInputProps = {\n\t\t\t...childrenProps,\n\t\t\tonClick: (event: React.MouseEvent<HTMLInputElement>) => {\n\t\t\t\topenDialog(event, { trigger: 'input-click' });\n\t\t\t\tif (typeof childrenProps.onClick === 'function') {\n\t\t\t\t\tchildrenProps.onClick();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\n\t\tconst inputRenderProps = input?.props || {};\n\n\t\treturn {\n\t\t\t...defaultInputProps,\n\t\t\t...topLevelDeprecatedComponentProps,\n\t\t\t...childrenPropInputProps,\n\t\t\t...inputRenderProps,\n\t\t};\n\t}, [\n\t\tassistiveTextOpenCalendar,\n\t\tassistiveText.openCalendar,\n\t\tgetIsOpen,\n\t\topenDialogFromIcon,\n\t\tsetInputRefCallback,\n\t\tgetId,\n\t\thandleInputChange,\n\t\topenDialog,\n\t\thandleKeyDown,\n\t\tinputValue,\n\t\tdisabled,\n\t\tlabel,\n\t\tlabels.label,\n\t\tlabels.placeholder,\n\t\tonBlur,\n\t\tonFocus,\n\t\tplaceholder,\n\t\trequired,\n\t\tchildren,\n\t\tinput,\n\t]);\n\n\t// ===== Main Render =====\n\n\tconst inputProps = getInputProps();\n\n\t// `children` prop is a deprecated API\n\tconst inputToRender = children ? (\n\t\tReact.cloneElement(children, inputProps as Record<string, unknown>)\n\t) : (\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t<Input {...(inputProps as any)} />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={triggerRef}\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t{\n\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t},\n\t\t\t\ttriggerClassName\n\t\t\t)}\n\t\t>\n\t\t\t{inputToRender}\n\t\t\t{getDialog()}\n\t\t</div>\n\t);\n};\n\nDatepicker.displayName = DATE_PICKER;\n\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AGlE,kBAAC,IAAD,EAAO,GAAK,EAAqB,CAAA;CAGlC,OACC,mBAAC,OAAD;EACC,KAAK;EACL,WAAW,EACV,yBACA,+BACA,+BACA;GACC,kBAAkB;GAClB,gBAAgB,EAAU;EAC3B,GACA,EACD;EAXD,UAAA,CAaE,IACA,GAAU,CACP;;AAEP;AAEA,EAAW,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/date-picker/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport { forwardRef, type ForwardedRef } from 'react';\nimport Datepicker, { type DatePickerProps } from './date-picker';\n\nexport type {\n\tDatePickerProps,\n\tDatePickerAssistiveText,\n\tDatePickerLabels,\n\tDatePickerChangeData,\n\tDatePickerCloseData,\n\tDatePickerRequestCloseData,\n\tDatePickerRequestCloseTrigger,\n\tDatePickerRequestOpenData,\n\tDatePickerRequestOpenTrigger,\n} from './date-picker';\n\n/**\n * DatePicker wrapper preserved for markup/backwards compatibility.\n *\n * Click-outside detection now lives inside the DatePicker component itself\n * (see `date-picker.tsx`) so it can call the internal close handler directly\n * and work for both controlled and uncontrolled usage. This replaces the\n * react-onclickoutside HOC that was removed for React 19 compatibility.\n */\nconst DatepickerWithClickOutside = forwardRef<HTMLDivElement, DatePickerProps>(\n\t(props, _ref: ForwardedRef<HTMLDivElement>) => (\n\t\t<div>\n\t\t\t<Datepicker {...props} />\n\t\t</div>\n\t)\n);\n\nDatepickerWithClickOutside.displayName = 'DatepickerWithClickOutside';\n\nexport default DatepickerWithClickOutside;\n"],"mappings":";;;;AA0BA,IAAM,IAA6B,GACjC,GAAO,MACP,kBAAC,OAAD,EAAA,UACC,kBAAC,GAAD,EAAY,GAAI,EAAQ,CAAA,EACpB,CAAA,CAEP;AAEA,EAA2B,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/date-picker/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport { forwardRef, type ForwardedRef } from 'react';\nimport Datepicker, { type DatePickerProps } from './date-picker';\n\nexport type {\n\tDatePickerProps,\n\tDatePickerAssistiveText,\n\tDatePickerLabels,\n\tDatePickerChangeData,\n\tDatePickerChangeHandler,\n\tDatePickerChangeProps,\n\tDatePickerCloseData,\n\tDatePickerRequestCloseData,\n\tDatePickerRequestCloseTrigger,\n\tDatePickerRequestOpenData,\n\tDatePickerRequestOpenTrigger,\n} from './date-picker';\n\n/**\n * DatePicker wrapper preserved for markup/backwards compatibility.\n *\n * Click-outside detection now lives inside the DatePicker component itself\n * (see `date-picker.tsx`) so it can call the internal close handler directly\n * and work for both controlled and uncontrolled usage. This replaces the\n * react-onclickoutside HOC that was removed for React 19 compatibility.\n */\nconst DatepickerWithClickOutside = forwardRef<HTMLDivElement, DatePickerProps>(\n\t(props, _ref: ForwardedRef<HTMLDivElement>) => (\n\t\t<div>\n\t\t\t<Datepicker {...props} />\n\t\t</div>\n\t)\n);\n\nDatepickerWithClickOutside.displayName = 'DatepickerWithClickOutside';\n\nexport default DatepickerWithClickOutside;\n"],"mappings":";;;;AA4BA,IAAM,IAA6B,GACjC,GAAO,MACP,kBAAC,OAAD,EAAA,UACC,kBAAC,GAAD,EAAY,GAAI,EAAQ,CAAA,EACpB,CAAA,CAEP;AAEA,EAA2B,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-wrapper.js","names":[],"sources":["../../../../../components/date-picker/private/calendar-wrapper.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type SyntheticEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, \"a simple javascript utility for conditionally\n// joining classNames together.\"\nimport classNames from 'classnames';\n\nimport Calendar, { type CalendarProps } from './calendar';\nimport CalendarNavigation from './navigation';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\n\nexport interface CalendarWrapperProps {\n\t/** Label for button to go to the next month */\n\tassistiveTextNextMonth: string;\n\t/** Label for button to go to the previous month */\n\tassistiveTextPreviousMonth: string;\n\t/** Label for year picklist/combobox */\n\tassistiveTextYear: string;\n\t/** One letter abbreviations of the days of the week, starting on Sunday */\n\tabbreviatedWeekDayLabels: string[];\n\t/** Whether or not the CalendarWrapper can steal focus from the main Input */\n\tcanFocusCalendar: boolean;\n\t/** CSS classes for datepicker */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/** Function to determine if a date should be disabled */\n\tdateDisabled?: (date: Date) => boolean;\n\t/** HTML id for component */\n\tid?: string;\n\t/** Makes Monday the first day of the week */\n\tisIsoWeekday?: boolean;\n\t/** For use of datepicker outside of dropdown */\n\tisolated?: boolean;\n\t/** Names of the months */\n\tmonthLabels: string[];\n\t/** Called when keyboard moves focus on calendar */\n\tonCalendarFocus?: (\n\t\tevent: SyntheticEvent | null,\n\t\tdata: { date?: Date; ref?: HTMLElement; direction?: string }\n\t) => void;\n\t/** Called when calendar should close */\n\tonRequestClose: (\n\t\tevent?: SyntheticEvent,\n\t\tdata?: Record<string, unknown>\n\t) => void;\n\t/** Called when a date is selected */\n\tonSelectDate: (event: SyntheticEvent, data: { date: Date }) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo: number;\n\t/** Currently selected date */\n\tselectedDate?: Date;\n\t/** Ref callback for selected date cell */\n\tselectedDateRef?: (ref: HTMLElement | null) => void;\n\t/** Label for today shortcut */\n\ttodayLabel: string;\n\t/** Full names of the days of the week */\n\tweekDayLabels: string[];\n}\n\ninterface CalendarWrapperState {\n\tinitialDateForCalendarRender: Date;\n}\n\nclass DatepickerCalendarWrapper extends React.Component<\n\tCalendarWrapperProps,\n\tCalendarWrapperState\n> {\n\tstatic displayName = 'DatepickerCalendarWrapper';\n\n\tstatic defaultProps = {\n\t\tselectedDate: new Date(),\n\t\tvalue: new Date(),\n\t};\n\n\tstate: CalendarWrapperState = {\n\t\tinitialDateForCalendarRender: this.props.selectedDate as Date,\n\t};\n\n\tpreviousMonthRef: HTMLButtonElement | null = null;\n\n\ttodayRef: HTMLAnchorElement | null = null;\n\n\thandleCalendarBlur = (\n\t\tevent: SyntheticEvent,\n\t\t{ direction }: { direction: string }\n\t) => {\n\t\tif (direction === 'next' && this.previousMonthRef) {\n\t\t\tif (this.props.onCalendarFocus) {\n\t\t\t\tthis.props.onCalendarFocus(event, {\n\t\t\t\t\tdirection,\n\t\t\t\t\tref: this.previousMonthRef,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.previousMonthRef.focus();\n\t\t} else if (direction === 'previous' && this.todayRef) {\n\t\t\tif (this.props.onCalendarFocus) {\n\t\t\t\tthis.props.onCalendarFocus(event, {\n\t\t\t\t\tdirection,\n\t\t\t\t\tref: this.todayRef,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.todayRef.focus();\n\t\t}\n\t};\n\n\thandleFirstFocusableNodeKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (event.shiftKey && event.keyCode === KEYS.TAB) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t}\n\t};\n\n\thandleInitialDateForCalendarRenderChange = (\n\t\tevent: SyntheticEvent | undefined,\n\t\tinitialDateForCalendarRender: Date\n\t) => {\n\t\tthis.setState({ initialDateForCalendarRender });\n\t};\n\n\thandleKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (event.keyCode === KEYS.ESCAPE) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t\tthis.props.onRequestClose(event, {});\n\t\t}\n\t};\n\n\thandleLastFocusableNodeKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (!event.shiftKey && event.keyCode === KEYS.TAB) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t\tthis.previousMonthRef?.focus();\n\t\t}\n\t};\n\n\thandleRequestClose = (event?: SyntheticEvent) => {\n\t\tif (this.props.onRequestClose) {\n\t\t\tthis.props.onRequestClose(event, {});\n\t\t}\n\t};\n\n\thandleRequestFocusDate = (\n\t\tevent: SyntheticEvent | undefined,\n\t\tdata: { date: Date; ref?: HTMLElement | null; triggerCallback?: boolean }\n\t) => {\n\t\t// will be called three times, due to re-render\n\t\tif (data.ref && this.props.canFocusCalendar) {\n\t\t\tdata.ref.focus();\n\t\t}\n\n\t\t// only call on actual DOM event and not on re-render\n\t\tif (this.props.onCalendarFocus && data.triggerCallback) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\tconst { triggerCallback, ref, ...rest } = data;\n\t\t\tthis.props.onCalendarFocus(event ?? null, {\n\t\t\t\t...rest,\n\t\t\t\tref: ref ?? undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t<div // eslint-disable-line jsx-a11y/no-static-element-interactions\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-datepicker': this.props.isolated,\n\t\t\t\t\t},\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t\taria-hidden=\"false\"\n\t\t\t\tdata-selection=\"single\"\n\t\t\t\tonKeyDown={this.handleKeyDown}\n\t\t\t>\n\t\t\t\t<CalendarNavigation\n\t\t\t\t\tassistiveTextNextMonth={this.props.assistiveTextNextMonth}\n\t\t\t\t\tassistiveTextPreviousMonth={this.props.assistiveTextPreviousMonth}\n\t\t\t\t\tassistiveTextYear={this.props.assistiveTextYear}\n\t\t\t\t\tid={this.props.id}\n\t\t\t\t\tinitialDateForCalendarRender={this.state.initialDateForCalendarRender}\n\t\t\t\t\tmonthLabels={this.props.monthLabels}\n\t\t\t\t\tonChangeMonth={this.handleInitialDateForCalendarRenderChange}\n\t\t\t\t\tpreviousMonthRef={(component) => {\n\t\t\t\t\t\tthis.previousMonthRef = component;\n\t\t\t\t\t}}\n\t\t\t\t\tonPreviousMonthKeyDown={this.handleFirstFocusableNodeKeyDown}\n\t\t\t\t\trelativeYearFrom={this.props.relativeYearFrom}\n\t\t\t\t\trelativeYearTo={this.props.relativeYearTo}\n\t\t\t\t/>\n\t\t\t\t<Calendar\n\t\t\t\t\tabbreviatedWeekDayLabels={this.props.abbreviatedWeekDayLabels}\n\t\t\t\t\tdateDisabled={\n\t\t\t\t\t\tthis.props.dateDisabled as CalendarProps['dateDisabled']\n\t\t\t\t\t}\n\t\t\t\t\tid={this.props.id as string}\n\t\t\t\t\tinitialDateForCalendarRender={this.state.initialDateForCalendarRender}\n\t\t\t\t\tisIsoWeekday={this.props.isIsoWeekday}\n\t\t\t\t\tonCalendarBlur={this.handleCalendarBlur}\n\t\t\t\t\tonChangeMonth={this.handleInitialDateForCalendarRenderChange}\n\t\t\t\t\tonRequestClose={this.handleRequestClose}\n\t\t\t\t\tonRequestInternalFocusDate={this.handleRequestFocusDate}\n\t\t\t\t\tonSelectDate={this.props.onSelectDate}\n\t\t\t\t\tselectedDate={this.props.selectedDate}\n\t\t\t\t\tselectedDateRef={this.props.selectedDateRef}\n\t\t\t\t\ttodayLabel={this.props.todayLabel}\n\t\t\t\t\ttodayRef={(component) => {\n\t\t\t\t\t\tthis.todayRef = component;\n\t\t\t\t\t}}\n\t\t\t\t\tonLastFocusableNodeKeyDown={this.handleLastFocusableNodeKeyDown}\n\t\t\t\t\tweekDayLabels={this.props.weekDayLabels}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default DatepickerCalendarWrapper;\n"],"mappings":";;;;;;;;AAsEA,IAAM,IAAN,cAAwC,EAAM,UAG5C;CACD,OAAO,cAAc;CAErB,OAAO,eAAe;EACrB,8BAAc,IAAI,KAAK;EACvB,uBAAO,IAAI,KAAK;CACjB;CAEA,QAA8B,EAC7B,8BAA8B,KAAK,MAAM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;GACA,eAAY;GACZ,kBAAe;GACf,WAAW,KAAK;GATjB,UAAA,CAWC,kBAAC,GAAD;IACC,wBAAwB,KAAK,MAAM;IACnC,4BAA4B,KAAK,MAAM;IACvC,mBAAmB,KAAK,MAAM;IAC9B,IAAI,KAAK,MAAM;IACf,8BAA8B,KAAK,MAAM;IACzC,aAAa,KAAK,MAAM;IACxB,eAAe,KAAK;IACpB,mBAAmB,MAAc;KAChC,KAAK,mBAAmB;IACzB;IACA,wBAAwB,KAAK;IAC7B,kBAAkB,KAAK,MAAM;IAC7B,gBAAgB,KAAK,MAAM;GAC3B,CAAA,GACD,kBAAC,GAAD;IACC,0BAA0B,KAAK,MAAM;IACrC,cACC,KAAK,MAAM;IAEZ,IAAI,KAAK,MAAM;IACf,8BAA8B,KAAK,MAAM;IACzC,cAAc,KAAK,MAAM;IACzB,gBAAgB,KAAK;IACrB,eAAe,KAAK;IACpB,gBAAgB,KAAK;IACrB,4BAA4B,KAAK;IACjC,cAAc,KAAK,MAAM;IACzB,cAAc,KAAK,MAAM;IACzB,iBAAiB,KAAK,MAAM;IAC5B,YAAY,KAAK,MAAM;IACvB,WAAW,MAAc;KACxB,KAAK,WAAW;IACjB;IACA,4BAA4B,KAAK;IACjC,eAAe,KAAK,MAAM;GAC1B,CAAA,CACG;;CAEP;AACD"}
1
+ {"version":3,"file":"calendar-wrapper.js","names":[],"sources":["../../../../../components/date-picker/private/calendar-wrapper.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type SyntheticEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, \"a simple javascript utility for conditionally\n// joining classNames together.\"\nimport classNames from 'classnames';\n\nimport Calendar from './calendar';\nimport CalendarNavigation from './navigation';\n\nimport EventUtil from '../../../utilities/event';\nimport KEYS from '../../../utilities/key-code';\n\nexport interface CalendarWrapperProps {\n\t/** Label for button to go to the next month */\n\tassistiveTextNextMonth: string;\n\t/** Label for button to go to the previous month */\n\tassistiveTextPreviousMonth: string;\n\t/** Label for year picklist/combobox */\n\tassistiveTextYear: string;\n\t/** One letter abbreviations of the days of the week, starting on Sunday */\n\tabbreviatedWeekDayLabels: string[];\n\t/** Whether or not the CalendarWrapper can steal focus from the main Input */\n\tcanFocusCalendar: boolean;\n\t/** CSS classes for datepicker */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/** Function to determine if a date should be disabled */\n\tdateDisabled?: (data: { date: Date }) => boolean;\n\t/** HTML id for component */\n\tid?: string;\n\t/** Makes Monday the first day of the week */\n\tisIsoWeekday?: boolean;\n\t/** For use of datepicker outside of dropdown */\n\tisolated?: boolean;\n\t/** Names of the months */\n\tmonthLabels: string[];\n\t/** Called when keyboard moves focus on calendar */\n\tonCalendarFocus?: (\n\t\tevent: SyntheticEvent | null,\n\t\tdata: { date?: Date; ref?: HTMLElement; direction?: string }\n\t) => void;\n\t/** Called when calendar should close */\n\tonRequestClose: (\n\t\tevent?: SyntheticEvent,\n\t\tdata?: Record<string, unknown>\n\t) => void;\n\t/** Called when a date is selected */\n\tonSelectDate: (event: SyntheticEvent, data: { date: Date }) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo: number;\n\t/** Currently selected date */\n\tselectedDate?: Date;\n\t/** Ref callback for selected date cell */\n\tselectedDateRef?: (ref: HTMLElement | null) => void;\n\t/** Label for today shortcut */\n\ttodayLabel: string;\n\t/** Full names of the days of the week */\n\tweekDayLabels: string[];\n}\n\ninterface CalendarWrapperState {\n\tinitialDateForCalendarRender: Date;\n}\n\nclass DatepickerCalendarWrapper extends React.Component<\n\tCalendarWrapperProps,\n\tCalendarWrapperState\n> {\n\tstatic displayName = 'DatepickerCalendarWrapper';\n\n\tstatic defaultProps = {\n\t\tselectedDate: new Date(),\n\t\tvalue: new Date(),\n\t};\n\n\tstate: CalendarWrapperState = {\n\t\tinitialDateForCalendarRender: this.props.selectedDate as Date,\n\t};\n\n\tpreviousMonthRef: HTMLButtonElement | null = null;\n\n\ttodayRef: HTMLAnchorElement | null = null;\n\n\thandleCalendarBlur = (\n\t\tevent: SyntheticEvent,\n\t\t{ direction }: { direction: string }\n\t) => {\n\t\tif (direction === 'next' && this.previousMonthRef) {\n\t\t\tif (this.props.onCalendarFocus) {\n\t\t\t\tthis.props.onCalendarFocus(event, {\n\t\t\t\t\tdirection,\n\t\t\t\t\tref: this.previousMonthRef,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.previousMonthRef.focus();\n\t\t} else if (direction === 'previous' && this.todayRef) {\n\t\t\tif (this.props.onCalendarFocus) {\n\t\t\t\tthis.props.onCalendarFocus(event, {\n\t\t\t\t\tdirection,\n\t\t\t\t\tref: this.todayRef,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.todayRef.focus();\n\t\t}\n\t};\n\n\thandleFirstFocusableNodeKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (event.shiftKey && event.keyCode === KEYS.TAB) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t}\n\t};\n\n\thandleInitialDateForCalendarRenderChange = (\n\t\tevent: SyntheticEvent | undefined,\n\t\tinitialDateForCalendarRender: Date\n\t) => {\n\t\tthis.setState({ initialDateForCalendarRender });\n\t};\n\n\thandleKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (event.keyCode === KEYS.ESCAPE) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t\tthis.props.onRequestClose(event, {});\n\t\t}\n\t};\n\n\thandleLastFocusableNodeKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (!event.shiftKey && event.keyCode === KEYS.TAB) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t\tthis.previousMonthRef?.focus();\n\t\t}\n\t};\n\n\thandleRequestClose = (event?: SyntheticEvent) => {\n\t\tif (this.props.onRequestClose) {\n\t\t\tthis.props.onRequestClose(event, {});\n\t\t}\n\t};\n\n\thandleRequestFocusDate = (\n\t\tevent: SyntheticEvent | undefined,\n\t\tdata: { date: Date; ref?: HTMLElement | null; triggerCallback?: boolean }\n\t) => {\n\t\t// will be called three times, due to re-render\n\t\tif (data.ref && this.props.canFocusCalendar) {\n\t\t\tdata.ref.focus();\n\t\t}\n\n\t\t// only call on actual DOM event and not on re-render\n\t\tif (this.props.onCalendarFocus && data.triggerCallback) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\tconst { triggerCallback, ref, ...rest } = data;\n\t\t\tthis.props.onCalendarFocus(event ?? null, {\n\t\t\t\t...rest,\n\t\t\t\tref: ref ?? undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t<div // eslint-disable-line jsx-a11y/no-static-element-interactions\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-datepicker': this.props.isolated,\n\t\t\t\t\t},\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t\taria-hidden=\"false\"\n\t\t\t\tdata-selection=\"single\"\n\t\t\t\tonKeyDown={this.handleKeyDown}\n\t\t\t>\n\t\t\t\t<CalendarNavigation\n\t\t\t\t\tassistiveTextNextMonth={this.props.assistiveTextNextMonth}\n\t\t\t\t\tassistiveTextPreviousMonth={this.props.assistiveTextPreviousMonth}\n\t\t\t\t\tassistiveTextYear={this.props.assistiveTextYear}\n\t\t\t\t\tid={this.props.id}\n\t\t\t\t\tinitialDateForCalendarRender={this.state.initialDateForCalendarRender}\n\t\t\t\t\tmonthLabels={this.props.monthLabels}\n\t\t\t\t\tonChangeMonth={this.handleInitialDateForCalendarRenderChange}\n\t\t\t\t\tpreviousMonthRef={(component) => {\n\t\t\t\t\t\tthis.previousMonthRef = component;\n\t\t\t\t\t}}\n\t\t\t\t\tonPreviousMonthKeyDown={this.handleFirstFocusableNodeKeyDown}\n\t\t\t\t\trelativeYearFrom={this.props.relativeYearFrom}\n\t\t\t\t\trelativeYearTo={this.props.relativeYearTo}\n\t\t\t\t/>\n\t\t\t\t<Calendar\n\t\t\t\t\tabbreviatedWeekDayLabels={this.props.abbreviatedWeekDayLabels}\n\t\t\t\t\tdateDisabled={this.props.dateDisabled}\n\t\t\t\t\tid={this.props.id as string}\n\t\t\t\t\tinitialDateForCalendarRender={this.state.initialDateForCalendarRender}\n\t\t\t\t\tisIsoWeekday={this.props.isIsoWeekday}\n\t\t\t\t\tonCalendarBlur={this.handleCalendarBlur}\n\t\t\t\t\tonChangeMonth={this.handleInitialDateForCalendarRenderChange}\n\t\t\t\t\tonRequestClose={this.handleRequestClose}\n\t\t\t\t\tonRequestInternalFocusDate={this.handleRequestFocusDate}\n\t\t\t\t\tonSelectDate={this.props.onSelectDate}\n\t\t\t\t\tselectedDate={this.props.selectedDate}\n\t\t\t\t\tselectedDateRef={this.props.selectedDateRef}\n\t\t\t\t\ttodayLabel={this.props.todayLabel}\n\t\t\t\t\ttodayRef={(component) => {\n\t\t\t\t\t\tthis.todayRef = component;\n\t\t\t\t\t}}\n\t\t\t\t\tonLastFocusableNodeKeyDown={this.handleLastFocusableNodeKeyDown}\n\t\t\t\t\tweekDayLabels={this.props.weekDayLabels}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default DatepickerCalendarWrapper;\n"],"mappings":";;;;;;;;AAsEA,IAAM,IAAN,cAAwC,EAAM,UAG5C;CACD,OAAO,cAAc;CAErB,OAAO,eAAe;EACrB,8BAAc,IAAI,KAAK;EACvB,uBAAO,IAAI,KAAK;CACjB;CAEA,QAA8B,EAC7B,8BAA8B,KAAK,MAAM,aAC1C;CAEA,mBAA6C;CAE7C,WAAqC;CAErC,sBACC,GACA,EAAE,mBACE;EACJ,AAAI,MAAc,UAAU,KAAK,oBAC5B,KAAK,MAAM,mBACd,KAAK,MAAM,gBAAgB,GAAO;GACjC;GACA,KAAK,KAAK;EACX,CAAC,GAEF,KA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