@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,1274 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { ControlElement, html, css, WarningNotice } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
5
- import { state } from '@refinitiv-ui/core/lib/decorators/state.js';
6
- import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
7
- import { cache } from '@refinitiv-ui/core/lib/directives/cache.js';
8
- import { guard } from '@refinitiv-ui/core/lib/directives/guard.js';
9
- import { ref, createRef } from '@refinitiv-ui/core/lib/directives/ref.js';
10
- import { VERSION } from '../version.js';
11
- import { isIE } from '@refinitiv-ui/utils/lib/browser.js';
12
- import { DateFormat, format, utcFormat, utcParse, isValidDate, isWeekend, isAfter, isBefore, addMonths, subMonths, isToday, isThisMonth, isThisYear, isSameDay, isSameMonth, isSameYear, toDateSegment, parse } from '@refinitiv-ui/utils/lib/date.js';
13
- import { left, right, up, down, first, last } from '@refinitiv-ui/utils/lib/navigation.js';
14
- import { monthInfo, weekdaysNames, monthsNames, formatLocaleDate, ViewFormatTranslateParams } from './utils.js';
15
- import { translate, getLocale, TranslatePropertyKey } from '@refinitiv-ui/translate';
16
- import { RenderView, CalendarLocaleScope, FIRST_DAY_OF_WEEK, YEARS_PER_YEAR_VIEW, DAY_VIEW, YEAR_VIEW, MONTH_VIEW } from './constants.js';
17
- import './locales.js';
18
- import '../button/index.js';
19
- import '@refinitiv-ui/phrasebook/lib/locale/en/calendar.js';
20
- /**
21
- * Standard calendar element
22
- *
23
- * @fires value-changed - Fired when the `value` changes.
24
- * @fires view-changed - Fired when the `view` changes.
25
- *
26
- * @attr {boolean} readonly - Set readonly state
27
- * @prop {boolean} [readonly=false] - Set readonly state
28
- *
29
- * @attr {boolean} disabled - Set disabled state
30
- * @prop {boolean} [disabled=false] - Set disabled state
31
- *
32
- * @slot footer - Adds slotted content into the footer of the calendar control
33
- */
34
- let Calendar = class Calendar extends ControlElement {
35
- constructor() {
36
- super(...arguments);
37
- this.defaultRole = 'group';
38
- /**
39
- * Reference to the view button
40
- */
41
- this.viewBtnRef = createRef();
42
- this._min = '';
43
- this._max = '';
44
- /**
45
- * Only enable weekdays
46
- */
47
- this.weekdaysOnly = false;
48
- /**
49
- * Only enable weekends
50
- */
51
- this.weekendsOnly = false;
52
- /**
53
- * Custom filter, used for enabling/disabling certain dates
54
- * @type {CalendarFilter | null}
55
- */
56
- this.filter = null;
57
- this._view = '';
58
- this.localFirstDayOfWeek = FIRST_DAY_OF_WEEK; // used from locales. 0 stands for Sunday
59
- this._firstDayOfWeek = null; // used from setter
60
- /**
61
- * Set to switch to range select mode
62
- */
63
- this.range = false;
64
- /**
65
- * Set to switch to multiple select mode
66
- */
67
- this.multiple = false;
68
- this._values = [];
69
- /**
70
- * Fill head and tail cell dates
71
- */
72
- this.fillCells = false;
73
- /**
74
- * Used for internal navigation between render views
75
- */
76
- this._renderView = RenderView.DAY;
77
- /**
78
- * Used for keyboard navigation when trying
79
- * to restore focus on re-render and control navigation
80
- */
81
- this._activeCellIndex = null;
82
- // Used to store current navigation map
83
- this.navigationGrid = [];
84
- /**
85
- * Connected to role. If false, the values are not announced in the screen reader
86
- */
87
- this.announceValues = true;
88
- // Cashed filter, which is constructed based on multiple local filters
89
- this.isDateAvailable = null;
90
- }
91
- /**
92
- * Element version number
93
- * @returns version number
94
- */
95
- static get version() {
96
- return VERSION;
97
- }
98
- /**
99
- * A `CSSResultGroup` that will be used
100
- * to style the host, slotted children
101
- * and the internal template of the element.
102
- * @return CSS template
103
- */
104
- static get styles() {
105
- return css `
106
- :host {
107
- display: inline-block;
108
- }
109
- [part~=navigation], [part~=navigation] section {
110
- display: flex;
111
- flex-flow: row nowrap;
112
- }
113
- [part~=navigation] {
114
- justify-content: space-between;
115
- }
116
- [part~=navigation] > div {
117
- display: flex;
118
- flex: 1;
119
- justify-content: center;
120
- }
121
- [part~=cell-content] {
122
- position: absolute;
123
- top: 0;
124
- bottom: 0;
125
- left: 0;
126
- right: 0;
127
- display: flex;
128
- align-items: center;
129
- justify-content: center;
130
- }
131
- [part=navigation] [part] {
132
- flex: none;
133
- }
134
- [part=table] {
135
- width: 100%;
136
- }
137
- [part~=row] {
138
- display: flex;
139
- width: 100%;
140
- }
141
- [part~=cell] {
142
- position: relative;
143
- }
144
- [part~=cell][part~=year] {
145
- width: calc(100% / ${YEAR_VIEW.columnCount});
146
- padding-top: calc(100% / ${YEAR_VIEW.columnCount});
147
- }
148
- [part~=cell][part~=month] {
149
- width: calc(100% / ${MONTH_VIEW.columnCount});
150
- padding-top: calc(100% / ${MONTH_VIEW.columnCount});
151
- }
152
- [part~=cell][part~=day], [part~=cell][part~=day-name] {
153
- width: calc(100% / ${DAY_VIEW.columnCount});
154
- padding-top: calc(100% / ${DAY_VIEW.columnCount});
155
- }
156
- [part~=cell-content]:not([tabindex]) {
157
- pointer-events: none;
158
- }
159
- [part~=selection] {
160
- cursor: pointer;
161
- }
162
- `;
163
- }
164
- /**
165
- * Set minimum date
166
- * @param min min date
167
- * @default -
168
- */
169
- set min(min) {
170
- const oldMin = this._min;
171
- if (!this.isValidValue(min)) {
172
- this.warnInvalidValue(min);
173
- min = '';
174
- }
175
- if (oldMin !== min) {
176
- this._min = min;
177
- this.requestUpdate('min', oldMin);
178
- }
179
- }
180
- get min() {
181
- return this._min;
182
- }
183
- /**
184
- * Set maximum date
185
- * @param max max date
186
- * @default -
187
- */
188
- set max(max) {
189
- const oldMax = this._max;
190
- if (!this.isValidValue(max)) {
191
- this.warnInvalidValue(max);
192
- max = '';
193
- }
194
- if (oldMax !== max) {
195
- this._max = max;
196
- this.requestUpdate('max', oldMax);
197
- }
198
- }
199
- get max() {
200
- return this._max;
201
- }
202
- /**
203
- * Current calendar view date
204
- * @param view view date
205
- * @default -
206
- */
207
- set view(view) {
208
- if (view && !isValidDate(view, DateFormat.yyyyMM)) {
209
- this.warnInvalidView(view);
210
- view = '';
211
- }
212
- const oldView = this._view;
213
- if (oldView !== view) {
214
- this._view = view;
215
- this.resetActiveCellIndex();
216
- this.requestUpdate('view', oldView);
217
- }
218
- }
219
- get view() {
220
- /* as soon as user interaction has happened, always rely on view */
221
- return this._view || (this.value ? utcFormat(toDateSegment(this.value), DateFormat.yyyyMM) : format(new Date(), DateFormat.yyyyMM));
222
- }
223
- /**
224
- * Set the first day of the week.
225
- * 0 - for Sunday, 6 - for Saturday
226
- * @param firstDayOfWeek The first day of the week
227
- * @type {number | null}
228
- * @default null
229
- */
230
- set firstDayOfWeek(firstDayOfWeek) {
231
- firstDayOfWeek %= 7;
232
- const oldFirstDayOfWeek = this._firstDayOfWeek;
233
- if (oldFirstDayOfWeek !== firstDayOfWeek) {
234
- this._firstDayOfWeek = firstDayOfWeek;
235
- this.requestUpdate('firstDayOfWeek', oldFirstDayOfWeek);
236
- }
237
- }
238
- get firstDayOfWeek() {
239
- return this._firstDayOfWeek === null ? this.localFirstDayOfWeek : this._firstDayOfWeek;
240
- }
241
- /**
242
- * Current date time value
243
- * @param value Calendar value
244
- * @default -
245
- */
246
- set value(value) {
247
- this.values = [value];
248
- }
249
- get value() {
250
- return this.values[0] || '';
251
- }
252
- /**
253
- * Set multiple selected values
254
- * @param values Values to set
255
- * @type {string[]}
256
- * @default []
257
- */
258
- set values(values) {
259
- const oldValues = this._values;
260
- const newValues = this.filterAndWarnInvalidValues(values);
261
- if (oldValues.toString() !== newValues.toString()) {
262
- this._values = newValues;
263
- this.requestUpdate('values', oldValues);
264
- }
265
- }
266
- get values() {
267
- return this._values.concat();
268
- }
269
- get renderView() {
270
- return this._renderView;
271
- }
272
- set renderView(renderView) {
273
- const oldRenderView = this._renderView;
274
- if (oldRenderView !== renderView) {
275
- this._renderView = renderView;
276
- // always reset active cell to not focus on potentially invalid cell
277
- this.resetActiveCellIndex();
278
- this.requestUpdate('renderView', oldRenderView);
279
- }
280
- }
281
- get activeCellIndex() {
282
- return this._activeCellIndex;
283
- }
284
- set activeCellIndex(activeCellIndex) {
285
- const oldCellIndex = this._activeCellIndex;
286
- if (String(activeCellIndex) !== String(oldCellIndex)) {
287
- this._activeCellIndex = activeCellIndex;
288
- this.requestUpdate('activeCellIndex', oldCellIndex);
289
- }
290
- }
291
- /**
292
- * Silently reset cell index without calling request update
293
- * @returns {void}
294
- */
295
- resetActiveCellIndex() {
296
- this._activeCellIndex = null;
297
- }
298
- /**
299
- * Get an active element
300
- */
301
- get activeElement() {
302
- return this.shadowRoot.activeElement;
303
- }
304
- /**
305
- * Get selectable date button element by index
306
- * @param index Cell index
307
- * @returns button HTML date button element or null
308
- */
309
- getDateButtonByIndex(index) {
310
- const elements = Array.from(this.renderRoot.querySelectorAll('[part~=cell] > [part~=selection]'));
311
- return elements.find((element) => this.isDateButton(element) && String(element.index) === String(index));
312
- }
313
- /**
314
- * Get active date button element
315
- * @returns button HTML date button element or null
316
- */
317
- get activeDateButton() {
318
- return this.renderRoot.querySelector('[part~=cell][active] > [part~=selection]');
319
- }
320
- /**
321
- * Return true if passed target is HTML
322
- * date button element that can be selected
323
- * @param target Target to check
324
- * @returns isDateButtonElement
325
- */
326
- isDateButton(target) {
327
- return target.index !== undefined;
328
- }
329
- static get observedAttributes() {
330
- const observed = super.observedAttributes;
331
- return ['role'].concat(observed);
332
- }
333
- attributeChangedCallback(name, oldValue, newValue) {
334
- super.attributeChangedCallback(name, oldValue, newValue);
335
- if (name === 'role') {
336
- this.announceValues = !(!newValue || newValue === 'none' || newValue === 'presentation');
337
- }
338
- }
339
- /**
340
- * Perform asynchronous update
341
- * @returns promise
342
- */
343
- async performUpdate() {
344
- const localFirstDayOfWeek = Number(await this.dateTPromise('FIRST_DAY_OF_WEEK'));
345
- this.localFirstDayOfWeek = isNaN(localFirstDayOfWeek) ? FIRST_DAY_OF_WEEK : (localFirstDayOfWeek % 7);
346
- void super.performUpdate();
347
- }
348
- /**
349
- * Updates the element
350
- * @param changedProperties Properties that has changed
351
- * @returns {void}
352
- */
353
- update(changedProperties) {
354
- if (!this.localMonthsNames || changedProperties.has(TranslatePropertyKey)) {
355
- const locale = getLocale(this);
356
- this.localMonthsNames = monthsNames(locale);
357
- }
358
- if (!this.localWeekdaysNames || changedProperties.has(TranslatePropertyKey)) {
359
- const locale = getLocale(this);
360
- const longWeekdaysNames = weekdaysNames(locale, 'long');
361
- this.localWeekdaysNames = weekdaysNames(locale).map((narrow, index) => {
362
- return { narrow, long: longWeekdaysNames[index] };
363
- });
364
- }
365
- this.shouldConstructFilters(changedProperties) && this.constructFilters();
366
- super.update(changedProperties);
367
- }
368
- /**
369
- * Called after render life-cycle finished
370
- * @param changedProperties Properties which have changed
371
- * @return {void}
372
- */
373
- updated(changedProperties) {
374
- super.updated(changedProperties);
375
- // This code is here to ensure that focus is not lost
376
- // while navigating through the render views using keyboard
377
- if (this.focused && changedProperties.has('renderView') && this.viewBtnRef.value && this.activeElement !== this.viewBtnRef.value) {
378
- this.viewBtnRef.value.focus();
379
- }
380
- const cellIndex = this.activeCellIndex;
381
- if (cellIndex && changedProperties.has('activeCellIndex')) {
382
- const dateButtonEl = this.getDateButtonByIndex(cellIndex);
383
- if (dateButtonEl && this.activeElement !== dateButtonEl) {
384
- dateButtonEl.focus();
385
- }
386
- }
387
- }
388
- /**
389
- * Run when an element has been first updated
390
- * @param changedProperties properties that was changed on first update
391
- * @returns {void}
392
- */
393
- firstUpdated(changedProperties) {
394
- super.firstUpdated(changedProperties);
395
- this.renderRoot.addEventListener('keydown', event => this.onKeyDown(event));
396
- }
397
- /**
398
- * Show invalid view message
399
- * @param value Invalid value
400
- * @returns {void}
401
- */
402
- warnInvalidView(value) {
403
- new WarningNotice(`The specified value "${value}" does not conform to the required format. The format is "yyyy-MM".`).once();
404
- }
405
- /**
406
- * Show invalid value message
407
- * @param value Invalid value
408
- * @returns {void}
409
- */
410
- warnInvalidValue(value) {
411
- new WarningNotice(`The specified value "${value}" does not conform to the required format. The format is "yyyy-MM-dd".`).once();
412
- }
413
- /**
414
- * Validate that the value confirms the control type
415
- * @param value Value to check
416
- * @returns false if value is invalid
417
- */
418
- isValidValue(value) {
419
- return value === '' || isValidDate(value);
420
- }
421
- /**
422
- * A helper method to make sure that only valid values are passed
423
- * Warn if passed value is invalid
424
- * @param values Values to check
425
- * @returns Filtered collection of values
426
- */
427
- filterAndWarnInvalidValues(values) {
428
- const filtered = [];
429
- values.forEach(value => {
430
- if (this.isValidValue(value)) {
431
- value && filtered.push(value);
432
- }
433
- else {
434
- this.warnInvalidValue(value);
435
- }
436
- });
437
- return filtered;
438
- }
439
- /**
440
- * Check if there is a need to reconstruct filters
441
- * @param changedProperties properties that was changed on first update
442
- * @returns true if filter needs to be constructed
443
- */
444
- shouldConstructFilters(changedProperties) {
445
- return changedProperties.has('min')
446
- || changedProperties.has('max')
447
- || changedProperties.has('weekdaysOnly')
448
- || changedProperties.has('weekendsOnly')
449
- || changedProperties.has('filter');
450
- }
451
- /**
452
- * Construct and store a collection of filters
453
- * First always comes default filters and last custom filters
454
- * @returns {void}
455
- */
456
- constructFilters() {
457
- const filters = [];
458
- this.min && filters.push(date => isSameDay(date, this.min) || isAfter(date, this.min));
459
- this.max && filters.push(date => isSameDay(date, this.max) || isBefore(date, this.max));
460
- if (this.weekdaysOnly) {
461
- filters.push(date => !isWeekend(date));
462
- }
463
- if (this.weekendsOnly) {
464
- filters.push(date => isWeekend(date));
465
- }
466
- if (this.filter) {
467
- filters.push(this.filter);
468
- }
469
- const filtersLength = filters.length;
470
- if (filtersLength) {
471
- this.isDateAvailable = (value) => {
472
- for (let i = 0; i < filtersLength; i += 1) {
473
- if (!filters[i](value)) {
474
- return false;
475
- }
476
- }
477
- return true;
478
- };
479
- }
480
- else {
481
- this.isDateAvailable = null;
482
- }
483
- }
484
- /**
485
- * Check if date cell is selected
486
- * @param value A value to compare
487
- * @param comparator A comparator to check for selection. Can be day, month or year
488
- * @returns true if cell is selected
489
- */
490
- isDateCellSelected(value, comparator) {
491
- const values = this._values;
492
- const valuesLength = values.length;
493
- for (let i = 0; i < valuesLength; i += 1) {
494
- if (comparator(value, values[i])) {
495
- return true;
496
- }
497
- }
498
- return false;
499
- }
500
- /**
501
- * Get cell selection model, which is used to bind values and ranges
502
- * to cell styles
503
- * @param value A value to compare
504
- * @param comparator A comparator to check for selection. Can be day, month or year
505
- * @returns cell selection model
506
- */
507
- getCellSelection(value, comparator) {
508
- const values = this._values;
509
- const selected = this.isDateCellSelected(value, comparator);
510
- const from = values[0];
511
- const to = values[1];
512
- if (!this.range || !from || !to) {
513
- return {
514
- selected
515
- };
516
- }
517
- const rangeFrom = comparator(value, from);
518
- const rangeTo = comparator(value, to);
519
- const range = !rangeFrom && !rangeTo && isAfter(value, from) && isBefore(value, to);
520
- return {
521
- selected,
522
- range,
523
- rangeFrom,
524
- rangeTo
525
- };
526
- }
527
- /**
528
- * Set navigation map based on rows
529
- * @param rows A collection of rows with cells
530
- * @returns {void}
531
- */
532
- setNavigationMap(rows) {
533
- this.navigationGrid = rows.map(row => row.map(cell => cell.value && !cell.disabled ? 1 : 0));
534
- }
535
- /**
536
- * Run when next button is tapped.
537
- * Change current view to next view
538
- * @param event Next view tap event
539
- * @returns {void}
540
- */
541
- onNextTap(event) {
542
- if (!event.defaultPrevented) {
543
- this.toNextView();
544
- }
545
- }
546
- /**
547
- * Run when previous button is tapped.
548
- * Change current view to previous view
549
- * @param event Previous view tap event
550
- * @returns {void}
551
- */
552
- onPreviousTap(event) {
553
- if (!event.defaultPrevented) {
554
- this.toPreviousView();
555
- }
556
- }
557
- /**
558
- * Run when change view button is tapped.
559
- * Switch between views
560
- * @param event Render view tap event
561
- * @returns {void}
562
- */
563
- onRenderViewTap(event) {
564
- if (!event.defaultPrevented) {
565
- this.renderView = this.renderView === RenderView.DAY ? RenderView.YEAR : RenderView.DAY;
566
- }
567
- }
568
- /**
569
- * Run when key down event happens on calendar
570
- * @param event Keyboard event
571
- * @returns {void}
572
- */
573
- onKeyDown(event) {
574
- if (event.defaultPrevented) {
575
- return;
576
- }
577
- switch (event.key) {
578
- case 'Esc':
579
- case 'Escape':
580
- if (this.renderView === RenderView.YEAR || this.renderView === RenderView.MONTH) {
581
- this.renderView = RenderView.DAY;
582
- break;
583
- }
584
- return;
585
- case 'Up': // IE11
586
- case 'ArrowUp':
587
- void this.onNavigation('ArrowUp');
588
- break;
589
- case 'Down':
590
- case 'ArrowDown':
591
- void this.onNavigation('ArrowDown');
592
- break;
593
- case 'Left':
594
- case 'ArrowLeft':
595
- void this.onNavigation('ArrowLeft');
596
- break;
597
- case 'Right':
598
- case 'ArrowRight':
599
- void this.onNavigation('ArrowRight');
600
- break;
601
- case 'Home':
602
- case 'End':
603
- void this.onNavigation(event.key);
604
- break;
605
- default:
606
- return;
607
- }
608
- event.preventDefault();
609
- }
610
- /**
611
- * Run when tap event happens ot table.
612
- * Select the values or switch the view
613
- * @param event Tap event
614
- * @returns {void}
615
- */
616
- onTableTap(event) {
617
- if (event.defaultPrevented) {
618
- return;
619
- }
620
- const cell = event.target;
621
- if (!cell || !this.isDateButton(cell) || !cell.value) {
622
- return;
623
- }
624
- this.activeCellIndex = cell.index;
625
- const cellSegment = toDateSegment(cell.value);
626
- const viewSegment = toDateSegment(this.view);
627
- if (this.renderView === RenderView.YEAR) { /* YEAR -> MONTH */
628
- viewSegment.year = cellSegment.year;
629
- if (this.notifyViewChange(viewSegment)) {
630
- this.renderView = RenderView.MONTH;
631
- }
632
- return;
633
- }
634
- if (this.renderView === RenderView.MONTH) { /* MONTH -> DAY */
635
- viewSegment.year = cellSegment.year;
636
- viewSegment.month = cellSegment.month;
637
- if (this.notifyViewChange(viewSegment)) {
638
- this.renderView = RenderView.DAY;
639
- }
640
- return;
641
- }
642
- this.onTapSelectValue(cell.value);
643
- }
644
- /**
645
- * Navigate over the grid
646
- * @param key Navigation direction
647
- * @returns navigation promise
648
- */
649
- async onNavigation(key) {
650
- const grid = this.navigationGrid;
651
- switch (key) {
652
- case 'Home':
653
- this.activeCellIndex = first(grid);
654
- return;
655
- case 'End':
656
- this.activeCellIndex = last(grid);
657
- return;
658
- // no default
659
- }
660
- // no previously selected cell, but there is cell which is a candidate for navigation
661
- const activeDateEl = this.activeDateButton;
662
- if (!this.activeCellIndex && activeDateEl) {
663
- this.activeCellIndex = activeDateEl.index;
664
- // current cell is already in focus (e.g. via Tab key, continue navigation from that point)
665
- if (!(this.activeElement === activeDateEl)) {
666
- return;
667
- }
668
- }
669
- const activeCellIndex = this.activeCellIndex;
670
- // All cells are disabled
671
- if (!activeCellIndex) {
672
- return;
673
- }
674
- // active cell is selected
675
- if (activeCellIndex) {
676
- let newActiveCell;
677
- switch (key) {
678
- case 'ArrowUp':
679
- newActiveCell = up(grid, activeCellIndex);
680
- break;
681
- case 'ArrowDown':
682
- newActiveCell = down(grid, activeCellIndex);
683
- break;
684
- case 'ArrowLeft':
685
- newActiveCell = left(grid, activeCellIndex);
686
- break;
687
- case 'ArrowRight':
688
- newActiveCell = right(grid, activeCellIndex);
689
- break;
690
- // no default
691
- }
692
- // Standard navigation withing the same view
693
- if (newActiveCell) {
694
- this.activeCellIndex = newActiveCell;
695
- return;
696
- }
697
- }
698
- // Jump to the next view
699
- switch (key) {
700
- // case 'ArrowUp': // it feels better not having Up/Down in these case
701
- case 'ArrowLeft':
702
- this.toPreviousView();
703
- await this.updateComplete; // must wait until the render cycle has finished
704
- await this.onNavigation('End');
705
- break;
706
- // case 'ArrowDown':
707
- case 'ArrowRight':
708
- this.toNextView();
709
- await this.updateComplete;
710
- await this.onNavigation('Home');
711
- break;
712
- // no default
713
- }
714
- }
715
- /**
716
- * Navigate to the next view
717
- * @returns {void}
718
- */
719
- toNextView() {
720
- let viewSegment = toDateSegment(this.view);
721
- switch (this.renderView) {
722
- case RenderView.DAY:
723
- viewSegment = toDateSegment(addMonths(this.view, 1));
724
- break;
725
- case RenderView.MONTH:
726
- viewSegment.year += 1;
727
- break;
728
- case RenderView.YEAR:
729
- viewSegment.year += YEARS_PER_YEAR_VIEW;
730
- break;
731
- // no default
732
- }
733
- this.notifyViewChange(viewSegment);
734
- }
735
- /**
736
- * Navigate to the previous view
737
- * @returns {void}
738
- */
739
- toPreviousView() {
740
- let viewSegment = toDateSegment(this.view);
741
- switch (this.renderView) {
742
- case RenderView.DAY:
743
- viewSegment = toDateSegment(subMonths(this.view, 1));
744
- break;
745
- case RenderView.MONTH:
746
- viewSegment.year -= 1;
747
- break;
748
- case RenderView.YEAR:
749
- viewSegment.year -= YEARS_PER_YEAR_VIEW;
750
- break;
751
- // no default
752
- }
753
- this.notifyViewChange(viewSegment);
754
- }
755
- /**
756
- * Run when tap event happened on DAY view and the cell has the values
757
- * Try to select/deselect cell value
758
- * @param value Date string
759
- * @returns {void}
760
- */
761
- onTapSelectValue(value) {
762
- if (this.readonly || this.disabled) {
763
- return;
764
- }
765
- let values;
766
- if (this.multiple) {
767
- values = this.values.concat([]);
768
- const valueIdx = this.values.indexOf(value);
769
- if (valueIdx === -1) {
770
- values.push(value);
771
- }
772
- else {
773
- values.splice(valueIdx, 1);
774
- }
775
- }
776
- else if (this.range) {
777
- if (!this.values.length) {
778
- values = [value];
779
- }
780
- else if (this.values.length === 1) { /* from is populated */
781
- const from = this.values[0];
782
- const to = value;
783
- if (isAfter(to, from) || isSameDay(to, from)) {
784
- values = [this.values[0], value];
785
- }
786
- else {
787
- values = [value];
788
- }
789
- }
790
- else if (this.values.indexOf(value) === -1) {
791
- values = [value];
792
- }
793
- else {
794
- // remove range if start/end index match
795
- values = [];
796
- }
797
- }
798
- else {
799
- values = this.value === value ? [] : [value];
800
- }
801
- this.notifyValuesChange(values);
802
- }
803
- /**
804
- * Notify that values array has been changed
805
- * @param values A collection of string dates
806
- * @returns {void}
807
- */
808
- notifyValuesChange(values) {
809
- if (this.values.toString() !== values.toString()) {
810
- this.values = values;
811
- this.notifyPropertyChange('value', this.value);
812
- }
813
- }
814
- /**
815
- * Notify that view has been changed
816
- * @param view Date
817
- * @returns {void}
818
- */
819
- notifyViewChange(view) {
820
- const viewString = utcFormat(view, DateFormat.yyyyMM);
821
- const res = this.notifyPropertyChange('view', viewString, true);
822
- if (res) {
823
- this.view = viewString;
824
- }
825
- return res;
826
- }
827
- /**
828
- * Localised format for render view
829
- * @param segment Segment object
830
- * @param includeMonth True to include a month
831
- * @returns template result
832
- */
833
- viewFormattedDate(segment, includeMonth = false) {
834
- const year = segment.year;
835
- const isBC = year <= 0;
836
- const includeEra = isBC;
837
- const date = utcParse(segment);
838
- // Unfortunately IE11 does not support date formatting for year <= 0
839
- // Do manual conversion instead
840
- if (isIE && isBC) {
841
- return html `${formatLocaleDate(date, getLocale(this), includeMonth, includeEra)}`;
842
- }
843
- return html `${this.dateT('VIEW_FORMAT', { date, includeMonth, includeEra }, ViewFormatTranslateParams)}`;
844
- }
845
- /**
846
- * Get a string representation of current view
847
- * @returns template result
848
- */
849
- get formattedViewRender() {
850
- const segment = toDateSegment(this.view);
851
- switch (this.renderView) {
852
- case RenderView.MONTH:
853
- return this.viewFormattedDate(segment);
854
- case RenderView.YEAR:
855
- const month = segment.month;
856
- const day = segment.day;
857
- const fromYear = Math.floor(segment.year / YEARS_PER_YEAR_VIEW) * YEARS_PER_YEAR_VIEW;
858
- const toYear = fromYear + YEARS_PER_YEAR_VIEW - 1;
859
- return html `${this.viewFormattedDate({ year: fromYear, month, day })} - ${this.viewFormattedDate({ year: toYear, month, day })}`;
860
- case RenderView.DAY:
861
- default:
862
- return this.viewFormattedDate(segment, true);
863
- }
864
- }
865
- /**
866
- * Set an active state of the cell based
867
- * @param rows A collection of rows with cells
868
- * @returns {void}
869
- */
870
- setActiveCell(rows) {
871
- const setActive = (cell) => {
872
- if (cell) {
873
- cell.active = true;
874
- }
875
- };
876
- const columnIdx = this.activeCellIndex ? this.activeCellIndex[0] : NaN;
877
- const rowIdx = this.activeCellIndex ? this.activeCellIndex[1] : NaN;
878
- // Selected cell is active or today cell or first available cell
879
- let activeCell;
880
- let nowCell;
881
- let firstCell;
882
- let selectedCell;
883
- for (let i = 0; i < rows.length; i += 1) {
884
- const row = rows[i];
885
- for (let e = 0; e < row.length; e += 1) {
886
- const cell = row[e];
887
- if (cell.disabled || !cell.value) {
888
- continue;
889
- }
890
- if (i === rowIdx && e === columnIdx) {
891
- activeCell = cell;
892
- }
893
- if (!selectedCell && cell.selected) {
894
- selectedCell = cell;
895
- }
896
- if (cell.now) {
897
- nowCell = cell;
898
- }
899
- if (!firstCell) {
900
- firstCell = cell;
901
- }
902
- }
903
- }
904
- // If a cell that was active before last render is not available now, remove index
905
- if (!activeCell && this.activeCellIndex) {
906
- this.resetActiveCellIndex(); // set on private to not cause another re-render
907
- }
908
- setActive(activeCell || selectedCell || nowCell || firstCell);
909
- }
910
- /**
911
- * Get year view template
912
- */
913
- get yearView() {
914
- const view = RenderView.YEAR;
915
- const currentYear = toDateSegment(this.view).year;
916
- const startIdx = Math.floor(currentYear / YEARS_PER_YEAR_VIEW) * YEARS_PER_YEAR_VIEW;
917
- const years = [];
918
- const rows = [];
919
- let cells = [];
920
- let cell;
921
- for (let i = 0; i < YEAR_VIEW.totalCount; i += 1) {
922
- if (i % YEAR_VIEW.columnCount === 0) {
923
- cells = [];
924
- rows.push(cells);
925
- }
926
- const year = startIdx + i;
927
- const value = utcFormat({ year, month: 0, day: 1 }, DateFormat.yyyyMMdd);
928
- cell = Object.assign({ view, text: year > 0 ? `${year}` : year === 0 ? '1' : `${Math.abs(year - 1)}`, value: `${year}`, now: isThisYear(value), index: [cells.length, rows.length - 1] }, this.getCellSelection(value, isSameYear));
929
- cells.push(cell);
930
- years.push(cell);
931
- }
932
- years[0].firstDate = true;
933
- years[years.length - 1].lastDate = true;
934
- this.setActiveCell(rows);
935
- this.setNavigationMap(rows);
936
- return html `${this.renderRows(rows)}`;
937
- }
938
- /**
939
- * Get month view template
940
- */
941
- get monthView() {
942
- const view = RenderView.MONTH;
943
- const currentYear = toDateSegment(this.view).year;
944
- const columnCount = MONTH_VIEW.columnCount;
945
- const monthCount = 12;
946
- const totalCount = MONTH_VIEW.totalCount;
947
- const monthsNames = this.localMonthsNames;
948
- const before = (totalCount - monthCount) / 2;
949
- const startIdx = monthCount - before % monthCount;
950
- const after = before + monthCount;
951
- const months = [];
952
- const rows = [];
953
- let cell;
954
- let cells = [];
955
- for (let i = 0; i < totalCount; i += 1) {
956
- if (i % columnCount === 0) {
957
- cells = [];
958
- rows.push(cells);
959
- }
960
- const month = (startIdx + i) % monthCount; /* 0 for Jan, 11 for Dev */
961
- const year = currentYear + Math.floor((i - before) / monthCount);
962
- const segment = { year, month, day: 1 };
963
- const value = utcFormat(segment, DateFormat.yyyyMMdd);
964
- const idle = i < before || i >= after;
965
- cell = Object.assign({ view, text: monthsNames[month], value: utcFormat(segment, DateFormat.yyyyMM), idle, now: isThisMonth(value), index: [cells.length, rows.length - 1] }, this.getCellSelection(value, isSameMonth));
966
- cells.push(cell);
967
- months.push(cell);
968
- }
969
- months[0].firstDate = true;
970
- months[months.length - 1].lastDate = true;
971
- this.setActiveCell(rows);
972
- this.setNavigationMap(rows);
973
- return html `${this.renderRows(rows)}`;
974
- }
975
- /**
976
- * Get day view template
977
- */
978
- get dayView() {
979
- const view = RenderView.DAY;
980
- const firstDayOfWeek = this.firstDayOfWeek;
981
- const padding = (7 + utcParse(this.view).getUTCDay() - firstDayOfWeek) % 7;
982
- const viewMonth = monthInfo(this.view);
983
- const prevMonth = monthInfo(subMonths(this.view, 1));
984
- const nextMonth = monthInfo(addMonths(this.view, 1));
985
- const days = [];
986
- const rows = [];
987
- let cells = [];
988
- let day;
989
- let month;
990
- let year;
991
- // Generate new cells.
992
- for (let i = 0; i < DAY_VIEW.totalCount; i += 1) {
993
- if (i % DAY_VIEW.columnCount === 0) {
994
- cells = [];
995
- rows.push(cells);
996
- }
997
- const datePadding = i - padding + 1;
998
- if (datePadding <= 0) {
999
- if (!this.fillCells) {
1000
- cells.push({
1001
- view,
1002
- index: [cells.length, rows.length - 1]
1003
- });
1004
- continue;
1005
- }
1006
- day = prevMonth.days + datePadding;
1007
- month = prevMonth.month;
1008
- year = prevMonth.year;
1009
- }
1010
- else if (datePadding > viewMonth.days) {
1011
- if (!this.fillCells) {
1012
- cells.push({
1013
- view,
1014
- index: [cells.length, rows.length - 1]
1015
- });
1016
- continue;
1017
- }
1018
- day = datePadding - viewMonth.days;
1019
- month = nextMonth.month;
1020
- year = nextMonth.year;
1021
- }
1022
- else {
1023
- day = datePadding;
1024
- month = viewMonth.month;
1025
- year = viewMonth.year;
1026
- }
1027
- const value = utcFormat({ year, month, day }, DateFormat.yyyyMMdd);
1028
- const disabled = this.isDateAvailable ? !this.isDateAvailable(value) : false;
1029
- const dayCell = Object.assign({ view, text: day.toString(), value,
1030
- disabled, idle: month !== viewMonth.month || year !== viewMonth.year, now: isToday(value), index: [cells.length, rows.length - 1] }, this.getCellSelection(value, isSameDay));
1031
- cells.push(dayCell);
1032
- days.push(dayCell);
1033
- }
1034
- days[0].firstDate = true;
1035
- days[days.length - 1].lastDate = true;
1036
- this.setActiveCell(rows);
1037
- this.setNavigationMap(rows);
1038
- return html `
1039
- ${guard([this.firstDayOfWeek, this.lang], () => this.renderWeekdayNames)}
1040
- ${this.renderRows(rows)}
1041
- `;
1042
- }
1043
- /**
1044
- * Get weekday names template
1045
- */
1046
- get renderWeekdayNames() {
1047
- const firstDayOfWeek = this.firstDayOfWeek;
1048
- const weekdaysNames = this.localWeekdaysNames.slice(firstDayOfWeek).concat(this.localWeekdaysNames.slice(0, firstDayOfWeek));
1049
- return html `
1050
- <div role="row"
1051
- part="row day-name-row">${weekdaysNames.map(day => html `
1052
- <div scope="col" role="columnheader" part="cell day-name" abbr="${day.long}">
1053
- <div part="cell-content">${day.narrow}</div>
1054
- </div>
1055
- `)}</div>`;
1056
- }
1057
- /**
1058
- * Render a view based on the current render view
1059
- */
1060
- get viewRender() {
1061
- let renderView;
1062
- switch (this.renderView) {
1063
- case RenderView.MONTH:
1064
- renderView = this.monthView;
1065
- break;
1066
- case RenderView.YEAR:
1067
- renderView = this.yearView;
1068
- break;
1069
- case RenderView.DAY:
1070
- default:
1071
- renderView = this.dayView;
1072
- }
1073
- return html `${cache(renderView)}`;
1074
- }
1075
- /**
1076
- * Get cell translate label key based on selected state
1077
- * @param cell Cell
1078
- * @returns key Translate label key
1079
- */
1080
- getCellLabelKey(cell) {
1081
- if (cell.selected && cell.now) {
1082
- return 'SELECTED_NOW';
1083
- }
1084
- if (cell.selected) {
1085
- return 'SELECTED';
1086
- }
1087
- if (cell.now) {
1088
- return 'NOW';
1089
- }
1090
- return 'CELL_LABEL';
1091
- }
1092
- /**
1093
- * Render cell template. Cell can be a day, month or year
1094
- * @param cell Cell object
1095
- * @returns template result
1096
- */
1097
- renderCell(cell) {
1098
- const isSelectable = cell.value !== undefined && !cell.disabled;
1099
- return html `<div
1100
- role="gridcell"
1101
- part="cell ${cell.view}"
1102
- aria-selected="${ifDefined(isSelectable ? (cell.selected ? 'true' : 'false') : undefined)}"
1103
- ?active=${cell.active}
1104
- ?disabled=${cell.disabled}
1105
- ?idle=${cell.idle}
1106
- ?today=${cell.now}
1107
- ?first-date=${cell.firstDate}
1108
- ?last-date=${cell.lastDate}
1109
- ?selected=${cell.selected}
1110
- ?range=${cell.range}
1111
- ?range-from=${cell.rangeFrom}
1112
- ?range-to=${cell.rangeTo}>
1113
- <div role="${ifDefined(cell.value ? 'button' : undefined)}"
1114
- tabindex=${ifDefined(isSelectable ? (cell.active ? 0 : -1) : undefined)}
1115
- aria-label="${ifDefined(isSelectable && !isIE ? this.t(this.getCellLabelKey(cell), {
1116
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1117
- value: parse(cell.value),
1118
- view: this.renderView
1119
- }) : undefined)}"
1120
- part="cell-content${isSelectable ? ' selection' : ''}"
1121
- .value=${cell.value}
1122
- .index=${cell.index}>${cell.text}</div>
1123
- </div>`;
1124
- }
1125
- /**
1126
- * Render view rows
1127
- * @param rows A collection of rows with cells
1128
- * @returns template result
1129
- */
1130
- renderRows(rows) {
1131
- return rows.map(row => html `<div role="row" part="row">${row.map(cell => this.renderCell(cell))}</div>`);
1132
- }
1133
- /**
1134
- * Render button navigation template
1135
- * @returns template result
1136
- */
1137
- get buttonNavigationTemplate() {
1138
- let prevBtnAriaLabel = this.t('PREVIOUS_MONTH');
1139
- let nextBtnAriaLabel = this.t('NEXT_MONTH');
1140
- let viewBtnAriaLabel = this.t('YEAR_SELECTOR');
1141
- switch (this.renderView) {
1142
- case RenderView.YEAR:
1143
- prevBtnAriaLabel = this.t('PREVIOUS_DECADE');
1144
- nextBtnAriaLabel = this.t('NEXT_DECADE');
1145
- viewBtnAriaLabel = this.t('DATE_SELECTOR');
1146
- break;
1147
- case RenderView.MONTH:
1148
- prevBtnAriaLabel = this.t('PREVIOUS_YEAR');
1149
- nextBtnAriaLabel = this.t('NEXT_YEAR');
1150
- viewBtnAriaLabel = this.t('DATE_SELECTOR');
1151
- break;
1152
- // RenderView.DAY
1153
- // no default
1154
- }
1155
- return html `<div part="navigation">
1156
- <ef-button
1157
- part="btn-prev"
1158
- aria-label="${prevBtnAriaLabel}"
1159
- icon="left"
1160
- @tap=${this.onPreviousTap}></ef-button>
1161
- <ef-button
1162
- ${ref(this.viewBtnRef)}
1163
- aria-description="${viewBtnAriaLabel}"
1164
- part="btn-view"
1165
- textpos="before"
1166
- .icon="${this.renderView === RenderView.DAY ? 'down' : 'up'}"
1167
- @tap="${this.onRenderViewTap}">${this.formattedViewRender}</ef-button>
1168
- <ef-button
1169
- part="btn-next"
1170
- aria-label="${nextBtnAriaLabel}"
1171
- icon="right"
1172
- @tap=${this.onNextTap}></ef-button>
1173
- </div>`;
1174
- }
1175
- /**
1176
- * A template used to notify currently selected value for screen readers
1177
- * @returns template result
1178
- */
1179
- get selectionTemplate() {
1180
- if (isIE || !this.announceValues) { /* IE11 has significant performance complications */
1181
- return;
1182
- }
1183
- return html `<div
1184
- part="aria-selection"
1185
- aria-live="polite"
1186
- aria-label="${this.value
1187
- ? this.range
1188
- ? this.t('SELECTED_RANGE', { from: parse(this.values[0]), to: this.values[1] ? parse(this.values[1]) : null })
1189
- : this.t('SELECTED_DATE', { value: parse(this.value), count: this.values.length })
1190
- : this.t('SELECTED_NONE', { multiple: this.multiple, range: this.range })}"></div>`;
1191
- }
1192
- /**
1193
- * A `TemplateResult` that will be used
1194
- * to render the updated internal template.
1195
- * @return Render template
1196
- */
1197
- render() {
1198
- return html `
1199
- ${guard([this.values, this.lang, this.range, this.multiple, this.announceValues], () => this.selectionTemplate)}
1200
- ${guard([this.view, this.renderView, this.lang], () => this.buttonNavigationTemplate)}
1201
- <div role="grid"
1202
- aria-multiselectable="${this.range || this.multiple}"
1203
- part="table"
1204
- @tap=${this.onTableTap}>${this.viewRender}</div>
1205
- <div part="footer"><slot name="footer"></slot></div>
1206
- `;
1207
- }
1208
- };
1209
- __decorate([
1210
- property({ type: String })
1211
- ], Calendar.prototype, "min", null);
1212
- __decorate([
1213
- property({ type: String })
1214
- ], Calendar.prototype, "max", null);
1215
- __decorate([
1216
- property({ type: Boolean, attribute: 'weekdays-only' })
1217
- ], Calendar.prototype, "weekdaysOnly", void 0);
1218
- __decorate([
1219
- property({ type: Boolean, attribute: 'weekends-only' })
1220
- ], Calendar.prototype, "weekendsOnly", void 0);
1221
- __decorate([
1222
- property({ attribute: false })
1223
- ], Calendar.prototype, "filter", void 0);
1224
- __decorate([
1225
- property({ type: String })
1226
- ], Calendar.prototype, "view", null);
1227
- __decorate([
1228
- property({ type: Number, attribute: 'first-day-of-week' })
1229
- ], Calendar.prototype, "firstDayOfWeek", null);
1230
- __decorate([
1231
- property({ type: Boolean, reflect: true })
1232
- ], Calendar.prototype, "range", void 0);
1233
- __decorate([
1234
- property({ type: Boolean, reflect: true })
1235
- ], Calendar.prototype, "multiple", void 0);
1236
- __decorate([
1237
- property({ type: String })
1238
- ], Calendar.prototype, "value", null);
1239
- __decorate([
1240
- property({
1241
- converter: {
1242
- fromAttribute: function (value) {
1243
- return value.split(',');
1244
- }
1245
- }
1246
- })
1247
- ], Calendar.prototype, "values", null);
1248
- __decorate([
1249
- property({ type: Boolean, attribute: 'fill-cells' })
1250
- ], Calendar.prototype, "fillCells", void 0);
1251
- __decorate([
1252
- translate({ mode: 'directive', scope: CalendarLocaleScope })
1253
- ], Calendar.prototype, "dateT", void 0);
1254
- __decorate([
1255
- translate({ mode: 'promise', scope: CalendarLocaleScope })
1256
- ], Calendar.prototype, "dateTPromise", void 0);
1257
- __decorate([
1258
- translate({ mode: 'directive', scope: 'ef-calendar' })
1259
- ], Calendar.prototype, "t", void 0);
1260
- __decorate([
1261
- state()
1262
- ], Calendar.prototype, "renderView", null);
1263
- __decorate([
1264
- state()
1265
- ], Calendar.prototype, "activeCellIndex", null);
1266
- __decorate([
1267
- state()
1268
- ], Calendar.prototype, "announceValues", void 0);
1269
- Calendar = __decorate([
1270
- customElement('ef-calendar', {
1271
- alias: 'coral-calendar'
1272
- })
1273
- ], Calendar);
1274
- export { Calendar };