@cloudscape-design/components 3.0.693 → 3.0.695

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 (344) hide show
  1. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts +2 -2
  2. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
  3. package/app-layout/visual-refresh-toolbar/compute-layout.js +2 -2
  4. package/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
  5. package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +6 -6
  6. package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +7 -7
  7. package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +6 -6
  8. package/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
  9. package/app-layout/visual-refresh-toolbar/index.js +35 -16
  10. package/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  11. package/app-layout/visual-refresh-toolbar/multi-layout.d.ts +27 -0
  12. package/app-layout/visual-refresh-toolbar/multi-layout.d.ts.map +1 -0
  13. package/app-layout/visual-refresh-toolbar/multi-layout.js +55 -0
  14. package/app-layout/visual-refresh-toolbar/multi-layout.js.map +1 -0
  15. package/app-layout/visual-refresh-toolbar/navigation/index.d.ts.map +1 -1
  16. package/app-layout/visual-refresh-toolbar/navigation/index.js +1 -0
  17. package/app-layout/visual-refresh-toolbar/navigation/index.js.map +1 -1
  18. package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +6 -6
  19. package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +15 -11
  20. package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +6 -6
  21. package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +16 -16
  22. package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +28 -28
  23. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +16 -16
  24. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts +12 -10
  25. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
  26. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +3 -3
  27. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
  28. package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +23 -3
  29. package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
  30. package/app-layout/visual-refresh-toolbar/toolbar/index.js +8 -8
  31. package/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  32. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.css.js +6 -6
  33. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.scoped.css +30 -44
  34. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.selectors.js +6 -6
  35. package/button-dropdown/analytics-metadata/interfaces.d.ts +26 -0
  36. package/button-dropdown/analytics-metadata/interfaces.d.ts.map +1 -0
  37. package/button-dropdown/analytics-metadata/interfaces.js +4 -0
  38. package/button-dropdown/analytics-metadata/interfaces.js.map +1 -0
  39. package/button-dropdown/analytics-metadata/styles.css.js +8 -0
  40. package/button-dropdown/analytics-metadata/styles.scoped.css +9 -0
  41. package/button-dropdown/analytics-metadata/styles.selectors.js +9 -0
  42. package/button-dropdown/category-elements/category-element.d.ts +1 -1
  43. package/button-dropdown/category-elements/category-element.d.ts.map +1 -1
  44. package/button-dropdown/category-elements/category-element.js +2 -2
  45. package/button-dropdown/category-elements/category-element.js.map +1 -1
  46. package/button-dropdown/category-elements/expandable-category-element.d.ts +1 -1
  47. package/button-dropdown/category-elements/expandable-category-element.d.ts.map +1 -1
  48. package/button-dropdown/category-elements/expandable-category-element.js +14 -3
  49. package/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
  50. package/button-dropdown/category-elements/mobile-expandable-category-element.d.ts +1 -1
  51. package/button-dropdown/category-elements/mobile-expandable-category-element.d.ts.map +1 -1
  52. package/button-dropdown/category-elements/mobile-expandable-category-element.js +14 -3
  53. package/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
  54. package/button-dropdown/index.d.ts.map +1 -1
  55. package/button-dropdown/index.js +10 -1
  56. package/button-dropdown/index.js.map +1 -1
  57. package/button-dropdown/interfaces.d.ts +3 -0
  58. package/button-dropdown/interfaces.d.ts.map +1 -1
  59. package/button-dropdown/interfaces.js.map +1 -1
  60. package/button-dropdown/internal.d.ts.map +1 -1
  61. package/button-dropdown/internal.js +22 -6
  62. package/button-dropdown/internal.js.map +1 -1
  63. package/button-dropdown/item-element/index.d.ts +1 -1
  64. package/button-dropdown/item-element/index.d.ts.map +1 -1
  65. package/button-dropdown/item-element/index.js +15 -4
  66. package/button-dropdown/item-element/index.js.map +1 -1
  67. package/button-dropdown/items-list.d.ts +1 -1
  68. package/button-dropdown/items-list.d.ts.map +1 -1
  69. package/button-dropdown/items-list.js +4 -4
  70. package/button-dropdown/items-list.js.map +1 -1
  71. package/button-dropdown/styles.css.js +18 -15
  72. package/button-dropdown/styles.scoped.css +31 -22
  73. package/button-dropdown/styles.selectors.js +18 -15
  74. package/checkbox/analytics-metadata/interfaces.d.ts +13 -0
  75. package/checkbox/analytics-metadata/interfaces.d.ts.map +1 -0
  76. package/checkbox/analytics-metadata/interfaces.js +4 -0
  77. package/checkbox/analytics-metadata/interfaces.js.map +1 -0
  78. package/checkbox/index.js +1 -1
  79. package/checkbox/index.js.map +1 -1
  80. package/checkbox/internal.d.ts +1 -0
  81. package/checkbox/internal.d.ts.map +1 -1
  82. package/checkbox/internal.js +16 -2
  83. package/checkbox/internal.js.map +1 -1
  84. package/container/analytics-metadata/interfaces.d.ts +5 -0
  85. package/container/analytics-metadata/interfaces.d.ts.map +1 -0
  86. package/container/analytics-metadata/interfaces.js +4 -0
  87. package/container/analytics-metadata/interfaces.js.map +1 -0
  88. package/container/analytics-metadata/styles.css.js +6 -0
  89. package/container/analytics-metadata/styles.scoped.css +7 -0
  90. package/container/analytics-metadata/styles.selectors.js +7 -0
  91. package/container/index.d.ts.map +1 -1
  92. package/container/index.js +6 -1
  93. package/container/index.js.map +1 -1
  94. package/container/internal.d.ts.map +1 -1
  95. package/container/internal.js +4 -2
  96. package/container/internal.js.map +1 -1
  97. package/drawer/implementation.d.ts.map +1 -1
  98. package/drawer/implementation.js +3 -1
  99. package/drawer/implementation.js.map +1 -1
  100. package/drawer/styles.css.js +4 -3
  101. package/drawer/styles.scoped.css +16 -8
  102. package/drawer/styles.selectors.js +4 -3
  103. package/form/analytics-metadata/interfaces.d.ts +13 -0
  104. package/form/analytics-metadata/interfaces.d.ts.map +1 -0
  105. package/form/analytics-metadata/interfaces.js +4 -0
  106. package/form/analytics-metadata/interfaces.js.map +1 -0
  107. package/form/analytics-metadata/styles.css.js +6 -0
  108. package/form/analytics-metadata/styles.scoped.css +7 -0
  109. package/form/analytics-metadata/styles.selectors.js +7 -0
  110. package/form/index.d.ts.map +1 -1
  111. package/form/index.js +1 -1
  112. package/form/index.js.map +1 -1
  113. package/form/internal.d.ts +4 -2
  114. package/form/internal.d.ts.map +1 -1
  115. package/form/internal.js +13 -3
  116. package/form/internal.js.map +1 -1
  117. package/form-field/analytics-metadata/interfaces.d.ts +5 -0
  118. package/form-field/analytics-metadata/interfaces.d.ts.map +1 -0
  119. package/form-field/analytics-metadata/interfaces.js +4 -0
  120. package/form-field/analytics-metadata/interfaces.js.map +1 -0
  121. package/form-field/analytics-metadata/styles.css.js +6 -0
  122. package/form-field/analytics-metadata/styles.scoped.css +7 -0
  123. package/form-field/analytics-metadata/styles.selectors.js +7 -0
  124. package/form-field/index.d.ts.map +1 -1
  125. package/form-field/index.js +8 -1
  126. package/form-field/index.js.map +1 -1
  127. package/form-field/internal.d.ts.map +1 -1
  128. package/form-field/internal.js +4 -2
  129. package/form-field/internal.js.map +1 -1
  130. package/header/analytics-metadata/styles.css.js +6 -0
  131. package/header/analytics-metadata/styles.scoped.css +7 -0
  132. package/header/analytics-metadata/styles.selectors.js +7 -0
  133. package/header/internal.d.ts.map +1 -1
  134. package/header/internal.js +4 -2
  135. package/header/internal.js.map +1 -1
  136. package/help-panel/implementation.d.ts.map +1 -1
  137. package/help-panel/implementation.js +4 -2
  138. package/help-panel/implementation.js.map +1 -1
  139. package/help-panel/styles.css.js +5 -4
  140. package/help-panel/styles.scoped.css +74 -65
  141. package/help-panel/styles.selectors.js +5 -4
  142. package/i18n/messages/all.all.js +1 -1
  143. package/i18n/messages/all.all.json +1 -1
  144. package/i18n/messages/all.ar.js +1 -1
  145. package/i18n/messages/all.ar.json +1 -1
  146. package/i18n/messages/all.de.js +1 -1
  147. package/i18n/messages/all.de.json +1 -1
  148. package/i18n/messages/all.en-GB.js +1 -1
  149. package/i18n/messages/all.en-GB.json +1 -1
  150. package/i18n/messages/all.en.js +1 -1
  151. package/i18n/messages/all.en.json +1 -1
  152. package/i18n/messages/all.es.js +1 -1
  153. package/i18n/messages/all.es.json +1 -1
  154. package/i18n/messages/all.fr.js +1 -1
  155. package/i18n/messages/all.fr.json +1 -1
  156. package/i18n/messages/all.id.js +1 -1
  157. package/i18n/messages/all.id.json +1 -1
  158. package/i18n/messages/all.it.js +1 -1
  159. package/i18n/messages/all.it.json +1 -1
  160. package/i18n/messages/all.ja.js +1 -1
  161. package/i18n/messages/all.ja.json +1 -1
  162. package/i18n/messages/all.ko.js +1 -1
  163. package/i18n/messages/all.ko.json +1 -1
  164. package/i18n/messages/all.pt-BR.js +1 -1
  165. package/i18n/messages/all.pt-BR.json +1 -1
  166. package/i18n/messages/all.tr.js +1 -1
  167. package/i18n/messages/all.tr.json +1 -1
  168. package/i18n/messages/all.zh-CN.js +1 -1
  169. package/i18n/messages/all.zh-CN.json +1 -1
  170. package/i18n/messages/all.zh-TW.js +1 -1
  171. package/i18n/messages/all.zh-TW.json +1 -1
  172. package/i18n/messages-types.d.ts +1 -0
  173. package/i18n/messages-types.d.ts.map +1 -1
  174. package/i18n/messages-types.js.map +1 -1
  175. package/internal/components/abstract-switch/analytics-metadata/styles.css.js +7 -0
  176. package/internal/components/abstract-switch/analytics-metadata/styles.scoped.css +8 -0
  177. package/internal/components/abstract-switch/analytics-metadata/styles.selectors.js +8 -0
  178. package/internal/components/abstract-switch/index.d.ts.map +1 -1
  179. package/internal/components/abstract-switch/index.js +13 -4
  180. package/internal/components/abstract-switch/index.js.map +1 -1
  181. package/internal/components/button-trigger/styles.css.js +11 -11
  182. package/internal/components/button-trigger/styles.scoped.css +52 -49
  183. package/internal/components/button-trigger/styles.selectors.js +11 -11
  184. package/internal/components/token-list/index.d.ts +1 -0
  185. package/internal/components/token-list/index.d.ts.map +1 -1
  186. package/internal/components/token-list/index.js.map +1 -1
  187. package/internal/components/tooltip/index.d.ts.map +1 -1
  188. package/internal/components/tooltip/index.js +1 -1
  189. package/internal/components/tooltip/index.js.map +1 -1
  190. package/internal/environment.js +1 -1
  191. package/internal/environment.json +1 -1
  192. package/internal/manifest.json +1 -1
  193. package/internal/plugins/api.d.ts +3 -0
  194. package/internal/plugins/api.d.ts.map +1 -1
  195. package/internal/plugins/api.js +3 -0
  196. package/internal/plugins/api.js.map +1 -1
  197. package/internal/plugins/controllers/app-layout-widget.d.ts +33 -0
  198. package/internal/plugins/controllers/app-layout-widget.d.ts.map +1 -0
  199. package/internal/plugins/controllers/app-layout-widget.js +77 -0
  200. package/internal/plugins/controllers/app-layout-widget.js.map +1 -0
  201. package/internal/plugins/helpers/use-global-breadcrumbs.d.ts +1 -1
  202. package/internal/plugins/helpers/use-global-breadcrumbs.d.ts.map +1 -1
  203. package/internal/plugins/helpers/use-global-breadcrumbs.js +5 -2
  204. package/internal/plugins/helpers/use-global-breadcrumbs.js.map +1 -1
  205. package/link/analytics-metadata/interfaces.d.ts +21 -0
  206. package/link/analytics-metadata/interfaces.d.ts.map +1 -0
  207. package/link/analytics-metadata/interfaces.js +4 -0
  208. package/link/analytics-metadata/interfaces.js.map +1 -0
  209. package/link/index.d.ts.map +1 -1
  210. package/link/index.js +17 -1
  211. package/link/index.js.map +1 -1
  212. package/package.json +1 -1
  213. package/pagination/analytics-metadata/interfaces.d.ts +17 -0
  214. package/pagination/analytics-metadata/interfaces.d.ts.map +1 -0
  215. package/pagination/analytics-metadata/interfaces.js +4 -0
  216. package/pagination/analytics-metadata/interfaces.js.map +1 -0
  217. package/pagination/index.d.ts.map +1 -1
  218. package/pagination/index.js +12 -1
  219. package/pagination/index.js.map +1 -1
  220. package/pagination/internal.d.ts.map +1 -1
  221. package/pagination/internal.js +35 -6
  222. package/pagination/internal.js.map +1 -1
  223. package/popover/internal.d.ts +2 -1
  224. package/popover/internal.d.ts.map +1 -1
  225. package/popover/internal.js +1 -1
  226. package/popover/internal.js.map +1 -1
  227. package/popover/styles.css.js +52 -50
  228. package/popover/styles.scoped.css +75 -67
  229. package/popover/styles.selectors.js +52 -50
  230. package/property-filter/filtering-token/index.d.ts +25 -8
  231. package/property-filter/filtering-token/index.d.ts.map +1 -1
  232. package/property-filter/filtering-token/index.js +51 -11
  233. package/property-filter/filtering-token/index.js.map +1 -1
  234. package/property-filter/filtering-token/styles.css.js +18 -7
  235. package/property-filter/filtering-token/styles.scoped.css +100 -17
  236. package/property-filter/filtering-token/styles.selectors.js +18 -7
  237. package/property-filter/styles.css.js +31 -32
  238. package/property-filter/styles.scoped.css +33 -34
  239. package/property-filter/styles.selectors.js +31 -32
  240. package/property-filter/test-classes/styles.css.js +14 -9
  241. package/property-filter/test-classes/styles.scoped.css +29 -9
  242. package/property-filter/test-classes/styles.selectors.js +14 -9
  243. package/property-filter/token-editor.d.ts +5 -5
  244. package/property-filter/token-editor.d.ts.map +1 -1
  245. package/property-filter/token-editor.js +19 -25
  246. package/property-filter/token-editor.js.map +1 -1
  247. package/property-filter/token.d.ts.map +1 -1
  248. package/property-filter/token.js +15 -5
  249. package/property-filter/token.js.map +1 -1
  250. package/radio-group/analytics-metadata/interfaces.d.ts +14 -0
  251. package/radio-group/analytics-metadata/interfaces.d.ts.map +1 -0
  252. package/radio-group/analytics-metadata/interfaces.js +4 -0
  253. package/radio-group/analytics-metadata/interfaces.js.map +1 -0
  254. package/radio-group/index.d.ts.map +1 -1
  255. package/radio-group/index.js +7 -1
  256. package/radio-group/index.js.map +1 -1
  257. package/radio-group/internal.d.ts.map +1 -1
  258. package/radio-group/internal.js +9 -1
  259. package/radio-group/internal.js.map +1 -1
  260. package/radio-group/radio-button.d.ts.map +1 -1
  261. package/radio-group/radio-button.js +6 -3
  262. package/radio-group/radio-button.js.map +1 -1
  263. package/select/interfaces.d.ts +15 -0
  264. package/select/interfaces.d.ts.map +1 -1
  265. package/select/interfaces.js.map +1 -1
  266. package/select/internal.d.ts.map +1 -1
  267. package/select/internal.js +3 -4
  268. package/select/internal.js.map +1 -1
  269. package/select/parts/styles.css.js +21 -17
  270. package/select/parts/styles.scoped.css +52 -18
  271. package/select/parts/styles.selectors.js +21 -17
  272. package/select/parts/trigger.d.ts +1 -0
  273. package/select/parts/trigger.d.ts.map +1 -1
  274. package/select/parts/trigger.js +5 -2
  275. package/select/parts/trigger.js.map +1 -1
  276. package/side-navigation/implementation.d.ts.map +1 -1
  277. package/side-navigation/implementation.js +3 -1
  278. package/side-navigation/implementation.js.map +1 -1
  279. package/side-navigation/styles.css.js +29 -28
  280. package/side-navigation/styles.scoped.css +47 -38
  281. package/side-navigation/styles.selectors.js +29 -28
  282. package/split-panel/implementation.d.ts.map +1 -1
  283. package/split-panel/implementation.js +3 -1
  284. package/split-panel/implementation.js.map +1 -1
  285. package/split-panel/side.d.ts.map +1 -1
  286. package/split-panel/side.js +4 -1
  287. package/split-panel/side.js.map +1 -1
  288. package/split-panel/styles.css.js +27 -27
  289. package/split-panel/styles.scoped.css +62 -44
  290. package/split-panel/styles.selectors.js +27 -27
  291. package/table/analytics-metadata/interfaces.d.ts +45 -0
  292. package/table/analytics-metadata/interfaces.d.ts.map +1 -0
  293. package/table/analytics-metadata/interfaces.js +4 -0
  294. package/table/analytics-metadata/interfaces.js.map +1 -0
  295. package/table/analytics-metadata/styles.css.js +6 -0
  296. package/table/analytics-metadata/styles.scoped.css +7 -0
  297. package/table/analytics-metadata/styles.selectors.js +7 -0
  298. package/table/body-cell/styles.css.js +47 -46
  299. package/table/body-cell/styles.scoped.css +276 -273
  300. package/table/body-cell/styles.selectors.js +47 -46
  301. package/table/body-cell/td-element.d.ts +2 -0
  302. package/table/body-cell/td-element.d.ts.map +1 -1
  303. package/table/body-cell/td-element.js +5 -2
  304. package/table/body-cell/td-element.js.map +1 -1
  305. package/table/header-cell/index.d.ts.map +1 -1
  306. package/table/header-cell/index.js +14 -2
  307. package/table/header-cell/index.js.map +1 -1
  308. package/table/header-cell/th-element.d.ts +1 -1
  309. package/table/header-cell/th-element.d.ts.map +1 -1
  310. package/table/header-cell/th-element.js +5 -2
  311. package/table/header-cell/th-element.js.map +1 -1
  312. package/table/header-cell/utils.d.ts +1 -0
  313. package/table/header-cell/utils.d.ts.map +1 -1
  314. package/table/header-cell/utils.js +11 -0
  315. package/table/header-cell/utils.js.map +1 -1
  316. package/table/index.d.ts.map +1 -1
  317. package/table/index.js +19 -2
  318. package/table/index.js.map +1 -1
  319. package/table/interfaces.d.ts +3 -0
  320. package/table/interfaces.d.ts.map +1 -1
  321. package/table/interfaces.js.map +1 -1
  322. package/table/internal.d.ts.map +1 -1
  323. package/table/internal.js +16 -2
  324. package/table/internal.js.map +1 -1
  325. package/table/selection/selection-control.d.ts +3 -1
  326. package/table/selection/selection-control.d.ts.map +1 -1
  327. package/table/selection/selection-control.js +10 -2
  328. package/table/selection/selection-control.js.map +1 -1
  329. package/table/thead.d.ts.map +1 -1
  330. package/table/thead.js +4 -1
  331. package/table/thead.js.map +1 -1
  332. package/test-utils/dom/property-filter/index.d.ts +10 -0
  333. package/test-utils/dom/property-filter/index.js +25 -1
  334. package/test-utils/dom/property-filter/index.js.map +1 -1
  335. package/test-utils/dom/select/index.d.ts +1 -0
  336. package/test-utils/dom/select/index.js +3 -0
  337. package/test-utils/dom/select/index.js.map +1 -1
  338. package/test-utils/selectors/property-filter/index.d.ts +10 -0
  339. package/test-utils/selectors/property-filter/index.js +25 -1
  340. package/test-utils/selectors/property-filter/index.js.map +1 -1
  341. package/test-utils/selectors/select/index.d.ts +1 -0
  342. package/test-utils/selectors/select/index.js +3 -0
  343. package/test-utils/selectors/select/index.js.map +1 -1
  344. package/test-utils/tsconfig.tsbuildinfo +1 -1
@@ -94,7 +94,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
94
94
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
95
  SPDX-License-Identifier: Apache-2.0
96
96
  */
97
- .awsui_root_1wzqe_1ktx1_97:not(#\9) {
97
+ .awsui_root_1wzqe_1phcq_97:not(#\9) {
98
98
  border-collapse: separate;
99
99
  border-spacing: 0;
100
100
  box-sizing: border-box;
@@ -130,112 +130,111 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
130
130
  -moz-osx-font-smoothing: auto;
131
131
  }
132
132
 
133
- .awsui_search-field_1wzqe_1ktx1_132:not(#\9) {
133
+ .awsui_search-field_1wzqe_1phcq_132:not(#\9) {
134
134
  display: flex;
135
135
  align-items: flex-end;
136
136
  max-inline-size: calc(688px - 2 * var(--space-l-t419sm, 20px));
137
137
  }
138
138
 
139
- .awsui_input-wrapper_1wzqe_1ktx1_138:not(#\9) {
139
+ .awsui_input-wrapper_1wzqe_1phcq_138:not(#\9) {
140
140
  flex-grow: 1;
141
141
  }
142
142
 
143
- .awsui_add-token_1wzqe_1ktx1_142:not(#\9) {
143
+ .awsui_add-token_1wzqe_1phcq_142:not(#\9) {
144
144
  border-inline-start: 1px solid var(--color-border-divider-default-j74lyz, #b6bec9);
145
145
  box-sizing: border-box;
146
146
  margin-inline-start: var(--space-m-udix3p, 16px);
147
147
  padding-inline-start: var(--space-m-udix3p, 16px);
148
148
  }
149
149
 
150
- .awsui_tokens_1wzqe_1ktx1_149:not(#\9) {
150
+ .awsui_tokens_1wzqe_1phcq_149:not(#\9) {
151
151
  margin-block: var(--space-xs-zb16t3, 8px);
152
152
  margin-inline: 0;
153
153
  }
154
154
 
155
- .awsui_token-operator_1wzqe_1ktx1_154:not(#\9) {
155
+ .awsui_token-operator_1wzqe_1phcq_154:not(#\9) {
156
156
  font-weight: bold;
157
157
  }
158
158
 
159
- .awsui_property-editor_1wzqe_1ktx1_158:not(#\9),
160
- .awsui_token-editor_1wzqe_1ktx1_159:not(#\9) {
159
+ .awsui_property-editor_1wzqe_1phcq_158:not(#\9),
160
+ .awsui_token-editor_1wzqe_1phcq_159:not(#\9) {
161
161
  -webkit-user-select: text;
162
162
  user-select: text;
163
163
  margin-block: var(--space-xxs-p8yyaw, 4px);
164
164
  margin-inline: var(--space-xxs-p8yyaw, 4px);
165
165
  }
166
- .awsui_property-editor-form_1wzqe_1ktx1_164:not(#\9),
167
- .awsui_token-editor-form_1wzqe_1ktx1_165:not(#\9) {
166
+ .awsui_property-editor-form_1wzqe_1phcq_164:not(#\9),
167
+ .awsui_token-editor-form_1wzqe_1phcq_165:not(#\9) {
168
168
  margin-block-end: var(--space-scaled-l-0hpmd7, 20px);
169
169
  }
170
- .awsui_property-editor-field-property_1wzqe_1ktx1_168:not(#\9),
171
- .awsui_token-editor-field-property_1wzqe_1ktx1_169:not(#\9) {
170
+ .awsui_property-editor-field-property_1wzqe_1phcq_168:not(#\9),
171
+ .awsui_token-editor-field-property_1wzqe_1phcq_169:not(#\9) {
172
172
  /* used in test-utils */
173
173
  }
174
- .awsui_property-editor-field-operator_1wzqe_1ktx1_172:not(#\9),
175
- .awsui_token-editor-field-operator_1wzqe_1ktx1_173:not(#\9) {
174
+ .awsui_property-editor-field-operator_1wzqe_1phcq_172:not(#\9),
175
+ .awsui_token-editor-field-operator_1wzqe_1phcq_173:not(#\9) {
176
176
  margin-block-start: var(--space-scaled-l-0hpmd7, 20px);
177
177
  }
178
- .awsui_property-editor-field-value_1wzqe_1ktx1_176:not(#\9),
179
- .awsui_token-editor-field-value_1wzqe_1ktx1_177:not(#\9) {
178
+ .awsui_property-editor-field-value_1wzqe_1phcq_176:not(#\9),
179
+ .awsui_token-editor-field-value_1wzqe_1phcq_177:not(#\9) {
180
180
  margin-block-start: var(--space-scaled-l-0hpmd7, 20px);
181
181
  }
182
- .awsui_property-editor-cancel_1wzqe_1ktx1_180:not(#\9),
183
- .awsui_token-editor-cancel_1wzqe_1ktx1_181:not(#\9) {
182
+ .awsui_property-editor-cancel_1wzqe_1phcq_180:not(#\9),
183
+ .awsui_token-editor-cancel_1wzqe_1phcq_181:not(#\9) {
184
184
  margin-inline-end: var(--space-xs-zb16t3, 8px);
185
185
  }
186
- .awsui_property-editor-submit_1wzqe_1ktx1_184:not(#\9),
187
- .awsui_token-editor-submit_1wzqe_1ktx1_185:not(#\9) {
186
+ .awsui_property-editor-submit_1wzqe_1phcq_184:not(#\9),
187
+ .awsui_token-editor-submit_1wzqe_1phcq_185:not(#\9) {
188
188
  /* used in test-utils */
189
189
  }
190
- .awsui_property-editor-actions_1wzqe_1ktx1_188:not(#\9),
191
- .awsui_token-editor-actions_1wzqe_1ktx1_189:not(#\9) {
190
+ .awsui_property-editor-actions_1wzqe_1phcq_188:not(#\9),
191
+ .awsui_token-editor-actions_1wzqe_1phcq_189:not(#\9) {
192
192
  display: flex;
193
193
  justify-content: flex-end;
194
194
  padding-block-start: var(--space-s-34lx8l, 12px);
195
195
  border-block-start: 1px solid var(--color-border-dropdown-item-default-k36ra7, #b6bec9);
196
196
  }
197
197
 
198
- .awsui_token-editor-actions_1wzqe_1ktx1_189:not(#\9) {
198
+ .awsui_token-editor-actions_1wzqe_1phcq_189:not(#\9) {
199
199
  padding-inline-end: calc(var(--space-m-udix3p, 16px) + var(--space-xxs-p8yyaw, 4px));
200
200
  margin-inline: calc(-1 * var(--space-m-udix3p, 16px) + -1 * var(--space-xxs-p8yyaw, 4px));
201
201
  }
202
202
 
203
- .awsui_property-editor_1wzqe_1ktx1_158:not(#\9) {
203
+ .awsui_property-editor_1wzqe_1phcq_158:not(#\9) {
204
204
  padding-block: var(--space-m-udix3p, 16px);
205
205
  padding-inline: var(--space-m-udix3p, 16px);
206
206
  overflow-y: auto;
207
207
  }
208
208
 
209
- .awsui_custom-content-wrapper_1wzqe_1ktx1_207:not(#\9) {
209
+ .awsui_custom-content-wrapper_1wzqe_1phcq_207:not(#\9) {
210
210
  display: contents;
211
211
  }
212
212
 
213
- .awsui_custom-control_1wzqe_1ktx1_211:not(#\9) {
213
+ .awsui_custom-control_1wzqe_1phcq_211:not(#\9) {
214
214
  margin-inline-end: var(--space-s-34lx8l, 12px);
215
215
  }
216
216
 
217
- .awsui_input_1wzqe_1ktx1_138:not(#\9) {
217
+ .awsui_input_1wzqe_1phcq_138:not(#\9) {
218
218
  flex: 1;
219
219
  }
220
220
 
221
- .awsui_results_1wzqe_1ktx1_219:not(#\9) {
221
+ .awsui_results_1wzqe_1phcq_219:not(#\9) {
222
222
  padding-block: calc(var(--space-scaled-xxs-7597g1, 4px) + var(--border-field-width-09w7vk, 2px));
223
223
  padding-inline: 0;
224
224
  }
225
225
 
226
- .awsui_token-trigger_1wzqe_1ktx1_224:not(#\9) {
226
+ .awsui_token-trigger_1wzqe_1phcq_224:not(#\9) {
227
227
  min-inline-size: 0;
228
228
  word-break: break-word;
229
229
  }
230
230
 
231
- .awsui_remove-all_1wzqe_1ktx1_229:not(#\9),
232
- .awsui_token-label_1wzqe_1ktx1_230:not(#\9),
233
- .awsui_join-operation_1wzqe_1ktx1_231:not(#\9),
234
- .awsui_custom-filter-actions_1wzqe_1ktx1_232:not(#\9) {
231
+ .awsui_remove-all_1wzqe_1phcq_229:not(#\9),
232
+ .awsui_join-operation_1wzqe_1phcq_230:not(#\9),
233
+ .awsui_custom-filter-actions_1wzqe_1phcq_231:not(#\9) {
235
234
  /* used in test-utils */
236
235
  }
237
236
 
238
- .awsui_constraint_1wzqe_1ktx1_236:not(#\9) {
237
+ .awsui_constraint_1wzqe_1phcq_235:not(#\9) {
239
238
  padding-block-start: var(--space-xxs-p8yyaw, 4px);
240
239
  color: var(--color-text-form-secondary-dxc248, #5f6b7a);
241
240
  font-size: var(--font-size-body-s-asqx2i, 12px);
@@ -2,37 +2,36 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_1wzqe_1ktx1_97",
6
- "search-field": "awsui_search-field_1wzqe_1ktx1_132",
7
- "input-wrapper": "awsui_input-wrapper_1wzqe_1ktx1_138",
8
- "add-token": "awsui_add-token_1wzqe_1ktx1_142",
9
- "tokens": "awsui_tokens_1wzqe_1ktx1_149",
10
- "token-operator": "awsui_token-operator_1wzqe_1ktx1_154",
11
- "property-editor": "awsui_property-editor_1wzqe_1ktx1_158",
12
- "token-editor": "awsui_token-editor_1wzqe_1ktx1_159",
13
- "property-editor-form": "awsui_property-editor-form_1wzqe_1ktx1_164",
14
- "token-editor-form": "awsui_token-editor-form_1wzqe_1ktx1_165",
15
- "property-editor-field-property": "awsui_property-editor-field-property_1wzqe_1ktx1_168",
16
- "token-editor-field-property": "awsui_token-editor-field-property_1wzqe_1ktx1_169",
17
- "property-editor-field-operator": "awsui_property-editor-field-operator_1wzqe_1ktx1_172",
18
- "token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_1ktx1_173",
19
- "property-editor-field-value": "awsui_property-editor-field-value_1wzqe_1ktx1_176",
20
- "token-editor-field-value": "awsui_token-editor-field-value_1wzqe_1ktx1_177",
21
- "property-editor-cancel": "awsui_property-editor-cancel_1wzqe_1ktx1_180",
22
- "token-editor-cancel": "awsui_token-editor-cancel_1wzqe_1ktx1_181",
23
- "property-editor-submit": "awsui_property-editor-submit_1wzqe_1ktx1_184",
24
- "token-editor-submit": "awsui_token-editor-submit_1wzqe_1ktx1_185",
25
- "property-editor-actions": "awsui_property-editor-actions_1wzqe_1ktx1_188",
26
- "token-editor-actions": "awsui_token-editor-actions_1wzqe_1ktx1_189",
27
- "custom-content-wrapper": "awsui_custom-content-wrapper_1wzqe_1ktx1_207",
28
- "custom-control": "awsui_custom-control_1wzqe_1ktx1_211",
29
- "input": "awsui_input_1wzqe_1ktx1_138",
30
- "results": "awsui_results_1wzqe_1ktx1_219",
31
- "token-trigger": "awsui_token-trigger_1wzqe_1ktx1_224",
32
- "remove-all": "awsui_remove-all_1wzqe_1ktx1_229",
33
- "token-label": "awsui_token-label_1wzqe_1ktx1_230",
34
- "join-operation": "awsui_join-operation_1wzqe_1ktx1_231",
35
- "custom-filter-actions": "awsui_custom-filter-actions_1wzqe_1ktx1_232",
36
- "constraint": "awsui_constraint_1wzqe_1ktx1_236"
5
+ "root": "awsui_root_1wzqe_1phcq_97",
6
+ "search-field": "awsui_search-field_1wzqe_1phcq_132",
7
+ "input-wrapper": "awsui_input-wrapper_1wzqe_1phcq_138",
8
+ "add-token": "awsui_add-token_1wzqe_1phcq_142",
9
+ "tokens": "awsui_tokens_1wzqe_1phcq_149",
10
+ "token-operator": "awsui_token-operator_1wzqe_1phcq_154",
11
+ "property-editor": "awsui_property-editor_1wzqe_1phcq_158",
12
+ "token-editor": "awsui_token-editor_1wzqe_1phcq_159",
13
+ "property-editor-form": "awsui_property-editor-form_1wzqe_1phcq_164",
14
+ "token-editor-form": "awsui_token-editor-form_1wzqe_1phcq_165",
15
+ "property-editor-field-property": "awsui_property-editor-field-property_1wzqe_1phcq_168",
16
+ "token-editor-field-property": "awsui_token-editor-field-property_1wzqe_1phcq_169",
17
+ "property-editor-field-operator": "awsui_property-editor-field-operator_1wzqe_1phcq_172",
18
+ "token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_1phcq_173",
19
+ "property-editor-field-value": "awsui_property-editor-field-value_1wzqe_1phcq_176",
20
+ "token-editor-field-value": "awsui_token-editor-field-value_1wzqe_1phcq_177",
21
+ "property-editor-cancel": "awsui_property-editor-cancel_1wzqe_1phcq_180",
22
+ "token-editor-cancel": "awsui_token-editor-cancel_1wzqe_1phcq_181",
23
+ "property-editor-submit": "awsui_property-editor-submit_1wzqe_1phcq_184",
24
+ "token-editor-submit": "awsui_token-editor-submit_1wzqe_1phcq_185",
25
+ "property-editor-actions": "awsui_property-editor-actions_1wzqe_1phcq_188",
26
+ "token-editor-actions": "awsui_token-editor-actions_1wzqe_1phcq_189",
27
+ "custom-content-wrapper": "awsui_custom-content-wrapper_1wzqe_1phcq_207",
28
+ "custom-control": "awsui_custom-control_1wzqe_1phcq_211",
29
+ "input": "awsui_input_1wzqe_1phcq_138",
30
+ "results": "awsui_results_1wzqe_1phcq_219",
31
+ "token-trigger": "awsui_token-trigger_1wzqe_1phcq_224",
32
+ "remove-all": "awsui_remove-all_1wzqe_1phcq_229",
33
+ "join-operation": "awsui_join-operation_1wzqe_1phcq_230",
34
+ "custom-filter-actions": "awsui_custom-filter-actions_1wzqe_1phcq_231",
35
+ "constraint": "awsui_constraint_1wzqe_1phcq_235"
37
36
  };
38
37
 
@@ -1,14 +1,19 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "filtering-token": "awsui_filtering-token_1heb1_tpllu_5",
5
- "filtering-token-dismiss-button": "awsui_filtering-token-dismiss-button_1heb1_tpllu_9",
6
- "filtering-token-select": "awsui_filtering-token-select_1heb1_tpllu_13",
7
- "filtering-token-content": "awsui_filtering-token-content_1heb1_tpllu_17",
8
- "token-editor-field-property": "awsui_token-editor-field-property_1heb1_tpllu_21",
9
- "token-editor-field-operator": "awsui_token-editor-field-operator_1heb1_tpllu_25",
10
- "token-editor-field-value": "awsui_token-editor-field-value_1heb1_tpllu_29",
11
- "token-editor-cancel": "awsui_token-editor-cancel_1heb1_tpllu_33",
12
- "token-editor-submit": "awsui_token-editor-submit_1heb1_tpllu_37"
4
+ "filtering-token": "awsui_filtering-token_1heb1_1doww_5",
5
+ "filtering-token-dismiss-button": "awsui_filtering-token-dismiss-button_1heb1_1doww_9",
6
+ "filtering-token-select": "awsui_filtering-token-select_1heb1_1doww_13",
7
+ "filtering-token-content": "awsui_filtering-token-content_1heb1_1doww_17",
8
+ "filtering-token-inner": "awsui_filtering-token-inner_1heb1_1doww_21",
9
+ "filtering-token-inner-dismiss-button": "awsui_filtering-token-inner-dismiss-button_1heb1_1doww_25",
10
+ "filtering-token-inner-select": "awsui_filtering-token-inner-select_1heb1_1doww_29",
11
+ "filtering-token-inner-content": "awsui_filtering-token-inner-content_1heb1_1doww_33",
12
+ "filtering-token-edit-button": "awsui_filtering-token-edit-button_1heb1_1doww_37",
13
+ "token-editor-field-property": "awsui_token-editor-field-property_1heb1_1doww_41",
14
+ "token-editor-field-operator": "awsui_token-editor-field-operator_1heb1_1doww_45",
15
+ "token-editor-field-value": "awsui_token-editor-field-value_1heb1_1doww_49",
16
+ "token-editor-cancel": "awsui_token-editor-cancel_1heb1_1doww_53",
17
+ "token-editor-submit": "awsui_token-editor-submit_1heb1_1doww_57"
13
18
  };
14
19
 
@@ -2,38 +2,58 @@
2
2
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- .awsui_filtering-token_1heb1_tpllu_5:not(#\9) {
5
+ .awsui_filtering-token_1heb1_1doww_5:not(#\9) {
6
6
  /* used in test-utils */
7
7
  }
8
8
 
9
- .awsui_filtering-token-dismiss-button_1heb1_tpllu_9:not(#\9) {
9
+ .awsui_filtering-token-dismiss-button_1heb1_1doww_9:not(#\9) {
10
10
  /* used in test-utils */
11
11
  }
12
12
 
13
- .awsui_filtering-token-select_1heb1_tpllu_13:not(#\9) {
13
+ .awsui_filtering-token-select_1heb1_1doww_13:not(#\9) {
14
14
  /* used in test-utils */
15
15
  }
16
16
 
17
- .awsui_filtering-token-content_1heb1_tpllu_17:not(#\9) {
17
+ .awsui_filtering-token-content_1heb1_1doww_17:not(#\9) {
18
18
  /* used in test-utils */
19
19
  }
20
20
 
21
- .awsui_token-editor-field-property_1heb1_tpllu_21:not(#\9) {
21
+ .awsui_filtering-token-inner_1heb1_1doww_21:not(#\9) {
22
22
  /* used in test-utils */
23
23
  }
24
24
 
25
- .awsui_token-editor-field-operator_1heb1_tpllu_25:not(#\9) {
25
+ .awsui_filtering-token-inner-dismiss-button_1heb1_1doww_25:not(#\9) {
26
26
  /* used in test-utils */
27
27
  }
28
28
 
29
- .awsui_token-editor-field-value_1heb1_tpllu_29:not(#\9) {
29
+ .awsui_filtering-token-inner-select_1heb1_1doww_29:not(#\9) {
30
30
  /* used in test-utils */
31
31
  }
32
32
 
33
- .awsui_token-editor-cancel_1heb1_tpllu_33:not(#\9) {
33
+ .awsui_filtering-token-inner-content_1heb1_1doww_33:not(#\9) {
34
34
  /* used in test-utils */
35
35
  }
36
36
 
37
- .awsui_token-editor-submit_1heb1_tpllu_37:not(#\9) {
37
+ .awsui_filtering-token-edit-button_1heb1_1doww_37:not(#\9) {
38
+ /* used in test-utils */
39
+ }
40
+
41
+ .awsui_token-editor-field-property_1heb1_1doww_41:not(#\9) {
42
+ /* used in test-utils */
43
+ }
44
+
45
+ .awsui_token-editor-field-operator_1heb1_1doww_45:not(#\9) {
46
+ /* used in test-utils */
47
+ }
48
+
49
+ .awsui_token-editor-field-value_1heb1_1doww_49:not(#\9) {
50
+ /* used in test-utils */
51
+ }
52
+
53
+ .awsui_token-editor-cancel_1heb1_1doww_53:not(#\9) {
54
+ /* used in test-utils */
55
+ }
56
+
57
+ .awsui_token-editor-submit_1heb1_1doww_57:not(#\9) {
38
58
  /* used in test-utils */
39
59
  }
@@ -2,14 +2,19 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "filtering-token": "awsui_filtering-token_1heb1_tpllu_5",
6
- "filtering-token-dismiss-button": "awsui_filtering-token-dismiss-button_1heb1_tpllu_9",
7
- "filtering-token-select": "awsui_filtering-token-select_1heb1_tpllu_13",
8
- "filtering-token-content": "awsui_filtering-token-content_1heb1_tpllu_17",
9
- "token-editor-field-property": "awsui_token-editor-field-property_1heb1_tpllu_21",
10
- "token-editor-field-operator": "awsui_token-editor-field-operator_1heb1_tpllu_25",
11
- "token-editor-field-value": "awsui_token-editor-field-value_1heb1_tpllu_29",
12
- "token-editor-cancel": "awsui_token-editor-cancel_1heb1_tpllu_33",
13
- "token-editor-submit": "awsui_token-editor-submit_1heb1_tpllu_37"
5
+ "filtering-token": "awsui_filtering-token_1heb1_1doww_5",
6
+ "filtering-token-dismiss-button": "awsui_filtering-token-dismiss-button_1heb1_1doww_9",
7
+ "filtering-token-select": "awsui_filtering-token-select_1heb1_1doww_13",
8
+ "filtering-token-content": "awsui_filtering-token-content_1heb1_1doww_17",
9
+ "filtering-token-inner": "awsui_filtering-token-inner_1heb1_1doww_21",
10
+ "filtering-token-inner-dismiss-button": "awsui_filtering-token-inner-dismiss-button_1heb1_1doww_25",
11
+ "filtering-token-inner-select": "awsui_filtering-token-inner-select_1heb1_1doww_29",
12
+ "filtering-token-inner-content": "awsui_filtering-token-inner-content_1heb1_1doww_33",
13
+ "filtering-token-edit-button": "awsui_filtering-token-edit-button_1heb1_1doww_37",
14
+ "token-editor-field-property": "awsui_token-editor-field-property_1heb1_1doww_41",
15
+ "token-editor-field-operator": "awsui_token-editor-field-operator_1heb1_1doww_45",
16
+ "token-editor-field-value": "awsui_token-editor-field-value_1heb1_1doww_49",
17
+ "token-editor-cancel": "awsui_token-editor-cancel_1heb1_1doww_53",
18
+ "token-editor-submit": "awsui_token-editor-submit_1heb1_1doww_57"
14
19
  };
15
20
 
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';
3
3
  import { NonCancelableEventHandler } from '../internal/events';
4
4
  import { GroupText, I18nStrings, InternalFilteringOption, InternalFilteringProperty, InternalFreeTextFiltering, InternalToken, LoadItemsDetail, Token } from './interfaces';
@@ -8,15 +8,15 @@ interface TokenEditorProps {
8
8
  customGroupsText: readonly GroupText[];
9
9
  disabled?: boolean;
10
10
  freeTextFiltering: InternalFreeTextFiltering;
11
- expandToViewport?: boolean;
12
11
  filteringProperties: readonly InternalFilteringProperty[];
13
12
  filteringOptions: readonly InternalFilteringOption[];
14
13
  i18nStrings: I18nStrings;
15
14
  onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;
16
15
  setToken: (newToken: Token) => void;
17
- token: InternalToken;
18
- triggerComponent?: React.ReactNode;
16
+ onDismiss: () => void;
17
+ temporaryToken: InternalToken;
18
+ onChangeTemporaryToken: (token: InternalToken) => void;
19
19
  }
20
- export declare function TokenEditor({ asyncProperties, asyncProps, customGroupsText, freeTextFiltering, expandToViewport, filteringProperties, filteringOptions, i18nStrings, onLoadItems, setToken, token, triggerComponent, }: TokenEditorProps): JSX.Element;
20
+ export declare function TokenEditor({ asyncProperties, asyncProps, customGroupsText, freeTextFiltering, filteringProperties, filteringOptions, i18nStrings, onLoadItems, setToken, onDismiss, temporaryToken, onChangeTemporaryToken, }: TokenEditorProps): JSX.Element;
21
21
  export {};
22
22
  //# sourceMappingURL=token-editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-editor.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAMhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAK/D,OAAO,EAEL,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,eAAe,EACf,KAAK,EACN,MAAM,cAAc,CAAC;AAoJtB,UAAU,gBAAgB;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,mBAAmB,CAAC;IAChC,gBAAgB,EAAE,SAAS,SAAS,EAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,yBAAyB,CAAC;IAC7C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC1D,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACrD,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;IACzD,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,KAAK,EAAE,aAAa,CAAC;IACrB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC;AAED,wBAAgB,WAAW,CAAC,EAC1B,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,KAAK,EACL,gBAAgB,GACjB,EAAE,gBAAgB,eAsHlB"}
1
+ {"version":3,"file":"token-editor.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAI/D,OAAO,EAEL,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,eAAe,EACf,KAAK,EACN,MAAM,cAAc,CAAC;AAoJtB,UAAU,gBAAgB;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,mBAAmB,CAAC;IAChC,gBAAgB,EAAE,SAAS,SAAS,EAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,yBAAyB,CAAC;IAC7C,mBAAmB,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC1D,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACrD,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;IACzD,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,EAAE,aAAa,CAAC;IAC9B,sBAAsB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CACxD;AAED,wBAAgB,WAAW,CAAC,EAC1B,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,cAAc,EACd,sBAAsB,GACvB,EAAE,gBAAgB,eAiGlB"}
@@ -1,11 +1,10 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import React, { useRef, useState } from 'react';
3
+ import React from 'react';
4
4
  import clsx from 'clsx';
5
5
  import InternalAutosuggest from '../autosuggest/internal';
6
6
  import InternalButton from '../button/internal';
7
7
  import InternalFormField from '../form-field/internal';
8
- import InternalPopover from '../popover/internal';
9
8
  import InternalSelect from '../select/internal';
10
9
  import { getAllowedOperators, getPropertySuggestions, operatorToDescription } from './controller';
11
10
  import { useLoadItems } from './use-load-items';
@@ -63,12 +62,7 @@ function ValueInput({ property, operator, value, onChangeValue, asyncProps, filt
63
62
  const OperatorForm = (property === null || property === void 0 ? void 0 : property.propertyKey) && operator && (property === null || property === void 0 ? void 0 : property.getValueFormRenderer(operator));
64
63
  return OperatorForm ? (React.createElement(OperatorForm, { value: value, onChange: onChangeValue, operator: operator })) : (React.createElement(InternalAutosuggest, Object.assign({ enteredTextLabel: (_a = i18nStrings.enteredTextLabel) !== null && _a !== void 0 ? _a : (value => value), value: (_c = (_b = matchedOption === null || matchedOption === void 0 ? void 0 : matchedOption.label) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : '', clearAriaLabel: i18nStrings.clearAriaLabel, onChange: e => onChangeValue(e.detail.value), disabled: !operator, options: valueOptions }, asyncValueAutosuggestProps, { virtualScroll: true })));
65
64
  }
66
- export function TokenEditor({ asyncProperties, asyncProps, customGroupsText, freeTextFiltering, expandToViewport, filteringProperties, filteringOptions, i18nStrings, onLoadItems, setToken, token, triggerComponent, }) {
67
- const [temporaryToken, setTemporaryToken] = useState(token);
68
- const popoverRef = useRef(null);
69
- const closePopover = () => {
70
- popoverRef.current && popoverRef.current.dismissPopover();
71
- };
65
+ export function TokenEditor({ asyncProperties, asyncProps, customGroupsText, freeTextFiltering, filteringProperties, filteringOptions, i18nStrings, onLoadItems, setToken, onDismiss, temporaryToken, onChangeTemporaryToken, }) {
72
66
  const property = temporaryToken.property;
73
67
  const onChangePropertyKey = (newPropertyKey) => {
74
68
  var _a;
@@ -78,29 +72,29 @@ export function TokenEditor({ asyncProperties, asyncProps, customGroupsText, fre
78
72
  ? temporaryToken.operator
79
73
  : allowedOperators[0];
80
74
  const matchedProperty = (_a = filteringProperties.find(property => property.propertyKey === newPropertyKey)) !== null && _a !== void 0 ? _a : null;
81
- setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { property: matchedProperty, operator, value: null }));
75
+ onChangeTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { property: matchedProperty, operator, value: null }));
82
76
  };
83
77
  const operator = temporaryToken.operator;
84
78
  const onChangeOperator = (newOperator) => {
85
- setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { operator: newOperator }));
79
+ onChangeTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { operator: newOperator }));
86
80
  };
87
81
  const value = temporaryToken.value;
88
82
  const onChangeValue = (newValue) => {
89
- setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { value: newValue }));
83
+ onChangeTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { value: newValue }));
90
84
  };
91
- return (React.createElement(InternalPopover, { ref: popoverRef, className: styles['token-label'], triggerType: "text", header: i18nStrings.editTokenHeader, size: "large", position: "right", dismissAriaLabel: i18nStrings.dismissAriaLabel, __onOpen: () => setTemporaryToken(token), renderWithPortal: expandToViewport, content: React.createElement("div", { className: styles['token-editor'] },
92
- React.createElement("div", { className: styles['token-editor-form'] },
93
- React.createElement(InternalFormField, { label: i18nStrings.propertyText, className: clsx(styles['token-editor-field-property'], testUtilStyles['token-editor-field-property']) },
94
- React.createElement(PropertyInput, { property: property, onChangePropertyKey: onChangePropertyKey, asyncProps: asyncProperties ? asyncProps : null, filteringProperties: filteringProperties, onLoadItems: onLoadItems, customGroupsText: customGroupsText, i18nStrings: i18nStrings, freeTextFiltering: freeTextFiltering })),
95
- React.createElement(InternalFormField, { label: i18nStrings.operatorText, className: clsx(styles['token-editor-field-operator'], testUtilStyles['token-editor-field-operator']) },
96
- React.createElement(OperatorInput, { property: property, operator: operator, onChangeOperator: onChangeOperator, i18nStrings: i18nStrings, freeTextFiltering: freeTextFiltering })),
97
- React.createElement(InternalFormField, { label: i18nStrings.valueText, className: clsx(styles['token-editor-field-value'], testUtilStyles['token-editor-field-value']) },
98
- React.createElement(ValueInput, { property: property, operator: operator, value: value, onChangeValue: onChangeValue, asyncProps: asyncProps, filteringOptions: filteringOptions, onLoadItems: onLoadItems, i18nStrings: i18nStrings }))),
99
- React.createElement("div", { className: styles['token-editor-actions'] },
100
- React.createElement(InternalButton, { formAction: "none", variant: "link", className: clsx(styles['token-editor-cancel'], testUtilStyles['token-editor-cancel']), onClick: closePopover }, i18nStrings.cancelActionText),
101
- React.createElement(InternalButton, { className: clsx(styles['token-editor-submit'], testUtilStyles['token-editor-submit']), formAction: "none", onClick: () => {
102
- setToken(matchTokenValue(temporaryToken, filteringOptions));
103
- closePopover();
104
- } }, i18nStrings.applyActionText))) }, triggerComponent));
85
+ return (React.createElement("div", { className: styles['token-editor'] },
86
+ React.createElement("div", { className: styles['token-editor-form'] },
87
+ React.createElement(InternalFormField, { label: i18nStrings.propertyText, className: clsx(styles['token-editor-field-property'], testUtilStyles['token-editor-field-property']) },
88
+ React.createElement(PropertyInput, { property: property, onChangePropertyKey: onChangePropertyKey, asyncProps: asyncProperties ? asyncProps : null, filteringProperties: filteringProperties, onLoadItems: onLoadItems, customGroupsText: customGroupsText, i18nStrings: i18nStrings, freeTextFiltering: freeTextFiltering })),
89
+ React.createElement(InternalFormField, { label: i18nStrings.operatorText, className: clsx(styles['token-editor-field-operator'], testUtilStyles['token-editor-field-operator']) },
90
+ React.createElement(OperatorInput, { property: property, operator: operator, onChangeOperator: onChangeOperator, i18nStrings: i18nStrings, freeTextFiltering: freeTextFiltering })),
91
+ React.createElement(InternalFormField, { label: i18nStrings.valueText, className: clsx(styles['token-editor-field-value'], testUtilStyles['token-editor-field-value']) },
92
+ React.createElement(ValueInput, { property: property, operator: operator, value: value, onChangeValue: onChangeValue, asyncProps: asyncProps, filteringOptions: filteringOptions, onLoadItems: onLoadItems, i18nStrings: i18nStrings }))),
93
+ React.createElement("div", { className: styles['token-editor-actions'] },
94
+ React.createElement(InternalButton, { formAction: "none", variant: "link", className: clsx(styles['token-editor-cancel'], testUtilStyles['token-editor-cancel']), onClick: onDismiss }, i18nStrings.cancelActionText),
95
+ React.createElement(InternalButton, { className: clsx(styles['token-editor-submit'], testUtilStyles['token-editor-submit']), formAction: "none", onClick: () => {
96
+ setToken(matchTokenValue(temporaryToken, filteringOptions));
97
+ onDismiss();
98
+ } }, i18nStrings.applyActionText))));
105
99
  }
106
100
  //# sourceMappingURL=token-editor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-editor.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,mBAAmB,MAAM,yBAAyB,CAAC;AAC1D,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,iBAAiB,MAAM,wBAA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C;gBAC5C,oBAAC,cAAc,IACb,UAAU,EAAC,MAAM,EACjB,OAAO,EAAC,MAAM,EACd,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC,EACrF,OAAO,EAAE,YAAY,IAEpB,WAAW,CAAC,gBAAgB,CACd;gBACjB,oBAAC,cAAc,IACb,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC,EACrF,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,CAAC,eAAe,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,CAAC;wBAC5D,YAAY,EAAE,CAAC;oBACjB,CAAC,IAEA,WAAW,CAAC,eAAe,CACb,CACb,CACF,IAGP,gBAAgB,CACD,CACnB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport InternalAutosuggest from '../autosuggest/internal';\nimport InternalButton from '../button/internal';\nimport InternalFormField from '../form-field/internal';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport InternalPopover, { InternalPopoverRef } from '../popover/internal';\nimport { SelectProps } from '../select/interfaces';\nimport InternalSelect from '../select/internal';\nimport { getAllowedOperators, getPropertySuggestions, operatorToDescription } from './controller';\nimport {\n ComparisonOperator,\n GroupText,\n I18nStrings,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalToken,\n LoadItemsDetail,\n Token,\n} from './interfaces';\nimport { useLoadItems } from './use-load-items';\nimport { matchTokenValue } from './utils';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStrings;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n property: null | InternalFilteringProperty;\n}\n\nfunction PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: property.propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStrings;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n}\n\nfunction OperatorInput({ property, operator, onChangeOperator, i18nStrings, freeTextFiltering }: OperatorInputProps) {\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant=\"option\"\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStrings;\n onChangeValue: (value: string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: undefined | string;\n}\n\nfunction ValueInput({\n property,\n operator,\n value,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }))\n : [];\n\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n return OperatorForm ? (\n <OperatorForm value={value} onChange={onChangeValue} operator={operator} />\n ) : (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel ?? (value => value)}\n value={matchedOption?.label ?? value ?? ''}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface TokenEditorProps {\n asyncProperties?: boolean;\n asyncProps: DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n disabled?: boolean;\n freeTextFiltering: InternalFreeTextFiltering;\n expandToViewport?: boolean;\n filteringProperties: readonly InternalFilteringProperty[];\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStrings;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n setToken: (newToken: Token) => void;\n token: InternalToken;\n triggerComponent?: React.ReactNode;\n}\n\nexport function TokenEditor({\n asyncProperties,\n asyncProps,\n customGroupsText,\n freeTextFiltering,\n expandToViewport,\n filteringProperties,\n filteringOptions,\n i18nStrings,\n onLoadItems,\n setToken,\n token,\n triggerComponent,\n}: TokenEditorProps) {\n const [temporaryToken, setTemporaryToken] = useState<InternalToken>(token);\n const popoverRef = useRef<InternalPopoverRef>(null);\n const closePopover = () => {\n popoverRef.current && popoverRef.current.dismissPopover();\n };\n\n const property = temporaryToken.property;\n const onChangePropertyKey = (newPropertyKey: undefined | string) => {\n const filteringProperty = filteringProperties.reduce<InternalFilteringProperty | undefined>(\n (acc, property) => (property.propertyKey === newPropertyKey ? property : acc),\n undefined\n );\n const allowedOperators = filteringProperty ? getAllowedOperators(filteringProperty) : freeTextFiltering.operators;\n const operator =\n temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1\n ? temporaryToken.operator\n : allowedOperators[0];\n const matchedProperty = filteringProperties.find(property => property.propertyKey === newPropertyKey) ?? null;\n setTemporaryToken({ ...temporaryToken, property: matchedProperty, operator, value: null });\n };\n\n const operator = temporaryToken.operator;\n const onChangeOperator = (newOperator: ComparisonOperator) => {\n setTemporaryToken({ ...temporaryToken, operator: newOperator });\n };\n\n const value = temporaryToken.value;\n const onChangeValue = (newValue: string) => {\n setTemporaryToken({ ...temporaryToken, value: newValue });\n };\n\n return (\n <InternalPopover\n ref={popoverRef}\n className={styles['token-label']}\n triggerType=\"text\"\n header={i18nStrings.editTokenHeader}\n size=\"large\"\n position=\"right\"\n dismissAriaLabel={i18nStrings.dismissAriaLabel}\n __onOpen={() => setTemporaryToken(token)}\n renderWithPortal={expandToViewport}\n content={\n <div className={styles['token-editor']}>\n <div className={styles['token-editor-form']}>\n <InternalFormField\n label={i18nStrings.propertyText}\n className={clsx(styles['token-editor-field-property'], testUtilStyles['token-editor-field-property'])}\n >\n <PropertyInput\n property={property}\n onChangePropertyKey={onChangePropertyKey}\n asyncProps={asyncProperties ? asyncProps : null}\n filteringProperties={filteringProperties}\n onLoadItems={onLoadItems}\n customGroupsText={customGroupsText}\n i18nStrings={i18nStrings}\n freeTextFiltering={freeTextFiltering}\n />\n </InternalFormField>\n\n <InternalFormField\n label={i18nStrings.operatorText}\n className={clsx(styles['token-editor-field-operator'], testUtilStyles['token-editor-field-operator'])}\n >\n <OperatorInput\n property={property}\n operator={operator}\n onChangeOperator={onChangeOperator}\n i18nStrings={i18nStrings}\n freeTextFiltering={freeTextFiltering}\n />\n </InternalFormField>\n\n <InternalFormField\n label={i18nStrings.valueText}\n className={clsx(styles['token-editor-field-value'], testUtilStyles['token-editor-field-value'])}\n >\n <ValueInput\n property={property}\n operator={operator}\n value={value}\n onChangeValue={onChangeValue}\n asyncProps={asyncProps}\n filteringOptions={filteringOptions}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n />\n </InternalFormField>\n </div>\n\n <div className={styles['token-editor-actions']}>\n <InternalButton\n formAction=\"none\"\n variant=\"link\"\n className={clsx(styles['token-editor-cancel'], testUtilStyles['token-editor-cancel'])}\n onClick={closePopover}\n >\n {i18nStrings.cancelActionText}\n </InternalButton>\n <InternalButton\n className={clsx(styles['token-editor-submit'], testUtilStyles['token-editor-submit'])}\n formAction=\"none\"\n onClick={() => {\n setToken(matchTokenValue(temporaryToken, filteringOptions));\n closePopover();\n }}\n >\n {i18nStrings.applyActionText}\n </InternalButton>\n </div>\n </div>\n }\n >\n {triggerComponent}\n </InternalPopover>\n );\n}\n"]}
1
+ {"version":3,"file":"token-editor.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,mBAAmB,MAAM,yBAAyB,CAAC;AAC1D,OAAO,cAAc,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ved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport InternalAutosuggest from '../autosuggest/internal';\nimport InternalButton from '../button/internal';\nimport InternalFormField from '../form-field/internal';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { SelectProps } from '../select/interfaces';\nimport InternalSelect from '../select/internal';\nimport { getAllowedOperators, getPropertySuggestions, operatorToDescription } from './controller';\nimport {\n ComparisonOperator,\n GroupText,\n I18nStrings,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalToken,\n LoadItemsDetail,\n Token,\n} from './interfaces';\nimport { useLoadItems } from './use-load-items';\nimport { matchTokenValue } from './utils';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStrings;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n property: null | InternalFilteringProperty;\n}\n\nfunction PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: property.propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStrings;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n}\n\nfunction OperatorInput({ property, operator, onChangeOperator, i18nStrings, freeTextFiltering }: OperatorInputProps) {\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant=\"option\"\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStrings;\n onChangeValue: (value: string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: undefined | string;\n}\n\nfunction ValueInput({\n property,\n operator,\n value,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }))\n : [];\n\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n return OperatorForm ? (\n <OperatorForm value={value} onChange={onChangeValue} operator={operator} />\n ) : (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel ?? (value => value)}\n value={matchedOption?.label ?? value ?? ''}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface TokenEditorProps {\n asyncProperties?: boolean;\n asyncProps: DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n disabled?: boolean;\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStrings;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n setToken: (newToken: Token) => void;\n onDismiss: () => void;\n temporaryToken: InternalToken;\n onChangeTemporaryToken: (token: InternalToken) => void;\n}\n\nexport function TokenEditor({\n asyncProperties,\n asyncProps,\n customGroupsText,\n freeTextFiltering,\n filteringProperties,\n filteringOptions,\n i18nStrings,\n onLoadItems,\n setToken,\n onDismiss,\n temporaryToken,\n onChangeTemporaryToken,\n}: TokenEditorProps) {\n const property = temporaryToken.property;\n const onChangePropertyKey = (newPropertyKey: undefined | string) => {\n const filteringProperty = filteringProperties.reduce<InternalFilteringProperty | undefined>(\n (acc, property) => (property.propertyKey === newPropertyKey ? property : acc),\n undefined\n );\n const allowedOperators = filteringProperty ? getAllowedOperators(filteringProperty) : freeTextFiltering.operators;\n const operator =\n temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1\n ? temporaryToken.operator\n : allowedOperators[0];\n const matchedProperty = filteringProperties.find(property => property.propertyKey === newPropertyKey) ?? null;\n onChangeTemporaryToken({ ...temporaryToken, property: matchedProperty, operator, value: null });\n };\n\n const operator = temporaryToken.operator;\n const onChangeOperator = (newOperator: ComparisonOperator) => {\n onChangeTemporaryToken({ ...temporaryToken, operator: newOperator });\n };\n\n const value = temporaryToken.value;\n const onChangeValue = (newValue: string) => {\n onChangeTemporaryToken({ ...temporaryToken, value: newValue });\n };\n\n return (\n <div className={styles['token-editor']}>\n <div className={styles['token-editor-form']}>\n <InternalFormField\n label={i18nStrings.propertyText}\n className={clsx(styles['token-editor-field-property'], testUtilStyles['token-editor-field-property'])}\n >\n <PropertyInput\n property={property}\n onChangePropertyKey={onChangePropertyKey}\n asyncProps={asyncProperties ? asyncProps : null}\n filteringProperties={filteringProperties}\n onLoadItems={onLoadItems}\n customGroupsText={customGroupsText}\n i18nStrings={i18nStrings}\n freeTextFiltering={freeTextFiltering}\n />\n </InternalFormField>\n\n <InternalFormField\n label={i18nStrings.operatorText}\n className={clsx(styles['token-editor-field-operator'], testUtilStyles['token-editor-field-operator'])}\n >\n <OperatorInput\n property={property}\n operator={operator}\n onChangeOperator={onChangeOperator}\n i18nStrings={i18nStrings}\n freeTextFiltering={freeTextFiltering}\n />\n </InternalFormField>\n\n <InternalFormField\n label={i18nStrings.valueText}\n className={clsx(styles['token-editor-field-value'], testUtilStyles['token-editor-field-value'])}\n >\n <ValueInput\n property={property}\n operator={operator}\n value={value}\n onChangeValue={onChangeValue}\n asyncProps={asyncProps}\n filteringOptions={filteringOptions}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n />\n </InternalFormField>\n </div>\n\n <div className={styles['token-editor-actions']}>\n <InternalButton\n formAction=\"none\"\n variant=\"link\"\n className={clsx(styles['token-editor-cancel'], testUtilStyles['token-editor-cancel'])}\n onClick={onDismiss}\n >\n {i18nStrings.cancelActionText}\n </InternalButton>\n <InternalButton\n className={clsx(styles['token-editor-submit'], testUtilStyles['token-editor-submit'])}\n formAction=\"none\"\n onClick={() => {\n setToken(matchTokenValue(temporaryToken, filteringOptions));\n onDismiss();\n }}\n >\n {i18nStrings.applyActionText}\n </InternalButton>\n </div>\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAEL,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,eAAe,EACf,KAAK,EACN,MAAM,cAAc,CAAC;AAMtB,UAAU,UAAU;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,mBAAmB,CAAC;IAChC,gBAAgB,EAAE,SAAS,SAAS,EAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,yBAAyB,CAAC;IAC7C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC1D,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;IACzD,SAAS,EAAE,aAAa,CAAC;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,CAAC,YAAY,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,qPAkBrB,UAAU,gBAoCZ,CAAC"}
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAEL,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,eAAe,EACf,KAAK,EACN,MAAM,cAAc,CAAC;AAMtB,UAAU,UAAU;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,mBAAmB,CAAC;IAChC,gBAAgB,EAAE,SAAS,SAAS,EAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,yBAAyB,CAAC;IAC7C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC1D,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;IACzD,SAAS,EAAE,aAAa,CAAC;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,CAAC,YAAY,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,qPAkBrB,UAAU,gBAyDZ,CAAC"}
@@ -1,17 +1,27 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import React from 'react';
3
+ import React, { useRef, useState } from 'react';
4
4
  import FilteringToken from './filtering-token';
5
5
  import { TokenEditor } from './token-editor';
6
6
  import { getFormattedToken } from './utils';
7
7
  import styles from './styles.css.js';
8
8
  export const TokenButton = ({ token, operation = 'and', first, removeToken, setToken, setOperation, filteringProperties, filteringOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, customGroupsText, disabled, freeTextFiltering, expandToViewport, }) => {
9
- var _a, _b, _c, _d;
9
+ var _a, _b, _c, _d, _e, _f, _g, _h;
10
+ const tokenRef = useRef(null);
10
11
  const externalToken = Object.assign(Object.assign({}, token), { propertyKey: (_a = token.property) === null || _a === void 0 ? void 0 : _a.propertyKey });
11
12
  const formattedToken = getFormattedToken(token);
12
- return (React.createElement(FilteringToken, { ariaLabel: formattedToken.label, showOperation: !first && !hideOperations, operation: operation, andText: (_b = i18nStrings.operationAndText) !== null && _b !== void 0 ? _b : '', orText: (_c = i18nStrings.operationOrText) !== null && _c !== void 0 ? _c : '', dismissAriaLabel: (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeTokenButtonAriaLabel) === null || _d === void 0 ? void 0 : _d.call(i18nStrings, externalToken), operatorAriaLabel: i18nStrings.tokenOperatorAriaLabel, onChange: setOperation, onDismiss: removeToken, disabled: disabled },
13
- React.createElement(TokenEditor, { setToken: setToken, triggerComponent: React.createElement("span", { className: styles['token-trigger'] },
14
- React.createElement(TokenTrigger, { property: formattedToken.property, operator: token.operator, value: formattedToken.value })), filteringProperties: filteringProperties, filteringOptions: filteringOptions, token: token, asyncProps: asyncProps, onLoadItems: onLoadItems, i18nStrings: i18nStrings, asyncProperties: asyncProperties, customGroupsText: customGroupsText, freeTextFiltering: freeTextFiltering, expandToViewport: expandToViewport })));
13
+ const [temporaryToken, setTemporaryToken] = useState(token);
14
+ return (React.createElement(FilteringToken, { ref: tokenRef, tokens: [
15
+ {
16
+ content: (React.createElement("span", { className: styles['token-trigger'] },
17
+ React.createElement(TokenTrigger, { property: formattedToken.property, operator: token.operator, value: formattedToken.value }))),
18
+ ariaLabel: formattedToken.label,
19
+ dismissAriaLabel: (_c = (_b = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeTokenButtonAriaLabel) === null || _b === void 0 ? void 0 : _b.call(i18nStrings, externalToken)) !== null && _c !== void 0 ? _c : '',
20
+ },
21
+ ], showOperation: !first && !hideOperations, operation: operation, andText: (_d = i18nStrings.operationAndText) !== null && _d !== void 0 ? _d : '', orText: (_e = i18nStrings.operationOrText) !== null && _e !== void 0 ? _e : '', operationAriaLabel: (_f = i18nStrings.tokenOperatorAriaLabel) !== null && _f !== void 0 ? _f : '', onChangeOperation: setOperation, onDismissToken: removeToken, disabled: disabled, editorContent: React.createElement(TokenEditor, { setToken: setToken, filteringProperties: filteringProperties, filteringOptions: filteringOptions, temporaryToken: temporaryToken, onChangeTemporaryToken: setTemporaryToken, asyncProps: asyncProps, onLoadItems: onLoadItems, i18nStrings: i18nStrings, asyncProperties: asyncProperties, customGroupsText: customGroupsText, freeTextFiltering: freeTextFiltering, onDismiss: () => { var _a; return (_a = tokenRef.current) === null || _a === void 0 ? void 0 : _a.closeEditor(); } }), editorHeader: (_g = i18nStrings.editTokenHeader) !== null && _g !== void 0 ? _g : '', editorDismissAriaLabel: (_h = i18nStrings.dismissAriaLabel) !== null && _h !== void 0 ? _h : '', editorExpandToViewport: !!expandToViewport, onEditorOpen: () => setTemporaryToken(token),
22
+ // The properties below are only relevant for grouped tokens that are not supported
23
+ // by the property filter component yet.
24
+ groupOperation: operation, groupAriaLabel: '', groupEditAriaLabel: '', onChangeGroupOperation: () => { }, hasGroups: false }));
15
25
  };
16
26
  const TokenTrigger = ({ property, operator, value, }) => {
17
27
  if (property) {