spell-ui 0.8.5 → 0.8.7

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 (722) hide show
  1. package/README-components.md +14 -6
  2. package/README-frameworks.md +22 -12
  3. package/README-migrating.md +7 -6
  4. package/README-runtime.md +14 -13
  5. package/README-site.md +11 -11
  6. package/README-themes.md +38 -11
  7. package/README.md +61 -73
  8. package/dist/Dragging-CMZoLEWQ.js +169 -0
  9. package/dist/Dragging-CMZoLEWQ.js.map +1 -0
  10. package/dist/{MarkdownEngine-CbuT9Mjc.js → MarkdownEngine-CW1WGqNp.js} +122 -100
  11. package/dist/MarkdownEngine-CW1WGqNp.js.map +1 -0
  12. package/dist/{PrefStore-CeaTtjTz.js → PrefStore-Qv0e5y04.js} +22 -22
  13. package/dist/PrefStore-Qv0e5y04.js.map +1 -0
  14. package/dist/ScrollingRow-7n7Z-HIE.js +88 -0
  15. package/dist/ScrollingRow-7n7Z-HIE.js.map +1 -0
  16. package/dist/SitePages-CciwREek.js +51 -0
  17. package/dist/SitePages-CciwREek.js.map +1 -0
  18. package/dist/{SlottedItems-Ch0tzzlL.js → SlottedItems-Du3aJwG1.js} +22 -22
  19. package/dist/{SlottedItems-Ch0tzzlL.js.map → SlottedItems-Du3aJwG1.js.map} +1 -1
  20. package/dist/ThemeDraft-B7NPif4d.js +805 -0
  21. package/dist/ThemeDraft-B7NPif4d.js.map +1 -0
  22. package/dist/TreeMeasure-BVJeGb1L.js +42 -0
  23. package/dist/TreeMeasure-BVJeGb1L.js.map +1 -0
  24. package/dist/UIButton-DFEds67r.js +6 -0
  25. package/dist/UIButton-DFEds67r.js.map +1 -0
  26. package/dist/UIInput-BodVbUoQ.js +6 -0
  27. package/dist/UIInput-BodVbUoQ.js.map +1 -0
  28. package/dist/{UIKeys-DJF2TIKE.js → UIKeys-Rh_gUZjP.js} +10 -9
  29. package/dist/UIKeys-Rh_gUZjP.js.map +1 -0
  30. package/dist/UILabel-DgJUBzB_.js +6 -0
  31. package/dist/UILabel-DgJUBzB_.js.map +1 -0
  32. package/dist/UIMenu-zdcAtwTa.js +42 -0
  33. package/dist/UIMenu-zdcAtwTa.js.map +1 -0
  34. package/dist/{UIRuntime-BBuehGly.js → UIRuntime-KH309p5B.js} +398 -207
  35. package/dist/UIRuntime-KH309p5B.js.map +1 -0
  36. package/dist/_spell-element/DOMElement.d.ts +62 -5
  37. package/dist/_spell-element/MoveAndResize.d.ts +75 -0
  38. package/dist/_spell-element/UIComponent.d.ts +42 -0
  39. package/dist/_spell-element/elements.types.d.ts +47 -0
  40. package/dist/_spell-element/index.d.ts +1 -0
  41. package/dist/_spell-element/vocabulary.types.d.ts +34 -2
  42. package/dist/{runtime → _util}/Api.d.ts +14 -4
  43. package/dist/_util/Dragging.d.ts +148 -0
  44. package/dist/_util/ListSelection.d.ts +46 -0
  45. package/dist/{util → _util}/LoadOnce.d.ts +9 -1
  46. package/dist/_util/ReconnectingSocket.d.ts +51 -0
  47. package/dist/_util/diagram/DiagramColumns.d.ts +14 -0
  48. package/dist/_util/diagram/DiagramLayout.d.ts +119 -0
  49. package/dist/_util/diagram/DiagramSVG.d.ts +17 -0
  50. package/dist/_util/dom.d.ts +10 -0
  51. package/dist/_util/fetching.d.ts +92 -0
  52. package/dist/_util/measures/Dimension.d.ts +63 -0
  53. package/dist/_util/measures/MeasureSystem.d.ts +66 -0
  54. package/dist/_util/measures/dimensions.generated.d.ts +16 -0
  55. package/dist/_util/persist/ColorScheme.d.ts +6 -0
  56. package/dist/_util/persist/ServerPlace.d.ts +42 -0
  57. package/dist/_util/persist/WaitedOnPlace.d.ts +27 -0
  58. package/dist/_util/persist/persist.types.d.ts +21 -2
  59. package/dist/_util/timing.d.ts +10 -1
  60. package/dist/api.js +8 -7
  61. package/dist/api.js.map +1 -1
  62. package/dist/components/ComponentDefinitions.d.ts +29 -0
  63. package/dist/components/components.es.d.ts +13 -0
  64. package/dist/components/components.types.d.ts +113 -8
  65. package/dist/components/ui-accordion/UIAccordion.d.ts +1 -0
  66. package/dist/components/ui-accordion/UIAccordion.en.d.ts +1 -0
  67. package/dist/components/ui-action/UIAction.en.d.ts +5 -1
  68. package/dist/components/ui-ad/UIAd.d.ts +1 -0
  69. package/dist/components/ui-ad/UIAd.en.d.ts +1 -0
  70. package/dist/components/ui-breadcrumbs/UIBreadcrumb.d.ts +1 -0
  71. package/dist/components/ui-breadcrumbs/UIBreadcrumb.en.d.ts +1 -0
  72. package/dist/components/ui-breadcrumbs/UIBreadcrumbs.d.ts +1 -0
  73. package/dist/components/ui-breadcrumbs/UIBreadcrumbs.en.d.ts +1 -0
  74. package/dist/components/ui-button/UIButton.d.ts +8 -3
  75. package/dist/components/ui-button/UIButton.en.d.ts +9 -4
  76. package/dist/components/ui-button/UIButton.es.d.ts +6 -0
  77. package/dist/components/ui-button/UIButton.fallback.d.ts +8 -3
  78. package/dist/components/ui-button/UIButtons.d.ts +1 -0
  79. package/dist/components/ui-button/UIButtons.en.d.ts +1 -0
  80. package/dist/components/ui-button/UIOr.d.ts +1 -0
  81. package/dist/components/ui-button/UIOr.en.d.ts +1 -0
  82. package/dist/components/ui-calendar/UICalendar.d.ts +6 -0
  83. package/dist/components/ui-calendar/UICalendar.en.d.ts +6 -0
  84. package/dist/components/ui-calendar/UICalendar.fallback.d.ts +6 -0
  85. package/dist/components/ui-card/CardClicks.d.ts +40 -0
  86. package/dist/components/ui-card/UICard.d.ts +41 -0
  87. package/dist/components/ui-card/UICard.en.d.ts +49 -0
  88. package/dist/components/ui-card/UICard.es.d.ts +1 -0
  89. package/dist/components/ui-card/UICards.d.ts +31 -0
  90. package/dist/components/ui-card/UICards.en.d.ts +31 -0
  91. package/dist/components/ui-card/UICards.es.d.ts +8 -0
  92. package/dist/components/ui-checkbox/CheckControl.d.ts +7 -0
  93. package/dist/components/ui-checkbox/UICheckbox.d.ts +7 -0
  94. package/dist/components/ui-checkbox/UICheckbox.en.d.ts +7 -0
  95. package/dist/components/ui-checkbox/UICheckbox.es.d.ts +1 -0
  96. package/dist/components/ui-checkbox/UICheckbox.fallback.d.ts +7 -0
  97. package/dist/components/ui-checkbox/UICheckbox.types.d.ts +5 -0
  98. package/dist/components/ui-checkbox/UIRadio.d.ts +8 -0
  99. package/dist/components/ui-checkbox/UIRadio.en.d.ts +6 -0
  100. package/dist/components/ui-code/UICode.en.d.ts +1 -0
  101. package/dist/components/ui-comment/UIComment.d.ts +1 -0
  102. package/dist/components/ui-comment/UIComment.en.d.ts +1 -0
  103. package/dist/components/ui-comment/UIComments.d.ts +1 -0
  104. package/dist/components/ui-comment/UIComments.en.d.ts +1 -0
  105. package/dist/components/ui-components/PackHotSwap.d.ts +17 -1
  106. package/dist/components/ui-components/UIComponents.d.ts +1 -0
  107. package/dist/components/ui-components/UIComponents.en.d.ts +1 -0
  108. package/dist/components/ui-container/UIContainer.d.ts +11 -0
  109. package/dist/components/ui-container/UIContainer.en.d.ts +7 -0
  110. package/dist/components/ui-container/UIContainer.es.d.ts +1 -0
  111. package/dist/components/ui-diagram/UIDiagram.d.ts +268 -0
  112. package/dist/components/ui-diagram/UIDiagram.en.d.ts +106 -0
  113. package/dist/components/ui-diagram/UIDiagram.es.d.ts +37 -0
  114. package/dist/components/ui-diagram/UIDiagramNode.d.ts +98 -0
  115. package/dist/components/ui-diagram/UIDiagramNode.en.d.ts +38 -0
  116. package/dist/components/ui-diagram/UIDiagramNode.es.d.ts +16 -0
  117. package/dist/components/ui-diagram/index.d.ts +8 -0
  118. package/dist/components/ui-dimension/UIDimension.d.ts +81 -0
  119. package/dist/components/ui-dimension/UIDimension.en.d.ts +54 -0
  120. package/dist/components/ui-dimension/UIDimension.es.d.ts +22 -0
  121. package/dist/components/ui-dimension/index.d.ts +2 -0
  122. package/dist/components/ui-dimmer/UIDimmer.d.ts +6 -1
  123. package/dist/components/ui-dimmer/UIDimmer.en.d.ts +1 -0
  124. package/dist/components/ui-dimmer/UIDimmer.es.d.ts +1 -1
  125. package/dist/components/ui-divider/UIDivider.d.ts +2 -0
  126. package/dist/components/ui-divider/UIDivider.en.d.ts +2 -0
  127. package/dist/components/ui-divider/UIDivider.es.d.ts +1 -0
  128. package/dist/components/ui-dropdown/UIDropdown.d.ts +6 -0
  129. package/dist/components/ui-dropdown/UIDropdown.en.d.ts +6 -0
  130. package/dist/components/ui-dropdown/UIDropdown.fallback.d.ts +6 -0
  131. package/dist/components/ui-embed/UIEmbed.d.ts +1 -0
  132. package/dist/components/ui-embed/UIEmbed.en.d.ts +1 -0
  133. package/dist/components/ui-emoji/UIEmoji.d.ts +1 -0
  134. package/dist/components/ui-emoji/UIEmoji.en.d.ts +1 -0
  135. package/dist/components/ui-example/UIExample.en.d.ts +4 -2
  136. package/dist/components/ui-example/UIExample.es.d.ts +3 -2
  137. package/dist/components/ui-feed/UIFeed.d.ts +1 -0
  138. package/dist/components/ui-feed/UIFeed.en.d.ts +1 -0
  139. package/dist/components/ui-feed/UIFeedEvent.d.ts +1 -0
  140. package/dist/components/ui-feed/UIFeedEvent.en.d.ts +1 -0
  141. package/dist/components/ui-flag/UIFlag.d.ts +1 -0
  142. package/dist/components/ui-flag/UIFlag.en.d.ts +1 -0
  143. package/dist/components/ui-flyout/UIFlyout.d.ts +1 -0
  144. package/dist/components/ui-flyout/UIFlyout.en.d.ts +1 -0
  145. package/dist/components/ui-form/FormBinding.d.ts +13 -1
  146. package/dist/components/ui-form/FormFields.d.ts +4 -4
  147. package/dist/components/ui-form/UIField.d.ts +30 -3
  148. package/dist/components/ui-form/UIField.en.d.ts +9 -0
  149. package/dist/components/ui-form/UIField.es.d.ts +6 -0
  150. package/dist/components/ui-form/UIFields.d.ts +1 -0
  151. package/dist/components/ui-form/UIFields.en.d.ts +1 -0
  152. package/dist/components/ui-form/UIForm.d.ts +15 -0
  153. package/dist/components/ui-form/UIForm.en.d.ts +6 -0
  154. package/dist/components/ui-form/UIRepeat.d.ts +1 -0
  155. package/dist/components/ui-form/UIRepeat.en.d.ts +1 -0
  156. package/dist/components/ui-form/index.d.ts +2 -1
  157. package/dist/components/ui-grid/UIColumn.d.ts +1 -0
  158. package/dist/components/ui-grid/UIColumn.en.d.ts +1 -0
  159. package/dist/components/ui-grid/UIGrid.d.ts +1 -0
  160. package/dist/components/ui-grid/UIGrid.en.d.ts +1 -0
  161. package/dist/components/ui-grid/UIRow.d.ts +1 -0
  162. package/dist/components/ui-grid/UIRow.en.d.ts +1 -0
  163. package/dist/components/ui-icon/UIIcon.d.ts +3 -2
  164. package/dist/components/ui-icon/UIIcon.en.d.ts +3 -2
  165. package/dist/components/ui-icon/UIIcons.d.ts +1 -0
  166. package/dist/components/ui-icon/UIIcons.en.d.ts +1 -0
  167. package/dist/components/ui-icon-picker/UIIconPicker.d.ts +6 -0
  168. package/dist/components/ui-icon-picker/UIIconPicker.en.d.ts +6 -0
  169. package/dist/components/ui-icon-picker/UIIconPicker.fallback.d.ts +6 -0
  170. package/dist/components/ui-image/UIImage.d.ts +34 -0
  171. package/dist/components/ui-image/UIImage.en.d.ts +23 -0
  172. package/dist/components/ui-image/UIImage.es.d.ts +2 -0
  173. package/dist/components/ui-image/UIImages.d.ts +1 -0
  174. package/dist/components/ui-image/UIImages.en.d.ts +1 -0
  175. package/dist/components/ui-include/UIInclude.d.ts +1 -0
  176. package/dist/components/ui-include/UIInclude.en.d.ts +1 -0
  177. package/dist/components/ui-input/TextControl.d.ts +7 -0
  178. package/dist/components/ui-input/UIInput.d.ts +22 -3
  179. package/dist/components/ui-input/UIInput.en.d.ts +9 -2
  180. package/dist/components/ui-input/UIInput.es.d.ts +2 -0
  181. package/dist/components/ui-input/UIInput.fallback.d.ts +9 -2
  182. package/dist/components/ui-input/UITextarea.d.ts +20 -0
  183. package/dist/components/ui-input/UITextarea.en.d.ts +15 -0
  184. package/dist/components/ui-input/UITextarea.es.d.ts +4 -0
  185. package/dist/components/ui-item/UIItem.d.ts +27 -4
  186. package/dist/components/ui-item/UIItem.en.d.ts +5 -1
  187. package/dist/components/ui-items/UIItems.d.ts +1 -0
  188. package/dist/components/ui-items/UIItems.en.d.ts +1 -0
  189. package/dist/components/ui-json/JsonChild.d.ts +30 -0
  190. package/dist/components/ui-json/UIJson.d.ts +128 -0
  191. package/dist/components/ui-json/UIJson.en.d.ts +71 -0
  192. package/dist/components/ui-json/UIJson.es.d.ts +12 -0
  193. package/dist/components/ui-json/index.d.ts +3 -0
  194. package/dist/components/ui-keys/UIKeys.d.ts +1 -0
  195. package/dist/components/ui-keys/UIKeys.en.d.ts +1 -0
  196. package/dist/components/ui-label/UILabel.d.ts +2 -0
  197. package/dist/components/ui-label/UILabel.en.d.ts +2 -0
  198. package/dist/components/ui-label/UILabel.es.d.ts +1 -0
  199. package/dist/components/ui-label/UILabels.d.ts +1 -0
  200. package/dist/components/ui-label/UILabels.en.d.ts +1 -0
  201. package/dist/components/ui-list/UIList.d.ts +2 -0
  202. package/dist/components/ui-list/UIList.en.d.ts +2 -0
  203. package/dist/components/ui-list/UIList.es.d.ts +1 -0
  204. package/dist/components/ui-loader/UILoader.d.ts +1 -0
  205. package/dist/components/ui-loader/UILoader.en.d.ts +1 -0
  206. package/dist/components/ui-markdown/MarkdownBox.d.ts +143 -0
  207. package/dist/components/ui-markdown/MarkdownEngine.d.ts +14 -2
  208. package/dist/components/ui-markdown/MarkdownFormats.d.ts +95 -0
  209. package/dist/components/ui-markdown/MarkdownSource.d.ts +57 -0
  210. package/dist/components/ui-markdown/UIMarkdown.d.ts +126 -6
  211. package/dist/components/ui-markdown/UIMarkdown.en.d.ts +111 -8
  212. package/dist/components/ui-markdown/UIMarkdown.es.d.ts +29 -1
  213. package/dist/components/ui-markdown/UIMarkdown.types.d.ts +26 -0
  214. package/dist/components/ui-menu/ScrollingRow.d.ts +79 -0
  215. package/dist/components/ui-menu/TitleFit.d.ts +3 -0
  216. package/dist/components/ui-menu/UIMenu.d.ts +97 -4
  217. package/dist/components/ui-menu/UIMenu.en.d.ts +50 -1
  218. package/dist/components/ui-menu/UIMenu.es.d.ts +4 -0
  219. package/dist/components/ui-message/UIMessage.d.ts +2 -0
  220. package/dist/components/ui-message/UIMessage.en.d.ts +2 -0
  221. package/dist/components/ui-message/UIMessage.es.d.ts +1 -0
  222. package/dist/components/ui-modal/UIModal.d.ts +1 -0
  223. package/dist/components/ui-modal/UIModal.en.d.ts +1 -0
  224. package/dist/components/ui-nag/UINag.d.ts +1 -0
  225. package/dist/components/ui-nag/UINag.en.d.ts +1 -0
  226. package/dist/components/ui-page/UIPage.d.ts +15 -0
  227. package/dist/components/ui-page/UIPage.en.d.ts +15 -0
  228. package/dist/components/ui-page/UIPage.es.d.ts +1 -0
  229. package/dist/components/ui-panel/UIPanel.d.ts +6 -0
  230. package/dist/components/ui-panel/UIPanel.en.d.ts +33 -20
  231. package/dist/components/ui-parts/UIActions.d.ts +1 -0
  232. package/dist/components/ui-parts/UIActions.en.d.ts +1 -0
  233. package/dist/components/ui-parts/UIAuthor.d.ts +1 -0
  234. package/dist/components/ui-parts/UIAuthor.en.d.ts +1 -0
  235. package/dist/components/ui-parts/UIAvatar.d.ts +1 -0
  236. package/dist/components/ui-parts/UIAvatar.en.d.ts +1 -0
  237. package/dist/components/ui-parts/UIContent.d.ts +1 -0
  238. package/dist/components/ui-parts/UIContent.en.d.ts +1 -0
  239. package/dist/components/ui-parts/UIDate.d.ts +1 -0
  240. package/dist/components/ui-parts/UIDate.en.d.ts +1 -0
  241. package/dist/components/ui-parts/UIDescription.d.ts +1 -0
  242. package/dist/components/ui-parts/UIDescription.en.d.ts +1 -0
  243. package/dist/components/ui-parts/UIDetail.d.ts +1 -0
  244. package/dist/components/ui-parts/UIDetail.en.d.ts +1 -0
  245. package/dist/components/ui-parts/UIExtra.d.ts +1 -0
  246. package/dist/components/ui-parts/UIExtra.en.d.ts +1 -0
  247. package/dist/components/ui-parts/UIHeader.d.ts +3 -1
  248. package/dist/components/ui-parts/UIHeader.en.d.ts +3 -1
  249. package/dist/components/ui-parts/UIMeta.d.ts +1 -0
  250. package/dist/components/ui-parts/UIMeta.en.d.ts +1 -0
  251. package/dist/components/ui-parts/UIParts.types.d.ts +15 -1
  252. package/dist/components/ui-parts/UISummary.d.ts +1 -0
  253. package/dist/components/ui-parts/UISummary.en.d.ts +1 -0
  254. package/dist/components/ui-parts/UITitle.d.ts +1 -0
  255. package/dist/components/ui-parts/UITitle.en.d.ts +1 -0
  256. package/dist/components/ui-parts/UIValue.d.ts +1 -0
  257. package/dist/components/ui-parts/UIValue.en.d.ts +1 -0
  258. package/dist/components/ui-placeholder/UIPlaceholder.d.ts +1 -0
  259. package/dist/components/ui-placeholder/UIPlaceholder.en.d.ts +1 -0
  260. package/dist/components/ui-placeholder/UIPlaceholderHeader.d.ts +1 -0
  261. package/dist/components/ui-placeholder/UIPlaceholderHeader.en.d.ts +1 -0
  262. package/dist/components/ui-placeholder/UIPlaceholderImage.d.ts +1 -0
  263. package/dist/components/ui-placeholder/UIPlaceholderImage.en.d.ts +1 -0
  264. package/dist/components/ui-placeholder/UIPlaceholderLine.d.ts +1 -0
  265. package/dist/components/ui-placeholder/UIPlaceholderLine.en.d.ts +1 -0
  266. package/dist/components/ui-placeholder/UIPlaceholderParagraph.d.ts +1 -0
  267. package/dist/components/ui-placeholder/UIPlaceholderParagraph.en.d.ts +1 -0
  268. package/dist/components/ui-popup/UIPopup.d.ts +30 -3
  269. package/dist/components/ui-popup/UIPopup.en.d.ts +7 -0
  270. package/dist/components/ui-popup/UIPopup.es.d.ts +1 -0
  271. package/dist/components/ui-progress/UIProgress.d.ts +2 -0
  272. package/dist/components/ui-progress/UIProgress.en.d.ts +2 -0
  273. package/dist/components/ui-progress/UIProgress.es.d.ts +1 -0
  274. package/dist/components/ui-property-editor/UIProperty.d.ts +132 -5
  275. package/dist/components/ui-property-editor/UIProperty.en.d.ts +11 -44
  276. package/dist/components/ui-property-editor/UIProperty.es.d.ts +4 -0
  277. package/dist/components/ui-property-editor/UIPropertyEditor.d.ts +38 -0
  278. package/dist/components/ui-property-editor/UIPropertyEditor.en.d.ts +1 -0
  279. package/dist/components/ui-property-editor/UIPropertyEditor.es.d.ts +4 -0
  280. package/dist/components/ui-property-editor/UIPropertyEditor.types.d.ts +33 -0
  281. package/dist/components/ui-property-editor/UIPropertyGroup.d.ts +12 -0
  282. package/dist/components/ui-property-editor/UIPropertyGroup.en.d.ts +2 -0
  283. package/dist/components/ui-property-editor/UIPropertyGroup.es.d.ts +9 -0
  284. package/dist/components/ui-property-editor/index.d.ts +1 -0
  285. package/dist/components/ui-quote/UIQuote.d.ts +1 -0
  286. package/dist/components/ui-quote/UIQuote.en.d.ts +1 -0
  287. package/dist/components/ui-rail/UIRail.d.ts +1 -0
  288. package/dist/components/ui-rail/UIRail.en.d.ts +1 -0
  289. package/dist/components/ui-rating/UIRating.d.ts +6 -0
  290. package/dist/components/ui-rating/UIRating.en.d.ts +6 -0
  291. package/dist/components/ui-rating/UIRating.fallback.d.ts +6 -0
  292. package/dist/components/ui-reveal/UIReveal.d.ts +1 -0
  293. package/dist/components/ui-reveal/UIReveal.en.d.ts +1 -0
  294. package/dist/components/ui-root/UIRoot.d.ts +18 -3
  295. package/dist/components/ui-root/UIRoot.en.d.ts +15 -0
  296. package/dist/components/ui-root/UIRoot.es.d.ts +1 -0
  297. package/dist/components/ui-search/UISearch.d.ts +48 -7
  298. package/dist/components/ui-search/UISearch.en.d.ts +13 -1
  299. package/dist/components/ui-search/UISearch.es.d.ts +1 -0
  300. package/dist/components/ui-search/UISearch.fallback.d.ts +13 -1
  301. package/dist/components/ui-section/UISection.d.ts +30 -1
  302. package/dist/components/ui-section/UISection.en.d.ts +10 -0
  303. package/dist/components/ui-section/UISection.es.d.ts +1 -0
  304. package/dist/components/ui-section/UISections.d.ts +1 -0
  305. package/dist/components/ui-section/UISections.en.d.ts +1 -0
  306. package/dist/components/ui-segment/UISegment.d.ts +2 -0
  307. package/dist/components/ui-segment/UISegment.en.d.ts +2 -0
  308. package/dist/components/ui-segment/UISegment.es.d.ts +1 -0
  309. package/dist/components/ui-segment/UISegments.d.ts +1 -0
  310. package/dist/components/ui-segment/UISegments.en.d.ts +1 -0
  311. package/dist/components/ui-select/UISelect.d.ts +6 -0
  312. package/dist/components/ui-select/UISelect.en.d.ts +6 -0
  313. package/dist/components/ui-select/UISelect.fallback.d.ts +6 -0
  314. package/dist/components/ui-shape/UIShape.d.ts +23 -2
  315. package/dist/components/ui-shape/UIShape.en.d.ts +8 -0
  316. package/dist/components/ui-shape/UIShape.es.d.ts +1 -0
  317. package/dist/components/ui-shape/UISide.d.ts +4 -0
  318. package/dist/components/ui-shape/UISide.en.d.ts +4 -0
  319. package/dist/components/ui-sidebar/UIPushable.d.ts +1 -0
  320. package/dist/components/ui-sidebar/UIPushable.en.d.ts +1 -0
  321. package/dist/components/ui-sidebar/UIPusher.d.ts +1 -0
  322. package/dist/components/ui-sidebar/UIPusher.en.d.ts +1 -0
  323. package/dist/components/ui-sidebar/UISidebar.d.ts +1 -0
  324. package/dist/components/ui-sidebar/UISidebar.en.d.ts +1 -0
  325. package/dist/components/ui-sides/UISides.d.ts +209 -0
  326. package/dist/components/ui-sides/UISides.en.d.ts +122 -0
  327. package/dist/components/ui-sides/UISides.es.d.ts +30 -0
  328. package/dist/components/ui-sides/UISides.fallback.d.ts +134 -0
  329. package/dist/components/ui-sides/index.d.ts +2 -0
  330. package/dist/components/ui-site-nav/SitePages.d.ts +53 -0
  331. package/dist/components/ui-site-nav/UISiteNav.d.ts +207 -0
  332. package/dist/components/ui-site-nav/UISiteNav.en.d.ts +87 -0
  333. package/dist/components/ui-site-nav/UISiteNav.es.d.ts +29 -0
  334. package/dist/components/ui-site-nav/index.d.ts +1 -0
  335. package/dist/components/ui-site-tabs/UISiteTabs.d.ts +126 -0
  336. package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +49 -0
  337. package/dist/components/ui-site-tabs/UISiteTabs.es.d.ts +18 -0
  338. package/dist/components/ui-site-tabs/index.d.ts +1 -0
  339. package/dist/components/ui-slider/UISlider.d.ts +7 -0
  340. package/dist/components/ui-slider/UISlider.en.d.ts +7 -0
  341. package/dist/components/ui-slider/UISlider.es.d.ts +1 -0
  342. package/dist/components/ui-slider/UISlider.fallback.d.ts +7 -0
  343. package/dist/components/ui-space/UISpace.d.ts +1 -0
  344. package/dist/components/ui-space/UISpace.en.d.ts +1 -0
  345. package/dist/components/ui-split-panel/UISplitPanel.d.ts +175 -0
  346. package/dist/components/ui-split-panel/UISplitPanel.en.d.ts +74 -0
  347. package/dist/components/ui-split-panel/UISplitPanel.es.d.ts +25 -0
  348. package/dist/components/ui-split-panel/index.d.ts +2 -0
  349. package/dist/components/ui-stack/UIStack.d.ts +31 -5
  350. package/dist/components/ui-stack/UIStack.en.d.ts +15 -3
  351. package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
  352. package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
  353. package/dist/components/ui-statistic/UIStatistics.d.ts +1 -0
  354. package/dist/components/ui-statistic/UIStatistics.en.d.ts +1 -0
  355. package/dist/components/ui-step/UIStep.d.ts +1 -0
  356. package/dist/components/ui-step/UIStep.en.d.ts +1 -0
  357. package/dist/components/ui-step/UISteps.d.ts +1 -0
  358. package/dist/components/ui-step/UISteps.en.d.ts +1 -0
  359. package/dist/components/ui-sticky/UISticky.d.ts +4 -0
  360. package/dist/components/ui-sticky/UISticky.en.d.ts +1 -0
  361. package/dist/components/ui-tab/UITab.d.ts +8 -0
  362. package/dist/components/ui-tab/UITab.en.d.ts +1 -0
  363. package/dist/components/ui-tab/UITabs.d.ts +107 -16
  364. package/dist/components/ui-tab/UITabs.en.d.ts +40 -1
  365. package/dist/components/ui-tab/UITabs.es.d.ts +4 -0
  366. package/dist/components/ui-table/TableEditing.d.ts +77 -0
  367. package/dist/components/ui-table/UICell.d.ts +1 -0
  368. package/dist/components/ui-table/UICell.en.d.ts +1 -0
  369. package/dist/components/ui-table/UITable.d.ts +145 -5
  370. package/dist/components/ui-table/UITable.en.d.ts +19 -0
  371. package/dist/components/ui-table/UITable.es.d.ts +3 -0
  372. package/dist/components/ui-terms/UITerm.d.ts +1 -0
  373. package/dist/components/ui-terms/UITerm.en.d.ts +1 -0
  374. package/dist/components/ui-terms/UITerms.d.ts +1 -0
  375. package/dist/components/ui-terms/UITerms.en.d.ts +1 -0
  376. package/dist/components/ui-text/UILink.d.ts +11 -0
  377. package/dist/components/ui-text/UILink.en.d.ts +4 -0
  378. package/dist/components/ui-text/UIText.d.ts +7 -0
  379. package/dist/components/ui-text/UIText.en.d.ts +7 -0
  380. package/dist/components/ui-text/UIText.es.d.ts +2 -0
  381. package/dist/components/ui-theme-editor/SavedTheme.d.ts +55 -43
  382. package/dist/components/ui-theme-editor/ThemeDraft.d.ts +15 -0
  383. package/dist/components/ui-theme-editor/UIColorChip.d.ts +1 -0
  384. package/dist/components/ui-theme-editor/UIColorChip.en.d.ts +1 -0
  385. package/dist/components/ui-theme-editor/UIThemeEditor.d.ts +157 -26
  386. package/dist/components/ui-theme-editor/UIThemeEditor.en.d.ts +79 -6
  387. package/dist/components/ui-theme-editor/UIThemeEditor.es.d.ts +20 -2
  388. package/dist/components/ui-theme-editor/UIThemeEditor.types.d.ts +0 -2
  389. package/dist/components/ui-theme-editor/UIThemeToken.d.ts +1 -0
  390. package/dist/components/ui-theme-editor/UIThemeToken.en.d.ts +1 -0
  391. package/dist/components/ui-theme-menu/HueDropdown.d.ts +47 -0
  392. package/dist/components/ui-theme-menu/ThemeMenu.d.ts +18 -7
  393. package/dist/components/ui-theme-menu/ThemePreference.d.ts +145 -36
  394. package/dist/components/ui-theme-menu/UIThemeMenu.d.ts +118 -7
  395. package/dist/components/ui-theme-menu/UIThemeMenu.en.d.ts +82 -2
  396. package/dist/components/ui-theme-menu/UIThemeMenu.es.d.ts +21 -1
  397. package/dist/components/ui-theme-menu/UIThemeMenu.types.d.ts +36 -8
  398. package/dist/components/ui-theme-menu/index.d.ts +2 -1
  399. package/dist/components/ui-toast/UIToast.d.ts +1 -0
  400. package/dist/components/ui-toast/UIToast.en.d.ts +1 -0
  401. package/dist/components/ui-toc/UIToc.d.ts +1 -0
  402. package/dist/components/ui-toc/UIToc.en.d.ts +1 -0
  403. package/dist/components/ui-toolbar/UIToolbar.d.ts +13 -10
  404. package/dist/components/ui-toolbar/UIToolbar.en.d.ts +138 -84
  405. package/dist/components/ui-toolbar/UIToolbar.es.d.ts +2 -0
  406. package/dist/components/ui-transition/UITransition.d.ts +1 -0
  407. package/dist/components/ui-transition/UITransition.en.d.ts +1 -0
  408. package/dist/components/ui-tree/UITree.d.ts +162 -0
  409. package/dist/components/ui-tree/UITree.en.d.ts +88 -0
  410. package/dist/components/ui-tree/UITree.es.d.ts +35 -0
  411. package/dist/components/ui-tree/UITreeItem.d.ts +204 -0
  412. package/dist/components/ui-tree/UITreeItem.en.d.ts +142 -0
  413. package/dist/components/ui-tree/UITreeItem.es.d.ts +32 -0
  414. package/dist/components/ui-tree/index.d.ts +3 -0
  415. package/dist/components/ui-tree-diagram/TreeData.d.ts +3 -12
  416. package/dist/components/ui-tree-diagram/TreeLayout.d.ts +54 -21
  417. package/dist/components/ui-tree-diagram/TreeMeasure.d.ts +36 -0
  418. package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +152 -27
  419. package/dist/components/ui-tree-diagram/UITreeDiagram.en.d.ts +47 -7
  420. package/dist/components/ui-tree-diagram/UITreeDiagram.es.d.ts +12 -1
  421. package/dist/components/ui-tree-diagram/UITreeDiagram.types.d.ts +66 -21
  422. package/dist/components/ui-tree-diagram/UITreeNode.d.ts +148 -0
  423. package/dist/components/ui-tree-diagram/UITreeNode.en.d.ts +69 -0
  424. package/dist/components/ui-tree-diagram/UITreeNode.es.d.ts +21 -0
  425. package/dist/components/ui-tree-diagram/index.d.ts +4 -2
  426. package/dist/components/ui-video/UIAudio.d.ts +1 -0
  427. package/dist/components/ui-video/UIAudio.en.d.ts +1 -0
  428. package/dist/components/ui-video/UIVideo.d.ts +1 -0
  429. package/dist/components/ui-video/UIVideo.en.d.ts +1 -0
  430. package/dist/components/ui-visibility/UIVisibility.d.ts +1 -0
  431. package/dist/components/ui-visibility/UIVisibility.en.d.ts +1 -0
  432. package/dist/components/ui-zoom/UIZoom.d.ts +1 -0
  433. package/dist/components/ui-zoom/UIZoom.en.d.ts +1 -0
  434. package/dist/{components.es-DmLzT-Bq.js → components.es-BOa_7gFF.js} +498 -109
  435. package/dist/components.es-BOa_7gFF.js.map +1 -0
  436. package/dist/core.d.ts +3 -1
  437. package/dist/core.js +1082 -511
  438. package/dist/core.js.map +1 -1
  439. package/dist/crisp-VfYZlTph.js +6 -0
  440. package/dist/{crisp-CoZRRDuQ.js.map → crisp-VfYZlTph.js.map} +1 -1
  441. package/dist/docs-components/index.d.ts +1 -0
  442. package/dist/docs-components/ui-docs-index/UIDocsIndex.d.ts +89 -0
  443. package/dist/docs-components/ui-docs-index/UIDocsIndex.en.d.ts +43 -0
  444. package/dist/docs-components/ui-docs-index/index.d.ts +2 -0
  445. package/dist/docs-components/ui-docs-nav/UIDocsNav.d.ts +54 -87
  446. package/dist/docs-components/ui-docs-nav/UIDocsNav.types.d.ts +2 -29
  447. package/dist/docs-components/ui-docs-search/SearchIndex.d.ts +8 -2
  448. package/dist/docs-components/ui-docs-search/UIDocsSearch.d.ts +10 -0
  449. package/dist/docs-components/ui-docs-search/UIDocsSearch.en.d.ts +5 -0
  450. package/dist/elements/AddressParameter.d.ts +87 -0
  451. package/dist/elements/DOMFormControl.d.ts +5 -0
  452. package/dist/elements/FormComponent.d.ts +32 -0
  453. package/dist/elements/LoadableBody.d.ts +6 -1
  454. package/dist/elements/LoadableComponent.d.ts +10 -1
  455. package/dist/elements/RootSettings.d.ts +43 -6
  456. package/dist/elements/SpellUISettings.d.ts +1 -0
  457. package/dist/elements/StickyWatch.d.ts +20 -0
  458. package/dist/elements/elements.types.d.ts +15 -0
  459. package/dist/elements/index.d.ts +2 -0
  460. package/dist/forms.js +93 -63
  461. package/dist/forms.js.map +1 -1
  462. package/dist/fruity-BRVlgJZd.js +6 -0
  463. package/dist/fruity-BRVlgJZd.js.map +1 -0
  464. package/dist/{fruity.theme-BJcMiPl1.js → fruity.theme-CbC7Jyvk.js} +2 -2
  465. package/dist/fruity.theme-CbC7Jyvk.js.map +1 -0
  466. package/dist/glass-x9tbbwVq.js +6 -0
  467. package/dist/glass-x9tbbwVq.js.map +1 -0
  468. package/dist/glass.theme-24wY2wH9.js +6 -0
  469. package/dist/glass.theme-24wY2wH9.js.map +1 -0
  470. package/dist/hot.js +536 -26
  471. package/dist/hot.js.map +1 -1
  472. package/dist/index.d.ts +8 -0
  473. package/dist/index.js +91 -81
  474. package/dist/jsx.d.ts +21149 -10377
  475. package/dist/matrix-QY2gWbJ0.js +6 -0
  476. package/dist/{matrix-CqA59hiF.js.map → matrix-QY2gWbJ0.js.map} +1 -1
  477. package/dist/{matrix.theme-jqQZjcq3.js → matrix.theme-_8xtwhDq.js} +2 -2
  478. package/dist/matrix.theme-_8xtwhDq.js.map +1 -0
  479. package/dist/midnight-BxlTQSfw.js +6 -0
  480. package/dist/{midnight-BnoVOrhC.js.map → midnight-BxlTQSfw.js.map} +1 -1
  481. package/dist/mockup-83ELBuVr.js +6 -0
  482. package/dist/mockup-83ELBuVr.js.map +1 -0
  483. package/dist/mockup.theme-DmpBgGBl.js +6 -0
  484. package/dist/mockup.theme-DmpBgGBl.js.map +1 -0
  485. package/dist/paper-M61nUilz.js +6 -0
  486. package/dist/{paper-CynH8ZuT.js.map → paper-M61nUilz.js.map} +1 -1
  487. package/dist/persist.types-D2m6wD-S.js +9 -0
  488. package/dist/persist.types-D2m6wD-S.js.map +1 -0
  489. package/dist/pop-CxXfytjk.js +6 -0
  490. package/dist/{pop-D2i9V_rG.js.map → pop-CxXfytjk.js.map} +1 -1
  491. package/dist/runtime/DataTooltips.d.ts +75 -0
  492. package/dist/runtime/PropertyControls.d.ts +15 -1
  493. package/dist/runtime/Sources.d.ts +16 -4
  494. package/dist/runtime/Styles.d.ts +11 -0
  495. package/dist/runtime/Themes.d.ts +10 -4
  496. package/dist/runtime/UIRuntime.d.ts +4 -1
  497. package/dist/runtime/index.d.ts +1 -1
  498. package/dist/runtime/runtime.types.d.ts +18 -85
  499. package/dist/spell-By5Y3jKP.js +6 -0
  500. package/dist/{spell-BFtLICm7.js.map → spell-By5Y3jKP.js.map} +1 -1
  501. package/dist/{spell.theme-B7AU7SQX.js → spell.theme-DxGj7qHx.js} +2 -2
  502. package/dist/spell.theme-DxGj7qHx.js.map +1 -0
  503. package/dist/styles/CodeThemeFile.d.ts +73 -0
  504. package/dist/styles/StyleGenerator.d.ts +6 -0
  505. package/dist/styles/styles.en.d.ts +141 -3
  506. package/dist/styles/styles.types.d.ts +2 -0
  507. package/dist/{styles.en-RLpYiO5_.js → styles.en-CUUxNwHo.js} +71 -14
  508. package/dist/styles.en-CUUxNwHo.js.map +1 -0
  509. package/dist/styles.js +13 -13
  510. package/dist/styles.js.map +1 -1
  511. package/dist/ui-accordion.js +54 -53
  512. package/dist/ui-accordion.js.map +1 -1
  513. package/dist/ui-action.js +20 -19
  514. package/dist/ui-action.js.map +1 -1
  515. package/dist/ui-ad.js +5 -4
  516. package/dist/ui-ad.js.map +1 -1
  517. package/dist/ui-breadcrumbs.js +15 -13
  518. package/dist/ui-breadcrumbs.js.map +1 -1
  519. package/dist/ui-button.js +132 -125
  520. package/dist/ui-button.js.map +1 -1
  521. package/dist/ui-calendar.js +208 -206
  522. package/dist/ui-calendar.js.map +1 -1
  523. package/dist/ui-card.js +260 -98
  524. package/dist/ui-card.js.map +1 -1
  525. package/dist/ui-checkbox.js +95 -81
  526. package/dist/ui-checkbox.js.map +1 -1
  527. package/dist/ui-code.js +25 -24
  528. package/dist/ui-code.js.map +1 -1
  529. package/dist/ui-comment.js +14 -12
  530. package/dist/ui-comment.js.map +1 -1
  531. package/dist/ui-components.js +7 -6
  532. package/dist/ui-components.js.map +1 -1
  533. package/dist/ui-container.js +24 -12
  534. package/dist/ui-container.js.map +1 -1
  535. package/dist/ui-diagram.js +1328 -0
  536. package/dist/ui-diagram.js.map +1 -0
  537. package/dist/ui-dimension.js +779 -0
  538. package/dist/ui-dimension.js.map +1 -0
  539. package/dist/ui-dimmer.js +36 -34
  540. package/dist/ui-dimmer.js.map +1 -1
  541. package/dist/ui-divider.js +7 -5
  542. package/dist/ui-divider.js.map +1 -1
  543. package/dist/ui-dropdown.js +107 -105
  544. package/dist/ui-dropdown.js.map +1 -1
  545. package/dist/ui-embed.js +36 -35
  546. package/dist/ui-embed.js.map +1 -1
  547. package/dist/ui-emoji.js +10 -9
  548. package/dist/ui-emoji.js.map +1 -1
  549. package/dist/ui-example.js +63 -61
  550. package/dist/ui-example.js.map +1 -1
  551. package/dist/ui-feed.js +12 -10
  552. package/dist/ui-feed.js.map +1 -1
  553. package/dist/ui-flag.js +10 -9
  554. package/dist/ui-flag.js.map +1 -1
  555. package/dist/ui-flyout.js +7 -6
  556. package/dist/ui-flyout.js.map +1 -1
  557. package/dist/ui-form.js +244 -162
  558. package/dist/ui-form.js.map +1 -1
  559. package/dist/ui-grid.js +21 -18
  560. package/dist/ui-grid.js.map +1 -1
  561. package/dist/ui-icon-picker.js +46 -44
  562. package/dist/ui-icon-picker.js.map +1 -1
  563. package/dist/ui-icon.js +17 -14
  564. package/dist/ui-icon.js.map +1 -1
  565. package/dist/ui-image.js +93 -55
  566. package/dist/ui-image.js.map +1 -1
  567. package/dist/ui-include.js +18 -17
  568. package/dist/ui-include.js.map +1 -1
  569. package/dist/ui-input.js +154 -112
  570. package/dist/ui-input.js.map +1 -1
  571. package/dist/ui-item.js +152 -102
  572. package/dist/ui-item.js.map +1 -1
  573. package/dist/ui-items.js +9 -8
  574. package/dist/ui-items.js.map +1 -1
  575. package/dist/ui-json.js +115 -0
  576. package/dist/ui-json.js.map +1 -0
  577. package/dist/ui-keys.js +1 -1
  578. package/dist/ui-label.js +18 -15
  579. package/dist/ui-label.js.map +1 -1
  580. package/dist/ui-list.js +7 -5
  581. package/dist/ui-list.js.map +1 -1
  582. package/dist/ui-loader.js +7 -6
  583. package/dist/ui-loader.js.map +1 -1
  584. package/dist/ui-markdown.js +975 -83
  585. package/dist/ui-markdown.js.map +1 -1
  586. package/dist/ui-menu.js +329 -196
  587. package/dist/ui-menu.js.map +1 -1
  588. package/dist/ui-message.js +20 -18
  589. package/dist/ui-message.js.map +1 -1
  590. package/dist/ui-modal.js +46 -45
  591. package/dist/ui-modal.js.map +1 -1
  592. package/dist/ui-nag.js +19 -18
  593. package/dist/ui-nag.js.map +1 -1
  594. package/dist/ui-page.js +8 -7
  595. package/dist/ui-page.js.map +1 -1
  596. package/dist/ui-panel.js +28 -17
  597. package/dist/ui-panel.js.map +1 -1
  598. package/dist/ui-parts.js +66 -52
  599. package/dist/ui-parts.js.map +1 -1
  600. package/dist/ui-placeholder.js +21 -16
  601. package/dist/ui-placeholder.js.map +1 -1
  602. package/dist/ui-popup.js +113 -84
  603. package/dist/ui-popup.js.map +1 -1
  604. package/dist/ui-progress.js +9 -7
  605. package/dist/ui-progress.js.map +1 -1
  606. package/dist/ui-property-editor.js +706 -203
  607. package/dist/ui-property-editor.js.map +1 -1
  608. package/dist/ui-quote.js +5 -4
  609. package/dist/ui-quote.js.map +1 -1
  610. package/dist/ui-rail.js +5 -4
  611. package/dist/ui-rail.js.map +1 -1
  612. package/dist/ui-rating.js +31 -29
  613. package/dist/ui-rating.js.map +1 -1
  614. package/dist/ui-reveal.js +7 -6
  615. package/dist/ui-reveal.js.map +1 -1
  616. package/dist/ui-root.js +324 -158
  617. package/dist/ui-root.js.map +1 -1
  618. package/dist/ui-search.js +210 -168
  619. package/dist/ui-search.js.map +1 -1
  620. package/dist/ui-section.js +167 -130
  621. package/dist/ui-section.js.map +1 -1
  622. package/dist/ui-segment.js +15 -12
  623. package/dist/ui-segment.js.map +1 -1
  624. package/dist/ui-select.js +83 -81
  625. package/dist/ui-select.js.map +1 -1
  626. package/dist/ui-shape.js +86 -58
  627. package/dist/ui-shape.js.map +1 -1
  628. package/dist/ui-sidebar.js +59 -56
  629. package/dist/ui-sidebar.js.map +1 -1
  630. package/dist/ui-sides.js +325 -0
  631. package/dist/ui-sides.js.map +1 -0
  632. package/dist/ui-site-nav.js +329 -0
  633. package/dist/ui-site-nav.js.map +1 -0
  634. package/dist/ui-site-tabs.js +177 -0
  635. package/dist/ui-site-tabs.js.map +1 -0
  636. package/dist/ui-slider.js +84 -81
  637. package/dist/ui-slider.js.map +1 -1
  638. package/dist/ui-space.js +7 -6
  639. package/dist/ui-space.js.map +1 -1
  640. package/dist/ui-split-panel.js +298 -0
  641. package/dist/ui-split-panel.js.map +1 -0
  642. package/dist/ui-stack.js +47 -23
  643. package/dist/ui-stack.js.map +1 -1
  644. package/dist/ui-statistic.js +15 -13
  645. package/dist/ui-statistic.js.map +1 -1
  646. package/dist/ui-step.js +31 -29
  647. package/dist/ui-step.js.map +1 -1
  648. package/dist/ui-sticky.js +7 -6
  649. package/dist/ui-sticky.js.map +1 -1
  650. package/dist/ui-tab.js +230 -138
  651. package/dist/ui-tab.js.map +1 -1
  652. package/dist/ui-table.js +724 -162
  653. package/dist/ui-table.js.map +1 -1
  654. package/dist/ui-terms.js +12 -10
  655. package/dist/ui-terms.js.map +1 -1
  656. package/dist/ui-text.js +53 -28
  657. package/dist/ui-text.js.map +1 -1
  658. package/dist/ui-theme-editor.js +1018 -1545
  659. package/dist/ui-theme-editor.js.map +1 -1
  660. package/dist/ui-theme-menu-CuIjr8Ou.js +1493 -0
  661. package/dist/ui-theme-menu-CuIjr8Ou.js.map +1 -0
  662. package/dist/ui-toast.js +45 -44
  663. package/dist/ui-toast.js.map +1 -1
  664. package/dist/ui-toc.js +75 -74
  665. package/dist/ui-toc.js.map +1 -1
  666. package/dist/ui-toolbar.js +51 -73
  667. package/dist/ui-toolbar.js.map +1 -1
  668. package/dist/ui-transition.js +12 -11
  669. package/dist/ui-transition.js.map +1 -1
  670. package/dist/ui-tree-diagram.js +676 -197
  671. package/dist/ui-tree-diagram.js.map +1 -1
  672. package/dist/ui-tree.js +625 -0
  673. package/dist/ui-tree.js.map +1 -0
  674. package/dist/ui-video.js +13 -11
  675. package/dist/ui-video.js.map +1 -1
  676. package/dist/ui-visibility.js +26 -25
  677. package/dist/ui-visibility.js.map +1 -1
  678. package/dist/ui-zoom.js +79 -78
  679. package/dist/ui-zoom.js.map +1 -1
  680. package/dist/util/TopLayerTip.d.ts +28 -0
  681. package/dist/util/index.d.ts +5 -2
  682. package/dist/vocabulary/DefaultValues.d.ts +34 -0
  683. package/dist/vocabulary/SharedVocabulary.d.ts +4 -0
  684. package/dist/vocabulary/SharedVocabulary.es.d.ts +7 -0
  685. package/dist/vocabulary/ValueSets.d.ts +18 -0
  686. package/dist/vocabulary/Vocabulary.d.ts +1 -0
  687. package/dist/vocabulary/defaults.generated.d.ts +6 -0
  688. package/dist/vocabulary/index.d.ts +1 -0
  689. package/package.json +1 -1
  690. package/dist/MarkdownEngine-CbuT9Mjc.js.map +0 -1
  691. package/dist/PrefStore-CeaTtjTz.js.map +0 -1
  692. package/dist/UIButton-XkfGqgh6.js +0 -6
  693. package/dist/UIButton-XkfGqgh6.js.map +0 -1
  694. package/dist/UIInput-BUudZstW.js +0 -6
  695. package/dist/UIInput-BUudZstW.js.map +0 -1
  696. package/dist/UIKeys-DJF2TIKE.js.map +0 -1
  697. package/dist/UILabel-C1jy3Yl8.js +0 -6
  698. package/dist/UILabel-C1jy3Yl8.js.map +0 -1
  699. package/dist/UIMenu-Btd-8V3A.js +0 -42
  700. package/dist/UIMenu-Btd-8V3A.js.map +0 -1
  701. package/dist/UIRuntime-BBuehGly.js.map +0 -1
  702. package/dist/components.es-DmLzT-Bq.js.map +0 -1
  703. package/dist/crisp-CoZRRDuQ.js +0 -6
  704. package/dist/fruity-CQFYeRlh.js +0 -6
  705. package/dist/fruity-CQFYeRlh.js.map +0 -1
  706. package/dist/fruity.theme-BJcMiPl1.js.map +0 -1
  707. package/dist/glass-CAfW11kL.js +0 -6
  708. package/dist/glass-CAfW11kL.js.map +0 -1
  709. package/dist/glass.theme-DQcBbtCW.js +0 -6
  710. package/dist/glass.theme-DQcBbtCW.js.map +0 -1
  711. package/dist/matrix-CqA59hiF.js +0 -6
  712. package/dist/matrix.theme-jqQZjcq3.js.map +0 -1
  713. package/dist/midnight-BnoVOrhC.js +0 -6
  714. package/dist/paper-CynH8ZuT.js +0 -6
  715. package/dist/persist.types-CsZxS8TG.js +0 -9
  716. package/dist/persist.types-CsZxS8TG.js.map +0 -1
  717. package/dist/pop-D2i9V_rG.js +0 -6
  718. package/dist/spell-BFtLICm7.js +0 -6
  719. package/dist/spell.theme-B7AU7SQX.js.map +0 -1
  720. package/dist/styles.en-RLpYiO5_.js.map +0 -1
  721. package/dist/ui-theme-menu-DyKZygpV.js +0 -921
  722. package/dist/ui-theme-menu-DyKZygpV.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ui-table.js","names":["UIT.WHITESPACE","_init","E.lazy","E.ClassBuilder","E.numberToWord","__name","HEADER","<Show when={this.hasOwnCaption}>\n <div class={CAPTION} part={this.partForName(\"caption\")}>\n <slot name=\"caption\">{this.caption}</slot>\n </div>\n </Show>","this","part={this.partForName(\"caption\")}","<div class={CAPTION} part={this.partForName(\"caption\")}>\n <slot name=\"caption\">{this.caption}</slot>\n </div>","ref={(box) => this.scroller = box}","<Show when={this.isInDataMode}>{this.staticTable()}</Show>","style={this.isInRowsMode ? { [COLUMNS_TOKEN]: String(this.columnCount) } : void 0}","part={this.partForName(\"scroller\")}","tabindex={this.isScrollRegion ? 0 : void 0}","role={this.isScrollRegion ? \"region\" : void 0}","aria-label={this.isScrollRegion ? this.regionLabel : void 0}","<Portal mount={this.domElement}>\n <Show when={this.isInDataMode}>{this.generatedTable()}</Show>\n </Portal>","<Show when={this.isInDataMode}>{this.generatedTable()}</Show>","ref={(table) => this.adoptDataTable(table)}","<table ref={(table) => this.adoptDataTable(table)}>{this.headAndBody()}</table>","<table class={this.rootClass}>{this.headAndBody(this.effectiveSortDirection)}</table>","<For each={this.dataColumns}>\n {(column, index) => this.columnHeader(column, index() === sorted ? direction : void 0)}\n </For>","<For each={this.sortedRows}>\n {(row) => <tr>\n <For each={this.dataColumns}>\n {(column) => <td class={TableGrammar.cell(column) || void 0}>{TableSort.text(row[column.key])}</td>}\n </For>\n </tr>}\n </For>","<For each={this.dataColumns}>\n {(column) => <td class={TableGrammar.cell(column) || void 0}>{TableSort.text(row[column.key])}</td>}\n </For>","scope=\"col\"","<Show when={this.sortable && !optOut} fallback={text}>\n <button type=\"button\">{text}</button>\n </Show>","fallback={text}","<button type=\"button\">{text}</button>","<th\n scope=\"col\"\n aria-sort={sort}\n class={TableGrammar.cell(column) || void 0}\n {...{\n [UIT.TABLE_SORT_KEY]: column.key,\n [UIT.TABLE_SORT_OPT_OUT.attribute]: optOut ? UIT.TABLE_SORT_OPT_OUT.value : void 0\n }}\n >\n <Show when={this.sortable && !optOut} fallback={text}>\n <button type=\"button\">{text}</button>\n </Show>\n </th>","_tmpl$","_ariaRole_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","E.UIComponent","E.proto","E.protoMerged","E.watches","E.state","E.onChange","E.untracked","E.isSameList","E.cssState","E.aria","E.derived","E.controlled","E.on","E.SlotContent","_$createComponent","_$getOwner","_$readShallow","_$setAttribute","UIT.STATIC_ROOT","UIT.TABLE_SORT_KEY","UIT.BOTTOM","__name","tableCSS","<slot />","E.UIComponent","E.proto","E.protoMerged","E.aria","E.derived","E.PartContext","_$getOwner","__name","STATIC_ROOT","__publicField","Key","__decorateElement","__decoratorMetadata","__decoratorStart","WHITESPACE","__name$1","__runInitializers","BOTTOM","TABLE_SORT_KEY","TABLE_SORT_OPT_OUT","__privateAdd","getOwner$1","tableVocabulary","TableClassMirror","classes","table","current","word","text","author","ours","mine","kept","next","_builder_dec","lazy","_init$2","_TableGrammar","input","name","SCROLLER_ATTRIBUTES","value","SCROLLING","OVERFLOWING","ClassBuilder","words","column","grammar","columns","ValueSets","numberToWord","SCROLLER_NOUN","TableGrammar","ATTACH","TableRows","child","ROW","row","CELL","HEADER$1","FOOTER","cell","SPAN","widest","width","sum","footer","sorted","span","element","tag","UI","Converters","TableSort","NATIVE_TABLE","NATIVE","shape","rows","target","header","before","start","sign","direction","texts","a","b","index","missingA","missingB","COLLATOR","body","UITable_default","_tmpl$$1","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_tmpl$6","_tmpl$7","_tmpl$8","_tmpl$9","_isAttachedBottom_dec","_isAttachedTop_dec","_isAttached_dec","_onReadyToMeasure_dec","_isTooWide_dec","_scrollerClasses_dec","_requestSort_dec","_sortableHeader_dec","_onKeyDown_dec","_onClick_dec","_onClientSortChanged_dec","_onSortChanged_dec","_sortDirection_dec","_sortColumn_dec","_sortedRows_dec","_dataColumns_dec","_onCaptionChanged_dec","_hasOwnCaption_dec","_ariaName_dec","_ariaRole_dec$1","_isInRowsMode_dec","_rowElements_dec","_decorateStatic_dec","_onManagedTableChanged_dec","_tableRevision_dec","_dataTable_dec","_authorTable_dec","_elementSetup_dec$1","_vocabulary_dec$1","_a$1","_init$1","_dataTable","_tableRevision","_sortColumn","_sortDirection","_isTooWide","_UITable","UIComponent","proto","protoMerged","watches","state","onChange","untracked","isSameList","cssState","aria","derived","controlled","on","SlotContent","content","isServer","createRenderEffect","_self$","createComponent","Show","_el$","_el$2","insert","effect","readShallow","CAPTION","className","_p$","t","setAttribute","_el$3","_el$4","ref","box","SIDEWAYS","COLUMNS_TOKEN","style","o","i","n","Portal","css","STACK_BY_CLASS","GENERATED","observer","attributeFilter","ROW_ATTRIBUTES","caption","defs","first","_self$2","_el$5","_self$3","_el$6","_v$","_$p","_self$4","_el$7","_el$8","For","_el$9","_el$10","_el$11","afterSolidUpdate","optOut","_self$5","_el$12","spread","sort","\"class\"","_el$13","headers","isSortable","focusable","isInRowsMode","clientSort","event","detail","isReady","resizes","UITable","cellVocabulary","_tmpl$","_hostLayout_dec","_ariaColumnSpan_dec","_ariaRole_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_UICell","PartContext","TABLE","HEADER","rules","align","vertical","VERTICAL","UICell"],"sources":["../src/components/ui-table/UITable.en.ts","../src/components/ui-table/TableClassMirror.ts","../src/components/ui-table/TableGrammar.ts","../src/components/ui-table/TableRows.ts","../src/components/ui-table/TableSort.ts","../src/components/ui-table/UITable.css?inline","../src/components/ui-table/UITable.tsx","../src/components/ui-table/UICell.en.ts","../src/components/ui-table/UICell.tsx","../src/components/ui-table/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-table>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), events, slots, parts and texts.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar, and are MIRRORED onto the slotted\n * `<table>` (see `UITable`): `<ui-table size=\"small\" celled appearance=\"very-basic\" stuck=\"head first\">` =>\n * `ui small celled very basic head stuck first stuck table`.\n * - Row / cell classes (`positive`, `red marked`, `collapsing`, `four wide` ...) are the author's,\n * on native `tr` / `td` / `th`: no attribute here.\n * - Or ROWS AND CELLS as tags, with no native table: `<ui-row>` and `<ui-cell>` (epic `ui-gaps` P7, for drawings,\n * which hold no native HTML). The table then owns them (`ownsParts`), and the same class words style them.\n * - NOTE: `columns` is Fomantic's (and `<ui-grid>`'s) equal-width COUNT (`four column`);\n * the data-mode column list is `column-defs` (`columnDefs`), so the two never collide.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `tableVocabulary`\n * The names of `<ui-table>`, a native `<table>` (slotted, or rendered from `rows`) in Fomantic's table look,\n * or its own `<ui-row>`s and `<ui-cell>`s.\n ****************/\nexport const tableVocabulary = {\n tag: \"ui-table\",\n topics: [\"tables\", \"data display\", \"basic\", \"collections\"],\n aka: [\"data table\", \"data grid\", \"grid\", \"spreadsheet\"],\n skeleton: \"long line, 4 line paragraph\",\n noun: \"table\",\n description: \"A table displays a collection of data grouped into rows.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Text size, `mini` ... `massive`; `medium` is the default.\"\n },\n {\n name: \"color\",\n group: \"appearance\",\n kind: \"color\",\n description: \"Coloured top edge; with `inverted`, a coloured fill.\"\n },\n { name: \"celled\", group: \"layout\", kind: \"keyOnly\", description: \"Borders between cells.\" },\n { name: \"collapsing\", group: \"layout\", kind: \"keyOnly\", description: \"As narrow as its content (`width: auto`).\" },\n {\n name: \"definition\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"First column is a definition column; blank corner.\"\n },\n {\n name: \"fixed\",\n group: \"layout\",\n kind: \"keyOnly\",\n description: \"`table-layout: fixed`; overflowing cell text is cut with `…`.\"\n },\n { name: \"inverted\", group: \"appearance\", kind: \"keyOnly\", description: \"For dark backgrounds: the dark scheme.\" },\n {\n name: \"resizable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description: \"With `scrolling`: people can drag the height.\"\n },\n { name: \"selectable\", group: \"behaviour\", kind: \"keyOnly\", description: \"Body rows highlight on hover.\" },\n {\n name: \"single-line\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"No wrapping: every cell's text stays on one line (`single line`).\"\n },\n {\n name: \"sortable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description:\n \"Header cells sort the table: click / Enter / Space dispatches `ui-sorting`; the sorted one gets \" +\n '`aria-sort`. Opt a header out with `data-sortable=\"false\"` (or Fomantic\\'s `class=\"disabled\"`).'\n },\n {\n name: \"appearance\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [\"basic\", \"very-basic\", \"striped\", \"structured\"],\n classes: { \"very-basic\": \"very basic\" },\n replaces: [\n { from: \"basic\", value: \"basic\", values: { very: \"very-basic\" } },\n { from: \"striped\", value: \"striped\" },\n { from: \"structured\", value: \"structured\" }\n ],\n description:\n \"The look, several words at once: `basic` (no header fill), `very-basic` (no outer border or edge \" +\n \"padding either), `striped` (every other body row tinted), `structured` (collapsed borders, for \" +\n '`rowspan` / `colspan` headers). Old names: `basic` (`basic=\"very\"`), `striped`, `structured`.'\n },\n {\n name: \"unstackable\",\n group: \"layout\",\n kind: \"keyOnly\",\n description:\n \"Never stacks rows into blocks, even on a viewport below 768px: \" +\n \"wider than its box, it scrolls sideways in it instead.\"\n },\n {\n name: \"padding\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"xs\", \"compact\", \"md\", \"lg\"],\n classes: { xs: \"very compact\", md: \"padded\", lg: \"very padded\" },\n replaces: [\n { from: \"compact\", value: \"compact\", values: { very: \"xs\" } },\n { from: \"padded\", value: \"md\", values: { very: \"lg\" } }\n ],\n description:\n \"Cell padding: `xs` and `compact` less, `md` and `lg` more. \" +\n 'Old names: `compact` (`compact=\"very\"` is `xs`), `padded` (`padded=\"very\"` is `lg`).'\n },\n {\n name: \"attach\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"both\", \"top\", \"bottom\"],\n classes: { both: \"attached\", top: \"top attached\", bottom: \"bottom attached\" },\n replaces: [{ from: \"attached\", value: \"both\" }],\n description:\n \"Joins a segment or another table: `both` (in the middle), `top` or `bottom`. Old name: `attached`.\"\n },\n {\n name: \"stackable\",\n group: \"layout\",\n kind: \"keyOrValueAndKey\",\n values: [\"tablet\"],\n description:\n \"Rows become blocks on a viewport below 768px (the default, `stackable`); \" +\n '`stackable=\"tablet\"` also below 992px. `stack-by=\"container\"` follows the table\\'s OWN width instead.'\n },\n {\n name: \"stack-by\",\n group: \"layout\",\n kind: \"enum\",\n values: [\"viewport\", \"container\", \"none\"],\n description:\n \"What `stackable` measures: the `viewport` (Fomantic's way, the default), the table's own width \" +\n \"(`container`: a table in a narrow column of a wide screen), or nothing (`none`: it never stacks, \" +\n \"as `unstackable`, and scrolls sideways when too wide). \" +\n \"Also a token for a whole region or page: `--ui-table-stack-by: container` \" +\n \"(or `none`); the attribute wins. Neither: the page-wide `--ui-stack-with` \" +\n \"(`<ui-root stack-with>`; `page` ~== `viewport`).\"\n },\n {\n name: \"scrolling\",\n group: \"layout\",\n kind: \"keyOrValueAndKey\",\n values: [\"short\", \"very short\", \"long\", \"very long\"],\n description:\n \"Caps the height and scrolls, head and foot stuck; `short` / `very short` / `long` / `very long` \" +\n \"change the cap. The scroller becomes a focusable, named region.\"\n },\n {\n name: \"overflowing\",\n group: \"appearance\",\n kind: \"keyOrValueAndKey\",\n values: [\"short\", \"very short\", \"long\", \"very long\"],\n description: \"Like `scrolling`, both ways, with nothing stuck; same height steps.\"\n },\n {\n name: \"stuck\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [\"head\", \"foot\", \"first\", \"last\"],\n description:\n 'Sticky parts: `stuck=\"head\"` (the `thead`), `foot`, `first` / `last` column; several at once, ' +\n 'e.g. `stuck=\"head first\"`.'\n },\n {\n name: \"columns\",\n group: \"layout\",\n kind: \"width\",\n values: \"widths\",\n widthClass: \"column\",\n description: \"Equal-width column count, `1` ... `16` (or `1/4`, `25%`): `four column`.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"textAlign\",\n replaces: [\"text-align\"],\n description: \"Text alignment of every cell. Old name: `text-align`.\"\n },\n {\n name: \"vertical-align\",\n group: \"layout\",\n kind: \"verticalAlign\",\n description: \"Vertical alignment of every cell.\"\n },\n {\n name: \"sort-column\",\n group: \"behaviour\",\n kind: \"number\",\n description:\n \"Index of the sorted column (0-based, counting `colspan`s); set by people's clicks unless the app \" +\n \"controls it.\"\n },\n {\n name: \"sort-direction\",\n group: \"behaviour\",\n kind: \"enum\",\n values: [\"ascending\", \"descending\"],\n description: \"Direction of `sort-column`; a newly sorted column starts `ascending`.\"\n },\n {\n name: \"client-sort\",\n group: \"advanced\",\n kind: \"boolean\",\n description:\n \"Slotted tables: reorder the `tbody` rows by the sorted column's cell text on `ui-sorting` (numeric-aware). \" +\n \"Off, the app sorts its own rows.\"\n },\n {\n name: \"column-defs\",\n group: \"content\",\n kind: \"json\",\n reflect: false,\n description:\n \"Data mode: `TableColumn[]` (`key`, `header`, `textAlign`, `sortable`, `width`); default the first \" +\n \"row's keys.\"\n },\n {\n name: \"caption\",\n group: \"content\",\n kind: \"string\",\n description:\n \"The table's title, drawn above it and naming it for screen readers. The `caption` slot is its rich \" +\n \"version; a native table's own `<caption>` wins.\"\n },\n {\n name: \"rows\",\n group: \"content\",\n kind: \"json\",\n reflect: false,\n description:\n \"Data mode: `Record<string, unknown>[]`; with no slotted `<table>`, the element renders one (text \" +\n \"only) into its light DOM.\"\n }\n ],\n events: [\n {\n name: \"ui-sorting\",\n detail: '{ column: number, key?: string, direction: \"ascending\" | \"descending\", originalEvent?: Event }',\n cancelable: true,\n description:\n \"A header was activated; `preventDefault()` keeps the current sort (and skips data / `client-sort` \" +\n \"reordering).\"\n }\n ],\n slots: [\n { name: \"\", description: \"One native `<table>`, or `<ui-row>`s of `<ui-cell>`s.\" },\n { name: \"caption\", description: \"The rich version of `caption`: links, emphasis, an icon.\" }\n ],\n parts: [\n {\n name: \"caption\",\n description: \"The caption above the table (`caption`).\"\n },\n {\n name: \"scroller\",\n description:\n \"Box around the slotted table; scrolls (a focusable, named region) with `scrolling` / `overflowing`, \" +\n \"and sideways, its height uncapped, while a table that doesn't stack is wider than it.\"\n }\n ],\n states: [\n {\n name: \"rows\",\n description: \"Set while it holds `<ui-row>`s rather than a native table: a CSS grid, its rows subgrids.\"\n },\n {\n name: \"captioned\",\n description: \"Set while it draws its own caption (`caption`, or the `caption` slot).\"\n },\n {\n name: \"attached\",\n description: \"Set while `attach` is set (any edge): the host drops the outer margin it carries.\"\n },\n { name: \"attached-top\", description: \"Set while `attach` is `top`: the host keeps only its top margin.\" },\n {\n name: \"attached-bottom\",\n description: \"Set while `attach` is `bottom`: the host keeps only its bottom margin.\"\n }\n ],\n texts: [\n {\n key: \"label\",\n text: \"Table\",\n description: \"Name of the scrolling region when the host has no `aria-label` and the table no `<caption>`.\"\n }\n ],\n ownsParts: [\"row\", \"cell\"]\n} as const satisfies E.ComponentVocabulary\n","import { UIT } from \"spell/ui/core\"\n\n/****************\n * ### `TableClassMirror`\n * Writes an element's Fomantic class string (`ui celled striped table`) onto a LIGHT-DOM `<table>`\n * (or, for a table of `<ui-row>`s, onto the `<ui-table>` itself),\n * so `UITable.css`'s class-grammar rules style it.\n * - Owns only its words: the author's other classes stay, in their order.\n * The element's phrase follows them as one run in grammar order,\n * since phrase selectors (`[class*=\"very basic\"]`) need the words adjacent.\n * - Words the table ALREADY has when first mirrored, and the element emits, count as the element's:\n * an SSR table carries the element's own words (`class=\"ui celled table\"`), which must go when `celled` does.\n * - Re-applies through a `MutationObserver` on the table's `class`, when a framework rewrites `className`.\n * - Plain DOM, no Solid.\n * - NOTE: letting go of a table (`detach()`) leaves its classes:\n * it's usually gone from the `<ui-table>` by then, and an app may have moved it on purpose.\n ****************/\nexport class TableClassMirror {\n /** Table mirrored onto, if any. */\n private table: Element | undefined\n\n /** Class string to mirror. */\n private classes = \"\"\n\n /** Words on `table` that are the element's, not the author's. */\n private owned = new Set<string>()\n\n /** Watches `table`'s `class`. */\n private observer: MutationObserver | undefined\n\n /**\n * Mirror `classes` onto `table`, switching tables when it changed; `undefined` lets go.\n * - SIDE EFFECT: writes `table`'s `class` attribute (only when the text changes).\n */\n apply(table: Element | undefined, classes: string) {\n this.classes = classes\n if (table !== this.table) {\n this.detach()\n this.table = table\n if (!table) return\n const current = new Set(TableClassMirror.words(table.getAttribute(\"class\")))\n this.owned = new Set(TableClassMirror.words(classes).filter((word) => current.has(word)))\n // oxlint-disable-next-line spell-ui/no-mutation-observer -- a helper class, watching ANOTHER element (the table)\n this.observer = new MutationObserver(() => this.write())\n this.observer.observe(table, { attributeFilter: [\"class\"] })\n }\n this.write()\n }\n\n /** Stop mirroring; the table keeps its classes. */\n detach() {\n this.observer?.disconnect()\n this.observer = undefined\n this.table = undefined\n this.owned = new Set()\n }\n\n /** Recompute the table's class text: author words, then the element's phrase. */\n private write() {\n const table = this.table\n if (!table) return\n const text = table.getAttribute(\"class\") ?? \"\"\n const author = TableClassMirror.words(text).filter((word) => !this.owned.has(word))\n const ours = TableClassMirror.words(this.classes)\n const mine = new Set(ours)\n const kept = author.filter((word) => !mine.has(word))\n this.owned = new Set(ours.filter((word) => !author.includes(word)))\n // NEVER dedupe `ours`: a phrase may repeat a word (`head stuck first stuck`, `center aligned top aligned`)\n const next = [...kept, ...ours].join(\" \")\n if (next !== text) table.setAttribute(\"class\", next)\n }\n\n /**\n * `table`'s class text with `classes` mirrored in once: its author words, then the element's phrase.\n * - For a static server render (`UITable.decorateStatic()`): no observer, nothing owned yet;\n * the same text a first `apply()` writes.\n * - `text` is `getAttribute()`'s: `null` when absent (a platform boundary).\n * - Static: one call, nothing to mirror into later.\n */\n static mirrored(text: string | null, classes: string): string {\n const ours = TableClassMirror.words(classes)\n const mine = new Set(ours)\n return [...TableClassMirror.words(text).filter((word) => !mine.has(word)), ...ours].join(\" \")\n }\n\n /** Class words of `text`, in order. Static: pure, for `mirrored()` too. */\n private static words(text: string | null): string[] {\n return text ? text.split(UIT.WHITESPACE).filter(Boolean) : []\n }\n}\n","import { E, type UIT } from \"spell/ui/core\"\nimport { tableVocabulary } from \"./UITable.en\"\n\n/****************\n * ### `TableGrammar`\n * Class strings a table needs besides its own root's: the shadow `.scroller`'s, and a data-mode cell's.\n * - Scroller: `ClassBuilder` over the table vocabulary's scroller-shaped attributes\n * (`resizable`, `attach`, `scrolling`, `overflowing`) with the noun `scroller` and no `ui`,\n * e.g. `resizable top attached short scrolling scroller`.\n * Same grammar as the table, so `UITable.css` keys the scroller on the same phrases (`[class*=\"very short\"]`).\n * - Cell: a `TableColumn`'s `textAlign` / `width` as Fomantic's cell classes (`right aligned four wide`).\n * - Plain functions of their input, no DOM.\n * - STATIC and instance-free on purpose: nothing to hold but the one cached builder.\n ****************/\nexport class TableGrammar {\n /** Scroller class string from `value(name)`, the converted value of each of `SCROLLER_ATTRIBUTES`. */\n static scroller(value: (name: string) => unknown): string {\n const input: Record<string, unknown> = {}\n for (const name of SCROLLER_ATTRIBUTES) input[name] = value(name)\n return TableGrammar.builder.build(input)\n }\n\n /** Does the scroller scroll: `scrolling` / `overflowing`, in any height? */\n static scrolls(value: (name: string) => unknown): boolean {\n return !!value(SCROLLING) || !!value(OVERFLOWING)\n }\n\n /**\n * Fomantic cell classes for a data-mode `column`, e.g. `right aligned four wide`; `\"\"` for none.\n * - An unusable width is dropped silently (no class), like `ClassBuilder`'s.\n */\n static cell(column: UIT.TableColumn): string {\n const { grammar } = E.ClassBuilder\n const words: string[] = []\n if (column.textAlign) words.push(`${column.textAlign} ${grammar.aligned}`)\n // `!= null`: `columnDefs` is JSON, where an unset width may be `null`\n if (column.width != null) {\n const columns = E.ValueSets.columns(String(column.width))\n const word = columns === undefined ? undefined : E.numberToWord(Math.round(columns))\n if (word) words.push(`${word} ${grammar.wide}`)\n }\n return words.join(\" \")\n }\n\n /**\n * Builds scroller classes: the table vocabulary narrowed to `SCROLLER_ATTRIBUTES`, noun `scroller`, no `ui`.\n * - Static: one per page, made on first use.\n */\n @E.lazy private static get builder(): E.ClassBuilder {\n return new E.ClassBuilder({\n ...tableVocabulary,\n noun: SCROLLER_NOUN,\n ui: false,\n attributes: tableVocabulary.attributes.filter(({ name }) => SCROLLER_ATTRIBUTES.includes(name))\n })\n }\n}\n\n/** Scroller attribute that joins it to what's above or below: `both`, `top`, `bottom`. */\nexport const ATTACH = \"attach\"\n\n/** Scroller attribute that caps the height and scrolls, head and foot stuck. */\nconst SCROLLING = \"scrolling\"\n\n/** Scroller attribute that caps the height and scrolls both ways. */\nconst OVERFLOWING = \"overflowing\"\n\n/** Canonical names of the table attributes that shape the scroller, in vocabulary order. */\nconst SCROLLER_ATTRIBUTES: readonly string[] = [\"resizable\", ATTACH, SCROLLING, OVERFLOWING]\n\n/** The scroller's noun: its last class word. */\nconst SCROLLER_NOUN = \"scroller\"\n","import { E, UI } from \"spell/ui/core\"\n\n/****************\n * ### `TableRows`\n * How a table made of `<ui-row>`s and `<ui-cell>`s is read (epic `ui-gaps` P7): its shape for `TableSort`'s walk\n * (`TableShape`: the class itself is it), and the rows-mode grid's own questions (its rows, its column count).\n * - Plain DOM, no state.\n * - Rows are the table's own children; cells, each row's.\n * Tags by their CANONICAL name (`UI.vocabulary.canonicalTagFor()`), so a translated page's `<es-fila>` counts.\n * - A row is a header row with `header`, a footer row with `footer`; every other row is the body.\n * - Every cell of a header row is a header; columns count `span`s, as a native table's count `colspan`s;\n * cells never span rows.\n * - STATIC and instance-free on purpose: it holds no state, as `TableSort` doesn't.\n ****************/\nexport class TableRows {\n /** The rows of `table`, a `<ui-table>` DOM element, in order. */\n static rows(table: Element): Element[] {\n return [...table.children].filter((child) => TableRows.is(child, ROW))\n }\n\n /** The cells of `row`, in order. */\n static cells(row: Element): Element[] {\n return [...row.children].filter((child) => TableRows.is(child, CELL))\n }\n\n /** Is `row` a header row? */\n static isHeaderRow(row: Element): boolean {\n return TableRows.isOn(row, HEADER)\n }\n\n /** Is `row` a footer row? */\n static isFooterRow(row: Element): boolean {\n return TableRows.isOn(row, FOOTER)\n }\n\n /** Columns `cell` covers: its `span`, a whole number, at least 1. */\n static span(cell: Element): number {\n return TableRows.spanOf(TableRows.value(cell, SPAN))\n }\n\n /** Columns of `table`: the widest row's spans added up; at least 1. */\n static columnCount(table: Element): number {\n let widest = 1\n for (const row of TableRows.rows(table)) {\n const width = TableRows.cells(row).reduce((sum, cell) => sum + TableRows.span(cell), 0)\n widest = Math.max(widest, width)\n }\n return widest\n }\n\n ////////////////\n // ## Its shape, for `TableSort`\n ////////////////\n\n /** The header rows of `table`, top first. */\n static headerRows(table: Element): Element[] {\n return TableRows.rows(table).filter((row) => TableRows.isHeaderRow(row))\n }\n\n /** The body rows, one group: every row but the header and footer rows. */\n static bodies(table: Element): Element[][] {\n return [TableRows.rows(table).filter((row) => !TableRows.isHeaderRow(row) && !TableRows.isFooterRow(row))]\n }\n\n /** Every cell of a header row is a header. */\n static isHeader(_cell: Element): boolean {\n return true\n }\n\n /** Put the body rows back, sorted: before the first footer row, header rows staying first. */\n static place(table: Element, sorted: Element[]) {\n const footer = TableRows.rows(table).find((row) => TableRows.isFooterRow(row))\n for (const row of sorted) table.insertBefore(row, footer ?? null)\n }\n\n /**\n * A span from what a `span` or `colspan` attribute says (`\"2\"`, `2`): a whole number, at least 1.\n * - Static: a native table's `colspan` (`TableSort`) and `<ui-cell>`'s own read through it too.\n */\n static spanOf(value: unknown): number {\n const span = Math.floor(Number(value))\n return Number.isFinite(span) && span > 1 ? span : 1\n }\n\n ////////////////\n // ## Reading the elements\n ////////////////\n\n /**\n * Is `element` the canonical `tag` (or its translation on this page)?\n * - Before the runtime loads, the canonical tag only: the translations are its.\n */\n private static is(element: Element, tag: string): boolean {\n const name = element.localName\n if (name === tag) return true\n return \"vocabulary\" in UI && UI.vocabulary.canonicalTagFor(name) === tag\n }\n\n /**\n * A row's or cell's attribute value, by its canonical name; before its family loads, the attribute's text.\n * - NEVER throws: a pending element has no definition yet (`valueNamed()` throws then).\n */\n private static value(element: Element, name: string): unknown {\n try {\n const value = (element as Element & { valueNamed?: (name: string) => unknown }).valueNamed?.(name)\n if (value !== undefined) return value\n } catch {\n // pending: its text, below\n }\n return element.getAttribute(name) ?? undefined\n }\n\n /** Is boolean attribute `name` of `element` on: its value, or its text before the element upgrades (`\"\"`, `\"true\"`)? */\n private static isOn(element: Element, name: string): boolean {\n const value = TableRows.value(element, name)\n return E.Converters.boolean(typeof value === \"boolean\" || typeof value === \"string\" ? value : undefined, name)\n }\n}\n\n/** The row tag. */\nconst ROW = \"ui-row\"\n\n/** The cell tag. */\nconst CELL = \"ui-cell\"\n\n/** A row's `header`. */\nconst HEADER = \"header\"\n\n/** A row's `footer`. */\nconst FOOTER = \"footer\"\n\n/** A cell's `span`. */\nconst SPAN = \"span\"\n","import { UIT } from \"spell/ui/core\"\nimport { TableRows } from \"./TableRows\"\n\n/****************\n * ### `TableSort`\n * A table's columns, and sorting its rows, as static helpers: which header a click hit, its column,\n * the header over a column, and reordering the body rows by cell text (`client-sort`). Plain DOM, no state.\n * - ONE walk for every kind of table, handed how to read it, its SHAPE (`TableShape`: its rows, a row's cells,\n * a cell's span; `TableSort.shapeOf()` picks):\n * - a native `<table>` (`NATIVE`), through its elements and attributes,\n * so a static server render's tables (linkedom, with no table API) read the same\n * - a `<ui-table>` of `<ui-row>`s and `<ui-cell>`s (`TableRows`)\n * - Columns count spans: `<th colspan=\"2\">` covers columns 0 and 1, the next header is column 2.\n * NOTE: `rowspan`s from rows above are not counted (a structured table's lower header row numbers its own\n * cells), and a spanning cell in the body answers for its FIRST column.\n * - Comparison: `Intl.Collator(undefined, { numeric: true })` -- `item 9` before `item 10`, locale-aware,\n * stable (`Array.prototype.sort`).\n * - STATIC and instance-free on purpose: it holds no state, and the element and its static render share it.\n ****************/\nexport class TableSort {\n /** How `table` is read: a native `<table>`'s shape, else a rows-mode `<ui-table>`'s (`TableRows`). */\n static shapeOf(table: Element): TableShape {\n return table.localName === NATIVE_TABLE ? NATIVE : TableRows\n }\n\n /**\n * The header cell of `table` that `target` is in, or `undefined`.\n * - Only `table`'s own header rows: a table nested in a cell doesn't count.\n */\n static header(table: Element, target: EventTarget | null): Element | undefined {\n const shape = TableSort.shapeOf(table)\n const rows = shape.headerRows(table)\n for (let element = target instanceof Element ? target : null; element && element !== table;) {\n // a table nested inside: its cells are its own\n if (element.localName === table.localName) return undefined\n const row = element.parentElement\n if (row && rows.includes(row) && shape.cells(row).includes(element)) {\n return shape.isHeader(element) ? element : undefined\n }\n element = row\n }\n return undefined\n }\n\n /** Every header cell of `table`'s header rows, row by row. */\n static headers(table: Element): Element[] {\n const shape = TableSort.shapeOf(table)\n return shape.headerRows(table).flatMap((row) => shape.cells(row).filter((cell) => shape.isHeader(cell)))\n }\n\n /** Can `header` (a native one, or a `<ui-cell>`) sort? Not with `data-sortable=\"false\"` or Fomantic's `class=\"disabled\"`. */\n static isSortable(header: Element): boolean {\n return (\n header.getAttribute(UIT.TABLE_SORT_OPT_OUT.attribute) !== UIT.TABLE_SORT_OPT_OUT.value &&\n !header.classList.contains(UIT.DISABLED)\n )\n }\n\n /** Column index of `cell`, a cell of `table`, in its row: the spans before it added up. */\n static column(table: Element, cell: Element): number {\n const shape = TableSort.shapeOf(table)\n let column = 0\n for (const before of cell.parentElement ? shape.cells(cell.parentElement) : []) {\n if (before === cell) break\n column += shape.span(before)\n }\n return column\n }\n\n /** The header for `column`: the lowest header row's header cell covering it (the most specific), if any. */\n static headerAt(table: Element, column: number): Element | undefined {\n const shape = TableSort.shapeOf(table)\n for (const row of shape.headerRows(table).reverse()) {\n const cell = TableSort.cellAt(table, row, column)\n if (cell && shape.isHeader(cell)) return cell\n }\n return undefined\n }\n\n /** `row`'s cell covering `column`, if any; `row` is one of `table`'s. */\n static cellAt(table: Element, row: Element, column: number): Element | undefined {\n const shape = TableSort.shapeOf(table)\n let start = 0\n for (const cell of shape.cells(row)) {\n const span = shape.span(cell)\n if (column < start + span) return cell\n start += span\n }\n return undefined\n }\n\n /** `header`'s `data-key`, for `ui-sorting`'s detail. */\n static key(header: Element): string | undefined {\n return header.getAttribute(UIT.TABLE_SORT_KEY) ?? undefined\n }\n\n /**\n * Reorder each group of `table`'s body rows by the text of their cell in `column`.\n * - SIDE EFFECT: moves rows, only when the order changes (so a sorted table sees no mutation);\n * header rows stay first, footer rows last.\n * - Rows without that cell sort last, in their order.\n */\n static sortRows(table: Element, column: number, direction: UIT.TableSortDirection) {\n const shape = TableSort.shapeOf(table)\n const sign = direction === \"descending\" ? -1 : 1\n for (const rows of shape.bodies(table)) {\n const texts = new Map(rows.map((row) => [row, TableSort.cellAt(table, row, column)?.textContent?.trim()]))\n const sorted = [...rows].sort((a, b) => TableSort.compare(texts.get(a), texts.get(b), sign))\n if (sorted.every((row, index) => row === rows[index])) continue\n shape.place(table, sorted)\n }\n }\n\n /**\n * Order of two values under `sign` (`1` ascending, `-1` descending).\n * - `undefined` / `null` / `\"\"` last, whatever the direction; two numbers numerically;\n * else the collator over their text.\n */\n static compare(a: unknown, b: unknown, sign: number): number {\n const missingA = a == null || a === \"\"\n const missingB = b == null || b === \"\"\n if (missingA || missingB) return Number(missingA) - Number(missingB)\n if (typeof a === \"number\" && typeof b === \"number\") return (a - b) * sign\n return COLLATOR.compare(TableSort.text(a), TableSort.text(b)) * sign\n }\n\n /** A value as text: primitives `String()`ed, `null` / `undefined` empty, anything else as JSON. */\n static text(value: unknown): string {\n if (value == null) return \"\"\n if (typeof value === \"object\") return JSON.stringify(value)\n return String(value as string | number | boolean | bigint | symbol)\n }\n}\n\n/**\n * How one kind of table is read: what `TableSort`'s walk needs of it.\n * - `TableSort`'s own for a native `<table>`; `TableRows` for a `<ui-table>` of `<ui-row>`s.\n */\nexport type TableShape = {\n /** the table's header rows, top first */\n headerRows(table: Element): Element[]\n /** the body rows that sort together, each group in order: a native table's per `<tbody>`, a rows-mode table's one */\n bodies(table: Element): Element[][]\n /** a row's cells, in order */\n cells(row: Element): Element[]\n /** the columns a cell covers: at least 1 */\n span(cell: Element): number\n /** is `cell`, a cell of a header row, a header: a native `<th>`; any cell of a rows-mode header row */\n isHeader(cell: Element): boolean\n /** put a group's rows back, sorted (`sorted` holds every row of one group) */\n place(table: Element, sorted: Element[]): void\n}\n\n/** A native table's tag. */\nconst NATIVE_TABLE = \"table\"\n\n/**\n * A native `<table>`, read through its elements and attributes: linkedom has no table API (`tHead`, `rows`, `cells`,\n * `colSpan`), and the browser's agrees with them.\n */\nconst NATIVE: TableShape = {\n headerRows: (table) => [...table.querySelectorAll(\":scope > thead > tr\")],\n bodies: (table) =>\n [...table.querySelectorAll(\":scope > tbody\")].map((body) => [...body.querySelectorAll(\":scope > tr\")]),\n cells: (row) => [...row.children].filter((cell) => cell.localName === \"td\" || cell.localName === \"th\"),\n span: (cell) => TableRows.spanOf(cell.getAttribute(\"colspan\")),\n isHeader: (cell) => cell.localName === \"th\",\n place: (_table, sorted) => sorted[0]?.parentElement?.append(...sorted)\n}\n\n/** Numeric-aware collator for cell text and data values: one per page. */\nconst COLLATOR = new Intl.Collator(undefined, { numeric: true })\n","/*\n * The style sheet of `<ui-table>`: a port of Fomantic's `table.less` + `table.variables`.\n * - ONE sheet, used twice:\n * - adopted into the element's shadow root as usual; only its `:host` and `.scroller` rules match there\n * - registered as a PAGE sheet (`UI.styles.register(\"table\", css, { page: true })`),\n * where its class-grammar rules style the LIGHT-DOM `<table>`:\n * a slotted table's `td` is out of reach of shadow CSS (`::slotted()` reaches the top level only)\n * - Shadow markup contract: `<div class=\"[resizable] [attached ...] [scrolling ...] [overflowing ...] [sideways]\n * scroller\" part=\"scroller\"><slot></slot></div>`.\n * While scrolling / overflowing, or `sideways` (a table too wide for it, which doesn't stack),\n * the scroller is a focusable, named region (`tabindex=\"0\" role=\"region\" aria-label`).\n * - Light-DOM contract: the element MIRRORS its class string (`ui small celled striped red table`)\n * onto the slotted `<table>`'s `class`, adding and removing only the words it owns (author classes stay).\n * Why:\n * - one mechanical port serves element markup AND static class-grammar markup: examples,\n * and SSR output that writes `class=\"ui celled table\"` itself, which paints styled before any JS\n * - translated attribute names / values, `yes` / `no` booleans and `medium` all resolve through the\n * vocabulary + `ClassBuilder` like every other component; attribute selectors on the DOM element\n * (`ui-table[celled] > table`) can't do that\n * - NOTE: phrase selectors (`[class*=\"very basic\"]`) need the words in grammar order, so the element writes\n * its phrase as one run after the author's own words\n * - Row / cell states and variations are CLASSES on native `tr` / `th` / `td`,\n * exactly Fomantic's (`positive`, `red marked left`, `collapsing`, `four wide`, `single line`, `selectable` ...):\n * no JS.\n * - Base look: `:where(ui-table) > table` gets the same base rules as `.ui.table` (it used to live in `native.css`),\n * so an un-upgraded `<ui-table><table>` is styled as soon as this sheet is on the page.\n * NOTE: canonical tag only; a translated tag's table is bare until its element upgrades.\n * - `--_table-hosted: 1`, set on `:host` and inherited down the flat tree,\n * tells light-DOM rules (through `@container style()`) that a table sits in an element.\n * Cells reset it, so a table nested in a cell answers for itself.\n * It picks between:\n * - stackable: by the viewport (`@media`), as in Fomantic, hosted or static.\n * A hosted table opts in to stacking by the DOM element's width,\n * with `stack-by=\"container\"` or `--ui-table-stack-by: container`;\n * `stack-by=\"none\"` / `--ui-table-stack-by: none` never stacks (a page that wants no stacked table)\n * (`@container`, the DOM element's `container-type: inline-size`, unnamed -- container names are tree-scoped)\n * - scrolling / overflowing: hosted tables scroll in the shadow `.scroller`, the head (and foot) stuck;\n * static tables keep Fomantic's `display: block` `tbody` (scrolling) and `table` (overflowing) scrollers\n * - Colours:\n * - the TABLE's colour is the generic remap (`.ui.red` => `--ui-color`, `colors.css`): a coloured top edge,\n * or a coloured fill when `inverted`\n * - Fomantic's row / cell classes carry no `ui`, which the generic remap needs:\n * this sheet maps each hue and state class to private tokens, and ONE rule set paints them\n * (`--_table-tint`, `-ink`, `-fill`, `-fill-on`, `-mark`).\n * NOTE: a hue added with `ValueSets.add(\"hues\")` needs a line in \"Row and cell colours\"\n * - cells reset the generic colour and size tokens, so a button in a red table's cell isn't red\n * - `inverted` sets `color-scheme: dark` (+ `--ui-inverted: 1`, `--ui-scheme: dark`):\n * surfaces, text and the state tokens re-resolve to their dark branches; only a coloured inverted fill needs rules\n * - Sortable: headers are sorted through `aria-sort` (the element's)\n * or Fomantic's `sorted ascending` / `sorted descending` classes (static markup).\n * - A `<button>` inside a header is reset to look like text.\n * - `th[data-sortable=\"false\"]` and Fomantic's `th.disabled` opt a header out.\n * - Layering: row / cell colours and states, hover, sorting and STACKED layout are in the `states` sublayer.\n * A later layer beats the `.ui.ui.ui.ui` specificity and `!important`s Fomantic needs\n * to override widths, stripes and cell backgrounds.\n * - Public tokens (`--ui-table-*`, the theming surface) are NEVER declared here:\n * the token block reads each through a private alias, and every rule reads the alias:\n * `--_ui-table-radius: var(--ui-table-radius, var(--ui-radius))`.\n * So a value set on `:root`, an ancestor, the DOM element, the table itself or in the app stylesheet\n * reaches the box (`notes/theming.md` \"Component tokens\").\n * The table is light DOM, so page CSS reaches it directly; set a token on the table, `<ui-table>` or any ancestor.\n * - NOTE: left out, on purpose:\n * - `.ui.table.segment` / `.stacked` coupling, and `.ui.attached + .ui.attached.table`\n * (a middle table after another attached block):\n * the neighbour relation isn't visible from a table inside an element\n * - Fomantic's icon-font sort arrows: a masked SVG caret instead; custom scrollbar colours\n * - `-moz-transform` hacks\n */\n\n@layer ui.components.table.types, ui.components.table.content, ui.components.table.variations, ui.components.table.states;\n\n/* Breakpoints (`@custom-media`), inlined at build time. */\n@import \"../../styles/media.css\";\n\n/*******************************\n Table\n*******************************/\n\n@layer ui.components.table.types {\n /* DOM element: a block and the size container `stackable` answers to; the flag that says \"hosted\". */\n :host {\n --_table-hosted: 1;\n /* the table's own token, else the page-wide `stack-with` one (`page` ~== `viewport`), else the viewport */\n --_table-stack-by: var(--ui-table-stack-by, var(--ui-stack-with, viewport));\n }\n :host {\n /* a colour or size from outside never reaches the table: its own classes remap them again */\n --ui-color: initial;\n --ui-color-text: initial;\n --ui-color-header: initial;\n --ui-color-border: initial;\n --ui-color-background: initial;\n --ui-color-inverted: initial;\n --ui-color-on: initial;\n --ui-color-inverted-on: initial;\n display: block;\n container-type: inline-size;\n }\n /*\n * The table's outer margin sits on the DOM ELEMENT: a size container is its own formatting context,\n * so a margin on the scroller inside it never collapses with the heading above, as class grammar's does.\n * Attached: see \"Attached\" (variations).\n */\n :host {\n margin-block: 1em;\n }\n :host(:first-child) {\n margin-block-start: 0;\n }\n :host(:last-child) {\n margin-block-end: 0;\n }\n\n /*\n * Scroller: around the slot; spaced by the DOM element's position, since the table is always an only child.\n * - In the shadow root the DOM element carries that spacing (above), so the scroller has none.\n * `:not([data-ui])`: a static server render's scroller (`spell/ui/static`) REPLACES the DOM element, and keeps it.\n * - `--_ui-table-row-height` here too: the scroller's scrolling heights read it (the table's alias is below it).\n */\n .scroller {\n --_ui-table-row-height: var(--ui-table-row-height, calc(2 * 0.785714em + var(--ui-line-height) * 1em));\n --_table-scroll-rows: 3;\n --_table-overflow-rows: 5;\n --_table-scroll-factor: 1;\n display: block;\n margin-block: 1em;\n }\n :host(:first-child) > .scroller {\n margin-block-start: 0;\n }\n :host(:last-child) > .scroller {\n margin-block-end: 0;\n }\n :host > .scroller:not([data-ui]) {\n margin-block: 0;\n }\n\n /*\n * Tokens: one per `table.variables` entry that still matters, from the global tokens --\n * each the private alias of its public token (never declare the public one: it would block inherited values).\n */\n .ui.table,\n :where(ui-table) > table {\n --_ui-table-margin: var(--ui-table-margin, 1em);\n --_ui-table-background: var(--ui-table-background, var(--ui-surface));\n --_ui-table-color: var(--ui-table-color, var(--ui-text-color));\n --_ui-table-border-width: var(--ui-table-border-width, var(--ui-border-width));\n --_ui-table-border-color: var(--ui-table-border-color, var(--ui-border-color));\n --_ui-table-radius: var(--ui-table-radius, var(--ui-radius));\n --_ui-table-duration: var(--ui-table-duration, var(--ui-duration-fast));\n --_ui-table-row-border: var(--ui-table-row-border, var(--ui-border-width) solid var(--ui-border-color-internal));\n --_ui-table-cell-border: var(--ui-table-cell-border, var(--ui-border-width) solid var(--ui-border-color-internal));\n --_ui-table-cell-padding-block: var(--ui-table-cell-padding-block, 0.785714em);\n --_ui-table-cell-padding-inline: var(--ui-table-cell-padding-inline, 0.785714em);\n --_ui-table-header-padding-block: var(--ui-table-header-padding-block, 0.928571em);\n --_ui-table-header-background: var(--ui-table-header-background, var(--ui-surface-muted));\n --_ui-table-header-color: var(--ui-table-header-color, var(--ui-text-color));\n --_ui-table-header-border: var(\n --ui-table-header-border,\n var(--ui-border-width) solid var(--ui-border-color-internal)\n );\n --_ui-table-footer-background: var(--ui-table-footer-background, var(--ui-surface-muted));\n --_ui-table-footer-color: var(--ui-table-footer-color, var(--ui-text-color));\n --_ui-table-footer-border: var(--ui-table-footer-border, var(--ui-border));\n --_ui-table-row-height: var(--ui-table-row-height, calc(2 * 0.785714em + var(--ui-line-height) * 1em));\n --_ui-table-responsive-row-padding: var(--ui-table-responsive-row-padding, 1em);\n --_ui-table-responsive-row-shadow: var(\n --ui-table-responsive-row-shadow,\n 0 -1px 0 0 oklch(from var(--ui-ink) l c h / 0.1) inset\n );\n --_ui-table-responsive-cell-padding: var(--ui-table-responsive-cell-padding, 0.25em 0.75em);\n --_ui-table-definition-page-background: var(--ui-table-definition-page-background, var(--ui-background));\n --_ui-table-definition-header-color: var(--ui-table-definition-header-color, var(--ui-text-unselected));\n --_ui-table-definition-column-background: var(\n --ui-table-definition-column-background,\n oklch(from var(--ui-ink) l c h / 0.03)\n );\n --_ui-table-definition-column-color: var(--ui-table-definition-column-color, var(--ui-text-selected));\n --_ui-table-active-background: var(\n --ui-table-active-background,\n color-mix(in oklab, var(--ui-ink) 12%, var(--ui-surface))\n );\n --_ui-table-active-color: var(--ui-table-active-color, var(--ui-text-color));\n /* Fomantic's 0.3-alpha disabled text fails WCAG contrast; a disabled ROW is still content to read. */\n --_ui-table-disabled-color: var(--ui-table-disabled-color, var(--ui-text-muted));\n --_ui-table-striped-background: var(--ui-table-striped-background, oklch(from var(--ui-ink) l c h / 0.03));\n --_ui-table-selectable-background: var(--ui-table-selectable-background, oklch(from var(--ui-ink) l c h / 0.05));\n --_ui-table-selectable-color: var(--ui-table-selectable-color, var(--ui-text-selected));\n --_ui-table-sortable-hover-background: var(\n --ui-table-sortable-hover-background,\n oklch(from var(--ui-ink) l c h / 0.05)\n );\n --_ui-table-sortable-hover-color: var(--ui-table-sortable-hover-color, var(--ui-text-hovered));\n --_ui-table-sortable-active-background: var(\n --ui-table-sortable-active-background,\n oklch(from var(--ui-ink) l c h / 0.05)\n );\n --_ui-table-sortable-active-color: var(--ui-table-sortable-active-color, var(--ui-text-selected));\n --_ui-table-sortable-border: var(--ui-table-sortable-border, var(--ui-border));\n --_ui-table-sortable-icon-opacity: var(--ui-table-sortable-icon-opacity, 0.8);\n --_ui-table-colored-border-size: var(--ui-table-colored-border-size, 0.2em);\n --_ui-table-marker-width: var(--ui-table-marker-width, 0.2em);\n --_ui-table-inverted-header-background: var(--ui-table-inverted-header-background, oklch(0 0 0 / 0.15));\n --_ui-table-inverted-cell-border-color: var(--ui-table-inverted-cell-border-color, oklch(1 0 0 / 0.1));\n /* Body rows of an `inverted striped` table: every other one. */\n --_ui-table-inverted-striped-background: var(--ui-table-inverted-striped-background, oklch(1 0 0 / 0.05));\n /* A hovered body row of an `inverted selectable` table. */\n --_ui-table-inverted-selectable-background: var(--ui-table-inverted-selectable-background, oklch(1 0 0 / 0.08));\n /* A hovered or sorted header of an `inverted sortable` table. */\n --_ui-table-inverted-sortable-background: var(--ui-table-inverted-sortable-background, oklch(1 0 0 / 0.08));\n /* The definition column of an `inverted definition` table. */\n --_ui-table-inverted-definition-column-background: var(\n --ui-table-inverted-definition-column-background,\n oklch(1 0 0 / 0.02)\n );\n /* Darkens the stuck header of an `inverted` table: mixed 15% into its fill. */\n --_ui-table-inverted-stuck-shade: var(--ui-table-inverted-stuck-shade, black);\n --_ui-table-stuck-background: var(--ui-table-stuck-background, var(--ui-surface));\n --_ui-table-stuck-header-background: var(--ui-table-stuck-header-background, var(--ui-surface-muted));\n --_ui-table-stuck-z: var(--ui-table-stuck-z, var(--ui-z-sticky));\n --_ui-table-padded: var(--ui-table-padded, 1em);\n --_ui-table-very-padded: var(--ui-table-very-padded, 1.5em);\n --_ui-table-compact-padding-block: var(--ui-table-compact-padding-block, 0.5em);\n --_ui-table-compact-padding-inline: var(--ui-table-compact-padding-inline, 0.7em);\n --_ui-table-very-compact-padding-block: var(--ui-table-very-compact-padding-block, 0.4em);\n --_ui-table-very-compact-padding-inline: var(--ui-table-very-compact-padding-inline, 0.6em);\n /* private defaults: flags this table answers for itself (a nested table never inherits them) */\n --_table-stack: 0;\n --_table-scroll-rows: 3;\n --_table-overflow-rows: 5;\n --_table-scroll-factor: 1;\n inline-size: 100%;\n margin: var(--_ui-table-margin) 0;\n border: var(--_ui-table-border-width) solid var(--_ui-table-border-color);\n border-radius: var(--_ui-table-radius);\n border-collapse: separate;\n border-spacing: 0;\n box-shadow: none;\n background: var(--_ui-table-background);\n color: var(--_ui-table-color);\n font-size: calc(var(--ui-font-size) * var(--ui-scale, 1));\n line-height: var(--ui-line-height);\n text-align: start;\n vertical-align: middle;\n }\n :is(.ui.table, :where(ui-table) > table):first-child {\n margin-block-start: 0;\n }\n :is(.ui.table, :where(ui-table) > table):last-child {\n margin-block-end: 0;\n }\n :is(.ui.table, :where(ui-table) > table) > :is(thead, tbody) {\n text-align: inherit;\n vertical-align: inherit;\n }\n\n /* Cells: what the table hands its content -- not its colour or scale, nor the flags it answers for. */\n :is(.ui.table, :where(ui-table) > table) :is(th, td) {\n --ui-color: initial;\n --ui-color-text: initial;\n --ui-color-header: initial;\n --ui-color-border: initial;\n --ui-color-background: initial;\n --ui-color-inverted: initial;\n --ui-color-hover: initial;\n --ui-color-focus: initial;\n --ui-color-down: initial;\n --ui-color-active: initial;\n --ui-color-on: initial;\n --ui-color-inverted-on: initial;\n --ui-scale: initial;\n --_table-hosted: initial;\n --_table-stack-by: initial;\n transition:\n background var(--_ui-table-duration) var(--ui-ease),\n color var(--_ui-table-duration) var(--ui-ease);\n }\n :is(.ui.table, :where(ui-table) > table) tr {\n --_table-mark-shadow: 0 0 transparent;\n }\n\n /* Caption: above the table, muted. */\n :is(.ui.table, :where(ui-table) > table) > caption {\n padding-block: var(--ui-space-xs);\n color: var(--ui-text-muted);\n text-align: start;\n }\n}\n\n/*******************************\n Parts\n*******************************/\n\n@layer ui.components.table.content {\n /* Rowspan helper */\n .ui.table :is(th, td).rowspanned {\n display: none;\n }\n\n /* Headers */\n :is(.ui.table, :where(ui-table) > table) > thead {\n box-shadow: none;\n }\n :is(.ui.table, :where(ui-table) > table) > thead > tr > th {\n padding: var(--_ui-table-header-padding-block) var(--_ui-table-cell-padding-inline);\n border-block-end: var(--_ui-table-header-border);\n border-inline-start: none;\n background: var(--_ui-table-header-background);\n color: var(--_ui-table-header-color);\n font-style: normal;\n font-weight: var(--ui-font-weight-bold);\n text-align: inherit;\n text-transform: none;\n vertical-align: inherit;\n cursor: auto;\n }\n :is(.ui.table, :where(ui-table) > table) > thead > tr:first-child > th:first-child {\n border-start-start-radius: var(--_ui-table-radius);\n }\n :is(.ui.table, :where(ui-table) > table) > thead > tr:first-child > th:last-child {\n border-start-end-radius: var(--_ui-table-radius);\n }\n\n /* Footer */\n :is(.ui.table, :where(ui-table) > table) > tfoot > tr > :is(th, td) {\n padding: var(--_ui-table-cell-padding-block) var(--_ui-table-cell-padding-inline);\n border-block-start: var(--_ui-table-footer-border);\n border-inline-start: none;\n background: var(--_ui-table-footer-background);\n color: var(--_ui-table-footer-color);\n font-style: normal;\n font-weight: var(--ui-font-weight-normal);\n text-align: inherit;\n text-transform: none;\n vertical-align: inherit;\n cursor: auto;\n }\n :is(.ui.table, :where(ui-table) > table) > tfoot > tr:last-child > :is(th, td):first-child {\n border-end-start-radius: var(--_ui-table-radius);\n }\n :is(.ui.table, :where(ui-table) > table) > tfoot > tr:last-child > :is(th, td):last-child {\n border-end-end-radius: var(--_ui-table-radius);\n }\n\n /* Rows: a line between body rows; none above the first, one between repeated bodies. */\n :is(.ui.table, :where(ui-table) > table) > tbody > tr > :is(td, th) {\n border-block-start: var(--_ui-table-row-border);\n }\n :is(.ui.table, :where(ui-table) > table) > tbody > tr:first-child > :is(td, th) {\n border-block-start: none;\n }\n :is(.ui.table, :where(ui-table) > table) > tbody + tbody > tr:first-child > :is(td, th) {\n border-block-start: var(--_ui-table-row-border);\n }\n\n /* Cells */\n :is(.ui.table, :where(ui-table) > table) > tbody > tr > :is(td, th) {\n padding: var(--_ui-table-cell-padding-block) var(--_ui-table-cell-padding-inline);\n text-align: inherit;\n }\n /* A header cell in the body (`<th scope=\"row\">`) reads as a row header. */\n :is(.ui.table, :where(ui-table) > table) > tbody > tr > th {\n font-weight: var(--ui-font-weight-bold);\n }\n\n /* Icons, images */\n .ui.table > i.icon,\n .ui.table :is(td, th) > :is(svg, ui-icon):only-child {\n vertical-align: baseline;\n }\n .ui.table .collapsing :is(.image, .image img, img) {\n max-inline-size: none;\n }\n\n /*\n * Definition: a blank corner, a highlighted first column.\n * - The corner may be a `td` (an empty `th` is an unnamed header to assistive tech;\n * axe `empty-table-header`), so both are keyed.\n */\n .ui.definition.table > thead:not(.full-width) > tr > :is(th, td):first-child {\n background: var(--_ui-table-definition-page-background);\n box-shadow: calc(var(--_ui-table-colored-border-size) / -2) calc(-1 * var(--_ui-table-colored-border-size)) 0\n calc(var(--_ui-table-colored-border-size) / 2) var(--_ui-table-definition-page-background);\n color: var(--_ui-table-definition-header-color);\n font-weight: var(--ui-font-weight-normal);\n pointer-events: none;\n }\n .ui.definition.table > thead:not(.full-width) > tr > :is(th, td):first-child:not(:empty) {\n pointer-events: auto;\n }\n .ui.definition.table > tfoot:not(.full-width) > tr > th:first-child {\n background: var(--_ui-table-definition-page-background);\n box-shadow: calc(var(--_ui-table-colored-border-size) / -2) var(--_ui-table-colored-border-size) 0\n calc(var(--_ui-table-colored-border-size) / 2) var(--_ui-table-definition-page-background);\n color: var(--_ui-table-definition-header-color);\n font-weight: var(--ui-font-weight-normal);\n pointer-events: none;\n }\n .ui.definition.table > tbody > tr > :is(td, th):first-child:not(.ignored),\n .ui.definition.table > tfoot > tr > td:first-child:not(.ignored),\n .ui.definition.table tr td.definition {\n background: var(--_ui-table-definition-column-background);\n color: var(--_ui-table-definition-column-color);\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.definition.table > thead:not(.full-width) > tr > th:nth-child(2),\n .ui.definition.table > tfoot:not(.full-width) > tr > :is(th, td):nth-child(2),\n .ui.definition.table > tbody > tr > :is(td, th):nth-child(2) {\n border-inline-start: var(--_ui-table-border-width) solid var(--_ui-table-border-color);\n }\n\n /* Structured: collapsed borders, for header cells spanning rows and columns. */\n .ui.structured.table {\n border-collapse: collapse;\n }\n .ui.structured.table > thead > tr > th {\n border-inline: none;\n }\n .ui.structured.sortable.table > thead > tr > th {\n border-inline: var(--_ui-table-sortable-border);\n }\n .ui.structured.basic.table > * > tr > th {\n border-inline: none;\n }\n .ui.structured.celled.table > * > tr > :is(th, td) {\n border-inline: var(--_ui-table-cell-border);\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.table.variations {\n /* Text alignment */\n .ui.table[class*=\"left aligned\"],\n .ui.table [class*=\"left aligned\"] {\n text-align: left;\n }\n .ui.table[class*=\"center aligned\"],\n .ui.table [class*=\"center aligned\"] {\n text-align: center;\n }\n .ui.table[class*=\"right aligned\"],\n .ui.table [class*=\"right aligned\"] {\n text-align: right;\n }\n .ui.justified.table,\n .ui.table .justified {\n text-align: justify;\n }\n\n /* Vertical alignment */\n .ui.table[class*=\"top aligned\"],\n .ui.table [class*=\"top aligned\"] {\n vertical-align: top;\n }\n .ui.table[class*=\"middle aligned\"],\n .ui.table [class*=\"middle aligned\"] {\n vertical-align: middle;\n }\n .ui.table[class*=\"bottom aligned\"],\n .ui.table [class*=\"bottom aligned\"] {\n vertical-align: bottom;\n }\n\n /* Collapsing: a cell as narrow as its content; a table as narrow as its cells. */\n .ui.table :is(th, td).collapsing {\n inline-size: 1px;\n white-space: nowrap;\n }\n .ui.collapsing.table {\n inline-size: auto;\n }\n\n /* Fixed */\n .ui.fixed.table {\n table-layout: fixed;\n }\n .ui.fixed.table :is(th, td) {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /* Selectable: the pointer, and a selectable cell's link filling it. */\n .ui.selectable.table > tbody > tr,\n .ui.table > tbody > tr > td.selectable {\n cursor: pointer;\n }\n .ui.table tbody tr td.selectable {\n padding: 0;\n }\n .ui.table tbody tr td.selectable > a:not(.ui) {\n display: block;\n color: inherit;\n }\n .ui.table:not(.compact) tbody tr td.selectable > a:not(.ui) {\n padding: var(--_ui-table-cell-padding-block) var(--_ui-table-cell-padding-inline);\n }\n\n /* Attached */\n .ui.attached.table {\n inset-block: 0;\n inline-size: calc(100% + 2 * var(--_ui-table-border-width));\n max-inline-size: calc(100% + 2 * var(--_ui-table-border-width));\n margin: 0 calc(-1 * var(--_ui-table-border-width));\n border: var(--_ui-table-border-width) solid var(--ui-border-color-strong);\n border-radius: 0;\n box-shadow: none;\n }\n .ui[class*=\"top attached\"].table {\n margin-block: var(--_ui-table-margin) 0;\n border-radius: var(--_ui-table-radius) var(--_ui-table-radius) 0 0;\n }\n .ui.table[class*=\"top attached\"]:first-child {\n margin-block-start: 0;\n }\n .ui[class*=\"bottom attached\"].table {\n margin-block: 0 var(--_ui-table-margin);\n border-radius: 0 0 var(--_ui-table-radius) var(--_ui-table-radius);\n }\n .ui[class*=\"bottom attached\"].table:last-child {\n margin-block-end: 0;\n }\n /*\n * In an element: the scroller carries the table's spacing\n * (a static render's; in a shadow root, the DOM element's).\n */\n .attached.scroller {\n margin-block: 0;\n }\n [class*=\"top attached\"].scroller {\n margin-block-start: 1em;\n }\n [class*=\"bottom attached\"].scroller {\n margin-block-end: 1em;\n }\n :host(:first-child) > [class*=\"top attached\"].scroller {\n margin-block-start: 0;\n }\n :host(:last-child) > [class*=\"bottom attached\"].scroller {\n margin-block-end: 0;\n }\n /* Shadow DOM: the DOM element carries the outer margin, so it mirrors the attached scroller's (`UITable` states). */\n :host(:state(attached)) {\n margin-block: 0;\n }\n :host(:state(attached-top):not(:first-child)) {\n margin-block-start: 1em;\n }\n :host(:state(attached-bottom):not(:last-child)) {\n margin-block-end: 1em;\n }\n :host > .scroller:not([data-ui]) {\n margin-block: 0;\n }\n\n /* Striped */\n .ui.striped.table > tr:nth-child(2n),\n .ui.striped.table > tbody > tr:nth-child(2n) {\n background-color: var(--_ui-table-striped-background);\n }\n\n /* Single line */\n .ui.table[class*=\"single line\"],\n .ui.table [class*=\"single line\"] {\n white-space: nowrap;\n }\n\n /* Coloured: a thick top edge in the table's colour (`--ui-color`, the generic remap). */\n .ui.table:is(\n .primary,\n .secondary,\n .red,\n .orange,\n .yellow,\n .olive,\n .green,\n .teal,\n .blue,\n .violet,\n .purple,\n .pink,\n .brown,\n .grey,\n .black\n ) {\n border-block-start: var(--_ui-table-colored-border-size) solid var(--ui-color);\n }\n\n /* Column count */\n .ui.one.column.table td {\n inline-size: 100%;\n }\n .ui.two.column.table td {\n inline-size: 50%;\n }\n .ui.three.column.table td {\n inline-size: 33.333333%;\n }\n .ui.four.column.table td {\n inline-size: 25%;\n }\n .ui.five.column.table td {\n inline-size: 20%;\n }\n .ui.six.column.table td {\n inline-size: 16.666667%;\n }\n .ui.seven.column.table td {\n inline-size: 14.285714%;\n }\n .ui.eight.column.table td {\n inline-size: 12.5%;\n }\n .ui.nine.column.table td {\n inline-size: 11.111111%;\n }\n .ui.ten.column.table td {\n inline-size: 10%;\n }\n .ui.eleven.column.table td {\n inline-size: 9.090909%;\n }\n .ui.twelve.column.table td {\n inline-size: 8.333333%;\n }\n .ui.thirteen.column.table td {\n inline-size: 7.692308%;\n }\n .ui.fourteen.column.table td {\n inline-size: 7.142857%;\n }\n .ui.fifteen.column.table td {\n inline-size: 6.666667%;\n }\n .ui.sixteen.column.table td {\n inline-size: 6.25%;\n }\n\n /* Column width */\n .ui.table :is(th, td).one.wide {\n inline-size: 6.25%;\n }\n .ui.table :is(th, td).two.wide {\n inline-size: 12.5%;\n }\n .ui.table :is(th, td).three.wide {\n inline-size: 18.75%;\n }\n .ui.table :is(th, td).four.wide {\n inline-size: 25%;\n }\n .ui.table :is(th, td).five.wide {\n inline-size: 31.25%;\n }\n .ui.table :is(th, td).six.wide {\n inline-size: 37.5%;\n }\n .ui.table :is(th, td).seven.wide {\n inline-size: 43.75%;\n }\n .ui.table :is(th, td).eight.wide {\n inline-size: 50%;\n }\n .ui.table :is(th, td).nine.wide {\n inline-size: 56.25%;\n }\n .ui.table :is(th, td).ten.wide {\n inline-size: 62.5%;\n }\n .ui.table :is(th, td).eleven.wide {\n inline-size: 68.75%;\n }\n .ui.table :is(th, td).twelve.wide {\n inline-size: 75%;\n }\n .ui.table :is(th, td).thirteen.wide {\n inline-size: 81.25%;\n }\n .ui.table :is(th, td).fourteen.wide {\n inline-size: 87.5%;\n }\n .ui.table :is(th, td).fifteen.wide {\n inline-size: 93.75%;\n }\n .ui.table :is(th, td).sixteen.wide {\n inline-size: 100%;\n }\n\n /* Sortable: headers are controls; a header `<button>` looks like the header's text. */\n .ui.sortable.table > thead > tr > th {\n color: var(--_ui-table-header-color);\n white-space: nowrap;\n cursor: pointer;\n }\n .ui.celled.sortable.table > thead > tr > th:not(:first-child) {\n border-inline-start: var(--_ui-table-sortable-border);\n }\n .ui.sortable.table > thead > tr > th > button {\n appearance: none;\n margin: 0;\n padding: 0;\n border: 0;\n background: none;\n color: inherit;\n font: inherit;\n text-align: inherit;\n text-transform: inherit;\n cursor: pointer;\n }\n .ui.sortable.table > thead > tr > th > button:focus-visible,\n .ui.sortable.table > thead > tr > th[tabindex]:focus-visible {\n outline: var(--ui-focus-width) solid var(--ui-focus-color);\n outline-offset: var(--ui-focus-offset);\n }\n .ui.sortable.table > thead > tr > th[tabindex]:focus-visible {\n outline-offset: calc(-1 * var(--ui-focus-width));\n }\n /* The direction caret, drawn only on the sorted header. */\n .ui.sortable.table > thead > tr > th::after {\n content: \"\";\n display: none;\n inline-size: 0.8em;\n block-size: 0.8em;\n margin-inline-start: 0.5em;\n background-color: currentColor;\n opacity: var(--_ui-table-sortable-icon-opacity);\n vertical-align: -0.05em;\n mask: var(--_table-caret) center / contain no-repeat;\n }\n .ui.sortable.table thead th:is([aria-sort=\"ascending\"], .sorted.ascending) {\n --_table-caret: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 2l4 6H1z'/%3E%3C/svg%3E\");\n }\n .ui.sortable.table thead th:is([aria-sort=\"descending\"], .sorted.descending) {\n --_table-caret: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 8L1 2h8z'/%3E%3C/svg%3E\");\n }\n .ui.sortable.table thead th:is([aria-sort=\"ascending\"], [aria-sort=\"descending\"], .sorted)::after {\n display: inline-block;\n }\n /* Opted out: no pointer, no hover. */\n .ui.sortable.table > thead > tr > th:is([data-sortable=\"false\"], .disabled) {\n cursor: auto;\n }\n\n /*\n * Inverted: the dark scheme -- surfaces, text, borders and state tokens re-resolve;\n * a coloured inverted table fills with its colour.\n */\n .ui.table {\n --ui-inverted: 0;\n }\n .ui.inverted.table {\n --ui-inverted: 1;\n --ui-scheme: dark;\n --_ui-table-cell-border: var(--ui-border-width) solid var(--_ui-table-inverted-cell-border-color);\n --_ui-table-row-border: var(--ui-border-width) solid var(--_ui-table-inverted-cell-border-color);\n --_ui-table-header-border: var(--ui-border-width) solid var(--_ui-table-inverted-cell-border-color);\n --_ui-table-footer-border: var(--ui-border-width) solid var(--_ui-table-inverted-cell-border-color);\n --_ui-table-header-background: var(--_ui-table-inverted-header-background);\n --_ui-table-footer-background: var(--_ui-table-inverted-header-background);\n --_ui-table-header-color: inherit;\n --_ui-table-footer-color: inherit;\n --_ui-table-striped-background: var(--_ui-table-inverted-striped-background);\n --_ui-table-selectable-background: var(--_ui-table-inverted-selectable-background);\n --_ui-table-stuck-header-background: color-mix(\n in oklab,\n var(--_ui-table-inverted-stuck-shade) 15%,\n var(--ui-surface)\n );\n color-scheme: dark;\n border: none;\n background: var(--ui-color, var(--ui-surface));\n color: var(--ui-color-on, var(--ui-text-color));\n }\n .ui.inverted.table:is(\n .primary,\n .secondary,\n .red,\n .orange,\n .yellow,\n .olive,\n .green,\n .teal,\n .blue,\n .violet,\n .purple,\n .pink,\n .brown,\n .grey,\n .black\n ) {\n --_ui-table-stuck-background: var(--ui-color);\n --_ui-table-stuck-header-background: color-mix(\n in oklab,\n var(--_ui-table-inverted-stuck-shade) 15%,\n var(--ui-color)\n );\n }\n .ui.inverted.definition.table > :is(thead, tfoot):not(.full-width) > tr > :is(th, td):first-child {\n --_ui-table-definition-page-background: var(--ui-background);\n color-scheme: light;\n }\n .ui.inverted.definition.table > :is(tbody, tfoot) > tr > td:first-child {\n --_ui-table-definition-column-background: var(--_ui-table-inverted-definition-column-background);\n }\n\n /* Basic: no fills, a lighter border. */\n .ui.basic.table {\n border: var(--_ui-table-border-width) solid var(--_ui-table-border-color);\n box-shadow: none;\n background: transparent;\n }\n .ui.basic.table > :is(thead, tfoot) {\n box-shadow: none;\n }\n .ui.basic.table > :is(thead, tbody, tfoot) > tr > th,\n .ui.basic.table > tr > th {\n border-inline-start: none;\n background: transparent;\n }\n .ui.basic.table > tbody > tr {\n border-block-end: var(--_ui-table-cell-border);\n }\n .ui.basic.table > :is(tbody, tfoot) > tr > td,\n .ui.basic.table > tr > td {\n background: transparent;\n }\n .ui.basic.striped.table > tbody > tr:nth-child(2n) {\n background-color: var(--_ui-table-selectable-background);\n }\n\n /* Very basic: no outer border, no padding at the edges. */\n .ui[class*=\"very basic\"].table {\n border: none;\n }\n .ui[class*=\"very basic\"].table:not(.sortable, .striped) > * > tr > :is(th, td):first-child {\n padding-inline-start: 0;\n }\n .ui[class*=\"very basic\"].table:not(.sortable, .striped) > * > tr > :is(th, td):last-child {\n padding-inline-end: 0;\n }\n .ui[class*=\"very basic\"].table:not(.sortable, .striped) > thead > tr:first-child > th {\n padding-block-start: 0;\n }\n\n /* Celled: borders between cells. */\n .ui.celled.table > * > tr > :is(th, td),\n .ui.celled.table > tr > :is(th, td) {\n border-inline-start: var(--_ui-table-cell-border);\n }\n .ui.celled.table > * > tr > :is(th, td):first-child,\n .ui.celled.table > tr > :is(th, td):first-child {\n border-inline-start: none;\n }\n\n /* Padded */\n .ui.padded.table > * > tr > th {\n padding-inline: var(--_ui-table-padded);\n }\n .ui.padded.table > * > tr > :is(th, td) {\n padding: var(--_ui-table-padded);\n }\n .ui[class*=\"very padded\"].table > * > tr > th {\n padding-inline: var(--_ui-table-very-padded);\n }\n .ui[class*=\"very padded\"].table > * > tr > td {\n padding: var(--_ui-table-very-padded);\n }\n\n /* Compact */\n .ui.compact.table > * > tr > th {\n padding-inline: var(--_ui-table-compact-padding-inline);\n }\n .ui.compact.table > :is(tbody, tfoot) > tr > td {\n padding: var(--_ui-table-compact-padding-block) var(--_ui-table-compact-padding-inline);\n }\n .ui[class*=\"very compact\"].table > * > tr > th {\n padding-inline: var(--_ui-table-very-compact-padding-inline);\n }\n .ui[class*=\"very compact\"].table > :is(tbody, tfoot) > tr > td {\n padding: var(--_ui-table-very-compact-padding-block) var(--_ui-table-very-compact-padding-inline);\n }\n\n /* Stuck: opaque rows, so sticky parts cover what scrolls under them. */\n .ui.stuck.table {\n background: var(--_ui-table-stuck-background);\n }\n .ui.stuck.table > thead > tr {\n background: var(--_ui-table-stuck-header-background);\n }\n .ui.stuck.table > tbody > tr {\n background: var(--_ui-table-stuck-background);\n }\n .ui.stuck.table > tfoot > tr {\n background: var(--_ui-table-stuck-header-background);\n }\n .ui.basic.stuck.table > :is(thead, tfoot) > tr {\n background: var(--_ui-table-stuck-background);\n }\n .ui.head.stuck.table > thead,\n .ui.foot.stuck.table > tfoot {\n position: sticky;\n z-index: var(--_ui-table-stuck-z);\n }\n .ui.head.stuck.table {\n border-block-start: 0;\n }\n .ui.head.stuck.table > thead {\n inset-block: 0 auto;\n }\n .ui.head.stuck.table > thead > tr:first-child > th {\n border-block-start: var(--_ui-table-cell-border);\n }\n .ui.foot.stuck.table {\n border-block-end: 0;\n }\n .ui.foot.stuck.table > tfoot {\n inset-block: auto 0;\n }\n .ui.foot.stuck.table > tfoot > tr:last-child > :is(td, th) {\n border-block-end: var(--_ui-table-cell-border);\n }\n .ui.first.stuck.table {\n border-inline-start: 0;\n }\n .ui.first.stuck.table :is(th, td):first-child {\n position: sticky;\n z-index: 1;\n inset-inline-start: 0;\n border-inline-start: var(--_ui-table-cell-border);\n background: inherit;\n }\n .ui.last.stuck.table {\n border-inline-end: 0;\n }\n .ui.last.stuck.table :is(th, td):last-child {\n position: sticky;\n z-index: 1;\n inset-inline-end: 0;\n border-inline-end: var(--_ui-table-cell-border);\n background: inherit;\n }\n .ui.celled.first.stuck.table :is(th, td):first-child {\n border-inline-end: var(--_ui-table-cell-border);\n }\n .ui.celled.last.stuck.table :is(th, td):last-child {\n border-inline-start: var(--_ui-table-cell-border);\n }\n\n /* Scrolling / overflowing heights: rows shown by page size, times the `short` ... `very long` factor. */\n .ui:is(.scrolling, .overflowing).short.table,\n .short:is(.scrolling, .overflowing).scroller {\n --_table-scroll-factor: 0.75;\n }\n .ui:is(.scrolling, .overflowing)[class*=\"very short\"].table,\n [class*=\"very short\"]:is(.scrolling, .overflowing).scroller {\n --_table-scroll-factor: 0.5;\n }\n .ui:is(.scrolling, .overflowing).long.table,\n .long:is(.scrolling, .overflowing).scroller {\n --_table-scroll-factor: 2;\n }\n .ui:is(.scrolling, .overflowing)[class*=\"very long\"].table,\n [class*=\"very long\"]:is(.scrolling, .overflowing).scroller {\n --_table-scroll-factor: 3;\n }\n @media (--ui-tablet), (--ui-computer) {\n :is(.ui.table, .scroller) {\n --_table-scroll-rows: 4;\n --_table-overflow-rows: 6;\n }\n }\n @media (--ui-computer) {\n :is(.ui.table, .scroller) {\n --_table-scroll-rows: 6;\n --_table-overflow-rows: 8;\n }\n }\n @media (--ui-widescreen) {\n :is(.ui.table, .scroller) {\n --_table-scroll-rows: 8;\n --_table-overflow-rows: 10;\n }\n }\n\n /* In an element: the scroller scrolls; a scrolling table keeps its head and foot in view. */\n .scrolling.scroller,\n .overflowing.scroller {\n overflow: auto;\n overscroll-behavior: contain;\n }\n .scrolling.scroller {\n max-block-size: calc(var(--_ui-table-row-height) * (var(--_table-scroll-rows) * var(--_table-scroll-factor) + 1));\n }\n .overflowing.scroller {\n max-block-size: calc(var(--_ui-table-row-height) * var(--_table-overflow-rows) * var(--_table-scroll-factor));\n }\n /*\n * A table that doesn't stack and is wider than its box (`UITable.isTooWide` adds `sideways`):\n * it scrolls sideways in the scroller, never the page, its height uncapped.\n */\n .sideways.scroller {\n overflow-x: auto;\n overscroll-behavior-x: contain;\n }\n .resizable.scrolling.scroller {\n block-size: calc(var(--_ui-table-row-height) * (var(--_table-scroll-rows) * var(--_table-scroll-factor) + 1));\n max-block-size: none;\n resize: vertical;\n }\n .scroller:focus-visible {\n outline: var(--ui-focus-width) solid var(--ui-focus-color);\n outline-offset: var(--ui-focus-offset);\n }\n @container style(--_table-hosted: 1) {\n .ui.scrolling.table > :is(thead, tfoot) {\n position: sticky;\n z-index: var(--_ui-table-stuck-z);\n }\n .ui.scrolling.table > thead {\n inset-block-start: 0;\n }\n .ui.scrolling.table > tfoot {\n inset-block-end: 0;\n }\n .ui.scrolling.table > thead > tr,\n .ui.scrolling.table > tfoot > tr {\n background: var(--_ui-table-stuck-header-background);\n }\n .ui.basic.scrolling.table > :is(thead, tfoot) > tr {\n background: var(--_ui-table-stuck-background);\n }\n }\n\n /* Static markup: Fomantic's scrollers -- the `tbody` (scrolling) or the whole table (overflowing). */\n @container not style(--_table-hosted: 1) {\n .ui.scrolling.table > :is(thead, tfoot, tbody) {\n display: block;\n overflow-y: scroll;\n overscroll-behavior: contain;\n }\n .ui.scrolling.table > :is(thead, tfoot, tbody) > tr {\n display: table;\n inline-size: 100%;\n table-layout: fixed;\n }\n .ui.scrolling.table > tbody {\n max-block-size: calc(var(--_ui-table-row-height) * var(--_table-scroll-rows) * var(--_table-scroll-factor));\n }\n .ui.resizable.scrolling.table > tbody {\n block-size: calc(var(--_ui-table-row-height) * var(--_table-scroll-rows) * var(--_table-scroll-factor));\n max-block-size: none;\n resize: vertical;\n }\n /* scrollbars in the head and foot only keep their width in step with the body's: camouflaged */\n .ui.scrolling.table > thead {\n border-radius: var(--_ui-table-radius) var(--_ui-table-radius) 0 0;\n background: var(--_ui-table-header-background);\n color: var(--_ui-table-header-background);\n scrollbar-color: currentColor currentColor;\n }\n .ui.scrolling.table > tfoot {\n border-radius: 0 0 var(--_ui-table-radius) var(--_ui-table-radius);\n background: var(--_ui-table-footer-background);\n color: var(--_ui-table-footer-background);\n scrollbar-color: currentColor currentColor;\n }\n .ui.overflowing.table {\n display: block;\n max-block-size: calc(var(--_ui-table-row-height) * var(--_table-overflow-rows) * var(--_table-scroll-factor));\n overflow: auto;\n overscroll-behavior: contain;\n }\n }\n\n /*\n * Stackable: below 768px (`tablet stackable`: 992px) rows become blocks.\n * This only FLAGS the table (`--_table-stack: 1`); the stacked layout is in the `states` sublayer.\n * - By the VIEWPORT (`@media`), as in Fomantic, for static markup and elements alike.\n * - By the HOST's width (`@container`) only when an element opts in: `stack-by=\"container\"`,\n * or `--ui-table-stack-by: container` on the DOM element, an ancestor or the page\n * (a table in a narrow sidebar of a wide screen); the attribute wins.\n * - Without either, the page-wide `--ui-stack-with` decides:\n * `container` stacks by the DOM element's width, `page` by the viewport.\n * (`<ui-root stack-with>` sets it: the token every stacking element follows.)\n * - NEVER, with `stack-by=\"none\"` or `--ui-table-stack-by: none`:\n * `unstackable` for every table of a region or page, the public way (never the private `--_table-stack`).\n */\n /*\n * Order matters below (same layer, equal specificity: the later rule wins):\n * 1. the token's way: by the DOM element's width when `--ui-table-stack-by: container`, else by the viewport;\n * `--ui-table-stack-by: none` then undoes it\n * 2. `stack-by` (the element's attribute: a private class on the table,\n * `stack-by-container` / `stack-by-viewport` / `stack-by-none`, from the canonical value) undoes 1,\n * then stacks its own way (`none`: not at all)\n * - A class in SELECTORS, not a state of the DOM element:\n * a state that set `--_table-stack-by` left WebKit evaluating a later table's style queries wrongly,\n * and `:state()` rules its viewport media queries.\n */\n @container (width < 768px) {\n @container style(--_table-stack-by: container) {\n .ui.table:not(.unstackable),\n .ui.stackable.table {\n --_table-stack: 1;\n }\n }\n }\n @container (width < 992px) {\n @container style(--_table-stack-by: container) {\n .ui[class*=\"tablet stackable\"].table {\n --_table-stack: 1;\n }\n }\n }\n @media (--ui-mobile) {\n @container not style(--_table-stack-by: container) {\n .ui.table:not(.unstackable),\n .ui.stackable.table {\n --_table-stack: 1;\n }\n }\n }\n @media (--ui-mobile), (--ui-tablet) {\n @container not style(--_table-stack-by: container) {\n .ui[class*=\"tablet stackable\"].table {\n --_table-stack: 1;\n }\n }\n }\n /* the token's `none`: as specific as every rule above (0,3,0), and later */\n @container style(--_table-stack-by: none) {\n :is(.ui.table:not(.unstackable), .ui.stackable.table, .ui[class*=\"tablet stackable\"].table) {\n --_table-stack: 0;\n }\n }\n .ui.stack-by-container.table,\n .ui.stack-by-viewport.table,\n .ui.stack-by-none.table {\n --_table-stack: initial;\n }\n @container (width < 768px) {\n :is(.ui.table:not(.unstackable), .ui.stackable.table).stack-by-container {\n --_table-stack: 1;\n }\n }\n @container (width < 992px) {\n .ui[class*=\"tablet stackable\"].stack-by-container.table {\n --_table-stack: 1;\n }\n }\n @media (--ui-mobile) {\n :is(.ui.table:not(.unstackable), .ui.stackable.table).stack-by-viewport {\n --_table-stack: 1;\n }\n }\n @media (--ui-mobile), (--ui-tablet) {\n .ui[class*=\"tablet stackable\"].stack-by-viewport.table {\n --_table-stack: 1;\n }\n }\n}\n\n/*******************************\n States\n*******************************/\n\n@layer ui.components.table.states {\n /*\n * Row and cell colours: each hue / state class => private tokens, painted by ONE rule set below.\n * - `--_table-tint` / `-ink`: the light background and its text (Fomantic's coloured and state cells)\n * - `--_table-fill` / `-fill-on`: the full colour and its text (inverted tables)\n * - `--_table-mark` / `-mark-inverted`: the `marked` edge\n * - `red colored` / `red marked` are phrases, so one cell can be `red colored right blue marked`.\n */\n .ui.table :is(tr, th, td).positive {\n --_table-tint: var(--ui-positive-background);\n --_table-ink: var(--ui-positive-text);\n }\n .ui.table :is(tr, th, td).negative {\n --_table-tint: var(--ui-negative-background);\n --_table-ink: var(--ui-negative-text);\n }\n .ui.table :is(tr, th, td).error {\n --_table-tint: var(--ui-error-background);\n --_table-ink: var(--ui-error-text);\n }\n .ui.table :is(tr, th, td).warning {\n --_table-tint: var(--ui-warning-background);\n --_table-ink: var(--ui-warning-text);\n }\n .ui.table :is(tr, th, td).active {\n --_table-tint: var(--_ui-table-active-background);\n --_table-ink: var(--_ui-table-active-color);\n }\n .ui.table :is(tr, th, td):is(.primary:not(.marked), [class*=\"primary colored\"]) {\n --_table-tint: var(--ui-primary-background);\n --_table-ink: var(--ui-primary-text);\n --_table-fill: var(--ui-primary);\n --_table-fill-on: var(--ui-primary-on);\n }\n .ui.table :is(tr, th, td):is(.secondary:not(.marked), [class*=\"secondary colored\"]) {\n --_table-tint: var(--ui-secondary-background);\n --_table-ink: var(--ui-secondary-text);\n --_table-fill: var(--ui-secondary);\n --_table-fill-on: var(--ui-secondary-on);\n }\n .ui.table :is(tr, th, td):is(.red:not(.marked), [class*=\"red colored\"]) {\n --_table-tint: var(--ui-red-background);\n --_table-ink: var(--ui-red-text);\n --_table-fill: var(--ui-red);\n --_table-fill-on: var(--ui-red-on);\n }\n .ui.table :is(tr, th, td):is(.orange:not(.marked), [class*=\"orange colored\"]) {\n --_table-tint: var(--ui-orange-background);\n --_table-ink: var(--ui-orange-text);\n --_table-fill: var(--ui-orange);\n --_table-fill-on: var(--ui-orange-on);\n }\n .ui.table :is(tr, th, td):is(.yellow:not(.marked), [class*=\"yellow colored\"]) {\n --_table-tint: var(--ui-yellow-background);\n --_table-ink: var(--ui-yellow-text);\n --_table-fill: var(--ui-yellow);\n --_table-fill-on: var(--ui-yellow-on);\n }\n .ui.table :is(tr, th, td):is(.olive:not(.marked), [class*=\"olive colored\"]) {\n --_table-tint: var(--ui-olive-background);\n --_table-ink: var(--ui-olive-text);\n --_table-fill: var(--ui-olive);\n --_table-fill-on: var(--ui-olive-on);\n }\n .ui.table :is(tr, th, td):is(.green:not(.marked), [class*=\"green colored\"]) {\n --_table-tint: var(--ui-green-background);\n --_table-ink: var(--ui-green-text);\n --_table-fill: var(--ui-green);\n --_table-fill-on: var(--ui-green-on);\n }\n .ui.table :is(tr, th, td):is(.teal:not(.marked), [class*=\"teal colored\"]) {\n --_table-tint: var(--ui-teal-background);\n --_table-ink: var(--ui-teal-text);\n --_table-fill: var(--ui-teal);\n --_table-fill-on: var(--ui-teal-on);\n }\n .ui.table :is(tr, th, td):is(.blue:not(.marked), [class*=\"blue colored\"]) {\n --_table-tint: var(--ui-blue-background);\n --_table-ink: var(--ui-blue-text);\n --_table-fill: var(--ui-blue);\n --_table-fill-on: var(--ui-blue-on);\n }\n .ui.table :is(tr, th, td):is(.violet:not(.marked), [class*=\"violet colored\"]) {\n --_table-tint: var(--ui-violet-background);\n --_table-ink: var(--ui-violet-text);\n --_table-fill: var(--ui-violet);\n --_table-fill-on: var(--ui-violet-on);\n }\n .ui.table :is(tr, th, td):is(.purple:not(.marked), [class*=\"purple colored\"]) {\n --_table-tint: var(--ui-purple-background);\n --_table-ink: var(--ui-purple-text);\n --_table-fill: var(--ui-purple);\n --_table-fill-on: var(--ui-purple-on);\n }\n .ui.table :is(tr, th, td):is(.pink:not(.marked), [class*=\"pink colored\"]) {\n --_table-tint: var(--ui-pink-background);\n --_table-ink: var(--ui-pink-text);\n --_table-fill: var(--ui-pink);\n --_table-fill-on: var(--ui-pink-on);\n }\n .ui.table :is(tr, th, td):is(.brown:not(.marked), [class*=\"brown colored\"]) {\n --_table-tint: var(--ui-brown-background);\n --_table-ink: var(--ui-brown-text);\n --_table-fill: var(--ui-brown);\n --_table-fill-on: var(--ui-brown-on);\n }\n .ui.table :is(tr, th, td):is(.grey:not(.marked), [class*=\"grey colored\"]) {\n --_table-tint: var(--ui-grey-background);\n --_table-ink: var(--ui-grey-text);\n --_table-fill: var(--ui-grey);\n --_table-fill-on: var(--ui-grey-on);\n }\n .ui.table :is(tr, th, td):is(.black:not(.marked), [class*=\"black colored\"]) {\n --_table-tint: var(--ui-black-background);\n --_table-ink: var(--ui-black-text);\n --_table-fill: var(--ui-black);\n --_table-fill-on: var(--ui-black-on);\n }\n .ui.table :is(tr, td)[class*=\"primary marked\"] {\n --_table-mark: var(--ui-primary);\n --_table-mark-inverted: var(--ui-primary-inverted);\n }\n .ui.table :is(tr, td)[class*=\"secondary marked\"] {\n --_table-mark: var(--ui-secondary);\n --_table-mark-inverted: var(--ui-secondary-inverted);\n }\n .ui.table :is(tr, td)[class*=\"red marked\"] {\n --_table-mark: var(--ui-red);\n --_table-mark-inverted: var(--ui-red-inverted);\n }\n .ui.table :is(tr, td)[class*=\"orange marked\"] {\n --_table-mark: var(--ui-orange);\n --_table-mark-inverted: var(--ui-orange-inverted);\n }\n .ui.table :is(tr, td)[class*=\"yellow marked\"] {\n --_table-mark: var(--ui-yellow);\n --_table-mark-inverted: var(--ui-yellow-inverted);\n }\n .ui.table :is(tr, td)[class*=\"olive marked\"] {\n --_table-mark: var(--ui-olive);\n --_table-mark-inverted: var(--ui-olive-inverted);\n }\n .ui.table :is(tr, td)[class*=\"green marked\"] {\n --_table-mark: var(--ui-green);\n --_table-mark-inverted: var(--ui-green-inverted);\n }\n .ui.table :is(tr, td)[class*=\"teal marked\"] {\n --_table-mark: var(--ui-teal);\n --_table-mark-inverted: var(--ui-teal-inverted);\n }\n .ui.table :is(tr, td)[class*=\"blue marked\"] {\n --_table-mark: var(--ui-blue);\n --_table-mark-inverted: var(--ui-blue-inverted);\n }\n .ui.table :is(tr, td)[class*=\"violet marked\"] {\n --_table-mark: var(--ui-violet);\n --_table-mark-inverted: var(--ui-violet-inverted);\n }\n .ui.table :is(tr, td)[class*=\"purple marked\"] {\n --_table-mark: var(--ui-purple);\n --_table-mark-inverted: var(--ui-purple-inverted);\n }\n .ui.table :is(tr, td)[class*=\"pink marked\"] {\n --_table-mark: var(--ui-pink);\n --_table-mark-inverted: var(--ui-pink-inverted);\n }\n .ui.table :is(tr, td)[class*=\"brown marked\"] {\n --_table-mark: var(--ui-brown);\n --_table-mark-inverted: var(--ui-brown-inverted);\n }\n .ui.table :is(tr, td)[class*=\"grey marked\"] {\n --_table-mark: var(--ui-grey);\n --_table-mark-inverted: var(--ui-grey-inverted);\n }\n .ui.table :is(tr, td)[class*=\"black marked\"] {\n --_table-mark: var(--ui-black);\n --_table-mark-inverted: var(--ui-black-inverted);\n }\n\n /* Paint: every coloured / state row and cell, from its tokens. */\n .ui.table\n :is(tr, th, td):is(\n .positive,\n .negative,\n .error,\n .warning,\n .active,\n .colored,\n :is(\n .primary,\n .secondary,\n .red,\n .orange,\n .yellow,\n .olive,\n .green,\n .teal,\n .blue,\n .violet,\n .purple,\n .pink,\n .brown,\n .grey,\n .black\n ):not(.marked)\n ) {\n background: var(--_table-tint);\n color: var(--_table-ink);\n }\n /* A coloured head / foot row shows through its header cells. */\n .ui.table\n > :is(thead, tfoot)\n > tr:is(\n .positive,\n .negative,\n .error,\n .warning,\n .active,\n .colored,\n :is(\n .primary,\n .secondary,\n .red,\n .orange,\n .yellow,\n .olive,\n .green,\n .teal,\n .blue,\n .violet,\n .purple,\n .pink,\n .brown,\n .grey,\n .black\n ):not(.marked)\n )\n > :is(th, td) {\n background: inherit;\n color: inherit;\n }\n /* Inverted: hues fill with the full colour; states keep their (now dark) tint. */\n .ui.inverted.table\n :is(tr, th, td):is(\n .colored,\n :is(\n .primary,\n .secondary,\n .red,\n .orange,\n .yellow,\n .olive,\n .green,\n .teal,\n .blue,\n .violet,\n .purple,\n .pink,\n .brown,\n .grey,\n .black\n ):not(.marked)\n ) {\n background: var(--_table-fill);\n color: var(--_table-fill-on);\n }\n\n /* Marked: a coloured edge on the left or right. */\n .ui.table :is(tr, td).left.marked {\n --_table-mark-shadow: var(--_ui-table-marker-width) 0 0 0 var(--_table-mark) inset;\n box-shadow: var(--_table-mark-shadow);\n }\n .ui.table :is(tr, td).right.marked {\n --_table-mark-shadow: calc(-1 * var(--_ui-table-marker-width)) 0 0 0 var(--_table-mark) inset;\n box-shadow: var(--_table-mark-shadow);\n }\n .ui.inverted.table :is(tr, td).left.marked {\n --_table-mark-shadow: var(--_ui-table-marker-width) 0 0 0 var(--_table-mark-inverted) inset;\n }\n .ui.inverted.table :is(tr, td).right.marked {\n --_table-mark-shadow: calc(-1 * var(--_ui-table-marker-width)) 0 0 0 var(--_table-mark-inverted) inset;\n }\n\n /* Disabled rows and cells: faded, inert to the pointer. */\n .ui.table tr.disabled > :is(td, th),\n .ui.table tr > :is(td, th).disabled {\n color: var(--_ui-table-disabled-color);\n pointer-events: none;\n }\n\n /*\n * Selectable: hovered rows / cells get a translucent overlay over whatever paints them\n * (plain, striped, coloured, state), so one rule serves every colour.\n */\n .ui.selectable.table > tbody > tr:hover,\n .ui.selectable.table > tr:hover,\n .ui.table tbody tr td.selectable:hover {\n background-image: linear-gradient(var(--_ui-table-selectable-background), var(--_ui-table-selectable-background));\n color: var(--_table-ink, var(--_ui-table-selectable-color));\n }\n .ui.inverted.selectable.table > tbody > tr:hover,\n .ui.inverted.table tbody tr td.selectable:hover {\n color: var(--_table-fill-on, var(--_ui-table-selectable-color));\n }\n\n /* Sortable: hover and sorted headers. */\n .ui.sortable.table > thead > tr > th:not([data-sortable=\"false\"], .disabled):hover {\n color: var(--_ui-table-sortable-hover-color);\n }\n .ui.sortable.table:not(.basic) > thead > tr > th:not([data-sortable=\"false\"], .disabled):hover {\n background: var(--_ui-table-sortable-hover-background);\n }\n .ui.sortable.table thead th:is([aria-sort], .sorted) {\n color: var(--_ui-table-sortable-active-color);\n user-select: none;\n }\n .ui.sortable.table:not(.basic) thead th:is([aria-sort], .sorted) {\n background: var(--_ui-table-sortable-active-background);\n }\n .ui.sortable.table > thead > tr > th.disabled:hover {\n color: var(--_ui-table-disabled-color);\n }\n .ui.inverted.sortable.table:not(.basic) > thead > tr > th {\n border-inline-color: transparent;\n }\n .ui.inverted.sortable.table:not(.basic) > thead > tr > th:not([data-sortable=\"false\"], .disabled):hover,\n .ui.inverted.sortable.table:not(.basic) thead th:is([aria-sort], .sorted) {\n background: var(--_ui-table-inverted-sortable-background);\n }\n\n /*\n * Stacked (see \"Stackable\"): every part a block, cells without borders or fills, a line under each row.\n * - Here, in the last sublayer, so it beats cell widths (`four wide`, `collapsing`) and fills --\n * Fomantic needs `!important` and `.ui.ui.ui.ui` for that.\n * - Style queries read the PARENT: `thead` asks the table, `tr` its section, a cell its row.\n */\n @container style(--_table-stack: 1) {\n .ui.table > :is(thead, tbody, tfoot),\n .ui.table > :is(thead, tbody, tfoot) > tr,\n .ui.table > tr,\n .ui.table > :is(thead, tbody, tfoot) > tr > :is(th, td):not(.rowspanned),\n .ui.table > tr > :is(th, td):not(.rowspanned) {\n display: block;\n inline-size: auto;\n }\n .ui.table > :is(thead, tbody, tfoot) > tr,\n .ui.table > tr {\n padding-block: var(--_ui-table-responsive-row-padding);\n box-shadow: var(--_ui-table-responsive-row-shadow), var(--_table-mark-shadow);\n }\n .ui.table > :is(thead, tbody, tfoot) > tr > :is(th, td),\n .ui.table > tr > :is(th, td) {\n padding: var(--_ui-table-responsive-cell-padding);\n border: none;\n box-shadow: none;\n background: none;\n }\n .ui.table > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child,\n .ui.table > tr > :is(th, td):first-child {\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.definition.table > thead > tr > :is(th, td):first-child {\n box-shadow: none;\n }\n }\n}\n\n/*******************************\n Rows and cells\n*******************************/\n\n/*\n * Rows mode (epic `ui-gaps` P7): `<ui-row>`s of `<ui-cell>`s, with no native table.\n * - The DOM element is the table box: the element mirrors its class words onto ITSELF, so the rules above that\n * style `.ui.table` (border, fill, colour edge, basic, inverted) style it as they style a native table.\n * - The shadow scroller is a CSS grid of `--_table-columns` columns (the element sets it);\n * each row is a subgrid of all of them, so columns line up; a cell spans its own (`<ui-cell span>`).\n * - Rows and cells are LIGHT DOM, styled here by this PAGE sheet: `:state(header)` / `:state(footer)` on a row,\n * `:state(header)` on a cell.\n * - NOTE: the caption (`caption`) sits inside the table's border, at its top; a native `<caption>` sits above it.\n */\n\n@layer ui.components.table.content {\n /* Shadow: the grid, and the caption above it. */\n :host(:state(rows)) > .scroller {\n display: grid;\n grid-template-columns: repeat(var(--_table-columns, 1), auto);\n margin: 0;\n }\n :host(:state(rows)) > .caption,\n :host > .caption {\n padding: var(--ui-space-xs) var(--_ui-table-cell-padding-inline, 0.785714em);\n color: var(--ui-text-muted);\n text-align: start;\n }\n\n /* Light DOM: rows span every column, as subgrids; cells are its items. */\n /* `container: none`: the grid's sheet makes a row a size container, and a contained box can't be a subgrid */\n .ui.table:state(rows) > ui-row {\n container: none;\n display: grid;\n grid-column: 1 / -1;\n grid-template-columns: subgrid;\n --_table-mark-shadow: 0 0 transparent;\n }\n .ui.table:state(rows) > ui-row > ui-cell {\n --ui-color: initial;\n --ui-color-text: initial;\n --ui-color-header: initial;\n --ui-color-border: initial;\n --ui-color-background: initial;\n --ui-color-inverted: initial;\n --ui-color-on: initial;\n --ui-color-inverted-on: initial;\n --ui-scale: initial;\n --_table-hosted: initial;\n --_table-stack-by: initial;\n display: block;\n min-inline-size: 0;\n padding: var(--_ui-table-cell-padding-block) var(--_ui-table-cell-padding-inline);\n border-block-start: var(--_ui-table-row-border);\n transition:\n background var(--_ui-table-duration) var(--ui-ease),\n color var(--_ui-table-duration) var(--ui-ease);\n }\n .ui.table:state(rows) > ui-row:first-child > ui-cell,\n .ui.table:state(rows) > ui-row:state(header) + ui-row > ui-cell {\n border-block-start: none;\n }\n\n /* Header row: the column headers. */\n .ui.table:state(rows) > ui-row:state(header) > ui-cell {\n padding-block: var(--_ui-table-header-padding-block);\n border-block-end: var(--_ui-table-header-border);\n background: var(--_ui-table-header-background);\n color: var(--_ui-table-header-color);\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.table:state(rows):not(:state(captioned)) > ui-row:state(header):first-child > ui-cell:first-child {\n border-start-start-radius: var(--_ui-table-radius);\n }\n .ui.table:state(rows):not(:state(captioned)) > ui-row:state(header):first-child > ui-cell:last-child {\n border-start-end-radius: var(--_ui-table-radius);\n }\n\n /* A header cell in a body row: its row's name. */\n .ui.table:state(rows) > ui-row:not(:state(header)) > ui-cell:state(header) {\n font-weight: var(--ui-font-weight-bold);\n }\n\n /* Footer row */\n .ui.table:state(rows) > ui-row:state(footer) > ui-cell {\n border-block-start: var(--_ui-table-footer-border);\n background: var(--_ui-table-footer-background);\n color: var(--_ui-table-footer-color);\n }\n}\n\n@layer ui.components.table.variations {\n /* Celled */\n .ui.celled.table:state(rows) > ui-row > ui-cell + ui-cell {\n border-inline-start: var(--_ui-table-cell-border);\n }\n\n /* Striped: every other body row. */\n .ui.striped.table:state(rows) > ui-row:nth-child(2n of :not(:state(header), :state(footer))) {\n background-color: var(--_ui-table-striped-background);\n }\n .ui.inverted.striped.table:state(rows) > ui-row:nth-child(2n of :not(:state(header), :state(footer))) {\n background-color: var(--_ui-table-inverted-striped-background);\n }\n\n /* Basic */\n .ui.basic.table:state(rows) > ui-row:state(header) > ui-cell {\n background: transparent;\n }\n\n /* Very basic: no padding at the edges. */\n .ui[class*=\"very basic\"].table:not(.sortable, .striped):state(rows) > ui-row > ui-cell:first-child {\n padding-inline-start: 0;\n }\n .ui[class*=\"very basic\"].table:not(.sortable, .striped):state(rows) > ui-row > ui-cell:last-child {\n padding-inline-end: 0;\n }\n\n /* Padding */\n .ui.padded.table:state(rows) > ui-row > ui-cell {\n padding: var(--_ui-table-padded);\n }\n .ui[class*=\"very padded\"].table:state(rows) > ui-row > ui-cell {\n padding: var(--_ui-table-very-padded);\n }\n .ui.compact.table:state(rows) > ui-row > ui-cell {\n padding: var(--_ui-table-compact-padding-block) var(--_ui-table-compact-padding-inline);\n }\n .ui[class*=\"very compact\"].table:state(rows) > ui-row > ui-cell {\n padding: var(--_ui-table-very-compact-padding-block) var(--_ui-table-very-compact-padding-inline);\n }\n\n /* Single line */\n .ui[class*=\"single line\"].table:state(rows) > ui-row > ui-cell {\n white-space: nowrap;\n }\n}\n\n@layer ui.components.table.states {\n /* Selectable: body rows light up on hover. */\n .ui.selectable.table:state(rows) > ui-row:not(:state(header), :state(footer)):hover {\n background: var(--_ui-table-selectable-background);\n color: var(--_ui-table-selectable-color);\n }\n .ui.inverted.selectable.table:state(rows) > ui-row:not(:state(header), :state(footer)):hover {\n background: var(--_ui-table-inverted-selectable-background);\n }\n\n /* Sortable: a header cell is a control. */\n .ui.sortable.table:state(rows) > ui-row:state(header) > ui-cell:not([data-sortable=\"false\"]) {\n cursor: pointer;\n user-select: none;\n }\n .ui.sortable.table:state(rows) > ui-row:state(header) > ui-cell:not([data-sortable=\"false\"]):hover {\n background: var(--_ui-table-sortable-hover-background);\n color: var(--_ui-table-sortable-hover-color);\n }\n .ui.sortable.table:state(rows) > ui-row:state(header) > ui-cell[aria-sort] {\n background: var(--_ui-table-sortable-active-background);\n color: var(--_ui-table-sortable-active-color);\n }\n .ui.sortable.table:state(rows) > ui-row:state(header) > ui-cell[tabindex]:focus-visible {\n outline: var(--ui-focus-width) solid var(--ui-focus-color);\n outline-offset: calc(-1 * var(--ui-focus-width));\n }\n /* The direction caret, drawn only on the sorted header: the native table's. */\n .ui.sortable.table:state(rows) > ui-row:state(header) > ui-cell[aria-sort=\"ascending\"] {\n --_table-caret: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 2l4 6H1z'/%3E%3C/svg%3E\");\n }\n .ui.sortable.table:state(rows) > ui-row:state(header) > ui-cell[aria-sort=\"descending\"] {\n --_table-caret: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 8L1 2h8z'/%3E%3C/svg%3E\");\n }\n .ui.sortable.table:state(rows) > ui-row:state(header) > ui-cell[aria-sort]::after {\n content: \"\";\n display: inline-block;\n inline-size: 0.8em;\n block-size: 0.8em;\n margin-inline-start: 0.5em;\n background-color: currentColor;\n opacity: var(--_ui-table-sortable-icon-opacity);\n vertical-align: -0.05em;\n mask: var(--_table-caret) center / contain no-repeat;\n }\n\n /* Stacked (see \"Stackable\"): the grid, its rows and cells, blocks; a line under each row. */\n @container style(--_table-stack: 1) {\n :host(:state(rows)) > .scroller {\n display: block;\n }\n .ui.table:state(rows) > ui-row {\n display: block;\n padding-block: var(--_ui-table-responsive-row-padding);\n box-shadow: var(--_ui-table-responsive-row-shadow);\n }\n .ui.table:state(rows) > ui-row > ui-cell {\n padding: var(--_ui-table-responsive-cell-padding);\n border: none;\n background: none;\n }\n .ui.table:state(rows) > ui-row > ui-cell:first-child {\n font-weight: var(--ui-font-weight-bold);\n }\n }\n}\n","// oxlint-disable-next-line spell-ui/no-solid-effect -- the class mirror's RENDER effect: a throw must reach the error boundary\nimport { For, Show, createRenderEffect } from \"solid-js\"\nimport { Portal, isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { tableVocabulary } from \"./UITable.en\"\nimport { TableClassMirror } from \"./TableClassMirror\"\nimport { ATTACH, TableGrammar } from \"./TableGrammar\"\nimport { TableRows } from \"./TableRows\"\nimport { TableSort } from \"./TableSort\"\n\nimport tableCSS from \"./UITable.css?inline\"\n\n/****************\n * ### `UITable`\n * The component behind `<ui-table>`:\n * a native `<table>` in Fomantic's table look, `<ui-table celled appearance=\"striped\"><table>...</table></ui-table>`.\n *\n * - The table stays NATIVE and in the LIGHT DOM (table semantics, find-in-page, copy, the page's CSS);\n * the shadow root is only `<div class=\"... scroller\" part=\"scroller\"><slot></slot></div>`.\n *\n * - Styling: the component mirrors its class string (`ui celled striped table`, from `ClassBuilder`)\n * onto the slotted table (`TableClassMirror`), and registers `UITable.css` as a PAGE sheet too,\n * whose class-grammar rules then style it.\n * - The mirror writes only its own words and keeps the author's classes,\n * and writes them again when a framework rewrites `className`.\n * - Why classes, not attribute selectors on the DOM element:\n * one mechanical port of `table.less` serves the element and static markup\n * (a server writes `class=\"ui celled table\"` and paints before any JS),\n * and translated names, `yes` / `no` and `medium` resolve through the vocabulary like every other component's.\n *\n * - Row and cell looks are the author's classes on native `tr` / `td` / `th`\n * (`positive`, `red marked left`, `collapsing` ...): no JS.\n *\n * - Scrolling: `scrolling` and `overflowing` cap the scroller's height.\n * It then scrolls, and is a focusable, named region\n * (the DOM element's `aria-label`, else the `<caption>`, else the translated `label`).\n * - A table that doesn't stack (`unstackable`, `stack-by=\"none\"`, or too wide for the stacking breakpoint)\n * and is wider than its box scrolls SIDEWAYS in the scroller, its height uncapped:\n * the same focusable, named region, never the page (`isTooWide`, measured).\n * - A stacked table always fits its box, so it never does.\n *\n * - Sorting (`sortable`): every `thead` header sorts, except `th[data-sortable=\"false\"]` and `th.disabled`.\n * - A header's `<button>` is its control (APG's sortable table: authors SHOULD put one in each sortable header);\n * a header without one is made focusable (`tabindex=\"0\"`) and answers Enter and Space.\n * The component never moves or wraps the author's nodes.\n * - The sorted header gets `aria-sort` (removed from the others); `UITable.css` draws the caret from it.\n * - `sort-column` and `sort-direction` are auto-controlled.\n * Each activation first sends the cancelable `ui-sorting` (`TableSortDetail`):\n * the sorted column flips, another starts `ascending`.\n * - Reordering: data mode shows its rows sorted.\n * A slotted table reorders its `tbody` rows by cell text only with `client-sort` (simple static tables);\n * otherwise the app sorts: frameworks own their rows.\n *\n * - Data mode: `rows` (and optional `columnDefs`), with NO slotted `<table>`, draws one into the LIGHT DOM:\n * header cells `scope=\"col\"`, a sort `<button>` each when sortable, keyed rows, text only (never HTML).\n * It's removed when `rows` is unset or an author table appears: the author's table always wins.\n * - Why the light DOM: the same page sheet and class grammar as a slotted table,\n * native semantics in the document,\n * and a server draws the same `<table>` itself (first paint never needs the property).\n * - NOTE: no virtualization (the plan's ~200-row threshold): every row is drawn.\n *\n * - NOTE: `sort-column` counts `colspan`s but not `rowspan`s (see `TableSort`).\n *\n * - Rows mode (epic `ui-gaps` P7): `<ui-row>`s of `<ui-cell>`s, with no native table, for a drawing,\n * which holds no native HTML.\n * - The DOM element is then the table box: the class mirror writes its class words onto the DOM element itself,\n * so the same class-grammar page rules style it (\"Rows and cells\" in `UITable.css`).\n * - The scroller is a CSS grid of `--_table-columns` columns (`TableRows.columnCount()`), each row a subgrid.\n * - ARIA `table`, its rows `row`, its cells `cell` / `columnheader` / `rowheader`, named by its `caption`.\n * - Sorting works the same (`TableRows`): header cells sort, and `client-sort` moves the row elements.\n * - NOTE: not in a static server render, which draws a rows-mode table unstyled.\n *\n * - `caption`: drawn above the scroller (attribute, or the `caption` slot); a native table's `<caption>` wins.\n *\n * - Static server render (`spell/ui/static`): no observers, effects or listeners.\n * `decorateStatic()` writes the author table's classes, marker and `aria-sort` once,\n * and data mode draws its table inside the scroller (the page's static style sheet styles it there).\n ****************/\nexport class UITable extends E.UIComponent<typeof tableVocabulary> {\n @E.proto static vocabulary = tableVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { table: tableCSS },\n // the scroller and the light-DOM headers take focus themselves\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /**\n * Base `onMount()`, plus the light-DOM work:\n * - the render effect that mirrors classes onto the managed table\n * (undone when the DOM element is released: it survives moves)\n * - the `@onChange` methods watch the table, decorate headers and (with `client-sort`) reorder rows\n */\n override onMount(): JSX.Element {\n const content = super.onMount()\n if (isServer) {\n this.decorateStatic()\n return content\n }\n this.domElement.addReleaseCallback(() => this.classMirror.detach())\n // stays explicit, a RENDER effect: the class mirror is the element's main DOM binding,\n // and a throw in its compute (the classes) must reach the element's error boundary --\n // a plain effect's error is only logged\n createRenderEffect(\n () => [this.mirrorTarget, this.rootClass] as const,\n ([table, classes]) => this.classMirror.apply(table, classes)\n )\n return content\n }\n\n render(): JSX.Element {\n this.registerPageSheets()\n return (\n <>\n <Show when={this.hasOwnCaption}>\n <div class={CAPTION} part={this.partForName(\"caption\")}>\n <slot name=\"caption\">{this.caption}</slot>\n </div>\n </Show>\n <div\n ref={(box: HTMLDivElement) => (this.scroller = box)}\n class={[this.scrollerClasses, { [SIDEWAYS]: this.isTooWide }]}\n style={this.isInRowsMode ? { [COLUMNS_TOKEN]: String(this.columnCount) } : undefined}\n part={this.partForName(\"scroller\")}\n tabindex={this.isScrollRegion ? 0 : undefined}\n role={this.isScrollRegion ? \"region\" : undefined}\n aria-label={this.isScrollRegion ? this.regionLabel : undefined}\n >\n <slot />\n {isServer ? <Show when={this.isInDataMode}>{this.staticTable()}</Show> : undefined}\n </div>\n {isServer ? undefined : (\n <Portal mount={this.domElement}>\n <Show when={this.isInDataMode}>{this.generatedTable()}</Show>\n </Portal>\n )}\n </>\n )\n }\n\n /**\n * Register the family's sheets as PAGE sheets too: their class-grammar rules style the light-DOM table.\n * - Idempotent (`UI.styles.register`); re-registering new text (hot reload) updates them in place.\n */\n private registerPageSheets() {\n if (isServer) return\n for (const [name, css] of Object.entries(this.elementSetup.styleSheets))\n UI.styles.register(name, css, { page: true })\n }\n\n /**\n * `stack-by` as a class on the table before the noun (`ui stackable stack-by-container table`):\n * a private word the sheet keys on, from the CANONICAL value, so a translated attribute still works.\n * - A class, not a state of the DOM element:\n * `:state()` rules in the page sheet left WebKit with stale viewport media queries on a later table.\n */\n protected get extraClass(): string | undefined {\n return this.stackBy ? `${STACK_BY_CLASS}${this.stackBy}` : undefined\n }\n\n ////////////////\n // ## The managed table\n ////////////////\n\n /** First author `<table>` child (never the generated one); follows the DOM element's children. */\n @E.watches({ childList: true })\n get authorTable(): HTMLTableElement | undefined {\n return this.scanAuthorTable()\n }\n\n /** The generated data-mode table, once rendered (set a microtask after its `ref`). */\n @E.state accessor dataTable: HTMLTableElement | undefined = undefined\n\n /** Bumped when the managed table's content changes (header rows, caption text ...). */\n @E.state accessor tableRevision = 0\n\n /** The table this element styles and sorts: the author's, else the generated one. */\n get managedTable(): HTMLTableElement | undefined {\n return this.authorTable ?? (this.isInDataMode ? this.dataTable : undefined)\n }\n\n /** Where the class words go: the managed table, else (rows mode) the DOM element itself. */\n get mirrorTarget(): Element | undefined {\n return this.managedTable ?? (this.isInRowsMode ? this.domElement : undefined)\n }\n\n /** What's sorted, and watched for changes: the managed table, else (rows mode) the DOM element and its rows. */\n get sortTarget(): Element | undefined {\n return this.mirrorTarget\n }\n\n /** Mirrors `rootClass` onto `managedTable`. */\n private readonly classMirror = new TableClassMirror()\n\n /**\n * First `<table>` child that the element didn't render.\n * - By `localName`, not `instanceof HTMLTableElement`: a static server render's children are linkedom elements.\n */\n private scanAuthorTable(): HTMLTableElement | undefined {\n for (const child of this.domElement.children) {\n if (child.localName === \"table\" && !GENERATED.has(child as HTMLTableElement)) return child as HTMLTableElement\n }\n return undefined\n }\n\n /**\n * Watch the managed table's content (rows, header cells, caption text, its `aria-label`)\n * and bump `tableRevision` when it changes.\n * - Returns the cleanup (run when the table changes).\n */\n @E.onChange(\"sortTarget\")\n protected onManagedTableChanged(table: Element | undefined): (() => void) | undefined {\n if (!table) return undefined\n // oxlint-disable-next-line spell-ui/no-mutation-observer -- watches the managed TABLE, swapped with it\n const observer = new MutationObserver(() => this.tableRevision++)\n // rows mode: the rows' `header` / `footer` and the cells' `span` move columns and headers too\n const attributeFilter = this.isInRowsMode ? [\"aria-label\", ...ROW_ATTRIBUTES] : [\"aria-label\"]\n observer.observe(table, { childList: true, subtree: true, characterData: true, attributeFilter })\n return () => observer.disconnect()\n }\n\n /**\n * The author table in a static server render, once: what the browser's effects keep up to date.\n * - its classes mirrored in (`TableClassMirror.mirrored()`)\n * - `data-ui=\"table\"`: a root of the static stylesheet's `@scope` too, so the table sheet reaches its cells\n * (a slotted element's insides are out of its owner's scope, but this sheet is a PAGE sheet in the browser)\n * - `aria-sort` on the sorted header, while `sortable` (the caret)\n * - SIDE EFFECT: writes the page's (linkedom) table; no focusable headers: nothing on a static page sorts.\n */\n @E.untracked\n private decorateStatic() {\n const table = this.authorTable\n if (!table) return\n table.setAttribute(\"class\", TableClassMirror.mirrored(table.getAttribute(\"class\"), this.rootClass))\n table.setAttribute(UIT.STATIC_ROOT, this.vocabulary.noun)\n const column = this.sortColumn\n const direction = this.effectiveSortDirection\n if (!this.sortable || column === undefined || !direction) return\n TableSort.headerAt(table, column)?.setAttribute(\"aria-sort\", direction)\n }\n\n ////////////////\n // ## Rows mode\n ////////////////\n\n /** The DOM element's `<ui-row>` children; follows them. */\n @E.watches({ childList: true, equals: E.isSameList })\n get rowElements(): readonly Element[] {\n return TableRows.rows(this.domElement)\n }\n\n /** Rows mode: `<ui-row>`s, and neither an author table nor data mode. */\n @E.cssState(\"rows\")\n get isInRowsMode(): boolean {\n return this.rowElements.length > 0 && !this.authorTable && this.dataRows === undefined\n }\n\n /** Columns of the rows-mode grid; follows the rows and their cells' `span`s (`tableRevision`). */\n get columnCount(): number {\n void this.tableRevision\n return TableRows.columnCount(this.domElement)\n }\n\n /** ARIA: `table` in rows mode (a native table is its own). */\n @E.aria(\"role\")\n get ariaRole(): string | undefined {\n return this.isInRowsMode ? \"table\" : undefined\n }\n\n /** ARIA name in rows mode: the `caption` text, unless the DOM element has an `aria-label`. */\n @E.aria(\"label\")\n get ariaName(): string | undefined {\n return this.isInRowsMode ? this.caption || undefined : undefined\n }\n\n ////////////////\n // ## Caption\n ////////////////\n\n /** Draws its own caption: `caption` or the slot, and no native `<caption>` of the managed table's. */\n @E.cssState(\"captioned\")\n get hasOwnCaption(): boolean {\n void this.tableRevision\n if (this.managedTable?.caption) return false\n return !!this.caption || this.slots.hasContent(this.slotForName(\"caption\"))\n }\n\n /** Which named slots have content (the `caption` slot). */\n readonly slots = new E.SlotContent(this.domElement)\n\n /** Name the native managed table by `caption`, while it has no name of its own: the one this element set. */\n @E.onChange(\"managedTable\", \"caption\", { writesDOMElement: true })\n protected onCaptionChanged(table: HTMLTableElement | undefined, caption: string | undefined) {\n if (!table || !caption || table.caption || table.hasAttribute(\"aria-label\")) return undefined\n table.setAttribute(\"aria-label\", caption)\n return () => {\n if (table.getAttribute(\"aria-label\") === caption) table.removeAttribute(\"aria-label\")\n }\n }\n\n ////////////////\n // ## Data mode\n ////////////////\n\n /** `rows`, when it's an array. */\n get dataRows(): readonly UIT.TableRow[] | undefined {\n const rows = this.rows\n return Array.isArray(rows) ? (rows as readonly UIT.TableRow[]) : undefined\n }\n\n /** Data mode: `rows` set and no author table. */\n get isInDataMode(): boolean {\n return this.dataRows !== undefined && !this.authorTable\n }\n\n /** Data-mode columns: `columnDefs`, else the first row's keys. */\n @E.derived\n get dataColumns(): readonly UIT.TableColumn[] {\n const defs = this.columnDefs\n if (Array.isArray(defs)) return (defs as UIT.TableColumn[]).filter((column) => typeof column?.key === \"string\")\n const first = this.dataRows?.[0]\n return first ? Object.keys(first).map((key) => ({ key })) : []\n }\n\n /** Data-mode rows in the current sort order; unsorted when the column can't sort. */\n @E.derived\n get sortedRows(): readonly UIT.TableRow[] {\n const rows = this.dataRows ?? []\n const index = this.sortColumn\n const column = index === undefined ? undefined : this.dataColumns[index]\n if (!column || column.sortable === false) return rows\n const sign = this.effectiveSortDirection === \"descending\" ? -1 : 1\n return [...rows].sort((a, b) => TableSort.compare(a[column.key], b[column.key], sign))\n }\n\n /**\n * The data-mode table, into the DOM element's LIGHT DOM (through the `Portal`).\n * - No classes here: `classMirror` writes them like on an author table.\n */\n private generatedTable(): JSX.Element {\n return <table ref={(table: HTMLTableElement) => this.adoptDataTable(table)}>{this.headAndBody()}</table>\n }\n\n /**\n * The data-mode table in a static server render: inside the scroller (no light DOM to portal into),\n * with the classes the mirror would write, and `aria-sort` on the sorted header.\n */\n private staticTable(): JSX.Element {\n return <table class={this.rootClass}>{this.headAndBody(this.effectiveSortDirection)}</table>\n }\n\n /**\n * The data-mode table's head and body.\n * - `direction`: the static render's `aria-sort` for the sorted column's header\n * (the browser's comes from `decorateHeaders()`).\n */\n private headAndBody(direction?: UIT.TableSortDirection): JSX.Element {\n const sorted = direction && this.sortable ? this.sortColumn : undefined\n return (\n <>\n <thead>\n <tr>\n <For each={this.dataColumns}>\n {(column, index) => this.columnHeader(column, index() === sorted ? direction : undefined)}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={this.sortedRows}>\n {(row) => (\n <tr>\n <For each={this.dataColumns}>\n {(column) => (\n <td class={TableGrammar.cell(column) || undefined}>{TableSort.text(row[column.key])}</td>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </>\n )\n }\n\n /**\n * Remember the generated `table`: marked at once (the author-table scan must skip it),\n * stored a microtask later (a `ref` runs inside the render, an owned scope).\n */\n private adoptDataTable(table: HTMLTableElement) {\n GENERATED.add(table)\n E.afterSolidUpdate(() => (this.dataTable = table))\n }\n\n /**\n * One data-mode header: `th scope=\"col\"`, a `<button>` inside while it can sort.\n * - `sort`: its `aria-sort`, in a static server render only.\n */\n private columnHeader(column: UIT.TableColumn, sort?: UIT.TableSortDirection): JSX.Element {\n const text = column.header ?? column.key\n const optOut = column.sortable === false\n return (\n <th\n scope=\"col\"\n aria-sort={sort}\n class={TableGrammar.cell(column) || undefined}\n {...{\n [UIT.TABLE_SORT_KEY]: column.key,\n [UIT.TABLE_SORT_OPT_OUT.attribute]: optOut ? UIT.TABLE_SORT_OPT_OUT.value : undefined\n }}\n >\n <Show when={this.sortable && !optOut} fallback={text}>\n <button type=\"button\">{text}</button>\n </Show>\n </th>\n )\n }\n\n ////////////////\n // ## Sorting\n ////////////////\n\n /** `sort-column`: page-controlled, or set by clicks. */\n @E.controlled(\"sort-column\") accessor sortColumn: number | undefined = undefined\n\n /** `sort-direction`: page-controlled, or set by clicks. */\n @E.controlled(\"sort-direction\") accessor sortDirection: UIT.TableSortDirection | undefined = undefined\n\n /** Direction in effect: `sortDirection`, `ascending` when only a column is set. */\n get effectiveSortDirection(): UIT.TableSortDirection | undefined {\n return this.sortColumn === undefined ? undefined : (this.sortDirection ?? \"ascending\")\n }\n\n /** Headers this element made focusable (`tabindex=\"0\"`). */\n private readonly headersMadeFocusable = new Set<Element>()\n\n /** Header this element set `aria-sort` on. */\n private sortedHeader: Element | undefined\n\n /** The table, its content, `sortable` or the sort changed: decorate the headers again. */\n @E.onChange(\"tableRevision\", \"sortTarget\", \"sortable\", \"sortColumn\", \"effectiveSortDirection\")\n protected onSortChanged(\n _revision: number,\n table: Element | undefined,\n isSortable: boolean,\n column: number | undefined,\n direction: UIT.TableSortDirection | undefined\n ) {\n this.decorateHeaders({ table, isSortable, column, direction })\n }\n\n /**\n * Header ARIA and focus for the current sort:\n * - while `sortable`, every sortable header without a `<button>` gets `tabindex=\"0\"`;\n * headers that stop qualifying lose the ones THIS element set\n * - the sorted column's header gets `aria-sort`; every other header in the `thead` loses it\n */\n private decorateHeaders({ table, isSortable, column, direction }: HeaderSort) {\n const headers = table && isSortable ? TableSort.headers(table) : []\n const focusable = new Set(\n headers.filter((header) => TableSort.isSortable(header) && !header.querySelector(\"button\"))\n )\n for (const header of this.headersMadeFocusable) {\n if (!focusable.has(header)) {\n header.removeAttribute(\"tabindex\")\n this.headersMadeFocusable.delete(header)\n }\n }\n for (const header of focusable) {\n if (header.hasAttribute(\"tabindex\")) continue\n header.setAttribute(\"tabindex\", \"0\")\n this.headersMadeFocusable.add(header)\n }\n const sorted = table && isSortable && column !== undefined ? TableSort.headerAt(table, column) : undefined\n if (this.sortedHeader && this.sortedHeader !== sorted) this.sortedHeader.removeAttribute(\"aria-sort\")\n for (const header of headers) if (header !== sorted) header.removeAttribute(\"aria-sort\")\n if (sorted && direction) sorted.setAttribute(\"aria-sort\", direction)\n this.sortedHeader = sorted\n }\n\n /** `client-sort`: reorder the body rows (the author table's, or rows mode's) by the sorted column's cell text. */\n @E.onChange(\"authorTable\", \"isInRowsMode\", \"clientSort\", \"sortColumn\", \"effectiveSortDirection\")\n protected onClientSortChanged(\n table: HTMLTableElement | undefined,\n isInRowsMode: boolean,\n clientSort: boolean,\n column: number | undefined,\n direction: UIT.TableSortDirection | undefined\n ) {\n const sorted = table ?? (isInRowsMode ? this.domElement : undefined)\n if (clientSort && sorted && column !== undefined && direction) TableSort.sortRows(sorted, column, direction)\n }\n\n /** A click on (or inside) a sortable header sorts by it. */\n @E.on(\"click\")\n protected onClick(event: MouseEvent) {\n const header = this.sortableHeader(event)\n if (header) this.requestSort(header, event)\n }\n\n /** Enter / Space on a focusable header (not its button: that one clicks). */\n @E.on(\"keydown\")\n protected onKeyDown(event: KeyboardEvent) {\n if (event.key !== UIT.Key.enter && event.key !== UIT.Key.space) return\n const header = this.sortableHeader(event)\n if (!header || event.target !== header) return\n event.preventDefault()\n this.requestSort(header, event)\n }\n\n /** The sortable header `event` happened in, while the table is `sortable`. */\n @E.untracked\n private sortableHeader(event: Event): Element | undefined {\n const table = this.sortTarget\n if (!table || !this.sortable) return undefined\n const header = TableSort.header(table, event.target)\n return header && TableSort.isSortable(header) ? header : undefined\n }\n\n /**\n * Sort by `header`'s column: `ui-sorting` first (cancelable), then `sort-column` / `sort-direction`.\n * - The sorted column flips direction; another column starts `ascending`.\n * - Nothing changes when the event is cancelled, or when a handler set either property itself.\n */\n @E.untracked\n private requestSort(header: Element, originalEvent: Event) {\n const table = this.sortTarget\n if (!table) return\n const column = TableSort.column(table, header)\n const current = this.sortColumn\n const direction: UIT.TableSortDirection =\n column === current && this.effectiveSortDirection === \"ascending\" ? \"descending\" : \"ascending\"\n const detail: UIT.TableSortDetail = { column, key: TableSort.key(header), direction, originalEvent }\n this.requestChange(\"sortDirection\", direction, () =>\n this.requestChange(\"sortColumn\", column, () => this.send(\"ui-sorting\", detail))\n )\n }\n\n ////////////////\n // ## The scroller\n ////////////////\n\n /** Shadow scroller's classes, e.g. `resizable short scrolling scroller`. */\n @E.derived\n get scrollerClasses(): string {\n return TableGrammar.scroller((name) => this.scrollerValue(name))\n }\n\n /** Scrolling or overflowing: the scroller's height is capped, and it scrolls. */\n get scrollerScrolls(): boolean {\n return TableGrammar.scrolls((name) => this.scrollerValue(name))\n }\n\n /** The scroller scrolls, either way: a focusable, named region. */\n get isScrollRegion(): boolean {\n return this.scrollerScrolls || this.isTooWide\n }\n\n /** The shadow scroller, once drawn (from its `ref`). */\n private scroller: HTMLDivElement | undefined\n\n /**\n * The table is wider than the scroller: it doesn't stack, and the scroller scrolls it sideways (`SIDEWAYS`).\n * - Measured (`onReadyToMeasure()`): whether a table stacks is the sheet's call\n * (viewport, its own width, tokens), so the width it ends up is the one fact to go on.\n */\n @E.state accessor isTooWide = false\n\n /**\n * SIDE EFFECT: follows the sizes of the scroller and the managed table, once drawn; the cleanup stops.\n * - Never on a server (an effect's apply): a static page's wide table spills, as before.\n */\n @E.onChange(\"isReady\", \"managedTable\")\n protected onReadyToMeasure(isReady: boolean, table: HTMLTableElement | undefined) {\n const box = this.scroller\n if (!isReady || !box) return\n const resizes = new ResizeObserver(() => this.measureWidth())\n resizes.observe(box)\n if (table) resizes.observe(table)\n this.measureWidth()\n return () => resizes.disconnect()\n }\n\n /** Is the table wider than the scroller? A pixel of slack: fractional widths round either way. */\n private measureWidth() {\n const box = this.scroller\n if (box) this.isTooWide = box.scrollWidth > box.clientWidth + 1\n }\n\n /**\n * Name of the scroller region: the DOM element's `aria-label`, else the table's `<caption>` text,\n * else the table's own `aria-label`, else the `label` text.\n * - Read in `render()`: the translated text needs the loaded runtime;\n * follows `tableRevision` (a new caption or `aria-label`).\n * - The table's own name before `label`: several tables on a page, each its own region, need names apart.\n */\n private get regionLabel(): string {\n void this.tableRevision\n const table = this.managedTable\n const caption = table?.caption?.textContent?.trim()\n return this.attributes[\"aria-label\"] ?? (caption || table?.ariaLabel || this.translationForKey(\"label\"))\n }\n\n // `attached` (any edge), `attached-top`, `attached-bottom`, from `attach`:\n // the DOM element carries the table's outer margin, so it mirrors the attached scroller's\n // (`UITable.css`: inside a size container a margin never collapses with the content above).\n\n /** Attached on any edge: `:state(attached)`. */\n @E.cssState(\"attached\")\n get isAttached(): boolean {\n return !!this.scrollerValue(ATTACH)\n }\n\n /** Attached at the top: `:state(attached-top)`. */\n @E.cssState(\"attached-top\")\n get isAttachedTop(): boolean {\n return this.scrollerValue(ATTACH) === UIT.TOP\n }\n\n /** Attached at the bottom: `:state(attached-bottom)`. */\n @E.cssState(\"attached-bottom\")\n get isAttachedBottom(): boolean {\n return this.scrollerValue(ATTACH) === UIT.BOTTOM\n }\n\n /** Converted value of scroller attribute `name` (`TableGrammar.scroller()`'s). */\n private scrollerValue(name: string): unknown {\n return this.classValue(name as E.AttributeName<typeof tableVocabulary>)\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UITable extends E.AttributeValues<typeof tableVocabulary> {}\n\n/** What `decorateHeaders()` decorates for. */\ntype HeaderSort = {\n /** the managed table (or, in rows mode, the DOM element), if any */\n table: Element | undefined\n /** `sortable` */\n isSortable: boolean\n /** sorted column, if any */\n column: number | undefined\n /** its direction, if any */\n direction: UIT.TableSortDirection | undefined\n}\n\n/** Tables the element rendered itself (data mode): never mistaken for an author's. */\nconst GENERATED = new WeakSet<HTMLTableElement>()\n\n/** Prefix of the class `stack-by` adds to the table: `stack-by-container`, `stack-by-viewport`. */\nconst STACK_BY_CLASS = \"stack-by-\"\n\n/** The scroller's class while the table is too wide for it (`isTooWide`): `UITable.css` scrolls it sideways. */\nconst SIDEWAYS = \"sideways\"\n\n/** The caption box's class. */\nconst CAPTION = \"caption\"\n\n/** The rows-mode grid's column count, on the scroller. */\nconst COLUMNS_TOKEN = \"--_table-columns\"\n\n/** Rows-mode attributes that move columns or headers: a row's `header` / `footer`, a cell's `span`. */\nconst ROW_ATTRIBUTES = [\"header\", \"footer\", \"span\"]\n","/**\n * The English vocabulary of `<ui-cell>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), slots, parts and states.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - A cell of a `<ui-row>` in a `<ui-table>` (epic `ui-gaps` P7): a table with no native `<table>`,\n * for a drawing, which holds no native HTML.\n * - Its look is the table's, from its class words (`celled`, `striped`, `padding` ...): no look of its own.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `cellVocabulary`\n * The names of `<ui-cell>`, one cell of a table row: its content, or a header.\n ****************/\nexport const cellVocabulary = {\n tag: \"ui-cell\",\n topics: [\"tables\", \"collections\"],\n aka: [\"table cell\", \"td\", \"th\", \"header cell\"],\n noun: \"cell\",\n description: \"A cell holds one value of a table row; a header cell names its column or row.\",\n attributes: [\n {\n name: \"header\",\n group: \"content\",\n kind: \"boolean\",\n description:\n \"A header cell: in a `header` row it names its column; in a body row, its row (the first cell, say).\"\n },\n {\n name: \"span\",\n group: \"layout\",\n kind: \"number\",\n description: \"How many columns it covers; default 1. Cells never span rows.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"textAlign\",\n values: \"alignments\",\n description: \"Aligns its text: `left`, `center`, `right` or `justified`.\"\n },\n {\n name: \"vertical-align\",\n group: \"layout\",\n kind: \"verticalAlign\",\n values: \"verticalAlignments\",\n description: \"Aligns its content to the `top`, `middle` or `bottom` of the row.\"\n }\n ],\n events: [],\n slots: [{ name: \"\", description: \"The cell's content: text, or any element.\" }],\n parts: [],\n states: [\n { name: \"header\", description: \"Set while it's a header cell (`header`).\" },\n { name: \"in-table\", description: \"Set while it's in a `<ui-table>`.\" }\n ],\n texts: []\n} as const satisfies E.ComponentVocabulary\n","import type { JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { cellVocabulary } from \"./UICell.en\"\nimport { TableRows } from \"./TableRows\"\n\n/****************\n * ### `UICell`\n * The component behind `<ui-cell>`: one cell of a `<ui-row>` in a `<ui-table>` (epic `ui-gaps` P7).\n *\n * - The shadow root is a bare slot: the DOM element IS the cell box, an item of its row's grid.\n * - Its look is the table's PAGE sheet's (`UITable.css`, \"Rows and cells\"), from the table's class words.\n * - ARIA, from where it sits:\n * - `columnheader`: a `header` cell in a `header` row\n * - `rowheader`: a `header` cell in a body row\n * - `cell`: any other cell of a table; nothing outside one\n * - `span` sets `aria-colspan` too\n * - Its own layout (`span`, `align`, `vertical-align`) is a `:host` rule of its own (`hostLayout`),\n * so the page's own `style` stays the author's.\n * - Which table it's in: its OWNER (`PartContext`), climbing through its row (a part too).\n ****************/\nexport class UICell extends E.UIComponent<typeof cellVocabulary> {\n @E.proto static vocabulary = cellVocabulary\n @E.protoMerged static elementSetup = {\n isAPart: true,\n delegatesFocus: false,\n cssStates: [\"header\"]\n } satisfies Partial<E.ElementSetup>\n\n /** The table it's a cell of, if any: `:state(in-table)` follows it. */\n readonly context = new E.PartContext({ domElement: this.domElement, noun: this.vocabulary.noun })\n\n /** In a `<ui-table>`. */\n get isInTable(): boolean {\n return this.context.owner?.ownerNoun === TABLE\n }\n\n /** Columns it covers: `span`, a whole number, at least 1, as its table counts it (`TableRows.spanOf()`). */\n get columnSpan(): number {\n return TableRows.spanOf(this.span)\n }\n\n /**\n * ARIA role, from where it sits (the class docstring).\n * - Reads its row once per owner change: a row turning into a header row later keeps its cells' roles\n * until they move.\n */\n @E.aria(\"role\")\n get ariaRole(): string | undefined {\n if (!this.isInTable) return undefined\n if (!this.header) return \"cell\"\n const row = this.domElement.parentElement as E.DOMElement | null\n return row?.valueNamed?.(HEADER) ? \"columnheader\" : \"rowheader\"\n }\n\n /** `aria-colspan`, while it spans. */\n @E.aria(\"colSpan\")\n get ariaColumnSpan(): string | undefined {\n return this.isInTable && this.columnSpan > 1 ? String(this.columnSpan) : undefined\n }\n\n /** Its own `:host` layout: the columns it spans, its alignment. */\n @E.derived\n protected get hostLayout(): string {\n const rules = [`grid-column: span ${this.columnSpan}`]\n const align = this.align === \"justified\" ? \"justify\" : this.align\n if (align) rules.push(`text-align: ${align}`)\n const vertical = this.verticalAlign\n if (vertical) rules.push(`align-self: ${VERTICAL[vertical as keyof typeof VERTICAL] ?? \"stretch\"}`)\n return rules.join(\"; \")\n }\n\n render(): JSX.Element {\n return <slot />\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UICell extends E.AttributeValues<typeof cellVocabulary> {}\n\n/** The owner noun of a table cell: `<ui-table>`'s. */\nconst TABLE = \"table\"\n\n/** A row's `header` attribute, by its canonical name. */\nconst HEADER = \"header\"\n\n/** `vertical-align` => the cell box's `align-self` in its row. */\nconst VERTICAL = { top: \"start\", middle: \"center\", bottom: \"end\" } as const\n","/**\n * The table family: defines `<ui-table>` and `<ui-cell>`, and exports their components, `UITable` and `UICell`.\n * - `<ui-row>` is the grid family's: in a table it's a table row (epic `ui-gaps` P7).\n * - SIDE EFFECT: importing it defines the tag.\n * - Also the library's `spell/ui/ui-table` entry (its size is in `notes/report.md`).\n * - NOTE: `TableClassMirror`, `TableGrammar`, `TableRows` and `TableSort` are internal helpers, not exported.\n */\n\nimport { UITable } from \"./UITable\"\nimport { UICell } from \"./UICell\"\n// a rows-mode table's rows: the grid family's `<ui-row>` (SIDE EFFECT: defines the grid's tags)\nimport \"spell/ui/components/ui-grid\"\n\nUITable.define()\nUICell.define()\n\nexport { UITable, UICell }\n"],"m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,GAAoD9N,EAAA8N,GAAA,QAAA,GACtD5N,EADE4N,GACK,cAAarN,EAApBoN,GAAA,GADEC,GACkBT,EAAA,CAAA,GAApB5M,EAAAoN,GAAA,IADEC,CAAA,GAEI5N,EAFJ4N,GAEW,gBAAerN,EAAtBoN,GAAA,IAFJC,GAE0B;CACnC,SAAS;CACT,gBAAgB;CAChB,WAAW,CAAC,QAAQ;AACtB,CAAA,CAAA,GAJerN,EAAAoN,GAAA,IAFJC,CAAA;AAAN,IAAMQ,IAANR,GA4DDE,KAAQ,SAGRC,KAAS,UAGTI,KAAW;CAAE,KAAK;CAAS,QAAQ;CAAU,QAAQ;AAAM;AC1EjEjB,GAAQ,OAAO,GACfkB,EAAO,OAAO"}
1
+ {"version":3,"file":"ui-table.js","names":["UIT.WHITESPACE","HEADER","E.kebabCase","_init","E.lazy","E.ClassBuilder","E.numberToWord","__name","<Show when={this.hasOwnCaption}>\n <div class={CAPTION} part={this.partForName(\"caption\")}>\n <slot name=\"caption\">{this.caption}</slot>\n </div>\n </Show>","this","part={this.partForName(\"caption\")}","<div class={CAPTION} part={this.partForName(\"caption\")}>\n <slot name=\"caption\">{this.caption}</slot>\n </div>","ref={(box) => this.scroller = box}","<Show when={this.isInDataMode}>{this.staticTable()}</Show>","style={this.isInRowsMode ? { [COLUMNS_TOKEN]: String(this.columnCount) } : void 0}","part={this.partForName(\"scroller\")}","tabindex={this.isScrollRegion ? 0 : void 0}","role={this.isScrollRegion ? \"region\" : void 0}","aria-label={this.isScrollRegion ? this.regionLabel : void 0}","<Portal mount={this.domElement}>\n <Show when={this.isInDataMode}>{this.generatedTable()}</Show>\n </Portal>","<Show when={this.isInDataMode}>{this.generatedTable()}</Show>","ref={(table) => this.adoptDataTable(table)}","aria-rowcount={this.isWindowed ? this.sortedRows.length + 1 : void 0}","<table\n ref={(table) => this.adoptDataTable(table)}\n role={this.isEditable ? \"grid\" : void 0}\n aria-rowcount={this.isWindowed ? this.sortedRows.length + 1 : void 0}\n >\n {this.headAndBody()}\n </table>","<table class={this.rootClass}>{this.headAndBody(this.effectiveSortDirection)}</table>","<For each={this.dataColumns}>\n {(column, index) => this.columnHeader(column, () => index() === sorted ? direction : void 0)}\n </For>","<tbody>\n {this.spacer(\"above\")}\n <Show\n when={this.isEditable}\n fallback={<For each={this.drawnRows}>\n {(row) => <tr>\n <For each={this.dataColumns}>\n {(column) => <td class={TableGrammar.cell(column) || void 0}>{TableSort.text(row[column.key])}</td>}\n </For>\n </tr>}\n </For>}\n >\n <For each={this.drawnRows}>\n {(row, drawnIndex) => <tr aria-rowindex={this.isWindowed ? this.drawnFrom + drawnIndex() + 2 : void 0}>\n <For each={this.dataColumns}>\n {(column, columnIndex) => this.editableCell({ row, rowIndex: /* @__PURE__ */ __name(() => this.drawnFrom + drawnIndex(), \"rowIndex\"), column, columnIndex })}\n </For>\n </tr>}\n </For>\n {this.spacer(\"below\")}\n <tr class={NEW_ROW} aria-label={this.translationForKey(\"new-row\")}>\n <For each={this.dataColumns}>\n {(column, columnIndex) => this.editableCell({ row: void 0, rowIndex: /* @__PURE__ */ __name(() => this.sortedRows.length, \"rowIndex\"), column, columnIndex })}\n </For>\n </tr>\n </Show>\n <Show when={!this.isEditable}>{this.spacer(\"below\")}</Show>\n </tbody>","<Show\n when={this.isEditable}\n fallback={<For each={this.drawnRows}>\n {(row) => <tr>\n <For each={this.dataColumns}>\n {(column) => <td class={TableGrammar.cell(column) || void 0}>{TableSort.text(row[column.key])}</td>}\n </For>\n </tr>}\n </For>}\n >\n <For each={this.drawnRows}>\n {(row, drawnIndex) => <tr aria-rowindex={this.isWindowed ? this.drawnFrom + drawnIndex() + 2 : void 0}>\n <For each={this.dataColumns}>\n {(column, columnIndex) => this.editableCell({ row, rowIndex: /* @__PURE__ */ __name(() => this.drawnFrom + drawnIndex(), \"rowIndex\"), column, columnIndex })}\n </For>\n </tr>}\n </For>\n {this.spacer(\"below\")}\n <tr class={NEW_ROW} aria-label={this.translationForKey(\"new-row\")}>\n <For each={this.dataColumns}>\n {(column, columnIndex) => this.editableCell({ row: void 0, rowIndex: /* @__PURE__ */ __name(() => this.sortedRows.length, \"rowIndex\"), column, columnIndex })}\n </For>\n </tr>\n </Show>","<For each={this.drawnRows}>\n {(row) => <tr>\n <For each={this.dataColumns}>\n {(column) => <td class={TableGrammar.cell(column) || void 0}>{TableSort.text(row[column.key])}</td>}\n </For>\n </tr>}\n </For>","<For each={this.dataColumns}>\n {(column) => <td class={TableGrammar.cell(column) || void 0}>{TableSort.text(row[column.key])}</td>}\n </For>","<For each={this.drawnRows}>\n {(row, drawnIndex) => <tr aria-rowindex={this.isWindowed ? this.drawnFrom + drawnIndex() + 2 : void 0}>\n <For each={this.dataColumns}>\n {(column, columnIndex) => this.editableCell({ row, rowIndex: /* @__PURE__ */ __name(() => this.drawnFrom + drawnIndex(), \"rowIndex\"), column, columnIndex })}\n </For>\n </tr>}\n </For>","<For each={this.dataColumns}>\n {(column, columnIndex) => this.editableCell({ row, rowIndex: /* @__PURE__ */ __name(() => this.drawnFrom + drawnIndex(), \"rowIndex\"), column, columnIndex })}\n </For>","this.spacer(\"below\")","<For each={this.dataColumns}>\n {(column, columnIndex) => this.editableCell({ row: void 0, rowIndex: /* @__PURE__ */ __name(() => this.sortedRows.length, \"rowIndex\"), column, columnIndex })}\n </For>","aria-label={this.translationForKey(\"new-row\")}","<Show when={!this.isEditable}>{this.spacer(\"below\")}</Show>","<Show when={this.isWindowed}>\n <tr class={SPACER} aria-hidden=\"true\">\n <td colspan={Math.max(1, this.dataColumns.length)} style={{ height: `${rows() * this.rowHeight}px` }} />\n </tr>\n </Show>","colspan={Math.max(1, this.dataColumns.length)}","height: `${rows() * this.rowHeight}px`","<tr class={SPACER} aria-hidden=\"true\">\n <td colspan={Math.max(1, this.dataColumns.length)} style={{ height: `${rows() * this.rowHeight}px` }} />\n </tr>","scope=\"col\"","<Show when={this.sortable && !optOut} fallback={text}>\n <button type=\"button\">{text}</button>\n </Show>","fallback={text}","<button type=\"button\">{text}</button>","<th\n scope=\"col\"\n aria-sort={sort()}\n class={TableGrammar.cell(column) || void 0}\n {...{\n [UIT.TABLE_SORT_KEY]: column.key,\n [UIT.TABLE_SORT_OPT_OUT.attribute]: optOut ? UIT.TABLE_SORT_OPT_OUT.value : void 0\n }}\n >\n <Show when={this.sortable && !optOut} fallback={text}>\n <button type=\"button\">{text}</button>\n </Show>\n </th>","<Show\n when={isEditing()}\n fallback={<Show when={type() === \"yes-no\"} fallback={<>{TableEditing.textFor(column, type(), value())}</>}>\n <input\n type=\"checkbox\"\n class={TICK}\n tabindex=\"-1\"\n checked={!!value()}\n disabled={!!column.readOnly}\n aria-label={column.header ?? column.key}\n onClick={(event) => {\n event.preventDefault();\n this.toggle({ row: rowIndex(), column: columnIndex() }, event);\n }}\n />\n </Show>}\n >\n {this.editor(column, type())}\n </Show>","<Show when={type() === \"yes-no\"} fallback={<>{TableEditing.textFor(column, type(), value())}</>}>\n <input\n type=\"checkbox\"\n class={TICK}\n tabindex=\"-1\"\n checked={!!value()}\n disabled={!!column.readOnly}\n aria-label={column.header ?? column.key}\n onClick={(event) => {\n event.preventDefault();\n this.toggle({ row: rowIndex(), column: columnIndex() }, event);\n }}\n />\n </Show>","{TableEditing.textFor(column, type(), value())}","checked={!!value()}","disabled={!!column.readOnly}","aria-label={column.header ?? column.key}","<input\n type=\"checkbox\"\n class={TICK}\n tabindex=\"-1\"\n checked={!!value()}\n disabled={!!column.readOnly}\n aria-label={column.header ?? column.key}\n onClick={(event) => {\n event.preventDefault();\n this.toggle({ row: rowIndex(), column: columnIndex() }, event);\n }}\n />","<td\n class={[TableGrammar.cell(column) || void 0, { [CURSOR]: isCursor() && !!this.cursor }]}\n tabindex={isCursor() ? 0 : -1}\n aria-readonly={column.readOnly ? \"true\" : void 0}\n >\n <Show\n when={isEditing()}\n fallback={<Show when={type() === \"yes-no\"} fallback={<>{TableEditing.textFor(column, type(), value())}</>}>\n <input\n type=\"checkbox\"\n class={TICK}\n tabindex=\"-1\"\n checked={!!value()}\n disabled={!!column.readOnly}\n aria-label={column.header ?? column.key}\n onClick={(event) => {\n event.preventDefault();\n this.toggle({ row: rowIndex(), column: columnIndex() }, event);\n }}\n />\n </Show>}\n >\n {this.editor(column, type())}\n </Show>\n <Show when={row && columnIndex() === this.dataColumns.length - 1}>\n <button\n type=\"button\"\n class={DELETE_ROW}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"delete-row\")}\n onClick={(event) => this.removeRow(rowIndex(), event)}\n >\n ×\n </button>\n </Show>\n </td>","<Show when={row && columnIndex() === this.dataColumns.length - 1}>\n <button\n type=\"button\"\n class={DELETE_ROW}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"delete-row\")}\n onClick={(event) => this.removeRow(rowIndex(), event)}\n >\n ×\n </button>\n </Show>","aria-label={this.translationForKey(\"delete-row\")}","<button\n type=\"button\"\n class={DELETE_ROW}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"delete-row\")}\n onClick={(event) => this.removeRow(rowIndex(), event)}\n >\n ×\n </button>","tabindex={isCursor() ? 0 : -1}","aria-readonly={column.readOnly ? \"true\" : void 0}","ref={focus}","<For each={column.choices ?? []}>\n {(choice, index) => <option value={String(index())} selected={this.editing?.draft === String(index())}>\n {choice.text ?? TableSort.text(choice.value)}\n </option>}\n </For>","selected={this.editing?.draft === String(index())}","selected={this.editing?.draft === \"\"}","<select\n ref={focus}\n class={EDITOR}\n aria-label={column.header ?? column.key}\n onChange={draft}\n onFocusOut={() => this.commitEdit()}\n >\n <option value=\"\" selected={this.editing?.draft === \"\"} />\n <For each={column.choices ?? []}>\n {(choice, index) => <option value={String(index())} selected={this.editing?.draft === String(index())}>\n {choice.text ?? TableSort.text(choice.value)}\n </option>}\n </For>\n </select>","value={this.editing?.draft ?? \"\"}","<input\n ref={focus}\n class={EDITOR}\n type={type === \"number\" ? \"number\" : type === \"date\" ? \"date\" : \"text\"}\n value={this.editing?.draft ?? \"\"}\n aria-label={column.header ?? column.key}\n onInput={draft}\n onFocusOut={() => this.commitEdit()}\n />","_tmpl$","_ariaRole_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","E.UIComponent","E.proto","E.protoMerged","E.watches","E.state","E.onChange","E.untracked","E.isSameList","E.cssState","E.aria","E.derived","E.controlled","E.on","E.SlotContent","_$createComponent","_$getOwner","_$readShallow","_$setAttribute","UIT.STATIC_ROOT","_$memo","_$setStyleProperty","E.beforeNextPaint","UIT.TABLE_SORT_KEY","E.afterSolidUpdate","UIT.BOTTOM","__name","tableCSS","_$delegateEvents","<slot />","E.UIComponent","E.proto","E.protoMerged","E.aria","E.derived","E.PartContext","_$getOwner","__name","__name$1","Key","WHITESPACE","__publicField","__decorateElement","__decoratorMetadata","__runInitializers","__privateAdd","TABLE_SORT_OPT_OUT","STATIC_ROOT","BOTTOM","TABLE_SORT_KEY","__decoratorStart","getOwner$1","tableVocabulary","TableClassMirror","classes","table","current","word","text","author","ours","mine","kept","next","TableRows","child","ROW","row","CELL","HEADER$1","FOOTER","cell","SPAN","widest","width","sum","footer","sorted","span","value","name","element","tag","UI","Converters","TableSort","NATIVE_TABLE","NATIVE","shape","rows","target","header","column","before","start","sign","direction","texts","a","b","index","missingA","missingB","COLLATOR","body","TableEditing","first","plain","key","kebabCase","ID","one","type","choice","draft","number","was","YES","choices","byPlace","byWords","lines","line","edits","cells","lineIndex","values","at","cellIndex","col","columns","types","newest","edit","changed","date","_builder_dec","lazy","_init$2","_TableGrammar","input","SCROLLER_ATTRIBUTES","SCROLLING","OVERFLOWING","ClassBuilder","words","grammar","ValueSets","numberToWord","SCROLLER_NOUN","TableGrammar","ATTACH","UITable_default","_tmpl$$1","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_tmpl$6","_tmpl$7","_tmpl$8","_tmpl$9","_tmpl$10","_tmpl$11","_tmpl$12","_tmpl$13","_tmpl$14","_tmpl$15","_tmpl$16","_isAttachedBottom_dec","_isAttachedTop_dec","_isAttached_dec","_onReadyToMeasure_dec","_isTooWide_dec","_scrollerClasses_dec","_focusCursor_dec","_setCursor_dec","_moveCursor_dec","_sendEdits_dec","_onPaste_dec","_removeRow_dec","_clearCell_dec","_toggle_dec","_commitEdit_dec","_startEdit_dec","_editingKey_dec","_onDoubleClick_dec","_clickedCell_dec","_placeOf_dec","_cellAt_dec","_editing_dec","_cursor_dec","_requestSort_dec","_sortableHeader_dec","_onKeyDown_dec","_onClick_dec","_onClientSortChanged_dec","_onSortChanged_dec","_sortDirection_dec","_sortColumn_dec","_drawRow_dec","_measureWindow_dec","_onWindowed_dec","_rowHeight_dec","_windowSize_dec","_windowStart_dec","_dataColumns_dec","_onCaptionChanged_dec","_hasOwnCaption_dec","_ariaName_dec","_ariaRole_dec$1","_isInRowsMode_dec","_rowElements_dec","_decorateStatic_dec","_onManagedTableChanged_dec","_tableRevision_dec","_dataTable_dec","_authorTable_dec","_elementSetup_dec$1","_vocabulary_dec$1","_a$1","_init$1","_dataTable","_tableRevision","_windowStart","_windowSize","_rowHeight","_sortColumn","_sortDirection","_cursor","_editing","_isTooWide","_UITable","UIComponent","proto","protoMerged","watches","state","onChange","untracked","isSameList","cssState","aria","derived","controlled","on","SlotContent","WINDOW_FIRST_SIZE","DEFAULT_ROW_PX","content","isServer","createRenderEffect","_self$","createComponent","Show","_el$","_el$2","insert","effect","readShallow","CAPTION","className","_p$","t","setAttribute","_el$3","_el$4","ref","box","SIDEWAYS","COLUMNS_TOKEN","style","o","i","n","Portal","css","STACK_BY_CLASS","GENERATED","observer","attributeFilter","ROW_ATTRIBUTES","caption","defs","named","_self$2","_el$5","_self$3","_el$6","_v$","_$p","_self$4","_el$7","_el$8","For","_el$9","_el$10","_el$12","_el$13","_el$14","_el$15","_el$16","drawnIndex","memo","_el$11","NEW_ROW","WINDOW_FROM","count","where","_self$5","_el$17","_el$18","SPACER","e","setStyleProperty","isReady","isWindowed","remeasure","beforeNextPaint","drawn","top","bottom","WINDOW_EXTRA","size","from","afterSolidUpdate","optOut","_self$6","_el$19","spread","sort","\"class\"","_el$20","headers","isSortable","focusable","isInRowsMode","clientSort","event","detail","columnIndex","isCursor","cursor","rowIndex","isEditing","_self$7","_el$21","_el$22","_el$24","_el$25","TICK","_el$23","DELETE_ROW","CURSOR","focus","field","editing","_self$8","_el$26","_el$27","addEvent","_el$28","EDITOR","_self$9","_el$29","setProperty","isMod","move","MOVES","take","last","typed","originalEvent","wrap","lastRow","lastColumn","resizes","UITable","low","high","delegateEvents","cellVocabulary","_tmpl$","_hostLayout_dec","_ariaColumnSpan_dec","_ariaRole_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_UICell","PartContext","TABLE","HEADER","rules","align","vertical","VERTICAL","UICell"],"sources":["../src/components/ui-table/UITable.en.ts","../src/components/ui-table/TableClassMirror.ts","../src/components/ui-table/TableRows.ts","../src/components/ui-table/TableSort.ts","../src/components/ui-table/TableEditing.ts","../src/components/ui-table/TableGrammar.ts","../src/components/ui-table/UITable.css?inline","../src/components/ui-table/UITable.tsx","../src/components/ui-table/UICell.en.ts","../src/components/ui-table/UICell.tsx","../src/components/ui-table/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-table>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), events, slots, parts and texts.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar, and are MIRRORED onto the slotted\n * `<table>` (see `UITable`): `<ui-table size=\"small\" celled appearance=\"very-basic\" stuck=\"head first\">` =>\n * `ui small celled very basic head stuck first stuck table`.\n * - Row / cell classes (`positive`, `red marked`, `collapsing`, `four wide` ...) are the author's,\n * on native `tr` / `td` / `th`: no attribute here.\n * - Or ROWS AND CELLS as tags, with no native table: `<ui-row>` and `<ui-cell>` (epic `ui-gaps` P7, for drawings,\n * which hold no native HTML). The table then owns them (`ownsParts`), and the same class words style them.\n * - NOTE: `columns` is Fomantic's (and `<ui-grid>`'s) equal-width COUNT (`four column`);\n * the data-mode column list is `column-defs` (`columnDefs`), so the two never collide.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `tableVocabulary`\n * The names of `<ui-table>`, a native `<table>` (slotted, or rendered from `rows`) in Fomantic's table look,\n * or its own `<ui-row>`s and `<ui-cell>`s.\n ****************/\nexport const tableVocabulary = {\n tag: \"ui-table\",\n icon: \"table\",\n topics: [\"tables\", \"data display\", \"basic\", \"collections\"],\n aka: [\"data table\", \"data grid\", \"grid\", \"spreadsheet\"],\n skeleton: \"long line, 4 line paragraph\",\n noun: \"table\",\n description: \"A table displays a collection of data grouped into rows.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Text size, `mini` ... `massive`; `medium` is the default.\"\n },\n {\n name: \"color\",\n group: \"appearance\",\n kind: \"color\",\n description: \"Coloured top edge; with `inverted`, a coloured fill.\"\n },\n { name: \"celled\", group: \"layout\", kind: \"keyOnly\", description: \"Borders between cells.\" },\n { name: \"collapsing\", group: \"layout\", kind: \"keyOnly\", description: \"As narrow as its content (`width: auto`).\" },\n {\n name: \"definition\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"First column is a definition column; blank corner.\"\n },\n {\n name: \"fixed\",\n group: \"layout\",\n kind: \"keyOnly\",\n description: \"`table-layout: fixed`; overflowing cell text is cut with `…`.\"\n },\n { name: \"inverted\", group: \"appearance\", kind: \"keyOnly\", description: \"For dark backgrounds: the dark scheme.\" },\n {\n name: \"resizable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description: \"With `scrolling`: people can drag the height.\"\n },\n { name: \"selectable\", group: \"behaviour\", kind: \"keyOnly\", description: \"Body rows highlight on hover.\" },\n {\n name: \"editable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description:\n \"Data mode: people edit the cells like a spreadsheet. A cell cursor (arrows, Tab, Enter, Home / End), \" +\n \"typing or F2 opens the cell's editor (by its column's `type`), Escape puts it back; the last, empty row \" +\n \"adds one; Delete clears a cell, ⌘ / Ctrl + Delete removes its row; a pasted block of cells (from Excel or \" +\n \"Sheets) fills from the cursor. Each change is sent as `ui-editing` first: square cells on a hairline grid \" +\n \"while it's on, in every theme.\"\n },\n {\n name: \"single-line\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"No wrapping: every cell's text stays on one line (`single line`).\"\n },\n {\n name: \"sortable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description:\n \"Header cells sort the table: click / Enter / Space dispatches `ui-sorting`; the sorted one gets \" +\n '`aria-sort`. Opt a header out with `data-sortable=\"false\"` (or Fomantic\\'s `class=\"disabled\"`).'\n },\n {\n name: \"appearance\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [\"basic\", \"very-basic\", \"striped\", \"structured\"],\n classes: { \"very-basic\": \"very basic\" },\n replaces: [\n { from: \"basic\", value: \"basic\", values: { very: \"very-basic\" } },\n { from: \"striped\", value: \"striped\" },\n { from: \"structured\", value: \"structured\" }\n ],\n description:\n \"The look, several words at once: `basic` (no header fill), `very-basic` (no outer border or edge \" +\n \"padding either), `striped` (every other body row tinted), `structured` (collapsed borders, for \" +\n '`rowspan` / `colspan` headers). Old names: `basic` (`basic=\"very\"`), `striped`, `structured`.'\n },\n {\n name: \"unstackable\",\n group: \"layout\",\n kind: \"keyOnly\",\n description:\n \"Never stacks rows into blocks, even on a viewport below 768px: \" +\n \"wider than its box, it scrolls sideways in it instead.\"\n },\n {\n name: \"padding\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"xs\", \"compact\", \"md\", \"lg\"],\n classes: { xs: \"very compact\", md: \"padded\", lg: \"very padded\" },\n replaces: [\n { from: \"compact\", value: \"compact\", values: { very: \"xs\" } },\n { from: \"padded\", value: \"md\", values: { very: \"lg\" } }\n ],\n description:\n \"Cell padding: `xs` and `compact` less, `md` and `lg` more. \" +\n 'Old names: `compact` (`compact=\"very\"` is `xs`), `padded` (`padded=\"very\"` is `lg`).'\n },\n {\n name: \"attach\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"both\", \"top\", \"bottom\"],\n classes: { both: \"attached\", top: \"top attached\", bottom: \"bottom attached\" },\n replaces: [{ from: \"attached\", value: \"both\" }],\n description:\n \"Joins a segment or another table: `both` (in the middle), `top` or `bottom`. Old name: `attached`.\"\n },\n {\n name: \"stackable\",\n group: \"layout\",\n kind: \"keyOrValueAndKey\",\n values: [\"tablet\"],\n description:\n \"Rows become blocks on a viewport below 768px (the default, `stackable`); \" +\n '`stackable=\"tablet\"` also below 992px. `stack-by=\"container\"` follows the table\\'s OWN width instead.'\n },\n {\n name: \"stack-by\",\n group: \"layout\",\n kind: \"enum\",\n values: [\"viewport\", \"container\", \"none\"],\n description:\n \"What `stackable` measures: the `viewport` (Fomantic's way, the default), the table's own width \" +\n \"(`container`: a table in a narrow column of a wide screen), or nothing (`none`: it never stacks, \" +\n \"as `unstackable`, and scrolls sideways when too wide). \" +\n \"Also a token for a whole region or page: `--ui-table-stack-by: container` \" +\n \"(or `none`); the attribute wins. Neither: the page-wide `--ui-stack-with` \" +\n \"(`<ui-root stack-with>`; `page` ~== `viewport`).\"\n },\n {\n name: \"scrolling\",\n group: \"layout\",\n kind: \"keyOrValueAndKey\",\n values: [\"short\", \"very short\", \"long\", \"very long\"],\n description:\n \"Caps the height and scrolls, head and foot stuck; `short` / `very short` / `long` / `very long` \" +\n \"change the cap. The scroller becomes a focusable, named region.\"\n },\n {\n name: \"overflowing\",\n group: \"appearance\",\n kind: \"keyOrValueAndKey\",\n values: [\"short\", \"very short\", \"long\", \"very long\"],\n description: \"Like `scrolling`, both ways, with nothing stuck; same height steps.\"\n },\n {\n name: \"stuck\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [\"head\", \"foot\", \"first\", \"last\"],\n description:\n 'Sticky parts: `stuck=\"head\"` (the `thead`), `foot`, `first` / `last` column; several at once, ' +\n 'e.g. `stuck=\"head first\"`.'\n },\n {\n name: \"columns\",\n group: \"layout\",\n kind: \"width\",\n values: \"widths\",\n widthClass: \"column\",\n description: \"Equal-width column count, `1` ... `16` (or `1/4`, `25%`): `four column`.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"textAlign\",\n replaces: [\"text-align\"],\n description: \"Text alignment of every cell. Old name: `text-align`.\"\n },\n {\n name: \"vertical-align\",\n group: \"layout\",\n kind: \"verticalAlign\",\n description: \"Vertical alignment of every cell.\"\n },\n {\n name: \"sort-column\",\n group: \"behaviour\",\n kind: \"number\",\n description:\n \"Index of the sorted column (0-based, counting `colspan`s); set by people's clicks unless the app \" +\n \"controls it.\"\n },\n {\n name: \"sort-direction\",\n group: \"behaviour\",\n kind: \"enum\",\n values: [\"ascending\", \"descending\"],\n description: \"Direction of `sort-column`; a newly sorted column starts `ascending`.\"\n },\n {\n name: \"client-sort\",\n group: \"advanced\",\n kind: \"boolean\",\n description:\n \"Slotted tables: reorder the `tbody` rows by the sorted column's cell text on `ui-sorting` (numeric-aware). \" +\n \"Off, the app sorts its own rows.\"\n },\n {\n name: \"column-defs\",\n group: \"content\",\n kind: \"json\",\n reflect: false,\n description:\n \"Data mode: `TableColumn[]` (`key`, `header`, `textAlign`, `sortable`, `width`; for `editable`, `type`, \" +\n \"`choices`, `readOnly`); default the first row's keys (its `toJSON()`'s, for a row that has one).\"\n },\n {\n name: \"caption\",\n group: \"content\",\n kind: \"string\",\n description:\n \"The table's title, drawn above it and naming it for screen readers. The `caption` slot is its rich \" +\n \"version; a native table's own `<caption>` wins.\"\n },\n {\n name: \"rows\",\n group: \"content\",\n kind: \"json\",\n reflect: false,\n description:\n \"Data mode: `Record<string, unknown>[]`, or any list of them (an iterable); with no slotted `<table>`, \" +\n \"the element renders one (text only) into its light DOM.\"\n }\n ],\n events: [\n {\n name: \"ui-editing\",\n detail: \"TableEditDetail\",\n cancelable: true,\n description:\n \"`editable`: cells were changed, a row added or removed, as `{ edits, originalEvent }` (`TableEdit[]`, \" +\n \"one keystroke, paste or click together). Not cancelled, the table shows them in new `rows` of its own; \" +\n \"`preventDefault()` when the page writes them itself (a Spell program's things), and hands the table its rows.\"\n },\n {\n name: \"ui-sorting\",\n detail: '{ column: number, key?: string, direction: \"ascending\" | \"descending\", originalEvent?: Event }',\n cancelable: true,\n description:\n \"A header was activated; `preventDefault()` keeps the current sort (and skips data / `client-sort` \" +\n \"reordering).\"\n }\n ],\n slots: [\n { name: \"\", description: \"One native `<table>`, or `<ui-row>`s of `<ui-cell>`s.\" },\n { name: \"caption\", description: \"The rich version of `caption`: links, emphasis, an icon.\" }\n ],\n parts: [\n {\n name: \"caption\",\n description: \"The caption above the table (`caption`).\"\n },\n {\n name: \"scroller\",\n description:\n \"Box around the slotted table; scrolls (a focusable, named region) with `scrolling` / `overflowing`, \" +\n \"and sideways, its height uncapped, while a table that doesn't stack is wider than it.\"\n }\n ],\n states: [\n {\n name: \"rows\",\n description: \"Set while it holds `<ui-row>`s rather than a native table: a CSS grid, its rows subgrids.\"\n },\n {\n name: \"captioned\",\n description: \"Set while it draws its own caption (`caption`, or the `caption` slot).\"\n },\n {\n name: \"attached\",\n description: \"Set while `attach` is set (any edge): the host drops the outer margin it carries.\"\n },\n { name: \"attached-top\", description: \"Set while `attach` is `top`: the host keeps only its top margin.\" },\n {\n name: \"attached-bottom\",\n description: \"Set while `attach` is `bottom`: the host keeps only its bottom margin.\"\n }\n ],\n texts: [\n { key: \"delete-row\", text: \"Delete row\", description: \"`editable`: the button at a row's end that removes it.\" },\n {\n key: \"new-row\",\n text: \"New row: type to add one\",\n description: \"`editable`: the empty last row's name, read out as the cursor reaches it.\"\n },\n {\n key: \"label\",\n text: \"Table\",\n description: \"Name of the scrolling region when the host has no `aria-label` and the table no `<caption>`.\"\n }\n ],\n ownsParts: [\"row\", \"cell\"]\n} as const satisfies E.ComponentVocabulary\n","import { UIT } from \"spell/ui/core\"\n\n/****************\n * ### `TableClassMirror`\n * Writes an element's Fomantic class string (`ui celled striped table`) onto a LIGHT-DOM `<table>`\n * (or, for a table of `<ui-row>`s, onto the `<ui-table>` itself),\n * so `UITable.css`'s class-grammar rules style it.\n * - Owns only its words: the author's other classes stay, in their order.\n * The element's phrase follows them as one run in grammar order,\n * since phrase selectors (`[class*=\"very basic\"]`) need the words adjacent.\n * - Words the table ALREADY has when first mirrored, and the element emits, count as the element's:\n * an SSR table carries the element's own words (`class=\"ui celled table\"`), which must go when `celled` does.\n * - Re-applies through a `MutationObserver` on the table's `class`, when a framework rewrites `className`.\n * - Plain DOM, no Solid.\n * - NOTE: letting go of a table (`detach()`) leaves its classes:\n * it's usually gone from the `<ui-table>` by then, and an app may have moved it on purpose.\n ****************/\nexport class TableClassMirror {\n /** Table mirrored onto, if any. */\n private table: Element | undefined\n\n /** Class string to mirror. */\n private classes = \"\"\n\n /** Words on `table` that are the element's, not the author's. */\n private owned = new Set<string>()\n\n /** Watches `table`'s `class`. */\n private observer: MutationObserver | undefined\n\n /**\n * Mirror `classes` onto `table`, switching tables when it changed; `undefined` lets go.\n * - SIDE EFFECT: writes `table`'s `class` attribute (only when the text changes).\n */\n apply(table: Element | undefined, classes: string) {\n this.classes = classes\n if (table !== this.table) {\n this.detach()\n this.table = table\n if (!table) return\n const current = new Set(TableClassMirror.words(table.getAttribute(\"class\")))\n this.owned = new Set(TableClassMirror.words(classes).filter((word) => current.has(word)))\n // oxlint-disable-next-line spell-ui/no-mutation-observer -- a helper class, watching ANOTHER element (the table)\n this.observer = new MutationObserver(() => this.write())\n this.observer.observe(table, { attributeFilter: [\"class\"] })\n }\n this.write()\n }\n\n /** Stop mirroring; the table keeps its classes. */\n detach() {\n this.observer?.disconnect()\n this.observer = undefined\n this.table = undefined\n this.owned = new Set()\n }\n\n /** Recompute the table's class text: author words, then the element's phrase. */\n private write() {\n const table = this.table\n if (!table) return\n const text = table.getAttribute(\"class\") ?? \"\"\n const author = TableClassMirror.words(text).filter((word) => !this.owned.has(word))\n const ours = TableClassMirror.words(this.classes)\n const mine = new Set(ours)\n const kept = author.filter((word) => !mine.has(word))\n this.owned = new Set(ours.filter((word) => !author.includes(word)))\n // NEVER dedupe `ours`: a phrase may repeat a word (`head stuck first stuck`, `center aligned top aligned`)\n const next = [...kept, ...ours].join(\" \")\n if (next !== text) table.setAttribute(\"class\", next)\n }\n\n /**\n * `table`'s class text with `classes` mirrored in once: its author words, then the element's phrase.\n * - For a static server render (`UITable.decorateStatic()`): no observer, nothing owned yet;\n * the same text a first `apply()` writes.\n * - `text` is `getAttribute()`'s: `null` when absent (a platform boundary).\n * - Static: one call, nothing to mirror into later.\n */\n static mirrored(text: string | null, classes: string): string {\n const ours = TableClassMirror.words(classes)\n const mine = new Set(ours)\n return [...TableClassMirror.words(text).filter((word) => !mine.has(word)), ...ours].join(\" \")\n }\n\n /** Class words of `text`, in order. Static: pure, for `mirrored()` too. */\n private static words(text: string | null): string[] {\n return text ? text.split(UIT.WHITESPACE).filter(Boolean) : []\n }\n}\n","import { E, UI } from \"spell/ui/core\"\n\n/****************\n * ### `TableRows`\n * How a table made of `<ui-row>`s and `<ui-cell>`s is read (epic `ui-gaps` P7): its shape for `TableSort`'s walk\n * (`TableShape`: the class itself is it), and the rows-mode grid's own questions (its rows, its column count).\n * - Plain DOM, no state.\n * - Rows are the table's own children; cells, each row's.\n * Tags by their CANONICAL name (`UI.vocabulary.canonicalTagFor()`), so a translated page's `<es-fila>` counts.\n * - A row is a header row with `header`, a footer row with `footer`; every other row is the body.\n * - Every cell of a header row is a header; columns count `span`s, as a native table's count `colspan`s;\n * cells never span rows.\n * - STATIC and instance-free on purpose: it holds no state, as `TableSort` doesn't.\n ****************/\nexport class TableRows {\n /** The rows of `table`, a `<ui-table>` DOM element, in order. */\n static rows(table: Element): Element[] {\n return [...table.children].filter((child) => TableRows.is(child, ROW))\n }\n\n /** The cells of `row`, in order. */\n static cells(row: Element): Element[] {\n return [...row.children].filter((child) => TableRows.is(child, CELL))\n }\n\n /** Is `row` a header row? */\n static isHeaderRow(row: Element): boolean {\n return TableRows.isOn(row, HEADER)\n }\n\n /** Is `row` a footer row? */\n static isFooterRow(row: Element): boolean {\n return TableRows.isOn(row, FOOTER)\n }\n\n /** Columns `cell` covers: its `span`, a whole number, at least 1. */\n static span(cell: Element): number {\n return TableRows.spanOf(TableRows.value(cell, SPAN))\n }\n\n /** Columns of `table`: the widest row's spans added up; at least 1. */\n static columnCount(table: Element): number {\n let widest = 1\n for (const row of TableRows.rows(table)) {\n const width = TableRows.cells(row).reduce((sum, cell) => sum + TableRows.span(cell), 0)\n widest = Math.max(widest, width)\n }\n return widest\n }\n\n ////////////////\n // ## Its shape, for `TableSort`\n ////////////////\n\n /** The header rows of `table`, top first. */\n static headerRows(table: Element): Element[] {\n return TableRows.rows(table).filter((row) => TableRows.isHeaderRow(row))\n }\n\n /** The body rows, one group: every row but the header and footer rows. */\n static bodies(table: Element): Element[][] {\n return [TableRows.rows(table).filter((row) => !TableRows.isHeaderRow(row) && !TableRows.isFooterRow(row))]\n }\n\n /** Every cell of a header row is a header. */\n static isHeader(_cell: Element): boolean {\n return true\n }\n\n /** Put the body rows back, sorted: before the first footer row, header rows staying first. */\n static place(table: Element, sorted: Element[]) {\n const footer = TableRows.rows(table).find((row) => TableRows.isFooterRow(row))\n for (const row of sorted) table.insertBefore(row, footer ?? null)\n }\n\n /**\n * A span from what a `span` or `colspan` attribute says (`\"2\"`, `2`): a whole number, at least 1.\n * - Static: a native table's `colspan` (`TableSort`) and `<ui-cell>`'s own read through it too.\n */\n static spanOf(value: unknown): number {\n const span = Math.floor(Number(value))\n return Number.isFinite(span) && span > 1 ? span : 1\n }\n\n ////////////////\n // ## Reading the elements\n ////////////////\n\n /**\n * Is `element` the canonical `tag` (or its translation on this page)?\n * - Before the runtime loads, the canonical tag only: the translations are its.\n */\n private static is(element: Element, tag: string): boolean {\n const name = element.localName\n if (name === tag) return true\n return \"vocabulary\" in UI && UI.vocabulary.canonicalTagFor(name) === tag\n }\n\n /**\n * A row's or cell's attribute value, by its canonical name; before its family loads, the attribute's text.\n * - NEVER throws: a pending element has no definition yet (`valueNamed()` throws then).\n */\n private static value(element: Element, name: string): unknown {\n try {\n const value = (element as Element & { valueNamed?: (name: string) => unknown }).valueNamed?.(name)\n if (value !== undefined) return value\n } catch {\n // pending: its text, below\n }\n return element.getAttribute(name) ?? undefined\n }\n\n /** Is boolean attribute `name` of `element` on: its value, or its text before the element upgrades (`\"\"`, `\"true\"`)? */\n private static isOn(element: Element, name: string): boolean {\n const value = TableRows.value(element, name)\n return E.Converters.boolean(typeof value === \"boolean\" || typeof value === \"string\" ? value : undefined, name)\n }\n}\n\n/** The row tag. */\nconst ROW = \"ui-row\"\n\n/** The cell tag. */\nconst CELL = \"ui-cell\"\n\n/** A row's `header`. */\nconst HEADER = \"header\"\n\n/** A row's `footer`. */\nconst FOOTER = \"footer\"\n\n/** A cell's `span`. */\nconst SPAN = \"span\"\n","import { UIT } from \"spell/ui/core\"\nimport { TableRows } from \"./TableRows\"\n\n/****************\n * ### `TableSort`\n * A table's columns, and sorting its rows, as static helpers: which header a click hit, its column,\n * the header over a column, and reordering the body rows by cell text (`client-sort`). Plain DOM, no state.\n * - ONE walk for every kind of table, handed how to read it, its SHAPE (`TableShape`: its rows, a row's cells,\n * a cell's span; `TableSort.shapeOf()` picks):\n * - a native `<table>` (`NATIVE`), through its elements and attributes,\n * so a static server render's tables (linkedom, with no table API) read the same\n * - a `<ui-table>` of `<ui-row>`s and `<ui-cell>`s (`TableRows`)\n * - Columns count spans: `<th colspan=\"2\">` covers columns 0 and 1, the next header is column 2.\n * NOTE: `rowspan`s from rows above are not counted (a structured table's lower header row numbers its own\n * cells), and a spanning cell in the body answers for its FIRST column.\n * - Comparison: `Intl.Collator(undefined, { numeric: true })` -- `item 9` before `item 10`, locale-aware,\n * stable (`Array.prototype.sort`).\n * - STATIC and instance-free on purpose: it holds no state, and the element and its static render share it.\n ****************/\nexport class TableSort {\n /** How `table` is read: a native `<table>`'s shape, else a rows-mode `<ui-table>`'s (`TableRows`). */\n static shapeOf(table: Element): TableShape {\n return table.localName === NATIVE_TABLE ? NATIVE : TableRows\n }\n\n /**\n * The header cell of `table` that `target` is in, or `undefined`.\n * - Only `table`'s own header rows: a table nested in a cell doesn't count.\n */\n static header(table: Element, target: EventTarget | null): Element | undefined {\n const shape = TableSort.shapeOf(table)\n const rows = shape.headerRows(table)\n for (let element = target instanceof Element ? target : null; element && element !== table;) {\n // a table nested inside: its cells are its own\n if (element.localName === table.localName) return undefined\n const row = element.parentElement\n if (row && rows.includes(row) && shape.cells(row).includes(element)) {\n return shape.isHeader(element) ? element : undefined\n }\n element = row\n }\n return undefined\n }\n\n /** Every header cell of `table`'s header rows, row by row. */\n static headers(table: Element): Element[] {\n const shape = TableSort.shapeOf(table)\n return shape.headerRows(table).flatMap((row) => shape.cells(row).filter((cell) => shape.isHeader(cell)))\n }\n\n /** Can `header` (a native one, or a `<ui-cell>`) sort? Not with `data-sortable=\"false\"` or Fomantic's `class=\"disabled\"`. */\n static isSortable(header: Element): boolean {\n return (\n header.getAttribute(UIT.TABLE_SORT_OPT_OUT.attribute) !== UIT.TABLE_SORT_OPT_OUT.value &&\n !header.classList.contains(UIT.DISABLED)\n )\n }\n\n /** Column index of `cell`, a cell of `table`, in its row: the spans before it added up. */\n static column(table: Element, cell: Element): number {\n const shape = TableSort.shapeOf(table)\n let column = 0\n for (const before of cell.parentElement ? shape.cells(cell.parentElement) : []) {\n if (before === cell) break\n column += shape.span(before)\n }\n return column\n }\n\n /** The header for `column`: the lowest header row's header cell covering it (the most specific), if any. */\n static headerAt(table: Element, column: number): Element | undefined {\n const shape = TableSort.shapeOf(table)\n for (const row of shape.headerRows(table).reverse()) {\n const cell = TableSort.cellAt(table, row, column)\n if (cell && shape.isHeader(cell)) return cell\n }\n return undefined\n }\n\n /** `row`'s cell covering `column`, if any; `row` is one of `table`'s. */\n static cellAt(table: Element, row: Element, column: number): Element | undefined {\n const shape = TableSort.shapeOf(table)\n let start = 0\n for (const cell of shape.cells(row)) {\n const span = shape.span(cell)\n if (column < start + span) return cell\n start += span\n }\n return undefined\n }\n\n /** `header`'s `data-key`, for `ui-sorting`'s detail. */\n static key(header: Element): string | undefined {\n return header.getAttribute(UIT.TABLE_SORT_KEY) ?? undefined\n }\n\n /**\n * Reorder each group of `table`'s body rows by the text of their cell in `column`.\n * - SIDE EFFECT: moves rows, only when the order changes (so a sorted table sees no mutation);\n * header rows stay first, footer rows last.\n * - Rows without that cell sort last, in their order.\n */\n static sortRows(table: Element, column: number, direction: UIT.TableSortDirection) {\n const shape = TableSort.shapeOf(table)\n const sign = direction === \"descending\" ? -1 : 1\n for (const rows of shape.bodies(table)) {\n const texts = new Map(rows.map((row) => [row, TableSort.cellAt(table, row, column)?.textContent?.trim()]))\n const sorted = [...rows].sort((a, b) => TableSort.compare(texts.get(a), texts.get(b), sign))\n if (sorted.every((row, index) => row === rows[index])) continue\n shape.place(table, sorted)\n }\n }\n\n /**\n * Order of two values under `sign` (`1` ascending, `-1` descending).\n * - `undefined` / `null` / `\"\"` last, whatever the direction; two numbers numerically;\n * else the collator over their text.\n */\n static compare(a: unknown, b: unknown, sign: number): number {\n const missingA = a == null || a === \"\"\n const missingB = b == null || b === \"\"\n if (missingA || missingB) return Number(missingA) - Number(missingB)\n if (typeof a === \"number\" && typeof b === \"number\") return (a - b) * sign\n return COLLATOR.compare(TableSort.text(a), TableSort.text(b)) * sign\n }\n\n /** A value as text: primitives `String()`ed, `null` / `undefined` empty, anything else as JSON. */\n static text(value: unknown): string {\n if (value == null) return \"\"\n if (typeof value === \"object\") return JSON.stringify(value)\n return String(value as string | number | boolean | bigint | symbol)\n }\n}\n\n/**\n * How one kind of table is read: what `TableSort`'s walk needs of it.\n * - `TableSort`'s own for a native `<table>`; `TableRows` for a `<ui-table>` of `<ui-row>`s.\n */\nexport type TableShape = {\n /** the table's header rows, top first */\n headerRows(table: Element): Element[]\n /** the body rows that sort together, each group in order: a native table's per `<tbody>`, a rows-mode table's one */\n bodies(table: Element): Element[][]\n /** a row's cells, in order */\n cells(row: Element): Element[]\n /** the columns a cell covers: at least 1 */\n span(cell: Element): number\n /** is `cell`, a cell of a header row, a header: a native `<th>`; any cell of a rows-mode header row */\n isHeader(cell: Element): boolean\n /** put a group's rows back, sorted (`sorted` holds every row of one group) */\n place(table: Element, sorted: Element[]): void\n}\n\n/** A native table's tag. */\nconst NATIVE_TABLE = \"table\"\n\n/**\n * A native `<table>`, read through its elements and attributes: linkedom has no table API (`tHead`, `rows`, `cells`,\n * `colSpan`), and the browser's agrees with them.\n */\nconst NATIVE: TableShape = {\n headerRows: (table) => [...table.querySelectorAll(\":scope > thead > tr\")],\n bodies: (table) =>\n [...table.querySelectorAll(\":scope > tbody\")].map((body) => [...body.querySelectorAll(\":scope > tr\")]),\n cells: (row) => [...row.children].filter((cell) => cell.localName === \"td\" || cell.localName === \"th\"),\n span: (cell) => TableRows.spanOf(cell.getAttribute(\"colspan\")),\n isHeader: (cell) => cell.localName === \"th\",\n place: (_table, sorted) => sorted[0]?.parentElement?.append(...sorted)\n}\n\n/** Numeric-aware collator for cell text and data values: one per page. */\nconst COLLATOR = new Intl.Collator(undefined, { numeric: true })\n","import { E, UIT } from \"spell/ui/core\"\nimport { TableSort } from \"./TableSort\"\n\n/****************\n * ### `TableEditing`\n * What `<ui-table editable>` reads and writes, as static helpers: a column's kind of value,\n * what a cell shows and its editor holds, a typed value read back, and a pasted block of cells as edits.\n * - Plain data, no DOM and no Solid: so each rule is tested on its own (`TableEditing.test.ts`).\n * - STATIC and instance-free on purpose, as `TableSort` is.\n ****************/\nexport class TableEditing {\n /**\n * The data-mode columns of `rows` with no `columnDefs`: the first row's keys.\n * - A row that isn't a plain object (a program's thing) names them by its `toJSON()`, without its `$` keys:\n * its own fields, never what its class keeps on the side; each headed by its words (`filmTitle` => `film title`).\n * - An `id` column is read only: it says which thing a row is.\n */\n static columnsOf(rows: readonly UIT.TableRow[]): UIT.TableColumn[] {\n const first = rows[0]\n if (!first) return []\n const plain = Object.getPrototypeOf(first) === Object.prototype || Object.getPrototypeOf(first) === null\n const shape =\n !plain && typeof (first as { toJSON?: unknown }).toJSON === \"function\"\n ? ((first as { toJSON(): unknown }).toJSON() as Record<string, unknown>)\n : first\n const keys = (shape && typeof shape === \"object\" ? Object.keys(shape) : []).filter((key) => !key.startsWith(\"$\"))\n return keys.map((key) => ({\n key,\n ...(!plain && { header: E.kebabCase(key).replaceAll(\"-\", \" \") }),\n ...(key === ID && { readOnly: true })\n }))\n }\n\n /**\n * The kind of value `column` holds: its `type`, else what its rows' first value is.\n * - a number `number`, `true` / `false` `yes-no`, a `Date` `date`; `choices` make it a `choice`; else `text`\n */\n static typeOf(column: UIT.TableColumn, rows: readonly UIT.TableRow[]): UIT.TableCellType {\n if (column.type) return column.type\n if (column.choices?.length) return \"choice\"\n const value = rows.map((row) => row[column.key]).find((one) => one !== undefined && one !== null && one !== \"\")\n if (typeof value === \"number\") return \"number\"\n if (typeof value === \"boolean\") return \"yes-no\"\n if (value instanceof Date) return \"date\"\n return \"text\"\n }\n\n /** What a cell of `column` shows for `value`: a choice's words, a date's day, else its text. */\n static textFor(column: UIT.TableColumn, type: UIT.TableCellType, value: unknown): string {\n if (type === \"yes-no\") return \"\"\n const choice = TableEditing.choiceFor(column, value)\n if (choice) return choice.text ?? TableSort.text(choice.value)\n if (type === \"date\" && value instanceof Date) return TableEditing.dayOf(value)\n return TableSort.text(value)\n }\n\n /**\n * What a cell's editor starts with for `value`: its text; a date as `2026-11-07`;\n * a choice or link as its place in `choices` (`\"2\"`), or `\"\"` for none.\n */\n static draftFor(column: UIT.TableColumn, type: UIT.TableCellType, value: unknown): string {\n if (type === \"choice\" || type === \"link\") {\n const index = (column.choices ?? []).findIndex((choice) => choice.value === value)\n return index < 0 ? \"\" : String(index)\n }\n if (type === \"date\") return value instanceof Date ? TableEditing.dayOf(value) : TableSort.text(value)\n return TableSort.text(value)\n }\n\n /**\n * The value `draft`, an editor's text, stands for in `column`.\n * - `number`: a number; blank, or not one, is `undefined`\n * - `date`: a `Date` when the cell held one (`was`), else the day as text\n * - `choice` / `link`: the choice at that place in `choices`, by its text too (a pasted word)\n * - `yes-no`: `true` for `true`, `yes`, `x`, `1`, `✓`\n * - `text`: the text\n */\n static valueFrom(column: UIT.TableColumn, type: UIT.TableCellType, draft: string, was?: unknown): unknown {\n const text = draft.trim()\n switch (type) {\n case \"number\": {\n if (!text) return undefined\n const number = Number(text.replaceAll(\",\", \"\"))\n return Number.isFinite(number) ? number : undefined\n }\n case \"date\":\n if (!text) return undefined\n return was instanceof Date ? new Date(`${text}T00:00`) : text\n case \"yes-no\":\n return YES.test(text)\n case \"choice\":\n case \"link\": {\n const choices = column.choices ?? []\n const byPlace = /^\\d+$/.test(text) ? choices[Number(text)] : undefined\n const byWords = choices.find((choice) => (choice.text ?? TableSort.text(choice.value)) === text)\n return (byPlace ?? byWords)?.value\n }\n default:\n return draft\n }\n }\n\n /** Is `a` the same value as `b`, as a cell shows it? Dates by their time. */\n static isSame(a: unknown, b: unknown): boolean {\n if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime()\n return a === b || ((a === undefined || a === null || a === \"\") && (b === undefined || b === null || b === \"\"))\n }\n\n /**\n * A pasted block's cells: rows by line, cells by tab, as Excel and Google Sheets copy them.\n * - A last empty line (what a copy ends with) is dropped; `\\r\\n` reads as `\\n`.\n */\n static cellsOf(text: string): string[][] {\n const lines = text.replaceAll(\"\\r\\n\", \"\\n\").split(\"\\n\")\n if (lines.length > 1 && lines.at(-1) === \"\") lines.pop()\n return lines.map((line) => line.split(\"\\t\"))\n }\n\n /**\n * `cells`, pasted at row `row` and column `column` of `rows` (as shown) and `columns`: the edits it makes.\n * - Over a row: a `set` for each cell that changes; a read-only column is passed over.\n * - Past the last row: an `add` for each line, with what it fills.\n * - Cells past the last column are dropped.\n */\n static pasteEdits({ rows, columns, types, row, column, cells }: PasteAt): UIT.TableEdit[] {\n const edits: UIT.TableEdit[] = []\n cells.forEach((line, lineIndex) => {\n const target = rows[row + lineIndex]\n const values: UIT.TableRow = {}\n line.forEach((draft, cellIndex) => {\n const at = column + cellIndex\n const col = columns[at]\n if (!col || col.readOnly) return\n const was = target?.[col.key]\n const value = TableEditing.valueFrom(col, types[at] ?? \"text\", draft, was)\n if (!target) values[col.key] = value\n else if (!TableEditing.isSame(value, was)) edits.push({ kind: \"set\", row: target, key: col.key, value, was })\n })\n if (!target && Object.keys(values).length) edits.push({ kind: \"add\", values })\n })\n return edits\n }\n\n /**\n * `rows` with `edits` done to them, as new objects: what a table with no page writing its things shows.\n * - The rows it hasn't changed stay the same objects; never changes one in place.\n */\n static applied(rows: readonly UIT.TableRow[], edits: readonly UIT.TableEdit[]): UIT.TableRow[] {\n // a row changed twice is found by its newest object\n const newest = new Map<UIT.TableRow, UIT.TableRow>()\n let next = [...rows]\n for (const edit of edits) {\n if (edit.kind === \"add\") {\n next.push({ ...edit.values })\n continue\n }\n const current = newest.get(edit.row) ?? edit.row\n if (edit.kind === \"remove\") {\n next = next.filter((row) => row !== current)\n continue\n }\n const changed = { ...current, [edit.key]: edit.value }\n newest.set(edit.row, changed)\n next = next.map((row) => (row === current ? changed : row))\n }\n return next\n }\n\n /** The choice of `column` holding `value`, if it has choices. */\n private static choiceFor(column: UIT.TableColumn, value: unknown): UIT.TableChoice | undefined {\n return column.choices?.find((choice) => choice.value === value)\n }\n\n /** `date`'s day, as a date field writes it: `2026-11-07`, in local time. */\n private static dayOf(date: Date): string {\n const pad = (number: number) => String(number).padStart(2, \"0\")\n return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`\n }\n}\n\n/** What `pasteEdits()` is handed. */\ntype PasteAt = {\n /** the rows, in the order shown */\n rows: readonly UIT.TableRow[]\n /** the columns */\n columns: readonly UIT.TableColumn[]\n /** each column's kind of value */\n types: readonly UIT.TableCellType[]\n /** the cursor's row */\n row: number\n /** the cursor's column */\n column: number\n /** the pasted cells, by line */\n cells: readonly (readonly string[])[]\n}\n\n/** The column that says which thing a row is: never edited. */\nconst ID = \"id\"\n\n/** Pasted or typed text that means yes in a `yes-no` column. */\nconst YES = /^(?:true|yes|y|x|1|✓|✔)$/i\n","import { E, type UIT } from \"spell/ui/core\"\nimport { tableVocabulary } from \"./UITable.en\"\n\n/****************\n * ### `TableGrammar`\n * Class strings a table needs besides its own root's: the shadow `.scroller`'s, and a data-mode cell's.\n * - Scroller: `ClassBuilder` over the table vocabulary's scroller-shaped attributes\n * (`resizable`, `attach`, `scrolling`, `overflowing`) with the noun `scroller` and no `ui`,\n * e.g. `resizable top attached short scrolling scroller`.\n * Same grammar as the table, so `UITable.css` keys the scroller on the same phrases (`[class*=\"very short\"]`).\n * - Cell: a `TableColumn`'s `textAlign` / `width` as Fomantic's cell classes (`right aligned four wide`).\n * - Plain functions of their input, no DOM.\n * - STATIC and instance-free on purpose: nothing to hold but the one cached builder.\n ****************/\nexport class TableGrammar {\n /** Scroller class string from `value(name)`, the converted value of each of `SCROLLER_ATTRIBUTES`. */\n static scroller(value: (name: string) => unknown): string {\n const input: Record<string, unknown> = {}\n for (const name of SCROLLER_ATTRIBUTES) input[name] = value(name)\n return TableGrammar.builder.build(input)\n }\n\n /** Does the scroller scroll: `scrolling` / `overflowing`, in any height? */\n static scrolls(value: (name: string) => unknown): boolean {\n return !!value(SCROLLING) || !!value(OVERFLOWING)\n }\n\n /**\n * Fomantic cell classes for a data-mode `column`, e.g. `right aligned four wide`; `\"\"` for none.\n * - An unusable width is dropped silently (no class), like `ClassBuilder`'s.\n */\n static cell(column: UIT.TableColumn): string {\n const { grammar } = E.ClassBuilder\n const words: string[] = []\n if (column.textAlign) words.push(`${column.textAlign} ${grammar.aligned}`)\n // `!= null`: `columnDefs` is JSON, where an unset width may be `null`\n if (column.width != null) {\n const columns = E.ValueSets.columns(String(column.width))\n const word = columns === undefined ? undefined : E.numberToWord(Math.round(columns))\n if (word) words.push(`${word} ${grammar.wide}`)\n }\n return words.join(\" \")\n }\n\n /**\n * Builds scroller classes: the table vocabulary narrowed to `SCROLLER_ATTRIBUTES`, noun `scroller`, no `ui`.\n * - Static: one per page, made on first use.\n */\n @E.lazy private static get builder(): E.ClassBuilder {\n return new E.ClassBuilder({\n ...tableVocabulary,\n noun: SCROLLER_NOUN,\n ui: false,\n attributes: tableVocabulary.attributes.filter(({ name }) => SCROLLER_ATTRIBUTES.includes(name))\n })\n }\n}\n\n/** Scroller attribute that joins it to what's above or below: `both`, `top`, `bottom`. */\nexport const ATTACH = \"attach\"\n\n/** Scroller attribute that caps the height and scrolls, head and foot stuck. */\nconst SCROLLING = \"scrolling\"\n\n/** Scroller attribute that caps the height and scrolls both ways. */\nconst OVERFLOWING = \"overflowing\"\n\n/** Canonical names of the table attributes that shape the scroller, in vocabulary order. */\nconst SCROLLER_ATTRIBUTES: readonly string[] = [\"resizable\", ATTACH, SCROLLING, OVERFLOWING]\n\n/** The scroller's noun: its last class word. */\nconst SCROLLER_NOUN = \"scroller\"\n","/*\n * The style sheet of `<ui-table>`: a port of Fomantic's `table.less` + `table.variables`.\n * - ONE sheet, used twice:\n * - adopted into the element's shadow root as usual; only its `:host` and `.scroller` rules match there\n * - registered as a PAGE sheet (`UI.styles.register(\"table\", css, { page: true })`),\n * where its class-grammar rules style the LIGHT-DOM `<table>`:\n * a slotted table's `td` is out of reach of shadow CSS (`::slotted()` reaches the top level only)\n * - Shadow markup contract: `<div class=\"[resizable] [attached ...] [scrolling ...] [overflowing ...] [sideways]\n * scroller\" part=\"scroller\"><slot></slot></div>`.\n * While scrolling / overflowing, or `sideways` (a table too wide for it, which doesn't stack),\n * the scroller is a focusable, named region (`tabindex=\"0\" role=\"region\" aria-label`).\n * - Light-DOM contract: the element MIRRORS its class string (`ui small celled striped red table`)\n * onto the slotted `<table>`'s `class`, adding and removing only the words it owns (author classes stay).\n * Why:\n * - one mechanical port serves element markup AND static class-grammar markup: examples,\n * and SSR output that writes `class=\"ui celled table\"` itself, which paints styled before any JS\n * - translated attribute names / values, `yes` / `no` booleans and `medium` all resolve through the\n * vocabulary + `ClassBuilder` like every other component; attribute selectors on the DOM element\n * (`ui-table[celled] > table`) can't do that\n * - NOTE: phrase selectors (`[class*=\"very basic\"]`) need the words in grammar order, so the element writes\n * its phrase as one run after the author's own words\n * - Row / cell states and variations are CLASSES on native `tr` / `th` / `td`,\n * exactly Fomantic's (`positive`, `red marked left`, `collapsing`, `four wide`, `single line`, `selectable` ...):\n * no JS.\n * - Base look: `:where(ui-table) > table` gets the same base rules as `.ui.table` (it used to live in `native.css`),\n * so an un-upgraded `<ui-table><table>` is styled as soon as this sheet is on the page.\n * NOTE: canonical tag only; a translated tag's table is bare until its element upgrades.\n * - `--_table-hosted: 1`, set on `:host` and inherited down the flat tree,\n * tells light-DOM rules (through `@container style()`) that a table sits in an element.\n * Cells reset it, so a table nested in a cell answers for itself.\n * It picks between:\n * - stackable: by the viewport (`@media`), as in Fomantic, hosted or static.\n * A hosted table opts in to stacking by the DOM element's width,\n * with `stack-by=\"container\"` or `--ui-table-stack-by: container`;\n * `stack-by=\"none\"` / `--ui-table-stack-by: none` never stacks (a page that wants no stacked table)\n * (`@container`, the DOM element's `container-type: inline-size`, unnamed -- container names are tree-scoped)\n * - scrolling / overflowing: hosted tables scroll in the shadow `.scroller`, the head (and foot) stuck;\n * static tables keep Fomantic's `display: block` `tbody` (scrolling) and `table` (overflowing) scrollers\n * - Colours:\n * - the TABLE's colour is the generic remap (`.ui.red` => `--ui-color`, `colors.css`): a coloured top edge,\n * or a coloured fill when `inverted`\n * - Fomantic's row / cell classes carry no `ui`, which the generic remap needs:\n * this sheet maps each hue and state class to private tokens, and ONE rule set paints them\n * (`--_table-tint`, `-ink`, `-fill`, `-fill-on`, `-mark`).\n * NOTE: a hue added with `ValueSets.add(\"hues\")` needs a line in \"Row and cell colours\"\n * - cells reset the generic colour and size tokens, so a button in a red table's cell isn't red\n * - `inverted` sets `color-scheme: dark` (+ `--ui-inverted: 1`, `--ui-scheme: dark`):\n * surfaces, text and the state tokens re-resolve to their dark branches; only a coloured inverted fill needs rules\n * - Sortable: headers are sorted through `aria-sort` (the element's)\n * or Fomantic's `sorted ascending` / `sorted descending` classes (static markup).\n * - A `<button>` inside a header is reset to look like text.\n * - `th[data-sortable=\"false\"]` and Fomantic's `th.disabled` opt a header out.\n * - Layering: row / cell colours and states, hover, sorting and STACKED layout are in the `states` sublayer.\n * A later layer beats the `.ui.ui.ui.ui` specificity and `!important`s Fomantic needs\n * to override widths, stripes and cell backgrounds.\n * - Public tokens (`--ui-table-*`, the theming surface) are NEVER declared here:\n * the token block reads each through a private alias, and every rule reads the alias:\n * `--_ui-table-radius: var(--ui-table-radius, var(--ui-radius))`.\n * So a value set on `:root`, an ancestor, the DOM element, the table itself or in the app stylesheet\n * reaches the box (`notes/theming.md` \"Component tokens\").\n * The table is light DOM, so page CSS reaches it directly; set a token on the table, `<ui-table>` or any ancestor.\n * - NOTE: left out, on purpose:\n * - `.ui.table.segment` / `.stacked` coupling, and `.ui.attached + .ui.attached.table`\n * (a middle table after another attached block):\n * the neighbour relation isn't visible from a table inside an element\n * - Fomantic's icon-font sort arrows: a masked SVG caret instead; custom scrollbar colours\n * - `-moz-transform` hacks\n */\n\n@layer ui.components.table.types, ui.components.table.content, ui.components.table.variations, ui.components.table.states;\n\n/* Breakpoints (`@custom-media`), inlined at build time. */\n@import \"../../styles/media.css\";\n\n/*******************************\n Table\n*******************************/\n\n@layer ui.components.table.types {\n /* DOM element: a block and the size container `stackable` answers to; the flag that says \"hosted\". */\n :host {\n --_table-hosted: 1;\n /* the table's own token, else the page-wide `stack-with` one (`page` ~== `viewport`), else the viewport */\n --_table-stack-by: var(--ui-table-stack-by, var(--ui-stack-with, viewport));\n }\n :host {\n /* a colour or size from outside never reaches the table: its own classes remap them again */\n --ui-color: initial;\n --ui-color-text: initial;\n --ui-color-header: initial;\n --ui-color-border: initial;\n --ui-color-background: initial;\n --ui-color-inverted: initial;\n --ui-color-on: initial;\n --ui-color-inverted-on: initial;\n display: block;\n container-type: inline-size;\n }\n /*\n * The table's outer margin sits on the DOM ELEMENT: a size container is its own formatting context,\n * so a margin on the scroller inside it never collapses with the heading above, as class grammar's does.\n * Attached: see \"Attached\" (variations).\n */\n :host {\n margin-block: 1em;\n }\n :host(:first-child) {\n margin-block-start: 0;\n }\n :host(:last-child) {\n margin-block-end: 0;\n }\n\n /*\n * Scroller: around the slot; spaced by the DOM element's position, since the table is always an only child.\n * - In the shadow root the DOM element carries that spacing (above), so the scroller has none.\n * `:not([data-ui])`: a static server render's scroller (`spell/ui/static`) REPLACES the DOM element, and keeps it.\n * - `--_ui-table-row-height` here too: the scroller's scrolling heights read it (the table's alias is below it).\n */\n .scroller {\n --_ui-table-row-height: var(--ui-table-row-height, calc(2 * 0.785714em + var(--ui-line-height) * 1em));\n --_table-scroll-rows: 3;\n --_table-overflow-rows: 5;\n --_table-scroll-factor: 1;\n display: block;\n margin-block: 1em;\n }\n :host(:first-child) > .scroller {\n margin-block-start: 0;\n }\n :host(:last-child) > .scroller {\n margin-block-end: 0;\n }\n :host > .scroller:not([data-ui]) {\n margin-block: 0;\n }\n\n /*\n * Tokens: one per `table.variables` entry that still matters, from the global tokens --\n * each the private alias of its public token (never declare the public one: it would block inherited values).\n */\n .ui.table,\n :where(ui-table) > table {\n --_ui-table-margin: var(--ui-table-margin, 1em);\n --_ui-table-background: var(--ui-table-background, var(--ui-surface));\n --_ui-table-color: var(--ui-table-color, var(--ui-text-color));\n --_ui-table-border-width: var(--ui-table-border-width, var(--ui-border-width));\n --_ui-table-border-color: var(--ui-table-border-color, var(--ui-border-color));\n --_ui-table-radius: var(--ui-table-radius, var(--ui-radius));\n --_ui-table-duration: var(--ui-table-duration, var(--ui-duration-fast));\n --_ui-table-row-border: var(--ui-table-row-border, var(--ui-border-width) solid var(--ui-border-color-internal));\n --_ui-table-cell-border: var(--ui-table-cell-border, var(--ui-border-width) solid var(--ui-border-color-internal));\n --_ui-table-cell-padding-block: var(--ui-table-cell-padding-block, 0.785714em);\n --_ui-table-cell-padding-inline: var(--ui-table-cell-padding-inline, 0.785714em);\n --_ui-table-header-padding-block: var(--ui-table-header-padding-block, 0.928571em);\n --_ui-table-header-background: var(--ui-table-header-background, var(--ui-surface-muted));\n --_ui-table-header-color: var(--ui-table-header-color, var(--ui-text-color));\n --_ui-table-header-border: var(\n --ui-table-header-border,\n var(--ui-border-width) solid var(--ui-border-color-internal)\n );\n --_ui-table-footer-background: var(--ui-table-footer-background, var(--ui-surface-muted));\n --_ui-table-footer-color: var(--ui-table-footer-color, var(--ui-text-color));\n --_ui-table-footer-border: var(--ui-table-footer-border, var(--ui-border));\n --_ui-table-row-height: var(--ui-table-row-height, calc(2 * 0.785714em + var(--ui-line-height) * 1em));\n --_ui-table-responsive-row-padding: var(--ui-table-responsive-row-padding, 1em);\n --_ui-table-responsive-row-shadow: var(\n --ui-table-responsive-row-shadow,\n 0 -1px 0 0 oklch(from var(--ui-ink) l c h / 0.1) inset\n );\n --_ui-table-responsive-cell-padding: var(--ui-table-responsive-cell-padding, 0.25em 0.75em);\n --_ui-table-definition-page-background: var(--ui-table-definition-page-background, var(--ui-background));\n --_ui-table-definition-header-color: var(--ui-table-definition-header-color, var(--ui-text-unselected));\n --_ui-table-definition-column-background: var(\n --ui-table-definition-column-background,\n oklch(from var(--ui-ink) l c h / 0.03)\n );\n --_ui-table-definition-column-color: var(--ui-table-definition-column-color, var(--ui-text-selected));\n --_ui-table-active-background: var(\n --ui-table-active-background,\n color-mix(in oklab, var(--ui-ink) 12%, var(--ui-surface))\n );\n --_ui-table-active-color: var(--ui-table-active-color, var(--ui-text-color));\n /* Fomantic's 0.3-alpha disabled text fails WCAG contrast; a disabled ROW is still content to read. */\n --_ui-table-disabled-color: var(--ui-table-disabled-color, var(--ui-text-muted));\n --_ui-table-striped-background: var(--ui-table-striped-background, oklch(from var(--ui-ink) l c h / 0.03));\n --_ui-table-selectable-background: var(--ui-table-selectable-background, oklch(from var(--ui-ink) l c h / 0.05));\n --_ui-table-selectable-color: var(--ui-table-selectable-color, var(--ui-text-selected));\n --_ui-table-sortable-hover-background: var(\n --ui-table-sortable-hover-background,\n oklch(from var(--ui-ink) l c h / 0.05)\n );\n --_ui-table-sortable-hover-color: var(--ui-table-sortable-hover-color, var(--ui-text-hovered));\n --_ui-table-sortable-active-background: var(\n --ui-table-sortable-active-background,\n oklch(from var(--ui-ink) l c h / 0.05)\n );\n --_ui-table-sortable-active-color: var(--ui-table-sortable-active-color, var(--ui-text-selected));\n --_ui-table-sortable-border: var(--ui-table-sortable-border, var(--ui-border));\n --_ui-table-sortable-icon-opacity: var(--ui-table-sortable-icon-opacity, 0.8);\n --_ui-table-colored-border-size: var(--ui-table-colored-border-size, 0.2em);\n --_ui-table-marker-width: var(--ui-table-marker-width, 0.2em);\n --_ui-table-inverted-header-background: var(--ui-table-inverted-header-background, oklch(0 0 0 / 0.15));\n --_ui-table-inverted-cell-border-color: var(--ui-table-inverted-cell-border-color, oklch(1 0 0 / 0.1));\n /* Body rows of an `inverted striped` table: every other one. */\n --_ui-table-inverted-striped-background: var(--ui-table-inverted-striped-background, oklch(1 0 0 / 0.05));\n /* A hovered body row of an `inverted selectable` table. */\n --_ui-table-inverted-selectable-background: var(--ui-table-inverted-selectable-background, oklch(1 0 0 / 0.08));\n /* A hovered or sorted header of an `inverted sortable` table. */\n --_ui-table-inverted-sortable-background: var(--ui-table-inverted-sortable-background, oklch(1 0 0 / 0.08));\n /* The definition column of an `inverted definition` table. */\n --_ui-table-inverted-definition-column-background: var(\n --ui-table-inverted-definition-column-background,\n oklch(1 0 0 / 0.02)\n );\n /* Darkens the stuck header of an `inverted` table: mixed 15% into its fill. */\n --_ui-table-inverted-stuck-shade: var(--ui-table-inverted-stuck-shade, black);\n --_ui-table-stuck-background: var(--ui-table-stuck-background, var(--ui-surface));\n --_ui-table-stuck-header-background: var(--ui-table-stuck-header-background, var(--ui-surface-muted));\n --_ui-table-stuck-z: var(--ui-table-stuck-z, var(--ui-z-sticky));\n --_ui-table-padded: var(--ui-table-padded, 1em);\n --_ui-table-very-padded: var(--ui-table-very-padded, 1.5em);\n --_ui-table-compact-padding-block: var(--ui-table-compact-padding-block, 0.5em);\n --_ui-table-compact-padding-inline: var(--ui-table-compact-padding-inline, 0.7em);\n --_ui-table-very-compact-padding-block: var(--ui-table-very-compact-padding-block, 0.4em);\n --_ui-table-very-compact-padding-inline: var(--ui-table-very-compact-padding-inline, 0.6em);\n /* private defaults: flags this table answers for itself (a nested table never inherits them) */\n --_table-stack: 0;\n --_table-scroll-rows: 3;\n --_table-overflow-rows: 5;\n --_table-scroll-factor: 1;\n inline-size: 100%;\n margin: var(--_ui-table-margin) 0;\n border: var(--_ui-table-border-width) solid var(--_ui-table-border-color);\n border-radius: var(--_ui-table-radius);\n border-collapse: separate;\n border-spacing: 0;\n box-shadow: none;\n background: var(--_ui-table-background);\n color: var(--_ui-table-color);\n font-size: calc(var(--ui-font-size) * var(--ui-scale, 1));\n line-height: var(--ui-line-height);\n text-align: start;\n vertical-align: middle;\n }\n :is(.ui.table, :where(ui-table) > table):first-child {\n margin-block-start: 0;\n }\n :is(.ui.table, :where(ui-table) > table):last-child {\n margin-block-end: 0;\n }\n :is(.ui.table, :where(ui-table) > table) > :is(thead, tbody) {\n text-align: inherit;\n vertical-align: inherit;\n }\n\n /* Cells: what the table hands its content -- not its colour or scale, nor the flags it answers for. */\n :is(.ui.table, :where(ui-table) > table) :is(th, td) {\n --ui-color: initial;\n --ui-color-text: initial;\n --ui-color-header: initial;\n --ui-color-border: initial;\n --ui-color-background: initial;\n --ui-color-inverted: initial;\n --ui-color-hover: initial;\n --ui-color-focus: initial;\n --ui-color-down: initial;\n --ui-color-active: initial;\n --ui-color-on: initial;\n --ui-color-inverted-on: initial;\n --ui-scale: initial;\n --_table-hosted: initial;\n --_table-stack-by: initial;\n transition:\n background var(--_ui-table-duration) var(--ui-ease),\n color var(--_ui-table-duration) var(--ui-ease);\n }\n :is(.ui.table, :where(ui-table) > table) tr {\n --_table-mark-shadow: 0 0 transparent;\n }\n\n /* Caption: above the table, muted. */\n :is(.ui.table, :where(ui-table) > table) > caption {\n padding-block: var(--ui-space-xs);\n color: var(--ui-text-muted);\n text-align: start;\n }\n}\n\n/*******************************\n Parts\n*******************************/\n\n@layer ui.components.table.content {\n /* Rowspan helper */\n .ui.table :is(th, td).rowspanned {\n display: none;\n }\n\n /* Headers */\n :is(.ui.table, :where(ui-table) > table) > thead {\n box-shadow: none;\n }\n :is(.ui.table, :where(ui-table) > table) > thead > tr > th {\n padding: var(--_ui-table-header-padding-block) var(--_ui-table-cell-padding-inline);\n border-block-end: var(--_ui-table-header-border);\n border-inline-start: none;\n background: var(--_ui-table-header-background);\n color: var(--_ui-table-header-color);\n font-style: normal;\n font-weight: var(--ui-font-weight-bold);\n text-align: inherit;\n text-transform: none;\n vertical-align: inherit;\n cursor: auto;\n }\n :is(.ui.table, :where(ui-table) > table) > thead > tr:first-child > th:first-child {\n border-start-start-radius: var(--_ui-table-radius);\n }\n :is(.ui.table, :where(ui-table) > table) > thead > tr:first-child > th:last-child {\n border-start-end-radius: var(--_ui-table-radius);\n }\n\n /* Footer */\n :is(.ui.table, :where(ui-table) > table) > tfoot > tr > :is(th, td) {\n padding: var(--_ui-table-cell-padding-block) var(--_ui-table-cell-padding-inline);\n border-block-start: var(--_ui-table-footer-border);\n border-inline-start: none;\n background: var(--_ui-table-footer-background);\n color: var(--_ui-table-footer-color);\n font-style: normal;\n font-weight: var(--ui-font-weight-normal);\n text-align: inherit;\n text-transform: none;\n vertical-align: inherit;\n cursor: auto;\n }\n :is(.ui.table, :where(ui-table) > table) > tfoot > tr:last-child > :is(th, td):first-child {\n border-end-start-radius: var(--_ui-table-radius);\n }\n :is(.ui.table, :where(ui-table) > table) > tfoot > tr:last-child > :is(th, td):last-child {\n border-end-end-radius: var(--_ui-table-radius);\n }\n\n /* Rows: a line between body rows; none above the first, one between repeated bodies. */\n :is(.ui.table, :where(ui-table) > table) > tbody > tr > :is(td, th) {\n border-block-start: var(--_ui-table-row-border);\n }\n :is(.ui.table, :where(ui-table) > table) > tbody > tr:first-child > :is(td, th) {\n border-block-start: none;\n }\n :is(.ui.table, :where(ui-table) > table) > tbody + tbody > tr:first-child > :is(td, th) {\n border-block-start: var(--_ui-table-row-border);\n }\n\n /* Cells */\n :is(.ui.table, :where(ui-table) > table) > tbody > tr > :is(td, th) {\n padding: var(--_ui-table-cell-padding-block) var(--_ui-table-cell-padding-inline);\n text-align: inherit;\n }\n /* A header cell in the body (`<th scope=\"row\">`) reads as a row header. */\n :is(.ui.table, :where(ui-table) > table) > tbody > tr > th {\n font-weight: var(--ui-font-weight-bold);\n }\n\n /* Icons, images */\n .ui.table > i.icon,\n .ui.table :is(td, th) > :is(svg, ui-icon):only-child {\n vertical-align: baseline;\n }\n .ui.table .collapsing :is(.image, .image img, img) {\n max-inline-size: none;\n }\n\n /*\n * Definition: a blank corner, a highlighted first column.\n * - The corner may be a `td` (an empty `th` is an unnamed header to assistive tech;\n * axe `empty-table-header`), so both are keyed.\n */\n .ui.definition.table > thead:not(.full-width) > tr > :is(th, td):first-child {\n background: var(--_ui-table-definition-page-background);\n box-shadow: calc(var(--_ui-table-colored-border-size) / -2) calc(-1 * var(--_ui-table-colored-border-size)) 0\n calc(var(--_ui-table-colored-border-size) / 2) var(--_ui-table-definition-page-background);\n color: var(--_ui-table-definition-header-color);\n font-weight: var(--ui-font-weight-normal);\n pointer-events: none;\n }\n .ui.definition.table > thead:not(.full-width) > tr > :is(th, td):first-child:not(:empty) {\n pointer-events: auto;\n }\n .ui.definition.table > tfoot:not(.full-width) > tr > th:first-child {\n background: var(--_ui-table-definition-page-background);\n box-shadow: calc(var(--_ui-table-colored-border-size) / -2) var(--_ui-table-colored-border-size) 0\n calc(var(--_ui-table-colored-border-size) / 2) var(--_ui-table-definition-page-background);\n color: var(--_ui-table-definition-header-color);\n font-weight: var(--ui-font-weight-normal);\n pointer-events: none;\n }\n .ui.definition.table > tbody > tr > :is(td, th):first-child:not(.ignored),\n .ui.definition.table > tfoot > tr > td:first-child:not(.ignored),\n .ui.definition.table tr td.definition {\n background: var(--_ui-table-definition-column-background);\n color: var(--_ui-table-definition-column-color);\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.definition.table > thead:not(.full-width) > tr > th:nth-child(2),\n .ui.definition.table > tfoot:not(.full-width) > tr > :is(th, td):nth-child(2),\n .ui.definition.table > tbody > tr > :is(td, th):nth-child(2) {\n border-inline-start: var(--_ui-table-border-width) solid var(--_ui-table-border-color);\n }\n\n /* Structured: collapsed borders, for header cells spanning rows and columns. */\n .ui.structured.table {\n border-collapse: collapse;\n }\n .ui.structured.table > thead > tr > th {\n border-inline: none;\n }\n .ui.structured.sortable.table > thead > tr > th {\n border-inline: var(--_ui-table-sortable-border);\n }\n .ui.structured.basic.table > * > tr > th {\n border-inline: none;\n }\n .ui.structured.celled.table > * > tr > :is(th, td) {\n border-inline: var(--_ui-table-cell-border);\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.table.variations {\n /* Text alignment */\n .ui.table[class*=\"left aligned\"],\n .ui.table [class*=\"left aligned\"] {\n text-align: left;\n }\n .ui.table[class*=\"center aligned\"],\n .ui.table [class*=\"center aligned\"] {\n text-align: center;\n }\n .ui.table[class*=\"right aligned\"],\n .ui.table [class*=\"right aligned\"] {\n text-align: right;\n }\n .ui.justified.table,\n .ui.table .justified {\n text-align: justify;\n }\n\n /* Vertical alignment */\n .ui.table[class*=\"top aligned\"],\n .ui.table [class*=\"top aligned\"] {\n vertical-align: top;\n }\n .ui.table[class*=\"middle aligned\"],\n .ui.table [class*=\"middle aligned\"] {\n vertical-align: middle;\n }\n .ui.table[class*=\"bottom aligned\"],\n .ui.table [class*=\"bottom aligned\"] {\n vertical-align: bottom;\n }\n\n /* Collapsing: a cell as narrow as its content; a table as narrow as its cells. */\n .ui.table :is(th, td).collapsing {\n inline-size: 1px;\n white-space: nowrap;\n }\n .ui.collapsing.table {\n inline-size: auto;\n }\n /*\n * In rows mode the DOM element IS the table box, a block: `auto` filled its container (epic `data` I91).\n * - So it hugs its columns, never wider than the room it has.\n * - Not a size container: one's width can't come from what's inside it,\n * so a collapsing table stacks by the viewport, never by its own width (`stack-by=\"container\"`).\n */\n .ui.collapsing.table:state(rows) {\n container-type: normal;\n inline-size: fit-content;\n max-inline-size: 100%;\n }\n\n /* Fixed */\n .ui.fixed.table {\n table-layout: fixed;\n }\n .ui.fixed.table :is(th, td) {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /*\n * Editable (`editable`, epic `mockup` P9): a spreadsheet, in every theme.\n * - Square cells on a hairline grid: no rounded corners, the grid's lines the table's own border colour.\n * - The cursor cell outlined in the focus colour; its editor fills it edge to edge, with no border or padding.\n * - A row's delete button shows at its last cell's end, on hover or while the cursor is in the row.\n */\n .ui.editable.table {\n border-radius: 0;\n border-collapse: collapse;\n }\n .ui.editable.table > :is(thead, tbody) > tr > :is(th, td) {\n border: 1px solid var(--_ui-table-border-color);\n border-radius: 0;\n padding: 0.3em 0.5em;\n position: relative;\n min-width: 4em;\n }\n .ui.editable.table > tbody > tr > td {\n cursor: cell;\n }\n .ui.editable.table > tbody > tr > td:focus,\n .ui.editable.table > tbody > tr > td.cursor {\n outline: 2px solid var(--ui-focus-color, Highlight);\n outline-offset: -2px;\n }\n .ui.editable.table > tbody > tr > td[aria-readonly=\"true\"] {\n color: var(--ui-text-muted, inherit);\n }\n .ui.editable.table .cell-editor {\n position: absolute;\n inset: 0;\n inline-size: 100%;\n block-size: 100%;\n box-sizing: border-box;\n margin: 0;\n border: none;\n border-radius: 0;\n padding: 0.3em 0.5em;\n font: inherit;\n color: inherit;\n background: var(--_ui-table-background);\n outline: 2px solid var(--ui-focus-color, Highlight);\n outline-offset: -2px;\n }\n .ui.editable.table .cell-tick {\n margin: 0;\n vertical-align: middle;\n }\n /* A long table's spacer rows: as tall as the rows not drawn, and nothing else (epic `mockup` P14). */\n .ui.table > tbody > tr.spacer > td {\n padding: 0;\n border: none;\n }\n\n .ui.editable.table > tbody > tr.new-row > td {\n block-size: 1.8em;\n }\n .ui.editable.table .delete-row {\n position: absolute;\n inset-block: 0;\n inset-inline-end: 0;\n inline-size: 1.6em;\n padding: 0;\n border: none;\n background: none;\n color: var(--ui-text-muted, inherit);\n font: inherit;\n cursor: pointer;\n opacity: 0;\n }\n .ui.editable.table > tbody > tr:is(:hover, :focus-within) .delete-row,\n .ui.editable.table .delete-row:focus-visible {\n opacity: 1;\n }\n\n /* Selectable: the pointer, and a selectable cell's link filling it. */\n .ui.selectable.table > tbody > tr,\n .ui.table > tbody > tr > td.selectable {\n cursor: var(--ui-control-cursor);\n }\n .ui.table tbody tr td.selectable {\n padding: 0;\n }\n .ui.table tbody tr td.selectable > a:not(.ui) {\n display: block;\n color: inherit;\n }\n .ui.table:not(.compact) tbody tr td.selectable > a:not(.ui) {\n padding: var(--_ui-table-cell-padding-block) var(--_ui-table-cell-padding-inline);\n }\n\n /* Attached */\n .ui.attached.table {\n inset-block: 0;\n inline-size: calc(100% + 2 * var(--_ui-table-border-width));\n max-inline-size: calc(100% + 2 * var(--_ui-table-border-width));\n margin: 0 calc(-1 * var(--_ui-table-border-width));\n border: var(--_ui-table-border-width) solid var(--ui-border-color-strong);\n border-radius: 0;\n box-shadow: none;\n }\n .ui[class*=\"top attached\"].table {\n margin-block: var(--_ui-table-margin) 0;\n border-radius: var(--_ui-table-radius) var(--_ui-table-radius) 0 0;\n }\n .ui.table[class*=\"top attached\"]:first-child {\n margin-block-start: 0;\n }\n .ui[class*=\"bottom attached\"].table {\n margin-block: 0 var(--_ui-table-margin);\n border-radius: 0 0 var(--_ui-table-radius) var(--_ui-table-radius);\n }\n .ui[class*=\"bottom attached\"].table:last-child {\n margin-block-end: 0;\n }\n /*\n * In an element: the scroller carries the table's spacing\n * (a static render's; in a shadow root, the DOM element's).\n */\n .attached.scroller {\n margin-block: 0;\n }\n [class*=\"top attached\"].scroller {\n margin-block-start: 1em;\n }\n [class*=\"bottom attached\"].scroller {\n margin-block-end: 1em;\n }\n :host(:first-child) > [class*=\"top attached\"].scroller {\n margin-block-start: 0;\n }\n :host(:last-child) > [class*=\"bottom attached\"].scroller {\n margin-block-end: 0;\n }\n /* Shadow DOM: the DOM element carries the outer margin, so it mirrors the attached scroller's (`UITable` states). */\n :host(:state(attached)) {\n margin-block: 0;\n }\n :host(:state(attached-top):not(:first-child)) {\n margin-block-start: 1em;\n }\n :host(:state(attached-bottom):not(:last-child)) {\n margin-block-end: 1em;\n }\n :host > .scroller:not([data-ui]) {\n margin-block: 0;\n }\n\n /* Striped */\n .ui.striped.table > tr:nth-child(2n),\n .ui.striped.table > tbody > tr:nth-child(2n) {\n background-color: var(--_ui-table-striped-background);\n }\n\n /* Single line */\n .ui.table[class*=\"single line\"],\n .ui.table [class*=\"single line\"] {\n white-space: nowrap;\n }\n\n /* Coloured: a thick top edge in the table's colour (`--ui-color`, the generic remap). */\n .ui.table:is(\n .primary,\n .secondary,\n .red,\n .orange,\n .yellow,\n .olive,\n .green,\n .teal,\n .blue,\n .violet,\n .purple,\n .pink,\n .brown,\n .grey,\n .black\n ) {\n border-block-start: var(--_ui-table-colored-border-size) solid var(--ui-color);\n }\n\n /* Column count */\n .ui.one.column.table td {\n inline-size: 100%;\n }\n .ui.two.column.table td {\n inline-size: 50%;\n }\n .ui.three.column.table td {\n inline-size: 33.333333%;\n }\n .ui.four.column.table td {\n inline-size: 25%;\n }\n .ui.five.column.table td {\n inline-size: 20%;\n }\n .ui.six.column.table td {\n inline-size: 16.666667%;\n }\n .ui.seven.column.table td {\n inline-size: 14.285714%;\n }\n .ui.eight.column.table td {\n inline-size: 12.5%;\n }\n .ui.nine.column.table td {\n inline-size: 11.111111%;\n }\n .ui.ten.column.table td {\n inline-size: 10%;\n }\n .ui.eleven.column.table td {\n inline-size: 9.090909%;\n }\n .ui.twelve.column.table td {\n inline-size: 8.333333%;\n }\n .ui.thirteen.column.table td {\n inline-size: 7.692308%;\n }\n .ui.fourteen.column.table td {\n inline-size: 7.142857%;\n }\n .ui.fifteen.column.table td {\n inline-size: 6.666667%;\n }\n .ui.sixteen.column.table td {\n inline-size: 6.25%;\n }\n\n /* Column width */\n .ui.table :is(th, td).one.wide {\n inline-size: 6.25%;\n }\n .ui.table :is(th, td).two.wide {\n inline-size: 12.5%;\n }\n .ui.table :is(th, td).three.wide {\n inline-size: 18.75%;\n }\n .ui.table :is(th, td).four.wide {\n inline-size: 25%;\n }\n .ui.table :is(th, td).five.wide {\n inline-size: 31.25%;\n }\n .ui.table :is(th, td).six.wide {\n inline-size: 37.5%;\n }\n .ui.table :is(th, td).seven.wide {\n inline-size: 43.75%;\n }\n .ui.table :is(th, td).eight.wide {\n inline-size: 50%;\n }\n .ui.table :is(th, td).nine.wide {\n inline-size: 56.25%;\n }\n .ui.table :is(th, td).ten.wide {\n inline-size: 62.5%;\n }\n .ui.table :is(th, td).eleven.wide {\n inline-size: 68.75%;\n }\n .ui.table :is(th, td).twelve.wide {\n inline-size: 75%;\n }\n .ui.table :is(th, td).thirteen.wide {\n inline-size: 81.25%;\n }\n .ui.table :is(th, td).fourteen.wide {\n inline-size: 87.5%;\n }\n .ui.table :is(th, td).fifteen.wide {\n inline-size: 93.75%;\n }\n .ui.table :is(th, td).sixteen.wide {\n inline-size: 100%;\n }\n\n /* Sortable: headers are controls; a header `<button>` looks like the header's text. */\n .ui.sortable.table > thead > tr > th {\n color: var(--_ui-table-header-color);\n white-space: nowrap;\n cursor: var(--ui-control-cursor);\n }\n .ui.celled.sortable.table > thead > tr > th:not(:first-child) {\n border-inline-start: var(--_ui-table-sortable-border);\n }\n .ui.sortable.table > thead > tr > th > button {\n appearance: none;\n margin: 0;\n padding: 0;\n border: 0;\n background: none;\n color: inherit;\n font: inherit;\n text-align: inherit;\n text-transform: inherit;\n cursor: var(--ui-control-cursor);\n }\n .ui.sortable.table > thead > tr > th > button:focus-visible,\n .ui.sortable.table > thead > tr > th[tabindex]:focus-visible {\n outline: var(--ui-focus-width) solid var(--ui-focus-color);\n outline-offset: var(--ui-focus-offset);\n }\n .ui.sortable.table > thead > tr > th[tabindex]:focus-visible {\n outline-offset: calc(-1 * var(--ui-focus-width));\n }\n /* The direction caret, drawn only on the sorted header. */\n .ui.sortable.table > thead > tr > th::after {\n content: \"\";\n display: none;\n inline-size: 0.8em;\n block-size: 0.8em;\n margin-inline-start: 0.5em;\n background-color: currentColor;\n opacity: var(--_ui-table-sortable-icon-opacity);\n vertical-align: -0.05em;\n mask: var(--_table-caret) center / contain no-repeat;\n }\n .ui.sortable.table thead th:is([aria-sort=\"ascending\"], .sorted.ascending) {\n --_table-caret: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 2l4 6H1z'/%3E%3C/svg%3E\");\n }\n .ui.sortable.table thead th:is([aria-sort=\"descending\"], .sorted.descending) {\n --_table-caret: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 8L1 2h8z'/%3E%3C/svg%3E\");\n }\n .ui.sortable.table thead th:is([aria-sort=\"ascending\"], [aria-sort=\"descending\"], .sorted)::after {\n display: inline-block;\n }\n /* Opted out: no pointer, no hover. */\n .ui.sortable.table > thead > tr > th:is([data-sortable=\"false\"], .disabled) {\n cursor: auto;\n }\n\n /*\n * Inverted: the dark scheme -- surfaces, text, borders and state tokens re-resolve;\n * a coloured inverted table fills with its colour.\n */\n .ui.table {\n --ui-inverted: 0;\n }\n .ui.inverted.table {\n --ui-inverted: 1;\n --ui-scheme: dark;\n --_ui-table-cell-border: var(--ui-border-width) solid var(--_ui-table-inverted-cell-border-color);\n --_ui-table-row-border: var(--ui-border-width) solid var(--_ui-table-inverted-cell-border-color);\n --_ui-table-header-border: var(--ui-border-width) solid var(--_ui-table-inverted-cell-border-color);\n --_ui-table-footer-border: var(--ui-border-width) solid var(--_ui-table-inverted-cell-border-color);\n --_ui-table-header-background: var(--_ui-table-inverted-header-background);\n --_ui-table-footer-background: var(--_ui-table-inverted-header-background);\n --_ui-table-header-color: inherit;\n --_ui-table-footer-color: inherit;\n --_ui-table-striped-background: var(--_ui-table-inverted-striped-background);\n --_ui-table-selectable-background: var(--_ui-table-inverted-selectable-background);\n --_ui-table-stuck-header-background: color-mix(\n in oklab,\n var(--_ui-table-inverted-stuck-shade) 15%,\n var(--ui-surface)\n );\n color-scheme: dark;\n border: none;\n background: var(--ui-color, var(--ui-surface));\n color: var(--ui-color-on, var(--ui-text-color));\n }\n .ui.inverted.table:is(\n .primary,\n .secondary,\n .red,\n .orange,\n .yellow,\n .olive,\n .green,\n .teal,\n .blue,\n .violet,\n .purple,\n .pink,\n .brown,\n .grey,\n .black\n ) {\n --_ui-table-stuck-background: var(--ui-color);\n --_ui-table-stuck-header-background: color-mix(\n in oklab,\n var(--_ui-table-inverted-stuck-shade) 15%,\n var(--ui-color)\n );\n }\n .ui.inverted.definition.table > :is(thead, tfoot):not(.full-width) > tr > :is(th, td):first-child {\n --_ui-table-definition-page-background: var(--ui-background);\n color-scheme: light;\n }\n .ui.inverted.definition.table > :is(tbody, tfoot) > tr > td:first-child {\n --_ui-table-definition-column-background: var(--_ui-table-inverted-definition-column-background);\n }\n\n /* Basic: no fills, a lighter border. */\n .ui.basic.table {\n border: var(--_ui-table-border-width) solid var(--_ui-table-border-color);\n box-shadow: none;\n background: transparent;\n }\n .ui.basic.table > :is(thead, tfoot) {\n box-shadow: none;\n }\n .ui.basic.table > :is(thead, tbody, tfoot) > tr > th,\n .ui.basic.table > tr > th {\n border-inline-start: none;\n background: transparent;\n }\n .ui.basic.table > tbody > tr {\n border-block-end: var(--_ui-table-cell-border);\n }\n .ui.basic.table > :is(tbody, tfoot) > tr > td,\n .ui.basic.table > tr > td {\n background: transparent;\n }\n .ui.basic.striped.table > tbody > tr:nth-child(2n) {\n background-color: var(--_ui-table-selectable-background);\n }\n\n /* Very basic: no outer border, no padding at the edges. */\n .ui[class*=\"very basic\"].table {\n border: none;\n }\n .ui[class*=\"very basic\"].table:not(.sortable, .striped) > * > tr > :is(th, td):first-child {\n padding-inline-start: 0;\n }\n .ui[class*=\"very basic\"].table:not(.sortable, .striped) > * > tr > :is(th, td):last-child {\n padding-inline-end: 0;\n }\n .ui[class*=\"very basic\"].table:not(.sortable, .striped) > thead > tr:first-child > th {\n padding-block-start: 0;\n }\n\n /* Celled: borders between cells. */\n .ui.celled.table > * > tr > :is(th, td),\n .ui.celled.table > tr > :is(th, td) {\n border-inline-start: var(--_ui-table-cell-border);\n }\n .ui.celled.table > * > tr > :is(th, td):first-child,\n .ui.celled.table > tr > :is(th, td):first-child {\n border-inline-start: none;\n }\n\n /* Padded */\n .ui.padded.table > * > tr > th {\n padding-inline: var(--_ui-table-padded);\n }\n .ui.padded.table > * > tr > :is(th, td) {\n padding: var(--_ui-table-padded);\n }\n .ui[class*=\"very padded\"].table > * > tr > th {\n padding-inline: var(--_ui-table-very-padded);\n }\n .ui[class*=\"very padded\"].table > * > tr > td {\n padding: var(--_ui-table-very-padded);\n }\n\n /* Compact */\n .ui.compact.table > * > tr > th {\n padding-inline: var(--_ui-table-compact-padding-inline);\n }\n .ui.compact.table > :is(tbody, tfoot) > tr > td {\n padding: var(--_ui-table-compact-padding-block) var(--_ui-table-compact-padding-inline);\n }\n .ui[class*=\"very compact\"].table > * > tr > th {\n padding-inline: var(--_ui-table-very-compact-padding-inline);\n }\n .ui[class*=\"very compact\"].table > :is(tbody, tfoot) > tr > td {\n padding: var(--_ui-table-very-compact-padding-block) var(--_ui-table-very-compact-padding-inline);\n }\n\n /* Stuck: opaque rows, so sticky parts cover what scrolls under them. */\n .ui.stuck.table {\n background: var(--_ui-table-stuck-background);\n }\n .ui.stuck.table > thead > tr {\n background: var(--_ui-table-stuck-header-background);\n }\n .ui.stuck.table > tbody > tr {\n background: var(--_ui-table-stuck-background);\n }\n .ui.stuck.table > tfoot > tr {\n background: var(--_ui-table-stuck-header-background);\n }\n .ui.basic.stuck.table > :is(thead, tfoot) > tr {\n background: var(--_ui-table-stuck-background);\n }\n .ui.head.stuck.table > thead,\n .ui.foot.stuck.table > tfoot {\n position: sticky;\n z-index: var(--_ui-table-stuck-z);\n }\n .ui.head.stuck.table {\n border-block-start: 0;\n }\n .ui.head.stuck.table > thead {\n inset-block: 0 auto;\n }\n .ui.head.stuck.table > thead > tr:first-child > th {\n border-block-start: var(--_ui-table-cell-border);\n }\n .ui.foot.stuck.table {\n border-block-end: 0;\n }\n .ui.foot.stuck.table > tfoot {\n inset-block: auto 0;\n }\n .ui.foot.stuck.table > tfoot > tr:last-child > :is(td, th) {\n border-block-end: var(--_ui-table-cell-border);\n }\n .ui.first.stuck.table {\n border-inline-start: 0;\n }\n .ui.first.stuck.table :is(th, td):first-child {\n position: sticky;\n z-index: 1;\n inset-inline-start: 0;\n border-inline-start: var(--_ui-table-cell-border);\n background: inherit;\n }\n .ui.last.stuck.table {\n border-inline-end: 0;\n }\n .ui.last.stuck.table :is(th, td):last-child {\n position: sticky;\n z-index: 1;\n inset-inline-end: 0;\n border-inline-end: var(--_ui-table-cell-border);\n background: inherit;\n }\n .ui.celled.first.stuck.table :is(th, td):first-child {\n border-inline-end: var(--_ui-table-cell-border);\n }\n .ui.celled.last.stuck.table :is(th, td):last-child {\n border-inline-start: var(--_ui-table-cell-border);\n }\n\n /* Scrolling / overflowing heights: rows shown by page size, times the `short` ... `very long` factor. */\n .ui:is(.scrolling, .overflowing).short.table,\n .short:is(.scrolling, .overflowing).scroller {\n --_table-scroll-factor: 0.75;\n }\n .ui:is(.scrolling, .overflowing)[class*=\"very short\"].table,\n [class*=\"very short\"]:is(.scrolling, .overflowing).scroller {\n --_table-scroll-factor: 0.5;\n }\n .ui:is(.scrolling, .overflowing).long.table,\n .long:is(.scrolling, .overflowing).scroller {\n --_table-scroll-factor: 2;\n }\n .ui:is(.scrolling, .overflowing)[class*=\"very long\"].table,\n [class*=\"very long\"]:is(.scrolling, .overflowing).scroller {\n --_table-scroll-factor: 3;\n }\n @media (--ui-tablet), (--ui-computer) {\n :is(.ui.table, .scroller) {\n --_table-scroll-rows: 4;\n --_table-overflow-rows: 6;\n }\n }\n @media (--ui-computer) {\n :is(.ui.table, .scroller) {\n --_table-scroll-rows: 6;\n --_table-overflow-rows: 8;\n }\n }\n @media (--ui-widescreen) {\n :is(.ui.table, .scroller) {\n --_table-scroll-rows: 8;\n --_table-overflow-rows: 10;\n }\n }\n\n /* In an element: the scroller scrolls; a scrolling table keeps its head and foot in view. */\n .scrolling.scroller,\n .overflowing.scroller {\n overflow: auto;\n overscroll-behavior: contain;\n }\n .scrolling.scroller {\n max-block-size: calc(var(--_ui-table-row-height) * (var(--_table-scroll-rows) * var(--_table-scroll-factor) + 1));\n }\n .overflowing.scroller {\n max-block-size: calc(var(--_ui-table-row-height) * var(--_table-overflow-rows) * var(--_table-scroll-factor));\n }\n /*\n * A table that doesn't stack and is wider than its box (`UITable.isTooWide` adds `sideways`):\n * it scrolls sideways in the scroller, never the page, its height uncapped.\n */\n .sideways.scroller {\n overflow-x: auto;\n overscroll-behavior-x: contain;\n }\n .resizable.scrolling.scroller {\n block-size: calc(var(--_ui-table-row-height) * (var(--_table-scroll-rows) * var(--_table-scroll-factor) + 1));\n max-block-size: none;\n resize: vertical;\n }\n .scroller:focus-visible {\n outline: var(--ui-focus-width) solid var(--ui-focus-color);\n outline-offset: var(--ui-focus-offset);\n }\n @container style(--_table-hosted: 1) {\n .ui.scrolling.table > :is(thead, tfoot) {\n position: sticky;\n z-index: var(--_ui-table-stuck-z);\n }\n .ui.scrolling.table > thead {\n inset-block-start: 0;\n }\n .ui.scrolling.table > tfoot {\n inset-block-end: 0;\n }\n .ui.scrolling.table > thead > tr,\n .ui.scrolling.table > tfoot > tr {\n background: var(--_ui-table-stuck-header-background);\n }\n .ui.basic.scrolling.table > :is(thead, tfoot) > tr {\n background: var(--_ui-table-stuck-background);\n }\n }\n\n /* Static markup: Fomantic's scrollers -- the `tbody` (scrolling) or the whole table (overflowing). */\n @container not style(--_table-hosted: 1) {\n .ui.scrolling.table > :is(thead, tfoot, tbody) {\n display: block;\n overflow-y: scroll;\n overscroll-behavior: contain;\n }\n .ui.scrolling.table > :is(thead, tfoot, tbody) > tr {\n display: table;\n inline-size: 100%;\n table-layout: fixed;\n }\n .ui.scrolling.table > tbody {\n max-block-size: calc(var(--_ui-table-row-height) * var(--_table-scroll-rows) * var(--_table-scroll-factor));\n }\n .ui.resizable.scrolling.table > tbody {\n block-size: calc(var(--_ui-table-row-height) * var(--_table-scroll-rows) * var(--_table-scroll-factor));\n max-block-size: none;\n resize: vertical;\n }\n /* scrollbars in the head and foot only keep their width in step with the body's: camouflaged */\n .ui.scrolling.table > thead {\n border-radius: var(--_ui-table-radius) var(--_ui-table-radius) 0 0;\n background: var(--_ui-table-header-background);\n color: var(--_ui-table-header-background);\n scrollbar-color: currentColor currentColor;\n }\n .ui.scrolling.table > tfoot {\n border-radius: 0 0 var(--_ui-table-radius) var(--_ui-table-radius);\n background: var(--_ui-table-footer-background);\n color: var(--_ui-table-footer-background);\n scrollbar-color: currentColor currentColor;\n }\n .ui.overflowing.table {\n display: block;\n max-block-size: calc(var(--_ui-table-row-height) * var(--_table-overflow-rows) * var(--_table-scroll-factor));\n overflow: auto;\n overscroll-behavior: contain;\n }\n }\n\n /*\n * Stackable: below 768px (`tablet stackable`: 992px) rows become blocks.\n * This only FLAGS the table (`--_table-stack: 1`); the stacked layout is in the `states` sublayer.\n * - By the VIEWPORT (`@media`), as in Fomantic, for static markup and elements alike.\n * - By the HOST's width (`@container`) only when an element opts in: `stack-by=\"container\"`,\n * or `--ui-table-stack-by: container` on the DOM element, an ancestor or the page\n * (a table in a narrow sidebar of a wide screen); the attribute wins.\n * - Without either, the page-wide `--ui-stack-with` decides:\n * `container` stacks by the DOM element's width, `page` by the viewport.\n * (`<ui-root stack-with>` sets it: the token every stacking element follows.)\n * - NEVER, with `stack-by=\"none\"` or `--ui-table-stack-by: none`:\n * `unstackable` for every table of a region or page, the public way (never the private `--_table-stack`).\n */\n /*\n * Order matters below (same layer, equal specificity: the later rule wins):\n * 1. the token's way: by the DOM element's width when `--ui-table-stack-by: container`, else by the viewport;\n * `--ui-table-stack-by: none` then undoes it\n * 2. `stack-by` (the element's attribute: a private class on the table,\n * `stack-by-container` / `stack-by-viewport` / `stack-by-none`, from the canonical value) undoes 1,\n * then stacks its own way (`none`: not at all)\n * - A class in SELECTORS, not a state of the DOM element:\n * a state that set `--_table-stack-by` left WebKit evaluating a later table's style queries wrongly,\n * and `:state()` rules its viewport media queries.\n */\n @container (width < 768px) {\n @container style(--_table-stack-by: container) {\n .ui.table:not(.unstackable),\n .ui.stackable.table {\n --_table-stack: 1;\n }\n }\n }\n @container (width < 992px) {\n @container style(--_table-stack-by: container) {\n .ui[class*=\"tablet stackable\"].table {\n --_table-stack: 1;\n }\n }\n }\n @media (--ui-mobile) {\n @container not style(--_table-stack-by: container) {\n .ui.table:not(.unstackable),\n .ui.stackable.table {\n --_table-stack: 1;\n }\n }\n }\n @media (--ui-mobile), (--ui-tablet) {\n @container not style(--_table-stack-by: container) {\n .ui[class*=\"tablet stackable\"].table {\n --_table-stack: 1;\n }\n }\n }\n /* the token's `none`: as specific as every rule above (0,3,0), and later */\n @container style(--_table-stack-by: none) {\n :is(.ui.table:not(.unstackable), .ui.stackable.table, .ui[class*=\"tablet stackable\"].table) {\n --_table-stack: 0;\n }\n }\n .ui.stack-by-container.table,\n .ui.stack-by-viewport.table,\n .ui.stack-by-none.table {\n --_table-stack: initial;\n }\n @container (width < 768px) {\n :is(.ui.table:not(.unstackable), .ui.stackable.table).stack-by-container {\n --_table-stack: 1;\n }\n }\n @container (width < 992px) {\n .ui[class*=\"tablet stackable\"].stack-by-container.table {\n --_table-stack: 1;\n }\n }\n @media (--ui-mobile) {\n :is(.ui.table:not(.unstackable), .ui.stackable.table).stack-by-viewport {\n --_table-stack: 1;\n }\n }\n @media (--ui-mobile), (--ui-tablet) {\n .ui[class*=\"tablet stackable\"].stack-by-viewport.table {\n --_table-stack: 1;\n }\n }\n}\n\n/*******************************\n States\n*******************************/\n\n@layer ui.components.table.states {\n /*\n * Row and cell colours: each hue / state class => private tokens, painted by ONE rule set below.\n * - `--_table-tint` / `-ink`: the light background and its text (Fomantic's coloured and state cells)\n * - `--_table-fill` / `-fill-on`: the full colour and its text (inverted tables)\n * - `--_table-mark` / `-mark-inverted`: the `marked` edge\n * - `red colored` / `red marked` are phrases, so one cell can be `red colored right blue marked`.\n */\n .ui.table :is(tr, th, td).positive {\n --_table-tint: var(--ui-positive-background);\n --_table-ink: var(--ui-positive-text);\n }\n .ui.table :is(tr, th, td).negative {\n --_table-tint: var(--ui-negative-background);\n --_table-ink: var(--ui-negative-text);\n }\n .ui.table :is(tr, th, td).error {\n --_table-tint: var(--ui-error-background);\n --_table-ink: var(--ui-error-text);\n }\n .ui.table :is(tr, th, td).warning {\n --_table-tint: var(--ui-warning-background);\n --_table-ink: var(--ui-warning-text);\n }\n .ui.table :is(tr, th, td).active {\n --_table-tint: var(--_ui-table-active-background);\n --_table-ink: var(--_ui-table-active-color);\n }\n .ui.table :is(tr, th, td):is(.primary:not(.marked), [class*=\"primary colored\"]) {\n --_table-tint: var(--ui-primary-background);\n --_table-ink: var(--ui-primary-text);\n --_table-fill: var(--ui-primary);\n --_table-fill-on: var(--ui-primary-on);\n }\n .ui.table :is(tr, th, td):is(.secondary:not(.marked), [class*=\"secondary colored\"]) {\n --_table-tint: var(--ui-secondary-background);\n --_table-ink: var(--ui-secondary-text);\n --_table-fill: var(--ui-secondary);\n --_table-fill-on: var(--ui-secondary-on);\n }\n .ui.table :is(tr, th, td):is(.red:not(.marked), [class*=\"red colored\"]) {\n --_table-tint: var(--ui-red-background);\n --_table-ink: var(--ui-red-text);\n --_table-fill: var(--ui-red);\n --_table-fill-on: var(--ui-red-on);\n }\n .ui.table :is(tr, th, td):is(.orange:not(.marked), [class*=\"orange colored\"]) {\n --_table-tint: var(--ui-orange-background);\n --_table-ink: var(--ui-orange-text);\n --_table-fill: var(--ui-orange);\n --_table-fill-on: var(--ui-orange-on);\n }\n .ui.table :is(tr, th, td):is(.yellow:not(.marked), [class*=\"yellow colored\"]) {\n --_table-tint: var(--ui-yellow-background);\n --_table-ink: var(--ui-yellow-text);\n --_table-fill: var(--ui-yellow);\n --_table-fill-on: var(--ui-yellow-on);\n }\n .ui.table :is(tr, th, td):is(.olive:not(.marked), [class*=\"olive colored\"]) {\n --_table-tint: var(--ui-olive-background);\n --_table-ink: var(--ui-olive-text);\n --_table-fill: var(--ui-olive);\n --_table-fill-on: var(--ui-olive-on);\n }\n .ui.table :is(tr, th, td):is(.green:not(.marked), [class*=\"green colored\"]) {\n --_table-tint: var(--ui-green-background);\n --_table-ink: var(--ui-green-text);\n --_table-fill: var(--ui-green);\n --_table-fill-on: var(--ui-green-on);\n }\n .ui.table :is(tr, th, td):is(.teal:not(.marked), [class*=\"teal colored\"]) {\n --_table-tint: var(--ui-teal-background);\n --_table-ink: var(--ui-teal-text);\n --_table-fill: var(--ui-teal);\n --_table-fill-on: var(--ui-teal-on);\n }\n .ui.table :is(tr, th, td):is(.blue:not(.marked), [class*=\"blue colored\"]) {\n --_table-tint: var(--ui-blue-background);\n --_table-ink: var(--ui-blue-text);\n --_table-fill: var(--ui-blue);\n --_table-fill-on: var(--ui-blue-on);\n }\n .ui.table :is(tr, th, td):is(.violet:not(.marked), [class*=\"violet colored\"]) {\n --_table-tint: var(--ui-violet-background);\n --_table-ink: var(--ui-violet-text);\n --_table-fill: var(--ui-violet);\n --_table-fill-on: var(--ui-violet-on);\n }\n .ui.table :is(tr, th, td):is(.purple:not(.marked), [class*=\"purple colored\"]) {\n --_table-tint: var(--ui-purple-background);\n --_table-ink: var(--ui-purple-text);\n --_table-fill: var(--ui-purple);\n --_table-fill-on: var(--ui-purple-on);\n }\n .ui.table :is(tr, th, td):is(.pink:not(.marked), [class*=\"pink colored\"]) {\n --_table-tint: var(--ui-pink-background);\n --_table-ink: var(--ui-pink-text);\n --_table-fill: var(--ui-pink);\n --_table-fill-on: var(--ui-pink-on);\n }\n .ui.table :is(tr, th, td):is(.brown:not(.marked), [class*=\"brown colored\"]) {\n --_table-tint: var(--ui-brown-background);\n --_table-ink: var(--ui-brown-text);\n --_table-fill: var(--ui-brown);\n --_table-fill-on: var(--ui-brown-on);\n }\n .ui.table :is(tr, th, td):is(.grey:not(.marked), [class*=\"grey colored\"]) {\n --_table-tint: var(--ui-grey-background);\n --_table-ink: var(--ui-grey-text);\n --_table-fill: var(--ui-grey);\n --_table-fill-on: var(--ui-grey-on);\n }\n .ui.table :is(tr, th, td):is(.black:not(.marked), [class*=\"black colored\"]) {\n --_table-tint: var(--ui-black-background);\n --_table-ink: var(--ui-black-text);\n --_table-fill: var(--ui-black);\n --_table-fill-on: var(--ui-black-on);\n }\n .ui.table :is(tr, td)[class*=\"primary marked\"] {\n --_table-mark: var(--ui-primary);\n --_table-mark-inverted: var(--ui-primary-inverted);\n }\n .ui.table :is(tr, td)[class*=\"secondary marked\"] {\n --_table-mark: var(--ui-secondary);\n --_table-mark-inverted: var(--ui-secondary-inverted);\n }\n .ui.table :is(tr, td)[class*=\"red marked\"] {\n --_table-mark: var(--ui-red);\n --_table-mark-inverted: var(--ui-red-inverted);\n }\n .ui.table :is(tr, td)[class*=\"orange marked\"] {\n --_table-mark: var(--ui-orange);\n --_table-mark-inverted: var(--ui-orange-inverted);\n }\n .ui.table :is(tr, td)[class*=\"yellow marked\"] {\n --_table-mark: var(--ui-yellow);\n --_table-mark-inverted: var(--ui-yellow-inverted);\n }\n .ui.table :is(tr, td)[class*=\"olive marked\"] {\n --_table-mark: var(--ui-olive);\n --_table-mark-inverted: var(--ui-olive-inverted);\n }\n .ui.table :is(tr, td)[class*=\"green marked\"] {\n --_table-mark: var(--ui-green);\n --_table-mark-inverted: var(--ui-green-inverted);\n }\n .ui.table :is(tr, td)[class*=\"teal marked\"] {\n --_table-mark: var(--ui-teal);\n --_table-mark-inverted: var(--ui-teal-inverted);\n }\n .ui.table :is(tr, td)[class*=\"blue marked\"] {\n --_table-mark: var(--ui-blue);\n --_table-mark-inverted: var(--ui-blue-inverted);\n }\n .ui.table :is(tr, td)[class*=\"violet marked\"] {\n --_table-mark: var(--ui-violet);\n --_table-mark-inverted: var(--ui-violet-inverted);\n }\n .ui.table :is(tr, td)[class*=\"purple marked\"] {\n --_table-mark: var(--ui-purple);\n --_table-mark-inverted: var(--ui-purple-inverted);\n }\n .ui.table :is(tr, td)[class*=\"pink marked\"] {\n --_table-mark: var(--ui-pink);\n --_table-mark-inverted: var(--ui-pink-inverted);\n }\n .ui.table :is(tr, td)[class*=\"brown marked\"] {\n --_table-mark: var(--ui-brown);\n --_table-mark-inverted: var(--ui-brown-inverted);\n }\n .ui.table :is(tr, td)[class*=\"grey marked\"] {\n --_table-mark: var(--ui-grey);\n --_table-mark-inverted: var(--ui-grey-inverted);\n }\n .ui.table :is(tr, td)[class*=\"black marked\"] {\n --_table-mark: var(--ui-black);\n --_table-mark-inverted: var(--ui-black-inverted);\n }\n\n /* Paint: every coloured / state row and cell, from its tokens. */\n .ui.table\n :is(tr, th, td):is(\n .positive,\n .negative,\n .error,\n .warning,\n .active,\n .colored,\n :is(\n .primary,\n .secondary,\n .red,\n .orange,\n .yellow,\n .olive,\n .green,\n .teal,\n .blue,\n .violet,\n .purple,\n .pink,\n .brown,\n .grey,\n .black\n ):not(.marked)\n ) {\n background: var(--_table-tint);\n color: var(--_table-ink);\n }\n /* A coloured head / foot row shows through its header cells. */\n .ui.table\n > :is(thead, tfoot)\n > tr:is(\n .positive,\n .negative,\n .error,\n .warning,\n .active,\n .colored,\n :is(\n .primary,\n .secondary,\n .red,\n .orange,\n .yellow,\n .olive,\n .green,\n .teal,\n .blue,\n .violet,\n .purple,\n .pink,\n .brown,\n .grey,\n .black\n ):not(.marked)\n )\n > :is(th, td) {\n background: inherit;\n color: inherit;\n }\n /* Inverted: hues fill with the full colour; states keep their (now dark) tint. */\n .ui.inverted.table\n :is(tr, th, td):is(\n .colored,\n :is(\n .primary,\n .secondary,\n .red,\n .orange,\n .yellow,\n .olive,\n .green,\n .teal,\n .blue,\n .violet,\n .purple,\n .pink,\n .brown,\n .grey,\n .black\n ):not(.marked)\n ) {\n background: var(--_table-fill);\n color: var(--_table-fill-on);\n }\n\n /* Marked: a coloured edge on the left or right. */\n .ui.table :is(tr, td).left.marked {\n --_table-mark-shadow: var(--_ui-table-marker-width) 0 0 0 var(--_table-mark) inset;\n box-shadow: var(--_table-mark-shadow);\n }\n .ui.table :is(tr, td).right.marked {\n --_table-mark-shadow: calc(-1 * var(--_ui-table-marker-width)) 0 0 0 var(--_table-mark) inset;\n box-shadow: var(--_table-mark-shadow);\n }\n .ui.inverted.table :is(tr, td).left.marked {\n --_table-mark-shadow: var(--_ui-table-marker-width) 0 0 0 var(--_table-mark-inverted) inset;\n }\n .ui.inverted.table :is(tr, td).right.marked {\n --_table-mark-shadow: calc(-1 * var(--_ui-table-marker-width)) 0 0 0 var(--_table-mark-inverted) inset;\n }\n\n /* Disabled rows and cells: faded, inert to the pointer. */\n .ui.table tr.disabled > :is(td, th),\n .ui.table tr > :is(td, th).disabled {\n color: var(--_ui-table-disabled-color);\n pointer-events: none;\n }\n\n /*\n * Selectable: hovered rows / cells get a translucent overlay over whatever paints them\n * (plain, striped, coloured, state), so one rule serves every colour.\n */\n .ui.selectable.table > tbody > tr:hover,\n .ui.selectable.table > tr:hover,\n .ui.table tbody tr td.selectable:hover {\n background-image: linear-gradient(var(--_ui-table-selectable-background), var(--_ui-table-selectable-background));\n color: var(--_table-ink, var(--_ui-table-selectable-color));\n }\n .ui.inverted.selectable.table > tbody > tr:hover,\n .ui.inverted.table tbody tr td.selectable:hover {\n color: var(--_table-fill-on, var(--_ui-table-selectable-color));\n }\n\n /* Sortable: hover and sorted headers. */\n .ui.sortable.table > thead > tr > th:not([data-sortable=\"false\"], .disabled):hover {\n color: var(--_ui-table-sortable-hover-color);\n }\n .ui.sortable.table:not(.basic) > thead > tr > th:not([data-sortable=\"false\"], .disabled):hover {\n background: var(--_ui-table-sortable-hover-background);\n }\n .ui.sortable.table thead th:is([aria-sort], .sorted) {\n color: var(--_ui-table-sortable-active-color);\n user-select: none;\n }\n .ui.sortable.table:not(.basic) thead th:is([aria-sort], .sorted) {\n background: var(--_ui-table-sortable-active-background);\n }\n .ui.sortable.table > thead > tr > th.disabled:hover {\n color: var(--_ui-table-disabled-color);\n }\n .ui.inverted.sortable.table:not(.basic) > thead > tr > th {\n border-inline-color: transparent;\n }\n .ui.inverted.sortable.table:not(.basic) > thead > tr > th:not([data-sortable=\"false\"], .disabled):hover,\n .ui.inverted.sortable.table:not(.basic) thead th:is([aria-sort], .sorted) {\n background: var(--_ui-table-inverted-sortable-background);\n }\n\n /*\n * Stacked (see \"Stackable\"): every part a block, cells without borders or fills, a line under each row.\n * - Here, in the last sublayer, so it beats cell widths (`four wide`, `collapsing`) and fills --\n * Fomantic needs `!important` and `.ui.ui.ui.ui` for that.\n * - Style queries read the PARENT: `thead` asks the table, `tr` its section, a cell its row.\n */\n @container style(--_table-stack: 1) {\n .ui.table > :is(thead, tbody, tfoot),\n .ui.table > :is(thead, tbody, tfoot) > tr,\n .ui.table > tr,\n .ui.table > :is(thead, tbody, tfoot) > tr > :is(th, td):not(.rowspanned),\n .ui.table > tr > :is(th, td):not(.rowspanned) {\n display: block;\n inline-size: auto;\n }\n .ui.table > :is(thead, tbody, tfoot) > tr,\n .ui.table > tr {\n padding-block: var(--_ui-table-responsive-row-padding);\n box-shadow: var(--_ui-table-responsive-row-shadow), var(--_table-mark-shadow);\n }\n .ui.table > :is(thead, tbody, tfoot) > tr > :is(th, td),\n .ui.table > tr > :is(th, td) {\n padding: var(--_ui-table-responsive-cell-padding);\n border: none;\n box-shadow: none;\n background: none;\n }\n .ui.table > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child,\n .ui.table > tr > :is(th, td):first-child {\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.definition.table > thead > tr > :is(th, td):first-child {\n box-shadow: none;\n }\n }\n}\n\n/*******************************\n Rows and cells\n*******************************/\n\n/*\n * Rows mode (epic `ui-gaps` P7): `<ui-row>`s of `<ui-cell>`s, with no native table.\n * - The DOM element is the table box: the element mirrors its class words onto ITSELF, so the rules above that\n * style `.ui.table` (border, fill, colour edge, basic, inverted) style it as they style a native table.\n * - The shadow scroller is a CSS grid of `--_table-columns` columns (the element sets it);\n * each row is a subgrid of all of them, so columns line up; a cell spans its own (`<ui-cell span>`).\n * - Rows and cells are LIGHT DOM, styled here by this PAGE sheet: `:state(header)` / `:state(footer)` on a row,\n * `:state(header)` on a cell.\n * - NOTE: the caption (`caption`) sits inside the table's border, at its top; a native `<caption>` sits above it.\n */\n\n@layer ui.components.table.content {\n /* Shadow: the grid, and the caption above it. */\n :host(:state(rows)) > .scroller {\n display: grid;\n grid-template-columns: repeat(var(--_table-columns, 1), auto);\n margin: 0;\n }\n :host(:state(rows)) > .caption,\n :host > .caption {\n padding: var(--ui-space-xs) var(--_ui-table-cell-padding-inline, 0.785714em);\n color: var(--ui-text-muted);\n text-align: start;\n }\n\n /* Light DOM: rows span every column, as subgrids; cells are its items. */\n /* `container: none`: the grid's sheet makes a row a size container, and a contained box can't be a subgrid */\n .ui.table:state(rows) > :is(ui-row, es-fila) {\n container: none;\n display: grid;\n grid-column: 1 / -1;\n grid-template-columns: subgrid;\n --_table-mark-shadow: 0 0 transparent;\n }\n .ui.table:state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda) {\n --ui-color: initial;\n --ui-color-text: initial;\n --ui-color-header: initial;\n --ui-color-border: initial;\n --ui-color-background: initial;\n --ui-color-inverted: initial;\n --ui-color-on: initial;\n --ui-color-inverted-on: initial;\n --ui-scale: initial;\n --_table-hosted: initial;\n --_table-stack-by: initial;\n display: block;\n min-inline-size: 0;\n padding: var(--_ui-table-cell-padding-block) var(--_ui-table-cell-padding-inline);\n border-block-start: var(--_ui-table-row-border);\n transition:\n background var(--_ui-table-duration) var(--ui-ease),\n color var(--_ui-table-duration) var(--ui-ease);\n }\n .ui.table:state(rows) > :is(ui-row, es-fila):first-child > :is(ui-cell, es-celda),\n .ui.table:state(rows) > :is(ui-row, es-fila):state(header) + ui-row > :is(ui-cell, es-celda) {\n border-block-start: none;\n }\n\n /* Header row: the column headers. */\n .ui.table:state(rows) > :is(ui-row, es-fila):state(header) > :is(ui-cell, es-celda) {\n padding-block: var(--_ui-table-header-padding-block);\n border-block-end: var(--_ui-table-header-border);\n background: var(--_ui-table-header-background);\n color: var(--_ui-table-header-color);\n font-weight: var(--ui-font-weight-bold);\n /* a column is never narrower than its heading's longest word: \"Temperature\" ran into \"Rain\" at phone width */\n min-inline-size: min-content;\n }\n .ui.table:state(rows):not(:state(captioned)) > :is(ui-row, es-fila):state(header):first-child > :is(ui-cell, es-celda):first-child {\n border-start-start-radius: var(--_ui-table-radius);\n }\n .ui.table:state(rows):not(:state(captioned)) > :is(ui-row, es-fila):state(header):first-child > :is(ui-cell, es-celda):last-child {\n border-start-end-radius: var(--_ui-table-radius);\n }\n\n /* A header cell in a body row: its row's name. */\n .ui.table:state(rows) > :is(ui-row, es-fila):not(:state(header)) > :is(ui-cell, es-celda):state(header) {\n font-weight: var(--ui-font-weight-bold);\n }\n\n /* Footer row */\n .ui.table:state(rows) > :is(ui-row, es-fila):state(footer) > :is(ui-cell, es-celda) {\n border-block-start: var(--_ui-table-footer-border);\n background: var(--_ui-table-footer-background);\n color: var(--_ui-table-footer-color);\n }\n}\n\n@layer ui.components.table.variations {\n /* Celled */\n .ui.celled.table:state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda) + ui-cell {\n border-inline-start: var(--_ui-table-cell-border);\n }\n\n /* Striped: every other body row. */\n .ui.striped.table:state(rows) > :is(ui-row, es-fila):nth-child(2n of :not(:state(header), :state(footer))) {\n background-color: var(--_ui-table-striped-background);\n }\n .ui.inverted.striped.table:state(rows) > :is(ui-row, es-fila):nth-child(2n of :not(:state(header), :state(footer))) {\n background-color: var(--_ui-table-inverted-striped-background);\n }\n\n /* Basic */\n .ui.basic.table:state(rows) > :is(ui-row, es-fila):state(header) > :is(ui-cell, es-celda) {\n background: transparent;\n }\n\n /* Very basic: no padding at the edges. */\n .ui[class*=\"very basic\"].table:not(.sortable, .striped):state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda):first-child {\n padding-inline-start: 0;\n }\n .ui[class*=\"very basic\"].table:not(.sortable, .striped):state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda):last-child {\n padding-inline-end: 0;\n }\n\n /* Padding */\n .ui.padded.table:state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda) {\n padding: var(--_ui-table-padded);\n }\n .ui[class*=\"very padded\"].table:state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda) {\n padding: var(--_ui-table-very-padded);\n }\n .ui.compact.table:state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda) {\n padding: var(--_ui-table-compact-padding-block) var(--_ui-table-compact-padding-inline);\n }\n .ui[class*=\"very compact\"].table:state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda) {\n padding: var(--_ui-table-very-compact-padding-block) var(--_ui-table-very-compact-padding-inline);\n }\n\n /* Single line */\n .ui[class*=\"single line\"].table:state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda) {\n white-space: nowrap;\n }\n}\n\n@layer ui.components.table.states {\n /* Selectable: body rows light up on hover. */\n .ui.selectable.table:state(rows) > :is(ui-row, es-fila):not(:state(header), :state(footer)):hover {\n background: var(--_ui-table-selectable-background);\n color: var(--_ui-table-selectable-color);\n }\n .ui.inverted.selectable.table:state(rows) > :is(ui-row, es-fila):not(:state(header), :state(footer)):hover {\n background: var(--_ui-table-inverted-selectable-background);\n }\n\n /* Sortable: a header cell is a control. */\n .ui.sortable.table:state(rows) > :is(ui-row, es-fila):state(header) > :is(ui-cell, es-celda):not([data-sortable=\"false\"]) {\n cursor: var(--ui-control-cursor);\n user-select: none;\n }\n .ui.sortable.table:state(rows) > :is(ui-row, es-fila):state(header) > :is(ui-cell, es-celda):not([data-sortable=\"false\"]):hover {\n background: var(--_ui-table-sortable-hover-background);\n color: var(--_ui-table-sortable-hover-color);\n }\n .ui.sortable.table:state(rows) > :is(ui-row, es-fila):state(header) > :is(ui-cell, es-celda)[aria-sort] {\n background: var(--_ui-table-sortable-active-background);\n color: var(--_ui-table-sortable-active-color);\n }\n .ui.sortable.table:state(rows) > :is(ui-row, es-fila):state(header) > :is(ui-cell, es-celda)[tabindex]:focus-visible {\n outline: var(--ui-focus-width) solid var(--ui-focus-color);\n outline-offset: calc(-1 * var(--ui-focus-width));\n }\n /* The direction caret, drawn only on the sorted header: the native table's. */\n .ui.sortable.table:state(rows) > :is(ui-row, es-fila):state(header) > :is(ui-cell, es-celda)[aria-sort=\"ascending\"] {\n --_table-caret: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 2l4 6H1z'/%3E%3C/svg%3E\");\n }\n .ui.sortable.table:state(rows) > :is(ui-row, es-fila):state(header) > :is(ui-cell, es-celda)[aria-sort=\"descending\"] {\n --_table-caret: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 8L1 2h8z'/%3E%3C/svg%3E\");\n }\n .ui.sortable.table:state(rows) > :is(ui-row, es-fila):state(header) > :is(ui-cell, es-celda)[aria-sort]::after {\n content: \"\";\n display: inline-block;\n inline-size: 0.8em;\n block-size: 0.8em;\n margin-inline-start: 0.5em;\n background-color: currentColor;\n opacity: var(--_ui-table-sortable-icon-opacity);\n vertical-align: -0.05em;\n mask: var(--_table-caret) center / contain no-repeat;\n }\n\n /* Stacked (see \"Stackable\"): the grid, its rows and cells, blocks; a line under each row. */\n @container style(--_table-stack: 1) {\n :host(:state(rows)) > .scroller {\n display: block;\n }\n .ui.table:state(rows) > :is(ui-row, es-fila) {\n display: block;\n padding-block: var(--_ui-table-responsive-row-padding);\n box-shadow: var(--_ui-table-responsive-row-shadow);\n }\n .ui.table:state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda) {\n padding: var(--_ui-table-responsive-cell-padding);\n border: none;\n background: none;\n }\n .ui.table:state(rows) > :is(ui-row, es-fila) > :is(ui-cell, es-celda):first-child {\n font-weight: var(--ui-font-weight-bold);\n }\n }\n}\n","// oxlint-disable-next-line spell-ui/no-solid-effect -- the class mirror's RENDER effect: a throw must reach the error boundary\nimport { For, Show, createRenderEffect } from \"solid-js\"\nimport { Portal, isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { tableVocabulary } from \"./UITable.en\"\nimport { TableClassMirror } from \"./TableClassMirror\"\nimport { TableEditing } from \"./TableEditing\"\nimport { ATTACH, TableGrammar } from \"./TableGrammar\"\nimport { TableRows } from \"./TableRows\"\nimport { TableSort } from \"./TableSort\"\n\nimport tableCSS from \"./UITable.css?inline\"\n\n/****************\n * ### `UITable`\n * The component behind `<ui-table>`:\n * a native `<table>` in Fomantic's table look, `<ui-table celled appearance=\"striped\"><table>...</table></ui-table>`.\n *\n * - The table stays NATIVE and in the LIGHT DOM (table semantics, find-in-page, copy, the page's CSS);\n * the shadow root is only `<div class=\"... scroller\" part=\"scroller\"><slot></slot></div>`.\n *\n * - Styling: the component mirrors its class string (`ui celled striped table`, from `ClassBuilder`)\n * onto the slotted table (`TableClassMirror`), and registers `UITable.css` as a PAGE sheet too,\n * whose class-grammar rules then style it.\n * - The mirror writes only its own words and keeps the author's classes,\n * and writes them again when a framework rewrites `className`.\n * - Why classes, not attribute selectors on the DOM element:\n * one mechanical port of `table.less` serves the element and static markup\n * (a server writes `class=\"ui celled table\"` and paints before any JS),\n * and translated names, `yes` / `no` and `medium` resolve through the vocabulary like every other component's.\n *\n * - Row and cell looks are the author's classes on native `tr` / `td` / `th`\n * (`positive`, `red marked left`, `collapsing` ...): no JS.\n *\n * - Scrolling: `scrolling` and `overflowing` cap the scroller's height.\n * It then scrolls, and is a focusable, named region\n * (the DOM element's `aria-label`, else the `<caption>`, else the translated `label`).\n * - A table that doesn't stack (`unstackable`, `stack-by=\"none\"`, or too wide for the stacking breakpoint)\n * and is wider than its box scrolls SIDEWAYS in the scroller, its height uncapped:\n * the same focusable, named region, never the page (`isTooWide`, measured).\n * - A stacked table always fits its box, so it never does.\n *\n * - Sorting (`sortable`): every `thead` header sorts, except `th[data-sortable=\"false\"]` and `th.disabled`.\n * - A header's `<button>` is its control (APG's sortable table: authors SHOULD put one in each sortable header);\n * a header without one is made focusable (`tabindex=\"0\"`) and answers Enter and Space.\n * The component never moves or wraps the author's nodes.\n * - The sorted header gets `aria-sort` (removed from the others); `UITable.css` draws the caret from it.\n * - `sort-column` and `sort-direction` are auto-controlled.\n * Each activation first sends the cancelable `ui-sorting` (`TableSortDetail`):\n * the sorted column flips, another starts `ascending`.\n * - Reordering: data mode shows its rows sorted.\n * A slotted table reorders its `tbody` rows by cell text only with `client-sort` (simple static tables);\n * otherwise the app sorts: frameworks own their rows.\n *\n * - Data mode: `rows` (and optional `columnDefs`), with NO slotted `<table>`, draws one into the LIGHT DOM:\n * header cells `scope=\"col\"`, a sort `<button>` each when sortable, keyed rows, text only (never HTML).\n * It's removed when `rows` is unset or an author table appears: the author's table always wins.\n * - Why the light DOM: the same page sheet and class grammar as a slotted table,\n * native semantics in the document,\n * and a server draws the same `<table>` itself (first paint never needs the property).\n * - NOTE: no virtualization (the plan's ~200-row threshold): every row is drawn.\n *\n * - NOTE: `sort-column` counts `colspan`s but not `rowspan`s (see `TableSort`).\n *\n * - Editing (`editable`, data mode only; epic `mockup` P9): a spreadsheet over `rows`.\n * - The table is an ARIA `grid`: one cell is the CURSOR, the only one in the tab order (a roving `tabindex`);\n * arrows, Tab, Enter, Home / End move it.\n * - Typing, F2 or Enter opens the cell's editor, by its column's `type` (`TableEditing.typeOf()`);\n * Enter or Tab keeps it, Escape puts it back. A `yes-no` cell is a tick box, toggled in place.\n * - The empty last row adds a row; Delete clears a cell, ⌘ / Ctrl + Delete (or the row's button) removes its row;\n * a pasted block of cells fills from the cursor, adding rows past the end.\n * - Each change goes out as ONE `ui-editing` (`TableEditDetail`), whatever it touched:\n * not cancelled, the table shows it in new `rows` of its own (`TableEditing.applied()`);\n * a page that writes its own things (a Spell program, through its core) cancels it, and its rows follow.\n * - It NEVER changes a row object in place.\n * - Its look is the sheet's `editable` class word: square cells on a hairline grid, the cursor outlined.\n * - NOTE: every row is drawn, as in data mode: a long table isn't drawn in windows yet.\n *\n * - Rows mode (epic `ui-gaps` P7): `<ui-row>`s of `<ui-cell>`s, with no native table, for a drawing,\n * which holds no native HTML.\n * - The DOM element is then the table box: the class mirror writes its class words onto the DOM element itself,\n * so the same class-grammar page rules style it (\"Rows and cells\" in `UITable.css`).\n * - The scroller is a CSS grid of `--_table-columns` columns (`TableRows.columnCount()`), each row a subgrid.\n * - ARIA `table`, its rows `row`, its cells `cell` / `columnheader` / `rowheader`, named by its `caption`.\n * - Sorting works the same (`TableRows`): header cells sort, and `client-sort` moves the row elements.\n * - NOTE: not in a static server render, which draws a rows-mode table unstyled.\n *\n * - `caption`: drawn above the scroller (attribute, or the `caption` slot); a native table's `<caption>` wins.\n *\n * - Static server render (`spell/ui/static`): no observers, effects or listeners.\n * `decorateStatic()` writes the author table's classes, marker and `aria-sort` once,\n * and data mode draws its table inside the scroller (the page's static style sheet styles it there).\n ****************/\nexport class UITable extends E.UIComponent<typeof tableVocabulary> {\n @E.proto static vocabulary = tableVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { table: tableCSS },\n // the scroller and the light-DOM headers take focus themselves\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /**\n * Base `onMount()`, plus the light-DOM work:\n * - the render effect that mirrors classes onto the managed table\n * (undone when the DOM element is released: it survives moves)\n * - the `@onChange` methods watch the table, decorate headers and (with `client-sort`) reorder rows\n */\n override onMount(): JSX.Element {\n const content = super.onMount()\n if (isServer) {\n this.decorateStatic()\n return content\n }\n this.domElement.addReleaseCallback(() => this.classMirror.detach())\n // stays explicit, a RENDER effect: the class mirror is the element's main DOM binding,\n // and a throw in its compute (the classes) must reach the element's error boundary --\n // a plain effect's error is only logged\n createRenderEffect(\n () => [this.mirrorTarget, this.rootClass] as const,\n ([table, classes]) => this.classMirror.apply(table, classes)\n )\n return content\n }\n\n render(): JSX.Element {\n this.registerPageSheets()\n return (\n <>\n <Show when={this.hasOwnCaption}>\n <div class={CAPTION} part={this.partForName(\"caption\")}>\n <slot name=\"caption\">{this.caption}</slot>\n </div>\n </Show>\n <div\n ref={(box: HTMLDivElement) => (this.scroller = box)}\n class={[this.scrollerClasses, { [SIDEWAYS]: this.isTooWide }]}\n style={this.isInRowsMode ? { [COLUMNS_TOKEN]: String(this.columnCount) } : undefined}\n part={this.partForName(\"scroller\")}\n tabindex={this.isScrollRegion ? 0 : undefined}\n role={this.isScrollRegion ? \"region\" : undefined}\n aria-label={this.isScrollRegion ? this.regionLabel : undefined}\n >\n <slot />\n {isServer ? <Show when={this.isInDataMode}>{this.staticTable()}</Show> : undefined}\n </div>\n {isServer ? undefined : (\n <Portal mount={this.domElement}>\n <Show when={this.isInDataMode}>{this.generatedTable()}</Show>\n </Portal>\n )}\n </>\n )\n }\n\n /**\n * Register the family's sheets as PAGE sheets too: their class-grammar rules style the light-DOM table.\n * - Idempotent (`UI.styles.register`); re-registering new text (hot reload) updates them in place.\n */\n private registerPageSheets() {\n if (isServer) return\n for (const [name, css] of Object.entries(this.elementSetup.styleSheets))\n UI.styles.register(name, css, { page: true })\n }\n\n /**\n * `stack-by` as a class on the table before the noun (`ui stackable stack-by-container table`):\n * a private word the sheet keys on, from the CANONICAL value, so a translated attribute still works.\n * - A class, not a state of the DOM element:\n * `:state()` rules in the page sheet left WebKit with stale viewport media queries on a later table.\n */\n protected get extraClass(): string | undefined {\n return this.stackBy ? `${STACK_BY_CLASS}${this.stackBy}` : undefined\n }\n\n ////////////////\n // ## The managed table\n ////////////////\n\n /** First author `<table>` child (never the generated one); follows the DOM element's children. */\n @E.watches({ childList: true })\n get authorTable(): HTMLTableElement | undefined {\n return this.scanAuthorTable()\n }\n\n /** The generated data-mode table, once rendered (set a microtask after its `ref`). */\n @E.state accessor dataTable: HTMLTableElement | undefined = undefined\n\n /** Bumped when the managed table's content changes (header rows, caption text ...). */\n @E.state accessor tableRevision = 0\n\n /** The table this element styles and sorts: the author's, else the generated one. */\n get managedTable(): HTMLTableElement | undefined {\n return this.authorTable ?? (this.isInDataMode ? this.dataTable : undefined)\n }\n\n /** Where the class words go: the managed table, else (rows mode) the DOM element itself. */\n get mirrorTarget(): Element | undefined {\n return this.managedTable ?? (this.isInRowsMode ? this.domElement : undefined)\n }\n\n /** What's sorted, and watched for changes: the managed table, else (rows mode) the DOM element and its rows. */\n get sortTarget(): Element | undefined {\n return this.mirrorTarget\n }\n\n /** Mirrors `rootClass` onto `managedTable`. */\n private readonly classMirror = new TableClassMirror()\n\n /**\n * First `<table>` child that the element didn't render.\n * - By `localName`, not `instanceof HTMLTableElement`: a static server render's children are linkedom elements.\n */\n private scanAuthorTable(): HTMLTableElement | undefined {\n for (const child of this.domElement.children) {\n if (child.localName === \"table\" && !GENERATED.has(child as HTMLTableElement)) return child as HTMLTableElement\n }\n return undefined\n }\n\n /**\n * Watch the managed table's content (rows, header cells, caption text, its `aria-label`)\n * and bump `tableRevision` when it changes.\n * - Returns the cleanup (run when the table changes).\n */\n @E.onChange(\"sortTarget\")\n protected onManagedTableChanged(table: Element | undefined): (() => void) | undefined {\n if (!table) return undefined\n // oxlint-disable-next-line spell-ui/no-mutation-observer -- watches the managed TABLE, swapped with it\n const observer = new MutationObserver(() => this.tableRevision++)\n // rows mode: the rows' `header` / `footer` and the cells' `span` move columns and headers too\n const attributeFilter = this.isInRowsMode ? [\"aria-label\", ...ROW_ATTRIBUTES] : [\"aria-label\"]\n observer.observe(table, { childList: true, subtree: true, characterData: true, attributeFilter })\n return () => observer.disconnect()\n }\n\n /**\n * The author table in a static server render, once: what the browser's effects keep up to date.\n * - its classes mirrored in (`TableClassMirror.mirrored()`)\n * - `data-ui=\"table\"`: a root of the static stylesheet's `@scope` too, so the table sheet reaches its cells\n * (a slotted element's insides are out of its owner's scope, but this sheet is a PAGE sheet in the browser)\n * - `aria-sort` on the sorted header, while `sortable` (the caret)\n * - SIDE EFFECT: writes the page's (linkedom) table; no focusable headers: nothing on a static page sorts.\n */\n @E.untracked\n private decorateStatic() {\n const table = this.authorTable\n if (!table) return\n table.setAttribute(\"class\", TableClassMirror.mirrored(table.getAttribute(\"class\"), this.rootClass))\n table.setAttribute(UIT.STATIC_ROOT, this.vocabulary.noun)\n const column = this.sortColumn\n const direction = this.effectiveSortDirection\n if (!this.sortable || column === undefined || !direction) return\n TableSort.headerAt(table, column)?.setAttribute(\"aria-sort\", direction)\n }\n\n ////////////////\n // ## Rows mode\n ////////////////\n\n /** The DOM element's `<ui-row>` children; follows them. */\n @E.watches({ childList: true, equals: E.isSameList })\n get rowElements(): readonly Element[] {\n return TableRows.rows(this.domElement)\n }\n\n /** Rows mode: `<ui-row>`s, and neither an author table nor data mode. */\n @E.cssState(\"rows\")\n get isInRowsMode(): boolean {\n return this.rowElements.length > 0 && !this.authorTable && this.dataRows === undefined\n }\n\n /** Columns of the rows-mode grid; follows the rows and their cells' `span`s (`tableRevision`). */\n get columnCount(): number {\n void this.tableRevision\n return TableRows.columnCount(this.domElement)\n }\n\n /** ARIA: `table` in rows mode (a native table is its own). */\n @E.aria(\"role\")\n get ariaRole(): string | undefined {\n return this.isInRowsMode ? \"table\" : undefined\n }\n\n /** ARIA name in rows mode: the `caption` text, unless the DOM element has an `aria-label`. */\n @E.aria(\"label\")\n get ariaName(): string | undefined {\n return this.isInRowsMode ? this.caption || undefined : undefined\n }\n\n ////////////////\n // ## Caption\n ////////////////\n\n /** Draws its own caption: `caption` or the slot, and no native `<caption>` of the managed table's. */\n @E.cssState(\"captioned\")\n get hasOwnCaption(): boolean {\n void this.tableRevision\n if (this.managedTable?.caption) return false\n return !!this.caption || this.slots.hasContent(this.slotForName(\"caption\"))\n }\n\n /** Which named slots have content (the `caption` slot). */\n readonly slots = new E.SlotContent(this.domElement)\n\n /** Name the native managed table by `caption`, while it has no name of its own: the one this element set. */\n @E.onChange(\"managedTable\", \"caption\", { writesDOMElement: true })\n protected onCaptionChanged(table: HTMLTableElement | undefined, caption: string | undefined) {\n if (!table || !caption || table.caption || table.hasAttribute(\"aria-label\")) return undefined\n table.setAttribute(\"aria-label\", caption)\n return () => {\n if (table.getAttribute(\"aria-label\") === caption) table.removeAttribute(\"aria-label\")\n }\n }\n\n ////////////////\n // ## Data mode\n ////////////////\n\n /**\n * `rows`, when it's an array, or any other list of rows (an iterable, e.g. a program's list of things).\n * - Read again on each read: a program's list follows its own changes, which a cache here wouldn't hear.\n */\n get dataRows(): readonly UIT.TableRow[] | undefined {\n const rows = this.rows as unknown\n if (Array.isArray(rows)) return rows as readonly UIT.TableRow[]\n if (rows && typeof rows === \"object\" && Symbol.iterator in rows) return Array.from(rows as Iterable<UIT.TableRow>)\n return undefined\n }\n\n /** Data mode: `rows` set and no author table. */\n get isInDataMode(): boolean {\n return this.dataRows !== undefined && !this.authorTable\n }\n\n /**\n * Data-mode columns: `columnDefs`; else the ones its list of rows names, its `tableColumns`\n * (a program's list of things names its own, so an empty one still has them); else the first row's keys.\n */\n @E.derived\n get dataColumns(): readonly UIT.TableColumn[] {\n const defs = this.columnDefs\n if (Array.isArray(defs)) return (defs as UIT.TableColumn[]).filter((column) => typeof column?.key === \"string\")\n const named = (this.rows as { tableColumns?: unknown } | undefined)?.tableColumns\n if (Array.isArray(named)) return named as UIT.TableColumn[]\n return TableEditing.columnsOf(this.dataRows ?? [])\n }\n\n /**\n * Data-mode rows in the current sort order; unsorted when the column can't sort.\n * - A plain getter, not `@derived`: a program's list of rows changes where a cache can't see it.\n */\n get sortedRows(): readonly UIT.TableRow[] {\n const rows = this.dataRows ?? []\n const index = this.sortColumn\n const column = index === undefined ? undefined : this.dataColumns[index]\n if (!column || column.sortable === false) return rows\n const sign = this.effectiveSortDirection === \"descending\" ? -1 : 1\n return [...rows].sort((a, b) => TableSort.compare(a[column.key], b[column.key], sign))\n }\n\n /**\n * The data-mode table, into the DOM element's LIGHT DOM (through the `Portal`).\n * - No classes here: `classMirror` writes them like on an author table.\n */\n private generatedTable(): JSX.Element {\n return (\n <table\n ref={(table: HTMLTableElement) => this.adoptDataTable(table)}\n role={this.isEditable ? \"grid\" : undefined}\n aria-rowcount={this.isWindowed ? this.sortedRows.length + 1 : undefined}\n >\n {this.headAndBody()}\n </table>\n )\n }\n\n /**\n * The data-mode table in a static server render: inside the scroller (no light DOM to portal into),\n * with the classes the mirror would write, and `aria-sort` on the sorted header.\n */\n private staticTable(): JSX.Element {\n return <table class={this.rootClass}>{this.headAndBody(this.effectiveSortDirection)}</table>\n }\n\n /**\n * The data-mode table's head and body.\n * - `direction`: the static render's `aria-sort` for the sorted column's header\n * (the browser's comes from `decorateHeaders()`).\n */\n private headAndBody(direction?: UIT.TableSortDirection): JSX.Element {\n const sorted = direction && this.sortable ? this.sortColumn : undefined\n return (\n <>\n <thead>\n <tr>\n <For each={this.dataColumns}>\n {(column, index) => this.columnHeader(column, () => (index() === sorted ? direction : undefined))}\n </For>\n </tr>\n </thead>\n <tbody>\n {this.spacer(\"above\")}\n <Show\n when={this.isEditable}\n fallback={\n <For each={this.drawnRows}>\n {(row) => (\n <tr>\n <For each={this.dataColumns}>\n {(column) => (\n <td class={TableGrammar.cell(column) || undefined}>{TableSort.text(row[column.key])}</td>\n )}\n </For>\n </tr>\n )}\n </For>\n }\n >\n <For each={this.drawnRows}>\n {(row, drawnIndex) => (\n <tr aria-rowindex={this.isWindowed ? this.drawnFrom + drawnIndex() + 2 : undefined}>\n <For each={this.dataColumns}>\n {(column, columnIndex) =>\n this.editableCell({ row, rowIndex: () => this.drawnFrom + drawnIndex(), column, columnIndex })\n }\n </For>\n </tr>\n )}\n </For>\n {this.spacer(\"below\")}\n <tr class={NEW_ROW} aria-label={this.translationForKey(\"new-row\")}>\n <For each={this.dataColumns}>\n {(column, columnIndex) =>\n this.editableCell({ row: undefined, rowIndex: () => this.sortedRows.length, column, columnIndex })\n }\n </For>\n </tr>\n </Show>\n <Show when={!this.isEditable}>{this.spacer(\"below\")}</Show>\n </tbody>\n </>\n )\n }\n\n ////////////////\n // ## Long tables: only the rows in view (epic `mockup` P14, J34 B)\n //\n // Past `WINDOW_FROM` rows, a data-mode body draws only the rows in view and a few around them, with a spacer row\n // above and below standing in for the rest, so a table of 10,000 rows scrolls as one of 50.\n // - What's in view: the body against the window and the scroller (`measureWindow()`), on every scroll and resize.\n // - The cursor is in the data's places (`sortedRows`), drawn or not: moving it to an undrawn row draws that row\n // first (`setCursor()`), and keys, edits and paste act on the data, so a paste fills rows past the window too.\n // - A server render draws every row: nothing scrolls there.\n ////////////////\n\n /** Is the body drawn in a window? Past `WINDOW_FROM` rows, in a browser. */\n get isWindowed(): boolean {\n return !isServer && this.isInDataMode && this.sortedRows.length > WINDOW_FROM\n }\n\n /** The first row drawn, in `sortedRows`. */\n @E.state accessor windowStart = 0\n\n /** How many rows the window draws. */\n @E.state accessor windowSize = WINDOW_FIRST_SIZE\n\n /** The first row drawn: 0 when it isn't windowed. */\n get drawnFrom(): number {\n return this.isWindowed ? Math.min(this.windowStart, this.sortedRows.length) : 0\n }\n\n /** The rows drawn: all of them, or the window's. */\n get drawnRows(): readonly UIT.TableRow[] {\n const rows = this.sortedRows\n return this.isWindowed ? rows.slice(this.drawnFrom, this.drawnFrom + this.windowSize) : rows\n }\n\n /** A row standing in for the undrawn rows `above` or `below` the window, as tall as they'd be. */\n private spacer(where: \"above\" | \"below\"): JSX.Element {\n const rows = () => {\n const count = this.sortedRows.length\n return where === \"above\" ? this.drawnFrom : Math.max(0, count - this.drawnFrom - this.drawnRows.length)\n }\n return (\n <Show when={this.isWindowed}>\n <tr class={SPACER} aria-hidden=\"true\">\n <td colspan={Math.max(1, this.dataColumns.length)} style={{ height: `${rows() * this.rowHeight}px` }} />\n </tr>\n </Show>\n )\n }\n\n /** A drawn row's height in pixels, measured once rows are drawn; `DEFAULT_ROW_PX` before. */\n @E.state accessor rowHeight = DEFAULT_ROW_PX\n\n /**\n * SIDE EFFECT: while windowed, follows every scroll and resize, and draws the rows then in view.\n * - Scrolls are heard on the document, capturing: the scroller, the page, or any box around it.\n */\n @E.onChange(\"isReady\", \"isWindowed\")\n protected onWindowed(isReady: boolean, isWindowed: boolean) {\n if (!isReady || !isWindowed) return\n const remeasure = () => E.beforeNextPaint(() => this.measureWindow())\n document.addEventListener(\"scroll\", remeasure, { capture: true, passive: true })\n window.addEventListener(\"resize\", remeasure)\n remeasure()\n return () => {\n document.removeEventListener(\"scroll\", remeasure, { capture: true })\n window.removeEventListener(\"resize\", remeasure)\n }\n }\n\n /** Draw the rows in view now, and a few around them. */\n @E.untracked\n private measureWindow() {\n const body = this.dataTable?.tBodies[0]\n if (!body || !this.isWindowed) return\n const drawn = body.rows[1]\n if (drawn && !drawn.classList.contains(SPACER) && drawn.offsetHeight) this.rowHeight = drawn.offsetHeight\n const box = this.scrollerScrolls ? this.scroller?.getBoundingClientRect() : undefined\n const top = Math.max(0, box?.top ?? 0)\n const bottom = Math.min(window.innerHeight, box?.bottom ?? window.innerHeight)\n // where the first row would be: the body's top, the spacer above included\n const first = Math.floor((top - body.getBoundingClientRect().top) / this.rowHeight)\n const count = Math.ceil(Math.max(0, bottom - top) / this.rowHeight)\n const start = Math.max(0, Math.min(first - WINDOW_EXTRA, this.sortedRows.length - 1))\n const size = Math.max(count + 2 * WINDOW_EXTRA, WINDOW_FIRST_SIZE)\n if (start !== this.windowStart) this.windowStart = start\n if (size !== this.windowSize) this.windowSize = size\n }\n\n /** Draw row `row` if it's outside the window: the window starts a few rows above it. */\n @E.untracked\n private drawRow(row: number) {\n if (!this.isWindowed || row >= this.sortedRows.length) return\n const from = this.drawnFrom\n if (row >= from && row < from + this.windowSize) return\n this.windowStart = Math.max(0, row - WINDOW_EXTRA)\n }\n\n /** How many spacer rows the body starts with: 1 while windowed. */\n private get rowsBeforeData(): number {\n return this.isWindowed ? 1 : 0\n }\n\n /**\n * Remember the generated `table`: marked at once (the author-table scan must skip it),\n * stored a microtask later (a `ref` runs inside the render, an owned scope).\n */\n private adoptDataTable(table: HTMLTableElement) {\n GENERATED.add(table)\n E.afterSolidUpdate(() => (this.dataTable = table))\n }\n\n /**\n * One data-mode header: `th scope=\"col\"`, a `<button>` inside while it can sort.\n * - `sort`: its `aria-sort`, in a static server render only.\n */\n private columnHeader(column: UIT.TableColumn, sort: () => UIT.TableSortDirection | undefined): JSX.Element {\n const text = column.header ?? column.key\n const optOut = column.sortable === false\n return (\n <th\n scope=\"col\"\n aria-sort={sort()}\n class={TableGrammar.cell(column) || undefined}\n {...{\n [UIT.TABLE_SORT_KEY]: column.key,\n [UIT.TABLE_SORT_OPT_OUT.attribute]: optOut ? UIT.TABLE_SORT_OPT_OUT.value : undefined\n }}\n >\n <Show when={this.sortable && !optOut} fallback={text}>\n <button type=\"button\">{text}</button>\n </Show>\n </th>\n )\n }\n\n ////////////////\n // ## Sorting\n ////////////////\n\n /** `sort-column`: page-controlled, or set by clicks. */\n @E.controlled(\"sort-column\") accessor sortColumn: number | undefined = undefined\n\n /** `sort-direction`: page-controlled, or set by clicks. */\n @E.controlled(\"sort-direction\") accessor sortDirection: UIT.TableSortDirection | undefined = undefined\n\n /** Direction in effect: `sortDirection`, `ascending` when only a column is set. */\n get effectiveSortDirection(): UIT.TableSortDirection | undefined {\n return this.sortColumn === undefined ? undefined : (this.sortDirection ?? \"ascending\")\n }\n\n /** Headers this element made focusable (`tabindex=\"0\"`). */\n private readonly headersMadeFocusable = new Set<Element>()\n\n /** Header this element set `aria-sort` on. */\n private sortedHeader: Element | undefined\n\n /** The table, its content, `sortable` or the sort changed: decorate the headers again. */\n @E.onChange(\"tableRevision\", \"sortTarget\", \"sortable\", \"sortColumn\", \"effectiveSortDirection\")\n protected onSortChanged(\n _revision: number,\n table: Element | undefined,\n isSortable: boolean,\n column: number | undefined,\n direction: UIT.TableSortDirection | undefined\n ) {\n this.decorateHeaders({ table, isSortable, column, direction })\n }\n\n /**\n * Header ARIA and focus for the current sort:\n * - while `sortable`, every sortable header without a `<button>` gets `tabindex=\"0\"`;\n * headers that stop qualifying lose the ones THIS element set\n * - the sorted column's header gets `aria-sort`; every other header in the `thead` loses it\n */\n private decorateHeaders({ table, isSortable, column, direction }: HeaderSort) {\n const headers = table && isSortable ? TableSort.headers(table) : []\n const focusable = new Set(\n headers.filter((header) => TableSort.isSortable(header) && !header.querySelector(\"button\"))\n )\n for (const header of this.headersMadeFocusable) {\n if (!focusable.has(header)) {\n header.removeAttribute(\"tabindex\")\n this.headersMadeFocusable.delete(header)\n }\n }\n for (const header of focusable) {\n if (header.hasAttribute(\"tabindex\")) continue\n header.setAttribute(\"tabindex\", \"0\")\n this.headersMadeFocusable.add(header)\n }\n const sorted = table && isSortable && column !== undefined ? TableSort.headerAt(table, column) : undefined\n if (this.sortedHeader && this.sortedHeader !== sorted) this.sortedHeader.removeAttribute(\"aria-sort\")\n for (const header of headers) if (header !== sorted) header.removeAttribute(\"aria-sort\")\n if (sorted && direction) sorted.setAttribute(\"aria-sort\", direction)\n this.sortedHeader = sorted\n }\n\n /** `client-sort`: reorder the body rows (the author table's, or rows mode's) by the sorted column's cell text. */\n @E.onChange(\"authorTable\", \"isInRowsMode\", \"clientSort\", \"sortColumn\", \"effectiveSortDirection\")\n protected onClientSortChanged(\n table: HTMLTableElement | undefined,\n isInRowsMode: boolean,\n clientSort: boolean,\n column: number | undefined,\n direction: UIT.TableSortDirection | undefined\n ) {\n const sorted = table ?? (isInRowsMode ? this.domElement : undefined)\n if (clientSort && sorted && column !== undefined && direction) TableSort.sortRows(sorted, column, direction)\n }\n\n /** A click on (or inside) a sortable header sorts by it; on an editable cell, puts the cursor there. */\n @E.on(\"click\")\n protected onClick(event: MouseEvent) {\n const header = this.sortableHeader(event)\n if (header) this.requestSort(header, event)\n else this.clickedCell(event)\n }\n\n /** Enter / Space on a focusable header (not its button: that one clicks); an editable table's keys. */\n @E.on(\"keydown\")\n protected onKeyDown(event: KeyboardEvent) {\n if (this.isEditable && this.editingKey(event)) return\n if (event.key !== UIT.Key.enter && event.key !== UIT.Key.space) return\n const header = this.sortableHeader(event)\n if (!header || event.target !== header) return\n event.preventDefault()\n this.requestSort(header, event)\n }\n\n /** The sortable header `event` happened in, while the table is `sortable`. */\n @E.untracked\n private sortableHeader(event: Event): Element | undefined {\n const table = this.sortTarget\n if (!table || !this.sortable) return undefined\n const header = TableSort.header(table, event.target)\n return header && TableSort.isSortable(header) ? header : undefined\n }\n\n /**\n * Sort by `header`'s column: `ui-sorting` first (cancelable), then `sort-column` / `sort-direction`.\n * - The sorted column flips direction; another column starts `ascending`.\n * - Nothing changes when the event is cancelled, or when a handler set either property itself.\n */\n @E.untracked\n private requestSort(header: Element, originalEvent: Event) {\n const table = this.sortTarget\n if (!table) return\n const column = TableSort.column(table, header)\n const current = this.sortColumn\n const direction: UIT.TableSortDirection =\n column === current && this.effectiveSortDirection === \"ascending\" ? \"descending\" : \"ascending\"\n const detail: UIT.TableSortDetail = { column, key: TableSort.key(header), direction, originalEvent }\n this.requestChange(\"sortDirection\", direction, () =>\n this.requestChange(\"sortColumn\", column, () => this.send(\"ui-sorting\", detail))\n )\n }\n\n ////////////////\n // ## Editing\n ////////////////\n\n /** `editable`, in data mode: a spreadsheet over `rows`. */\n get isEditable(): boolean {\n return !!this.editable && this.isInDataMode\n }\n\n /** Each column's kind of value (`TableEditing.typeOf()`), in column order. */\n get columnTypes(): readonly UIT.TableCellType[] {\n const rows = this.dataRows ?? []\n return this.dataColumns.map((column) => TableEditing.typeOf(column, rows))\n }\n\n /** The cursor: the cell keys act on; its `row` is `sortedRows.length` in the empty last row. */\n @E.state accessor cursor: CellAt | undefined = undefined\n\n /** The cell being edited, and what its editor holds now; always the cursor's. */\n @E.state accessor editing: CellDraft | undefined = undefined\n\n /** The cell at `at` in the generated table's body, if it's drawn. */\n @E.untracked\n private cellAt(at: CellAt): HTMLTableCellElement | undefined {\n const body = this.dataTable?.tBodies[0]\n if (!body) return undefined\n // the empty last row is the body's last, after a spacer below\n if (at.row === this.sortedRows.length && this.isEditable) return body.rows[body.rows.length - 1]?.cells[at.column]\n const drawn = at.row - this.drawnFrom\n if (drawn < 0 || drawn >= this.drawnRows.length) return undefined\n return body.rows[this.rowsBeforeData + drawn]?.cells[at.column]\n }\n\n /** The body cell `target` is in, as a place, if it's the generated table's. */\n @E.untracked\n private placeOf(target: EventTarget | null): CellAt | undefined {\n const cell = (target as Element | null)?.closest?.(\"td\")\n const table = this.dataTable\n if (!cell || !table || cell.closest(\"table\") !== table || cell.parentElement?.parentElement !== table.tBodies[0])\n return undefined\n const row = cell.parentElement as HTMLTableRowElement\n if (row.classList.contains(SPACER)) return undefined\n if (row.classList.contains(NEW_ROW)) return { row: this.sortedRows.length, column: cell.cellIndex }\n return { row: this.drawnFrom + row.sectionRowIndex - this.rowsBeforeData, column: cell.cellIndex }\n }\n\n /**\n * One cell of an editable table: its value shown, or its editor while it's edited.\n * - In the tab order only while it's the cursor (the first cell, before there is one).\n */\n private editableCell({ row, rowIndex, column, columnIndex }: EditableCell): JSX.Element {\n const type = () => this.columnTypes[columnIndex()] ?? \"text\"\n const isCursor = () => {\n const cursor = this.cursor\n return cursor\n ? cursor.row === rowIndex() && cursor.column === columnIndex()\n : rowIndex() === 0 && columnIndex() === 0\n }\n const isEditing = () => isCursor() && this.editing !== undefined\n const value = () => row?.[column.key]\n return (\n <td\n class={[TableGrammar.cell(column) || undefined, { [CURSOR]: isCursor() && !!this.cursor }]}\n tabindex={isCursor() ? 0 : -1}\n aria-readonly={column.readOnly ? \"true\" : undefined}\n >\n <Show\n when={isEditing()}\n fallback={\n <Show when={type() === \"yes-no\"} fallback={<>{TableEditing.textFor(column, type(), value())}</>}>\n <input\n type=\"checkbox\"\n class={TICK}\n tabindex=\"-1\"\n checked={!!value()}\n disabled={!!column.readOnly}\n aria-label={column.header ?? column.key}\n onClick={(event) => {\n event.preventDefault()\n this.toggle({ row: rowIndex(), column: columnIndex() }, event)\n }}\n />\n </Show>\n }\n >\n {this.editor(column, type())}\n </Show>\n <Show when={row && columnIndex() === this.dataColumns.length - 1}>\n <button\n type=\"button\"\n class={DELETE_ROW}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"delete-row\")}\n onClick={(event) => this.removeRow(rowIndex(), event)}\n >\n ×\n </button>\n </Show>\n </td>\n )\n }\n\n /** The editor of the cell being edited: a field of its column's kind, or a list of its choices. */\n private editor(column: UIT.TableColumn, type: UIT.TableCellType): JSX.Element {\n const focus = (field: HTMLInputElement | HTMLSelectElement) =>\n E.afterSolidUpdate(() => {\n field.focus()\n if (field instanceof HTMLInputElement && field.type === \"text\") field.setSelectionRange(9999, 9999)\n })\n const draft = (event: Event) => {\n const editing = this.editing\n if (editing) this.editing = { ...editing, draft: (event.target as HTMLInputElement).value }\n }\n if (type === \"choice\" || type === \"link\") {\n return (\n <select\n ref={focus}\n class={EDITOR}\n aria-label={column.header ?? column.key}\n onChange={draft}\n onFocusOut={() => this.commitEdit()}\n >\n <option value=\"\" selected={this.editing?.draft === \"\"} />\n <For each={column.choices ?? []}>\n {(choice, index) => (\n <option value={String(index())} selected={this.editing?.draft === String(index())}>\n {choice.text ?? TableSort.text(choice.value)}\n </option>\n )}\n </For>\n </select>\n )\n }\n return (\n <input\n ref={focus}\n class={EDITOR}\n type={type === \"number\" ? \"number\" : type === \"date\" ? \"date\" : \"text\"}\n value={this.editing?.draft ?? \"\"}\n aria-label={column.header ?? column.key}\n onInput={draft}\n onFocusOut={() => this.commitEdit()}\n />\n )\n }\n\n /** A click on an editable body cell (not its tick box or button): the cursor goes there. */\n @E.untracked\n private clickedCell(event: MouseEvent) {\n if (!this.isEditable) return\n const at = this.placeOf(event.target)\n if (!at || (event.target as Element).closest(`.${EDITOR}`)) return\n if (this.editing) this.commitEdit()\n this.cursor = at\n }\n\n /** A double click on an editable cell opens its editor. */\n @E.on(\"dblclick\")\n protected onDoubleClick(event: MouseEvent) {\n if (!this.isEditable) return\n const at = this.placeOf(event.target)\n if (at) this.startEdit(at)\n }\n\n /**\n * An editable table's key, if it's one: true when it took it.\n * - In an editor: Enter keeps it and goes down (Shift up), Tab keeps it and goes on, Escape puts it back.\n * - On a cell: arrows, Tab, Home / End move; Enter or F2 edit (Enter toggles a tick box, as Space does);\n * Delete or Backspace clears it, with ⌘ / Ctrl its row goes; any letter starts its editor with that letter.\n */\n @E.untracked\n private editingKey(event: KeyboardEvent): boolean {\n const target = event.target as Element\n if (target.closest?.(`.${EDITOR}`)) return this.editorKey(event)\n const at = this.placeOf(target)\n if (!at) return false\n const type = this.columnTypes[at.column] ?? \"text\"\n const isMod = event.metaKey || event.ctrlKey\n const move = MOVES[event.key]\n const take = () => {\n event.preventDefault()\n return true\n }\n if (move) {\n this.moveCursor(at, isMod ? { rows: move.rows * 9999, columns: move.columns * 9999 } : move)\n return take()\n }\n if (event.key === UIT.Key.tab) {\n this.moveCursor(at, { rows: 0, columns: event.shiftKey ? -1 : 1 }, \"wrap\")\n return take()\n }\n if (event.key === UIT.Key.home || event.key === UIT.Key.end) {\n const last = this.dataColumns.length - 1\n const column = event.key === UIT.Key.home ? 0 : last\n this.setCursor({ row: isMod ? (event.key === UIT.Key.home ? 0 : this.sortedRows.length) : at.row, column })\n return take()\n }\n if (type === \"yes-no\" && (event.key === UIT.Key.enter || event.key === UIT.Key.space)) {\n this.toggle(at, event)\n return take()\n }\n if (event.key === UIT.Key.enter || event.key === \"F2\") {\n this.startEdit(at)\n return take()\n }\n if (event.key === UIT.Key.delete || event.key === UIT.Key.backspace) {\n if (isMod) this.removeRow(at.row, event)\n else this.clearCell(at, event)\n return take()\n }\n if (event.key.length === 1 && !isMod && !event.altKey && type !== \"yes-no\") {\n this.startEdit(at, event.key)\n return take()\n }\n return false\n }\n\n /** A key in the open editor: see `editingKey()`. */\n private editorKey(event: KeyboardEvent): boolean {\n const at = this.editing?.at\n if (!at) return false\n if (event.key === UIT.Key.escape) {\n this.editing = undefined\n this.focusCursor()\n } else if (event.key === UIT.Key.enter) {\n this.commitEdit(event, { rows: event.shiftKey ? -1 : 1, columns: 0 })\n } else if (event.key === UIT.Key.tab) {\n this.commitEdit(event, { rows: 0, columns: event.shiftKey ? -1 : 1 }, \"wrap\")\n } else return false\n event.preventDefault()\n event.stopPropagation()\n return true\n }\n\n /** Open the editor of the cell at `at`, holding `typed` (a key pressed), else what the cell holds. */\n @E.untracked\n private startEdit(at: CellAt, typed?: string) {\n const column = this.dataColumns[at.column]\n if (!column || column.readOnly) return\n const type = this.columnTypes[at.column] ?? \"text\"\n if (type === \"yes-no\") return\n const draft = typed ?? TableEditing.draftFor(column, type, this.sortedRows[at.row]?.[column.key])\n this.cursor = at\n this.editing = { at, draft }\n }\n\n /**\n * Keep what the editor holds: a `set` of its row, or an `add` from the empty last row, if it changed anything.\n * - Then the cursor moves by `move`, or stays, focused.\n */\n @E.untracked\n private commitEdit(originalEvent?: Event, move?: CursorMove, wrap?: \"wrap\") {\n const editing = this.editing\n if (!editing) return\n this.editing = undefined\n const { at, draft } = editing\n const column = this.dataColumns[at.column]\n if (column) {\n const type = this.columnTypes[at.column] ?? \"text\"\n const row = this.sortedRows[at.row]\n const was = row?.[column.key]\n const value = TableEditing.valueFrom(column, type, draft, was)\n if (row && !TableEditing.isSame(value, was))\n this.sendEdits([{ kind: \"set\", row, key: column.key, value, was }], originalEvent)\n else if (!row && !TableEditing.isSame(value, undefined))\n this.sendEdits([{ kind: \"add\", values: { [column.key]: value } }], originalEvent)\n }\n if (move) this.moveCursor(at, move, wrap)\n else this.focusCursor()\n }\n\n /** Turn the tick box at `at` over. */\n @E.untracked\n private toggle(at: CellAt, originalEvent: Event) {\n const column = this.dataColumns[at.column]\n this.setCursor(at)\n if (!column || column.readOnly) return\n const row = this.sortedRows[at.row]\n if (row)\n this.sendEdits(\n [{ kind: \"set\", row, key: column.key, value: !row[column.key], was: row[column.key] }],\n originalEvent\n )\n else this.sendEdits([{ kind: \"add\", values: { [column.key]: true } }], originalEvent)\n }\n\n /** Empty the cell at `at`: a tick box unticked. */\n @E.untracked\n private clearCell(at: CellAt, originalEvent: Event) {\n const column = this.dataColumns[at.column]\n const row = this.sortedRows[at.row]\n if (!column || column.readOnly || !row) return\n const value = this.columnTypes[at.column] === \"yes-no\" ? false : undefined\n if (!TableEditing.isSame(value, row[column.key]))\n this.sendEdits([{ kind: \"set\", row, key: column.key, value, was: row[column.key] }], originalEvent)\n }\n\n /** Remove the row at `index` (as shown). */\n @E.untracked\n private removeRow(index: number, originalEvent: Event) {\n const row = this.sortedRows[index]\n if (row) this.sendEdits([{ kind: \"remove\", row }], originalEvent)\n }\n\n /** A pasted block of cells fills from the cursor, as one `ui-editing`. */\n @E.on(\"paste\")\n protected onPaste(event: ClipboardEvent) {\n if (!this.isEditable || this.editing) return\n const at = this.placeOf(event.target)\n const text = event.clipboardData?.getData(\"text/plain\")\n if (!at || !text) return\n event.preventDefault()\n const edits = TableEditing.pasteEdits({\n rows: this.sortedRows,\n columns: this.dataColumns,\n types: this.columnTypes,\n row: at.row,\n column: at.column,\n cells: TableEditing.cellsOf(text)\n })\n this.sendEdits(edits, event)\n }\n\n /**\n * Ask for `edits`: `ui-editing` first; not cancelled, the table shows them in new `rows`.\n * - Nothing to ask for: nothing sent.\n */\n @E.untracked\n private sendEdits(edits: readonly UIT.TableEdit[], originalEvent?: Event) {\n if (!edits.length) return\n const detail: UIT.TableEditDetail = { edits, originalEvent }\n if (this.send(\"ui-editing\", detail)) this.rows = TableEditing.applied(this.dataRows ?? [], edits)\n }\n\n /** Move the cursor from `at` by `move`, kept inside the table (the empty last row counts); `wrap`: Tab's way. */\n @E.untracked\n private moveCursor(at: CellAt, move: CursorMove, wrap?: \"wrap\") {\n const lastRow = this.sortedRows.length\n const lastColumn = this.dataColumns.length - 1\n let row = at.row + move.rows\n let column = at.column + move.columns\n if (wrap && column > lastColumn && row < lastRow) [row, column] = [row + 1, 0]\n if (wrap && column < 0 && row > 0) [row, column] = [row - 1, lastColumn]\n this.setCursor({ row: clamp(row, 0, lastRow), column: clamp(column, 0, lastColumn) })\n }\n\n /** Put the cursor at `at`, and focus its cell. */\n @E.untracked\n private setCursor(at: CellAt) {\n this.drawRow(at.row)\n this.cursor = at\n this.focusCursor()\n }\n\n /** Focus the cursor's cell, once it's drawn. */\n @E.untracked\n private focusCursor() {\n E.afterSolidUpdate(() => {\n const at = this.cursor\n if (at) this.cellAt(at)?.focus()\n })\n }\n\n ////////////////\n // ## The scroller\n ////////////////\n\n /** Shadow scroller's classes, e.g. `resizable short scrolling scroller`. */\n @E.derived\n get scrollerClasses(): string {\n return TableGrammar.scroller((name) => this.scrollerValue(name))\n }\n\n /** Scrolling or overflowing: the scroller's height is capped, and it scrolls. */\n get scrollerScrolls(): boolean {\n return TableGrammar.scrolls((name) => this.scrollerValue(name))\n }\n\n /** The scroller scrolls, either way: a focusable, named region. */\n get isScrollRegion(): boolean {\n return this.scrollerScrolls || this.isTooWide\n }\n\n /** The shadow scroller, once drawn (from its `ref`). */\n private scroller: HTMLDivElement | undefined\n\n /**\n * The table is wider than the scroller: it doesn't stack, and the scroller scrolls it sideways (`SIDEWAYS`).\n * - Measured (`onReadyToMeasure()`): whether a table stacks is the sheet's call\n * (viewport, its own width, tokens), so the width it ends up is the one fact to go on.\n */\n @E.state accessor isTooWide = false\n\n /**\n * SIDE EFFECT: follows the sizes of the scroller and the managed table, once drawn; the cleanup stops.\n * - Never on a server (an effect's apply): a static page's wide table spills, as before.\n */\n @E.onChange(\"isReady\", \"managedTable\")\n protected onReadyToMeasure(isReady: boolean, table: HTMLTableElement | undefined) {\n const box = this.scroller\n if (!isReady || !box) return\n const resizes = new ResizeObserver(() => this.measureWidth())\n resizes.observe(box)\n if (table) resizes.observe(table)\n this.measureWidth()\n return () => resizes.disconnect()\n }\n\n /** Is the table wider than the scroller? A pixel of slack: fractional widths round either way. */\n private measureWidth() {\n const box = this.scroller\n if (box) this.isTooWide = box.scrollWidth > box.clientWidth + 1\n }\n\n /**\n * Name of the scroller region: the DOM element's `aria-label`, else the table's `<caption>` text,\n * else the table's own `aria-label`, else the `label` text.\n * - Read in `render()`: the translated text needs the loaded runtime;\n * follows `tableRevision` (a new caption or `aria-label`).\n * - The table's own name before `label`: several tables on a page, each its own region, need names apart.\n */\n private get regionLabel(): string {\n void this.tableRevision\n const table = this.managedTable\n const caption = table?.caption?.textContent?.trim()\n return this.attributes[\"aria-label\"] ?? (caption || table?.ariaLabel || this.translationForKey(\"label\"))\n }\n\n // `attached` (any edge), `attached-top`, `attached-bottom`, from `attach`:\n // the DOM element carries the table's outer margin, so it mirrors the attached scroller's\n // (`UITable.css`: inside a size container a margin never collapses with the content above).\n\n /** Attached on any edge: `:state(attached)`. */\n @E.cssState(\"attached\")\n get isAttached(): boolean {\n return !!this.scrollerValue(ATTACH)\n }\n\n /** Attached at the top: `:state(attached-top)`. */\n @E.cssState(\"attached-top\")\n get isAttachedTop(): boolean {\n return this.scrollerValue(ATTACH) === UIT.TOP\n }\n\n /** Attached at the bottom: `:state(attached-bottom)`. */\n @E.cssState(\"attached-bottom\")\n get isAttachedBottom(): boolean {\n return this.scrollerValue(ATTACH) === UIT.BOTTOM\n }\n\n /** Converted value of scroller attribute `name` (`TableGrammar.scroller()`'s). */\n private scrollerValue(name: string): unknown {\n return this.classValue(name as E.AttributeName<typeof tableVocabulary>)\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UITable extends E.AttributeValues<typeof tableVocabulary> {}\n\n/** What `decorateHeaders()` decorates for. */\ntype HeaderSort = {\n /** the managed table (or, in rows mode, the DOM element), if any */\n table: Element | undefined\n /** `sortable` */\n isSortable: boolean\n /** sorted column, if any */\n column: number | undefined\n /** its direction, if any */\n direction: UIT.TableSortDirection | undefined\n}\n\n/** Tables the element rendered itself (data mode): never mistaken for an author's. */\nconst GENERATED = new WeakSet<HTMLTableElement>()\n\n/** Prefix of the class `stack-by` adds to the table: `stack-by-container`, `stack-by-viewport`. */\nconst STACK_BY_CLASS = \"stack-by-\"\n\n/** The scroller's class while the table is too wide for it (`isTooWide`): `UITable.css` scrolls it sideways. */\nconst SIDEWAYS = \"sideways\"\n\n/** The caption box's class. */\nconst CAPTION = \"caption\"\n\n/** The rows-mode grid's column count, on the scroller. */\nconst COLUMNS_TOKEN = \"--_table-columns\"\n\n/** Rows-mode attributes that move columns or headers: a row's `header` / `footer`, a cell's `span`. */\nconst ROW_ATTRIBUTES = [\"header\", \"footer\", \"span\"]\n\n/** A cell of an editable table, by its row (as shown; `sortedRows.length` is the empty last row) and column. */\ntype CellAt = {\n /** row, as shown */\n row: number\n /** column */\n column: number\n}\n\n/** The cell being edited, and its editor's text. */\ntype CellDraft = {\n /** where */\n at: CellAt\n /** what the editor holds: a choice's place in `choices` for a `choice` or `link` */\n draft: string\n}\n\n/** How far the cursor moves. */\ntype CursorMove = {\n /** rows down (negative: up) */\n rows: number\n /** columns on (negative: back) */\n columns: number\n}\n\n/** What `editableCell()` draws. */\ntype EditableCell = {\n /** the row; none in the empty last row */\n row: UIT.TableRow | undefined\n /** its place, as shown */\n rowIndex: () => number\n /** the column */\n column: UIT.TableColumn\n /** its place */\n columnIndex: () => number\n}\n\n/** The arrow keys' moves. */\nconst MOVES: Record<string, CursorMove | undefined> = {\n [UIT.Key.arrowUp]: { rows: -1, columns: 0 },\n [UIT.Key.arrowDown]: { rows: 1, columns: 0 },\n [UIT.Key.arrowLeft]: { rows: 0, columns: -1 },\n [UIT.Key.arrowRight]: { rows: 0, columns: 1 }\n}\n\n/** `n`, kept between `low` and `high`. */\nfunction clamp(n: number, low: number, high: number): number {\n return Math.max(low, Math.min(high, n))\n}\n\n/** An editable table's empty last row's class. */\nconst NEW_ROW = \"new-row\"\n/** A long table's spacer rows' class: standing in for the rows not drawn. */\nconst SPACER = \"spacer\"\n\n/** How many rows a body has before it's drawn in a window. */\nconst WINDOW_FROM = 200\n/** How many rows a window draws before it's measured. */\nconst WINDOW_FIRST_SIZE = 60\n/** How many rows a window draws above and below what's in view. */\nconst WINDOW_EXTRA = 15\n/** A row's height before one is measured, in pixels. */\nconst DEFAULT_ROW_PX = 32\n\n/** The cursor cell's class. */\nconst CURSOR = \"cursor\"\n\n/** A cell's editor's class. */\nconst EDITOR = \"cell-editor\"\n\n/** A `yes-no` cell's tick box's class. */\nconst TICK = \"cell-tick\"\n\n/** A row's delete button's class. */\nconst DELETE_ROW = \"delete-row\"\n","/**\n * The English vocabulary of `<ui-cell>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), slots, parts and states.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - A cell of a `<ui-row>` in a `<ui-table>` (epic `ui-gaps` P7): a table with no native `<table>`,\n * for a drawing, which holds no native HTML.\n * - Its look is the table's, from its class words (`celled`, `striped`, `padding` ...): no look of its own.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `cellVocabulary`\n * The names of `<ui-cell>`, one cell of a table row: its content, or a header.\n ****************/\nexport const cellVocabulary = {\n tag: \"ui-cell\",\n icon: \"square outline\",\n topics: [\"tables\", \"collections\"],\n aka: [\"table cell\", \"td\", \"th\", \"header cell\"],\n noun: \"cell\",\n description: \"A cell holds one value of a table row; a header cell names its column or row.\",\n attributes: [\n {\n name: \"header\",\n group: \"content\",\n kind: \"boolean\",\n description:\n \"A header cell: in a `header` row it names its column; in a body row, its row (the first cell, say).\"\n },\n {\n name: \"span\",\n group: \"layout\",\n kind: \"number\",\n description: \"How many columns it covers; default 1. Cells never span rows.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"textAlign\",\n values: \"alignments\",\n description: \"Aligns its text: `left`, `center`, `right` or `justified`.\"\n },\n {\n name: \"vertical-align\",\n group: \"layout\",\n kind: \"verticalAlign\",\n values: \"verticalAlignments\",\n description: \"Aligns its content to the `top`, `middle` or `bottom` of the row.\"\n }\n ],\n events: [],\n slots: [{ name: \"\", description: \"The cell's content: text, or any element.\" }],\n parts: [],\n states: [\n { name: \"header\", description: \"Set while it's a header cell (`header`).\" },\n { name: \"in-table\", description: \"Set while it's in a `<ui-table>`.\" }\n ],\n texts: []\n} as const satisfies E.ComponentVocabulary\n","import type { JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { cellVocabulary } from \"./UICell.en\"\nimport { TableRows } from \"./TableRows\"\n\n/****************\n * ### `UICell`\n * The component behind `<ui-cell>`: one cell of a `<ui-row>` in a `<ui-table>` (epic `ui-gaps` P7).\n *\n * - The shadow root is a bare slot: the DOM element IS the cell box, an item of its row's grid.\n * - Its look is the table's PAGE sheet's (`UITable.css`, \"Rows and cells\"), from the table's class words.\n * - ARIA, from where it sits:\n * - `columnheader`: a `header` cell in a `header` row\n * - `rowheader`: a `header` cell in a body row\n * - `cell`: any other cell of a table; nothing outside one\n * - `span` sets `aria-colspan` too\n * - Its own layout (`span`, `align`, `vertical-align`) is a `:host` rule of its own (`hostLayout`),\n * so the page's own `style` stays the author's.\n * - Which table it's in: its OWNER (`PartContext`), climbing through its row (a part too).\n ****************/\nexport class UICell extends E.UIComponent<typeof cellVocabulary> {\n @E.proto static vocabulary = cellVocabulary\n @E.protoMerged static elementSetup = {\n isAPart: true,\n delegatesFocus: false,\n cssStates: [\"header\"]\n } satisfies Partial<E.ElementSetup>\n\n /** The table it's a cell of, if any: `:state(in-table)` follows it. */\n readonly context = new E.PartContext({ domElement: this.domElement, noun: this.vocabulary.noun })\n\n /** In a `<ui-table>`. */\n get isInTable(): boolean {\n return this.context.owner?.ownerNoun === TABLE\n }\n\n /** Columns it covers: `span`, a whole number, at least 1, as its table counts it (`TableRows.spanOf()`). */\n get columnSpan(): number {\n return TableRows.spanOf(this.span)\n }\n\n /**\n * ARIA role, from where it sits (the class docstring).\n * - Reads its row once per owner change: a row turning into a header row later keeps its cells' roles\n * until they move.\n */\n @E.aria(\"role\")\n get ariaRole(): string | undefined {\n if (!this.isInTable) return undefined\n if (!this.header) return \"cell\"\n const row = this.domElement.parentElement as E.DOMElement | null\n return row?.valueNamed?.(HEADER) ? \"columnheader\" : \"rowheader\"\n }\n\n /** `aria-colspan`, while it spans. */\n @E.aria(\"colSpan\")\n get ariaColumnSpan(): string | undefined {\n return this.isInTable && this.columnSpan > 1 ? String(this.columnSpan) : undefined\n }\n\n /** Its own `:host` layout: the columns it spans, its alignment. */\n @E.derived\n protected get hostLayout(): string {\n const rules = [`grid-column: span ${this.columnSpan}`]\n const align = this.align === \"justified\" ? \"justify\" : this.align\n if (align) rules.push(`text-align: ${align}`)\n const vertical = this.verticalAlign\n if (vertical) rules.push(`align-self: ${VERTICAL[vertical as keyof typeof VERTICAL] ?? \"stretch\"}`)\n return rules.join(\"; \")\n }\n\n render(): JSX.Element {\n return <slot />\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UICell extends E.AttributeValues<typeof cellVocabulary> {}\n\n/** The owner noun of a table cell: `<ui-table>`'s. */\nconst TABLE = \"table\"\n\n/** A row's `header` attribute, by its canonical name. */\nconst HEADER = \"header\"\n\n/** `vertical-align` => the cell box's `align-self` in its row. */\nconst VERTICAL = { top: \"start\", middle: \"center\", bottom: \"end\" } as const\n","/**\n * The table family: defines `<ui-table>` and `<ui-cell>`, and exports their components, `UITable` and `UICell`.\n * - `<ui-row>` is the grid family's: in a table it's a table row (epic `ui-gaps` P7).\n * - SIDE EFFECT: importing it defines the tag.\n * - Also the library's `spell/ui/ui-table` entry (its size is in `notes/report.md`).\n * - NOTE: `TableClassMirror`, `TableGrammar`, `TableRows` and `TableSort` are internal helpers, not exported.\n */\n\nimport { UITable } from \"./UITable\"\nimport { UICell } from \"./UICell\"\n// a rows-mode table's rows: the grid family's `<ui-row>` (SIDE EFFECT: defines the grid's tags)\nimport \"spell/ui/components/ui-grid\"\n\nUITable.define()\nUICell.define()\n\nexport { UITable, UICell }\n"],"mappings":";;;;;;AAsBA,IAAa0H,KAAkB;CAC7B,KAAK;CACL,MAAM;CACN,QAAQ;EAAC;EAAU;EAAgB;EAAS;CAAa;CACzD,KAAK;EAAC;EA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