@cloudscape-design/components 3.0.297 → 3.0.299

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 (380) hide show
  1. package/alert/interfaces.d.ts +1 -0
  2. package/alert/interfaces.d.ts.map +1 -1
  3. package/alert/interfaces.js.map +1 -1
  4. package/annotation-context/annotation/styles.css.js +24 -24
  5. package/annotation-context/annotation/styles.scoped.css +30 -30
  6. package/annotation-context/annotation/styles.selectors.js +24 -24
  7. package/app-layout/interfaces.d.ts +1 -0
  8. package/app-layout/interfaces.d.ts.map +1 -1
  9. package/app-layout/interfaces.js.map +1 -1
  10. package/app-layout/notifications/styles.css.js +3 -3
  11. package/app-layout/notifications/styles.scoped.css +7 -7
  12. package/app-layout/notifications/styles.selectors.js +3 -3
  13. package/app-layout/visual-refresh/background.d.ts +1 -5
  14. package/app-layout/visual-refresh/background.d.ts.map +1 -1
  15. package/app-layout/visual-refresh/background.js +8 -13
  16. package/app-layout/visual-refresh/background.js.map +1 -1
  17. package/app-layout/visual-refresh/breadcrumbs.d.ts +3 -0
  18. package/app-layout/visual-refresh/breadcrumbs.d.ts.map +1 -0
  19. package/app-layout/visual-refresh/breadcrumbs.js +17 -0
  20. package/app-layout/visual-refresh/breadcrumbs.js.map +1 -0
  21. package/app-layout/visual-refresh/context.js +3 -3
  22. package/app-layout/visual-refresh/context.js.map +1 -1
  23. package/app-layout/visual-refresh/header.d.ts +0 -4
  24. package/app-layout/visual-refresh/header.d.ts.map +1 -1
  25. package/app-layout/visual-refresh/header.js +0 -4
  26. package/app-layout/visual-refresh/header.js.map +1 -1
  27. package/app-layout/visual-refresh/index.d.ts +0 -8
  28. package/app-layout/visual-refresh/index.d.ts.map +1 -1
  29. package/app-layout/visual-refresh/index.js +4 -13
  30. package/app-layout/visual-refresh/index.js.map +1 -1
  31. package/app-layout/visual-refresh/layout.d.ts.map +1 -1
  32. package/app-layout/visual-refresh/layout.js +31 -19
  33. package/app-layout/visual-refresh/layout.js.map +1 -1
  34. package/app-layout/visual-refresh/main.d.ts.map +1 -1
  35. package/app-layout/visual-refresh/main.js +2 -6
  36. package/app-layout/visual-refresh/main.js.map +1 -1
  37. package/app-layout/visual-refresh/mobile-toolbar.d.ts +3 -0
  38. package/app-layout/visual-refresh/mobile-toolbar.d.ts.map +1 -0
  39. package/app-layout/visual-refresh/{app-bar.js → mobile-toolbar.js} +9 -18
  40. package/app-layout/visual-refresh/mobile-toolbar.js.map +1 -0
  41. package/app-layout/visual-refresh/navigation.js +1 -1
  42. package/app-layout/visual-refresh/navigation.js.map +1 -1
  43. package/app-layout/visual-refresh/notifications.d.ts +0 -4
  44. package/app-layout/visual-refresh/notifications.d.ts.map +1 -1
  45. package/app-layout/visual-refresh/notifications.js +4 -9
  46. package/app-layout/visual-refresh/notifications.js.map +1 -1
  47. package/app-layout/visual-refresh/split-panel.js +1 -1
  48. package/app-layout/visual-refresh/split-panel.js.map +1 -1
  49. package/app-layout/visual-refresh/styles.css.js +68 -72
  50. package/app-layout/visual-refresh/styles.scoped.css +400 -576
  51. package/app-layout/visual-refresh/styles.selectors.js +68 -72
  52. package/attribute-editor/interfaces.d.ts +2 -1
  53. package/attribute-editor/interfaces.d.ts.map +1 -1
  54. package/attribute-editor/interfaces.js.map +1 -1
  55. package/attribute-editor/row.d.ts +1 -1
  56. package/attribute-editor/row.d.ts.map +1 -1
  57. package/attribute-editor/row.js +3 -1
  58. package/attribute-editor/row.js.map +1 -1
  59. package/autosuggest/autosuggest-option.d.ts +1 -1
  60. package/autosuggest/autosuggest-option.d.ts.map +1 -1
  61. package/autosuggest/autosuggest-option.js +3 -1
  62. package/autosuggest/autosuggest-option.js.map +1 -1
  63. package/autosuggest/interfaces.d.ts +3 -1
  64. package/autosuggest/interfaces.d.ts.map +1 -1
  65. package/autosuggest/interfaces.js.map +1 -1
  66. package/autosuggest/internal.d.ts.map +1 -1
  67. package/autosuggest/internal.js +4 -0
  68. package/autosuggest/internal.js.map +1 -1
  69. package/autosuggest/plain-list.d.ts +1 -1
  70. package/autosuggest/plain-list.d.ts.map +1 -1
  71. package/autosuggest/plain-list.js.map +1 -1
  72. package/breadcrumb-group/interfaces.d.ts +1 -0
  73. package/breadcrumb-group/interfaces.d.ts.map +1 -1
  74. package/breadcrumb-group/interfaces.js.map +1 -1
  75. package/calendar/interfaces.d.ts +3 -0
  76. package/calendar/interfaces.d.ts.map +1 -1
  77. package/calendar/interfaces.js.map +1 -1
  78. package/cards/interfaces.d.ts +1 -0
  79. package/cards/interfaces.d.ts.map +1 -1
  80. package/cards/interfaces.js.map +1 -1
  81. package/cards/styles.css.js +37 -37
  82. package/cards/styles.scoped.css +53 -53
  83. package/cards/styles.selectors.js +37 -37
  84. package/code-editor/interfaces.d.ts +1 -0
  85. package/code-editor/interfaces.d.ts.map +1 -1
  86. package/code-editor/interfaces.js.map +1 -1
  87. package/collection-preferences/content-display/index.d.ts.map +1 -1
  88. package/collection-preferences/content-display/index.js +14 -9
  89. package/collection-preferences/content-display/index.js.map +1 -1
  90. package/collection-preferences/index.d.ts.map +1 -1
  91. package/collection-preferences/index.js +6 -4
  92. package/collection-preferences/index.js.map +1 -1
  93. package/collection-preferences/interfaces.d.ts +21 -12
  94. package/collection-preferences/interfaces.d.ts.map +1 -1
  95. package/collection-preferences/interfaces.js.map +1 -1
  96. package/collection-preferences/utils.d.ts +1 -1
  97. package/collection-preferences/utils.d.ts.map +1 -1
  98. package/collection-preferences/utils.js +19 -6
  99. package/collection-preferences/utils.js.map +1 -1
  100. package/content-layout/internal.d.ts.map +1 -1
  101. package/content-layout/internal.js +1 -3
  102. package/content-layout/internal.js.map +1 -1
  103. package/content-layout/styles.css.js +6 -7
  104. package/content-layout/styles.scoped.css +9 -19
  105. package/content-layout/styles.selectors.js +6 -7
  106. package/date-range-picker/calendar/grids/grid.d.ts +1 -1
  107. package/date-range-picker/calendar/grids/grid.d.ts.map +1 -1
  108. package/date-range-picker/calendar/grids/grid.js.map +1 -1
  109. package/date-range-picker/calendar/grids/index.d.ts +1 -1
  110. package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  111. package/date-range-picker/calendar/grids/index.js.map +1 -1
  112. package/date-range-picker/calendar/header/header-button.d.ts +1 -1
  113. package/date-range-picker/calendar/header/header-button.d.ts.map +1 -1
  114. package/date-range-picker/calendar/header/header-button.js.map +1 -1
  115. package/date-range-picker/calendar/header/index.d.ts +2 -2
  116. package/date-range-picker/calendar/header/index.d.ts.map +1 -1
  117. package/date-range-picker/calendar/header/index.js.map +1 -1
  118. package/date-range-picker/calendar/index.d.ts +1 -1
  119. package/date-range-picker/calendar/index.d.ts.map +1 -1
  120. package/date-range-picker/calendar/index.js +11 -8
  121. package/date-range-picker/calendar/index.js.map +1 -1
  122. package/date-range-picker/calendar/range-inputs.d.ts +1 -1
  123. package/date-range-picker/calendar/range-inputs.d.ts.map +1 -1
  124. package/date-range-picker/calendar/range-inputs.js +7 -5
  125. package/date-range-picker/calendar/range-inputs.js.map +1 -1
  126. package/date-range-picker/dropdown.d.ts +2 -1
  127. package/date-range-picker/dropdown.d.ts.map +1 -1
  128. package/date-range-picker/dropdown.js +7 -5
  129. package/date-range-picker/dropdown.js.map +1 -1
  130. package/date-range-picker/index.d.ts.map +1 -1
  131. package/date-range-picker/index.js +13 -4
  132. package/date-range-picker/index.js.map +1 -1
  133. package/date-range-picker/interfaces.d.ts +22 -21
  134. package/date-range-picker/interfaces.d.ts.map +1 -1
  135. package/date-range-picker/interfaces.js.map +1 -1
  136. package/date-range-picker/mode-switcher.d.ts +1 -1
  137. package/date-range-picker/mode-switcher.d.ts.map +1 -1
  138. package/date-range-picker/mode-switcher.js +4 -2
  139. package/date-range-picker/mode-switcher.js.map +1 -1
  140. package/date-range-picker/relative-range/index.d.ts +1 -1
  141. package/date-range-picker/relative-range/index.d.ts.map +1 -1
  142. package/date-range-picker/relative-range/index.js +14 -10
  143. package/date-range-picker/relative-range/index.js.map +1 -1
  144. package/flashbar/interfaces.d.ts +1 -0
  145. package/flashbar/interfaces.d.ts.map +1 -1
  146. package/flashbar/interfaces.js.map +1 -1
  147. package/flashbar/styles.css.js +45 -45
  148. package/flashbar/styles.scoped.css +169 -169
  149. package/flashbar/styles.selectors.js +45 -45
  150. package/form/interfaces.d.ts +1 -0
  151. package/form/interfaces.d.ts.map +1 -1
  152. package/form/interfaces.js.map +1 -1
  153. package/form-field/interfaces.d.ts +1 -0
  154. package/form-field/interfaces.d.ts.map +1 -1
  155. package/form-field/interfaces.js.map +1 -1
  156. package/help-panel/interfaces.d.ts +1 -0
  157. package/help-panel/interfaces.d.ts.map +1 -1
  158. package/help-panel/interfaces.js.map +1 -1
  159. package/i18n/context.d.ts +20 -0
  160. package/i18n/context.d.ts.map +1 -0
  161. package/i18n/context.js +17 -0
  162. package/i18n/context.js.map +1 -0
  163. package/i18n/index.d.ts +2 -0
  164. package/i18n/index.d.ts.map +1 -0
  165. package/i18n/index.js +4 -0
  166. package/i18n/index.js.map +1 -0
  167. package/i18n/messages/all.all.d.ts +3 -0
  168. package/i18n/messages/all.all.js +5473 -0
  169. package/i18n/messages/all.all.json +5518 -0
  170. package/i18n/messages/all.de.d.ts +3 -0
  171. package/i18n/messages/all.de.js +446 -0
  172. package/i18n/messages/all.de.json +454 -0
  173. package/i18n/messages/all.en-GB.d.ts +3 -0
  174. package/i18n/messages/all.en-GB.js +436 -0
  175. package/i18n/messages/all.en-GB.json +439 -0
  176. package/i18n/messages/all.en.d.ts +3 -0
  177. package/i18n/messages/all.en.js +722 -0
  178. package/i18n/messages/all.en.json +721 -0
  179. package/i18n/messages/all.es.d.ts +3 -0
  180. package/i18n/messages/all.es.js +437 -0
  181. package/i18n/messages/all.es.json +439 -0
  182. package/i18n/messages/all.fr.d.ts +3 -0
  183. package/i18n/messages/all.fr.js +451 -0
  184. package/i18n/messages/all.fr.json +452 -0
  185. package/i18n/messages/all.id.d.ts +3 -0
  186. package/i18n/messages/all.id.js +427 -0
  187. package/i18n/messages/all.id.json +435 -0
  188. package/i18n/messages/all.it.d.ts +3 -0
  189. package/i18n/messages/all.it.js +437 -0
  190. package/i18n/messages/all.it.json +441 -0
  191. package/i18n/messages/all.ja.d.ts +3 -0
  192. package/i18n/messages/all.ja.js +441 -0
  193. package/i18n/messages/all.ja.json +445 -0
  194. package/i18n/messages/all.ko.d.ts +3 -0
  195. package/i18n/messages/all.ko.js +419 -0
  196. package/i18n/messages/all.ko.json +426 -0
  197. package/i18n/messages/all.pt-BR.d.ts +3 -0
  198. package/i18n/messages/all.pt-BR.js +444 -0
  199. package/i18n/messages/all.pt-BR.json +443 -0
  200. package/i18n/messages/all.zh-CN.d.ts +3 -0
  201. package/i18n/messages/all.zh-CN.js +429 -0
  202. package/i18n/messages/all.zh-CN.json +434 -0
  203. package/i18n/messages/all.zh-TW.d.ts +3 -0
  204. package/i18n/messages/all.zh-TW.js +428 -0
  205. package/i18n/messages/all.zh-TW.json +433 -0
  206. package/i18n/provider.d.ts +20 -0
  207. package/i18n/provider.d.ts.map +1 -0
  208. package/i18n/provider.js +105 -0
  209. package/i18n/provider.js.map +1 -0
  210. package/i18n/testing.d.ts +8 -0
  211. package/i18n/testing.d.ts.map +1 -0
  212. package/i18n/testing.js +8 -0
  213. package/i18n/testing.js.map +1 -0
  214. package/input/interfaces.d.ts +1 -0
  215. package/input/interfaces.d.ts.map +1 -1
  216. package/input/interfaces.js.map +1 -1
  217. package/internal/base-component/styles.scoped.css +0 -2
  218. package/internal/components/dropdown-status/interfaces.d.ts +3 -0
  219. package/internal/components/dropdown-status/interfaces.d.ts.map +1 -1
  220. package/internal/components/dropdown-status/interfaces.js.map +1 -1
  221. package/internal/environment.js +1 -1
  222. package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  223. package/internal/generated/custom-css-properties/index.js +37 -32
  224. package/internal/generated/custom-css-properties/index.js.map +1 -1
  225. package/internal/i18n/context.d.ts +1 -19
  226. package/internal/i18n/context.d.ts.map +1 -1
  227. package/internal/i18n/context.js +1 -14
  228. package/internal/i18n/context.js.map +1 -1
  229. package/internal/i18n/index.d.ts +1 -1
  230. package/internal/i18n/index.js +1 -1
  231. package/internal/i18n/index.js.map +1 -1
  232. package/internal/i18n/messages/all.all.js +3541 -30
  233. package/internal/i18n/messages/all.all.json +3599 -52
  234. package/internal/i18n/messages/all.de.js +280 -1
  235. package/internal/i18n/messages/all.de.json +290 -3
  236. package/internal/i18n/messages/all.en-GB.js +270 -1
  237. package/internal/i18n/messages/all.en-GB.json +275 -3
  238. package/internal/i18n/messages/all.en.js +556 -1
  239. package/internal/i18n/messages/all.en.json +558 -4
  240. package/internal/i18n/messages/all.es.js +271 -1
  241. package/internal/i18n/messages/all.es.json +275 -3
  242. package/internal/i18n/messages/all.fr.js +289 -5
  243. package/internal/i18n/messages/all.fr.json +292 -7
  244. package/internal/i18n/messages/all.id.js +261 -1
  245. package/internal/i18n/messages/all.id.json +271 -3
  246. package/internal/i18n/messages/all.it.js +271 -1
  247. package/internal/i18n/messages/all.it.json +277 -3
  248. package/internal/i18n/messages/all.ja.js +267 -1
  249. package/internal/i18n/messages/all.ja.json +273 -3
  250. package/internal/i18n/messages/all.ko.js +257 -2
  251. package/internal/i18n/messages/all.ko.json +263 -4
  252. package/internal/i18n/messages/all.pt-BR.js +280 -3
  253. package/internal/i18n/messages/all.pt-BR.json +281 -5
  254. package/internal/i18n/messages/all.zh-CN.js +272 -9
  255. package/internal/i18n/messages/all.zh-CN.json +276 -11
  256. package/internal/i18n/messages/all.zh-TW.js +264 -1
  257. package/internal/i18n/messages/all.zh-TW.json +268 -3
  258. package/internal/i18n/provider.d.ts +1 -19
  259. package/internal/i18n/provider.d.ts.map +1 -1
  260. package/internal/i18n/provider.js +1 -102
  261. package/internal/i18n/provider.js.map +1 -1
  262. package/internal/i18n/testing.d.ts +1 -7
  263. package/internal/i18n/testing.d.ts.map +1 -1
  264. package/internal/i18n/testing.js +1 -5
  265. package/internal/i18n/testing.js.map +1 -1
  266. package/internal/manifest.json +1 -1
  267. package/link/interfaces.d.ts +1 -0
  268. package/link/interfaces.d.ts.map +1 -1
  269. package/link/interfaces.js.map +1 -1
  270. package/modal/interfaces.d.ts +1 -0
  271. package/modal/interfaces.d.ts.map +1 -1
  272. package/modal/interfaces.js.map +1 -1
  273. package/multiselect/interfaces.d.ts +1 -0
  274. package/multiselect/interfaces.d.ts.map +1 -1
  275. package/multiselect/interfaces.js.map +1 -1
  276. package/package.json +28 -1
  277. package/pagination/interfaces.d.ts +1 -0
  278. package/pagination/interfaces.d.ts.map +1 -1
  279. package/pagination/interfaces.js.map +1 -1
  280. package/property-filter/interfaces.d.ts +1 -0
  281. package/property-filter/interfaces.d.ts.map +1 -1
  282. package/property-filter/interfaces.js.map +1 -1
  283. package/s3-resource-selector/interfaces.d.ts +48 -47
  284. package/s3-resource-selector/interfaces.d.ts.map +1 -1
  285. package/s3-resource-selector/interfaces.js.map +1 -1
  286. package/s3-resource-selector/s3-in-context/index.d.ts.map +1 -1
  287. package/s3-resource-selector/s3-in-context/index.js +11 -9
  288. package/s3-resource-selector/s3-in-context/index.js.map +1 -1
  289. package/s3-resource-selector/s3-in-context/validation.d.ts +2 -1
  290. package/s3-resource-selector/s3-in-context/validation.d.ts.map +1 -1
  291. package/s3-resource-selector/s3-in-context/validation.js +2 -2
  292. package/s3-resource-selector/s3-in-context/validation.js.map +1 -1
  293. package/s3-resource-selector/s3-modal/basic-table.d.ts +2 -1
  294. package/s3-resource-selector/s3-modal/basic-table.d.ts.map +1 -1
  295. package/s3-resource-selector/s3-modal/basic-table.js +7 -7
  296. package/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
  297. package/s3-resource-selector/s3-modal/buckets-table.d.ts.map +1 -1
  298. package/s3-resource-selector/s3-modal/buckets-table.js +10 -7
  299. package/s3-resource-selector/s3-modal/buckets-table.js.map +1 -1
  300. package/s3-resource-selector/s3-modal/index.d.ts.map +1 -1
  301. package/s3-resource-selector/s3-modal/index.js +8 -6
  302. package/s3-resource-selector/s3-modal/index.js.map +1 -1
  303. package/s3-resource-selector/s3-modal/objects-table.d.ts.map +1 -1
  304. package/s3-resource-selector/s3-modal/objects-table.js +10 -7
  305. package/s3-resource-selector/s3-modal/objects-table.js.map +1 -1
  306. package/s3-resource-selector/s3-modal/table-utils.d.ts +2 -1
  307. package/s3-resource-selector/s3-modal/table-utils.d.ts.map +1 -1
  308. package/s3-resource-selector/s3-modal/table-utils.js +5 -9
  309. package/s3-resource-selector/s3-modal/table-utils.js.map +1 -1
  310. package/s3-resource-selector/s3-modal/versions-table.d.ts.map +1 -1
  311. package/s3-resource-selector/s3-modal/versions-table.js +10 -7
  312. package/s3-resource-selector/s3-modal/versions-table.js.map +1 -1
  313. package/select/interfaces.d.ts +2 -0
  314. package/select/interfaces.d.ts.map +1 -1
  315. package/select/interfaces.js.map +1 -1
  316. package/split-panel/index.d.ts.map +1 -1
  317. package/split-panel/index.js +16 -13
  318. package/split-panel/index.js.map +1 -1
  319. package/split-panel/interfaces.d.ts +4 -3
  320. package/split-panel/interfaces.d.ts.map +1 -1
  321. package/split-panel/interfaces.js.map +1 -1
  322. package/split-panel/side.d.ts +3 -3
  323. package/split-panel/side.d.ts.map +1 -1
  324. package/split-panel/side.js +2 -2
  325. package/split-panel/side.js.map +1 -1
  326. package/table/body-cell/index.d.ts.map +1 -1
  327. package/table/body-cell/index.js +3 -1
  328. package/table/body-cell/index.js.map +1 -1
  329. package/table/body-cell/inline-editor.d.ts.map +1 -1
  330. package/table/body-cell/inline-editor.js +5 -1
  331. package/table/body-cell/inline-editor.js.map +1 -1
  332. package/table/header-cell/index.d.ts.map +1 -1
  333. package/table/header-cell/index.js +3 -1
  334. package/table/header-cell/index.js.map +1 -1
  335. package/table/interfaces.d.ts +2 -0
  336. package/table/interfaces.d.ts.map +1 -1
  337. package/table/interfaces.js.map +1 -1
  338. package/table/styles.css.js +36 -35
  339. package/table/styles.scoped.css +46 -43
  340. package/table/styles.selectors.js +36 -35
  341. package/tabs/interfaces.d.ts +1 -0
  342. package/tabs/interfaces.d.ts.map +1 -1
  343. package/tabs/interfaces.js.map +1 -1
  344. package/tag-editor/index.d.ts.map +1 -1
  345. package/tag-editor/index.js +19 -16
  346. package/tag-editor/index.js.map +1 -1
  347. package/tag-editor/interfaces.d.ts +33 -32
  348. package/tag-editor/interfaces.d.ts.map +1 -1
  349. package/tag-editor/interfaces.js.map +1 -1
  350. package/tag-editor/internal.d.ts +6 -6
  351. package/tag-editor/internal.d.ts.map +1 -1
  352. package/tag-editor/internal.js.map +1 -1
  353. package/tag-editor/validation.d.ts +2 -1
  354. package/tag-editor/validation.d.ts.map +1 -1
  355. package/tag-editor/validation.js +8 -8
  356. package/tag-editor/validation.js.map +1 -1
  357. package/token-group/interfaces.d.ts +1 -0
  358. package/token-group/interfaces.d.ts.map +1 -1
  359. package/token-group/interfaces.js.map +1 -1
  360. package/top-navigation/interfaces.d.ts +4 -3
  361. package/top-navigation/interfaces.d.ts.map +1 -1
  362. package/top-navigation/interfaces.js.map +1 -1
  363. package/top-navigation/internal.d.ts.map +1 -1
  364. package/top-navigation/internal.js +6 -4
  365. package/top-navigation/internal.js.map +1 -1
  366. package/top-navigation/parts/overflow-menu/index.d.ts.map +1 -1
  367. package/top-navigation/parts/overflow-menu/index.js +6 -2
  368. package/top-navigation/parts/overflow-menu/index.js.map +1 -1
  369. package/wizard/interfaces.d.ts +1 -0
  370. package/wizard/interfaces.d.ts.map +1 -1
  371. package/wizard/interfaces.js.map +1 -1
  372. package/wizard/styles.css.js +31 -32
  373. package/wizard/styles.scoped.css +64 -67
  374. package/wizard/styles.selectors.js +31 -32
  375. package/wizard/wizard-form.d.ts.map +1 -1
  376. package/wizard/wizard-form.js +1 -1
  377. package/wizard/wizard-form.js.map +1 -1
  378. package/app-layout/visual-refresh/app-bar.d.ts +0 -7
  379. package/app-layout/visual-refresh/app-bar.d.ts.map +0 -1
  380. package/app-layout/visual-refresh/app-bar.js.map +0 -1
@@ -2,77 +2,73 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "appbar": "awsui_appbar_hyvsj_1s8d9_93",
6
- "appbar-nav": "awsui_appbar-nav_hyvsj_1s8d9_117",
7
- "breadcrumbs": "awsui_breadcrumbs_hyvsj_1s8d9_121",
8
- "appbar-tools": "awsui_appbar-tools_hyvsj_1s8d9_125",
9
- "drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_1s8d9_126",
10
- "has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_1s8d9_167",
11
- "has-notifications-content": "awsui_has-notifications-content_hyvsj_1s8d9_175",
12
- "has-header": "awsui_has-header_hyvsj_1s8d9_181",
13
- "has-dynamic-overlap-height": "awsui_has-dynamic-overlap-height_hyvsj_1s8d9_181",
14
- "content-type-wizard": "awsui_content-type-wizard_hyvsj_1s8d9_182",
15
- "content-type-cards": "awsui_content-type-cards_hyvsj_1s8d9_185",
16
- "content-type-table": "awsui_content-type-table_hyvsj_1s8d9_186",
17
- "has-sticky-background": "awsui_has-sticky-background_hyvsj_1s8d9_189",
18
- "background": "awsui_background_hyvsj_1s8d9_224",
19
- "notifications-appbar-header": "awsui_notifications-appbar-header_hyvsj_1s8d9_227",
20
- "sticky-notifications": "awsui_sticky-notifications_hyvsj_1s8d9_240",
21
- "overlap": "awsui_overlap_hyvsj_1s8d9_246",
22
- "drawers-container": "awsui_drawers-container_hyvsj_1s8d9_274",
23
- "has-open-drawer": "awsui_has-open-drawer_hyvsj_1s8d9_286",
24
- "disable-body-scroll": "awsui_disable-body-scroll_hyvsj_1s8d9_320",
25
- "drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_1s8d9_325",
26
- "has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_1s8d9_343",
27
- "drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_1s8d9_375",
28
- "drawers-trigger": "awsui_drawers-trigger_hyvsj_1s8d9_375",
29
- "drawer": "awsui_drawer_hyvsj_1s8d9_126",
30
- "drawer-close-button": "awsui_drawer-close-button_hyvsj_1s8d9_426",
31
- "drawer-content": "awsui_drawer-content_hyvsj_1s8d9_431",
32
- "is-drawer-open": "awsui_is-drawer-open_hyvsj_1s8d9_436",
33
- "content": "awsui_content_hyvsj_1s8d9_182",
34
- "layout": "awsui_layout_hyvsj_1s8d9_534",
35
- "has-max-content-width": "awsui_has-max-content-width_hyvsj_1s8d9_618",
36
- "content-type-dashboard": "awsui_content-type-dashboard_hyvsj_1s8d9_633",
37
- "is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_1s8d9_660",
38
- "has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_1s8d9_667",
39
- "has-split-panel": "awsui_has-split-panel_hyvsj_1s8d9_681",
40
- "split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_1s8d9_681",
41
- "has-content-gap-left": "awsui_has-content-gap-left_hyvsj_1s8d9_693",
42
- "has-content-gap-right": "awsui_has-content-gap-right_hyvsj_1s8d9_696",
43
- "block-body-scroll": "awsui_block-body-scroll_hyvsj_1s8d9_711",
44
- "container": "awsui_container_hyvsj_1s8d9_719",
45
- "disable-content-paddings": "awsui_disable-content-paddings_hyvsj_1s8d9_745",
46
- "is-navigation-open": "awsui_is-navigation-open_hyvsj_1s8d9_750",
47
- "is-tools-open": "awsui_is-tools-open_hyvsj_1s8d9_753",
48
- "is-split-panel-open": "awsui_is-split-panel-open_hyvsj_1s8d9_753",
49
- "split-panel-position-side": "awsui_split-panel-position-side_hyvsj_1s8d9_753",
50
- "content-type-default": "awsui_content-type-default_hyvsj_1s8d9_773",
51
- "content-type-form": "awsui_content-type-form_hyvsj_1s8d9_773",
52
- "unfocusable": "awsui_unfocusable_hyvsj_1s8d9_814",
53
- "navigation-container": "awsui_navigation-container_hyvsj_1s8d9_824",
54
- "show-navigation": "awsui_show-navigation_hyvsj_1s8d9_868",
55
- "animating": "awsui_animating_hyvsj_1s8d9_890",
56
- "showButtons": "awsui_showButtons_hyvsj_1s8d9_1",
57
- "navigation": "awsui_navigation_hyvsj_1s8d9_824",
58
- "openNavigation": "awsui_openNavigation_hyvsj_1s8d9_1",
59
- "animated-content": "awsui_animated-content_hyvsj_1s8d9_951",
60
- "hide-navigation": "awsui_hide-navigation_hyvsj_1s8d9_960",
61
- "notifications": "awsui_notifications_hyvsj_1s8d9_227",
62
- "split-panel-bottom": "awsui_split-panel-bottom_hyvsj_1s8d9_1027",
63
- "position-bottom": "awsui_position-bottom_hyvsj_1s8d9_1073",
64
- "openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_1s8d9_1",
65
- "split-panel-side": "awsui_split-panel-side_hyvsj_1s8d9_1102",
66
- "position-side": "awsui_position-side_hyvsj_1s8d9_1130",
67
- "openSplitPanelSide": "awsui_openSplitPanelSide_hyvsj_1s8d9_1",
68
- "tools-container": "awsui_tools-container_hyvsj_1s8d9_1167",
69
- "tools": "awsui_tools_hyvsj_1s8d9_1167",
70
- "openTools": "awsui_openTools_hyvsj_1s8d9_1",
71
- "has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_1s8d9_1261",
72
- "hide-tools": "awsui_hide-tools_hyvsj_1s8d9_1271",
73
- "show-tools": "awsui_show-tools_hyvsj_1s8d9_1283",
74
- "has-tools-form": "awsui_has-tools-form_hyvsj_1s8d9_1261",
75
- "trigger": "awsui_trigger_hyvsj_1s8d9_1350",
76
- "selected": "awsui_selected_hyvsj_1s8d9_1389"
5
+ "background": "awsui_background_hyvsj_tfl2k_93",
6
+ "scrolling-background": "awsui_scrolling-background_hyvsj_tfl2k_96",
7
+ "sticky-background": "awsui_sticky-background_hyvsj_tfl2k_102",
8
+ "has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_tfl2k_110",
9
+ "breadcrumbs": "awsui_breadcrumbs_hyvsj_tfl2k_123",
10
+ "has-sticky-background": "awsui_has-sticky-background_hyvsj_tfl2k_133",
11
+ "drawers-container": "awsui_drawers-container_hyvsj_tfl2k_145",
12
+ "has-open-drawer": "awsui_has-open-drawer_hyvsj_tfl2k_157",
13
+ "disable-body-scroll": "awsui_disable-body-scroll_hyvsj_tfl2k_191",
14
+ "drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_tfl2k_196",
15
+ "has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_tfl2k_214",
16
+ "drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_tfl2k_246",
17
+ "drawers-trigger": "awsui_drawers-trigger_hyvsj_tfl2k_246",
18
+ "drawer": "awsui_drawer_hyvsj_tfl2k_145",
19
+ "drawer-close-button": "awsui_drawer-close-button_hyvsj_tfl2k_297",
20
+ "drawer-content": "awsui_drawer-content_hyvsj_tfl2k_302",
21
+ "is-drawer-open": "awsui_is-drawer-open_hyvsj_tfl2k_307",
22
+ "content": "awsui_content_hyvsj_tfl2k_341",
23
+ "layout": "awsui_layout_hyvsj_tfl2k_362",
24
+ "has-max-content-width": "awsui_has-max-content-width_hyvsj_tfl2k_443",
25
+ "content-type-dashboard": "awsui_content-type-dashboard_hyvsj_tfl2k_458",
26
+ "is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_tfl2k_475",
27
+ "has-content-gap-left": "awsui_has-content-gap-left_hyvsj_tfl2k_507",
28
+ "has-content-gap-right": "awsui_has-content-gap-right_hyvsj_tfl2k_510",
29
+ "content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_tfl2k_520",
30
+ "has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_tfl2k_523",
31
+ "content-first-child-header": "awsui_content-first-child-header_hyvsj_tfl2k_526",
32
+ "has-header": "awsui_has-header_hyvsj_tfl2k_526",
33
+ "content-first-child-main": "awsui_content-first-child-main_hyvsj_tfl2k_544",
34
+ "disable-content-paddings": "awsui_disable-content-paddings_hyvsj_tfl2k_544",
35
+ "has-split-panel": "awsui_has-split-panel_hyvsj_tfl2k_581",
36
+ "split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_tfl2k_581",
37
+ "block-body-scroll": "awsui_block-body-scroll_hyvsj_tfl2k_597",
38
+ "unfocusable": "awsui_unfocusable_hyvsj_tfl2k_602",
39
+ "container": "awsui_container_hyvsj_tfl2k_612",
40
+ "is-navigation-open": "awsui_is-navigation-open_hyvsj_tfl2k_637",
41
+ "is-tools-open": "awsui_is-tools-open_hyvsj_tfl2k_640",
42
+ "is-split-panel-open": "awsui_is-split-panel-open_hyvsj_tfl2k_640",
43
+ "split-panel-position-side": "awsui_split-panel-position-side_hyvsj_tfl2k_640",
44
+ "mobile-toolbar": "awsui_mobile-toolbar_hyvsj_tfl2k_649",
45
+ "mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_tfl2k_665",
46
+ "mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_tfl2k_669",
47
+ "mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_tfl2k_673",
48
+ "navigation-container": "awsui_navigation-container_hyvsj_tfl2k_682",
49
+ "show-navigation": "awsui_show-navigation_hyvsj_tfl2k_726",
50
+ "animating": "awsui_animating_hyvsj_tfl2k_748",
51
+ "showButtons": "awsui_showButtons_hyvsj_tfl2k_1",
52
+ "navigation": "awsui_navigation_hyvsj_tfl2k_682",
53
+ "openNavigation": "awsui_openNavigation_hyvsj_tfl2k_1",
54
+ "animated-content": "awsui_animated-content_hyvsj_tfl2k_809",
55
+ "hide-navigation": "awsui_hide-navigation_hyvsj_tfl2k_818",
56
+ "notifications": "awsui_notifications_hyvsj_tfl2k_828",
57
+ "sticky-notifications": "awsui_sticky-notifications_hyvsj_tfl2k_834",
58
+ "split-panel-bottom": "awsui_split-panel-bottom_hyvsj_tfl2k_851",
59
+ "position-bottom": "awsui_position-bottom_hyvsj_tfl2k_897",
60
+ "openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_tfl2k_1",
61
+ "split-panel-side": "awsui_split-panel-side_hyvsj_tfl2k_926",
62
+ "position-side": "awsui_position-side_hyvsj_tfl2k_954",
63
+ "openSplitPanelSide": "awsui_openSplitPanelSide_hyvsj_tfl2k_1",
64
+ "tools-container": "awsui_tools-container_hyvsj_tfl2k_991",
65
+ "tools": "awsui_tools_hyvsj_tfl2k_991",
66
+ "openTools": "awsui_openTools_hyvsj_tfl2k_1",
67
+ "has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_tfl2k_1085",
68
+ "hide-tools": "awsui_hide-tools_hyvsj_tfl2k_1095",
69
+ "show-tools": "awsui_show-tools_hyvsj_tfl2k_1107",
70
+ "has-tools-form": "awsui_has-tools-form_hyvsj_tfl2k_1085",
71
+ "trigger": "awsui_trigger_hyvsj_tfl2k_1174",
72
+ "selected": "awsui_selected_hyvsj_tfl2k_1213"
77
73
  };
78
74
 
@@ -53,7 +53,7 @@ export interface AttributeEditorProps<T> extends BaseComponentProps {
53
53
  /**
54
54
  * Specifies the text that's displayed in the remove button.
55
55
  */
56
- removeButtonText: string;
56
+ removeButtonText?: string;
57
57
  /**
58
58
  * Specifies the items that serve as the data source for all rows.
59
59
  * The display of a row is handled by the `definition` property.
@@ -92,6 +92,7 @@ export interface AttributeEditorProps<T> extends BaseComponentProps {
92
92
  onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;
93
93
  /**
94
94
  * An object containing all the necessary localized strings required by the component.
95
+ * @i18n
95
96
  */
96
97
  i18nStrings?: AttributeEditorProps.I18nStrings<T>;
97
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["attribute-editor/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAY/D,MAAM,WAAW,6BAA6B;IAC5C,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,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OAIG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAElE;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;;;;;OAUG;IACH,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnE;;OAEG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IAE9F;;;OAGG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CACnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["attribute-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n export interface I18nStrings<T = any> {\n errorIconAriaLabel?: string;\n itemRemovedAriaLive?: string;\n removeButtonAriaLabel?: (item: T) => string;\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n */\n removeButtonText: string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n * * `label` (ReactNode) - Text label for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n *\n * A maximum of four fields are supported.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["attribute-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n export interface I18nStrings<T = any> {\n errorIconAriaLabel?: string;\n itemRemovedAriaLive?: string;\n removeButtonAriaLabel?: (item: T) => string;\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n */\n removeButtonText?: string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n * * `label` (ReactNode) - Text label for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n *\n * A maximum of four fields are supported.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
@@ -10,7 +10,7 @@ export interface RowProps<T> {
10
10
  i18nStrings: AttributeEditorProps.I18nStrings | undefined;
11
11
  index: number;
12
12
  removable: boolean;
13
- removeButtonText: string;
13
+ removeButtonText?: string;
14
14
  removeButtonRefs: Array<ButtonProps.Ref | undefined>;
15
15
  onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"row.d.ts","sourceRoot":"lib/default/","sources":["attribute-editor/row.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAE3C,OAA6B,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAA0B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAQvF,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,WAAW,EAAE,oBAAoB,CAAC,WAAW,GAAG,SAAS,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC;IACrD,mBAAmB,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;CAC/F;AAYD,eAAO,MAAM,GAAG,yLA2Ef,CAAC"}
1
+ {"version":3,"file":"row.d.ts","sourceRoot":"lib/default/","sources":["attribute-editor/row.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAE3C,OAA6B,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAA0B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AASvF,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,WAAW,EAAE,oBAAoB,CAAC,WAAW,GAAG,SAAS,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC;IACrD,mBAAmB,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;CAC/F;AAYD,eAAO,MAAM,GAAG,yLA4Ef,CAAC"}
@@ -10,6 +10,7 @@ import InternalGrid from '../grid/internal';
10
10
  import { InternalButton } from '../button/internal';
11
11
  import clsx from 'clsx';
12
12
  import { useUniqueId } from '../internal/hooks/use-unique-id';
13
+ import { useInternalI18n } from '../internal/i18n/context';
13
14
  const Divider = () => React.createElement(InternalBox, { className: styles.divider, padding: { top: 'l' } });
14
15
  function render(item, itemIndex, slot) {
15
16
  return typeof slot === 'function' ? slot(item, itemIndex) : slot;
@@ -18,6 +19,7 @@ const GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }];
18
19
  const REMOVABLE_GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }];
19
20
  export const Row = React.memo(({ breakpoint, item, definition, i18nStrings = {}, index, removable, removeButtonText, removeButtonRefs, onRemoveButtonClick, }) => {
20
21
  var _a;
22
+ const i18n = useInternalI18n('attribute-editor');
21
23
  const isNarrowViewport = breakpoint === 'default' || breakpoint === 'xxs';
22
24
  const isWideViewport = !isNarrowViewport;
23
25
  const handleRemoveClick = useCallback(() => {
@@ -31,7 +33,7 @@ export const Row = React.memo(({ breakpoint, item, definition, i18nStrings = {},
31
33
  removable && (React.createElement(ButtonContainer, { index: index, isNarrowViewport: isNarrowViewport, hasLabel: definition.some(row => row.label) },
32
34
  React.createElement(InternalButton, { className: styles['remove-button'], formAction: "none", ref: ref => {
33
35
  removeButtonRefs[index] = ref !== null && ref !== void 0 ? ref : undefined;
34
- }, ariaLabel: (_a = i18nStrings.removeButtonAriaLabel) === null || _a === void 0 ? void 0 : _a.call(i18nStrings, item), onClick: handleRemoveClick }, removeButtonText))))),
36
+ }, ariaLabel: (_a = i18nStrings.removeButtonAriaLabel) === null || _a === void 0 ? void 0 : _a.call(i18nStrings, item), onClick: handleRemoveClick }, i18n('removeButtonText', removeButtonText)))))),
35
37
  isNarrowViewport && React.createElement(Divider, null)));
36
38
  });
37
39
  const ButtonContainer = ({ index, children, isNarrowViewport, hasLabel }) => (React.createElement("div", { className: clsx({
@@ -1 +1 @@
1
- {"version":3,"file":"row.js","sourceRoot":"lib/default/","sources":["attribute-editor/row.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,oBAAgD,MAAM,2BAA2B,CAAC;AAGzF,OAAO,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AACvF,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,oBAAC,WAAW,IAAC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAI,CAA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EAClC,UAAU,EAAC,MAAM,EACjB,GAAG,EAAE,GAAG,CAAC,EAAE;4BACT,gBAAgB,CAAC,KAAK,CAAC,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,SAAS,CAAC;wBAC7C,CAAC,EACD,SAAS,EAAE,MAAA,WAAW,CAAC,qBAAqB,4DAAG,IAAI,CAAC,EACpD,OAAO,EAAE,iBAAiB,IAEzB,gBAAgB,CACF,CACD,CACnB,CACY,CACX;QACL,gBAAgB,IAAI,oBAAC,OAAO,OAAG,CACpB,CACf,CAAC;AACJ,CAAC,CACF,CAAC;AASF,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAmB,EAAE,EAAE,CAAC,CAC5F,6BACE,SAAS,EAAE,IAAI,CAAC;QACd,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,EAAE,CAAC,gBAAgB,IAAI,KAAK,KAAK,CAAC,IAAI,QAAQ;QACnF,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,gBAAgB,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,QAAQ;QACnF,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,gBAAgB;KAC1C,CAAC,IAED,QAAQ,CACL,CACP,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport InternalBox from '../box/internal';\nimport styles from './styles.css.js';\nimport React, { useCallback } from 'react';\nimport InternalFormField from '../form-field/internal';\nimport InternalColumnLayout, { ColumnLayoutBreakpoint } from '../column-layout/internal';\nimport { AttributeEditorProps } from './interfaces';\nimport { ButtonProps } from '../button/interfaces';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport InternalGrid from '../grid/internal';\nimport { InternalButton } from '../button/internal';\nimport clsx from 'clsx';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\n\nconst Divider = () => <InternalBox className={styles.divider} padding={{ top: 'l' }} />;\n\nexport interface RowProps<T> {\n breakpoint: ColumnLayoutBreakpoint | null;\n item: T;\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n i18nStrings: AttributeEditorProps.I18nStrings | undefined;\n index: number;\n removable: boolean;\n removeButtonText: string;\n removeButtonRefs: Array<ButtonProps.Ref | undefined>;\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n}\n\nfunction render<T>(\n item: T,\n itemIndex: number,\n slot: AttributeEditorProps.FieldRenderable<T> | React.ReactNode | undefined\n) {\n return typeof slot === 'function' ? slot(item, itemIndex) : slot;\n}\n\nconst GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }];\nconst REMOVABLE_GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }];\nexport const Row = React.memo(\n <T,>({\n breakpoint,\n item,\n definition,\n i18nStrings = {},\n index,\n removable,\n removeButtonText,\n removeButtonRefs,\n onRemoveButtonClick,\n }: RowProps<T>) => {\n const isNarrowViewport = breakpoint === 'default' || breakpoint === 'xxs';\n const isWideViewport = !isNarrowViewport;\n\n const handleRemoveClick = useCallback(() => {\n fireNonCancelableEvent(onRemoveButtonClick, { itemIndex: index });\n }, [onRemoveButtonClick, index]);\n\n const firstControlId = useUniqueId('first-control-id-');\n\n return (\n <InternalBox className={styles.row} margin={{ bottom: 's' }}>\n <div role=\"group\" aria-labelledby={`${firstControlId}-label ${firstControlId}`}>\n <InternalGrid\n __breakpoint={breakpoint}\n gridDefinition={removable ? REMOVABLE_GRID_DEFINITION : GRID_DEFINITION}\n >\n <InternalColumnLayout\n className={styles['row-control']}\n columns={definition.length}\n __breakpoint={breakpoint}\n >\n {definition.map(({ info, label, constraintText, errorText, control }, defIndex) => (\n <InternalFormField\n key={defIndex}\n className={styles.field}\n label={label}\n info={info}\n constraintText={render(item, index, constraintText)}\n errorText={render(item, index, errorText)}\n stretch={true}\n i18nStrings={{ errorIconAriaLabel: i18nStrings.errorIconAriaLabel }}\n __hideLabel={isWideViewport && index > 0}\n controlId={defIndex === 0 ? firstControlId : undefined}\n >\n {render(item, index, control)}\n </InternalFormField>\n ))}\n </InternalColumnLayout>\n {removable && (\n <ButtonContainer\n index={index}\n isNarrowViewport={isNarrowViewport}\n hasLabel={definition.some(row => row.label)}\n >\n <InternalButton\n className={styles['remove-button']}\n formAction=\"none\"\n ref={ref => {\n removeButtonRefs[index] = ref ?? undefined;\n }}\n ariaLabel={i18nStrings.removeButtonAriaLabel?.(item)}\n onClick={handleRemoveClick}\n >\n {removeButtonText}\n </InternalButton>\n </ButtonContainer>\n )}\n </InternalGrid>\n </div>\n {isNarrowViewport && <Divider />}\n </InternalBox>\n );\n }\n);\n\ninterface ButtonContainer {\n index: number;\n children: React.ReactNode;\n isNarrowViewport: boolean;\n hasLabel: boolean;\n}\n\nconst ButtonContainer = ({ index, children, isNarrowViewport, hasLabel }: ButtonContainer) => (\n <div\n className={clsx({\n [styles['button-container-haslabel']]: !isNarrowViewport && index === 0 && hasLabel,\n [styles['button-container-nolabel']]: !isNarrowViewport && index === 0 && !hasLabel,\n [styles['right-align']]: isNarrowViewport,\n })}\n >\n {children}\n </div>\n);\n"]}
1
+ {"version":3,"file":"row.js","sourceRoot":"lib/default/","sources":["attribute-editor/row.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,oBAAgD,MAAM,2BAA2B,CAAC;AAGzF,OAAO,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AACvF,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cA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ourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport InternalBox from '../box/internal';\nimport styles from './styles.css.js';\nimport React, { useCallback } from 'react';\nimport InternalFormField from '../form-field/internal';\nimport InternalColumnLayout, { ColumnLayoutBreakpoint } from '../column-layout/internal';\nimport { AttributeEditorProps } from './interfaces';\nimport { ButtonProps } from '../button/interfaces';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport InternalGrid from '../grid/internal';\nimport { InternalButton } from '../button/internal';\nimport clsx from 'clsx';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useInternalI18n } from '../internal/i18n/context';\n\nconst Divider = () => <InternalBox className={styles.divider} padding={{ top: 'l' }} />;\n\nexport interface RowProps<T> {\n breakpoint: ColumnLayoutBreakpoint | null;\n item: T;\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n i18nStrings: AttributeEditorProps.I18nStrings | undefined;\n index: number;\n removable: boolean;\n removeButtonText?: string;\n removeButtonRefs: Array<ButtonProps.Ref | undefined>;\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n}\n\nfunction render<T>(\n item: T,\n itemIndex: number,\n slot: AttributeEditorProps.FieldRenderable<T> | React.ReactNode | undefined\n) {\n return typeof slot === 'function' ? slot(item, itemIndex) : slot;\n}\n\nconst GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }];\nconst REMOVABLE_GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }];\nexport const Row = React.memo(\n <T,>({\n breakpoint,\n item,\n definition,\n i18nStrings = {},\n index,\n removable,\n removeButtonText,\n removeButtonRefs,\n onRemoveButtonClick,\n }: RowProps<T>) => {\n const i18n = useInternalI18n('attribute-editor');\n const isNarrowViewport = breakpoint === 'default' || breakpoint === 'xxs';\n const isWideViewport = !isNarrowViewport;\n\n const handleRemoveClick = useCallback(() => {\n fireNonCancelableEvent(onRemoveButtonClick, { itemIndex: index });\n }, [onRemoveButtonClick, index]);\n\n const firstControlId = useUniqueId('first-control-id-');\n\n return (\n <InternalBox className={styles.row} margin={{ bottom: 's' }}>\n <div role=\"group\" aria-labelledby={`${firstControlId}-label ${firstControlId}`}>\n <InternalGrid\n __breakpoint={breakpoint}\n gridDefinition={removable ? REMOVABLE_GRID_DEFINITION : GRID_DEFINITION}\n >\n <InternalColumnLayout\n className={styles['row-control']}\n columns={definition.length}\n __breakpoint={breakpoint}\n >\n {definition.map(({ info, label, constraintText, errorText, control }, defIndex) => (\n <InternalFormField\n key={defIndex}\n className={styles.field}\n label={label}\n info={info}\n constraintText={render(item, index, constraintText)}\n errorText={render(item, index, errorText)}\n stretch={true}\n i18nStrings={{ errorIconAriaLabel: i18nStrings.errorIconAriaLabel }}\n __hideLabel={isWideViewport && index > 0}\n controlId={defIndex === 0 ? firstControlId : undefined}\n >\n {render(item, index, control)}\n </InternalFormField>\n ))}\n </InternalColumnLayout>\n {removable && (\n <ButtonContainer\n index={index}\n isNarrowViewport={isNarrowViewport}\n hasLabel={definition.some(row => row.label)}\n >\n <InternalButton\n className={styles['remove-button']}\n formAction=\"none\"\n ref={ref => {\n removeButtonRefs[index] = ref ?? undefined;\n }}\n ariaLabel={i18nStrings.removeButtonAriaLabel?.(item)}\n onClick={handleRemoveClick}\n >\n {i18n('removeButtonText', removeButtonText)}\n </InternalButton>\n </ButtonContainer>\n )}\n </InternalGrid>\n </div>\n {isNarrowViewport && <Divider />}\n </InternalBox>\n );\n }\n);\n\ninterface ButtonContainer {\n index: number;\n children: React.ReactNode;\n isNarrowViewport: boolean;\n hasLabel: boolean;\n}\n\nconst ButtonContainer = ({ index, children, isNarrowViewport, hasLabel }: ButtonContainer) => (\n <div\n className={clsx({\n [styles['button-container-haslabel']]: !isNarrowViewport && index === 0 && hasLabel,\n [styles['button-container-nolabel']]: !isNarrowViewport && index === 0 && !hasLabel,\n [styles['right-align']]: isNarrowViewport,\n })}\n >\n {children}\n </div>\n);\n"]}
@@ -9,7 +9,7 @@ export interface AutosuggestOptionProps extends BaseComponentProps {
9
9
  highlighted: boolean;
10
10
  highlightType: HighlightType;
11
11
  current: boolean;
12
- enteredTextLabel: (value: string) => string;
12
+ enteredTextLabel?: (value: string) => string;
13
13
  virtualPosition?: number;
14
14
  padBottom?: boolean;
15
15
  screenReaderContent?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"autosuggest-option.d.ts","sourceRoot":"lib/default/","sources":["autosuggest/autosuggest-option.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,kBAAkB,EAAgB,MAAM,4BAA4B,CAAC;AAI9E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAC;AAE/F,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,eAAe,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;;AAyED,wBAA+D"}
1
+ {"version":3,"file":"autosuggest-option.d.ts","sourceRoot":"lib/default/","sources":["autosuggest/autosuggest-option.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,kBAAkB,EAAgB,MAAM,4BAA4B,CAAC;AAI9E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAC;AAG/F,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,eAAe,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;;AA4ED,wBAA+D"}
@@ -7,16 +7,18 @@ import SelectableItem from '../internal/components/selectable-item';
7
7
  import { getBaseProps } from '../internal/base-component';
8
8
  import { getTestOptionIndexes } from '../internal/components/options-list/utils/test-indexes';
9
9
  import styles from './styles.css.js';
10
+ import { useInternalI18n } from '../internal/i18n/context';
10
11
  const AutosuggestOption = (_a, ref) => {
11
12
  var { nativeAttributes = {}, highlightText, option, highlighted, highlightType, current, enteredTextLabel, virtualPosition, padBottom, screenReaderContent, ariaSetsize, ariaPosinset } = _a, rest = __rest(_a, ["nativeAttributes", "highlightText", "option", "highlighted", "highlightType", "current", "enteredTextLabel", "virtualPosition", "padBottom", "screenReaderContent", "ariaSetsize", "ariaPosinset"]);
12
13
  const baseProps = getBaseProps(rest);
14
+ const i18n = useInternalI18n('autosuggest');
13
15
  const useEntered = 'type' in option && option.type === 'use-entered';
14
16
  const isParent = 'type' in option && option.type === 'parent';
15
17
  const isChild = 'type' in option && option.type === 'child';
16
18
  const { throughIndex, inGroupIndex, groupIndex } = getTestOptionIndexes(option) || {};
17
19
  let optionContent;
18
20
  if (useEntered) {
19
- optionContent = enteredTextLabel(option.value || '');
21
+ optionContent = i18n('enteredTextLabel', enteredTextLabel === null || enteredTextLabel === void 0 ? void 0 : enteredTextLabel(option.value || ''), format => format({ value: option.value || '' }));
20
22
  // we don't want fancy generated content for screenreader for the "Use..." option,
21
23
  // just the visible text is fine
22
24
  screenReaderContent = undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"autosuggest-option.js","sourceRoot":"lib/default/","sources":["autosuggest/autosuggest-option.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAsB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAE9F,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAmBrC,MAAM,iBAAiB,GAAG,CACxB,EAcyB,EACzB,GAA8B,EAC9B,EAAE;QAhBF,EACE,gBAAgB,GAAG,EAAE,EACrB,aAAa,EACb,MAAM,EACN,WAAW,EACX,aAAa,EACb,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,YAAY,OAEW,EADpB,IAAI,cAbT,oMAcC,CADQ;IAIT,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,CAAC;IACrE,MAAM,QAAQ,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;IAC9D,MAAM,OAAO,GA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AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport OptionComponent from '../internal/components/option';\nimport SelectableItem from '../internal/components/selectable-item';\nimport { BaseComponentProps, getBaseProps } from '../internal/base-component';\nimport { getTestOptionIndexes } from '../internal/components/options-list/utils/test-indexes';\n\nimport styles from './styles.css.js';\nimport { AutosuggestItem } from './interfaces';\nimport { HighlightType } from '../internal/components/options-list/utils/use-highlight-option';\n\nexport interface AutosuggestOptionProps extends BaseComponentProps {\n nativeAttributes?: Record<string, any>;\n highlightText: string;\n option: AutosuggestItem;\n highlighted: boolean;\n highlightType: HighlightType;\n current: boolean;\n enteredTextLabel: (value: string) => string;\n virtualPosition?: number;\n padBottom?: boolean;\n screenReaderContent?: string;\n ariaSetsize?: number;\n ariaPosinset?: number;\n}\n\nconst AutosuggestOption = (\n {\n nativeAttributes = {},\n highlightText,\n option,\n highlighted,\n highlightType,\n current,\n enteredTextLabel,\n virtualPosition,\n padBottom,\n screenReaderContent,\n ariaSetsize,\n ariaPosinset,\n ...rest\n }: AutosuggestOptionProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(rest);\n const useEntered = 'type' in option && option.type === 'use-entered';\n const isParent = 'type' in option && option.type === 'parent';\n const isChild = 'type' in option && option.type === 'child';\n const { throughIndex, inGroupIndex, groupIndex } = getTestOptionIndexes(option) || {};\n\n let optionContent;\n if (useEntered) {\n optionContent = enteredTextLabel(option.value || '');\n // we don't want fancy generated content for screenreader for the \"Use...\" option,\n // just the visible text is fine\n screenReaderContent = undefined;\n } else if (isParent) {\n optionContent = option.label;\n } else {\n const a11yProperties: AutosuggestOptionProps['nativeAttributes'] = {};\n if (nativeAttributes['aria-label']) {\n a11yProperties['aria-label'] = nativeAttributes['aria-label'];\n }\n\n optionContent = (\n <div {...a11yProperties}>\n <OptionComponent option={option} highlightedOption={highlighted} highlightText={highlightText} />\n </div>\n );\n }\n\n return (\n <SelectableItem\n {...baseProps}\n className={styles.option}\n ariaSelected={current}\n highlighted={highlighted}\n disabled={option.disabled}\n hasBackground={useEntered}\n isParent={isParent}\n isChild={isChild}\n virtualPosition={virtualPosition}\n data-test-index={throughIndex}\n data-in-group-index={inGroupIndex}\n data-group-index={groupIndex}\n ref={ref}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaSetsize={ariaSetsize}\n ariaPosinset={ariaPosinset}\n highlightType={highlightType}\n >\n {optionContent}\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(AutosuggestOption));\n"]}
1
+ {"version":3,"file":"autosuggest-option.js","sourceRoot":"lib/default/","sources":["autosuggest/autosuggest-option.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAsB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAE9F,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAiB3D,MAAM,iBAAiB,GAAG,CACxB,EAcyB,EACzB,GAA8B,EAC9B,EAAE;QAhBF,EACE,gBAAgB,GAAG,EAAE,EACrB,aAAa,EACb,MAAM,EACN,WAAW,EACX,aAAa,EACb,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,YAAY,OAEW,EADpB,IAAI,cAbT,oMAcC,CADQ;IAIT,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAA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M,EACxB,YAAY,EAAE,OAAO,EACrB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,aAAa,EAAE,UAAU,EACzB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,eAAe,qBACf,YAAY,yBACR,YAAY,sBACf,UAAU,EAC5B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,KAE3B,aAAa,CACC,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport OptionComponent from '../internal/components/option';\nimport SelectableItem from '../internal/components/selectable-item';\nimport { BaseComponentProps, getBaseProps } from '../internal/base-component';\nimport { getTestOptionIndexes } from '../internal/components/options-list/utils/test-indexes';\n\nimport styles from './styles.css.js';\nimport { AutosuggestItem } from './interfaces';\nimport { HighlightType } from '../internal/components/options-list/utils/use-highlight-option';\nimport { useInternalI18n } from '../internal/i18n/context';\n\nexport interface AutosuggestOptionProps extends BaseComponentProps {\n nativeAttributes?: Record<string, any>;\n highlightText: string;\n option: AutosuggestItem;\n highlighted: boolean;\n highlightType: HighlightType;\n current: boolean;\n enteredTextLabel?: (value: string) => string;\n virtualPosition?: number;\n padBottom?: boolean;\n screenReaderContent?: string;\n ariaSetsize?: number;\n ariaPosinset?: number;\n}\n\nconst AutosuggestOption = (\n {\n nativeAttributes = {},\n highlightText,\n option,\n highlighted,\n highlightType,\n current,\n enteredTextLabel,\n virtualPosition,\n padBottom,\n screenReaderContent,\n ariaSetsize,\n ariaPosinset,\n ...rest\n }: AutosuggestOptionProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('autosuggest');\n const useEntered = 'type' in option && option.type === 'use-entered';\n const isParent = 'type' in option && option.type === 'parent';\n const isChild = 'type' in option && option.type === 'child';\n const { throughIndex, inGroupIndex, groupIndex } = getTestOptionIndexes(option) || {};\n\n let optionContent;\n if (useEntered) {\n optionContent = i18n('enteredTextLabel', enteredTextLabel?.(option.value || ''), format =>\n format({ value: option.value || '' })\n );\n // we don't want fancy generated content for screenreader for the \"Use...\" option,\n // just the visible text is fine\n screenReaderContent = undefined;\n } else if (isParent) {\n optionContent = option.label;\n } else {\n const a11yProperties: AutosuggestOptionProps['nativeAttributes'] = {};\n if (nativeAttributes['aria-label']) {\n a11yProperties['aria-label'] = nativeAttributes['aria-label'];\n }\n\n optionContent = (\n <div {...a11yProperties}>\n <OptionComponent option={option} highlightedOption={highlighted} highlightText={highlightText} />\n </div>\n );\n }\n\n return (\n <SelectableItem\n {...baseProps}\n className={styles.option}\n ariaSelected={current}\n highlighted={highlighted}\n disabled={option.disabled}\n hasBackground={useEntered}\n isParent={isParent}\n isChild={isChild}\n virtualPosition={virtualPosition}\n data-test-index={throughIndex}\n data-in-group-index={inGroupIndex}\n data-group-index={groupIndex}\n ref={ref}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaSetsize={ariaSetsize}\n ariaPosinset={ariaPosinset}\n highlightType={highlightType}\n >\n {optionContent}\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(AutosuggestOption));\n"]}
@@ -58,8 +58,9 @@ export interface AutosuggestProps extends BaseComponentProps, BaseInputProps, In
58
58
  filteringType?: OptionsFilteringType;
59
59
  /**
60
60
  * Specifies a function that generates the custom value indicator (for example, `Use "${value}"`).
61
+ * @i18n
61
62
  */
62
- enteredTextLabel: AutosuggestProps.EnteredTextLabel;
63
+ enteredTextLabel?: AutosuggestProps.EnteredTextLabel;
63
64
  /**
64
65
  * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.
65
66
  */
@@ -78,6 +79,7 @@ export interface AutosuggestProps extends BaseComponentProps, BaseInputProps, In
78
79
  * Specifies the localized string that describes an option as being selected.
79
80
  * This is required to provide a good screen reader experience. For more information, see the
80
81
  * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).
82
+ * @i18n
81
83
  */
82
84
  selectedAriaLabel?: string;
83
85
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["autosuggest/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpH,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,gBACf,SAAQ,kBAAkB,EACxB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,+BAA+B,EAC/B,mBAAmB;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA8BI;IACJ,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC;IACnC;;;;;;;;;;;;;;;QAeI;IACJ,aAAa,CAAC,EAAE,oBAAoB,CAAC;IAErC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IAE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AC,gBAAgB,CAAC,MAAM,GAAG,gBAAgB,CAAC,WAAW,CAAC,GAAG;IACvF,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;IAC1C,MAAM,EAAE,gBAAgB,GAAG,WAAW,CAAC;CACxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["autosuggest/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport {\n BaseDropdownHostProps,\n OptionsLoadItemsDetail,\n OptionsFilteringType,\n} from '../internal/components/dropdown/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents, InputProps } from '../input/interfaces';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface AutosuggestProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n BaseDropdownHostProps,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAlt` (string) - (Optional) Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: AutosuggestProps.Options;\n /**\n * Determines how filtering is applied to the list of `options`:\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Specifies a function that generates the custom value indicator (for example, `Use \"${value}\"`).\n */\n enteredTextLabel: AutosuggestProps.EnteredTextLabel;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Specifies the text that's displayed when there aren't any suggestions to display.\n * This is displayed when `statusType` is set to `finished` or it's not set at all.\n */\n empty?: React.ReactNode;\n\n /**\n * Called whenever a user selects an option in the dropdown. Don't use this event as the only way to handle user input.\n * Instead, use `onSelect` in combination with the `onChange` handler only as an optional convenience for the user.\n */\n onSelect?: NonCancelableEventHandler<AutosuggestProps.SelectDetail>;\n\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: AutosuggestProps.ContainingOptionAndGroupString;\n}\n\nexport namespace AutosuggestProps {\n export type ChangeDetail = InputProps.ChangeDetail;\n export type KeyDetail = InputProps.KeyDetail;\n export type FilteringType = OptionsFilteringType;\n export type Option = OptionDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n export type EnteredTextLabel = (value: string) => string;\n export interface OptionGroup extends Option {\n label?: string;\n options: ReadonlyArray<Option>;\n }\n export type LoadItemsDetail = OptionsLoadItemsDetail;\n export type StatusType = DropdownStatusProps.StatusType;\n export interface SelectDetail {\n value: string;\n selectedOption?: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\n }\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n\n /**\n * Selects all text in the input control.\n */\n select(): void;\n }\n}\n\n// TODO: use DropdownOption type same as in select and multiselect\nexport type AutosuggestItem = (AutosuggestProps.Option | AutosuggestProps.OptionGroup) & {\n type?: 'parent' | 'child' | 'use-entered';\n option: OptionDefinition | OptionGroup;\n};\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["autosuggest/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport {\n BaseDropdownHostProps,\n OptionsLoadItemsDetail,\n OptionsFilteringType,\n} from '../internal/components/dropdown/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents, InputProps } from '../input/interfaces';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface AutosuggestProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n BaseDropdownHostProps,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAlt` (string) - (Optional) Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: AutosuggestProps.Options;\n /**\n * Determines how filtering is applied to the list of `options`:\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Specifies a function that generates the custom value indicator (for example, `Use \"${value}\"`).\n * @i18n\n */\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Specifies the text that's displayed when there aren't any suggestions to display.\n * This is displayed when `statusType` is set to `finished` or it's not set at all.\n */\n empty?: React.ReactNode;\n\n /**\n * Called whenever a user selects an option in the dropdown. Don't use this event as the only way to handle user input.\n * Instead, use `onSelect` in combination with the `onChange` handler only as an optional convenience for the user.\n */\n onSelect?: NonCancelableEventHandler<AutosuggestProps.SelectDetail>;\n\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: AutosuggestProps.ContainingOptionAndGroupString;\n}\n\nexport namespace AutosuggestProps {\n export type ChangeDetail = InputProps.ChangeDetail;\n export type KeyDetail = InputProps.KeyDetail;\n export type FilteringType = OptionsFilteringType;\n export type Option = OptionDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n export type EnteredTextLabel = (value: string) => string;\n export interface OptionGroup extends Option {\n label?: string;\n options: ReadonlyArray<Option>;\n }\n export type LoadItemsDetail = OptionsLoadItemsDetail;\n export type StatusType = DropdownStatusProps.StatusType;\n export interface SelectDetail {\n value: string;\n selectedOption?: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\n }\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n\n /**\n * Selects all text in the input control.\n */\n select(): void;\n }\n}\n\n// TODO: use DropdownOption type same as in select and multiselect\nexport type AutosuggestItem = (AutosuggestProps.Option | AutosuggestProps.OptionGroup) & {\n type?: 'parent' | 'child' | 'use-entered';\n option: OptionDefinition | OptionGroup;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["autosuggest/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,OAAO,EAAmB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAejE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAUlF,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAEjG,QAAA,MAAM,mBAAmB,uGAgNvB,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["autosuggest/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,OAAO,EAAmB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAejE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAWlF,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAEjG,QAAA,MAAM,mBAAmB,uGAoNvB,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
@@ -16,6 +16,7 @@ import AutosuggestInput from '../internal/components/autosuggest-input';
16
16
  import { useFormFieldContext } from '../contexts/form-field';
17
17
  import { useInternalI18n } from '../internal/i18n/context';
18
18
  import styles from './styles.css.js';
19
+ import { warnOnce } from '../internal/logging';
19
20
  const InternalAutosuggest = React.forwardRef((props, ref) => {
20
21
  var _a, _b;
21
22
  const { value, onChange, onBlur, onFocus, onKeyUp, onLoadItems, options, filteringType = 'auto', statusType = 'finished', recoveryText, placeholder, clearAriaLabel, name, disabled, disableBrowserAutocorrect = false, autoFocus, readOnly, ariaLabel, ariaRequired, enteredTextLabel, filteringResultsText, onKeyDown, virtualScroll, expandToViewport, onSelect, renderHighlightedAriaLive, __internalRootRef } = props, restProps = __rest(props, ["value", "onChange", "onBlur", "onFocus", "onKeyUp", "onLoadItems", "options", "filteringType", "statusType", "recoveryText", "placeholder", "clearAriaLabel", "name", "disabled", "disableBrowserAutocorrect", "autoFocus", "readOnly", "ariaLabel", "ariaRequired", "enteredTextLabel", "filteringResultsText", "onKeyDown", "virtualScroll", "expandToViewport", "onSelect", "renderHighlightedAriaLive", "__internalRootRef"]);
@@ -29,6 +30,9 @@ const InternalAutosuggest = React.forwardRef((props, ref) => {
29
30
  const i18n = useInternalI18n('autosuggest');
30
31
  const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);
31
32
  const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);
33
+ if (!enteredTextLabel) {
34
+ warnOnce('Autosuggest', 'A value for enteredTextLabel must be provided.');
35
+ }
32
36
  const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({
33
37
  options: options || [],
34
38
  filterValue: value,
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["autosuggest/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAO,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,cAAc,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAEL,mBAAmB,EACnB,sBAAsB,GAEvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,eAAe,MAAM,oCAAoC,CAAC;AAEjE,OAAO,sBAAsB,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,gBAAyC,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAA+B,EAAE,GAA8B,EAAE,EAAE;;IAC/G,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,WAAW,EACX,OAAO,EACP,aAAa,GAAG,MAAM,EACtB,UAAU,GAAG,UAAU,EACvB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,IAAI,EACJ,QAAQ,EAC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AC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useAutosuggestItems } from './options-controller';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\n\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport DropdownFooter from '../internal/components/dropdown-footer';\n\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport {\n BaseKeyDetail,\n fireCancelableEvent,\n fireNonCancelableEvent,\n NonCancelableCustomEvent,\n} from '../internal/events';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport AutosuggestOptionsList from './options-list';\nimport { useAutosuggestLoadMore } from './load-more-controller';\nimport { OptionsLoadItemsDetail } from '../internal/components/dropdown/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { useInternalI18n } from '../internal/i18n/context';\n\nimport styles from './styles.css.js';\n\nexport interface InternalAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {}\n\nconst InternalAutosuggest = React.forwardRef((props: InternalAutosuggestProps, ref: Ref<AutosuggestProps.Ref>) => {\n const {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onLoadItems,\n options,\n filteringType = 'auto',\n statusType = 'finished',\n recoveryText,\n placeholder,\n clearAriaLabel,\n name,\n disabled,\n disableBrowserAutocorrect = false,\n autoFocus,\n readOnly,\n ariaLabel,\n ariaRequired,\n enteredTextLabel,\n filteringResultsText,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n onSelect,\n renderHighlightedAriaLive,\n __internalRootRef,\n ...restProps\n } = props;\n\n checkControlled('Autosuggest', 'value', value, 'onChange', onChange);\n checkOptionValueField('Autosuggest', 'options', options);\n\n const autosuggestInputRef = useRef<AutosuggestInputRef>(null);\n useImperativeHandle(\n ref,\n () => ({\n focus: () => autosuggestInputRef.current?.focus(),\n select: () => autosuggestInputRef.current?.select(),\n }),\n []\n );\n\n const i18n = useInternalI18n('autosuggest');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: options || [],\n filterValue: value,\n filterText: value,\n filteringType,\n hideEnteredTextLabel: false,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n fireNonCancelableEvent(onSelect, {\n value,\n selectedOption: option.type !== 'use-entered' ? option.option : undefined,\n });\n autosuggestInputRef.current?.close();\n },\n });\n\n const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({\n options,\n statusType,\n onLoadItems: (detail: OptionsLoadItemsDetail) => fireNonCancelableEvent(onLoadItems, detail),\n });\n\n const handleChange = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestItemsHandlers.setShowAll(false);\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n fireNonCancelableEvent(onChange, event.detail);\n };\n\n const handleDelayedInput = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value);\n };\n\n const handleBlur = () => {\n fireNonCancelableEvent(onBlur, null);\n };\n\n const handleFocus = () => {\n autosuggestItemsHandlers.setShowAll(true);\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireNonCancelableEvent(onFocus, null);\n };\n\n const handleKeyUp = (e: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyUp, e.detail);\n };\n\n const handleKeyDown = (e: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyDown, e.detail);\n };\n\n const handlePressArrowDown = () => {\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n };\n\n const handlePressArrowUp = () => {\n autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);\n };\n\n const handlePressEnter = () => {\n return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard();\n };\n\n const handleCloseDropdown = () => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n };\n\n const handleRecoveryClick = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick();\n autosuggestInputRef.current?.focus();\n };\n\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('input');\n const footerControlId = useUniqueId('footer');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const highlightedOptionIdSource = useUniqueId();\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const isFiltered = !!value && value.length !== 0;\n const filteredText = isFiltered\n ? filteringResultsText?.(autosuggestItemsState.items.length, options?.length ?? 0)\n : undefined;\n const dropdownStatus = useDropdownStatus({\n ...props,\n isEmpty,\n isFiltered,\n recoveryText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n filteringResultsText: filteredText,\n });\n\n return (\n <AutosuggestInput\n {...restProps}\n className={clsx(styles.root, restProps.className)}\n ref={autosuggestInputRef}\n __internalRootRef={__internalRootRef}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n name={name}\n controlId={controlId}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n autoFocus={autoFocus}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n expandToViewport={expandToViewport}\n ariaControls={listId}\n ariaActivedescendant={highlightedOptionId}\n dropdownExpanded={autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null}\n dropdownContent={\n <AutosuggestOptionsList\n statusType={statusType}\n autosuggestItemsState={autosuggestItemsState}\n autosuggestItemsHandlers={autosuggestItemsHandlers}\n highlightedOptionId={highlightedOptionId}\n highlightText={value}\n listId={listId}\n controlId={controlId}\n enteredTextLabel={enteredTextLabel}\n handleLoadMore={autosuggestLoadMoreHandlers.fireLoadMoreOnScroll}\n hasDropdownStatus={dropdownStatus.content !== null}\n virtualScroll={virtualScroll}\n selectedAriaLabel={selectedAriaLabel}\n renderHighlightedAriaLive={renderHighlightedAriaLive}\n listBottom={\n !dropdownStatus.isSticky ? <DropdownFooter content={dropdownStatus.content} id={footerControlId} /> : null\n }\n ariaDescribedby={dropdownStatus.content ? footerControlId : undefined}\n />\n }\n dropdownFooter={\n dropdownStatus.isSticky ? (\n <DropdownFooter\n id={footerControlId}\n content={dropdownStatus.content}\n hasItems={autosuggestItemsState.items.length >= 1}\n />\n ) : null\n }\n loopFocus={statusType === 'error' && !!recoveryText}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n});\n\nexport default InternalAutosuggest;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["autosuggest/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAO,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,cAAc,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE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B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,2BAA2B,CAAC,oBAAoB,EAChE,iBAAiB,EAAE,cAAc,CAAC,OAAO,KAAK,IAAI,EAClD,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,yBAAyB,EAAE,yBAAyB,EACpD,UAAU,EACR,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAC,cAAc,IAAC,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,GAAI,CAAC,CAAC,CAAC,IAAI,EAE5G,eAAe,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,GACrE,EAEJ,cAAc,EACZ,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CACxB,oBAAC,cAAc,IACb,EAAE,EAAE,eAAe,EACnB,OAAO,EAAE,cAAc,CAAC,OAAO,EAC/B,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GACjD,CACH,CAAC,CAAC,CAAC,IAAI,EAEV,SAAS,EAAE,UAAU,KAAK,OAAO,IAAI,CAAC,CAAC,YAAY,EACnD,eAAe,EAAE,mBAAmB,EACpC,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,EACtC,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gBAAgB,IAC9B,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useAutosuggestItems } from './options-controller';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\n\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport DropdownFooter from '../internal/components/dropdown-footer';\n\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport {\n BaseKeyDetail,\n fireCancelableEvent,\n fireNonCancelableEvent,\n NonCancelableCustomEvent,\n} from '../internal/events';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport AutosuggestOptionsList from './options-list';\nimport { useAutosuggestLoadMore } from './load-more-controller';\nimport { OptionsLoadItemsDetail } from '../internal/components/dropdown/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { useInternalI18n } from '../internal/i18n/context';\n\nimport styles from './styles.css.js';\nimport { warnOnce } from '../internal/logging';\n\nexport interface InternalAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {}\n\nconst InternalAutosuggest = React.forwardRef((props: InternalAutosuggestProps, ref: Ref<AutosuggestProps.Ref>) => {\n const {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onLoadItems,\n options,\n filteringType = 'auto',\n statusType = 'finished',\n recoveryText,\n placeholder,\n clearAriaLabel,\n name,\n disabled,\n disableBrowserAutocorrect = false,\n autoFocus,\n readOnly,\n ariaLabel,\n ariaRequired,\n enteredTextLabel,\n filteringResultsText,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n onSelect,\n renderHighlightedAriaLive,\n __internalRootRef,\n ...restProps\n } = props;\n\n checkControlled('Autosuggest', 'value', value, 'onChange', onChange);\n checkOptionValueField('Autosuggest', 'options', options);\n\n const autosuggestInputRef = useRef<AutosuggestInputRef>(null);\n useImperativeHandle(\n ref,\n () => ({\n focus: () => autosuggestInputRef.current?.focus(),\n select: () => autosuggestInputRef.current?.select(),\n }),\n []\n );\n\n const i18n = useInternalI18n('autosuggest');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n\n if (!enteredTextLabel) {\n warnOnce('Autosuggest', 'A value for enteredTextLabel must be provided.');\n }\n\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: options || [],\n filterValue: value,\n filterText: value,\n filteringType,\n hideEnteredTextLabel: false,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n fireNonCancelableEvent(onSelect, {\n value,\n selectedOption: option.type !== 'use-entered' ? option.option : undefined,\n });\n autosuggestInputRef.current?.close();\n },\n });\n\n const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({\n options,\n statusType,\n onLoadItems: (detail: OptionsLoadItemsDetail) => fireNonCancelableEvent(onLoadItems, detail),\n });\n\n const handleChange = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestItemsHandlers.setShowAll(false);\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n fireNonCancelableEvent(onChange, event.detail);\n };\n\n const handleDelayedInput = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value);\n };\n\n const handleBlur = () => {\n fireNonCancelableEvent(onBlur, null);\n };\n\n const handleFocus = () => {\n autosuggestItemsHandlers.setShowAll(true);\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireNonCancelableEvent(onFocus, null);\n };\n\n const handleKeyUp = (e: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyUp, e.detail);\n };\n\n const handleKeyDown = (e: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyDown, e.detail);\n };\n\n const handlePressArrowDown = () => {\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n };\n\n const handlePressArrowUp = () => {\n autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);\n };\n\n const handlePressEnter = () => {\n return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard();\n };\n\n const handleCloseDropdown = () => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n };\n\n const handleRecoveryClick = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick();\n autosuggestInputRef.current?.focus();\n };\n\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('input');\n const footerControlId = useUniqueId('footer');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const highlightedOptionIdSource = useUniqueId();\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const isFiltered = !!value && value.length !== 0;\n const filteredText = isFiltered\n ? filteringResultsText?.(autosuggestItemsState.items.length, options?.length ?? 0)\n : undefined;\n const dropdownStatus = useDropdownStatus({\n ...props,\n isEmpty,\n isFiltered,\n recoveryText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n filteringResultsText: filteredText,\n });\n\n return (\n <AutosuggestInput\n {...restProps}\n className={clsx(styles.root, restProps.className)}\n ref={autosuggestInputRef}\n __internalRootRef={__internalRootRef}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n name={name}\n controlId={controlId}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n autoFocus={autoFocus}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n expandToViewport={expandToViewport}\n ariaControls={listId}\n ariaActivedescendant={highlightedOptionId}\n dropdownExpanded={autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null}\n dropdownContent={\n <AutosuggestOptionsList\n statusType={statusType}\n autosuggestItemsState={autosuggestItemsState}\n autosuggestItemsHandlers={autosuggestItemsHandlers}\n highlightedOptionId={highlightedOptionId}\n highlightText={value}\n listId={listId}\n controlId={controlId}\n enteredTextLabel={enteredTextLabel}\n handleLoadMore={autosuggestLoadMoreHandlers.fireLoadMoreOnScroll}\n hasDropdownStatus={dropdownStatus.content !== null}\n virtualScroll={virtualScroll}\n selectedAriaLabel={selectedAriaLabel}\n renderHighlightedAriaLive={renderHighlightedAriaLive}\n listBottom={\n !dropdownStatus.isSticky ? <DropdownFooter content={dropdownStatus.content} id={footerControlId} /> : null\n }\n ariaDescribedby={dropdownStatus.content ? footerControlId : undefined}\n />\n }\n dropdownFooter={\n dropdownStatus.isSticky ? (\n <DropdownFooter\n id={footerControlId}\n content={dropdownStatus.content}\n hasItems={autosuggestItemsState.items.length >= 1}\n />\n ) : null\n }\n loopFocus={statusType === 'error' && !!recoveryText}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n});\n\nexport default InternalAutosuggest;\n"]}
@@ -6,7 +6,7 @@ export interface ListProps {
6
6
  autosuggestItemsState: AutosuggestItemsState;
7
7
  menuProps: Omit<OptionsListProps, 'children'>;
8
8
  handleLoadMore: () => void;
9
- enteredTextLabel: AutosuggestProps.EnteredTextLabel;
9
+ enteredTextLabel?: AutosuggestProps.EnteredTextLabel;
10
10
  highlightedA11yProps: Record<string, string | number | boolean>;
11
11
  hasDropdownStatus?: boolean;
12
12
  highlightText: string;
@@ -1 +1 @@
1
- {"version":3,"file":"plain-list.d.ts","sourceRoot":"lib/default/","sources":["autosuggest/plain-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAoB,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAKpF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,SAAS;IACxB,qBAAqB,EAAE,qBAAqB,C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