@esri/calcite-components 5.2.0-next.14 → 5.2.0-next.16

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 (166) hide show
  1. package/dist/cdn/{WFM52MRQ.js → 23CKFJJ3.js} +1 -1
  2. package/dist/cdn/{7PO443AZ.js → 25ZVWCQX.js} +1 -1
  3. package/dist/cdn/{QR2CY34G.js → 2BPEKIT3.js} +1 -1
  4. package/dist/cdn/{D4VDP2CJ.js → 2YBRZFRA.js} +1 -1
  5. package/dist/cdn/{OV7EBZPB.js → 34JHLJ3H.js} +1 -1
  6. package/dist/cdn/{LK3625ZO.js → 3I5BTEEC.js} +1 -1
  7. package/dist/cdn/{LJPWEOCO.js → 3N5FOQAL.js} +1 -1
  8. package/dist/cdn/{QCZA4MJZ.js → 3U4ZWJVW.js} +1 -1
  9. package/dist/cdn/{I2H4WGUS.js → 44MSN4BY.js} +1 -1
  10. package/dist/cdn/{PTH7GUAT.js → 44P2MJGD.js} +1 -1
  11. package/dist/cdn/{HLQVOOYB.js → 4EHBKF47.js} +1 -1
  12. package/dist/cdn/{XHRQMRVG.js → 4GEVIBLZ.js} +1 -1
  13. package/dist/cdn/{SDDCAWLS.js → 4IFN3JAF.js} +1 -1
  14. package/dist/cdn/{Q7WHVLIS.js → 4IMOW4XR.js} +1 -1
  15. package/dist/cdn/{6Q4TUT5Y.js → 4NVF6ZE7.js} +1 -1
  16. package/dist/cdn/{JBDHPNDM.js → 4TIEXZFH.js} +1 -1
  17. package/dist/cdn/{6HSIDCQD.js → 5R66KNRS.js} +1 -1
  18. package/dist/cdn/{KSKQOJZX.js → 5RU4WRDH.js} +1 -1
  19. package/dist/cdn/{RLE74BGN.js → 5UODEL4J.js} +1 -1
  20. package/dist/cdn/{ZNGJAGTZ.js → 62H6YWOD.js} +1 -1
  21. package/dist/cdn/{TMRLVWBO.js → 667BX6C2.js} +1 -1
  22. package/dist/cdn/{CR7M7KVL.js → 67UZPLTH.js} +1 -1
  23. package/dist/cdn/{HG5J2NEG.js → 6AK6KZDQ.js} +1 -1
  24. package/dist/cdn/{PGUXZOTZ.js → 6MFBNGHM.js} +1 -1
  25. package/dist/cdn/{A6VJGLSS.js → 6OZPUPKW.js} +1 -1
  26. package/dist/cdn/{P6DSHT3Y.js → 6P5O53FC.js} +1 -1
  27. package/dist/cdn/{D6XD3BXF.js → 6UUG7BR5.js} +1 -1
  28. package/dist/cdn/{ABMJH33P.js → 743PCCPR.js} +1 -1
  29. package/dist/cdn/{44HY2CJ4.js → 7KHQNJUK.js} +1 -1
  30. package/dist/cdn/{7WTBOSC5.js → 7NECG5PK.js} +1 -1
  31. package/dist/cdn/{UFW5G6ZY.js → 7TXXRTD6.js} +1 -1
  32. package/dist/cdn/{WCEPBGPF.js → ADXJH4JG.js} +1 -1
  33. package/dist/cdn/{IUW6CWCX.js → AOXRDXK3.js} +1 -1
  34. package/dist/cdn/{U4TZRIC5.js → B2ORCPWA.js} +1 -1
  35. package/dist/cdn/{FEJS343B.js → B2Z2OFXW.js} +1 -1
  36. package/dist/cdn/{PWGR5AJD.js → B3QZ2XNQ.js} +1 -1
  37. package/dist/cdn/{B3FIO2DT.js → B3UUKGE4.js} +1 -1
  38. package/dist/cdn/{3AKE4BCT.js → B5Q7JLP5.js} +1 -1
  39. package/dist/cdn/{W7AGRLRI.js → B6AJO7QQ.js} +1 -1
  40. package/dist/cdn/{LS43N4RX.js → BCQDFCKN.js} +1 -1
  41. package/dist/cdn/{ZGO66DGC.js → BKBRE6BE.js} +1 -1
  42. package/dist/cdn/{H4VRREJL.js → BLVQHZ6I.js} +1 -1
  43. package/dist/cdn/{MXTIZU2R.js → BQLQFRQU.js} +1 -1
  44. package/dist/cdn/{6CTVP6XP.js → BWYJRS53.js} +1 -1
  45. package/dist/cdn/{GJNU6EMY.js → CMSVRAIL.js} +1 -1
  46. package/dist/cdn/{C7EIL5WB.js → CULRGSU4.js} +1 -1
  47. package/dist/cdn/{JVKBC3XX.js → D2HKARC2.js} +1 -1
  48. package/dist/cdn/{ORAHJ4QI.js → D52NOMC4.js} +1 -1
  49. package/dist/cdn/{I3NOTK5S.js → D7VHKSBM.js} +1 -1
  50. package/dist/cdn/{NGE5JQLU.js → DEJB6LKH.js} +1 -1
  51. package/dist/cdn/{6D5AK4GJ.js → E622Q2TQ.js} +1 -1
  52. package/dist/cdn/{GWXFMOCL.js → E7IC4K6C.js} +1 -1
  53. package/dist/cdn/{4MGG67YX.js → EZQKTHH3.js} +1 -1
  54. package/dist/cdn/{QSPWWIIZ.js → F5OYYX7P.js} +1 -1
  55. package/dist/cdn/{Y3FAB6G2.js → FNJIBEB2.js} +1 -1
  56. package/dist/cdn/{6Q33X7P4.js → FP434YLN.js} +1 -1
  57. package/dist/cdn/{545MJ5AY.js → FQ6VKBCC.js} +1 -1
  58. package/dist/cdn/{4EC2NTV4.js → G6FR4KMK.js} +1 -1
  59. package/dist/cdn/{QZSPTHHD.js → GW747T3W.js} +1 -1
  60. package/dist/cdn/{3UXDKWOB.js → GWUTSOHK.js} +1 -1
  61. package/dist/cdn/{HLJQDLHI.js → H37WKFXM.js} +1 -1
  62. package/dist/cdn/{WVZMOFAQ.js → H4L4EHB2.js} +1 -1
  63. package/dist/cdn/{EQWEKQDO.js → H5TXFZSO.js} +1 -1
  64. package/dist/cdn/{BVYG6VVD.js → H7AVJRRT.js} +1 -1
  65. package/dist/cdn/{OECHJXEQ.js → HA3LHNRC.js} +1 -1
  66. package/dist/cdn/{ZQW5EHUD.js → HHWIABV7.js} +1 -1
  67. package/dist/cdn/{66FRAAIX.js → HLSREAGB.js} +1 -1
  68. package/dist/cdn/{FZ53VYVY.js → HXJ3PWDD.js} +1 -1
  69. package/dist/cdn/{GS5ZCHGY.js → IEV3ZJGY.js} +1 -1
  70. package/dist/cdn/{G5FIT3VP.js → IK2ZWLKD.js} +1 -1
  71. package/dist/cdn/{VH5BZDLX.js → IMNESPYO.js} +1 -1
  72. package/dist/cdn/{AVV4E53Z.js → IWV3N5DN.js} +1 -1
  73. package/dist/cdn/{UBTLX7CK.js → JSWUC46W.js} +1 -1
  74. package/dist/cdn/{2RQWAUJS.js → JTOHCGX2.js} +1 -1
  75. package/dist/cdn/{EEUC3KBF.js → KG6IVYF4.js} +1 -1
  76. package/dist/cdn/{UZZGN37F.js → KNTHSCWX.js} +1 -1
  77. package/dist/cdn/{XZEWXNBK.js → KSGT4GRV.js} +1 -1
  78. package/dist/cdn/{SXMZWDUQ.js → KVCFGTZC.js} +1 -1
  79. package/dist/cdn/{MSAH5RX3.js → LDIOQBSI.js} +1 -1
  80. package/dist/cdn/{EH3ZS3AI.js → LF6MQ6HF.js} +1 -1
  81. package/dist/cdn/{UVGPW4FV.js → LHPCIKUI.js} +1 -1
  82. package/dist/cdn/{SYSWISF6.js → LMNS42HV.js} +1 -1
  83. package/dist/cdn/{V3VTO2ZZ.js → MDEHQJED.js} +1 -1
  84. package/dist/cdn/{DWAZPL2W.js → MDWQVFCB.js} +1 -1
  85. package/dist/cdn/{SCWTJCNK.js → MGSMKR2I.js} +1 -1
  86. package/dist/cdn/{LNQK4SQB.js → MPBEGHZK.js} +1 -1
  87. package/dist/cdn/{BL5X256T.js → MZ7UQKEU.js} +1 -1
  88. package/dist/cdn/{4GDHH5DV.js → NMTRXY5U.js} +1 -1
  89. package/dist/cdn/NR7I7ABN.js +2 -0
  90. package/dist/cdn/{KD7UHFNY.js → NRGZYLHS.js} +1 -1
  91. package/dist/cdn/{3NCFJD25.js → NVMXMJKA.js} +1 -1
  92. package/dist/cdn/{Z7GJKEIA.js → NY44QG3Z.js} +1 -1
  93. package/dist/cdn/{3PLEDPR4.js → OD4W6GP7.js} +1 -1
  94. package/dist/cdn/{A56N4SUK.js → OZWW4O5S.js} +1 -1
  95. package/dist/cdn/{G37Q6LNH.js → PBNAZWZY.js} +1 -1
  96. package/dist/cdn/{YJLCYJ2M.js → PDEJLZ3D.js} +1 -1
  97. package/dist/cdn/{EO5N74I3.js → PQYNJXHD.js} +1 -1
  98. package/dist/cdn/{KCTZSNBT.js → Q4ZZN7TG.js} +1 -1
  99. package/dist/cdn/{4HIEDMZD.js → Q54HXE6A.js} +1 -1
  100. package/dist/cdn/{G7GLZIL5.js → Q7GAT2DB.js} +1 -1
  101. package/dist/cdn/{HJSWKTWW.js → QDCCLW4T.js} +1 -1
  102. package/dist/cdn/{UT3IREUB.js → QLNZXK7M.js} +1 -1
  103. package/dist/cdn/{BSF3NY4V.js → QQEZNIQC.js} +1 -1
  104. package/dist/cdn/{OUSNZRJZ.js → QZUGIHZN.js} +1 -1
  105. package/dist/cdn/{FEJWDUDH.js → RF7K7DTZ.js} +1 -1
  106. package/dist/cdn/{SOHXC2HB.js → RJUGARBU.js} +1 -1
  107. package/dist/cdn/{B66XEYW2.js → RZULQ2JP.js} +1 -1
  108. package/dist/cdn/{QWBN3AWD.js → SBGFZIL5.js} +1 -1
  109. package/dist/cdn/{YS6CLONR.js → SDUVQU3B.js} +1 -1
  110. package/dist/cdn/{6JHWUVP4.js → SHDZO7WL.js} +1 -1
  111. package/dist/cdn/{MMNBD7LM.js → SI2JU5OQ.js} +1 -1
  112. package/dist/cdn/{ZF6T2CLM.js → TQ3C46K7.js} +1 -1
  113. package/dist/cdn/{UVD3MS5W.js → TQOSF3DK.js} +1 -1
  114. package/dist/cdn/{OODIPTDH.js → TR56RG7Q.js} +1 -1
  115. package/dist/cdn/{X6Q5JZBS.js → TTNGUCIA.js} +1 -1
  116. package/dist/cdn/{A5XTOCVX.js → TVX7XVJC.js} +1 -1
  117. package/dist/cdn/{VP3UYOHO.js → UFJCW5EG.js} +1 -1
  118. package/dist/cdn/{3CJCDXXM.js → UHDMAQIY.js} +1 -1
  119. package/dist/cdn/{H7EDS3CQ.js → UI2Y2KED.js} +1 -1
  120. package/dist/cdn/{7WMROAW4.js → UJXHOMUC.js} +1 -1
  121. package/dist/cdn/{7D4K4QDI.js → UTSULH62.js} +1 -1
  122. package/dist/cdn/{TEIBL22G.js → VRNR72VI.js} +1 -1
  123. package/dist/cdn/{PN5LDURO.js → W5QIPFSJ.js} +1 -1
  124. package/dist/cdn/{TS6R5IK4.js → WHGBMNS4.js} +1 -1
  125. package/dist/cdn/{GCB2FLDV.js → WL2UZNLW.js} +1 -1
  126. package/dist/cdn/{OAOMEBGK.js → X3TBQXF6.js} +1 -1
  127. package/dist/cdn/{LURVUV4O.js → XJMNQRUJ.js} +1 -1
  128. package/dist/cdn/{MVJAI5VF.js → XLHTNALK.js} +1 -1
  129. package/dist/cdn/{ZU6KB5AC.js → XVNOPWL3.js} +1 -1
  130. package/dist/cdn/{EXV5UE47.js → Y5JJBAGO.js} +1 -1
  131. package/dist/cdn/{JVDVZORD.js → Y6JHEDKL.js} +1 -1
  132. package/dist/cdn/{6YLJ3NL4.js → YFT3HJ6C.js} +1 -1
  133. package/dist/cdn/{RPIHDJF2.js → YGO2VHM5.js} +1 -1
  134. package/dist/cdn/YPCHV7D7.js +2 -0
  135. package/dist/cdn/{LAH33JTG.js → Z3VY5WT2.js} +1 -1
  136. package/dist/cdn/{R5LGIEUS.js → Z5X6I2G7.js} +1 -1
  137. package/dist/cdn/{K76VTOP3.js → ZD7I7RV6.js} +1 -1
  138. package/dist/cdn/{GDP3QRZQ.js → ZFHW7RUW.js} +1 -1
  139. package/dist/cdn/{33AXJNE7.js → ZHNSJJ4O.js} +1 -1
  140. package/dist/cdn/ZOAYIZNY.js +2 -0
  141. package/dist/cdn/{4VDL3UOJ.js → ZS6DTRJ2.js} +1 -1
  142. package/dist/cdn/{4363MSYP.js → ZSX6UO57.js} +1 -1
  143. package/dist/cdn/ZT2T23RU.js +2 -0
  144. package/dist/cdn/{B64URJTB.js → ZUIIHKJP.js} +1 -1
  145. package/dist/cdn/index.js +1 -1
  146. package/dist/chunks/runtime.js +4 -4
  147. package/dist/components/calcite-combobox/customElement.js +1 -1
  148. package/dist/components/calcite-table/customElement.d.ts +6 -0
  149. package/dist/components/calcite-table/customElement.js +80 -5
  150. package/dist/components/calcite-table-cell/customElement.js +3 -2
  151. package/dist/components/calcite-table-header/customElement.js +1 -1
  152. package/dist/components/calcite-table-row/customElement.js +26 -15
  153. package/dist/docs/api.json +1 -1
  154. package/dist/docs/docs.json +1 -1
  155. package/dist/docs/vscode.html-custom-data.json +1 -1
  156. package/dist/docs/web-types.json +1 -1
  157. package/dist/loader.js +3 -3
  158. package/dist/types/lumina.d.ts +1 -1
  159. package/dist/types/preact.d.ts +1 -1
  160. package/dist/types/react.d.ts +1 -1
  161. package/dist/types/stencil.d.ts +1 -1
  162. package/package.json +2 -2
  163. package/dist/cdn/KBUGK427.js +0 -2
  164. package/dist/cdn/PZX674UB.js +0 -2
  165. package/dist/cdn/TEGKCRK6.js +0 -2
  166. package/dist/cdn/TNG5UZWM.js +0 -2
@@ -6,6 +6,7 @@ import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
6
6
  import { n as numberStringFormatter } from "../../chunks/locale.js";
7
7
  import { u as useT9n } from "../../chunks/useT9n.js";
8
8
  import { i as isHidden } from "../../chunks/component.js";
9
+ import { c as createObserver } from "../../chunks/observers.js";
9
10
  function getUserAgentData() {
10
11
  return navigator.userAgentData;
11
12
  }
@@ -23,6 +24,7 @@ const CSS = {
23
24
  paginationArea: "pagination-area",
24
25
  container: "container",
25
26
  tableContainer: "table-container",
27
+ tableContainerOverflow: "table-container--overflow",
26
28
  tableFixed: "table--fixed",
27
29
  assistiveText: "assistive-text",
28
30
  selectionActions: "selection-actions",
@@ -40,7 +42,7 @@ const ICONS = {
40
42
  hideEmpty: "hide-empty",
41
43
  clear: "x"
42
44
  };
43
- const styles = css`@charset "UTF-8";:host([scale=s]){--calcite-internal-table-cell-padding: .25rem;--calcite-internal-table-cell-font-size: var(--calcite-font-size--2);--calcite-internal-table-cell-font-size-secondary: var(--calcite-font-size--3)}:host([scale=m]){--calcite-internal-table-cell-padding: .5rem;--calcite-internal-table-cell-font-size: var(--calcite-font-size--1);--calcite-internal-table-cell-font-size-secondary: var(--calcite-font-size--2)}:host(:is([scale=s],[scale=m])){--calcite-internal-table-selection-action-spacing: var(--calcite-spacing-xxs)}:host([scale=l]){--calcite-internal-table-selection-action-spacing: var(--calcite-spacing-xs);--calcite-internal-table-cell-padding: 1rem;--calcite-internal-table-cell-font-size: var(--calcite-font-size-0);--calcite-internal-table-cell-font-size-secondary: var(--calcite-font-size--1)}:host{display:flex}.container{display:flex;flex-direction:column;inline-size:var(--calcite-container-size-content-fluid);block-size:var(--calcite-container-size-content-fluid)}.table-container{overflow:auto;white-space:nowrap;line-height:var(--calcite-font-line-height-relative-tight);border:var(--calcite-border-width-sm) solid var(--calcite-table-border-color, var(--calcite-color-border-2));border-radius:var(--calcite-table-corner-radius, var(--calcite-corner-radius-sharp));box-shadow:var(--calcite-table-shadow, var(--calcite-shadow-none))}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}table{border-collapse:collapse;overflow-x:scroll;inline-size:var(--calcite-container-size-content-fluid)}@-moz-document url-prefix(){table{border-collapse:separate;border-spacing:0}}.table--fixed{table-layout:fixed}.bordered ::slotted(calcite-table-row){--calcite-table-row-border-color: var(--calcite-table-border-color, var(--calcite-color-border-2))}.striped ::slotted(calcite-table-row:nth-child(2n+1)){--calcite-table-row-background-color: var( --calcite-table-row-background-color-striped, var(--calcite-color-foreground-2) )}.selection-actions{display:flex;flex-direction:row;gap:var(--calcite-internal-table-selection-action-spacing);margin-inline-start:auto}.selection-area{display:flex;flex-direction:row;align-items:center;padding-block:var(--calcite-internal-table-cell-padding)}.selection-area calcite-chip:last-of-type{margin-inline-end:.5rem}.selection-area calcite-chip:last-of-type:not(:first-of-type){margin-inline-start:.5rem}.selection-area calcite-button{margin-inline-end:1rem}.selection-chip{--calcite-chip-background-color: var(--calcite-table-selection-chip-background-color);--calcite-chip-border-color: var(--calcite-table-selection-chip-border-color);--calcite-chip-corner-radius: var(--calcite-table-selection-chip-corner-radius);--calcite-chip-shadow: var(--calcite-table-selection-chip-shadow);--calcite-chip-text-color: var(--calcite-table-selection-chip-text-color)}.selection-chip.selection-chip--active{--calcite-chip-background-color: var(--calcite-table-selection-chip-background-color-selected);--calcite-chip-border-color: var(--calcite-table-selection-chip-border-color-selected);--calcite-chip-text-color: var(--calcite-table-selection-chip-text-color-selected)}.selection-chip--out-of-view{--calcite-chip-background-color: var(--calcite-table-selection-out-of-view-chip-background-color);--calcite-chip-border-color: var(--calcite-table-selection-out-of-view-chip-border-color);--calcite-chip-corner-radius: var(--calcite-table-selection-out-of-view-chip-corner-radius);--calcite-chip-shadow: var(--calcite-table-selection-out-of-view-chip-shadow);--calcite-chip-text-color: var(--calcite-table-selection-out-of-view-chip-text-color);--calcite-chip-icon-color: var(--calcite-table-selection-out-of-view-chip-icon-color)}.pagination-area{display:flex;inline-size:100%;flex-direction:row;justify-content:center;padding-block:var(--calcite-internal-table-cell-padding)}calcite-pagination{flex:1;justify-content:center;--calcite-pagination-color: var(--calcite-table-pagination-color);--calcite-pagination-color-hover: var(--calcite-table-pagination-color-hover);--calcite-pagination-color-border-hover: var(--calcite-table-pagination-color-border-hover);--calcite-pagination-color-border-active: var(--calcite-table-pagination-color-border-active);--calcite-pagination-background-color: var(--calcite-table-pagination-background-color);--calcite-pagination-icon-color-background-hover: var(--calcite-table-pagination-icon-color-background-hover)}.dismiss-button{margin-inline-end:1rem;--calcite-button-background-color: var(--calcite-table-selection-dismiss-button-background-color);--calcite-button-border-color: var(--calcite-table-selection-dismiss-button-border-color);--calcite-button-corner-radius: var(--calcite-table-selection-dismiss-button-corner-radius);--calcite-button-shadow: var(--calcite-table-selection-dismiss-button-shadow);--calcite-button-text-color: var(--calcite-table-selection-dismiss-button-text-color)}.dismiss-button:hover{--calcite-button-background-color: var(--calcite-table-selection-dismiss-button-background-color-hover);--calcite-button-border-color: var(--calcite-table-selection-dismiss-button-border-color-hover);--calcite-button-text-color: var(--calcite-table-selection-dismiss-button-text-color-hover)}.dismiss-button:active{--calcite-button-background-color: var(--calcite-table-selection-dismiss-button-background-color-active);--calcite-button-border-color: var(--calcite-table-selection-dismiss-button-border-color-active);--calcite-button-text-color: var(--calcite-table-selection-dismiss-button-text-color-active)}:host([hidden]){display:none}[hidden]{display:none}`;
45
+ const styles = css`@charset "UTF-8";:host{display:flex;--calcite-internal-table-border-collapse: collapse}:host([scale=s]){--calcite-internal-table-cell-padding: .25rem;--calcite-internal-table-cell-font-size: var(--calcite-font-size--2);--calcite-internal-table-cell-font-size-secondary: var(--calcite-font-size--3)}:host([scale=m]){--calcite-internal-table-cell-padding: .5rem;--calcite-internal-table-cell-font-size: var(--calcite-font-size--1);--calcite-internal-table-cell-font-size-secondary: var(--calcite-font-size--2)}:host(:is([scale=s],[scale=m])){--calcite-internal-table-selection-action-spacing: var(--calcite-spacing-xxs)}:host([scale=l]){--calcite-internal-table-selection-action-spacing: var(--calcite-spacing-xs);--calcite-internal-table-cell-padding: 1rem;--calcite-internal-table-cell-font-size: var(--calcite-font-size-0);--calcite-internal-table-cell-font-size-secondary: var(--calcite-font-size--1)}:host([sticky-header]){--calcite-internal-table-border-collapse: separate;--calcite-internal-table-header-border-block-end-width: 0;--calcite-internal-table-sticky-header-border-shadow: inset 0 calc(-1 * var(--calcite-border-width-sm)) 0 0 var(--calcite-table-header-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)))}:host([sticky-header]) .table-container{position:relative}.container{display:flex;flex-direction:column;inline-size:var(--calcite-container-size-content-fluid);block-size:var(--calcite-container-size-content-fluid)}.table-container{white-space:nowrap;line-height:var(--calcite-font-line-height-relative-tight);border:var(--calcite-border-width-sm) solid var(--calcite-table-border-color, var(--calcite-color-border-2));border-radius:var(--calcite-table-corner-radius, var(--calcite-corner-radius-sharp));box-shadow:var(--calcite-table-shadow, var(--calcite-shadow-none));overflow:auto}.table-container--overflow{overscroll-behavior-y:none}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}table{border-collapse:var(--calcite-internal-table-border-collapse);border-spacing:0;inline-size:var(--calcite-container-size-content-fluid)}@-moz-document url-prefix(){table{border-collapse:separate;border-spacing:0}}.table--fixed{table-layout:fixed}.bordered ::slotted(calcite-table-row){--calcite-table-row-border-color: var(--calcite-table-border-color, var(--calcite-color-border-2))}.striped ::slotted(calcite-table-row:nth-child(2n+1)){--calcite-table-row-background-color: var( --calcite-table-row-background-color-striped, var(--calcite-color-foreground-2) )}.selection-actions{display:flex;flex-direction:row;gap:var(--calcite-internal-table-selection-action-spacing);margin-inline-start:auto}.selection-area{display:flex;flex-direction:row;align-items:center;padding-block:var(--calcite-internal-table-cell-padding)}.selection-area calcite-chip:last-of-type{margin-inline-end:.5rem}.selection-area calcite-chip:last-of-type:not(:first-of-type){margin-inline-start:.5rem}.selection-area calcite-button{margin-inline-end:1rem}.selection-chip{--calcite-chip-background-color: var(--calcite-table-selection-chip-background-color);--calcite-chip-border-color: var(--calcite-table-selection-chip-border-color);--calcite-chip-corner-radius: var(--calcite-table-selection-chip-corner-radius);--calcite-chip-shadow: var(--calcite-table-selection-chip-shadow);--calcite-chip-text-color: var(--calcite-table-selection-chip-text-color)}.selection-chip.selection-chip--active{--calcite-chip-background-color: var(--calcite-table-selection-chip-background-color-selected);--calcite-chip-border-color: var(--calcite-table-selection-chip-border-color-selected);--calcite-chip-text-color: var(--calcite-table-selection-chip-text-color-selected)}.selection-chip--out-of-view{--calcite-chip-background-color: var(--calcite-table-selection-out-of-view-chip-background-color);--calcite-chip-border-color: var(--calcite-table-selection-out-of-view-chip-border-color);--calcite-chip-corner-radius: var(--calcite-table-selection-out-of-view-chip-corner-radius);--calcite-chip-shadow: var(--calcite-table-selection-out-of-view-chip-shadow);--calcite-chip-text-color: var(--calcite-table-selection-out-of-view-chip-text-color);--calcite-chip-icon-color: var(--calcite-table-selection-out-of-view-chip-icon-color)}.pagination-area{display:flex;inline-size:100%;flex-direction:row;justify-content:center;padding-block:var(--calcite-internal-table-cell-padding)}calcite-pagination{flex:1;justify-content:center;--calcite-pagination-color: var(--calcite-table-pagination-color);--calcite-pagination-color-hover: var(--calcite-table-pagination-color-hover);--calcite-pagination-color-border-hover: var(--calcite-table-pagination-color-border-hover);--calcite-pagination-color-border-active: var(--calcite-table-pagination-color-border-active);--calcite-pagination-background-color: var(--calcite-table-pagination-background-color);--calcite-pagination-icon-color-background-hover: var(--calcite-table-pagination-icon-color-background-hover)}.dismiss-button{margin-inline-end:1rem;--calcite-button-background-color: var(--calcite-table-selection-dismiss-button-background-color);--calcite-button-border-color: var(--calcite-table-selection-dismiss-button-border-color);--calcite-button-corner-radius: var(--calcite-table-selection-dismiss-button-corner-radius);--calcite-button-shadow: var(--calcite-table-selection-dismiss-button-shadow);--calcite-button-text-color: var(--calcite-table-selection-dismiss-button-text-color)}.dismiss-button:hover{--calcite-button-background-color: var(--calcite-table-selection-dismiss-button-background-color-hover);--calcite-button-border-color: var(--calcite-table-selection-dismiss-button-border-color-hover);--calcite-button-text-color: var(--calcite-table-selection-dismiss-button-text-color-hover)}.dismiss-button:active{--calcite-button-background-color: var(--calcite-table-selection-dismiss-button-background-color-active);--calcite-button-border-color: var(--calcite-table-selection-dismiss-button-border-color-active);--calcite-button-text-color: var(--calcite-table-selection-dismiss-button-text-color-active)}:host([hidden]){display:none}[hidden]{display:none}`;
44
46
  class Table extends LitElement {
45
47
  constructor() {
46
48
  super();
@@ -49,14 +51,19 @@ class Table extends LitElement {
49
51
  this.footRows = [];
50
52
  this.headRows = [];
51
53
  this.paginationRef = createRef();
54
+ this.tableContainerRef = createRef();
55
+ this.tableEl = null;
52
56
  this.tableBodySlotRef = createRef();
53
57
  this.tableFootSlotRef = createRef();
54
58
  this.tableHeadSlotRef = createRef();
59
+ this.tableContainerOverflowAnimationFrame = null;
60
+ this.tableContainerResizeObserver = createObserver("resize", () => this.scheduleTableContainerOverflowUpdate());
55
61
  this.messages = useT9n({ blocking: true });
56
62
  this.colCount = 0;
57
63
  this.pageStartRow = 1;
58
64
  this.readCellContentsToAT = false;
59
65
  this.selectedCount = 0;
66
+ this.tableContainerHasOverflow = false;
60
67
  this._selectedItems = [];
61
68
  this.bordered = false;
62
69
  this.currentPage = 0;
@@ -69,6 +76,7 @@ class Table extends LitElement {
69
76
  this.selectionDisplay = "top";
70
77
  this.selectionMode = "none";
71
78
  this.striped = false;
79
+ this.stickyHeader = false;
72
80
  this.calciteInternalTableRowFocusChange = createEvent({ cancelable: false });
73
81
  this.calciteTablePageChange = createEvent({ cancelable: false });
74
82
  this.calciteTableSelect = createEvent({ cancelable: false });
@@ -77,7 +85,7 @@ class Table extends LitElement {
77
85
  this.listen("calciteInternalTableRowFocusRequest", this.calciteInternalTableRowFocusEvent);
78
86
  }
79
87
  static {
80
- this.properties = { colCount: [16, {}, { state: true }], pageStartRow: [16, {}, { state: true }], readCellContentsToAT: [16, {}, { state: true }], selectedCount: [16, {}, { state: true }], _selectedItems: [16, {}, { state: true }], bordered: [7, {}, { reflect: true, type: Boolean }], caption: 1, currentPage: [11, {}, { reflect: true, type: Number }], groupSeparator: [7, {}, { reflect: true, type: Boolean }], interactionMode: [3, {}, { reflect: true }], layout: [3, {}, { reflect: true }], messageOverrides: [0, {}, { attribute: false }], numbered: [7, {}, { reflect: true, type: Boolean }], numberingSystem: [3, {}, { reflect: true }], pageSize: [11, {}, { reflect: true, type: Number }], scale: [3, {}, { reflect: true }], selectedItems: [32, {}, { attribute: false, readOnly: true }], selectionDisplay: [3, {}, { reflect: true }], selectionMode: [3, {}, { reflect: true }], striped: [7, {}, { reflect: true, type: Boolean }] };
88
+ this.properties = { colCount: [16, {}, { state: true }], pageStartRow: [16, {}, { state: true }], readCellContentsToAT: [16, {}, { state: true }], selectedCount: [16, {}, { state: true }], tableContainerHasOverflow: [16, {}, { state: true }], _selectedItems: [16, {}, { state: true }], bordered: [7, {}, { reflect: true, type: Boolean }], caption: 1, currentPage: [11, {}, { reflect: true, type: Number }], groupSeparator: [7, {}, { reflect: true, type: Boolean }], interactionMode: [3, {}, { reflect: true }], layout: [3, {}, { reflect: true }], messageOverrides: [0, {}, { attribute: false }], numbered: [7, {}, { reflect: true, type: Boolean }], numberingSystem: [3, {}, { reflect: true }], pageSize: [11, {}, { reflect: true, type: Number }], scale: [3, {}, { reflect: true }], selectedItems: [32, {}, { attribute: false, readOnly: true }], selectionDisplay: [3, {}, { reflect: true }], selectionMode: [3, {}, { reflect: true }], striped: [7, {}, { reflect: true, type: Boolean }], stickyHeader: [7, {}, { reflect: true, type: Boolean }] };
81
89
  }
82
90
  static {
83
91
  this.styles = styles;
@@ -89,14 +97,42 @@ class Table extends LitElement {
89
97
  this.readCellContentsToAT = /safari/i.test(getUserAgentString());
90
98
  this.listenOn(this.el.shadowRoot, "slotchange", this.handleSlotChange);
91
99
  }
100
+ disconnectedCallback() {
101
+ super.disconnectedCallback();
102
+ if (this.tableContainerOverflowAnimationFrame !== null) {
103
+ cancelAnimationFrame(this.tableContainerOverflowAnimationFrame);
104
+ this.tableContainerOverflowAnimationFrame = null;
105
+ }
106
+ this.tableContainerResizeObserver?.disconnect();
107
+ }
92
108
  willUpdate(changes) {
93
109
  if (changes.has("groupSeparator") && (this.hasUpdated || this.groupSeparator !== false) || changes.has("interactionMode") && (this.hasUpdated || this.interactionMode !== "interactive") || changes.has("numbered") && (this.hasUpdated || this.numbered !== false) || changes.has("numberingSystem") || changes.has("pageSize") && (this.hasUpdated || this.pageSize !== 0) || changes.has("scale") && (this.hasUpdated || this.scale !== "m") || changes.has("selectionMode") && (this.hasUpdated || this.selectionMode !== "none") || changes.has("currentPage") && (this.hasUpdated || this.currentPage > 1) && this.pageSize > 0) {
94
110
  this.updateRows();
95
111
  }
112
+ if (changes.has("stickyHeader") && (this.hasUpdated || this.stickyHeader !== false)) {
113
+ this.allRows?.forEach((row) => {
114
+ row.stickyHeaderEnabled = this.stickyHeader;
115
+ });
116
+ if (this.stickyHeader) {
117
+ this.applyHeaderRowPositionStyles();
118
+ } else {
119
+ this.resetStickyHeaderState();
120
+ }
121
+ }
96
122
  }
97
123
  handleSlotChange() {
98
124
  this.updateRows();
99
125
  }
126
+ clearStickyHeaderRowStyles() {
127
+ this.headRows?.forEach((row) => {
128
+ row.style.removeProperty("--calcite-internal-table-header-offset");
129
+ row.style.removeProperty("--calcite-internal-table-header-z-index");
130
+ row.style.removeProperty("--calcite-internal-table-header-row-position");
131
+ });
132
+ }
133
+ resetStickyHeaderState() {
134
+ this.clearStickyHeaderRowStyles();
135
+ }
100
136
  calciteTableRowSelectListener(event) {
101
137
  if (event.composedPath().includes(this.el)) {
102
138
  this.setSelectedItems(event.target);
@@ -157,6 +193,40 @@ class Table extends LitElement {
157
193
  }
158
194
  return el.assignedElements({ flatten: true }).filter((el2) => el2.matches("calcite-table-row"));
159
195
  }
196
+ observeTableContainer() {
197
+ this.tableContainerResizeObserver?.disconnect();
198
+ const tableContainer = this.tableContainerRef.value;
199
+ const table = this.tableEl;
200
+ if (tableContainer) {
201
+ this.tableContainerResizeObserver?.observe(tableContainer);
202
+ }
203
+ if (table) {
204
+ this.tableContainerResizeObserver?.observe(table);
205
+ }
206
+ }
207
+ scheduleTableContainerOverflowUpdate() {
208
+ if (this.tableContainerOverflowAnimationFrame !== null) {
209
+ cancelAnimationFrame(this.tableContainerOverflowAnimationFrame);
210
+ }
211
+ this.tableContainerOverflowAnimationFrame = requestAnimationFrame(() => {
212
+ this.tableContainerOverflowAnimationFrame = null;
213
+ this.updateTableContainerOverflow();
214
+ });
215
+ }
216
+ applyHeaderRowPositionStyles() {
217
+ this.clearStickyHeaderRowStyles();
218
+ const firstHeadRow = this.headRows?.[0];
219
+ if (!firstHeadRow) {
220
+ return;
221
+ }
222
+ firstHeadRow.style.setProperty("--calcite-internal-table-header-offset", "0");
223
+ firstHeadRow.style.setProperty("--calcite-internal-table-header-z-index", "2");
224
+ firstHeadRow.style.setProperty("--calcite-internal-table-header-row-position", this.stickyHeader ? "sticky" : "static");
225
+ }
226
+ updateTableContainerOverflow() {
227
+ const tableContainer = this.tableContainerRef.value;
228
+ this.tableContainerHasOverflow = !!tableContainer && (tableContainer.scrollHeight > tableContainer.clientHeight || tableContainer.scrollWidth > tableContainer.clientWidth);
229
+ }
160
230
  updateRows() {
161
231
  const headRows = this.getSlottedRows(this.tableHeadSlotRef.value);
162
232
  const bodyRows = this.getSlottedRows(this.tableBodySlotRef.value);
@@ -190,12 +260,15 @@ class Table extends LitElement {
190
260
  row.readCellContentsToAT = this.readCellContentsToAT;
191
261
  row.lastVisibleRow = allRows?.indexOf(row) === allRows.length - 1;
192
262
  });
193
- const colCount = headRows[0]?.cellCount || headRows[0]?.querySelectorAll("calcite-table-header")?.length;
263
+ const colCount = headRows[0]?.cellCount || 0;
194
264
  this.colCount = colCount;
195
265
  this.headRows = headRows;
196
266
  this.bodyRows = bodyRows;
197
267
  this.footRows = footRows;
198
268
  this.allRows = allRows;
269
+ this.applyHeaderRowPositionStyles();
270
+ this.observeTableContainer();
271
+ this.scheduleTableContainerOverflowUpdate();
199
272
  this.handleCurrentPageRange();
200
273
  this.updateSelectedItems();
201
274
  }
@@ -288,12 +361,14 @@ class Table extends LitElement {
288
361
  return html`<div class=${safeClassMap(CSS.container)}>${this.selectionMode !== "none" && this.selectionDisplay !== "none" && this.renderSelectionArea() || ""}<div class=${safeClassMap({
289
362
  [CSS.bordered]: this.bordered,
290
363
  [CSS.striped]: this.striped,
291
- [CSS.tableContainer]: true
292
- })}><table .ariaColCount=${this.colCount} .ariaMultiSelectable=${/* workaround to ensure the attr gets removed; we should be able to avoid the ternary when fixed */
364
+ [CSS.tableContainer]: true,
365
+ [CSS.tableContainerOverflow]: this.tableContainerHasOverflow
366
+ })} ${ref(this.tableContainerRef)}><table .ariaColCount=${this.colCount} .ariaMultiSelectable=${/* workaround to ensure the attr gets removed; we should be able to avoid the ternary when fixed */
293
367
  this.selectionMode === "multiple" ? "true" : void 0} .ariaRowCount=${this.allRows?.length} class=${safeClassMap({ [CSS.tableFixed]: this.layout === "fixed" })} .role=${this.interactionMode === "interactive" ? "grid" : "table"} ${ref((el) => {
294
368
  if (!el) {
295
369
  return;
296
370
  }
371
+ this.tableEl = el;
297
372
  render(html`<caption class=${safeClassMap(CSS.assistiveText)}>${this.caption}</caption>${this.renderTHead()}${this.renderTBody()}${this.renderTFoot()}`, el);
298
373
  })}></table></div>${this.pageSize > 0 && this.renderPaginationArea() || ""}</div>`;
299
374
  }
@@ -17,7 +17,7 @@ const CSS = {
17
17
  lastCell: "last-cell",
18
18
  staticCell: "static-cell"
19
19
  };
20
- const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:contents}:host([alignment=center]) td:not(.selection-cell):not(.number-cell){text-align:center}:host([alignment=end]) td:not(.selection-cell):not(.number-cell){text-align:end}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}td{white-space:normal;text-align:start;vertical-align:middle;color:var(--calcite-table-cell-text-color, var(--calcite-color-text-1));background-color:var(--calcite-internal-table-cell-background-color, var(--calcite-table-cell-background-color, transparent));font-size:var(--calcite-internal-table-cell-font-size);border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-table-cell-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)));padding:var(--calcite-internal-table-cell-padding)}td:not(.static-cell){outline-color:transparent}td:not(.static-cell):focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}td.start.content-cell{vertical-align:top}td.end.content-cell{vertical-align:bottom}td.last-cell{border-inline-end:0}.footer-cell{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-table-cell-text-color, var(--calcite-color-text-1));background-color:var(--calcite-table-cell-background-color, var(--calcite-table-cell-background, var(--calcite-color-background)));border-block-start:var(--calcite-border-width-sm) solid var(--calcite-table-cell-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)))}.number-cell,.selection-cell{text-align:center;border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-table-cell-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)));inline-size:2rem;min-inline-size:2rem}.number-cell{color:var(--calcite-table-number-cell-text-color, var(--calcite-color-text-1));background-color:var(--calcite-table-number-cell-background-color, var(--calcite-color-foreground-2))}.number-cell.footer-cell{background-color:var(--calcite-table-number-cell-background-color, var(--calcite-table-cell-background-color, var(--calcite-color-background)))}.selection-cell{color:var(--calcite-table-selection-cell-icon-color, var(--calcite-color-text-3))}.selection-cell:not(.footer-cell){cursor:pointer;background-color:var(--calcite-table-selection-cell-background-color, var(--calcite-table-cell-background-color, transparent))}.selection-cell.footer-cell{background-color:var(--calcite-table-selection-cell-background-color, var(--calcite-table-cell-background-color, var(--calcite-color-background)))}.selected-cell:not(.number-cell):not(.footer-cell){background-color:var(--calcite-table-cell-background-color-selected, var(--calcite-table-row-background-color-selected, var(--calcite-color-surface-highlight)))}.selection-cell.selected-cell{box-shadow:inset 0 0 0 0 var(--calcite-table-row-accent-color-selected, var(--calcite-color-brand));color:var(--calcite-table-selection-cell-icon-color-selected, var(--calcite-color-brand))}.calcite--rtl.selection-cell.selected-cell{box-shadow:inset -.25rem 0 0 0 var(--calcite-table-row-accent-color-selected, var(--calcite-color-brand))}.selection-cell{vertical-align:middle}.selection-cell ::slotted(calcite-icon){pointer-events:none;margin-block-start:.25rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`;
20
+ const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:contents}:host([alignment=center]) td:not(.selection-cell):not(.number-cell){text-align:center}:host([alignment=end]) td:not(.selection-cell):not(.number-cell){text-align:end}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}td{white-space:normal;text-align:start;vertical-align:middle;color:var(--calcite-table-cell-text-color, var(--calcite-color-text-1));background-color:var(--calcite-internal-table-cell-background-color, var(--calcite-table-cell-background-color, transparent));font-size:var(--calcite-internal-table-cell-font-size);border-block-end:var(--calcite-internal-table-row-border-block-end-width, 0) solid var(--calcite-internal-table-row-border-block-end-color, transparent);border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-table-cell-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)));padding:var(--calcite-internal-table-cell-padding)}td:not(.static-cell){outline-color:transparent}td:not(.static-cell):focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}td.start.content-cell{vertical-align:top}td.end.content-cell{vertical-align:bottom}td.last-cell{border-inline-end:0}:host([reaches-body-end]) td{border-block-end:0}.footer-cell{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-table-cell-text-color, var(--calcite-color-text-1));background-color:var(--calcite-table-cell-background-color, var(--calcite-table-cell-background, var(--calcite-color-background)));border-block-end:0;border-block-start:var(--calcite-border-width-sm) solid var(--calcite-table-cell-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)))}.number-cell,.selection-cell{text-align:center;border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-table-cell-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)));inline-size:2rem;min-inline-size:2rem}.number-cell{color:var(--calcite-table-number-cell-text-color, var(--calcite-color-text-1));background-color:var(--calcite-table-number-cell-background-color, var(--calcite-color-foreground-2))}.number-cell.footer-cell{background-color:var(--calcite-table-number-cell-background-color, var(--calcite-table-cell-background-color, var(--calcite-color-background)))}.selection-cell{color:var(--calcite-table-selection-cell-icon-color, var(--calcite-color-text-3))}.selection-cell:not(.footer-cell){cursor:pointer;background-color:var(--calcite-table-selection-cell-background-color, var(--calcite-table-cell-background-color, transparent))}.selection-cell.footer-cell{background-color:var(--calcite-table-selection-cell-background-color, var(--calcite-table-cell-background-color, var(--calcite-color-background)))}.selected-cell:not(.number-cell):not(.footer-cell){background-color:var(--calcite-table-cell-background-color-selected, var(--calcite-table-row-background-color-selected, var(--calcite-color-surface-highlight)))}.selection-cell.selected-cell{box-shadow:inset 0 0 0 0 var(--calcite-table-row-accent-color-selected, var(--calcite-color-brand));color:var(--calcite-table-selection-cell-icon-color-selected, var(--calcite-color-brand))}.calcite--rtl.selection-cell.selected-cell{box-shadow:inset -.25rem 0 0 0 var(--calcite-table-row-accent-color-selected, var(--calcite-color-brand))}.selection-cell{vertical-align:middle}.selection-cell ::slotted(calcite-icon){pointer-events:none;margin-block-start:.25rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`;
21
21
  class TableCell extends LitElement {
22
22
  constructor() {
23
23
  super(...arguments);
@@ -34,6 +34,7 @@ class TableCell extends LitElement {
34
34
  this.interactionMode = "interactive";
35
35
  this.lastCell = false;
36
36
  this.numberCell = false;
37
+ this.reachesBodyEnd = false;
37
38
  this.parentRowAlignment = "start";
38
39
  this.parentRowIsSelected = false;
39
40
  this.readCellContentsToAT = false;
@@ -41,7 +42,7 @@ class TableCell extends LitElement {
41
42
  this.selectionCell = false;
42
43
  }
43
44
  static {
44
- this.properties = { contentsText: [16, {}, { state: true }], focused: [16, {}, { state: true }], selectionText: [16, {}, { state: true }], alignment: [3, {}, { reflect: true }], colSpan: [11, {}, { reflect: true, type: Number }], disabled: [5, {}, { type: Boolean }], interactionMode: 1, lastCell: [5, {}, { type: Boolean }], messageOverrides: [0, {}, { attribute: false }], numberCell: [5, {}, { type: Boolean }], parentRowAlignment: 1, parentRowIsSelected: [5, {}, { type: Boolean }], parentRowPositionLocalized: 1, parentRowType: 1, positionInRow: [9, {}, { type: Number }], readCellContentsToAT: [5, {}, { type: Boolean }], rowSpan: [11, {}, { reflect: true, type: Number }], scale: 1, selectionCell: [5, {}, { type: Boolean }] };
45
+ this.properties = { contentsText: [16, {}, { state: true }], focused: [16, {}, { state: true }], selectionText: [16, {}, { state: true }], alignment: [3, {}, { reflect: true }], colSpan: [11, {}, { reflect: true, type: Number }], disabled: [5, {}, { type: Boolean }], interactionMode: 1, lastCell: [5, {}, { type: Boolean }], messageOverrides: [0, {}, { attribute: false }], numberCell: [5, {}, { type: Boolean }], reachesBodyEnd: [7, {}, { reflect: true, type: Boolean }], parentRowAlignment: 1, parentRowIsSelected: [5, {}, { type: Boolean }], parentRowPositionLocalized: 1, parentRowType: 1, positionInRow: [9, {}, { type: Number }], readCellContentsToAT: [5, {}, { type: Boolean }], rowSpan: [11, {}, { reflect: true, type: Number }], scale: 1, selectionCell: [5, {}, { type: Boolean }] };
45
46
  }
46
47
  static {
47
48
  this.styles = styles;
@@ -26,7 +26,7 @@ const ICONS = {
26
26
  indeterminate: "minus-square-f",
27
27
  unchecked: "square"
28
28
  };
29
- const styles = css`:host{display:contents}:host([alignment=center]) th{text-align:center}:host([alignment=end]) th{text-align:end}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}th{white-space:normal;text-align:start;vertical-align:top;font-weight:var(--calcite-font-weight-medium);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-table-header-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)));padding-block:calc(var(--calcite-internal-table-cell-padding) * 1.5);padding-inline:var(--calcite-internal-table-cell-padding);background-color:var(--calcite-table-header-background-color, var(--calcite-table-header-background, var(--calcite-color-foreground-2)));font-size:var(--calcite-internal-table-cell-font-size);border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-table-cell-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)))}th:not(.static-cell){outline-color:transparent}th:not(.static-cell):not(.static-cell):focus-within{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}th:not(.center):not(.end).content-cell{vertical-align:top}th.center{vertical-align:middle}th.end.content-cell{vertical-align:bottom}th.body-row,th.footer-row{padding-block:var(--calcite-internal-table-cell-padding);border-block-end:0}th.footer-row{border-block-start:var(--calcite-border-width-sm) solid var(--calcite-table-header-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)))}th.last-cell{border-inline-end:0}.cell--multiple-selection{cursor:pointer;vertical-align:middle;color:var(--calcite-table-selection-cell-icon-color, var(--calcite-color-text-3));background-color:var(--calcite-table-selection-cell-background-color, var(--calcite-color-foreground-2))}.cell--multiple-selection.selected-cell{background-color:var(--calcite-table-selection-cell-background-color-selected, var(--calcite-color-foreground-2))}.cell--multiple-selection:not(.end){vertical-align:middle}.number-cell{background-color:var(--calcite-table-number-cell-background-color, var(--calcite-table-cell-background-color, var(--calcite-color-foreground-2)))}.number-cell,.selection-cell{inline-size:2rem;min-inline-size:2rem}.selection-cell calcite-icon.active{color:var(--calcite-table-selection-cell-icon-color-selected, var(--calcite-color-brand))}.number-cell calcite-icon,.selection-cell calcite-icon{margin-inline-start:auto;margin-inline-end:auto;vertical-align:middle}.heading{color:var(--calcite-table-header-heading-text-color, var(--calcite-color-text-1))}.description{color:var(--calcite-table-header-description-text-color, var(--calcite-color-text-3));font-size:var(--calcite-internal-table-cell-font-size-secondary)}`;
29
+ const styles = css`:host{display:contents}:host([alignment=center]) th{text-align:center}:host([alignment=end]) th{text-align:end}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}th{white-space:normal;text-align:start;vertical-align:top;font-weight:var(--calcite-font-weight-medium);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-table-header-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)));padding-block:calc(var(--calcite-internal-table-cell-padding) * 1.5);padding-inline:var(--calcite-internal-table-cell-padding);background-color:var(--calcite-table-header-background-color, var(--calcite-table-header-background, var(--calcite-color-foreground-2)));font-size:var(--calcite-internal-table-cell-font-size);border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-table-cell-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)))}th:not(.static-cell){outline-color:transparent}th:not(.static-cell):not(.static-cell):focus-within{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}th:not(.body-row):not(.footer-row){border-block-end-width:var(--calcite-internal-table-header-border-block-end-width, var(--calcite-border-width-sm));box-shadow:var(--calcite-internal-table-sticky-header-border-shadow, 0 0 0 0 transparent)}th:not(.center):not(.end).content-cell{vertical-align:top}th.center{vertical-align:middle}th.end.content-cell{vertical-align:bottom}th.body-row,th.footer-row{padding-block:var(--calcite-internal-table-cell-padding);border-block-end:0}th.footer-row{border-block-start:var(--calcite-border-width-sm) solid var(--calcite-table-header-border-color, var(--calcite-table-border-color, var(--calcite-color-border-2)))}th.last-cell{border-inline-end:0}.cell--multiple-selection{cursor:pointer;vertical-align:middle;color:var(--calcite-table-selection-cell-icon-color, var(--calcite-color-text-3));background-color:var(--calcite-table-selection-cell-background-color, var(--calcite-color-foreground-2))}.cell--multiple-selection.selected-cell{background-color:var(--calcite-table-selection-cell-background-color-selected, var(--calcite-color-foreground-2))}.cell--multiple-selection:not(.end){vertical-align:middle}.number-cell{background-color:var(--calcite-table-number-cell-background-color, var(--calcite-table-cell-background-color, var(--calcite-color-foreground-2)))}.number-cell,.selection-cell{inline-size:2rem;min-inline-size:2rem}.selection-cell calcite-icon.active{color:var(--calcite-table-selection-cell-icon-color-selected, var(--calcite-color-brand))}.number-cell calcite-icon,.selection-cell calcite-icon{margin-inline-start:auto;margin-inline-end:auto;vertical-align:middle}.heading{color:var(--calcite-table-header-heading-text-color, var(--calcite-color-text-1))}.description{color:var(--calcite-table-header-description-text-color, var(--calcite-color-text-3));font-size:var(--calcite-internal-table-cell-font-size-secondary)}`;
30
30
  class TableHeader extends LitElement {
31
31
  constructor() {
32
32
  super(...arguments);
@@ -4,7 +4,7 @@ import { keyed } from "lit/directives/keyed.js";
4
4
  import { css, html, render } from "lit";
5
5
  import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
6
6
  import { createRef, ref } from "lit/directives/ref.js";
7
- import { f as focusElementInGroup } from "../../chunks/dom.js";
7
+ import { f as focusElementInGroup, D as getSlotAssignedElements } from "../../chunks/dom.js";
8
8
  import { i as isActivationKey } from "../../chunks/key.js";
9
9
  import { g as getIconScale } from "../../chunks/component.js";
10
10
  import { u as useInteractive } from "../../chunks/useInteractive.js";
@@ -17,12 +17,16 @@ const ICONS = {
17
17
  circleF: "circle-f",
18
18
  circle: "circle"
19
19
  };
20
- const styles = css`@charset "UTF-8";:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:contents}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) tr{pointer-events:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}calcite-table-cell{--calcite-internal-table-cell-background-color: var( --calcite-table-row-background-color, var(--calcite-table-row-background, var(--calcite-color-foreground-1)) )}:host([selected]) calcite-table-cell{--calcite-internal-table-cell-background-color: var( --calcite-table-row-background-color-selected, var(--calcite-color-foreground-1) )}tr{border-block-end:var(--calcite-border-width-sm) solid var(--calcite-table-row-border-color, transparent);background-color:var(--calcite-table-row-background-color, var(--calcite-table-row-background, var(--calcite-color-foreground-1)))}tr.last-visible-row{border-block-end:0}@-moz-document url-prefix(){tr{box-shadow:inset 0 -1px 0 0 var(--calcite-table-row-border-color)}tr.last-visible-row{box-shadow:inset 0 -1px 0 0 transparent}}:host([item-hidden]){display:none}`;
20
+ const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:contents}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) tr{pointer-events:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}calcite-table-cell{--calcite-internal-table-cell-background-color: var( --calcite-table-row-background-color, var(--calcite-table-row-background, var(--calcite-color-foreground-1)) )}:host([slot=table-header]) tr{position:var(--calcite-internal-table-header-row-position);inset-block-start:var(--calcite-internal-table-header-offset, 0);z-index:var(--calcite-internal-table-header-z-index, calc(var(--calcite-z-index) + 1))}:host([selected]) calcite-table-cell{--calcite-internal-table-cell-background-color: var( --calcite-table-row-background-color-selected, var(--calcite-color-foreground-1) )}tr{--calcite-internal-table-row-border-block-end-width: var(--calcite-border-width-sm);--calcite-internal-table-row-border-block-end-color: var(--calcite-table-row-border-color, transparent);background-color:var(--calcite-table-row-background-color, var(--calcite-table-row-background, var(--calcite-color-foreground-1)))}tr.last-visible-row{--calcite-internal-table-row-border-block-end-width: 0;--calcite-internal-table-row-border-block-end-color: transparent}:host([item-hidden]){display:none}`;
21
21
  class TableRow extends LitElement {
22
22
  constructor() {
23
23
  super();
24
+ this.numberedCellRef = createRef();
25
+ this.numberedHeaderRef = createRef();
24
26
  this.rowCells = [];
25
- this.tableRowSlotRef = createRef();
27
+ this.rowSlotRef = createRef();
28
+ this.selectionCellRef = createRef();
29
+ this.selectionHeaderRef = createRef();
26
30
  this.userTriggered = false;
27
31
  this._selected = false;
28
32
  this.clickHandler = () => {
@@ -42,6 +46,7 @@ class TableRow extends LitElement {
42
46
  this.interactionMode = "interactive";
43
47
  this.lastVisibleRow = false;
44
48
  this.numbered = false;
49
+ this.stickyHeaderEnabled = false;
45
50
  this.selectionMode = "none";
46
51
  this.calciteInternalTableRowFocusRequest = createEvent({ cancelable: false });
47
52
  this.calciteInternalTableRowSelect = createEvent({ cancelable: false });
@@ -49,7 +54,7 @@ class TableRow extends LitElement {
49
54
  this.listenOn(document, "calciteInternalTableRowFocusChange", this.calciteInternalTableRowFocusChangeHandler);
50
55
  }
51
56
  static {
52
- this.properties = { alignment: [3, {}, { reflect: true }], itemHidden: [7, {}, { reflect: true, type: Boolean }], bodyRowCount: [9, {}, { type: Number }], cellCount: [9, {}, { type: Number }], disabled: [7, {}, { reflect: true, type: Boolean }], interactionMode: 1, lastVisibleRow: [5, {}, { type: Boolean }], numbered: [5, {}, { type: Boolean }], positionAll: [9, {}, { type: Number }], positionSection: [9, {}, { type: Number }], positionSectionLocalized: 1, readCellContentsToAT: [5, {}, { type: Boolean }], rowType: 1, scale: 1, selected: [7, {}, { reflect: true, type: Boolean }], selectedRowCount: [9, {}, { type: Number }], selectedRowCountLocalized: 1, selectionMode: 1 };
57
+ this.properties = { alignment: [3, {}, { reflect: true }], itemHidden: [7, {}, { reflect: true, type: Boolean }], bodyRowCount: [9, {}, { type: Number }], cellCount: [9, {}, { type: Number }], disabled: [7, {}, { reflect: true, type: Boolean }], interactionMode: 1, lastVisibleRow: [5, {}, { type: Boolean }], numbered: [5, {}, { type: Boolean }], positionAll: [9, {}, { type: Number }], positionSection: [9, {}, { type: Number }], positionSectionLocalized: 1, readCellContentsToAT: [5, {}, { type: Boolean }], rowType: 1, scale: 1, stickyHeaderEnabled: [5, {}, { type: Boolean }], selected: [7, {}, { reflect: true, type: Boolean }], selectedRowCount: [9, {}, { type: Number }], selectedRowCountLocalized: 1, selectionMode: 1 };
53
58
  }
54
59
  static {
55
60
  this.styles = styles;
@@ -79,7 +84,7 @@ class TableRow extends LitElement {
79
84
  }
80
85
  }
81
86
  loaded() {
82
- if (this.tableRowEl && this.rowCells.length > 0) {
87
+ if (this.rowCells.length > 0) {
83
88
  this.updateCells();
84
89
  }
85
90
  }
@@ -87,12 +92,12 @@ class TableRow extends LitElement {
87
92
  this.updateCells();
88
93
  }
89
94
  handleCellChanges() {
90
- if (this.tableRowEl && this.rowCells.length > 0) {
95
+ if (this.rowCells.length > 0) {
91
96
  this.updateCells();
92
97
  }
93
98
  }
94
99
  handleDelayedCellChanges() {
95
- if (this.tableRowEl && this.rowCells.length > 0) {
100
+ if (this.rowCells.length > 0) {
96
101
  requestAnimationFrame(() => this.updateCells());
97
102
  }
98
103
  }
@@ -180,10 +185,14 @@ class TableRow extends LitElement {
180
185
  }
181
186
  updateCells() {
182
187
  const alignment = this.alignment ? this.alignment : this.rowType !== "head" ? "center" : "start";
183
- const slottedCells = this.tableRowSlotRef.value?.assignedElements({ flatten: true })?.filter((el) => el.matches("calcite-table-cell") || el.matches("calcite-table-header")) ?? [];
184
- const tableRowEls = this.tableRowEl?.querySelectorAll("calcite-table-header, calcite-table-cell");
185
- const renderedCells = tableRowEls ? Array.from(tableRowEls).filter((el) => el.numberCell || el.selectionCell) : void 0;
186
- const cells = renderedCells ? renderedCells.concat(slottedCells) : slottedCells;
188
+ const slottedCells = this.rowSlotRef.value ? getSlotAssignedElements(this.rowSlotRef.value, "calcite-table-cell, calcite-table-header") : [];
189
+ const renderedCells = [
190
+ this.numberedCellRef.value,
191
+ this.numberedHeaderRef.value,
192
+ this.selectionCellRef.value,
193
+ this.selectionHeaderRef.value
194
+ ].filter((cell) => cell != null);
195
+ const cells = renderedCells.concat(slottedCells);
187
196
  if (cells.length > 0) {
188
197
  cells?.forEach((cell, index) => {
189
198
  cell.interactionMode = this.interactionMode;
@@ -194,8 +203,11 @@ class TableRow extends LitElement {
194
203
  cell.positionInRow = index + 1;
195
204
  cell.scale = this.scale;
196
205
  if (cell.nodeName === "CALCITE-TABLE-CELL") {
206
+ const rowSpan = cell.rowSpan || 1;
207
+ const reachesBodyEnd = this.rowType === "body" && rowSpan > 1 && this.positionSection + rowSpan >= this.bodyRowCount;
197
208
  cell.readCellContentsToAT = this.readCellContentsToAT;
198
209
  cell.disabled = this.disabled;
210
+ cell.reachesBodyEnd = reachesBodyEnd;
199
211
  }
200
212
  });
201
213
  }
@@ -215,18 +227,17 @@ class TableRow extends LitElement {
215
227
  return html`<calcite-icon .icon=${icon} .scale=${getIconScale(this.scale)}></calcite-icon>`;
216
228
  }
217
229
  renderSelectableCell() {
218
- return this.rowType === "head" ? keyed("selection-head", html`<calcite-table-header alignment=center .bodyRowCount=${this.bodyRowCount} @click=${this.clickHandler} @keydown=${this.handleKeyboardSelection} .parentRowAlignment=${this.alignment} .selectedRowCount=${this.selectedRowCount} .selectedRowCountLocalized=${this.selectedRowCountLocalized} .selectionCell=${true} .selectionMode=${this.selectionMode}></calcite-table-header>`) : this.rowType === "body" ? keyed("selection-body", html`<calcite-table-cell alignment=center @click=${this.clickHandler} @keydown=${this.handleKeyboardSelection} .parentRowAlignment=${this.alignment} .parentRowIsSelected=${this.selected} .parentRowPositionLocalized=${this.positionSectionLocalized} .selectionCell=${true}>${this.renderSelectionIcon()}</calcite-table-cell>`) : keyed("selection-foot", html`<calcite-table-cell alignment=center .parentRowAlignment=${this.alignment} .selectionCell=${true}></calcite-table-cell>`);
230
+ return this.rowType === "head" ? keyed("selection-head", html`<calcite-table-header alignment=center .bodyRowCount=${this.bodyRowCount} @click=${this.clickHandler} @keydown=${this.handleKeyboardSelection} .parentRowAlignment=${this.alignment} .selectedRowCount=${this.selectedRowCount} .selectedRowCountLocalized=${this.selectedRowCountLocalized} .selectionCell=${true} .selectionMode=${this.selectionMode} ${ref(this.selectionHeaderRef)}></calcite-table-header>`) : this.rowType === "body" ? keyed("selection-body", html`<calcite-table-cell alignment=center @click=${this.clickHandler} @keydown=${this.handleKeyboardSelection} .parentRowAlignment=${this.alignment} .parentRowIsSelected=${this.selected} .parentRowPositionLocalized=${this.positionSectionLocalized} .selectionCell=${true} ${ref(this.selectionCellRef)}>${this.renderSelectionIcon()}</calcite-table-cell>`) : keyed("selection-foot", html`<calcite-table-cell alignment=center .parentRowAlignment=${this.alignment} .selectionCell=${true} ${ref(this.selectionCellRef)}></calcite-table-cell>`);
219
231
  }
220
232
  renderNumberedCell() {
221
- return this.rowType === "head" ? keyed("numbered-head", html`<calcite-table-header alignment=center .numberCell=${true} .parentRowAlignment=${this.alignment}></calcite-table-header>`) : this.rowType === "body" ? keyed("numbered-body", html`<calcite-table-cell alignment=center .numberCell=${true} .parentRowAlignment=${this.alignment}>${this.positionSectionLocalized}</calcite-table-cell>`) : keyed("numbered-foot", html`<calcite-table-cell alignment=center .numberCell=${true} .parentRowAlignment=${this.alignment}></calcite-table-cell>`);
233
+ return this.rowType === "head" ? keyed("numbered-head", html`<calcite-table-header alignment=center .numberCell=${true} .parentRowAlignment=${this.alignment} ${ref(this.numberedHeaderRef)}></calcite-table-header>`) : this.rowType === "body" ? keyed("numbered-body", html`<calcite-table-cell alignment=center .numberCell=${true} .parentRowAlignment=${this.alignment} ${ref(this.numberedCellRef)}>${this.positionSectionLocalized}</calcite-table-cell>`) : keyed("numbered-foot", html`<calcite-table-cell alignment=center .numberCell=${true} .parentRowAlignment=${this.alignment} ${ref(this.numberedCellRef)}></calcite-table-cell>`);
222
234
  }
223
235
  render() {
224
236
  return this.interactiveContainer({ disabled: this.disabled, children: html`<tr .ariaRowIndex=${this.positionAll + 1} .ariaSelected=${this.selected} class=${safeClassMap({ [CSS.lastVisibleRow]: this.lastVisibleRow })} @keydown=${this.keyDownHandler} ${ref((el) => {
225
237
  if (!el) {
226
238
  return;
227
239
  }
228
- this.tableRowEl = el;
229
- render(html`${this.numbered && this.renderNumberedCell() || ""}${this.selectionMode !== "none" && this.renderSelectableCell() || ""}<slot ${ref(this.tableRowSlotRef)}></slot>`, el);
240
+ render(html`${this.numbered && this.renderNumberedCell() || ""}${this.selectionMode !== "none" && this.renderSelectableCell() || ""}<slot ${ref(this.rowSlotRef)}></slot>`, el);
230
241
  })}></tr>` });
231
242
  }
232
243
  }