@refinitiv-ui/elements 5.11.0 → 5.12.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (504) hide show
  1. package/README.md +4 -4
  2. package/package.json +21 -290
  3. package/lib/accordion/index.d.ts +0 -76
  4. package/lib/accordion/index.js +0 -136
  5. package/lib/accordion/themes/halo/dark/index.js +0 -3
  6. package/lib/accordion/themes/halo/light/index.js +0 -3
  7. package/lib/accordion/themes/solar/charcoal/index.js +0 -3
  8. package/lib/accordion/themes/solar/pearl/index.js +0 -3
  9. package/lib/appstate-bar/index.d.ts +0 -65
  10. package/lib/appstate-bar/index.js +0 -100
  11. package/lib/appstate-bar/themes/halo/dark/index.js +0 -3
  12. package/lib/appstate-bar/themes/halo/light/index.js +0 -3
  13. package/lib/appstate-bar/themes/solar/charcoal/index.js +0 -3
  14. package/lib/appstate-bar/themes/solar/pearl/index.js +0 -3
  15. package/lib/autosuggest/helpers/types.d.ts +0 -54
  16. package/lib/autosuggest/helpers/types.js +0 -1
  17. package/lib/autosuggest/helpers/utils.d.ts +0 -39
  18. package/lib/autosuggest/helpers/utils.js +0 -75
  19. package/lib/autosuggest/index.d.ts +0 -538
  20. package/lib/autosuggest/index.js +0 -1255
  21. package/lib/autosuggest/themes/halo/dark/index.js +0 -5
  22. package/lib/autosuggest/themes/halo/light/index.js +0 -5
  23. package/lib/autosuggest/themes/solar/charcoal/index.js +0 -5
  24. package/lib/autosuggest/themes/solar/pearl/index.js +0 -5
  25. package/lib/button/index.d.ts +0 -132
  26. package/lib/button/index.js +0 -223
  27. package/lib/button/themes/halo/dark/index.js +0 -3
  28. package/lib/button/themes/halo/light/index.js +0 -3
  29. package/lib/button/themes/solar/charcoal/index.js +0 -3
  30. package/lib/button/themes/solar/pearl/index.js +0 -3
  31. package/lib/button-bar/index.d.ts +0 -76
  32. package/lib/button-bar/index.js +0 -155
  33. package/lib/button-bar/themes/halo/dark/index.js +0 -3
  34. package/lib/button-bar/themes/halo/light/index.js +0 -3
  35. package/lib/button-bar/themes/solar/charcoal/index.js +0 -3
  36. package/lib/button-bar/themes/solar/pearl/index.js +0 -3
  37. package/lib/calendar/constants.d.ts +0 -26
  38. package/lib/calendar/constants.js +0 -28
  39. package/lib/calendar/index.d.ts +0 -412
  40. package/lib/calendar/index.js +0 -1274
  41. package/lib/calendar/locales.d.ts +0 -1
  42. package/lib/calendar/locales.js +0 -41
  43. package/lib/calendar/themes/halo/dark/index.js +0 -3
  44. package/lib/calendar/themes/halo/light/index.js +0 -3
  45. package/lib/calendar/themes/solar/charcoal/index.js +0 -3
  46. package/lib/calendar/themes/solar/pearl/index.js +0 -3
  47. package/lib/calendar/types.d.ts +0 -32
  48. package/lib/calendar/types.js +0 -1
  49. package/lib/calendar/utils.d.ts +0 -42
  50. package/lib/calendar/utils.js +0 -120
  51. package/lib/canvas/index.d.ts +0 -101
  52. package/lib/canvas/index.js +0 -173
  53. package/lib/canvas/themes/halo/dark/index.js +0 -2
  54. package/lib/canvas/themes/halo/light/index.js +0 -2
  55. package/lib/canvas/themes/solar/charcoal/index.js +0 -2
  56. package/lib/canvas/themes/solar/pearl/index.js +0 -2
  57. package/lib/card/helpers/types.d.ts +0 -12
  58. package/lib/card/helpers/types.js +0 -1
  59. package/lib/card/index.d.ts +0 -142
  60. package/lib/card/index.js +0 -248
  61. package/lib/card/themes/halo/dark/index.js +0 -5
  62. package/lib/card/themes/halo/light/index.js +0 -5
  63. package/lib/card/themes/solar/charcoal/index.js +0 -5
  64. package/lib/card/themes/solar/pearl/index.js +0 -5
  65. package/lib/chart/helpers/index.d.ts +0 -2
  66. package/lib/chart/helpers/index.js +0 -2
  67. package/lib/chart/helpers/legend.d.ts +0 -5
  68. package/lib/chart/helpers/legend.js +0 -78
  69. package/lib/chart/helpers/merge.d.ts +0 -15
  70. package/lib/chart/helpers/merge.js +0 -28
  71. package/lib/chart/helpers/types.d.ts +0 -69
  72. package/lib/chart/helpers/types.js +0 -1
  73. package/lib/chart/index.d.ts +0 -187
  74. package/lib/chart/index.js +0 -491
  75. package/lib/chart/plugins/doughnut-center-label.d.ts +0 -3
  76. package/lib/chart/plugins/doughnut-center-label.js +0 -196
  77. package/lib/chart/themes/halo/dark/index.js +0 -4
  78. package/lib/chart/themes/halo/light/index.js +0 -4
  79. package/lib/chart/themes/solar/charcoal/index.js +0 -4
  80. package/lib/chart/themes/solar/pearl/index.js +0 -4
  81. package/lib/checkbox/index.d.ts +0 -97
  82. package/lib/checkbox/index.js +0 -194
  83. package/lib/checkbox/themes/halo/dark/index.js +0 -4
  84. package/lib/checkbox/themes/halo/light/index.js +0 -4
  85. package/lib/checkbox/themes/solar/charcoal/index.js +0 -4
  86. package/lib/checkbox/themes/solar/pearl/index.js +0 -4
  87. package/lib/clock/index.d.ts +0 -321
  88. package/lib/clock/index.js +0 -583
  89. package/lib/clock/themes/halo/dark/index.js +0 -2
  90. package/lib/clock/themes/halo/light/index.js +0 -2
  91. package/lib/clock/themes/solar/charcoal/index.js +0 -2
  92. package/lib/clock/themes/solar/pearl/index.js +0 -2
  93. package/lib/clock/utils/TickManager.d.ts +0 -14
  94. package/lib/clock/utils/TickManager.js +0 -66
  95. package/lib/clock/utils/timestamps.d.ts +0 -6
  96. package/lib/clock/utils/timestamps.js +0 -6
  97. package/lib/collapse/index.d.ts +0 -119
  98. package/lib/collapse/index.js +0 -197
  99. package/lib/collapse/themes/halo/dark/index.js +0 -5
  100. package/lib/collapse/themes/halo/light/index.js +0 -5
  101. package/lib/collapse/themes/solar/charcoal/index.js +0 -5
  102. package/lib/collapse/themes/solar/pearl/index.js +0 -5
  103. package/lib/color-dialog/elements/color-palettes.d.ts +0 -52
  104. package/lib/color-dialog/elements/color-palettes.js +0 -101
  105. package/lib/color-dialog/elements/grayscale-palettes.d.ts +0 -67
  106. package/lib/color-dialog/elements/grayscale-palettes.js +0 -161
  107. package/lib/color-dialog/elements/palettes.d.ts +0 -65
  108. package/lib/color-dialog/elements/palettes.js +0 -132
  109. package/lib/color-dialog/helpers/color-helpers.d.ts +0 -16
  110. package/lib/color-dialog/helpers/color-helpers.js +0 -161
  111. package/lib/color-dialog/helpers/value-model.d.ts +0 -75
  112. package/lib/color-dialog/helpers/value-model.js +0 -141
  113. package/lib/color-dialog/index.d.ts +0 -232
  114. package/lib/color-dialog/index.js +0 -459
  115. package/lib/color-dialog/themes/halo/dark/index.js +0 -7
  116. package/lib/color-dialog/themes/halo/light/index.js +0 -7
  117. package/lib/color-dialog/themes/solar/charcoal/index.js +0 -7
  118. package/lib/color-dialog/themes/solar/pearl/index.js +0 -7
  119. package/lib/combo-box/helpers/filter.d.ts +0 -10
  120. package/lib/combo-box/helpers/filter.js +0 -29
  121. package/lib/combo-box/helpers/keyboard-event.d.ts +0 -17
  122. package/lib/combo-box/helpers/keyboard-event.js +0 -19
  123. package/lib/combo-box/helpers/renderer.d.ts +0 -8
  124. package/lib/combo-box/helpers/renderer.js +0 -24
  125. package/lib/combo-box/helpers/types.d.ts +0 -11
  126. package/lib/combo-box/helpers/types.js +0 -1
  127. package/lib/combo-box/index.d.ts +0 -551
  128. package/lib/combo-box/index.js +0 -1183
  129. package/lib/combo-box/themes/halo/dark/index.js +0 -7
  130. package/lib/combo-box/themes/halo/light/index.js +0 -7
  131. package/lib/combo-box/themes/solar/charcoal/index.js +0 -7
  132. package/lib/combo-box/themes/solar/pearl/index.js +0 -7
  133. package/lib/counter/index.d.ts +0 -91
  134. package/lib/counter/index.js +0 -154
  135. package/lib/counter/themes/halo/dark/index.js +0 -3
  136. package/lib/counter/themes/halo/light/index.js +0 -3
  137. package/lib/counter/themes/solar/charcoal/index.js +0 -3
  138. package/lib/counter/themes/solar/pearl/index.js +0 -3
  139. package/lib/counter/utils.d.ts +0 -13
  140. package/lib/counter/utils.js +0 -52
  141. package/lib/datetime-picker/index.d.ts +0 -509
  142. package/lib/datetime-picker/index.js +0 -1175
  143. package/lib/datetime-picker/locales.d.ts +0 -8
  144. package/lib/datetime-picker/locales.js +0 -57
  145. package/lib/datetime-picker/themes/halo/dark/index.js +0 -7
  146. package/lib/datetime-picker/themes/halo/light/index.js +0 -7
  147. package/lib/datetime-picker/themes/solar/charcoal/index.js +0 -7
  148. package/lib/datetime-picker/themes/solar/pearl/index.js +0 -7
  149. package/lib/datetime-picker/types.d.ts +0 -3
  150. package/lib/datetime-picker/types.js +0 -1
  151. package/lib/datetime-picker/utils.d.ts +0 -55
  152. package/lib/datetime-picker/utils.js +0 -92
  153. package/lib/dialog/draggable-element.d.ts +0 -14
  154. package/lib/dialog/draggable-element.js +0 -221
  155. package/lib/dialog/index.d.ts +0 -196
  156. package/lib/dialog/index.js +0 -328
  157. package/lib/dialog/themes/halo/dark/index.js +0 -7
  158. package/lib/dialog/themes/halo/light/index.js +0 -7
  159. package/lib/dialog/themes/solar/charcoal/index.js +0 -7
  160. package/lib/dialog/themes/solar/pearl/index.js +0 -7
  161. package/lib/email-field/index.d.ts +0 -80
  162. package/lib/email-field/index.js +0 -86
  163. package/lib/email-field/themes/halo/dark/index.js +0 -3
  164. package/lib/email-field/themes/halo/light/index.js +0 -3
  165. package/lib/email-field/themes/solar/charcoal/index.js +0 -3
  166. package/lib/email-field/themes/solar/pearl/index.js +0 -3
  167. package/lib/events.d.ts +0 -121
  168. package/lib/events.js +0 -1
  169. package/lib/flag/index.d.ts +0 -96
  170. package/lib/flag/index.js +0 -168
  171. package/lib/flag/themes/halo/dark/index.js +0 -2
  172. package/lib/flag/themes/halo/light/index.js +0 -2
  173. package/lib/flag/themes/solar/charcoal/index.js +0 -2
  174. package/lib/flag/themes/solar/pearl/index.js +0 -2
  175. package/lib/flag/utils/FlagLoader.d.ts +0 -47
  176. package/lib/flag/utils/FlagLoader.js +0 -86
  177. package/lib/header/index.d.ts +0 -46
  178. package/lib/header/index.js +0 -73
  179. package/lib/header/themes/halo/dark/index.js +0 -2
  180. package/lib/header/themes/halo/light/index.js +0 -2
  181. package/lib/header/themes/solar/charcoal/index.js +0 -2
  182. package/lib/header/themes/solar/pearl/index.js +0 -2
  183. package/lib/heatmap/helpers/color.d.ts +0 -30
  184. package/lib/heatmap/helpers/color.js +0 -68
  185. package/lib/heatmap/helpers/text.d.ts +0 -26
  186. package/lib/heatmap/helpers/text.js +0 -91
  187. package/lib/heatmap/helpers/track.d.ts +0 -102
  188. package/lib/heatmap/helpers/track.js +0 -160
  189. package/lib/heatmap/helpers/types.d.ts +0 -40
  190. package/lib/heatmap/helpers/types.js +0 -1
  191. package/lib/heatmap/index.d.ts +0 -453
  192. package/lib/heatmap/index.js +0 -1103
  193. package/lib/heatmap/themes/halo/dark/index.js +0 -4
  194. package/lib/heatmap/themes/halo/light/index.js +0 -4
  195. package/lib/heatmap/themes/solar/charcoal/index.js +0 -4
  196. package/lib/heatmap/themes/solar/pearl/index.js +0 -4
  197. package/lib/icon/index.d.ts +0 -90
  198. package/lib/icon/index.js +0 -171
  199. package/lib/icon/themes/halo/dark/index.js +0 -2
  200. package/lib/icon/themes/halo/light/index.js +0 -2
  201. package/lib/icon/themes/solar/charcoal/index.js +0 -2
  202. package/lib/icon/themes/solar/pearl/index.js +0 -2
  203. package/lib/icon/utils/IconLoader.d.ts +0 -52
  204. package/lib/icon/utils/IconLoader.js +0 -93
  205. package/lib/index.d.ts +0 -3
  206. package/lib/index.js +0 -3
  207. package/lib/interactive-chart/helpers/merge.d.ts +0 -15
  208. package/lib/interactive-chart/helpers/merge.js +0 -28
  209. package/lib/interactive-chart/helpers/types.d.ts +0 -45
  210. package/lib/interactive-chart/helpers/types.js +0 -6
  211. package/lib/interactive-chart/index.d.ts +0 -383
  212. package/lib/interactive-chart/index.js +0 -1093
  213. package/lib/interactive-chart/themes/halo/dark/index.js +0 -3
  214. package/lib/interactive-chart/themes/halo/light/index.js +0 -3
  215. package/lib/interactive-chart/themes/solar/charcoal/index.js +0 -3
  216. package/lib/interactive-chart/themes/solar/pearl/index.js +0 -3
  217. package/lib/item/helpers/types.d.ts +0 -57
  218. package/lib/item/helpers/types.js +0 -1
  219. package/lib/item/index.d.ts +0 -159
  220. package/lib/item/index.js +0 -272
  221. package/lib/item/themes/halo/dark/index.js +0 -4
  222. package/lib/item/themes/halo/light/index.js +0 -4
  223. package/lib/item/themes/solar/charcoal/index.js +0 -4
  224. package/lib/item/themes/solar/pearl/index.js +0 -4
  225. package/lib/label/index.d.ts +0 -102
  226. package/lib/label/index.js +0 -245
  227. package/lib/label/themes/halo/dark/index.js +0 -3
  228. package/lib/label/themes/halo/light/index.js +0 -3
  229. package/lib/label/themes/solar/charcoal/index.js +0 -3
  230. package/lib/label/themes/solar/pearl/index.js +0 -3
  231. package/lib/layout/index.d.ts +0 -107
  232. package/lib/layout/index.js +0 -212
  233. package/lib/layout/themes/halo/dark/index.js +0 -2
  234. package/lib/layout/themes/halo/light/index.js +0 -2
  235. package/lib/layout/themes/solar/charcoal/index.js +0 -2
  236. package/lib/layout/themes/solar/pearl/index.js +0 -2
  237. package/lib/led-gauge/index.d.ts +0 -144
  238. package/lib/led-gauge/index.js +0 -438
  239. package/lib/led-gauge/themes/halo/dark/index.js +0 -3
  240. package/lib/led-gauge/themes/halo/light/index.js +0 -3
  241. package/lib/led-gauge/themes/solar/charcoal/index.js +0 -3
  242. package/lib/led-gauge/themes/solar/pearl/index.js +0 -3
  243. package/lib/list/extensible-function.d.ts +0 -8
  244. package/lib/list/extensible-function.js +0 -13
  245. package/lib/list/helpers/list-renderer.d.ts +0 -9
  246. package/lib/list/helpers/list-renderer.js +0 -37
  247. package/lib/list/helpers/types.d.ts +0 -3
  248. package/lib/list/helpers/types.js +0 -1
  249. package/lib/list/index.d.ts +0 -313
  250. package/lib/list/index.js +0 -640
  251. package/lib/list/renderer.d.ts +0 -36
  252. package/lib/list/renderer.js +0 -9
  253. package/lib/list/themes/halo/dark/index.js +0 -3
  254. package/lib/list/themes/halo/light/index.js +0 -3
  255. package/lib/list/themes/solar/charcoal/index.js +0 -3
  256. package/lib/list/themes/solar/pearl/index.js +0 -3
  257. package/lib/loader/index.d.ts +0 -41
  258. package/lib/loader/index.js +0 -61
  259. package/lib/loader/themes/halo/dark/index.js +0 -2
  260. package/lib/loader/themes/halo/light/index.js +0 -2
  261. package/lib/loader/themes/solar/charcoal/index.js +0 -2
  262. package/lib/loader/themes/solar/pearl/index.js +0 -2
  263. package/lib/multi-input/helpers/types.d.ts +0 -11
  264. package/lib/multi-input/helpers/types.js +0 -1
  265. package/lib/multi-input/index.d.ts +0 -301
  266. package/lib/multi-input/index.js +0 -594
  267. package/lib/multi-input/themes/halo/dark/index.js +0 -4
  268. package/lib/multi-input/themes/halo/light/index.js +0 -4
  269. package/lib/multi-input/themes/solar/charcoal/index.js +0 -4
  270. package/lib/multi-input/themes/solar/pearl/index.js +0 -4
  271. package/lib/notification/elements/notification-tray.d.ts +0 -97
  272. package/lib/notification/elements/notification-tray.js +0 -167
  273. package/lib/notification/elements/notification.d.ts +0 -90
  274. package/lib/notification/elements/notification.js +0 -154
  275. package/lib/notification/helpers/status.d.ts +0 -30
  276. package/lib/notification/helpers/status.js +0 -130
  277. package/lib/notification/helpers/types.d.ts +0 -10
  278. package/lib/notification/helpers/types.js +0 -1
  279. package/lib/notification/index.d.ts +0 -2
  280. package/lib/notification/index.js +0 -2
  281. package/lib/notification/themes/halo/dark/index.js +0 -5
  282. package/lib/notification/themes/halo/light/index.js +0 -5
  283. package/lib/notification/themes/solar/charcoal/index.js +0 -5
  284. package/lib/notification/themes/solar/pearl/index.js +0 -5
  285. package/lib/number-field/index.d.ts +0 -339
  286. package/lib/number-field/index.js +0 -740
  287. package/lib/number-field/themes/halo/dark/index.js +0 -3
  288. package/lib/number-field/themes/halo/light/index.js +0 -3
  289. package/lib/number-field/themes/solar/charcoal/index.js +0 -3
  290. package/lib/number-field/themes/solar/pearl/index.js +0 -3
  291. package/lib/overlay/elements/overlay-backdrop.d.ts +0 -46
  292. package/lib/overlay/elements/overlay-backdrop.js +0 -64
  293. package/lib/overlay/elements/overlay-viewport.d.ts +0 -40
  294. package/lib/overlay/elements/overlay-viewport.js +0 -52
  295. package/lib/overlay/elements/overlay.d.ts +0 -408
  296. package/lib/overlay/elements/overlay.js +0 -1426
  297. package/lib/overlay/helpers/functions.d.ts +0 -13
  298. package/lib/overlay/helpers/functions.js +0 -16
  299. package/lib/overlay/helpers/types.d.ts +0 -97
  300. package/lib/overlay/helpers/types.js +0 -16
  301. package/lib/overlay/index.d.ts +0 -2
  302. package/lib/overlay/index.js +0 -1
  303. package/lib/overlay/managers/backdrop-manager.d.ts +0 -45
  304. package/lib/overlay/managers/backdrop-manager.js +0 -96
  305. package/lib/overlay/managers/close-manager.d.ts +0 -54
  306. package/lib/overlay/managers/close-manager.js +0 -138
  307. package/lib/overlay/managers/focus-manager.d.ts +0 -71
  308. package/lib/overlay/managers/focus-manager.js +0 -228
  309. package/lib/overlay/managers/interaction-lock-manager.d.ts +0 -138
  310. package/lib/overlay/managers/interaction-lock-manager.js +0 -375
  311. package/lib/overlay/managers/viewport-manager.d.ts +0 -93
  312. package/lib/overlay/managers/viewport-manager.js +0 -211
  313. package/lib/overlay/managers/zindex-manager.d.ts +0 -80
  314. package/lib/overlay/managers/zindex-manager.js +0 -195
  315. package/lib/overlay/themes/halo/dark/index.js +0 -4
  316. package/lib/overlay/themes/halo/light/index.js +0 -4
  317. package/lib/overlay/themes/solar/charcoal/index.js +0 -4
  318. package/lib/overlay/themes/solar/pearl/index.js +0 -4
  319. package/lib/overlay-menu/helpers/types.d.ts +0 -8
  320. package/lib/overlay-menu/helpers/types.js +0 -1
  321. package/lib/overlay-menu/index.d.ts +0 -387
  322. package/lib/overlay-menu/index.js +0 -935
  323. package/lib/overlay-menu/managers/menu-manager.d.ts +0 -98
  324. package/lib/overlay-menu/managers/menu-manager.js +0 -240
  325. package/lib/overlay-menu/themes/halo/dark/index.js +0 -5
  326. package/lib/overlay-menu/themes/halo/light/index.js +0 -5
  327. package/lib/overlay-menu/themes/solar/charcoal/index.js +0 -5
  328. package/lib/overlay-menu/themes/solar/pearl/index.js +0 -5
  329. package/lib/pagination/index.d.ts +0 -275
  330. package/lib/pagination/index.js +0 -552
  331. package/lib/pagination/themes/halo/dark/index.js +0 -6
  332. package/lib/pagination/themes/halo/light/index.js +0 -6
  333. package/lib/pagination/themes/solar/charcoal/index.js +0 -6
  334. package/lib/pagination/themes/solar/pearl/index.js +0 -6
  335. package/lib/panel/index.d.ts +0 -48
  336. package/lib/panel/index.js +0 -74
  337. package/lib/panel/themes/halo/dark/index.js +0 -2
  338. package/lib/panel/themes/halo/light/index.js +0 -2
  339. package/lib/panel/themes/solar/charcoal/index.js +0 -2
  340. package/lib/panel/themes/solar/pearl/index.js +0 -2
  341. package/lib/password-field/index.d.ts +0 -89
  342. package/lib/password-field/index.js +0 -112
  343. package/lib/password-field/themes/halo/dark/index.js +0 -3
  344. package/lib/password-field/themes/halo/light/index.js +0 -3
  345. package/lib/password-field/themes/solar/charcoal/index.js +0 -3
  346. package/lib/password-field/themes/solar/pearl/index.js +0 -3
  347. package/lib/pill/index.d.ts +0 -97
  348. package/lib/pill/index.js +0 -160
  349. package/lib/pill/themes/halo/dark/index.js +0 -3
  350. package/lib/pill/themes/halo/light/index.js +0 -3
  351. package/lib/pill/themes/solar/charcoal/index.js +0 -3
  352. package/lib/pill/themes/solar/pearl/index.js +0 -3
  353. package/lib/progress-bar/index.d.ts +0 -82
  354. package/lib/progress-bar/index.js +0 -157
  355. package/lib/progress-bar/themes/halo/dark/index.js +0 -2
  356. package/lib/progress-bar/themes/halo/light/index.js +0 -2
  357. package/lib/progress-bar/themes/solar/charcoal/index.js +0 -2
  358. package/lib/progress-bar/themes/solar/pearl/index.js +0 -2
  359. package/lib/radio-button/index.d.ts +0 -123
  360. package/lib/radio-button/index.js +0 -261
  361. package/lib/radio-button/radio-button-registry.d.ts +0 -22
  362. package/lib/radio-button/radio-button-registry.js +0 -93
  363. package/lib/radio-button/themes/halo/dark/index.js +0 -3
  364. package/lib/radio-button/themes/halo/light/index.js +0 -3
  365. package/lib/radio-button/themes/solar/charcoal/index.js +0 -3
  366. package/lib/radio-button/themes/solar/pearl/index.js +0 -3
  367. package/lib/rating/index.d.ts +0 -91
  368. package/lib/rating/index.js +0 -157
  369. package/lib/rating/themes/halo/dark/index.js +0 -2
  370. package/lib/rating/themes/halo/light/index.js +0 -2
  371. package/lib/rating/themes/solar/charcoal/index.js +0 -2
  372. package/lib/rating/themes/solar/pearl/index.js +0 -2
  373. package/lib/search-field/index.d.ts +0 -77
  374. package/lib/search-field/index.js +0 -84
  375. package/lib/search-field/themes/halo/dark/index.js +0 -3
  376. package/lib/search-field/themes/halo/light/index.js +0 -3
  377. package/lib/search-field/themes/solar/charcoal/index.js +0 -3
  378. package/lib/search-field/themes/solar/pearl/index.js +0 -3
  379. package/lib/select/helpers/types.d.ts +0 -3
  380. package/lib/select/helpers/types.js +0 -1
  381. package/lib/select/index.d.ts +0 -396
  382. package/lib/select/index.js +0 -981
  383. package/lib/select/themes/halo/dark/index.js +0 -5
  384. package/lib/select/themes/halo/light/index.js +0 -5
  385. package/lib/select/themes/solar/charcoal/index.js +0 -5
  386. package/lib/select/themes/solar/pearl/index.js +0 -5
  387. package/lib/sidebar-layout/index.d.ts +0 -70
  388. package/lib/sidebar-layout/index.js +0 -134
  389. package/lib/sidebar-layout/themes/halo/dark/index.js +0 -3
  390. package/lib/sidebar-layout/themes/halo/light/index.js +0 -3
  391. package/lib/sidebar-layout/themes/solar/charcoal/index.js +0 -3
  392. package/lib/sidebar-layout/themes/solar/pearl/index.js +0 -3
  393. package/lib/slider/index.d.ts +0 -409
  394. package/lib/slider/index.js +0 -1187
  395. package/lib/slider/themes/halo/dark/index.js +0 -3
  396. package/lib/slider/themes/halo/light/index.js +0 -3
  397. package/lib/slider/themes/solar/charcoal/index.js +0 -3
  398. package/lib/slider/themes/solar/pearl/index.js +0 -3
  399. package/lib/sparkline/index.d.ts +0 -109
  400. package/lib/sparkline/index.js +0 -188
  401. package/lib/sparkline/themes/halo/dark/index.js +0 -2
  402. package/lib/sparkline/themes/halo/light/index.js +0 -2
  403. package/lib/sparkline/themes/solar/charcoal/index.js +0 -2
  404. package/lib/sparkline/themes/solar/pearl/index.js +0 -2
  405. package/lib/swing-gauge/const.d.ts +0 -22
  406. package/lib/swing-gauge/const.js +0 -26
  407. package/lib/swing-gauge/helpers.d.ts +0 -8
  408. package/lib/swing-gauge/helpers.js +0 -105
  409. package/lib/swing-gauge/index.d.ts +0 -296
  410. package/lib/swing-gauge/index.js +0 -764
  411. package/lib/swing-gauge/themes/halo/dark/index.js +0 -3
  412. package/lib/swing-gauge/themes/halo/light/index.js +0 -3
  413. package/lib/swing-gauge/themes/solar/charcoal/index.js +0 -3
  414. package/lib/swing-gauge/themes/solar/pearl/index.js +0 -3
  415. package/lib/swing-gauge/types.d.ts +0 -34
  416. package/lib/swing-gauge/types.js +0 -1
  417. package/lib/tab/index.d.ts +0 -118
  418. package/lib/tab/index.js +0 -208
  419. package/lib/tab/themes/halo/dark/index.js +0 -4
  420. package/lib/tab/themes/halo/light/index.js +0 -4
  421. package/lib/tab/themes/solar/charcoal/index.js +0 -4
  422. package/lib/tab/themes/solar/pearl/index.js +0 -4
  423. package/lib/tab-bar/helpers/animate.d.ts +0 -16
  424. package/lib/tab-bar/helpers/animate.js +0 -53
  425. package/lib/tab-bar/index.d.ts +0 -108
  426. package/lib/tab-bar/index.js +0 -218
  427. package/lib/tab-bar/themes/halo/dark/index.js +0 -4
  428. package/lib/tab-bar/themes/halo/light/index.js +0 -4
  429. package/lib/tab-bar/themes/solar/charcoal/index.js +0 -4
  430. package/lib/tab-bar/themes/solar/pearl/index.js +0 -4
  431. package/lib/text-field/index.d.ts +0 -151
  432. package/lib/text-field/index.js +0 -260
  433. package/lib/text-field/themes/halo/dark/index.js +0 -3
  434. package/lib/text-field/themes/halo/light/index.js +0 -3
  435. package/lib/text-field/themes/solar/charcoal/index.js +0 -3
  436. package/lib/text-field/themes/solar/pearl/index.js +0 -3
  437. package/lib/time-picker/index.d.ts +0 -412
  438. package/lib/time-picker/index.js +0 -898
  439. package/lib/time-picker/themes/halo/dark/index.js +0 -4
  440. package/lib/time-picker/themes/halo/light/index.js +0 -4
  441. package/lib/time-picker/themes/solar/charcoal/index.js +0 -4
  442. package/lib/time-picker/themes/solar/pearl/index.js +0 -4
  443. package/lib/toggle/index.d.ts +0 -87
  444. package/lib/toggle/index.js +0 -153
  445. package/lib/toggle/themes/halo/dark/index.js +0 -2
  446. package/lib/toggle/themes/halo/light/index.js +0 -2
  447. package/lib/toggle/themes/solar/charcoal/index.js +0 -2
  448. package/lib/toggle/themes/solar/pearl/index.js +0 -2
  449. package/lib/tooltip/elements/title-tooltip.d.ts +0 -1
  450. package/lib/tooltip/elements/title-tooltip.js +0 -18
  451. package/lib/tooltip/elements/tooltip-element.d.ts +0 -21
  452. package/lib/tooltip/elements/tooltip-element.js +0 -54
  453. package/lib/tooltip/helpers/overflow-tooltip.d.ts +0 -9
  454. package/lib/tooltip/helpers/overflow-tooltip.js +0 -19
  455. package/lib/tooltip/helpers/renderer.d.ts +0 -8
  456. package/lib/tooltip/helpers/renderer.js +0 -11
  457. package/lib/tooltip/helpers/types.d.ts +0 -23
  458. package/lib/tooltip/helpers/types.js +0 -1
  459. package/lib/tooltip/index.d.ts +0 -232
  460. package/lib/tooltip/index.js +0 -477
  461. package/lib/tooltip/managers/tooltip-manager.d.ts +0 -15
  462. package/lib/tooltip/managers/tooltip-manager.js +0 -140
  463. package/lib/tooltip/themes/halo/dark/index.js +0 -3
  464. package/lib/tooltip/themes/halo/light/index.js +0 -3
  465. package/lib/tooltip/themes/solar/charcoal/index.js +0 -3
  466. package/lib/tooltip/themes/solar/pearl/index.js +0 -3
  467. package/lib/tornado-chart/elements/tornado-chart.d.ts +0 -78
  468. package/lib/tornado-chart/elements/tornado-chart.js +0 -122
  469. package/lib/tornado-chart/elements/tornado-item.d.ts +0 -110
  470. package/lib/tornado-chart/elements/tornado-item.js +0 -207
  471. package/lib/tornado-chart/index.d.ts +0 -2
  472. package/lib/tornado-chart/index.js +0 -2
  473. package/lib/tornado-chart/themes/halo/dark/index.js +0 -6
  474. package/lib/tornado-chart/themes/halo/light/index.js +0 -6
  475. package/lib/tornado-chart/themes/solar/charcoal/index.js +0 -6
  476. package/lib/tornado-chart/themes/solar/pearl/index.js +0 -6
  477. package/lib/tree/elements/tree-item.d.ts +0 -129
  478. package/lib/tree/elements/tree-item.js +0 -238
  479. package/lib/tree/elements/tree.d.ts +0 -203
  480. package/lib/tree/elements/tree.js +0 -414
  481. package/lib/tree/helpers/filter.d.ts +0 -8
  482. package/lib/tree/helpers/filter.js +0 -33
  483. package/lib/tree/helpers/renderer.d.ts +0 -5
  484. package/lib/tree/helpers/renderer.js +0 -33
  485. package/lib/tree/helpers/types.d.ts +0 -25
  486. package/lib/tree/helpers/types.js +0 -1
  487. package/lib/tree/index.d.ts +0 -4
  488. package/lib/tree/index.js +0 -3
  489. package/lib/tree/managers/tree-manager.d.ts +0 -248
  490. package/lib/tree/managers/tree-manager.js +0 -395
  491. package/lib/tree/themes/halo/dark/index.js +0 -7
  492. package/lib/tree/themes/halo/light/index.js +0 -7
  493. package/lib/tree/themes/solar/charcoal/index.js +0 -7
  494. package/lib/tree/themes/solar/pearl/index.js +0 -7
  495. package/lib/tree-select/helpers/types.d.ts +0 -4
  496. package/lib/tree-select/helpers/types.js +0 -1
  497. package/lib/tree-select/index.d.ts +0 -404
  498. package/lib/tree-select/index.js +0 -891
  499. package/lib/tree-select/themes/halo/dark/index.js +0 -11
  500. package/lib/tree-select/themes/halo/light/index.js +0 -11
  501. package/lib/tree-select/themes/solar/charcoal/index.js +0 -11
  502. package/lib/tree-select/themes/solar/pearl/index.js +0 -11
  503. package/lib/version.d.ts +0 -1
  504. package/lib/version.js +0 -1
@@ -1,1255 +0,0 @@
1
- var Autosuggest_1;
2
- import { __decorate } from "tslib";
3
- import { css, html } from '@refinitiv-ui/core';
4
- import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
5
- import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
6
- import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
7
- import { unsafeHTML } from '@refinitiv-ui/core/lib/directives/unsafe-html.js';
8
- import { VERSION } from '../version.js';
9
- import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/lib/async.js';
10
- import { escapeRegExp, itemHighlightable, itemRenderer, queryWordSelect } from './helpers/utils.js';
11
- import { isIE, isMobile } from '@refinitiv-ui/utils/lib/browser.js';
12
- import { Overlay } from '../overlay/index.js';
13
- import '../loader/index.js';
14
- import '../item/index.js';
15
- export { queryWordSelect, itemRenderer, escapeRegExp, itemHighlightable, updateElementContent } from './helpers/utils.js';
16
- /**
17
- * Shows suggestions based on users' query.
18
- * It can be used by attaching to text form control
19
- * such as TextField, Multi Input, etc.
20
- * Autosuggest supports various use cases such as
21
- * custom rendering, pagination, asynchronous data request, etc.
22
- *
23
- * @fires item-highlight Fired when an item gets highlighted or highlight is removed
24
- * @fires add-attach-target-events Fired when attach has been set
25
- * @fires remove-attach-target-events Fired when attach has been removed
26
- * @fires item-select Fired when an item gets selected
27
- * @fires suggestions-fetch-requested Fired when auto suggest requests the data
28
- * @fires suggestions-clear-requested Fired when auto suggest requests to clear the data. If used in reactive application, prevent default and set suggestions to []
29
- * @fires suggestions-query Fired when input value has changed and the query must be set
30
- * @fires suggestions-changed Fired when suggestions changed
31
- *
32
- * @attr {boolean} opened - Set to open auto suggest popup
33
- * @prop {boolean} [opened=false] - Auto suggest popup's open state
34
- *
35
- * @slot header - Slot to add custom contents at the top of autosuggest popup
36
- * @slot footer - Slot to add custom contents at the bottom of autosuggest popup
37
- */
38
- let Autosuggest = Autosuggest_1 = class Autosuggest extends Overlay {
39
- /**
40
- * creates auto-suggest
41
- */
42
- constructor() {
43
- super();
44
- /**
45
- * An HTML Element or CSS selector
46
- * @type {AutosuggestTargetElement | string | null}
47
- */
48
- this.attach = null;
49
- /**
50
- * Request suggestions when attach target is focused
51
- */
52
- this.requestOnFocus = false;
53
- /**
54
- * If set to true display 'Has more results' item
55
- */
56
- this.moreResults = false;
57
- /**
58
- * Custom text for More Search
59
- * @default More results for {0}
60
- */
61
- this.moreSearchText = Autosuggest_1.defaultMoreSearchText;
62
- /**
63
- * If set to true show loading mask
64
- */
65
- this.loading = false;
66
- /**
67
- * An object that represents a query from attach target
68
- * @type {AutosuggestQuery | null}
69
- */
70
- this.query = null;
71
- /**
72
- * Debounce rate in ms of the filter as a number.
73
- * Used to throttle the filter rate so as not to trigger unneeded filtering
74
- * @default 100
75
- */
76
- this.debounceRate = Autosuggest_1.defaultDebounceRate;
77
- /**
78
- * A renderer applied to suggestion.
79
- * By default a render maps data to item attributes
80
- * @type {AutosuggestRenderer}
81
- */
82
- this.renderer = itemRenderer;
83
- /**
84
- * A function that is applied to every suggestion during the render process
85
- * to say whether the item can be highlighted and selected. Only items that return true are considered.
86
- * By default the function checks for `item` `highlightable` property.
87
- * @type {AutosuggestHighlightable}
88
- */
89
- this.highlightable = itemHighlightable;
90
- /**
91
- * A list of suggestion items
92
- * @type {AutosuggestItem[]}
93
- */
94
- this.suggestions = [];
95
- /**
96
- * If set to true, the render function is not called. Instead the wrapper element
97
- * should populate and destroy suggestion elements. Rendering items manually
98
- * may have performance benefits in frameworks that use virtual DOM (such as `Vue`, `React`, `hyperHTML` and others)
99
- */
100
- this.htmlRenderer = false;
101
- // used to map render elements with data
102
- this.suggestionMap = new Map();
103
- this.highlightedItem = null;
104
- this.attachTarget = null;
105
- this.lastActiveElement = null;
106
- this.suspendedKey = false;
107
- this.preservedQueryValue = null;
108
- this.focusSuspended = false;
109
- this.jobRunner = new TimeoutTaskRunner(this.debounceRate);
110
- this.attachChangeRunner = new AnimationTaskRunner();
111
- this.moreResultsRunner = new AnimationTaskRunner();
112
- this.loadingRunner = new AnimationTaskRunner();
113
- /**
114
- * Run when document click event happens.
115
- * @param event object
116
- * @returns {void}
117
- */
118
- this.onOutsideClick = (event) => {
119
- const path = event.composedPath();
120
- // outside click
121
- if (!path.includes(this) && this.attachTarget && !path.includes(this.attachTarget)) {
122
- this.setOpened(false);
123
- }
124
- };
125
- /**
126
- * fire event and reinit listeners if attach was changed
127
- * @returns {void}
128
- */
129
- this.attachChangeFrameCallback = () => {
130
- this.dispatchAttachEventsRemoveAction();
131
- const attachTarget = (typeof this.attach === 'string' ? document.querySelector(this.attach) : this.attach);
132
- if (attachTarget && attachTarget.nodeType === document.ELEMENT_NODE) {
133
- this.attachTarget = attachTarget;
134
- if (!this.positionTarget) {
135
- this.positionTarget = attachTarget; // in most cases attachTarget and positionTarget must be the same
136
- }
137
- /**
138
- * @event add-attach-target-events
139
- * Fired when attach has been set.
140
- * Add attach target listeners.
141
- */
142
- this.dispatchEventDefault(new CustomEvent('add-attach-target-events', {
143
- cancelable: true
144
- }), this.attachEventsAddAction);
145
- }
146
- };
147
- /**
148
- * set opened state due to status of focus and content
149
- * @returns {void}
150
- */
151
- this.moreResultsFrameCallback = () => {
152
- this.setOpened(this.attachTargetFocused && this.hasContent);
153
- };
154
- /**
155
- * initialize opened state depends on focus and content
156
- * @returns {void}
157
- */
158
- this.loadingFrameCallback = () => {
159
- if (this.loading && !this.opened && this.attachTargetFocused) {
160
- this.setOpened(true);
161
- }
162
- else if (!this.loading && this.opened && !this.hasContent) {
163
- this.setOpened(false);
164
- }
165
- };
166
- this.removeChildNode = (el) => {
167
- el.parentNode && el.parentNode.removeChild(el);
168
- };
169
- this.generateSuggestionsFragment = (fragment, suggestion) => {
170
- const el = this.renderer(suggestion, this.preservedQueryValue);
171
- fragment.appendChild(el);
172
- return fragment;
173
- };
174
- /**
175
- * Fired when mouse down event happens. Select the item
176
- * @param event Mouse down event
177
- * @returns {void}
178
- */
179
- this.onItemMousedown = (event) => {
180
- // do not loose focus from input when click happens on the popup
181
- // note, in IE when scrolling the focus is lost regardless, so
182
- // do hacking here and with on blur
183
- /* istanbul ignore next */
184
- requestAnimationFrame(() => {
185
- // Ignore any focus query events!
186
- this.focusSuspended = true;
187
- this.attachTarget && this.attachTarget.focus();
188
- this.focusSuspended = false;
189
- });
190
- event.stopPropagation();
191
- event.preventDefault();
192
- };
193
- /**
194
- * @ignore
195
- */
196
- this.position = ['bottom-start', 'top-start', 'right-middle'];
197
- /**
198
- * @ignore
199
- */
200
- this.noCancelOnEscKey = true;
201
- /**
202
- * @ignore
203
- */
204
- this.noCancelOnOutsideClick = true;
205
- /**
206
- * @ignore
207
- */
208
- this.noAutofocus = true;
209
- /**
210
- * @ignore
211
- */
212
- this.noOverlap = true;
213
- /**
214
- * @ignore
215
- */
216
- this.withShadow = false;
217
- /**
218
- * @ignore
219
- */
220
- this.onInputValueChange = this.onInputValueChange.bind(this);
221
- /**
222
- * @ignore
223
- */
224
- this.onInputKeyDown = this.onInputKeyDown.bind(this);
225
- /**
226
- * @ignore
227
- */
228
- this.onInputBlur = this.onInputBlur.bind(this);
229
- /**
230
- * @ignore
231
- */
232
- this.onInputFocus = this.onInputFocus.bind(this);
233
- /**
234
- * @ignore
235
- */
236
- this.suggestionsQueryAction = this.suggestionsQueryAction.bind(this);
237
- /**
238
- * @ignore
239
- */
240
- this.itemSelectAction = this.itemSelectAction.bind(this);
241
- /**
242
- * @ignore
243
- */
244
- this.itemHighlightAction = this.itemHighlightAction.bind(this);
245
- /**
246
- * @ignore
247
- */
248
- this.highlightText = this.highlightText.bind(this);
249
- /**
250
- * @ignore
251
- */
252
- this.suggestionsFetchRequestedAction = this.suggestionsFetchRequestedAction.bind(this);
253
- /**
254
- * @ignore
255
- */
256
- this.suggestionsClearRequestedAction = this.suggestionsClearRequestedAction.bind(this);
257
- /**
258
- * @ignore
259
- */
260
- this.attachEventsAddAction = this.attachEventsAddAction.bind(this);
261
- /**
262
- * @ignore
263
- */
264
- this.attachEventsRemoveAction = this.attachEventsRemoveAction.bind(this);
265
- }
266
- /**
267
- * Element version number
268
- * @returns version number
269
- */
270
- static get version() {
271
- return VERSION;
272
- }
273
- /**
274
- * A `CSSResultGroup` that will be used
275
- * to style the host, slotted children
276
- * and the internal template of the element.
277
- * @return CSS template
278
- */
279
- static get styles() {
280
- return [
281
- super.styles,
282
- css `
283
- :host {
284
- overflow: hidden;
285
- display: flex;
286
- flex-direction: column;
287
- }
288
- [part=content] {
289
- flex: 1 1 auto;
290
- overflow-x: hidden;
291
- overflow-y: auto;
292
- -webkit-overflow-scrolling: touch;
293
- }
294
- [part=header], [part=footer] {
295
- flex: none;
296
- }
297
- `
298
- ];
299
- }
300
- /**
301
- * A basic regexp matching pattern to replace text based on string input.
302
- * @param text Value to test against
303
- * @param query The query
304
- * @param [pattern=<mark>$1</mark>] Provide a pattern to replace string
305
- * @returns innerHTML The text that can be used as innerHTML
306
- */
307
- static QueryWordSelect(text, query = '', pattern = '<mark>$1</mark>') {
308
- return queryWordSelect(text, query, pattern);
309
- }
310
- /**
311
- * Build item element from data object
312
- * @param suggestion Suggestion data
313
- * @param query A query data (usually string, but could be any entity )
314
- * @returns item
315
- */
316
- static ItemRenderer(suggestion, query) {
317
- return itemRenderer(suggestion, query);
318
- }
319
- /**
320
- * Replace forbidden characters in regular expressions
321
- * @param string A string to process
322
- * @returns clean string
323
- */
324
- static EscapeRegExp(string = '') {
325
- return escapeRegExp(string);
326
- }
327
- /**
328
- * Check whether item can be highlighted
329
- * @param suggestion Suggestion object
330
- * @param target item element
331
- * @returns highlightable
332
- */
333
- static ItemHighlightable(suggestion, target) {
334
- return itemHighlightable(suggestion, target);
335
- }
336
- disconnectedCallback() {
337
- this.dispatchAttachEventsRemoveAction();
338
- super.disconnectedCallback();
339
- }
340
- /**
341
- * Run when attach target value changes.
342
- * @param event by default `value-changed` event is listened
343
- * @returns {void}
344
- */
345
- onInputValueChange(event) {
346
- if (!this.suspended) { // avoid circular
347
- /* istanbul ignore next */
348
- if (isMobile) {
349
- this.lastActiveElement = event.target;
350
- }
351
- this.requestSuggestions('value-changed', true);
352
- }
353
- }
354
- /**
355
- * Run when input has lost focus
356
- * @param event by default `blur` event is listened
357
- * @returns {void}
358
- */
359
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
360
- onInputBlur(event) {
361
- requestAnimationFrame(() => {
362
- if (!this.attachTargetFocused) {
363
- this.setOpened(false);
364
- }
365
- });
366
- }
367
- /**
368
- * Run when input received focus
369
- * @param event by default `focus` event is listened
370
- * @returns {void}
371
- */
372
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
373
- onInputFocus(event) {
374
- /* istanbul ignore next */
375
- if (this.focusSuspended) {
376
- // see _onItemMousedown, it is an IE fix for scrollbar
377
- return;
378
- }
379
- this.requestOnFocus && this.requestSuggestions('input-focus');
380
- }
381
- /**
382
- * Run when input key down event has happened
383
- * @param event by default `keydown` event is listened
384
- * @returns {void}
385
- */
386
- onInputKeyDown(event) {
387
- if (event.key === 'Up' || event.key === 'ArrowUp') {
388
- this.onUpKey();
389
- }
390
- else if (event.key === 'Down' || event.key === 'ArrowDown') {
391
- this.onDownKey();
392
- }
393
- else if (event.key === 'Esc' || event.key === 'Escape') {
394
- this.onEscKey();
395
- }
396
- else if (event.key === 'Enter' || event.key === 'Return') {
397
- this.onEnterKey(event);
398
- }
399
- else {
400
- return;
401
- }
402
- event.preventDefault();
403
- }
404
- /**
405
- * @ignore
406
- * Called when the element's dimensions have changed
407
- * @param size dimension details
408
- * @returns {void}
409
- */
410
- resizedCallback(size) {
411
- super.resizedCallback(size);
412
- this.calculateContentMaxHeight(size);
413
- }
414
- /**
415
- * @returns template of loader if currently query loading
416
- */
417
- get loaderTemplate() {
418
- if (!this.loading) {
419
- return null;
420
- }
421
- return html `
422
- <div part="loader">
423
- <div part="backdrop"></div>
424
- <ef-loader size="medium"></ef-loader>
425
- </div>
426
- `;
427
- }
428
- /**
429
- * @returns template of moreResults
430
- */
431
- get moreResultsTemplate() {
432
- if (!this.moreResults) {
433
- return null;
434
- }
435
- return html `
436
- <ef-item id="moreResults" part="more-results">${this.highlightText(this.moreResults, this.moreSearchText, this.query)}</ef-item>
437
- `;
438
- }
439
- /**
440
- * A `TemplateResult` that will be used
441
- * to render the updated internal template.
442
- * @return Render template
443
- */
444
- render() {
445
- return html `
446
- <div part="header">
447
- <slot id="headerSlot" name="header"></slot>
448
- </div>
449
- <div id="content" part="content" @mousemove="${this.onItemMouseMove}" @mouseleave="${this.onItemMouseLeave}" @tap="${this.onItemMouseClick}">
450
- <slot id="contentSlot" @slotchange="${this.onSlotChange}"></slot>
451
- ${this.moreResultsTemplate}
452
- </div>
453
- <div part="footer">
454
- <slot id="footerSlot" name="footer"></slot>
455
- </div>
456
- ${this.loaderTemplate}
457
- `;
458
- }
459
- /**
460
- * Called once after the component is first rendered
461
- * @param changedProperties map of changed properties with old values
462
- * @returns {void}
463
- */
464
- firstUpdated(changedProperties) {
465
- super.firstUpdated(changedProperties);
466
- this.addEventListener('tapstart', this.onItemMousedown);
467
- }
468
- /**
469
- * Called when the element’s DOM has been updated and rendered
470
- * @param changedProperties Properties that has changed
471
- * @returns shouldUpdate
472
- */
473
- shouldUpdate(changedProperties) {
474
- let result = super.shouldUpdate(changedProperties);
475
- result = result || this.shouldAutosuggestUpdate(changedProperties);
476
- return result;
477
- }
478
- /**
479
- * Called after the element’s DOM has been updated
480
- * @param changedProperties Properties that has changed
481
- * @returns {void}
482
- */
483
- updated(changedProperties) {
484
- super.updated(changedProperties);
485
- if (changedProperties.has('suggestions')) {
486
- this.notifySuggestions();
487
- }
488
- this.changedCallbacks(changedProperties);
489
- }
490
- /**
491
- * inheritance callbacks
492
- */
493
- /**
494
- * Run when the slot has changed.
495
- * @param event Slot change query
496
- * @returns {void}
497
- */
498
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
499
- onSlotChange(event) {
500
- const nodes = (this.contentSlot && this.contentSlot.assignedNodes()) || [];
501
- this.setOpened(this.attachTargetFocused && this.hasContent);
502
- // make a brave assumption that suggestions are populated as well
503
- const suggestions = this.suggestions;
504
- this.highlightItem(); // hide highlight
505
- this.suggestionMap.clear();
506
- nodes.forEach((node, idx) => {
507
- /* istanbul ignore next */
508
- if (node.nodeType !== Node.ELEMENT_NODE) {
509
- return;
510
- }
511
- const suggestion = suggestions[idx];
512
- if (this.highlightable(suggestion, node)) {
513
- this.suggestionMap.set(node, suggestion);
514
- }
515
- });
516
- }
517
- /**
518
- * 'suggestions-query' default action
519
- * @param event Suggestion query
520
- * @returns {void}
521
- */
522
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
523
- suggestionsQueryAction(event) {
524
- this.query = this.attachTarget && this.attachTarget.value;
525
- }
526
- /**
527
- * 'item-select' default action
528
- * @param event Select action
529
- * @returns {void}
530
- */
531
- itemSelectAction(event) {
532
- const { detail: { query, suggestion } } = event;
533
- /* istanbul ignore next */
534
- if (this.attachTarget) {
535
- this.attachTarget.value = suggestion && (suggestion === null || suggestion === void 0 ? void 0 : suggestion.label) || query;
536
- }
537
- }
538
- /**
539
- * 'item-highlight' default action
540
- * @param event Highlight action
541
- * @returns {void}
542
- */
543
- itemHighlightAction(event) {
544
- const target = event.detail.target;
545
- const oldTarget = event.detail.oldTarget;
546
- if (target) {
547
- target.highlighted = true;
548
- }
549
- if (oldTarget) {
550
- oldTarget.highlighted = false;
551
- }
552
- }
553
- /**
554
- * 'suggestions-fetch-requested' default action
555
- * @param event Fetch request
556
- * @returns {void}
557
- */
558
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
559
- suggestionsFetchRequestedAction(event) {
560
- // do nothing
561
- }
562
- /**
563
- * 'suggestions-clear-requested' default action
564
- * @param event Clear request
565
- * @returns {void}
566
- */
567
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
568
- suggestionsClearRequestedAction(event) {
569
- this.suggestions = [];
570
- }
571
- /**
572
- * Add listeners to the attached target
573
- * By default `input`, 'keydown', 'focus' and 'blur' events are listened
574
- * @param event Attach add action
575
- * @returns {void}
576
- */
577
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
578
- attachEventsAddAction(event) {
579
- const attachTarget = this.attachTarget;
580
- /* istanbul ignore next */
581
- if (!attachTarget) {
582
- return;
583
- }
584
- attachTarget.addEventListener('input', this.onInputValueChange);
585
- attachTarget.addEventListener('keydown', this.onInputKeyDown);
586
- attachTarget.addEventListener('blur', this.onInputBlur);
587
- attachTarget.addEventListener('focus', this.onInputFocus);
588
- }
589
- /**
590
- * Remove event listeners from the attached target
591
- * By default `input`, 'keydown', 'focus' and 'blur' events are listened
592
- * @param event Attach remove action
593
- * @returns {void}
594
- */
595
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
596
- attachEventsRemoveAction(event) {
597
- const attachTarget = this.attachTarget;
598
- if (!attachTarget) {
599
- return;
600
- }
601
- attachTarget.removeEventListener('input', this.onInputValueChange);
602
- attachTarget.removeEventListener('keydown', this.onInputKeyDown);
603
- attachTarget.removeEventListener('blur', this.onInputBlur);
604
- attachTarget.removeEventListener('focus', this.onInputFocus);
605
- }
606
- /**
607
- * Call this method to fetch more results
608
- * @returns {void}
609
- */
610
- fetchMoreSuggestions() {
611
- this.dispatchSuggestionsFetchRequested('more-results');
612
- }
613
- /**
614
- * Highlight the item and remove old highlighted item
615
- * @param target Element to highlight. Pass null to just remove previous highlight
616
- * @param silent Do not fire a select event on highlight. Select should be fired on keyboard navigation
617
- * @returns {void}
618
- */
619
- highlightItem(target = null, silent = true) {
620
- if (this.highlightedItem !== target) {
621
- const oldTarget = this.highlightedItem;
622
- this.highlightedItem = target && this.canSelect(target) ? target : null;
623
- /**
624
- * @event item-highlight
625
- * Fired when an item gets highlighted or highlight is removed
626
- * @param {HTMLElement} [target] New highlight target or null
627
- * @param {*} [suggestion] New suggestion or null
628
- * @param {HTMLElement} [oldTarget] Old highlight target or null
629
- * @param {*} [oldSuggestion] Old suggestion or null
630
- */
631
- this.dispatchEventDefault(new CustomEvent('item-highlight', {
632
- cancelable: true,
633
- detail: {
634
- target: this.highlightedItem,
635
- suggestion: this.getSuggestionFor(this.highlightedItem),
636
- oldTarget,
637
- oldSuggestion: this.getSuggestionFor(oldTarget)
638
- }
639
- }), this.itemHighlightAction);
640
- if (!silent && target) {
641
- this.selectItem(target, 'navigation');
642
- }
643
- }
644
- }
645
- /**
646
- * Calculate more search text inner html
647
- * @param moreResults True if has more results
648
- * @param moreSearchText More search text template
649
- * @param query A query
650
- * @returns innerHTML
651
- */
652
- highlightText(moreResults, moreSearchText, query) {
653
- if (!moreResults) {
654
- return null;
655
- }
656
- return html `
657
- <span part="more-results-text">
658
- ${unsafeHTML(moreSearchText.replace(/{0\}/g, `<mark>${query ? query.toString() : ''}</mark>`))}
659
- </span>
660
- <span part="more-results-keys" slot="right"><kbd>SHIFT</kbd> + <kbd>ENTER</kbd></span>
661
- `;
662
- }
663
- /**
664
- * Call this method to request suggestions
665
- * @private
666
- * @param reason The reason to request query
667
- * @param debounce True to debounce
668
- * @returns {void}
669
- */
670
- requestSuggestions(reason, debounce = false) {
671
- this.dispatchSuggestionsQuery(reason);
672
- if (this.preservedQueryValue === this.query) { // if the query is the same do not re-issue the request, instead try to open auto suggest
673
- if (!this.opened && ((this.suggestions && this.suggestions.length) || this.moreResults)) {
674
- this.setOpened(true);
675
- }
676
- return;
677
- }
678
- this.preservedQueryValue = this.query;
679
- const dispatch = () => {
680
- if (this.attachTargetFocused) {
681
- this.dispatchSuggestionsFetchRequested(reason);
682
- }
683
- };
684
- if (debounce) {
685
- // debounce
686
- this.jobRunner.schedule(dispatch);
687
- return;
688
- }
689
- this.jobRunner.cancel();
690
- dispatch();
691
- }
692
- /**
693
- * All internal opened set events can be stoppable externally
694
- * Use this instead of setting opened directly
695
- * Protected method that can be used by managers or subclasses
696
- * @returns {void}
697
- */
698
- onOpened() {
699
- super.onOpened();
700
- document.addEventListener('tapstart', this.onOutsideClick);
701
- }
702
- /**
703
- * Run when the popup has closed, managers are de-registered
704
- * and closing transition has finished
705
- * @returns {void}
706
- */
707
- onClosed() {
708
- super.onClosed();
709
- this.restrictContentMaxHeight();
710
- document.removeEventListener('tapstart', this.onOutsideClick);
711
- }
712
- /**
713
- * enter key processing
714
- * @param event Enter
715
- * @returns {void}
716
- */
717
- onEnterKey(event) {
718
- if (!this.opened) {
719
- this.requestSuggestions('enter-pressed');
720
- return;
721
- }
722
- /* istanbul ignore next */
723
- if (this.loading) {
724
- return;
725
- }
726
- // more results
727
- if (this.moreResults && event.shiftKey) {
728
- this.fetchMoreSuggestions();
729
- return;
730
- }
731
- if (!this.highlightedItem) {
732
- this.setOpened(false);
733
- return;
734
- }
735
- this.highlightedItem && this.selectItem(this.highlightedItem, 'enter');
736
- }
737
- /**
738
- * Up key processing
739
- * @returns {void}
740
- */
741
- onUpKey() {
742
- if (!this.opened) {
743
- this.requestSuggestions('suggestions-revealed');
744
- return;
745
- }
746
- /* istanbul ignore next */
747
- if (this.loading) {
748
- return;
749
- }
750
- this.focusElement(-1);
751
- }
752
- /**
753
- * Down key processing
754
- * @returns {void}
755
- */
756
- onDownKey() {
757
- if (!this.opened) {
758
- this.requestSuggestions('suggestions-revealed');
759
- return;
760
- }
761
- /* istanbul ignore next */
762
- if (this.loading) {
763
- return;
764
- }
765
- this.focusElement(1);
766
- }
767
- /**
768
- * Esc key processing
769
- * @returns {void}
770
- */
771
- onEscKey() {
772
- if (this.opened) {
773
- // if preserved value exists, set it back
774
- this.dispatchItemSelect('reset');
775
- this.setOpened(false);
776
- return;
777
- }
778
- if (this.query) {
779
- this.suspend();
780
- this.dispatchItemSelect('clear');
781
- this.resume();
782
- this.requestSuggestions('escape-pressed');
783
- }
784
- }
785
- /**
786
- * Highlight it on mouse move
787
- * @param event for item
788
- * @returns {void}
789
- */
790
- onItemMouseMove(event) {
791
- this.highlightItem(this.getTarget(event));
792
- }
793
- /**
794
- * @param target Item to check
795
- * @returns true if an item can be highlighted and selectable
796
- */
797
- canSelect(target) {
798
- return this.suggestionMap.has(target) || (this.moreResults && target === this.moreResultsItem);
799
- }
800
- /**
801
- * Get suggestion for target
802
- * @param target Target to check
803
- * @returns suggestion
804
- */
805
- getSuggestionFor(target) {
806
- return target && this.suggestionMap.get(target);
807
- }
808
- /**
809
- * Select the item from the list
810
- * @param target Element to select
811
- * @param method 'click', 'enter' or 'navigation'
812
- * @returns {void}
813
- */
814
- selectItem(target, method) {
815
- if (this.canSelect(target)) {
816
- // more results
817
- if (target === this.moreResultsItem) {
818
- this.dispatchItemSelect('reset');
819
- switch (method) {
820
- case 'click':
821
- case 'enter':
822
- this.fetchMoreSuggestions();
823
- break;
824
- default:
825
- // node default
826
- }
827
- return;
828
- }
829
- this.dispatchItemSelect(method, target);
830
- switch (method) {
831
- case 'click':
832
- case 'enter':
833
- this.dispatchSuggestionsClearRequested();
834
- break;
835
- default:
836
- // node default
837
- }
838
- }
839
- }
840
- /**
841
- * Get the list of rendered suggestions
842
- * @returns renderedSuggestions
843
- */
844
- get renderedSuggestions() {
845
- const keys = [];
846
- this.suggestionMap.forEach((value, key) => {
847
- keys.push(key);
848
- });
849
- if (this.moreResults && this.moreResultsItem) {
850
- keys.push(this.moreResultsItem);
851
- }
852
- return keys;
853
- }
854
- /**
855
- * Fired when mouse leave event happens. Remove highlight from the item
856
- * @returns {void}
857
- */
858
- /* istanbul ignore next */
859
- onItemMouseLeave() {
860
- this.highlightItem(); // remove highlight
861
- }
862
- /**
863
- * Fired when mouse click event happens. Select an item
864
- * @param event Mouse click event
865
- * @returns {void}
866
- */
867
- onItemMouseClick(event) {
868
- this.selectItem(this.getTarget(event), 'click');
869
- }
870
- /**
871
- * check some of native properties was modified
872
- * @param changedProperties properties that was changed
873
- * @returns true if some of changedProperties modified
874
- */
875
- shouldAutosuggestUpdate(changedProperties) {
876
- return changedProperties.has('attach') || changedProperties.has('suggestions') || changedProperties.has('moreResults') || changedProperties.has('loading') || changedProperties.has('debounceRate');
877
- }
878
- changedCallbacks(changedProperties) {
879
- if (changedProperties.has('attach')) {
880
- this.attachChangeRunner.schedule(this.attachChangeFrameCallback);
881
- }
882
- if (changedProperties.has('moreResults')) {
883
- this.moreResultsRunner.schedule(this.moreResultsFrameCallback);
884
- }
885
- if (changedProperties.has('loading')) {
886
- this.loadingRunner.schedule(this.loadingFrameCallback);
887
- }
888
- if (changedProperties.has('opened')) {
889
- this.handleAfterOpened();
890
- }
891
- if (changedProperties.has('debounceRate')) {
892
- this.debounceRateChange();
893
- }
894
- }
895
- /**
896
- * handle highlight after open
897
- * @returns {void}
898
- */
899
- handleAfterOpened() {
900
- this.highlightItem(); // hide highlight for case more-result
901
- }
902
- /**
903
- * recreate debouncer if dobounceRate was changed
904
- * @returns {void}
905
- */
906
- debounceRateChange() {
907
- this.jobRunner.fulfil();
908
- this.jobRunner = new TimeoutTaskRunner(this.debounceRate);
909
- }
910
- /**
911
- * Dispatch attach events remove action event
912
- * @returns {void}
913
- */
914
- dispatchAttachEventsRemoveAction() {
915
- if (this.attachTarget) {
916
- /**
917
- * @event remove-attach-target-events
918
- * Fired when attach has been removed.
919
- * Remove attach target listeners.
920
- */
921
- this.dispatchEventDefault(new CustomEvent('remove-attach-target-events', {
922
- cancelable: true
923
- }), this.attachEventsRemoveAction);
924
- this.attachTarget = null;
925
- }
926
- }
927
- /**
928
- * Run when suggestions get changed
929
- * NB: this function is only run when htmlRenderer is set to false
930
- * @returns {void}
931
- */
932
- suggestionsChange() {
933
- this.contentSlot && this.contentSlot.assignedNodes().forEach(this.removeChildNode);
934
- this.appendChild(this.suggestions.reduce(this.generateSuggestionsFragment, document.createDocumentFragment()));
935
- }
936
- /**
937
- * Dispatch item select event
938
- * The event may change input, therefore suspend listening
939
- * @param method Select method
940
- * @param target Target for suggestion
941
- * @returns {void}
942
- */
943
- dispatchItemSelect(method, target = null) {
944
- this.suspend();
945
- /**
946
- * @event item-select
947
- * Fired when an item gets selected
948
- * @param {AutosuggestMethodType} method Select method
949
- * @param {HTMLElement} target Selection target
950
- * @param {*} [suggestion] Selected suggestion or null
951
- * @param {*} [query] Saved query object or null
952
- */
953
- this.dispatchEventDefault(new CustomEvent('item-select', {
954
- cancelable: true,
955
- detail: {
956
- method,
957
- target,
958
- suggestion: this.getSuggestionFor(target),
959
- query: method === 'clear' ? null : this.preservedQueryValue
960
- }
961
- }), this.itemSelectAction);
962
- this.resume();
963
- }
964
- /**
965
- * fire 'suggestions-fetch-requested' event
966
- * @param reason Dispatch reason
967
- * @returns {void}
968
- */
969
- dispatchSuggestionsFetchRequested(reason) {
970
- /**
971
- * @event suggestions-fetch-requested
972
- * Fired when auto suggest requests the data.
973
- * @param {String} query Input query
974
- * @param {} reason The reason to fetch data
975
- */
976
- this.dispatchEventDefault(new CustomEvent('suggestions-fetch-requested', {
977
- cancelable: true,
978
- detail: {
979
- query: this.query,
980
- reason
981
- }
982
- }), this.suggestionsFetchRequestedAction);
983
- }
984
- /**
985
- * fire 'suggestions-clear-requested' event
986
- * @returns {void}
987
- */
988
- dispatchSuggestionsClearRequested() {
989
- this.preservedQueryValue = null;
990
- /**
991
- * @event suggestions-clear-requested
992
- * Fired when auto suggest requests to clear the data.
993
- * If used in reactive application, prevent default and set suggestions to []
994
- */
995
- this.dispatchEventDefault(new CustomEvent('suggestions-clear-requested', {
996
- cancelable: true
997
- }), this.suggestionsClearRequestedAction);
998
- }
999
- /**
1000
- * fire 'suggestions-query' event
1001
- * @param reason Dispatch reason
1002
- * @returns {void}
1003
- */
1004
- dispatchSuggestionsQuery(reason) {
1005
- /**
1006
- * @event suggestions-query
1007
- * Fired when input value has changed and the query must be set.
1008
- * @param reason The reason to request query
1009
- */
1010
- this.dispatchEventDefault(new CustomEvent('suggestions-query', {
1011
- cancelable: true,
1012
- detail: {
1013
- reason
1014
- }
1015
- }), this.suggestionsQueryAction);
1016
- }
1017
- /**
1018
- * Dispatch event and run default action if preventDefault is not run
1019
- * @param event Custom event to dispatch
1020
- * @param defaultAction Default action to run
1021
- * @returns {void}
1022
- */
1023
- dispatchEventDefault(event, defaultAction) {
1024
- this.dispatchEvent(event);
1025
- if (!event.defaultPrevented) {
1026
- defaultAction.call(this, event);
1027
- }
1028
- }
1029
- /**
1030
- * Check if the attach target is in focus
1031
- * @returns focused true if attach target is focused
1032
- */
1033
- get attachTargetFocused() {
1034
- return this.isFocused(document.activeElement) || this.attachTarget === this.lastActiveElement;
1035
- }
1036
- /**
1037
- * Walk through shadowDOM to find activeElement
1038
- * @param activeElement currently active document element
1039
- * @returns true if activeElement is attached target
1040
- */
1041
- isFocused(activeElement) {
1042
- if (this.attachTarget === activeElement) {
1043
- return true;
1044
- }
1045
- if (activeElement && activeElement.shadowRoot) {
1046
- return this.isFocused(activeElement.shadowRoot.activeElement);
1047
- }
1048
- return false;
1049
- }
1050
- /**
1051
- * Check if the autosuggest has content
1052
- * @returns content exists
1053
- */
1054
- get hasContent() {
1055
- if (this.moreResults) {
1056
- return true;
1057
- }
1058
- // Space characters (e.g. space, tab, EOL) don't count as having content
1059
- const nodes = this.contentSlot && this.contentSlot.assignedNodes() || [];
1060
- return nodes.some(({ nodeType, textContent }) => nodeType === Node.ELEMENT_NODE || (textContent && textContent.search(/\S/) >= 0)); // If node is element always return true
1061
- }
1062
- /**
1063
- * Suspend updating suggestions on value-changed
1064
- * Autosuggest is suspended on select
1065
- * @returns {void}
1066
- */
1067
- suspend() {
1068
- this.suspendedKey = true;
1069
- }
1070
- /**
1071
- * Resume suspended autosuggest
1072
- * @returns {void}
1073
- */
1074
- resume() {
1075
- this.suspendedKey = false;
1076
- }
1077
- /**
1078
- * Check if the autosuggest is suspended
1079
- * @returns {Boolean} suspended
1080
- */
1081
- get suspended() {
1082
- return this.suspendedKey;
1083
- }
1084
- /**
1085
- * Event target is not always what we want. Try to find the best target to process further
1086
- * @param event Mouse click hover event
1087
- * @returns target
1088
- */
1089
- getTarget(event) {
1090
- const path = event.composedPath();
1091
- for (let i = 0; i <= path.length; i += 1) {
1092
- const node = path[i];
1093
- /* istanbul ignore next */
1094
- if (node.nodeType !== Node.ELEMENT_NODE) {
1095
- continue;
1096
- }
1097
- if (this.canSelect(node)) {
1098
- return node;
1099
- }
1100
- /* istanbul ignore next */
1101
- if (node === this) {
1102
- return event.target;
1103
- }
1104
- }
1105
- return event.target;
1106
- }
1107
- /**
1108
- * Highlight next or previous highlightable element if present
1109
- * @param {Number} direction -1 - up/next; 1 - down/previous
1110
- * @returns {void}
1111
- */
1112
- focusElement(direction) {
1113
- // focus is spread across
1114
- const highlightedItem = this.highlightedItem;
1115
- const children = this.renderedSuggestions;
1116
- const idx = highlightedItem ? children.indexOf(highlightedItem) : -1;
1117
- let focusElement;
1118
- if (direction === 1) {
1119
- focusElement = idx === -1 ? children[0] : children[idx + 1];
1120
- }
1121
- else {
1122
- focusElement = idx === -1 ? children[children.length - 1] : children[idx - 1];
1123
- }
1124
- if (!focusElement) {
1125
- focusElement = direction === 1 ? children[0] : children[children.length - 1];
1126
- }
1127
- if (focusElement) {
1128
- this.highlightItem(focusElement, false);
1129
- focusElement.scrollIntoView({
1130
- behavior: 'auto',
1131
- block: 'nearest'
1132
- });
1133
- }
1134
- }
1135
- /**
1136
- * @returns {void}
1137
- */
1138
- notifySuggestions() {
1139
- this.dispatchEvent(new CustomEvent('suggestions-changed', {
1140
- detail: {
1141
- value: this.suggestions
1142
- }
1143
- }));
1144
- if (!this.htmlRenderer) {
1145
- this.suggestionsChange();
1146
- }
1147
- }
1148
- /**
1149
- * Set the width
1150
- * @returns {void}
1151
- */
1152
- refit() {
1153
- super.refit();
1154
- if (this.positionTarget && this.positionTarget instanceof HTMLElement) {
1155
- const rect = this.positionTarget.getBoundingClientRect();
1156
- this.style.minWidth = `${rect.width}px`;
1157
- }
1158
- this.restrictContentMaxHeight();
1159
- }
1160
- /**
1161
- * IE11 only: Restrict maximum height of content element
1162
- * @param [maxHeight] Maximum height of content element
1163
- * @returns {void}
1164
- */
1165
- /* istanbul ignore next */
1166
- restrictContentMaxHeight(maxHeight) {
1167
- if (!isIE) {
1168
- return;
1169
- }
1170
- if (maxHeight) {
1171
- this.contentElement && this.contentElement.style.setProperty('max-height', `${maxHeight}px`);
1172
- }
1173
- else {
1174
- this.contentElement && this.contentElement.style.removeProperty('max-height');
1175
- }
1176
- }
1177
- /**
1178
- * IE11 only: Calculate the maxHeight of content element
1179
- * @param size Size of the dialog
1180
- * @returns {void}
1181
- */
1182
- /* istanbul ignore next */
1183
- calculateContentMaxHeight(size) {
1184
- var _a, _b, _c;
1185
- if (!isIE) {
1186
- return;
1187
- }
1188
- const headerRect = (_a = this.headerElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1189
- const footerRect = (_b = this.footerElement) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
1190
- const contentRect = (_c = this.contentElement) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect();
1191
- const dialogHeight = size.height;
1192
- const headerHeight = headerRect ? headerRect.height : 0;
1193
- const footerHeight = footerRect ? footerRect.height : 0;
1194
- const contentHeight = contentRect ? contentRect.height : 0;
1195
- if (headerHeight + footerHeight + contentHeight > dialogHeight) {
1196
- this.restrictContentMaxHeight(dialogHeight - footerHeight - headerHeight);
1197
- }
1198
- }
1199
- };
1200
- Autosuggest.defaultDebounceRate = 100;
1201
- Autosuggest.defaultMoreSearchText = 'More results for {0}';
1202
- __decorate([
1203
- property({ type: String })
1204
- ], Autosuggest.prototype, "attach", void 0);
1205
- __decorate([
1206
- property({ type: Boolean, attribute: 'request-on-focus' })
1207
- ], Autosuggest.prototype, "requestOnFocus", void 0);
1208
- __decorate([
1209
- property({ type: Boolean, reflect: true, attribute: 'more-results' })
1210
- ], Autosuggest.prototype, "moreResults", void 0);
1211
- __decorate([
1212
- property({ type: String, attribute: 'more-search-text' })
1213
- ], Autosuggest.prototype, "moreSearchText", void 0);
1214
- __decorate([
1215
- property({ type: Boolean, reflect: true })
1216
- ], Autosuggest.prototype, "loading", void 0);
1217
- __decorate([
1218
- property({ type: Object, attribute: false })
1219
- ], Autosuggest.prototype, "query", void 0);
1220
- __decorate([
1221
- property({ type: Number, attribute: 'debounce-rate' })
1222
- ], Autosuggest.prototype, "debounceRate", void 0);
1223
- __decorate([
1224
- property({ type: Function, attribute: false })
1225
- ], Autosuggest.prototype, "renderer", void 0);
1226
- __decorate([
1227
- property({ type: Function, attribute: false })
1228
- ], Autosuggest.prototype, "highlightable", void 0);
1229
- __decorate([
1230
- property({ type: Array, attribute: false })
1231
- ], Autosuggest.prototype, "suggestions", void 0);
1232
- __decorate([
1233
- property({ type: Boolean, attribute: 'html-renderer' })
1234
- ], Autosuggest.prototype, "htmlRenderer", void 0);
1235
- __decorate([
1236
- query('#moreResults')
1237
- ], Autosuggest.prototype, "moreResultsItem", void 0);
1238
- __decorate([
1239
- query('#contentSlot')
1240
- ], Autosuggest.prototype, "contentSlot", void 0);
1241
- __decorate([
1242
- query('[part="content"]')
1243
- ], Autosuggest.prototype, "contentElement", void 0);
1244
- __decorate([
1245
- query('[part="header"]')
1246
- ], Autosuggest.prototype, "headerElement", void 0);
1247
- __decorate([
1248
- query('[part="footer"]')
1249
- ], Autosuggest.prototype, "footerElement", void 0);
1250
- Autosuggest = Autosuggest_1 = __decorate([
1251
- customElement('ef-autosuggest', {
1252
- alias: 'emerald-autosuggest'
1253
- })
1254
- ], Autosuggest);
1255
- export { Autosuggest };