@vonage/vivid 5.15.1 → 5.17.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 (732) hide show
  1. package/accordion/definition.cjs +7 -207
  2. package/accordion/definition.js +2 -199
  3. package/accordion/index.cjs +4 -4
  4. package/accordion/index.js +93 -127
  5. package/accordion-item/definition.cjs +6 -146
  6. package/accordion-item/definition.js +2 -139
  7. package/accordion-item/index.cjs +1 -1
  8. package/accordion-item/index.js +6 -2
  9. package/action-group/definition.cjs +5 -69
  10. package/action-group/definition.js +1 -62
  11. package/action-group/index.cjs +4 -4
  12. package/action-group/index.js +16 -46
  13. package/alert/definition.cjs +6 -201
  14. package/alert/definition.js +2 -194
  15. package/alert/index.cjs +15 -15
  16. package/alert/index.js +90 -136
  17. package/audio-player/definition.cjs +6 -459
  18. package/audio-player/definition.js +2 -452
  19. package/audio-player/index.cjs +49 -49
  20. package/audio-player/index.js +234 -302
  21. package/avatar/definition.cjs +6 -117
  22. package/avatar/definition.js +2 -110
  23. package/avatar/index.cjs +14 -14
  24. package/avatar/index.js +44 -84
  25. package/badge/definition.cjs +6 -85
  26. package/badge/definition.js +2 -78
  27. package/badge/index.cjs +4 -4
  28. package/badge/index.js +21 -65
  29. package/banner/definition.cjs +6 -160
  30. package/banner/definition.js +2 -153
  31. package/banner/index.cjs +13 -13
  32. package/banner/index.js +76 -109
  33. package/breadcrumb/definition.cjs +5 -97
  34. package/breadcrumb/definition.js +1 -90
  35. package/breadcrumb/index.cjs +4 -4
  36. package/breadcrumb/index.js +33 -59
  37. package/breadcrumb-item/definition.cjs +7 -47
  38. package/breadcrumb-item/definition.js +3 -40
  39. package/breadcrumb-item/index.cjs +5 -5
  40. package/breadcrumb-item/index.js +20 -32
  41. package/bundled/affix.cjs +10 -10
  42. package/bundled/affix.js +44 -57
  43. package/bundled/anchored.cjs +3 -3
  44. package/bundled/anchored.js +47 -65
  45. package/bundled/aria.cjs +1 -1
  46. package/bundled/aria.js +6 -6
  47. package/bundled/attribute-binding-behaviour.cjs +1 -1
  48. package/bundled/attribute-binding-behaviour.js +17 -28
  49. package/bundled/base-color-picker.cjs +10 -10
  50. package/bundled/base-color-picker.js +115 -197
  51. package/bundled/base-progress.cjs +1 -1
  52. package/bundled/base-progress.js +29 -56
  53. package/bundled/breadcrumb-item.cjs +1 -1
  54. package/bundled/breadcrumb-item.js +11 -20
  55. package/bundled/button.cjs +1 -1
  56. package/bundled/button.js +65 -100
  57. package/bundled/calendar-event.cjs +1 -1
  58. package/bundled/calendar-event.js +11 -34
  59. package/bundled/calendar-picker.template.cjs +77 -77
  60. package/bundled/calendar-picker.template.js +2883 -3347
  61. package/bundled/char-count.cjs +7 -7
  62. package/bundled/char-count.js +31 -46
  63. package/bundled/children.cjs +1 -1
  64. package/bundled/children.js +27 -45
  65. package/bundled/class-names.cjs +1 -1
  66. package/bundled/class-names.js +8 -8
  67. package/bundled/data-grid.options.cjs +1 -1
  68. package/bundled/data-grid.options.js +22 -26
  69. package/bundled/decorate.cjs +1 -0
  70. package/bundled/decorate.js +9 -0
  71. package/bundled/definition.cjs +1 -39
  72. package/bundled/definition.js +5 -122
  73. package/bundled/definition10.cjs +18 -72
  74. package/bundled/definition10.js +74 -355
  75. package/bundled/definition11.cjs +10 -12
  76. package/bundled/definition11.js +28 -92
  77. package/bundled/definition12.cjs +72 -18
  78. package/bundled/definition12.js +192 -222
  79. package/bundled/definition13.cjs +20 -10
  80. package/bundled/definition13.js +55 -41
  81. package/bundled/definition14.cjs +5 -1
  82. package/bundled/definition14.js +11 -20
  83. package/bundled/definition15.cjs +19 -5
  84. package/bundled/definition15.js +77 -28
  85. package/bundled/definition16.cjs +12 -29
  86. package/bundled/definition16.js +80 -78
  87. package/bundled/definition17.cjs +17 -17
  88. package/bundled/definition17.js +126 -98
  89. package/bundled/definition18.cjs +87 -13
  90. package/bundled/definition18.js +423 -134
  91. package/bundled/definition19.cjs +5 -87
  92. package/bundled/definition19.js +16 -742
  93. package/bundled/definition2.cjs +8 -8
  94. package/bundled/definition2.js +79 -122
  95. package/bundled/definition20.cjs +26 -16
  96. package/bundled/definition20.js +153 -98
  97. package/bundled/definition21.cjs +29 -5
  98. package/bundled/definition21.js +174 -18
  99. package/bundled/definition22.cjs +38 -23
  100. package/bundled/definition22.js +70 -149
  101. package/bundled/definition3.cjs +1 -29
  102. package/bundled/definition3.js +183 -194
  103. package/bundled/definition4.cjs +24 -6
  104. package/bundled/definition4.js +88 -40
  105. package/bundled/definition5.cjs +30 -1
  106. package/bundled/definition5.js +48 -346
  107. package/bundled/definition6.cjs +28 -30
  108. package/bundled/definition6.js +110 -264
  109. package/bundled/definition7.cjs +6 -30
  110. package/bundled/definition7.js +22 -288
  111. package/bundled/definition8.cjs +13 -18
  112. package/bundled/definition8.js +150 -132
  113. package/bundled/definition9.cjs +12 -14
  114. package/bundled/definition9.js +67 -235
  115. package/bundled/delegates-aria.cjs +1 -1
  116. package/bundled/delegates-aria.js +56 -88
  117. package/bundled/dialog.cjs +1 -0
  118. package/bundled/dialog.js +6 -0
  119. package/bundled/divider.cjs +1 -1
  120. package/bundled/divider.js +16 -33
  121. package/bundled/dom.cjs +1 -1
  122. package/bundled/dom.js +5 -5
  123. package/bundled/enums.cjs +1 -1
  124. package/bundled/enums.js +16 -9
  125. package/bundled/floating-ui.dom.cjs +1 -1
  126. package/bundled/floating-ui.dom.js +953 -1238
  127. package/bundled/form-associated.cjs +1 -1
  128. package/bundled/form-associated.js +165 -318
  129. package/bundled/form-element.cjs +1 -1
  130. package/bundled/form-element.js +33 -55
  131. package/bundled/host-semantics.cjs +1 -1
  132. package/bundled/host-semantics.js +46 -69
  133. package/bundled/key-codes.cjs +1 -1
  134. package/bundled/key-codes.js +4 -16
  135. package/bundled/linkable.cjs +6 -6
  136. package/bundled/linkable.js +25 -45
  137. package/bundled/listbox.cjs +1 -1
  138. package/bundled/listbox.js +176 -351
  139. package/bundled/localized.cjs +1 -1
  140. package/bundled/localized.js +451 -564
  141. package/bundled/mixins.cjs +20 -20
  142. package/bundled/mixins.js +162 -210
  143. package/bundled/normalize.cjs +1 -1
  144. package/bundled/normalize.js +6 -6
  145. package/bundled/numbers.cjs +1 -1
  146. package/bundled/numbers.js +9 -11
  147. package/bundled/picker-field.template.cjs +23 -23
  148. package/bundled/picker-field.template.js +108 -171
  149. package/bundled/playbackRates.cjs +1 -1
  150. package/bundled/playbackRates.js +10 -10
  151. package/bundled/ref.cjs +1 -1
  152. package/bundled/ref.js +10 -14
  153. package/bundled/repeat.cjs +1 -1
  154. package/bundled/repeat.js +421 -552
  155. package/bundled/scrollIntoView.cjs +1 -1
  156. package/bundled/scrollIntoView.js +26 -29
  157. package/bundled/single-date-picker.cjs +1 -1
  158. package/bundled/single-date-picker.js +23 -38
  159. package/bundled/single-value-picker.cjs +1 -1
  160. package/bundled/single-value-picker.js +58 -86
  161. package/bundled/slider.template.cjs +14 -14
  162. package/bundled/slider.template.js +67 -78
  163. package/bundled/slottable-request.cjs +4 -4
  164. package/bundled/slottable-request.js +1907 -2904
  165. package/bundled/slotted.cjs +1 -1
  166. package/bundled/slotted.js +47 -97
  167. package/bundled/strings.cjs +1 -1
  168. package/bundled/strings.js +6 -6
  169. package/bundled/text-field.cjs +1 -1
  170. package/bundled/text-field.js +4 -4
  171. package/bundled/time-selection-picker.template.cjs +26 -26
  172. package/bundled/time-selection-picker.template.js +355 -552
  173. package/bundled/trapped-focus.cjs +1 -1
  174. package/bundled/trapped-focus.js +18 -25
  175. package/bundled/vivid-element.cjs +4 -5
  176. package/bundled/vivid-element.js +1781 -2806
  177. package/bundled/when.cjs +1 -1
  178. package/bundled/when.js +10 -10
  179. package/bundled/with-contextual-help.cjs +1 -1
  180. package/bundled/with-contextual-help.js +15 -31
  181. package/bundled/with-error-text.cjs +1 -1
  182. package/bundled/with-error-text.js +25 -38
  183. package/bundled/with-success-text.cjs +1 -1
  184. package/bundled/with-success-text.js +8 -15
  185. package/button/definition.cjs +6 -14
  186. package/button/definition.js +3 -4
  187. package/button/index.cjs +1 -1
  188. package/button/index.js +6 -2
  189. package/calendar/definition.cjs +5 -358
  190. package/calendar/definition.js +1 -351
  191. package/calendar/index.cjs +20 -20
  192. package/calendar/index.js +165 -427
  193. package/calendar-event/definition.cjs +6 -58
  194. package/calendar-event/definition.js +2 -51
  195. package/calendar-event/index.cjs +7 -7
  196. package/calendar-event/index.js +25 -41
  197. package/card/definition.cjs +6 -194
  198. package/card/definition.js +2 -187
  199. package/card/index.cjs +37 -34
  200. package/card/index.js +83 -133
  201. package/checkbox/definition.cjs +6 -209
  202. package/checkbox/definition.js +2 -202
  203. package/checkbox/index.cjs +1 -1
  204. package/checkbox/index.js +6 -2
  205. package/color-picker/definition.cjs +6 -1175
  206. package/color-picker/definition.js +2 -1168
  207. package/color-picker/index.cjs +94 -94
  208. package/color-picker/index.js +605 -737
  209. package/combobox/definition.cjs +6 -647
  210. package/combobox/definition.js +2 -640
  211. package/combobox/index.cjs +38 -37
  212. package/combobox/index.js +258 -458
  213. package/contextual-help/definition.cjs +6 -63
  214. package/contextual-help/definition.js +2 -56
  215. package/contextual-help/index.cjs +1 -1
  216. package/contextual-help/index.js +6 -2
  217. package/country/definition.cjs +6 -340
  218. package/country/definition.js +2 -333
  219. package/country/index.cjs +6 -6
  220. package/country/index.js +1209 -308
  221. package/custom-elements.json +1247 -1173
  222. package/data-grid/definition.cjs +10 -2350
  223. package/data-grid/definition.js +2 -2339
  224. package/data-grid/index.cjs +65 -65
  225. package/data-grid/index.js +644 -997
  226. package/date-picker/definition.cjs +6 -152
  227. package/date-picker/definition.js +2 -145
  228. package/date-picker/index.cjs +1 -1
  229. package/date-picker/index.js +66 -114
  230. package/date-range-picker/definition.cjs +6 -467
  231. package/date-range-picker/definition.js +2 -460
  232. package/date-range-picker/index.cjs +1 -1
  233. package/date-range-picker/index.js +218 -334
  234. package/date-time-picker/definition.cjs +6 -285
  235. package/date-time-picker/definition.js +2 -278
  236. package/date-time-picker/index.cjs +4 -4
  237. package/date-time-picker/index.js +116 -211
  238. package/dial-pad/definition.cjs +6 -460
  239. package/dial-pad/definition.js +2 -453
  240. package/dial-pad/index.cjs +44 -43
  241. package/dial-pad/index.js +197 -288
  242. package/dialog/definition.cjs +6 -349
  243. package/dialog/definition.js +2 -342
  244. package/dialog/index.cjs +28 -28
  245. package/dialog/index.js +148 -229
  246. package/divider/definition.cjs +6 -42
  247. package/divider/definition.js +2 -35
  248. package/divider/index.cjs +1 -1
  249. package/divider/index.js +5 -2
  250. package/elevation/definition.cjs +4 -11
  251. package/elevation/definition.js +2 -2
  252. package/elevation/index.cjs +1 -1
  253. package/elevation/index.js +5 -2
  254. package/empty-state/definition.cjs +6 -86
  255. package/empty-state/definition.js +2 -79
  256. package/empty-state/index.cjs +9 -9
  257. package/empty-state/index.js +28 -60
  258. package/fab/definition.cjs +6 -105
  259. package/fab/definition.js +2 -98
  260. package/fab/index.cjs +17 -17
  261. package/fab/index.js +46 -81
  262. package/file-picker/definition.cjs +6 -523
  263. package/file-picker/definition.js +2 -516
  264. package/file-picker/index.cjs +32 -29
  265. package/file-picker/index.js +254 -356
  266. package/header/definition.cjs +5 -78
  267. package/header/definition.js +1 -71
  268. package/header/index.cjs +6 -6
  269. package/header/index.js +28 -42
  270. package/icon/definition.cjs +5 -202
  271. package/icon/definition.js +1 -195
  272. package/icon/index.cjs +1 -1
  273. package/icon/index.js +5 -2
  274. package/index.cjs +353 -356
  275. package/index.js +79 -78
  276. package/layout/definition.cjs +5 -72
  277. package/layout/definition.js +1 -65
  278. package/layout/index.cjs +2 -2
  279. package/layout/index.js +10 -51
  280. package/lib/alert/alert.d.ts +0 -1
  281. package/lib/audio-player/audio-player.d.ts +0 -1
  282. package/lib/banner/banner.d.ts +0 -2
  283. package/lib/button/button.d.ts +0 -1
  284. package/lib/calendar/calendar.d.ts +0 -1
  285. package/lib/combobox/combobox.d.ts +0 -3
  286. package/lib/data-grid/data-grid-cell.d.ts +0 -3
  287. package/lib/data-grid/data-grid-row.d.ts +0 -3
  288. package/lib/data-grid/data-grid.d.ts +0 -1
  289. package/lib/date-time-picker/date-time-picker.d.ts +0 -4
  290. package/lib/dial-pad/dial-pad.d.ts +6 -2
  291. package/lib/dialog/dialog.d.ts +0 -1
  292. package/lib/fab/fab.d.ts +0 -1
  293. package/lib/file-picker/file-picker.d.ts +1 -1
  294. package/lib/icon/icon.d.ts +0 -1
  295. package/lib/menu/menu.d.ts +0 -1
  296. package/lib/option/option.d.ts +4 -1
  297. package/lib/pagination/pagination.d.ts +0 -4
  298. package/lib/popover/popover.d.ts +0 -5
  299. package/lib/rich-text-editor/rte/exports.d.ts +1 -0
  300. package/lib/rich-text-editor/rte/features/alignment.d.ts +1 -1
  301. package/lib/rich-text-editor/rte/features/character-count.d.ts +21 -0
  302. package/lib/rich-text-editor/rte/features/font-size-picker.d.ts +1 -1
  303. package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +1 -1
  304. package/lib/rich-text-editor/rte/features/keyboard-shortcuts.d.ts +1 -1
  305. package/lib/rich-text-editor/rte/features/text-color-picker.d.ts +1 -1
  306. package/lib/rich-text-editor/rte/public-interface.d.ts +6 -0
  307. package/lib/searchable-select/option-tag.d.ts +0 -1
  308. package/lib/split-button/split-button.d.ts +0 -2
  309. package/lib/tab/tab.d.ts +0 -2
  310. package/lib/table/definition.d.ts +2 -1
  311. package/lib/table/table-header-cell.d.ts +3 -0
  312. package/lib/table/table-sorting-button.d.ts +415 -0
  313. package/lib/table/table-sorting-button.template.d.ts +3 -0
  314. package/lib/tag/tag.d.ts +0 -2
  315. package/lib/toggletip/toggletip.d.ts +0 -1
  316. package/lib/tree-item/tree-item.d.ts +0 -2
  317. package/lib/tree-view/tree-view.d.ts +0 -1
  318. package/locales/de-DE.cjs +266 -550
  319. package/locales/de-DE.js +264 -548
  320. package/locales/en-GB.cjs +266 -382
  321. package/locales/en-GB.js +264 -380
  322. package/locales/en-US.cjs +266 -550
  323. package/locales/en-US.js +264 -548
  324. package/locales/ja-JP.cjs +266 -549
  325. package/locales/ja-JP.js +264 -547
  326. package/locales/zh-CN.cjs +266 -551
  327. package/locales/zh-CN.js +264 -549
  328. package/menu/definition.cjs +6 -393
  329. package/menu/definition.js +2 -386
  330. package/menu/index.cjs +1 -1
  331. package/menu/index.js +6 -2
  332. package/menu-item/definition.cjs +7 -14
  333. package/menu-item/definition.js +3 -3
  334. package/menu-item/index.cjs +1 -1
  335. package/menu-item/index.js +6 -2
  336. package/nav/definition.cjs +5 -27
  337. package/nav/definition.js +1 -20
  338. package/nav/index.cjs +3 -3
  339. package/nav/index.js +7 -10
  340. package/nav-disclosure/definition.cjs +6 -122
  341. package/nav-disclosure/definition.js +2 -115
  342. package/nav-disclosure/index.cjs +8 -8
  343. package/nav-disclosure/index.js +49 -86
  344. package/nav-item/definition.cjs +6 -79
  345. package/nav-item/definition.js +2 -72
  346. package/nav-item/index.cjs +2 -2
  347. package/nav-item/index.js +33 -58
  348. package/note/definition.cjs +6 -61
  349. package/note/definition.js +2 -54
  350. package/note/index.cjs +5 -5
  351. package/note/index.js +24 -38
  352. package/number-field/definition.cjs +6 -440
  353. package/number-field/definition.js +2 -433
  354. package/number-field/index.cjs +31 -31
  355. package/number-field/index.js +160 -328
  356. package/option/definition.cjs +6 -13
  357. package/option/definition.js +3 -3
  358. package/option/index.cjs +1 -1
  359. package/option/index.js +6 -2
  360. package/package.json +15 -17
  361. package/pagination/definition.cjs +6 -254
  362. package/pagination/definition.js +2 -247
  363. package/pagination/index.cjs +37 -37
  364. package/pagination/index.js +148 -186
  365. package/popover/definition.cjs +6 -356
  366. package/popover/definition.js +2 -349
  367. package/popover/index.cjs +16 -16
  368. package/popover/index.js +161 -239
  369. package/popup/definition.cjs +5 -13
  370. package/popup/definition.js +3 -4
  371. package/popup/index.cjs +1 -1
  372. package/popup/index.js +6 -2
  373. package/progress/definition.cjs +5 -87
  374. package/progress/definition.js +1 -80
  375. package/progress/index.cjs +9 -9
  376. package/progress/index.js +33 -55
  377. package/progress-ring/definition.cjs +5 -95
  378. package/progress-ring/definition.js +1 -88
  379. package/progress-ring/index.cjs +1 -1
  380. package/progress-ring/index.js +5 -2
  381. package/radio/definition.cjs +5 -227
  382. package/radio/definition.js +1 -220
  383. package/radio/index.cjs +1 -1
  384. package/radio/index.js +5 -2
  385. package/radio-group/definition.cjs +6 -361
  386. package/radio-group/definition.js +2 -354
  387. package/radio-group/index.cjs +10 -10
  388. package/radio-group/index.js +160 -242
  389. package/range-slider/definition.cjs +6 -632
  390. package/range-slider/definition.js +2 -625
  391. package/range-slider/index.cjs +41 -41
  392. package/range-slider/index.js +259 -429
  393. package/rich-text-editor/definition.cjs +33 -15694
  394. package/rich-text-editor/definition.js +3 -15662
  395. package/rich-text-editor/index.cjs +18 -18
  396. package/rich-text-editor/index.js +9129 -11475
  397. package/rich-text-view/definition.cjs +5 -171
  398. package/rich-text-view/definition.js +1 -164
  399. package/rich-text-view/index.cjs +1 -1
  400. package/rich-text-view/index.js +68 -102
  401. package/searchable-select/definition.cjs +5 -1401
  402. package/searchable-select/definition.js +2 -1395
  403. package/searchable-select/index.cjs +94 -94
  404. package/searchable-select/index.js +600 -1015
  405. package/select/definition.cjs +6 -1002
  406. package/select/definition.js +2 -995
  407. package/select/index.cjs +1 -1
  408. package/select/index.js +6 -2
  409. package/selectable-box/definition.cjs +6 -174
  410. package/selectable-box/definition.js +2 -167
  411. package/selectable-box/index.cjs +18 -18
  412. package/selectable-box/index.js +66 -127
  413. package/shared/foundation/test-utilities/fixture.d.ts +1 -1
  414. package/shared/patterns/linkable.d.ts +1 -1
  415. package/side-drawer/definition.cjs +5 -130
  416. package/side-drawer/definition.js +1 -123
  417. package/side-drawer/index.cjs +7 -7
  418. package/side-drawer/index.js +47 -89
  419. package/simple-color-picker/definition.cjs +6 -225
  420. package/simple-color-picker/definition.js +2 -218
  421. package/simple-color-picker/index.cjs +15 -15
  422. package/simple-color-picker/index.js +98 -135
  423. package/slider/definition.cjs +6 -499
  424. package/slider/definition.js +2 -492
  425. package/slider/index.cjs +1 -1
  426. package/slider/index.js +6 -2
  427. package/split-button/definition.cjs +6 -176
  428. package/split-button/definition.js +2 -169
  429. package/split-button/index.cjs +15 -15
  430. package/split-button/index.js +74 -135
  431. package/status/definition.cjs +6 -82
  432. package/status/definition.js +2 -75
  433. package/status/index.cjs +7 -7
  434. package/status/index.js +35 -52
  435. package/switch/definition.cjs +6 -148
  436. package/switch/definition.js +2 -141
  437. package/switch/index.cjs +8 -8
  438. package/switch/index.js +48 -92
  439. package/tab/definition.cjs +6 -127
  440. package/tab/definition.js +2 -120
  441. package/tab/index.cjs +1 -1
  442. package/tab/index.js +6 -2
  443. package/tab-panel/definition.cjs +5 -29
  444. package/tab-panel/definition.js +1 -22
  445. package/tab-panel/index.cjs +1 -1
  446. package/tab-panel/index.js +5 -2
  447. package/table/definition.cjs +18 -174
  448. package/table/definition.js +3 -158
  449. package/table/index.cjs +19 -10
  450. package/table/index.js +74 -82
  451. package/tabs/definition.cjs +7 -467
  452. package/tabs/definition.js +2 -459
  453. package/tabs/index.cjs +11 -11
  454. package/tabs/index.js +169 -296
  455. package/tag/definition.cjs +6 -176
  456. package/tag/definition.js +2 -169
  457. package/tag/index.cjs +26 -26
  458. package/tag/index.js +64 -125
  459. package/tag-group/definition.cjs +5 -40
  460. package/tag-group/definition.js +1 -33
  461. package/tag-group/index.cjs +4 -4
  462. package/tag-group/index.js +10 -21
  463. package/text-area/definition.cjs +6 -355
  464. package/text-area/definition.js +2 -348
  465. package/text-area/index.cjs +11 -11
  466. package/text-area/index.js +153 -260
  467. package/text-field/definition.cjs +6 -423
  468. package/text-field/definition.js +2 -416
  469. package/text-field/index.cjs +1 -1
  470. package/text-field/index.js +6 -2
  471. package/time-picker/definition.cjs +7 -43
  472. package/time-picker/definition.js +3 -36
  473. package/time-picker/index.cjs +1 -1
  474. package/time-picker/index.js +24 -29
  475. package/toggletip/definition.cjs +6 -159
  476. package/toggletip/definition.js +2 -152
  477. package/toggletip/index.cjs +1 -1
  478. package/toggletip/index.js +6 -2
  479. package/tooltip/definition.cjs +6 -139
  480. package/tooltip/definition.js +2 -132
  481. package/tooltip/index.cjs +1 -1
  482. package/tooltip/index.js +6 -2
  483. package/tree-item/definition.cjs +6 -13
  484. package/tree-item/definition.js +3 -3
  485. package/tree-item/index.cjs +1 -1
  486. package/tree-item/index.js +6 -2
  487. package/tree-view/definition.cjs +6 -302
  488. package/tree-view/definition.js +2 -295
  489. package/tree-view/index.cjs +11 -11
  490. package/tree-view/index.js +145 -174
  491. package/unbundled/affix.cjs +89 -62
  492. package/unbundled/affix.js +58 -55
  493. package/unbundled/anchored.cjs +87 -94
  494. package/unbundled/anchored.js +74 -90
  495. package/unbundled/attribute-binding-behaviour.cjs +37 -42
  496. package/unbundled/attribute-binding-behaviour.js +31 -40
  497. package/unbundled/base-color-picker.cjs +226 -275
  498. package/unbundled/base-color-picker.js +214 -272
  499. package/unbundled/base-progress.cjs +63 -78
  500. package/unbundled/base-progress.js +57 -76
  501. package/unbundled/breadcrumb-item.cjs +24 -28
  502. package/unbundled/breadcrumb-item.js +18 -26
  503. package/unbundled/button.cjs +115 -166
  504. package/unbundled/button.js +109 -164
  505. package/unbundled/calendar-event.cjs +28 -41
  506. package/unbundled/calendar-event.js +22 -39
  507. package/unbundled/calendar-picker.template.cjs +4967 -792
  508. package/unbundled/calendar-picker.template.js +4907 -781
  509. package/unbundled/char-count.cjs +50 -80
  510. package/unbundled/char-count.js +44 -78
  511. package/unbundled/chunk.cjs +28 -0
  512. package/unbundled/data-grid.options.cjs +80 -29
  513. package/unbundled/data-grid.options.js +51 -23
  514. package/unbundled/decorate.cjs +14 -0
  515. package/unbundled/decorate.js +9 -0
  516. package/unbundled/definition.cjs +42 -405
  517. package/unbundled/definition.js +24 -399
  518. package/unbundled/definition10.cjs +253 -0
  519. package/unbundled/definition10.js +229 -0
  520. package/unbundled/definition11.cjs +397 -0
  521. package/unbundled/definition11.js +379 -0
  522. package/unbundled/definition12.cjs +317 -0
  523. package/unbundled/definition12.js +287 -0
  524. package/unbundled/definition13.cjs +321 -0
  525. package/unbundled/definition13.js +303 -0
  526. package/unbundled/definition14.cjs +406 -0
  527. package/unbundled/definition14.js +388 -0
  528. package/unbundled/definition15.cjs +107 -0
  529. package/unbundled/definition15.js +89 -0
  530. package/unbundled/definition16.cjs +63 -0
  531. package/unbundled/definition16.js +45 -0
  532. package/unbundled/definition17.cjs +151 -0
  533. package/unbundled/definition17.js +133 -0
  534. package/unbundled/definition18.cjs +47 -0
  535. package/unbundled/definition18.js +35 -0
  536. package/unbundled/definition19.cjs +98 -0
  537. package/unbundled/definition19.js +80 -0
  538. package/unbundled/definition2.cjs +180 -220
  539. package/unbundled/definition2.js +162 -215
  540. package/unbundled/definition20.cjs +56 -0
  541. package/unbundled/definition20.js +43 -0
  542. package/unbundled/definition21.cjs +304 -0
  543. package/unbundled/definition21.js +285 -0
  544. package/unbundled/definition22.cjs +179 -0
  545. package/unbundled/definition22.js +161 -0
  546. package/unbundled/definition23.cjs +161 -0
  547. package/unbundled/definition23.js +143 -0
  548. package/unbundled/definition24.cjs +157 -0
  549. package/unbundled/definition24.js +139 -0
  550. package/unbundled/definition25.cjs +75 -0
  551. package/unbundled/definition25.js +57 -0
  552. package/unbundled/definition26.cjs +363 -0
  553. package/unbundled/definition26.js +345 -0
  554. package/unbundled/definition27.cjs +137 -0
  555. package/unbundled/definition27.js +119 -0
  556. package/unbundled/definition28.cjs +538 -0
  557. package/unbundled/definition28.js +520 -0
  558. package/unbundled/definition29.cjs +236 -0
  559. package/unbundled/definition29.js +212 -0
  560. package/unbundled/definition3.cjs +131 -284
  561. package/unbundled/definition3.js +113 -279
  562. package/unbundled/definition30.cjs +559 -0
  563. package/unbundled/definition30.js +541 -0
  564. package/unbundled/definition31.cjs +1265 -0
  565. package/unbundled/definition31.js +1247 -0
  566. package/unbundled/definition32.cjs +1908 -0
  567. package/unbundled/definition32.js +1866 -0
  568. package/unbundled/definition33.cjs +346 -0
  569. package/unbundled/definition33.js +256 -0
  570. package/unbundled/definition34.cjs +46 -0
  571. package/unbundled/definition34.js +33 -0
  572. package/unbundled/definition35.cjs +152 -0
  573. package/unbundled/definition35.js +134 -0
  574. package/unbundled/definition36.cjs +426 -0
  575. package/unbundled/definition36.js +408 -0
  576. package/unbundled/definition37.cjs +247 -0
  577. package/unbundled/definition37.js +229 -0
  578. package/unbundled/definition38.cjs +411 -0
  579. package/unbundled/definition38.js +393 -0
  580. package/unbundled/definition39.cjs +299 -0
  581. package/unbundled/definition39.js +281 -0
  582. package/unbundled/definition4.cjs +186 -205
  583. package/unbundled/definition4.js +162 -200
  584. package/unbundled/definition40.cjs +81 -0
  585. package/unbundled/definition40.js +63 -0
  586. package/unbundled/definition41.cjs +100 -0
  587. package/unbundled/definition41.js +82 -0
  588. package/unbundled/definition42.cjs +468 -0
  589. package/unbundled/definition42.js +450 -0
  590. package/unbundled/definition43.cjs +86 -0
  591. package/unbundled/definition43.js +68 -0
  592. package/unbundled/definition44.cjs +60 -0
  593. package/unbundled/definition44.js +41 -0
  594. package/unbundled/definition45.cjs +124 -0
  595. package/unbundled/definition45.js +106 -0
  596. package/unbundled/definition46.cjs +85 -0
  597. package/unbundled/definition46.js +67 -0
  598. package/unbundled/definition47.cjs +52 -0
  599. package/unbundled/definition47.js +31 -0
  600. package/unbundled/definition48.cjs +69 -0
  601. package/unbundled/definition48.js +51 -0
  602. package/unbundled/definition49.cjs +377 -0
  603. package/unbundled/definition49.js +359 -0
  604. package/unbundled/definition5.cjs +69 -298
  605. package/unbundled/definition5.js +44 -293
  606. package/unbundled/definition50.cjs +246 -0
  607. package/unbundled/definition50.js +228 -0
  608. package/unbundled/definition51.cjs +337 -0
  609. package/unbundled/definition51.js +319 -0
  610. package/unbundled/definition52.cjs +86 -0
  611. package/unbundled/definition52.js +67 -0
  612. package/unbundled/definition53.cjs +193 -0
  613. package/unbundled/definition53.js +174 -0
  614. package/unbundled/definition54.cjs +297 -0
  615. package/unbundled/definition54.js +279 -0
  616. package/unbundled/definition55.cjs +510 -0
  617. package/unbundled/definition55.js +492 -0
  618. package/unbundled/definition56.cjs +3659 -0
  619. package/unbundled/definition56.js +3478 -0
  620. package/unbundled/definition57.cjs +837 -0
  621. package/unbundled/definition57.js +819 -0
  622. package/unbundled/definition58.cjs +147 -0
  623. package/unbundled/definition58.js +129 -0
  624. package/unbundled/definition59.cjs +1081 -0
  625. package/unbundled/definition59.js +1063 -0
  626. package/unbundled/definition6.cjs +88 -56
  627. package/unbundled/definition6.js +69 -52
  628. package/unbundled/definition60.cjs +149 -0
  629. package/unbundled/definition60.js +131 -0
  630. package/unbundled/definition61.cjs +116 -0
  631. package/unbundled/definition61.js +97 -0
  632. package/unbundled/definition62.cjs +213 -0
  633. package/unbundled/definition62.js +195 -0
  634. package/unbundled/definition63.cjs +159 -0
  635. package/unbundled/definition63.js +141 -0
  636. package/unbundled/definition64.cjs +86 -0
  637. package/unbundled/definition64.js +68 -0
  638. package/unbundled/definition65.cjs +126 -0
  639. package/unbundled/definition65.js +107 -0
  640. package/unbundled/definition66.cjs +49 -0
  641. package/unbundled/definition66.js +28 -0
  642. package/unbundled/definition67.cjs +119 -0
  643. package/unbundled/definition67.js +101 -0
  644. package/unbundled/definition68.cjs +374 -0
  645. package/unbundled/definition68.js +349 -0
  646. package/unbundled/definition69.cjs +57 -0
  647. package/unbundled/definition69.js +38 -0
  648. package/unbundled/definition7.cjs +190 -0
  649. package/unbundled/definition7.js +166 -0
  650. package/unbundled/definition70.cjs +155 -0
  651. package/unbundled/definition70.js +137 -0
  652. package/unbundled/definition71.cjs +302 -0
  653. package/unbundled/definition71.js +284 -0
  654. package/unbundled/definition72.cjs +48 -0
  655. package/unbundled/definition72.js +37 -0
  656. package/unbundled/definition73.cjs +171 -0
  657. package/unbundled/definition73.js +147 -0
  658. package/unbundled/definition74.cjs +232 -0
  659. package/unbundled/definition74.js +213 -0
  660. package/unbundled/definition75.cjs +533 -0
  661. package/unbundled/definition75.js +513 -0
  662. package/unbundled/definition8.cjs +63 -0
  663. package/unbundled/definition8.js +44 -0
  664. package/unbundled/definition9.cjs +183 -0
  665. package/unbundled/definition9.js +165 -0
  666. package/unbundled/delegates-aria.cjs +90 -131
  667. package/unbundled/delegates-aria.js +77 -127
  668. package/unbundled/dialog.cjs +15 -0
  669. package/unbundled/dialog.js +10 -0
  670. package/unbundled/divider.cjs +42 -50
  671. package/unbundled/divider.js +30 -47
  672. package/unbundled/enums.cjs +166 -107
  673. package/unbundled/enums.js +95 -94
  674. package/unbundled/form-associated.cjs +408 -463
  675. package/unbundled/form-associated.js +396 -460
  676. package/unbundled/form-element.cjs +74 -83
  677. package/unbundled/form-element.js +68 -81
  678. package/unbundled/host-semantics.cjs +70 -89
  679. package/unbundled/host-semantics.js +57 -85
  680. package/unbundled/key-codes.cjs +16 -10
  681. package/unbundled/key-codes.js +5 -7
  682. package/unbundled/linkable.cjs +35 -56
  683. package/unbundled/linkable.js +27 -52
  684. package/unbundled/listbox.cjs +363 -465
  685. package/unbundled/listbox.js +357 -463
  686. package/unbundled/localized.cjs +79 -74
  687. package/unbundled/localized.js +61 -70
  688. package/unbundled/mixins.cjs +222 -223
  689. package/unbundled/mixins.js +186 -211
  690. package/unbundled/picker-field.template.cjs +188 -217
  691. package/unbundled/picker-field.template.js +165 -208
  692. package/unbundled/playbackRates.cjs +18 -11
  693. package/unbundled/playbackRates.js +13 -9
  694. package/unbundled/scrollIntoView.cjs +38 -43
  695. package/unbundled/scrollIntoView.js +33 -41
  696. package/unbundled/single-date-picker.cjs +48 -45
  697. package/unbundled/single-date-picker.js +43 -43
  698. package/unbundled/single-value-picker.cjs +106 -114
  699. package/unbundled/single-value-picker.js +101 -112
  700. package/unbundled/slider.template.cjs +107 -73
  701. package/unbundled/slider.template.js +67 -62
  702. package/unbundled/slottable-request.cjs +145 -3700
  703. package/unbundled/slottable-request.js +98 -3681
  704. package/unbundled/text-field.cjs +9 -5
  705. package/unbundled/text-field.js +4 -3
  706. package/unbundled/time-selection-picker.template.cjs +611 -755
  707. package/unbundled/time-selection-picker.template.js +554 -742
  708. package/unbundled/trapped-focus.cjs +45 -35
  709. package/unbundled/trapped-focus.js +34 -32
  710. package/unbundled/vivid-element.cjs +281 -274
  711. package/unbundled/vivid-element.js +239 -266
  712. package/unbundled/with-contextual-help.cjs +35 -39
  713. package/unbundled/with-contextual-help.js +29 -37
  714. package/unbundled/with-error-text.cjs +45 -55
  715. package/unbundled/with-error-text.js +39 -53
  716. package/unbundled/with-success-text.cjs +18 -22
  717. package/unbundled/with-success-text.js +12 -20
  718. package/video-player/definition.cjs +5 -69835
  719. package/video-player/definition.js +1 -69828
  720. package/video-player/index.cjs +44 -39
  721. package/video-player/index.js +23517 -35507
  722. package/visually-hidden/definition.cjs +5 -30
  723. package/visually-hidden/definition.js +1 -23
  724. package/visually-hidden/index.cjs +1 -1
  725. package/visually-hidden/index.js +5 -2
  726. package/vivid.api.json +331 -1874
  727. package/bundled/index.cjs +0 -1
  728. package/bundled/index.js +0 -6
  729. package/unbundled/_commonjsHelpers.cjs +0 -40
  730. package/unbundled/_commonjsHelpers.js +0 -36
  731. package/unbundled/index.cjs +0 -11
  732. package/unbundled/index.js +0 -9
@@ -1,2340 +1,3 @@
1
- import { VwcIconElement as Icon, iconDefinition } from '../icon/definition.js';
2
- import { V as VividElement, d as defineVividComponent, c as createRegisterFunction } from '../unbundled/vivid-element.js';
3
- import { VwcVisuallyHiddenElement as VisuallyHidden, visuallyHiddenDefinition } from '../visually-hidden/definition.js';
4
- import { html, attr, observable, RepeatDirective, normalizeBinding, Updates as Updates$1, Observable, nullableNumberConverter, children, elements, slotted, when } from '@microsoft/fast-element';
5
- import { c as commonjsGlobal } from '../unbundled/_commonjsHelpers.js';
6
- import { eventFocusIn, eventFocusOut, eventKeyDown, keyEscape, keyFunction2, keyEnter, keyEnd, keyHome, eventFocus, keyPageDown, keyPageUp, keyArrowDown, keyArrowUp, classNames, keySpace } from '@microsoft/fast-web-utilities';
7
- import { a as DataGridCellTypes, b as DataGridCellSortStates, c as DataGridRowTypes, G as GenerateHeaderOptions, D as DataGridCellRole } from '../unbundled/data-grid.options.js';
8
- import { a as keyArrowRight, k as keyArrowLeft } from '../unbundled/key-codes.js';
9
- import { H as HostSemantics, a as applyHostSemantics } from '../unbundled/host-semantics.js';
10
- import { L as Localized } from '../unbundled/localized.js';
11
-
12
- const dataGridStyles = ":host{display:block}:host([generate-header=sticky]){max-block-size:400px}.base{--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.base{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.base ::-webkit-scrollbar{width:4px}.base ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.base ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.base{position:relative;overflow:auto;block-size:inherit;inline-size:100%;max-block-size:inherit}";
13
-
14
- const dataGridRowStyles = ".base.connotation-cta{--_connotation-color-primary: var(--vvd-data-grid-row-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-data-grid-row-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-data-grid-row-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-firm: var(--vvd-data-grid-row-cta-firm, var(--vvd-color-cta-600));--_connotation-color-faint: var(--vvd-data-grid-row-cta-faint, var(--vvd-color-cta-50));--_connotation-color-soft: var(--vvd-data-grid-row-cta-soft, var(--vvd-color-cta-100));--_connotation-color-pale: var(--vvd-data-grid-row-cta-pale, var(--vvd-color-cta-300));--_connotation-color-dim: var(--vvd-data-grid-row-cta-dim, var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-data-grid-row-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-data-grid-row-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-data-grid-row-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-firm: var(--vvd-data-grid-row-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-data-grid-row-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-data-grid-row-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-pale: var(--vvd-data-grid-row-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-dim: var(--vvd-data-grid-row-accent-dim, var(--vvd-color-neutral-200))}.base{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media(hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media(hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base{display:grid;width:100%;box-sizing:border-box;color:var(--vvd-color-canvas-text)}:host([row-type=sticky-header]) .base{position:sticky;z-index:9;top:0;background:var(--data-grid-row-background, var(--vvd-color-canvas))}:host([row-type=hidden-header]) .base{display:none}:host(:is([selected]):not([row-type*=header])) .base{background-color:var(--_appearance-color-fill)}";
15
-
16
- const dataGridCellStyles = ":host{block-size:100%;min-inline-size:80px}:host(:focus-visible){outline:none}:host([data-fixed]){position:sticky;z-index:5;background:var(--data-grid-cell-background, var(--vvd-color-surface-2dp))}:host([data-fixed]):before{position:absolute;z-index:1;top:0;right:0;width:1px;block-size:100%;box-shadow:4px 0 4px #0000001a,2px 0 2px #0000000d,1px 0 1px #0000000d;content:\"\";pointer-events:none}.base.connotation-cta{--_connotation-color-primary: var(--vvd-data-grid-cell-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-data-grid-cell-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-data-grid-cell-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-firm: var(--vvd-data-grid-cell-cta-firm, var(--vvd-color-cta-600));--_connotation-color-soft: var(--vvd-data-grid-cell-cta-soft, var(--vvd-color-cta-100));--_connotation-color-faint: var(--vvd-data-grid-cell-cta-faint, var(--vvd-color-cta-50));--_connotation-color-pale: var(--vvd-data-grid-cell-cta-pale, var(--vvd-color-cta-300));--_connotation-color-dim: var(--vvd-data-grid-cell-cta-dim, var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-data-grid-cell-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-data-grid-cell-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-data-grid-cell-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-firm: var(--vvd-data-grid-cell-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-soft: var(--vvd-data-grid-cell-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-faint: var(--vvd-data-grid-cell-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-pale: var(--vvd-data-grid-cell-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-dim: var(--vvd-data-grid-cell-accent-dim, var(--vvd-color-neutral-200))}.base{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media(hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media(hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base{display:flex;box-sizing:border-box;align-items:center;border-bottom:1px solid var(--vvd-color-neutral-300);block-size:var(--data-grid-cell-block-size, var(--_data-grid-cell-default-block-size));color:var(--_appearance-color-text);font:var(--vvd-typography-base);min-block-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:13px 14px;padding-inline:12px}:host(:focus-visible) .base{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--focus-stroke-color, var(--vvd-color-cta-500)),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}:host([cell-type=columnheader]) .base{border-color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold);--_data-grid-cell-default-block-size: calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_data-grid-cell-default-white-space: nowrap}:host(:not([cell-type=columnheader])) .base{--_data-grid-cell-default-block-size: 100%;--_data-grid-cell-default-white-space: normal}:host(:is([selected]):not([cell-type=columnheader])) .base{background-color:var(--_appearance-color-fill)}.content{display:flex;overflow:hidden;align-items:center}.content[role=button]{cursor:pointer}slot:not([name]){display:block;overflow:hidden;text-overflow:ellipsis;white-space:var(--data-grid-cell-white-space, var(--_data-grid-cell-default-white-space))}:host(:not([cell-type=columnheader][aria-sort])) slot:not([name]){inline-size:100%}.header-icon{flex-shrink:0;margin-inline-start:16px}slot[name=action-items]{display:flex;flex-shrink:0;align-items:center}.base.has-action-items slot[name=action-items]{margin-inline-start:16px}";
17
-
18
- let kernelMode;
19
- const kernelAttr = "fast-kernel";
20
- try {
21
- if (document.currentScript) {
22
- kernelMode = document.currentScript.getAttribute(kernelAttr);
23
- }
24
- else {
25
- const scripts = document.getElementsByTagName("script");
26
- const currentScript = scripts[scripts.length - 1];
27
- kernelMode = currentScript.getAttribute(kernelAttr);
28
- }
29
- }
30
- catch (e) {
31
- kernelMode = "isolate";
32
- }
33
- let KernelServiceId;
34
- switch (kernelMode) {
35
- case "share": // share the kernel across major versions
36
- KernelServiceId = Object.freeze({
37
- updateQueue: 1,
38
- observable: 2,
39
- contextEvent: 3,
40
- elementRegistry: 4,
41
- });
42
- break;
43
- case "share-v2": // only share the kernel with other v2 instances
44
- KernelServiceId = Object.freeze({
45
- updateQueue: 1.2,
46
- observable: 2.2,
47
- contextEvent: 3.2,
48
- elementRegistry: 4.2,
49
- });
50
- break;
51
- default:
52
- // fully isolate the kernel from all other FAST instances
53
- const postfix = `-${Math.random().toString(36).substring(2, 8)}`;
54
- KernelServiceId = Object.freeze({
55
- updateQueue: `1.2${postfix}`,
56
- observable: `2.2${postfix}`,
57
- contextEvent: `3.2${postfix}`,
58
- elementRegistry: `4.2${postfix}`,
59
- });
60
- break;
61
- }
62
- /**
63
- * Determines whether or not an object is a function.
64
- * @public
65
- */
66
- const isFunction = (object) => typeof object === "function";
67
- /**
68
- * Determines whether or not an object is a string.
69
- * @public
70
- */
71
- const isString = (object) => typeof object === "string";
72
- /**
73
- * A function which does nothing.
74
- * @public
75
- */
76
- const noop = () => void 0;
77
-
78
- var polyfills = {};
79
-
80
- /* eslint-disable @typescript-eslint/ban-ts-comment */
81
-
82
- var hasRequiredPolyfills;
83
-
84
- function requirePolyfills () {
85
- if (hasRequiredPolyfills) return polyfills;
86
- hasRequiredPolyfills = 1;
87
- (function ensureGlobalThis() {
88
- if (typeof globalThis !== "undefined") {
89
- // We're running in a modern environment.
90
- return;
91
- }
92
- // @ts-ignore
93
- if (typeof commonjsGlobal !== "undefined") {
94
- // We're running in NodeJS
95
- // @ts-ignore
96
- commonjsGlobal.globalThis = commonjsGlobal;
97
- }
98
- else if (typeof self !== "undefined") {
99
- self.globalThis = self;
100
- }
101
- else if (typeof window !== "undefined") {
102
- // We're running in the browser's main thread.
103
- window.globalThis = window;
104
- }
105
- else {
106
- // Hopefully we never get here...
107
- // Not all environments allow eval and Function. Use only as a last resort:
108
- // eslint-disable-next-line no-new-func
109
- const result = new Function("return this")();
110
- result.globalThis = result;
111
- }
112
- })();
113
- (function requestIdleCallbackPolyfill() {
114
- if ("requestIdleCallback" in globalThis) {
115
- return;
116
- }
117
- /**
118
- * A polyfill for requestIdleCallback that falls back to setTimeout.
119
- *
120
- * @param callback - The function to call when the browser is idle.
121
- * @param options - Options object that may contain a timeout property.
122
- * @returns An ID that can be used to cancel the callback.
123
- * @public
124
- */
125
- globalThis.requestIdleCallback = function requestIdleCallback(callback, options) {
126
- const start = Date.now();
127
- return setTimeout(() => {
128
- callback({
129
- didTimeout: (options === null || options === void 0 ? void 0 : options.timeout)
130
- ? Date.now() - start >= options.timeout
131
- : false,
132
- timeRemaining: () => 0,
133
- });
134
- }, 1);
135
- };
136
- /**
137
- * A polyfill for cancelIdleCallback that falls back to clearTimeout.
138
- *
139
- * @param id - The ID of the callback to cancel.
140
- * @public
141
- */
142
- globalThis.cancelIdleCallback = function cancelIdleCallback(id) {
143
- clearTimeout(id);
144
- };
145
- })();
146
- return polyfills;
147
- }
148
-
149
- requirePolyfills();
150
-
151
- // ensure FAST global - duplicated debug.ts
152
- const propConfig = {
153
- configurable: false,
154
- enumerable: false,
155
- writable: false,
156
- };
157
- if (globalThis.FAST === void 0) {
158
- Reflect.defineProperty(globalThis, "FAST", Object.assign({ value: Object.create(null) }, propConfig));
159
- }
160
- /**
161
- * The FAST global.
162
- * @public
163
- */
164
- const FAST = globalThis.FAST;
165
- if (FAST.getById === void 0) {
166
- const storage = Object.create(null);
167
- Reflect.defineProperty(FAST, "getById", Object.assign({ value(id, initialize) {
168
- let found = storage[id];
169
- if (found === void 0) {
170
- found = initialize ? (storage[id] = initialize()) : null;
171
- }
172
- return found;
173
- } }, propConfig));
174
- }
175
- if (FAST.error === void 0) {
176
- Object.assign(FAST, {
177
- warn() { },
178
- error(code) {
179
- return new Error(`Error ${code}`);
180
- },
181
- addMessages() { },
182
- });
183
- }
184
- /**
185
- * Creates a function capable of locating metadata associated with a type.
186
- * @returns A metadata locator function.
187
- * @internal
188
- */
189
- function createMetadataLocator() {
190
- const metadataLookup = new WeakMap();
191
- return function (target) {
192
- let metadata = metadataLookup.get(target);
193
- if (metadata === void 0) {
194
- let currentTarget = Reflect.getPrototypeOf(target);
195
- while (metadata === void 0 && currentTarget !== null) {
196
- metadata = metadataLookup.get(currentTarget);
197
- currentTarget = Reflect.getPrototypeOf(currentTarget);
198
- }
199
- metadata = metadata === void 0 ? [] : metadata.slice(0);
200
- metadataLookup.set(target, metadata);
201
- }
202
- return metadata;
203
- };
204
- }
205
- /**
206
- * Makes a type noop for JSON serialization.
207
- * @param type - The type to make noop for JSON serialization.
208
- * @internal
209
- */
210
- function makeSerializationNoop(type) {
211
- type.prototype.toJSON = noop;
212
- }
213
-
214
- const createHTML = html => html;
215
- const fastTrustedType = globalThis.trustedTypes
216
- ? globalThis.trustedTypes.createPolicy("fast-html", { createHTML })
217
- : { createHTML };
218
- let defaultPolicy = Object.freeze({
219
- createHTML(value) {
220
- return fastTrustedType.createHTML(value);
221
- },
222
- protect(tagName, aspect, aspectName, sink) {
223
- return sink;
224
- },
225
- });
226
- const fastPolicy = defaultPolicy;
227
- /**
228
- * Common DOM APIs.
229
- * @public
230
- */
231
- const DOM = Object.freeze({
232
- /**
233
- * Gets the dom policy used by the templating system.
234
- */
235
- get policy() {
236
- return defaultPolicy;
237
- },
238
- /**
239
- * Sets the dom policy used by the templating system.
240
- * @param policy - The policy to set.
241
- * @remarks
242
- * This API can only be called once, for security reasons. It should be
243
- * called by the application developer at the start of their program.
244
- */
245
- setPolicy(value) {
246
- if (defaultPolicy !== fastPolicy) {
247
- throw FAST.error(1201 /* Message.onlySetDOMPolicyOnce */);
248
- }
249
- defaultPolicy = value;
250
- },
251
- /**
252
- * Sets an attribute value on an element.
253
- * @param element - The element to set the attribute value on.
254
- * @param attributeName - The attribute name to set.
255
- * @param value - The value of the attribute to set.
256
- * @remarks
257
- * If the value is `null` or `undefined`, the attribute is removed, otherwise
258
- * it is set to the provided value using the standard `setAttribute` API.
259
- */
260
- setAttribute(element, attributeName, value) {
261
- value === null || value === undefined
262
- ? element.removeAttribute(attributeName)
263
- : element.setAttribute(attributeName, value);
264
- },
265
- /**
266
- * Sets a boolean attribute value.
267
- * @param element - The element to set the boolean attribute value on.
268
- * @param attributeName - The attribute name to set.
269
- * @param value - The value of the attribute to set.
270
- * @remarks
271
- * If the value is true, the attribute is added; otherwise it is removed.
272
- */
273
- setBooleanAttribute(element, attributeName, value) {
274
- value
275
- ? element.setAttribute(attributeName, "")
276
- : element.removeAttribute(attributeName);
277
- },
278
- });
279
-
280
- /**
281
- * The default UpdateQueue.
282
- * @public
283
- */
284
- const Updates = FAST.getById(KernelServiceId.updateQueue, () => {
285
- const tasks = [];
286
- const pendingErrors = [];
287
- const rAF = globalThis.requestAnimationFrame;
288
- let updateAsync = true;
289
- function throwFirstError() {
290
- if (pendingErrors.length) {
291
- throw pendingErrors.shift();
292
- }
293
- }
294
- function tryRunTask(task) {
295
- try {
296
- task.call();
297
- }
298
- catch (error) {
299
- if (updateAsync) {
300
- pendingErrors.push(error);
301
- setTimeout(throwFirstError, 0);
302
- }
303
- else {
304
- tasks.length = 0;
305
- throw error;
306
- }
307
- }
308
- }
309
- function process() {
310
- const capacity = 1024;
311
- let index = 0;
312
- while (index < tasks.length) {
313
- tryRunTask(tasks[index]);
314
- index++;
315
- // Prevent leaking memory for long chains of recursive calls to `enqueue`.
316
- // If we call `enqueue` within a task scheduled by `enqueue`, the queue will
317
- // grow, but to avoid an O(n) walk for every task we execute, we don't
318
- // shift tasks off the queue after they have been executed.
319
- // Instead, we periodically shift 1024 tasks off the queue.
320
- if (index > capacity) {
321
- // Manually shift all values starting at the index back to the
322
- // beginning of the queue.
323
- for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) {
324
- tasks[scan] = tasks[scan + index];
325
- }
326
- tasks.length -= index;
327
- index = 0;
328
- }
329
- }
330
- tasks.length = 0;
331
- }
332
- function enqueue(callable) {
333
- tasks.push(callable);
334
- if (tasks.length < 2) {
335
- updateAsync ? rAF(process) : process();
336
- }
337
- }
338
- return Object.freeze({
339
- enqueue,
340
- next: () => new Promise(enqueue),
341
- process,
342
- setMode: (isAsync) => (updateAsync = isAsync),
343
- });
344
- });
345
-
346
- /**
347
- * An implementation of {@link Notifier} that efficiently keeps track of
348
- * subscribers interested in a specific change notification on an
349
- * observable subject.
350
- *
351
- * @remarks
352
- * This set is optimized for the most common scenario of 1 or 2 subscribers.
353
- * With this in mind, it can store a subscriber in an internal field, allowing it to avoid Array#push operations.
354
- * If the set ever exceeds two subscribers, it upgrades to an array automatically.
355
- * @public
356
- */
357
- class SubscriberSet {
358
- /**
359
- * Creates an instance of SubscriberSet for the specified subject.
360
- * @param subject - The subject that subscribers will receive notifications from.
361
- * @param initialSubscriber - An initial subscriber to changes.
362
- */
363
- constructor(subject, initialSubscriber) {
364
- this.sub1 = void 0;
365
- this.sub2 = void 0;
366
- this.spillover = void 0;
367
- this.subject = subject;
368
- this.sub1 = initialSubscriber;
369
- }
370
- /**
371
- * Checks whether the provided subscriber has been added to this set.
372
- * @param subscriber - The subscriber to test for inclusion in this set.
373
- */
374
- has(subscriber) {
375
- return this.spillover === void 0
376
- ? this.sub1 === subscriber || this.sub2 === subscriber
377
- : this.spillover.indexOf(subscriber) !== -1;
378
- }
379
- /**
380
- * Subscribes to notification of changes in an object's state.
381
- * @param subscriber - The object that is subscribing for change notification.
382
- */
383
- subscribe(subscriber) {
384
- const spillover = this.spillover;
385
- if (spillover === void 0) {
386
- if (this.has(subscriber)) {
387
- return;
388
- }
389
- if (this.sub1 === void 0) {
390
- this.sub1 = subscriber;
391
- return;
392
- }
393
- if (this.sub2 === void 0) {
394
- this.sub2 = subscriber;
395
- return;
396
- }
397
- this.spillover = [this.sub1, this.sub2, subscriber];
398
- this.sub1 = void 0;
399
- this.sub2 = void 0;
400
- }
401
- else {
402
- const index = spillover.indexOf(subscriber);
403
- if (index === -1) {
404
- spillover.push(subscriber);
405
- }
406
- }
407
- }
408
- /**
409
- * Unsubscribes from notification of changes in an object's state.
410
- * @param subscriber - The object that is unsubscribing from change notification.
411
- */
412
- unsubscribe(subscriber) {
413
- const spillover = this.spillover;
414
- if (spillover === void 0) {
415
- if (this.sub1 === subscriber) {
416
- this.sub1 = void 0;
417
- }
418
- else if (this.sub2 === subscriber) {
419
- this.sub2 = void 0;
420
- }
421
- }
422
- else {
423
- const index = spillover.indexOf(subscriber);
424
- if (index !== -1) {
425
- spillover.splice(index, 1);
426
- }
427
- }
428
- }
429
- /**
430
- * Notifies all subscribers.
431
- * @param args - Data passed along to subscribers during notification.
432
- */
433
- notify(args) {
434
- const spillover = this.spillover;
435
- const subject = this.subject;
436
- if (spillover === void 0) {
437
- const sub1 = this.sub1;
438
- const sub2 = this.sub2;
439
- if (sub1 !== void 0) {
440
- sub1.handleChange(subject, args);
441
- }
442
- if (sub2 !== void 0) {
443
- sub2.handleChange(subject, args);
444
- }
445
- }
446
- else {
447
- for (let i = 0, ii = spillover.length; i < ii; ++i) {
448
- spillover[i].handleChange(subject, args);
449
- }
450
- }
451
- }
452
- }
453
- /**
454
- * An implementation of Notifier that allows subscribers to be notified
455
- * of individual property changes on an object.
456
- * @public
457
- */
458
- class PropertyChangeNotifier {
459
- /**
460
- * Creates an instance of PropertyChangeNotifier for the specified subject.
461
- * @param subject - The object that subscribers will receive notifications for.
462
- */
463
- constructor(subject) {
464
- this.subscribers = {};
465
- this.subjectSubscribers = null;
466
- this.subject = subject;
467
- }
468
- /**
469
- * Notifies all subscribers, based on the specified property.
470
- * @param propertyName - The property name, passed along to subscribers during notification.
471
- */
472
- notify(propertyName) {
473
- var _a, _b;
474
- (_a = this.subscribers[propertyName]) === null || _a === void 0 ? void 0 : _a.notify(propertyName);
475
- (_b = this.subjectSubscribers) === null || _b === void 0 ? void 0 : _b.notify(propertyName);
476
- }
477
- /**
478
- * Subscribes to notification of changes in an object's state.
479
- * @param subscriber - The object that is subscribing for change notification.
480
- * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes.
481
- */
482
- subscribe(subscriber, propertyToWatch) {
483
- var _a, _b;
484
- let subscribers;
485
- if (propertyToWatch) {
486
- subscribers =
487
- (_a = this.subscribers[propertyToWatch]) !== null && _a !== void 0 ? _a : (this.subscribers[propertyToWatch] = new SubscriberSet(this.subject));
488
- }
489
- else {
490
- subscribers =
491
- (_b = this.subjectSubscribers) !== null && _b !== void 0 ? _b : (this.subjectSubscribers = new SubscriberSet(this.subject));
492
- }
493
- subscribers.subscribe(subscriber);
494
- }
495
- /**
496
- * Unsubscribes from notification of changes in an object's state.
497
- * @param subscriber - The object that is unsubscribing from change notification.
498
- * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching.
499
- */
500
- unsubscribe(subscriber, propertyToUnwatch) {
501
- var _a, _b;
502
- if (propertyToUnwatch) {
503
- (_a = this.subscribers[propertyToUnwatch]) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber);
504
- }
505
- else {
506
- (_b = this.subjectSubscribers) === null || _b === void 0 ? void 0 : _b.unsubscribe(subscriber);
507
- }
508
- }
509
- }
510
-
511
- /**
512
- * Describes how the source's lifetime relates to its controller's lifetime.
513
- * @public
514
- */
515
- const SourceLifetime = Object.freeze({
516
- /**
517
- * The source to controller lifetime relationship is unknown.
518
- */
519
- unknown: void 0,
520
- /**
521
- * The source and controller lifetimes are coupled to one another.
522
- * They can/will be GC'd together.
523
- */
524
- coupled: 1,
525
- });
526
- /**
527
- * Common Observable APIs.
528
- * @public
529
- */
530
- FAST.getById(KernelServiceId.observable, () => {
531
- const queueUpdate = Updates.enqueue;
532
- const volatileRegex = /(:|&&|\|\||if|\?\.)/;
533
- const notifierLookup = new WeakMap();
534
- let watcher = void 0;
535
- let createArrayObserver = (array) => {
536
- throw FAST.error(1101 /* Message.needsArrayObservation */);
537
- };
538
- function getNotifier(source) {
539
- var _a;
540
- let found = (_a = source.$fastController) !== null && _a !== void 0 ? _a : notifierLookup.get(source);
541
- if (found === void 0) {
542
- Array.isArray(source)
543
- ? (found = createArrayObserver(source))
544
- : notifierLookup.set(source, (found = new PropertyChangeNotifier(source)));
545
- }
546
- return found;
547
- }
548
- const getAccessors = createMetadataLocator();
549
- class DefaultObservableAccessor {
550
- constructor(name) {
551
- this.name = name;
552
- this.field = `_${name}`;
553
- this.callback = `${name}Changed`;
554
- }
555
- getValue(source) {
556
- if (watcher !== void 0) {
557
- watcher.watch(source, this.name);
558
- }
559
- return source[this.field];
560
- }
561
- setValue(source, newValue) {
562
- const field = this.field;
563
- const oldValue = source[field];
564
- if (oldValue !== newValue) {
565
- source[field] = newValue;
566
- const callback = source[this.callback];
567
- if (isFunction(callback)) {
568
- callback.call(source, oldValue, newValue);
569
- }
570
- getNotifier(source).notify(this.name);
571
- }
572
- }
573
- }
574
- class ExpressionNotifierImplementation extends SubscriberSet {
575
- constructor(expression, initialSubscriber, isVolatileBinding = false) {
576
- super(expression, initialSubscriber);
577
- this.expression = expression;
578
- this.isVolatileBinding = isVolatileBinding;
579
- this.needsRefresh = true;
580
- this.needsQueue = true;
581
- this.isAsync = true;
582
- this.first = this;
583
- this.last = null;
584
- this.propertySource = void 0;
585
- this.propertyName = void 0;
586
- this.notifier = void 0;
587
- this.next = void 0;
588
- }
589
- setMode(isAsync) {
590
- this.isAsync = this.needsQueue = isAsync;
591
- }
592
- bind(controller) {
593
- this.controller = controller;
594
- const value = this.observe(controller.source, controller.context);
595
- if (!controller.isBound && this.requiresUnbind(controller)) {
596
- controller.onUnbind(this);
597
- }
598
- return value;
599
- }
600
- requiresUnbind(controller) {
601
- return (controller.sourceLifetime !== SourceLifetime.coupled ||
602
- this.first !== this.last ||
603
- this.first.propertySource !== controller.source);
604
- }
605
- unbind(controller) {
606
- this.dispose();
607
- }
608
- observe(source, context) {
609
- if (this.needsRefresh && this.last !== null) {
610
- this.dispose();
611
- }
612
- const previousWatcher = watcher;
613
- watcher = this.needsRefresh ? this : void 0;
614
- this.needsRefresh = this.isVolatileBinding;
615
- let result;
616
- try {
617
- result = this.expression(source, context);
618
- }
619
- finally {
620
- watcher = previousWatcher;
621
- }
622
- return result;
623
- }
624
- // backwards compat with v1 kernel
625
- disconnect() {
626
- this.dispose();
627
- }
628
- dispose() {
629
- if (this.last !== null) {
630
- let current = this.first;
631
- while (current !== void 0) {
632
- current.notifier.unsubscribe(this, current.propertyName);
633
- current = current.next;
634
- }
635
- this.last = null;
636
- this.needsRefresh = this.needsQueue = this.isAsync;
637
- }
638
- }
639
- watch(propertySource, propertyName) {
640
- const prev = this.last;
641
- const notifier = getNotifier(propertySource);
642
- const current = prev === null ? this.first : {};
643
- current.propertySource = propertySource;
644
- current.propertyName = propertyName;
645
- current.notifier = notifier;
646
- notifier.subscribe(this, propertyName);
647
- if (prev !== null) {
648
- if (!this.needsRefresh) {
649
- // Declaring the variable prior to assignment below circumvents
650
- // a bug in Angular's optimization process causing infinite recursion
651
- // of this watch() method. Details https://github.com/microsoft/fast/issues/4969
652
- let prevValue;
653
- watcher = void 0;
654
- /* eslint-disable-next-line */
655
- prevValue = prev.propertySource[prev.propertyName];
656
- /* eslint-disable-next-line */
657
- watcher = this;
658
- if (propertySource === prevValue) {
659
- this.needsRefresh = true;
660
- }
661
- }
662
- prev.next = current;
663
- }
664
- this.last = current;
665
- }
666
- handleChange() {
667
- if (this.needsQueue) {
668
- this.needsQueue = false;
669
- queueUpdate(this);
670
- }
671
- else if (!this.isAsync) {
672
- this.call();
673
- }
674
- }
675
- call() {
676
- if (this.last !== null) {
677
- this.needsQueue = this.isAsync;
678
- this.notify(this);
679
- }
680
- }
681
- *records() {
682
- let next = this.first;
683
- while (next !== void 0) {
684
- yield next;
685
- next = next.next;
686
- }
687
- }
688
- }
689
- makeSerializationNoop(ExpressionNotifierImplementation);
690
- return Object.freeze({
691
- /**
692
- * @internal
693
- * @param factory - The factory used to create array observers.
694
- */
695
- setArrayObserverFactory(factory) {
696
- createArrayObserver = factory;
697
- },
698
- /**
699
- * Gets a notifier for an object or Array.
700
- * @param source - The object or Array to get the notifier for.
701
- */
702
- getNotifier,
703
- /**
704
- * Records a property change for a source object.
705
- * @param source - The object to record the change against.
706
- * @param propertyName - The property to track as changed.
707
- */
708
- track(source, propertyName) {
709
- watcher && watcher.watch(source, propertyName);
710
- },
711
- /**
712
- * Notifies watchers that the currently executing property getter or function is volatile
713
- * with respect to its observable dependencies.
714
- */
715
- trackVolatile() {
716
- watcher && (watcher.needsRefresh = true);
717
- },
718
- /**
719
- * Notifies subscribers of a source object of changes.
720
- * @param source - the object to notify of changes.
721
- * @param args - The change args to pass to subscribers.
722
- */
723
- notify(source, args) {
724
- /* eslint-disable-next-line @typescript-eslint/no-use-before-define */
725
- getNotifier(source).notify(args);
726
- },
727
- /**
728
- * Defines an observable property on an object or prototype.
729
- * @param target - The target object to define the observable on.
730
- * @param nameOrAccessor - The name of the property to define as observable;
731
- * or a custom accessor that specifies the property name and accessor implementation.
732
- */
733
- defineProperty(target, nameOrAccessor) {
734
- if (isString(nameOrAccessor)) {
735
- nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor);
736
- }
737
- getAccessors(target).push(nameOrAccessor);
738
- Reflect.defineProperty(target, nameOrAccessor.name, {
739
- enumerable: true,
740
- get() {
741
- return nameOrAccessor.getValue(this);
742
- },
743
- set(newValue) {
744
- nameOrAccessor.setValue(this, newValue);
745
- },
746
- });
747
- },
748
- /**
749
- * Finds all the observable accessors defined on the target,
750
- * including its prototype chain.
751
- * @param target - The target object to search for accessor on.
752
- */
753
- getAccessors,
754
- /**
755
- * Creates a {@link ExpressionNotifier} that can watch the
756
- * provided {@link Expression} for changes.
757
- * @param expression - The binding to observe.
758
- * @param initialSubscriber - An initial subscriber to changes in the binding value.
759
- * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation.
760
- */
761
- binding(expression, initialSubscriber, isVolatileBinding = this.isVolatileBinding(expression)) {
762
- return new ExpressionNotifierImplementation(expression, initialSubscriber, isVolatileBinding);
763
- },
764
- /**
765
- * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated
766
- * on every evaluation of the value.
767
- * @param expression - The binding to inspect.
768
- */
769
- isVolatileBinding(expression) {
770
- return volatileRegex.test(expression.toString());
771
- },
772
- });
773
- });
774
- const contextEvent = FAST.getById(KernelServiceId.contextEvent, () => {
775
- let current = null;
776
- return {
777
- get() {
778
- return current;
779
- },
780
- set(event) {
781
- current = event;
782
- },
783
- };
784
- });
785
- /**
786
- * Provides additional contextual information available to behaviors and expressions.
787
- * @public
788
- */
789
- const ExecutionContext = Object.freeze({
790
- /**
791
- * A default execution context.
792
- */
793
- default: {
794
- index: 0,
795
- length: 0,
796
- get event() {
797
- return ExecutionContext.getEvent();
798
- },
799
- eventDetail() {
800
- return this.event.detail;
801
- },
802
- eventTarget() {
803
- return this.event.target;
804
- },
805
- },
806
- /**
807
- * Gets the current event.
808
- * @returns An event object.
809
- */
810
- getEvent() {
811
- return contextEvent.get();
812
- },
813
- /**
814
- * Sets the current event.
815
- * @param event - An event object.
816
- */
817
- setEvent(event) {
818
- contextEvent.set(event);
819
- },
820
- });
821
-
822
- const marker = `fast-${Math.random().toString(36).substring(2, 8)}`;
823
- let id = 0;
824
- /** @internal */
825
- const nextId = () => `${marker}-${++id}`;
826
-
827
- /**
828
- * Bridges between ViewBehaviors and HostBehaviors, enabling a host to
829
- * control ViewBehaviors.
830
- * @public
831
- */
832
- const ViewBehaviorOrchestrator = Object.freeze({
833
- /**
834
- * Creates a ViewBehaviorOrchestrator.
835
- * @param source - The source to to associate behaviors with.
836
- * @returns A ViewBehaviorOrchestrator.
837
- */
838
- create(source) {
839
- const behaviors = [];
840
- const targets = {};
841
- let unbindables = null;
842
- let isConnected = false;
843
- return {
844
- source,
845
- context: ExecutionContext.default,
846
- targets,
847
- get isBound() {
848
- return isConnected;
849
- },
850
- addBehaviorFactory(factory, target) {
851
- var _a, _b, _c, _d;
852
- const compiled = factory;
853
- compiled.id = (_a = compiled.id) !== null && _a !== void 0 ? _a : nextId();
854
- compiled.targetNodeId = (_b = compiled.targetNodeId) !== null && _b !== void 0 ? _b : nextId();
855
- compiled.targetTagName = (_c = target.tagName) !== null && _c !== void 0 ? _c : null;
856
- compiled.policy = (_d = compiled.policy) !== null && _d !== void 0 ? _d : DOM.policy;
857
- this.addTarget(compiled.targetNodeId, target);
858
- this.addBehavior(compiled.createBehavior());
859
- },
860
- addTarget(nodeId, target) {
861
- targets[nodeId] = target;
862
- },
863
- addBehavior(behavior) {
864
- behaviors.push(behavior);
865
- if (isConnected) {
866
- behavior.bind(this);
867
- }
868
- },
869
- onUnbind(unbindable) {
870
- if (unbindables === null) {
871
- unbindables = [];
872
- }
873
- unbindables.push(unbindable);
874
- },
875
- connectedCallback(controller) {
876
- if (!isConnected) {
877
- isConnected = true;
878
- behaviors.forEach(x => x.bind(this));
879
- }
880
- },
881
- disconnectedCallback(controller) {
882
- if (isConnected) {
883
- isConnected = false;
884
- if (unbindables !== null) {
885
- unbindables.forEach(x => x.unbind(this));
886
- }
887
- }
888
- },
889
- };
890
- },
891
- });
892
-
893
- var __defProp$2 = Object.defineProperty;
894
- var __decorateClass$2 = (decorators, target, key, kind) => {
895
- var result = void 0 ;
896
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
897
- if (decorator = decorators[i])
898
- result = (decorator(target, key, result) ) || result;
899
- if (result) __defProp$2(target, key, result);
900
- return result;
901
- };
902
- const defaultCellContentsTemplate = html`
903
- <template>
904
- ${(x) => x.rowData === null || x.columnDefinition === null || x.columnDefinition.columnDataKey === null ? null : x.rowData[x.columnDefinition.columnDataKey]}
905
- </template>
906
- `;
907
- const defaultHeaderCellContentsTemplate = html`
908
- <template>
909
- ${(x) => x.columnDefinition.title === void 0 ? x.columnDefinition.columnDataKey : x.columnDefinition.title}
910
- </template>
911
- `;
912
- class DataGridCell extends Localized(HostSemantics(VividElement)) {
913
- constructor() {
914
- super(...arguments);
915
- // eslint-disable-next-line @repo/repo/no-attribute-default-value
916
- this.cellType = DataGridCellTypes.default;
917
- this.rowData = null;
918
- this.columnDefinition = null;
919
- this.isActiveCell = false;
920
- this.customCellView = null;
921
- this.updateCellStyle = () => {
922
- if (this.gridColumn && !this.gridColumn.includes("undefined")) {
923
- this.style.gridColumn = this.gridColumn;
924
- } else {
925
- this.style.removeProperty("grid-column");
926
- }
927
- };
928
- this._selectable = false;
929
- this.selected = false;
930
- /**
931
- * Indicates the selected status.
932
- *
933
- * @deprecated For setting selected state, please use `selected` property instead.
934
- * @public
935
- * HTML Attribute: aria-selected
936
- */
937
- this.ariaSelected = null;
938
- /**
939
- * Indicates the sort status.
940
- *
941
- * @deprecated To set the sorting visual style please use `sortDirection` property.
942
- * @public
943
- * HTML Attribute: aria-sort
944
- */
945
- this.ariaSort = null;
946
- }
947
- /**
948
- * @internal
949
- */
950
- cellTypeChanged() {
951
- if (this.$fastController.isConnected) {
952
- this.updateCellView();
953
- }
954
- }
955
- /**
956
- * @internal
957
- */
958
- gridColumnChanged() {
959
- if (this.$fastController.isConnected) {
960
- this.updateCellStyle();
961
- }
962
- }
963
- /**
964
- * @internal
965
- */
966
- columnDefinitionChanged(_oldValue, _newValue) {
967
- if (this.$fastController.isConnected) {
968
- this.updateCellView();
969
- }
970
- }
971
- /**
972
- * Updates the fixed column style
973
- * @internal
974
- */
975
- updateFixedStyle() {
976
- if (this.fixedPosition !== void 0) {
977
- this.setAttribute("data-fixed", "");
978
- this.style.left = this.fixedPosition;
979
- } else {
980
- this.removeAttribute("data-fixed");
981
- this.style.removeProperty("left");
982
- }
983
- }
984
- /**
985
- * Sets the fixed state and position for this cell
986
- * @internal
987
- */
988
- setFixedPosition(position) {
989
- this.fixedPosition = position;
990
- this.updateFixedStyle();
991
- }
992
- /**
993
- * @internal
994
- */
995
- connectedCallback() {
996
- super.connectedCallback();
997
- this.addEventListener(eventFocusIn, this.handleFocusin);
998
- this.addEventListener(eventFocusOut, this.handleFocusout);
999
- this.addEventListener(eventKeyDown, this.handleKeydown);
1000
- this.style.gridColumn = `${this.columnDefinition?.gridColumn === void 0 ? 0 : this.columnDefinition.gridColumn}`;
1001
- this.updateCellView();
1002
- this.updateCellStyle();
1003
- this.updateFixedStyle();
1004
- }
1005
- /**
1006
- * @internal
1007
- */
1008
- disconnectedCallback() {
1009
- super.disconnectedCallback();
1010
- this.removeEventListener(eventFocusIn, this.handleFocusin);
1011
- this.removeEventListener(
1012
- eventFocusOut,
1013
- this.handleFocusout
1014
- );
1015
- this.removeEventListener(eventKeyDown, this.handleKeydown);
1016
- this.disconnectCellView();
1017
- }
1018
- handleFocusin(_) {
1019
- this.shadowRoot.querySelector(".base").classList.add("active");
1020
- if (this.isActiveCell) {
1021
- return;
1022
- }
1023
- this.isActiveCell = true;
1024
- switch (this.cellType) {
1025
- case DataGridCellTypes.columnHeader:
1026
- if (this.columnDefinition !== null && this.columnDefinition.headerCellInternalFocusQueue !== true && typeof this.columnDefinition.headerCellFocusTargetCallback === "function") {
1027
- const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this);
1028
- if (focusTarget !== null) {
1029
- focusTarget.focus();
1030
- }
1031
- }
1032
- break;
1033
- default:
1034
- if (this.columnDefinition !== null && this.columnDefinition.cellInternalFocusQueue !== true && typeof this.columnDefinition.cellFocusTargetCallback === "function") {
1035
- const focusTarget = this.columnDefinition.cellFocusTargetCallback(this);
1036
- if (focusTarget !== null) {
1037
- focusTarget.focus();
1038
- }
1039
- }
1040
- break;
1041
- }
1042
- this.$emit("cell-focused", this);
1043
- }
1044
- handleFocusout(_) {
1045
- this.shadowRoot.querySelector(".base").classList.remove("active");
1046
- if (this !== document.activeElement && !this.contains(document.activeElement)) {
1047
- this.isActiveCell = false;
1048
- }
1049
- }
1050
- handleKeydown(e) {
1051
- if (e.defaultPrevented || this.columnDefinition === null || this.cellType === DataGridCellTypes.default && this.columnDefinition.cellInternalFocusQueue !== true || this.cellType === DataGridCellTypes.columnHeader && this.columnDefinition.headerCellInternalFocusQueue !== true) {
1052
- return;
1053
- }
1054
- switch (e.key) {
1055
- case keyEnter:
1056
- case keyFunction2:
1057
- if (this.contains(document.activeElement) && document.activeElement !== this) {
1058
- return;
1059
- }
1060
- switch (this.cellType) {
1061
- case DataGridCellTypes.columnHeader: {
1062
- if (this.columnDefinition.headerCellFocusTargetCallback !== void 0) {
1063
- const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this);
1064
- if (focusTarget !== null) {
1065
- focusTarget.focus();
1066
- }
1067
- e.preventDefault();
1068
- }
1069
- break;
1070
- }
1071
- default: {
1072
- if (this.columnDefinition.cellFocusTargetCallback !== void 0) {
1073
- const focusTarget = this.columnDefinition.cellFocusTargetCallback(this);
1074
- if (focusTarget !== null) {
1075
- focusTarget.focus();
1076
- }
1077
- e.preventDefault();
1078
- }
1079
- break;
1080
- }
1081
- }
1082
- break;
1083
- case keyEscape: {
1084
- if (this.contains(document.activeElement) && document.activeElement !== this) {
1085
- this.focus();
1086
- e.preventDefault();
1087
- }
1088
- break;
1089
- }
1090
- }
1091
- }
1092
- updateCellView() {
1093
- this.disconnectCellView();
1094
- if (this.columnDefinition === null) {
1095
- return;
1096
- }
1097
- switch (this.cellType) {
1098
- case DataGridCellTypes.columnHeader:
1099
- if (this.columnDefinition.headerCellTemplate !== void 0) {
1100
- this.customCellView = this.columnDefinition.headerCellTemplate.render(
1101
- this,
1102
- this
1103
- );
1104
- } else {
1105
- this.customCellView = defaultHeaderCellContentsTemplate.render(
1106
- this,
1107
- this
1108
- );
1109
- }
1110
- break;
1111
- case DataGridCellTypes.rowHeader:
1112
- case DataGridCellTypes.default:
1113
- if (this.columnDefinition.cellTemplate !== void 0) {
1114
- this.customCellView = this.columnDefinition.cellTemplate.render(
1115
- this,
1116
- this
1117
- );
1118
- } else {
1119
- this.customCellView = defaultCellContentsTemplate.render(this, this);
1120
- }
1121
- break;
1122
- }
1123
- if (!this.columnDefinition?.sortable) {
1124
- this.sortDirection = void 0;
1125
- } else if (this.columnDefinition.sortDirection) {
1126
- this.sortDirection = this.columnDefinition.sortDirection;
1127
- } else {
1128
- this.sortDirection = DataGridCellSortStates.none;
1129
- }
1130
- }
1131
- disconnectCellView() {
1132
- if (this.customCellView !== null) {
1133
- this.customCellView.dispose();
1134
- this.customCellView = null;
1135
- }
1136
- }
1137
- /**
1138
- * @internal
1139
- */
1140
- ariaSelectedChanged(prevValue, newValue) {
1141
- super.ariaSelectedChanged(prevValue, newValue);
1142
- this._selectable = newValue !== null;
1143
- this.selected = newValue === "true";
1144
- }
1145
- /**
1146
- * @internal
1147
- */
1148
- ariaSortChanged(oldValue, newValue) {
1149
- super.ariaSortChanged(oldValue, newValue);
1150
- if (newValue === null) {
1151
- this.sortDirection = void 0;
1152
- return;
1153
- }
1154
- this.sortDirection = newValue;
1155
- }
1156
- #getColumnDataKey() {
1157
- return this.columnDefinition && this.columnDefinition.columnDataKey ? this.columnDefinition.columnDataKey : this.textContent.trim();
1158
- }
1159
- /**
1160
- * @internal
1161
- */
1162
- _handleInteraction() {
1163
- const isHeaderCell = this.cellType === "columnheader";
1164
- const isSortable = isHeaderCell && this.sortDirection !== void 0;
1165
- if (isSortable) {
1166
- this.$emit("sort", {
1167
- columnDataKey: this.#getColumnDataKey(),
1168
- sortDirection: this.sortDirection
1169
- });
1170
- }
1171
- const hasInternalFocusQueue = isHeaderCell ? this.columnDefinition?.headerCellInternalFocusQueue : this.columnDefinition?.cellInternalFocusQueue;
1172
- if (!hasInternalFocusQueue) {
1173
- this.$emit("cell-click", {
1174
- cell: this,
1175
- row: this.parentElement,
1176
- isHeaderCell,
1177
- columnDataKey: this.#getColumnDataKey()
1178
- });
1179
- }
1180
- return true;
1181
- }
1182
- }
1183
- __decorateClass$2([
1184
- attr({ attribute: "cell-type" })
1185
- ], DataGridCell.prototype, "cellType");
1186
- __decorateClass$2([
1187
- attr({ attribute: "grid-column" })
1188
- ], DataGridCell.prototype, "gridColumn");
1189
- __decorateClass$2([
1190
- observable
1191
- ], DataGridCell.prototype, "rowData");
1192
- __decorateClass$2([
1193
- observable
1194
- ], DataGridCell.prototype, "columnDefinition");
1195
- __decorateClass$2([
1196
- observable
1197
- ], DataGridCell.prototype, "_selectable");
1198
- __decorateClass$2([
1199
- attr({ mode: "boolean" })
1200
- ], DataGridCell.prototype, "selected");
1201
- __decorateClass$2([
1202
- attr({ attribute: "sort-direction" })
1203
- ], DataGridCell.prototype, "sortDirection");
1204
- __decorateClass$2([
1205
- observable
1206
- ], DataGridCell.prototype, "_actionItemsSlottedContent");
1207
-
1208
- var __defProp$1 = Object.defineProperty;
1209
- var __decorateClass$1 = (decorators, target, key, kind) => {
1210
- var result = void 0 ;
1211
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1212
- if (decorator = decorators[i])
1213
- result = (decorator(target, key, result) ) || result;
1214
- if (result) __defProp$1(target, key, result);
1215
- return result;
1216
- };
1217
- class DataGridRow extends HostSemantics(VividElement) {
1218
- constructor() {
1219
- super(...arguments);
1220
- // eslint-disable-next-line @repo/repo/no-attribute-default-value
1221
- this.rowType = DataGridRowTypes.default;
1222
- this.rowData = null;
1223
- this.columnDefinitions = null;
1224
- this.behaviorOrchestrator = null;
1225
- /**
1226
- * @internal
1227
- */
1228
- this.focusColumnIndex = 0;
1229
- this.updateRowStyle = () => {
1230
- this.style.gridTemplateColumns = this.gridTemplateColumns;
1231
- };
1232
- /**
1233
- * Indicates the selected status.
1234
- *
1235
- * @deprecated
1236
- * @public
1237
- * HTML Attribute: aria-selected
1238
- */
1239
- this.ariaSelected = null;
1240
- this._selectable = false;
1241
- this.selected = false;
1242
- }
1243
- /**
1244
- * @internal
1245
- */
1246
- gridTemplateColumnsChanged() {
1247
- if (this.$fastController.isConnected) {
1248
- this.updateRowStyle();
1249
- }
1250
- }
1251
- /**
1252
- * @internal
1253
- */
1254
- rowTypeChanged() {
1255
- if (this.$fastController.isConnected) {
1256
- this.updateItemTemplate();
1257
- }
1258
- }
1259
- /**
1260
- * @internal
1261
- */
1262
- cellItemTemplateChanged() {
1263
- this.updateItemTemplate();
1264
- }
1265
- /**
1266
- * @internal
1267
- */
1268
- headerCellItemTemplateChanged() {
1269
- this.updateItemTemplate();
1270
- }
1271
- /**
1272
- * @internal
1273
- */
1274
- connectedCallback() {
1275
- super.connectedCallback();
1276
- if (this.behaviorOrchestrator === null) {
1277
- this.updateItemTemplate();
1278
- this.behaviorOrchestrator = ViewBehaviorOrchestrator.create(this);
1279
- this.$fastController.addBehavior(this.behaviorOrchestrator);
1280
- this.behaviorOrchestrator.addBehaviorFactory(
1281
- new RepeatDirective(
1282
- normalizeBinding((x) => x.columnDefinitions),
1283
- normalizeBinding((x) => x.activeCellItemTemplate),
1284
- { positioning: true }
1285
- ),
1286
- this.appendChild(document.createComment(""))
1287
- );
1288
- }
1289
- this.addEventListener("cell-focused", this.handleCellFocus);
1290
- this.addEventListener(eventFocusOut, this.handleFocusout);
1291
- this.addEventListener(eventKeyDown, this.handleKeydown);
1292
- this.updateRowStyle();
1293
- }
1294
- /**
1295
- * @internal
1296
- */
1297
- disconnectedCallback() {
1298
- super.disconnectedCallback();
1299
- this.removeEventListener("cell-focused", this.handleCellFocus);
1300
- this.removeEventListener(
1301
- eventFocusOut,
1302
- this.handleFocusout
1303
- );
1304
- this.removeEventListener(eventKeyDown, this.handleKeydown);
1305
- }
1306
- handleFocusout(_) {
1307
- if (!this.contains(document.activeElement)) {
1308
- this.focusColumnIndex = 0;
1309
- }
1310
- }
1311
- handleCellFocus(e) {
1312
- this.focusColumnIndex = this.cellElements.indexOf(e.target);
1313
- this.$emit("row-focused", this);
1314
- }
1315
- handleKeydown(e) {
1316
- if (e.defaultPrevented) {
1317
- return;
1318
- }
1319
- let newFocusColumnIndex = 0;
1320
- switch (e.key) {
1321
- case keyArrowLeft:
1322
- newFocusColumnIndex = Math.max(0, this.focusColumnIndex - 1);
1323
- this.cellElements[newFocusColumnIndex].focus();
1324
- e.preventDefault();
1325
- break;
1326
- case keyArrowRight:
1327
- newFocusColumnIndex = Math.min(
1328
- this.cellElements.length - 1,
1329
- this.focusColumnIndex + 1
1330
- );
1331
- this.cellElements[newFocusColumnIndex].focus();
1332
- e.preventDefault();
1333
- break;
1334
- case keyHome:
1335
- if (!e.ctrlKey) {
1336
- this.cellElements[0].focus();
1337
- e.preventDefault();
1338
- }
1339
- break;
1340
- case keyEnd:
1341
- if (!e.ctrlKey) {
1342
- this.cellElements[this.cellElements.length - 1].focus();
1343
- e.preventDefault();
1344
- }
1345
- break;
1346
- }
1347
- }
1348
- updateItemTemplate() {
1349
- this.activeCellItemTemplate = this.rowType === DataGridRowTypes.default && this.cellItemTemplate !== void 0 ? this.cellItemTemplate : this.rowType === DataGridRowTypes.default && this.cellItemTemplate === void 0 ? this.defaultCellItemTemplate : this.headerCellItemTemplate !== void 0 ? this.headerCellItemTemplate : this.defaultHeaderCellItemTemplate;
1350
- }
1351
- /**
1352
- * @internal
1353
- */
1354
- ariaSelectedChanged(oldValue, newValue) {
1355
- super.ariaSelectedChanged(oldValue, newValue);
1356
- this._selectable = newValue !== null;
1357
- this.selected = newValue === "true";
1358
- }
1359
- }
1360
- // @ts-expect-error Type is incorrectly non-optional
1361
- __decorateClass$1([
1362
- attr({ attribute: "grid-template-columns" })
1363
- ], DataGridRow.prototype, "gridTemplateColumns");
1364
- __decorateClass$1([
1365
- attr({ attribute: "row-type" })
1366
- ], DataGridRow.prototype, "rowType");
1367
- __decorateClass$1([
1368
- observable
1369
- ], DataGridRow.prototype, "rowData");
1370
- __decorateClass$1([
1371
- observable
1372
- ], DataGridRow.prototype, "columnDefinitions");
1373
- __decorateClass$1([
1374
- observable
1375
- ], DataGridRow.prototype, "cellItemTemplate");
1376
- __decorateClass$1([
1377
- observable
1378
- ], DataGridRow.prototype, "headerCellItemTemplate");
1379
- __decorateClass$1([
1380
- observable
1381
- ], DataGridRow.prototype, "rowIndex");
1382
- __decorateClass$1([
1383
- observable
1384
- ], DataGridRow.prototype, "activeCellItemTemplate");
1385
- __decorateClass$1([
1386
- observable
1387
- ], DataGridRow.prototype, "defaultCellItemTemplate");
1388
- __decorateClass$1([
1389
- observable
1390
- ], DataGridRow.prototype, "defaultHeaderCellItemTemplate");
1391
- __decorateClass$1([
1392
- observable
1393
- ], DataGridRow.prototype, "cellElements");
1394
- __decorateClass$1([
1395
- observable
1396
- ], DataGridRow.prototype, "_selectable");
1397
- __decorateClass$1([
1398
- attr({ mode: "boolean" })
1399
- ], DataGridRow.prototype, "selected");
1400
-
1401
- var __defProp = Object.defineProperty;
1402
- var __decorateClass = (decorators, target, key, kind) => {
1403
- var result = void 0 ;
1404
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1405
- if (decorator = decorators[i])
1406
- result = (decorator(target, key, result) ) || result;
1407
- if (result) __defProp(target, key, result);
1408
- return result;
1409
- };
1410
- const DataGridSelectionMode = {
1411
- none: "none",
1412
- singleRow: "single-row",
1413
- multiRow: "multi-row",
1414
- singleCell: "single-cell",
1415
- multiCell: "multi-cell"
1416
- };
1417
- const _DataGrid = class _DataGrid extends VividElement {
1418
- constructor() {
1419
- super();
1420
- this.noTabbing = false;
1421
- // eslint-disable-next-line @repo/repo/no-attribute-default-value
1422
- this.generateHeader = GenerateHeaderOptions.default;
1423
- this.rowsData = [];
1424
- this.columnDefinitions = null;
1425
- this.focusRowIndex = 0;
1426
- this.focusColumnIndex = 0;
1427
- /**
1428
- * @internal
1429
- */
1430
- this.fixedColumnsPositions = [];
1431
- this.behaviorOrchestrator = null;
1432
- this.generatedHeader = null;
1433
- this.isUpdatingFocus = false;
1434
- this.pendingFocusUpdate = false;
1435
- this.rowindexUpdateQueued = false;
1436
- this.columnDefinitionsStale = true;
1437
- this.generatedGridTemplateColumns = "";
1438
- this.focusOnCell = (rowIndex, columnIndex, scrollIntoView) => {
1439
- if (this.rowElements.length === 0) {
1440
- this.focusRowIndex = 0;
1441
- this.focusColumnIndex = 0;
1442
- return;
1443
- }
1444
- const focusRowIndex = Math.max(
1445
- 0,
1446
- Math.min(this.rowElements.length - 1, rowIndex)
1447
- );
1448
- const focusRow = this.rowElements[focusRowIndex];
1449
- const cells = focusRow.querySelectorAll(
1450
- '[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"], [data-vvd-component="data-grid-cell"]'
1451
- );
1452
- const focusColumnIndex = Math.max(
1453
- 0,
1454
- Math.min(cells.length - 1, columnIndex)
1455
- );
1456
- const focusTarget = cells[focusColumnIndex];
1457
- if (scrollIntoView && this.scrollHeight !== this.clientHeight && (focusRowIndex < this.focusRowIndex && this.scrollTop > 0 || focusRowIndex > this.focusRowIndex && this.scrollTop < this.scrollHeight - this.clientHeight)) {
1458
- focusTarget.scrollIntoView({ block: "center", inline: "center" });
1459
- }
1460
- focusTarget.focus();
1461
- };
1462
- this.onChildListChange = (mutations, _) => {
1463
- if (mutations && mutations.length) {
1464
- mutations.forEach((mutation) => {
1465
- mutation.addedNodes.forEach((newNode) => {
1466
- if (newNode.nodeType === 1 && (newNode.getAttribute("role") === "row" || newNode.getAttribute("row-type") === "default")) {
1467
- newNode.columnDefinitions = this.columnDefinitions;
1468
- }
1469
- });
1470
- });
1471
- this.queueRowIndexUpdate();
1472
- }
1473
- };
1474
- this.queueRowIndexUpdate = () => {
1475
- if (!this.rowindexUpdateQueued) {
1476
- this.rowindexUpdateQueued = true;
1477
- Updates$1.enqueue(this.updateRowIndexes);
1478
- }
1479
- };
1480
- this.updateRowIndexes = () => {
1481
- let newGridTemplateColumns = this.gridTemplateColumns;
1482
- if (newGridTemplateColumns === void 0) {
1483
- if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) {
1484
- const firstRow = this.rowElements[0];
1485
- this.generatedGridTemplateColumns = new Array(
1486
- firstRow.cellElements.length
1487
- ).fill("1fr").join(" ");
1488
- }
1489
- newGridTemplateColumns = this.generatedGridTemplateColumns;
1490
- }
1491
- this.rowElements.forEach((element, index) => {
1492
- const thisRow = element;
1493
- thisRow.rowIndex = index;
1494
- thisRow.gridTemplateColumns = newGridTemplateColumns;
1495
- if (this.columnDefinitionsStale) {
1496
- thisRow.columnDefinitions = this.columnDefinitions;
1497
- }
1498
- });
1499
- this.rowindexUpdateQueued = false;
1500
- this.columnDefinitionsStale = false;
1501
- };
1502
- this.#handleKeypress = (e) => {
1503
- if (e.key === "Enter" || e.key === " ") {
1504
- this.#handleClick(e);
1505
- }
1506
- };
1507
- this.#handleClick = ({ target, ctrlKey, shiftKey, metaKey }) => {
1508
- if (target.getAttribute("role") !== "gridcell" || target.getAttribute("cell-type") !== "default")
1509
- return;
1510
- if (this.selectionMode === DataGridSelectionMode.singleCell || this.selectionMode === DataGridSelectionMode.multiCell) {
1511
- this.#handleCellSelection({ target, ctrlKey, shiftKey, metaKey });
1512
- return;
1513
- }
1514
- if (this.selectionMode === DataGridSelectionMode.singleRow || this.selectionMode === DataGridSelectionMode.multiRow) {
1515
- this.#handleRowSelection({ target, ctrlKey, shiftKey, metaKey });
1516
- }
1517
- };
1518
- this.#handleCellSelection = ({
1519
- target,
1520
- ctrlKey,
1521
- shiftKey,
1522
- metaKey
1523
- }) => {
1524
- const cell = target;
1525
- if (this.selectionMode === DataGridSelectionMode.multiCell && (ctrlKey || shiftKey || metaKey)) {
1526
- cell.selected = !this.#selectedCells.includes(cell);
1527
- } else {
1528
- const cacheTargetSelection = cell.selected;
1529
- this._resetSelection(true);
1530
- cell.selected = !cacheTargetSelection;
1531
- }
1532
- };
1533
- this.#handleRowSelection = ({
1534
- target,
1535
- ctrlKey,
1536
- shiftKey,
1537
- metaKey
1538
- }) => {
1539
- const row = target.parentNode;
1540
- if (this.selectionMode === DataGridSelectionMode.multiRow && (ctrlKey || shiftKey || metaKey)) {
1541
- row.selected = !this.#selectedRows.includes(row);
1542
- } else {
1543
- const cacheTargetSelection = row.selected;
1544
- this._resetSelection(true);
1545
- row.selected = !cacheTargetSelection;
1546
- }
1547
- };
1548
- this.#changeHandler = {
1549
- handleChange(dataGrid, propertyName) {
1550
- if (propertyName === "columnDefinitions") {
1551
- if (dataGrid.$fastController.isConnected) {
1552
- dataGrid.toggleGeneratedHeader();
1553
- }
1554
- }
1555
- }
1556
- };
1557
- /**
1558
- * @internal
1559
- */
1560
- this._resetSelection = (clear = false) => {
1561
- const cells = Array.from(
1562
- this.querySelectorAll('[role="gridcell"], [cell-type="default"]')
1563
- );
1564
- const rows = Array.from(
1565
- this.querySelectorAll('[role="row"], [row-type="default"]')
1566
- );
1567
- if (this.selectionMode === DataGridSelectionMode.singleCell || this.selectionMode === DataGridSelectionMode.multiCell) {
1568
- for (const cell of cells) {
1569
- cell._selectable = true;
1570
- cell.selected = clear ? false : cell.selected || false;
1571
- }
1572
- for (const row of rows) {
1573
- row._selectable = false;
1574
- row.selected = false;
1575
- }
1576
- }
1577
- if (this.selectionMode === DataGridSelectionMode.none) {
1578
- for (const element of [...cells, ...rows]) {
1579
- element._selectable = false;
1580
- element.selected = false;
1581
- }
1582
- }
1583
- if (this.selectionMode === DataGridSelectionMode.singleRow || this.selectionMode === DataGridSelectionMode.multiRow) {
1584
- for (const cell of cells) {
1585
- cell._selectable = false;
1586
- cell.selected = false;
1587
- }
1588
- for (const row of rows) {
1589
- row._selectable = true;
1590
- row.selected = clear ? false : row.selected || false;
1591
- }
1592
- }
1593
- };
1594
- this.addEventListener("click", this.#handleClick);
1595
- this.addEventListener("keydown", this.#handleKeypress);
1596
- }
1597
- /**
1598
- * generates a gridTemplateColumns based on columndata array
1599
- */
1600
- static generateTemplateColumns(columnDefinitions) {
1601
- let templateColumns = "";
1602
- columnDefinitions.forEach((_) => {
1603
- templateColumns = `${templateColumns}${templateColumns === "" ? "" : " "}${"1fr"}`;
1604
- });
1605
- return templateColumns;
1606
- }
1607
- /**
1608
- * @internal
1609
- */
1610
- noTabbingChanged() {
1611
- if (this.$fastController.isConnected) {
1612
- this.#setTabIndex();
1613
- }
1614
- }
1615
- #setTabIndex() {
1616
- this.setAttribute(
1617
- "tabIndex",
1618
- this.noTabbing || this.contains(document.activeElement) ? "-1" : "0"
1619
- );
1620
- }
1621
- /**
1622
- * @internal
1623
- */
1624
- generateHeaderChanged() {
1625
- if (this.$fastController.isConnected) {
1626
- this.toggleGeneratedHeader();
1627
- }
1628
- }
1629
- /**
1630
- * @internal
1631
- */
1632
- gridTemplateColumnsChanged() {
1633
- if (this.$fastController.isConnected) {
1634
- this.updateRowIndexes();
1635
- if (this.fixedColumns && this.fixedColumns > 0) {
1636
- this.applyFixedColumns();
1637
- }
1638
- }
1639
- }
1640
- /**
1641
- * @internal
1642
- */
1643
- rowsDataChanged() {
1644
- if (this.columnDefinitions === null && this.rowsData.length > 0) {
1645
- this.columnDefinitions = _DataGrid.generateColumns(this.rowsData[0]);
1646
- }
1647
- if (this.$fastController.isConnected) {
1648
- this.toggleGeneratedHeader();
1649
- }
1650
- }
1651
- /**
1652
- * @internal
1653
- */
1654
- columnDefinitionsChanged() {
1655
- if (this.columnDefinitions === null) {
1656
- this.generatedGridTemplateColumns = "";
1657
- return;
1658
- }
1659
- this.generatedGridTemplateColumns = _DataGrid.generateTemplateColumns(
1660
- this.columnDefinitions
1661
- );
1662
- if (this.$fastController.isConnected) {
1663
- this.columnDefinitionsStale = true;
1664
- this.queueRowIndexUpdate();
1665
- }
1666
- }
1667
- /**
1668
- * @internal
1669
- */
1670
- headerCellItemTemplateChanged() {
1671
- if (this.$fastController.isConnected) {
1672
- if (this.generatedHeader !== null) {
1673
- this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate;
1674
- }
1675
- }
1676
- }
1677
- /**
1678
- * @internal
1679
- */
1680
- focusRowIndexChanged() {
1681
- if (this.$fastController.isConnected) {
1682
- this.queueFocusUpdate();
1683
- }
1684
- }
1685
- /**
1686
- * @internal
1687
- */
1688
- focusColumnIndexChanged() {
1689
- if (this.$fastController.isConnected) {
1690
- this.queueFocusUpdate();
1691
- }
1692
- }
1693
- /**
1694
- * @internal
1695
- */
1696
- fixedColumnsChanged() {
1697
- if (this.$fastController.isConnected) {
1698
- this.applyFixedColumns();
1699
- this.setupResizeObserver();
1700
- }
1701
- }
1702
- /**
1703
- * @internal
1704
- */
1705
- setupResizeObserver() {
1706
- if (this.resizeObserver) {
1707
- this.resizeObserver.disconnect();
1708
- this.resizeObserver = void 0;
1709
- }
1710
- if (typeof ResizeObserver !== "undefined" && this.fixedColumns && this.fixedColumns > 0) {
1711
- this.resizeObserver = new ResizeObserver(() => {
1712
- this.applyFixedColumns();
1713
- });
1714
- this.resizeObserver.observe(this);
1715
- }
1716
- }
1717
- /**
1718
- * @internal
1719
- */
1720
- connectedCallback() {
1721
- super.connectedCallback();
1722
- if (this.rowItemTemplate === void 0) {
1723
- this.rowItemTemplate = this.defaultRowItemTemplate;
1724
- }
1725
- if (this.behaviorOrchestrator === null) {
1726
- this.behaviorOrchestrator = ViewBehaviorOrchestrator.create(this);
1727
- this.$fastController.addBehavior(this.behaviorOrchestrator);
1728
- this.behaviorOrchestrator.addBehaviorFactory(
1729
- new RepeatDirective(
1730
- normalizeBinding((x) => x.rowsData),
1731
- normalizeBinding((x) => x.rowItemTemplate),
1732
- { positioning: true }
1733
- ),
1734
- this.appendChild(document.createComment(""))
1735
- );
1736
- }
1737
- this.toggleGeneratedHeader();
1738
- this.addEventListener("row-focused", this.handleRowFocus);
1739
- this.addEventListener(eventFocus, this.handleFocus);
1740
- this.addEventListener(eventKeyDown, this.handleKeydown);
1741
- this.addEventListener(eventFocusOut, this.handleFocusOut);
1742
- this.observer = new MutationObserver(this.onChildListChange);
1743
- this.observer.observe(this, { childList: true });
1744
- this.setupResizeObserver();
1745
- Updates$1.enqueue(this.queueRowIndexUpdate);
1746
- this.#setTabIndex();
1747
- Observable.getNotifier(this).subscribe(
1748
- this.#changeHandler,
1749
- "columnDefinitions"
1750
- );
1751
- }
1752
- /**
1753
- * @internal
1754
- */
1755
- disconnectedCallback() {
1756
- super.disconnectedCallback();
1757
- this.removeEventListener("row-focused", this.handleRowFocus);
1758
- this.removeEventListener(eventFocus, this.handleFocus);
1759
- this.removeEventListener(eventKeyDown, this.handleKeydown);
1760
- this.removeEventListener(
1761
- eventFocusOut,
1762
- this.handleFocusOut
1763
- );
1764
- this.observer.disconnect();
1765
- if (this.resizeObserver) {
1766
- this.resizeObserver.disconnect();
1767
- this.resizeObserver = void 0;
1768
- }
1769
- this.generatedHeader = null;
1770
- Observable.getNotifier(this).unsubscribe(
1771
- this.#changeHandler,
1772
- "columnDefinitions"
1773
- );
1774
- }
1775
- /**
1776
- * @internal
1777
- */
1778
- handleRowFocus(e) {
1779
- this.isUpdatingFocus = true;
1780
- const focusRow = e.target;
1781
- this.focusRowIndex = this.rowElements.indexOf(focusRow);
1782
- this.focusColumnIndex = focusRow.focusColumnIndex;
1783
- this.setAttribute("tabIndex", "-1");
1784
- this.isUpdatingFocus = false;
1785
- }
1786
- /**
1787
- * @internal
1788
- */
1789
- handleFocus(_) {
1790
- this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true);
1791
- }
1792
- /**
1793
- * @internal
1794
- */
1795
- handleFocusOut(e) {
1796
- if (e.relatedTarget === null || !this.contains(e.relatedTarget)) {
1797
- this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0");
1798
- }
1799
- }
1800
- /**
1801
- * @internal
1802
- */
1803
- handleKeydown(e) {
1804
- if (e.defaultPrevented) {
1805
- return;
1806
- }
1807
- let newFocusRowIndex;
1808
- const maxIndex = this.rowElements.length - 1;
1809
- const currentGridBottom = this.offsetHeight + this.scrollTop;
1810
- const lastRow = this.rowElements[maxIndex];
1811
- switch (e.key) {
1812
- case keyArrowUp:
1813
- e.preventDefault();
1814
- this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, true);
1815
- break;
1816
- case keyArrowDown:
1817
- e.preventDefault();
1818
- this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, true);
1819
- break;
1820
- case keyPageUp:
1821
- e.preventDefault();
1822
- if (this.rowElements.length === 0) {
1823
- this.focusOnCell(0, 0, false);
1824
- break;
1825
- }
1826
- if (this.focusRowIndex === 0) {
1827
- this.focusOnCell(0, this.focusColumnIndex, false);
1828
- return;
1829
- }
1830
- newFocusRowIndex = this.focusRowIndex - 1;
1831
- for (newFocusRowIndex; newFocusRowIndex >= 0; newFocusRowIndex--) {
1832
- const thisRow = this.rowElements[newFocusRowIndex];
1833
- if (thisRow.offsetTop < this.scrollTop) {
1834
- this.scrollTop = thisRow.offsetTop + thisRow.clientHeight - this.clientHeight;
1835
- break;
1836
- }
1837
- }
1838
- this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false);
1839
- break;
1840
- case keyPageDown:
1841
- e.preventDefault();
1842
- if (this.rowElements.length === 0) {
1843
- this.focusOnCell(0, 0, false);
1844
- break;
1845
- }
1846
- if (this.focusRowIndex >= maxIndex || lastRow.offsetTop + lastRow.offsetHeight <= currentGridBottom) {
1847
- this.focusOnCell(maxIndex, this.focusColumnIndex, false);
1848
- return;
1849
- }
1850
- newFocusRowIndex = this.focusRowIndex + 1;
1851
- for (newFocusRowIndex; newFocusRowIndex <= maxIndex; newFocusRowIndex++) {
1852
- const thisRow = this.rowElements[newFocusRowIndex];
1853
- if (thisRow.offsetTop + thisRow.offsetHeight > currentGridBottom) {
1854
- let stickyHeaderOffset = 0;
1855
- if (this.generateHeader === GenerateHeaderOptions.sticky && this.generatedHeader !== null) {
1856
- stickyHeaderOffset = this.generatedHeader.clientHeight;
1857
- }
1858
- this.scrollTop = thisRow.offsetTop - stickyHeaderOffset;
1859
- break;
1860
- }
1861
- }
1862
- this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false);
1863
- break;
1864
- case keyHome: {
1865
- if (e.ctrlKey) {
1866
- e.preventDefault();
1867
- this.focusOnCell(0, 0, true);
1868
- }
1869
- break;
1870
- }
1871
- case keyEnd: {
1872
- if (e.ctrlKey && this.columnDefinitions !== null) {
1873
- e.preventDefault();
1874
- this.focusOnCell(
1875
- this.rowElements.length - 1,
1876
- this.columnDefinitions.length - 1,
1877
- true
1878
- );
1879
- }
1880
- break;
1881
- }
1882
- }
1883
- }
1884
- queueFocusUpdate() {
1885
- if (this.isUpdatingFocus && this.contains(document.activeElement)) {
1886
- return;
1887
- }
1888
- if (this.pendingFocusUpdate === false) {
1889
- this.pendingFocusUpdate = true;
1890
- Updates$1.enqueue(() => this.updateFocus());
1891
- }
1892
- }
1893
- updateFocus() {
1894
- this.pendingFocusUpdate = false;
1895
- this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true);
1896
- }
1897
- toggleGeneratedHeader() {
1898
- if (this.generatedHeader !== null) {
1899
- this.removeChild(this.generatedHeader);
1900
- this.generatedHeader = null;
1901
- }
1902
- if (this.generateHeader !== GenerateHeaderOptions.none && this.columnDefinitions !== null) {
1903
- const generatedHeaderElement = document.createElement(
1904
- this.rowElementTag
1905
- );
1906
- this.generatedHeader = generatedHeaderElement;
1907
- this.generatedHeader.columnDefinitions = this.columnDefinitions;
1908
- this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns;
1909
- this.generatedHeader.rowType = this.generateHeader === GenerateHeaderOptions.sticky ? DataGridRowTypes.stickyHeader : DataGridRowTypes.header;
1910
- if (this.firstChild !== null) {
1911
- this.insertBefore(generatedHeaderElement, this.firstChild);
1912
- }
1913
- return;
1914
- }
1915
- }
1916
- /**
1917
- *
1918
- *
1919
- * @internal
1920
- */
1921
- slottedRowElementsChanged(_oldValue, _newValue) {
1922
- this._resetSelection();
1923
- }
1924
- get #selectedRows() {
1925
- return this.rowElements.filter((row) => row.selected);
1926
- }
1927
- get #selectedCells() {
1928
- return this.rowElements.reduce((acc, row) => {
1929
- const rowChildren = Array.from(row.children);
1930
- const selectedCells = rowChildren.filter(
1931
- (cell) => cell.selected
1932
- );
1933
- return acc.concat(selectedCells);
1934
- }, []);
1935
- }
1936
- selectionModeChanged(oldValue) {
1937
- if (oldValue === void 0) {
1938
- Updates$1.enqueue(this._resetSelection);
1939
- return;
1940
- }
1941
- this._resetSelection(true);
1942
- }
1943
- #handleKeypress;
1944
- #handleClick;
1945
- #handleCellSelection;
1946
- #handleRowSelection;
1947
- #changeHandler;
1948
- static generateColumns(rowData) {
1949
- return Object.keys(rowData).map((property, index) => {
1950
- return {
1951
- columnDataKey: property,
1952
- gridColumn: `${index}`
1953
- };
1954
- });
1955
- }
1956
- /**
1957
- * @internal
1958
- */
1959
- applyFixedColumns() {
1960
- if (!this.fixedColumns || this.fixedColumns <= 0) {
1961
- this.clearFixedColumns();
1962
- return;
1963
- }
1964
- this.calculateFixedColumnPositions();
1965
- this.applyFixedColumnStyling();
1966
- }
1967
- /**
1968
- * Applies fixed columns styling using cached positions
1969
- * @internal
1970
- */
1971
- applyFixedColumnStyling() {
1972
- this.rowElements.forEach((row) => {
1973
- const cells = row.querySelectorAll(
1974
- '[role="cell"], [role="gridcell"], [role="columnheader"], [cell-type="default"], [cell-type="columnheader"]'
1975
- );
1976
- this.fixedColumnsPositions.forEach((position, index) => {
1977
- if (index < cells.length) {
1978
- const gridCell = cells[index];
1979
- if (typeof gridCell.setFixedPosition === "function") {
1980
- gridCell.setFixedPosition(`${position}px`);
1981
- }
1982
- }
1983
- });
1984
- });
1985
- }
1986
- /**
1987
- * Calculates and caches fixed columns positions based on current layout
1988
- * @internal
1989
- */
1990
- calculateFixedColumnPositions() {
1991
- this.fixedColumnsPositions = [];
1992
- if (this.rowElements.length === 0) return;
1993
- const cells = this.rowElements[0].querySelectorAll(
1994
- '[role="cell"], [role="gridcell"], [role="columnheader"], [cell-type="default"], [cell-type="columnheader"]'
1995
- );
1996
- let accumulator = 0;
1997
- for (let i = 0; i < Math.min(this.fixedColumns, cells.length); i++) {
1998
- this.fixedColumnsPositions.push(accumulator);
1999
- accumulator += cells[i].offsetWidth;
2000
- }
2001
- }
2002
- /**
2003
- * Clears all fixed columns state and styling
2004
- * @internal
2005
- */
2006
- clearFixedColumns() {
2007
- if (this.rowElements.length === 0) {
2008
- this.fixedColumnsPositions = [];
2009
- return;
2010
- }
2011
- this.rowElements.forEach((row) => {
2012
- const cells = row.querySelectorAll(
2013
- '[role="cell"], [role="gridcell"], [role="columnheader"], [cell-type="default"], [cell-type="columnheader"]'
2014
- );
2015
- this.fixedColumnsPositions.forEach((_, index) => {
2016
- if (index < cells.length) {
2017
- const gridCell = cells[index];
2018
- if (typeof gridCell.setFixedPosition === "function") {
2019
- gridCell.setFixedPosition(void 0);
2020
- }
2021
- }
2022
- });
2023
- });
2024
- this.fixedColumnsPositions = [];
2025
- }
2026
- };
2027
- __decorateClass([
2028
- attr({ attribute: "no-tabbing", mode: "boolean" })
2029
- ], _DataGrid.prototype, "noTabbing");
2030
- __decorateClass([
2031
- attr({ attribute: "generate-header" })
2032
- ], _DataGrid.prototype, "generateHeader");
2033
- // @ts-expect-error Type is incorrectly non-optional
2034
- __decorateClass([
2035
- attr({ attribute: "grid-template-columns" })
2036
- ], _DataGrid.prototype, "gridTemplateColumns");
2037
- __decorateClass([
2038
- observable
2039
- ], _DataGrid.prototype, "rowsData");
2040
- __decorateClass([
2041
- observable
2042
- ], _DataGrid.prototype, "columnDefinitions");
2043
- __decorateClass([
2044
- observable
2045
- ], _DataGrid.prototype, "rowItemTemplate");
2046
- __decorateClass([
2047
- observable
2048
- ], _DataGrid.prototype, "cellItemTemplate");
2049
- __decorateClass([
2050
- observable
2051
- ], _DataGrid.prototype, "headerCellItemTemplate");
2052
- __decorateClass([
2053
- observable
2054
- ], _DataGrid.prototype, "focusRowIndex");
2055
- __decorateClass([
2056
- observable
2057
- ], _DataGrid.prototype, "focusColumnIndex");
2058
- __decorateClass([
2059
- attr({ attribute: "fixed-columns", converter: nullableNumberConverter })
2060
- ], _DataGrid.prototype, "fixedColumns");
2061
- __decorateClass([
2062
- observable
2063
- ], _DataGrid.prototype, "defaultRowItemTemplate");
2064
- __decorateClass([
2065
- observable
2066
- ], _DataGrid.prototype, "rowElementTag");
2067
- __decorateClass([
2068
- observable
2069
- ], _DataGrid.prototype, "rowElements");
2070
- __decorateClass([
2071
- observable
2072
- ], _DataGrid.prototype, "slottedRowElements");
2073
- __decorateClass([
2074
- attr({ attribute: "selection-mode" })
2075
- ], _DataGrid.prototype, "selectionMode");
2076
- let DataGrid = _DataGrid;
2077
-
2078
- function createRowItemTemplate(context) {
2079
- const rowTag = context.tagFor(DataGridRow);
2080
- return html`
2081
- <${rowTag}
2082
- :rowData="${(x) => x}"
2083
- :cellItemTemplate="${(_, c) => c.parent.cellItemTemplate}"
2084
- :headerCellItemTemplate="${(_, c) => c.parent.headerCellItemTemplate}"
2085
- ></${rowTag}>
2086
- `;
2087
- }
2088
- function getMultiSelectAriaState(x) {
2089
- return x.selectionMode === void 0 || x.selectionMode === DataGridSelectionMode.none ? null : x.selectionMode.includes("multi") ? "true" : "false";
2090
- }
2091
- function setHeaderRow(x) {
2092
- if (x.columnDefinitions === null) {
2093
- const headerRow = x.querySelector(
2094
- '[cell-type="columnheader"]'
2095
- )?.parentElement;
2096
- if (x.generateHeader === GenerateHeaderOptions.default && (headerRow?.getAttribute("row-type") === DataGridRowTypes.header || headerRow?.getAttribute("row-type") === DataGridRowTypes.stickyHeader)) {
2097
- return;
2098
- }
2099
- if (headerRow) {
2100
- const rowType = x.generateHeader === GenerateHeaderOptions.sticky ? DataGridRowTypes.stickyHeader : DataGridRowTypes.header;
2101
- headerRow.setAttribute("row-type", rowType);
2102
- }
2103
- }
2104
- }
2105
- function handleColumnSort(_, { event }) {
2106
- event.stopPropagation();
2107
- }
2108
- const DataGridTemplate = (context) => {
2109
- const rowItemTemplate = createRowItemTemplate(context);
2110
- const rowTag = context.tagFor(DataGridRow, true);
2111
- return html`
2112
- <template
2113
- aria-multiselectable="${getMultiSelectAriaState}"
2114
- role="grid"
2115
- tabindex="0"
2116
- @sort="${handleColumnSort}"
2117
- :rowElementTag="${() => rowTag}"
2118
- :defaultRowItemTemplate="${rowItemTemplate}"
2119
- ${children({
2120
- property: "rowElements",
2121
- filter: elements("[role=row],[data-vvd-component=data-grid-row]")
2122
- })}
2123
- >
2124
- <div class="base">
2125
- ${setHeaderRow}
2126
- <slot ${slotted("slottedRowElements")}></slot>
2127
- </div>
2128
- </template>
2129
- `;
2130
- };
2131
-
2132
- function calculateAriaSelectedValue$1(x) {
2133
- if (x._selectable && x.selected) return "true";
2134
- if (x._selectable && !x.selected) return "false";
2135
- return null;
2136
- }
2137
- function createCellItemTemplate(context) {
2138
- const cellTag = context.tagFor(DataGridCell);
2139
- return html`
2140
- <${cellTag}
2141
- cell-type="${(x) => x.isRowHeader ? "rowheader" : void 0}"
2142
- grid-column="${(_, c) => c.index + 1}"
2143
- :rowData="${(_, c) => c.parent.rowData}"
2144
- :columnDefinition="${(x) => x}"
2145
- selected="${(_, c) => c.parent.ariaSelected === "true" ? true : null}"
2146
- ></${cellTag}>
2147
- `;
2148
- }
2149
- function createHeaderCellItemTemplate(context) {
2150
- const cellTag = context.tagFor(DataGridCell);
2151
- return html`
2152
- <${cellTag}
2153
- cell-type="columnheader"
2154
- grid-column="${(_, c) => c.index + 1}"
2155
- :columnDefinition="${(x) => x}"
2156
- ></${cellTag}>
2157
- `;
2158
- }
2159
- const DataGridRowTemplate = (context) => {
2160
- const cellItemTemplate = createCellItemTemplate(context);
2161
- const headerCellItemTemplate = createHeaderCellItemTemplate(context);
2162
- const getBaseClasses = (x) => classNames("base", ["selected", !!x.selected]);
2163
- return html`
2164
- <template
2165
- ${applyHostSemantics({
2166
- role: "row",
2167
- ariaSelected: calculateAriaSelectedValue$1
2168
- })}
2169
- class="${(x) => x.rowType !== "default" ? x.rowType : ""}"
2170
- :defaultCellItemTemplate="${cellItemTemplate}"
2171
- :defaultHeaderCellItemTemplate="${headerCellItemTemplate}"
2172
- ${children({
2173
- property: "cellElements",
2174
- filter: elements(
2175
- '[role="cell"],[role="gridcell"],[role="columnheader"],[role="rowheader"],[data-vvd-component="data-grid-cell"]'
2176
- )
2177
- })}
2178
- >
2179
- <div
2180
- class="${getBaseClasses}"
2181
- style="grid-template-columns: ${(x) => x.gridTemplateColumns};"
2182
- >
2183
- <slot ${slotted("slottedCellElements")}></slot>
2184
- </div>
2185
- </template>
2186
- `;
2187
- };
2188
-
2189
- function shouldShowSortIcons(x) {
2190
- return x.cellType === "columnheader" && x.sortDirection !== void 0 && x.sortDirection !== DataGridCellSortStates.other;
2191
- }
2192
- function getSortIcon(x) {
2193
- if (x.sortDirection === DataGridCellSortStates.ascending) {
2194
- return "sort-asc-solid";
2195
- }
2196
- if (x.sortDirection === DataGridCellSortStates.descending) {
2197
- return "sort-desc-solid";
2198
- }
2199
- return "sort-solid";
2200
- }
2201
- function calculateAriaSelectedValue(x) {
2202
- if (x._selectable && x.selected) return "true";
2203
- if (x._selectable && !x.selected) return "false";
2204
- return null;
2205
- }
2206
- function renderSortIcons(c) {
2207
- const iconTag = c.tagFor(Icon);
2208
- return html`
2209
- ${when(
2210
- shouldShowSortIcons,
2211
- html`
2212
- <${iconTag} class="header-icon" name="${getSortIcon}"></${iconTag}>
2213
- `
2214
- )}
2215
- `;
2216
- }
2217
- function shouldAnnounceSortState(x) {
2218
- return x.cellType === DataGridCellTypes.columnHeader && x.sortDirection !== void 0;
2219
- }
2220
- function getSortStateKey(x) {
2221
- return x.sortDirection ?? DataGridCellSortStates.none;
2222
- }
2223
- function getLocalizedSortStatus(x) {
2224
- const direction = getSortStateKey(x);
2225
- const sortStatus = x.locale.dataGrid.cell.sortStatus;
2226
- return sortStatus?.[direction];
2227
- }
2228
- function getLocalizedSortInstruction(x) {
2229
- const direction = getSortStateKey(x);
2230
- const sortInstruction = x.locale.dataGrid.cell.sortInstruction;
2231
- return sortInstruction?.[direction];
2232
- }
2233
- function getSortAnnouncement(x) {
2234
- return [getLocalizedSortStatus(x), getLocalizedSortInstruction(x)].filter((part) => !!part).join(" ").trim();
2235
- }
2236
- function handleKeyDown(x, e) {
2237
- if (e.key === keyEnter || e.key === keySpace) {
2238
- const target = e.target;
2239
- if (target.closest('[slot="action-items"]')) return true;
2240
- x._handleInteraction();
2241
- }
2242
- return true;
2243
- }
2244
- function handleClick(x, e) {
2245
- const target = e.target;
2246
- if (target.closest('[slot="action-items"]')) return true;
2247
- x._handleInteraction();
2248
- return true;
2249
- }
2250
- const DataGridCellTemplate = (context) => {
2251
- const visuallyHiddenTagName = context.tagFor(VisuallyHidden);
2252
- const getBaseClasses = ({
2253
- selected,
2254
- _actionItemsSlottedContent
2255
- }) => classNames(
2256
- "base",
2257
- ["selected", !!selected],
2258
- ["has-action-items", Boolean(_actionItemsSlottedContent?.length)]
2259
- );
2260
- return html`
2261
- <template
2262
- tabindex="-1"
2263
- ${applyHostSemantics({
2264
- role: (x) => DataGridCellRole[x.cellType] ?? DataGridCellRole.default,
2265
- ariaSelected: calculateAriaSelectedValue,
2266
- ariaSort: (x) => x.sortDirection ?? null
2267
- })}
2268
- @click="${(x, c) => handleClick(x, c.event)}"
2269
- @keydown="${(x, c) => handleKeyDown(x, c.event)}"
2270
- >
2271
- <div class="${getBaseClasses}">
2272
- <div
2273
- class="content"
2274
- role="${(x) => shouldShowSortIcons(x) ? "button" : void 0}"
2275
- >
2276
- ${(x) => x.selected ? html`<${visuallyHiddenTagName}
2277
- data-announcement="selection"
2278
- >
2279
- ${(x2) => x2.locale.dataGrid.cell.selected}
2280
- </${visuallyHiddenTagName}>` : null}
2281
- <slot></slot>
2282
- ${when(
2283
- shouldShowSortIcons,
2284
- html`<${visuallyHiddenTagName}
2285
- data-announcement="button-role"
2286
- >
2287
- ${(x) => x.locale.dataGrid.cell.button}
2288
- </${visuallyHiddenTagName}>
2289
- `
2290
- )}
2291
- ${when(
2292
- shouldAnnounceSortState,
2293
- html`<${visuallyHiddenTagName}
2294
- aria-live="polite"
2295
- data-announcement="sort-state"
2296
- >
2297
- ${getSortAnnouncement}
2298
- </${visuallyHiddenTagName}>`
2299
- )}
2300
- ${(_) => renderSortIcons(context)}
2301
- </div>
2302
- <slot
2303
- name="action-items"
2304
- ${slotted("_actionItemsSlottedContent")}
2305
- ></slot>
2306
- </div>
2307
- </template>
2308
- `;
2309
- };
2310
-
2311
- const dataGridCellDefinition = defineVividComponent(
2312
- "data-grid-cell",
2313
- DataGridCell,
2314
- DataGridCellTemplate,
2315
- [iconDefinition, visuallyHiddenDefinition],
2316
- {
2317
- styles: dataGridCellStyles
2318
- }
2319
- );
2320
- const dataGridRowDefinition = defineVividComponent(
2321
- "data-grid-row",
2322
- DataGridRow,
2323
- DataGridRowTemplate,
2324
- [dataGridCellDefinition],
2325
- {
2326
- styles: dataGridRowStyles
2327
- }
2328
- );
2329
- const dataGridDefinition = defineVividComponent(
2330
- "data-grid",
2331
- DataGrid,
2332
- DataGridTemplate,
2333
- [dataGridRowDefinition],
2334
- {
2335
- styles: dataGridStyles
2336
- }
2337
- );
2338
- const registerDataGrid = createRegisterFunction(dataGridDefinition);
2339
-
1
+ import "../unbundled/definition2.js";
2
+ import { a as DataGridCell, i as registerDataGrid, n as dataGridDefinition, o as DataGridRow, r as dataGridRowDefinition, s as DataGrid, t as dataGridCellDefinition } from "../unbundled/definition32.js";
2340
3
  export { DataGridCell as VwcDataGridCellElement, DataGrid as VwcDataGridElement, DataGridRow as VwcDataGridRowElement, dataGridCellDefinition, dataGridDefinition, dataGridRowDefinition, registerDataGrid };