@salesforce/design-system-react 11.0.0-alpha.3 → 11.0.0-alpha.4

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 (203) hide show
  1. package/dist/cjs/components/index.cjs +1 -1
  2. package/dist/cjs/components/page-header/index.cjs.map +1 -1
  3. package/dist/cjs/components/{data-table → simple-data-table}/cell.cjs +1 -1
  4. package/dist/cjs/components/simple-data-table/cell.cjs.map +1 -0
  5. package/dist/cjs/components/{data-table → simple-data-table}/check-props.cjs +1 -1
  6. package/dist/cjs/components/simple-data-table/check-props.cjs.map +1 -0
  7. package/dist/cjs/components/simple-data-table/column-check-props.cjs.map +1 -0
  8. package/dist/cjs/components/simple-data-table/column.cjs +2 -0
  9. package/dist/cjs/components/simple-data-table/column.cjs.map +1 -0
  10. package/dist/cjs/components/simple-data-table/component.cjs +2 -0
  11. package/dist/cjs/components/simple-data-table/component.cjs.map +1 -0
  12. package/dist/cjs/components/{data-table → simple-data-table}/highlight-cell.cjs +1 -1
  13. package/dist/cjs/components/simple-data-table/highlight-cell.cjs.map +1 -0
  14. package/dist/cjs/components/simple-data-table/index.cjs +2 -0
  15. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -0
  16. package/dist/cjs/components/simple-data-table/interactive-element.cjs.map +1 -0
  17. package/dist/cjs/components/simple-data-table/interactive-link.cjs.map +1 -0
  18. package/dist/cjs/components/simple-data-table/private/cell-context.cjs.map +1 -0
  19. package/dist/cjs/components/simple-data-table/private/cell-fixed.cjs.map +1 -0
  20. package/dist/cjs/components/simple-data-table/private/context-helper.cjs.map +1 -0
  21. package/dist/cjs/components/{data-table → simple-data-table}/private/head.cjs +1 -1
  22. package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -0
  23. package/dist/cjs/components/simple-data-table/private/header-cell.cjs +2 -0
  24. package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -0
  25. package/dist/cjs/components/simple-data-table/private/link.cjs.map +1 -0
  26. package/dist/cjs/components/simple-data-table/private/mode.cjs.map +1 -0
  27. package/dist/cjs/components/simple-data-table/private/row.cjs +2 -0
  28. package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -0
  29. package/dist/cjs/components/simple-data-table/private/table-context.cjs.map +1 -0
  30. package/dist/cjs/components/{data-table → simple-data-table}/row-actions.cjs +1 -1
  31. package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -0
  32. package/dist/cjs/components/simple-data-table.cjs +1 -0
  33. package/dist/cjs/utilities/constants.cjs +1 -1
  34. package/dist/cjs/utilities/constants.cjs.map +1 -1
  35. package/dist/es/components/index.js +78 -78
  36. package/dist/es/components/page-header/index.js.map +1 -1
  37. package/dist/es/components/{data-table → simple-data-table}/cell.js +2 -2
  38. package/dist/es/components/simple-data-table/cell.js.map +1 -0
  39. package/dist/es/components/{data-table → simple-data-table}/check-props.js +2 -2
  40. package/dist/es/components/simple-data-table/check-props.js.map +1 -0
  41. package/dist/es/components/{data-table → simple-data-table}/column-check-props.js +1 -1
  42. package/dist/es/components/simple-data-table/column-check-props.js.map +1 -0
  43. package/dist/es/components/simple-data-table/column.js +8 -0
  44. package/dist/es/components/simple-data-table/column.js.map +1 -0
  45. package/dist/es/components/{data-table → simple-data-table}/component.js +6 -10
  46. package/dist/es/components/simple-data-table/component.js.map +1 -0
  47. package/dist/es/components/{data-table → simple-data-table}/highlight-cell.js +2 -2
  48. package/dist/es/components/simple-data-table/highlight-cell.js.map +1 -0
  49. package/dist/es/components/{data-table → simple-data-table}/index.js +72 -177
  50. package/dist/es/components/simple-data-table/index.js.map +1 -0
  51. package/dist/es/components/{data-table → simple-data-table}/interactive-element.js +1 -1
  52. package/dist/es/components/simple-data-table/interactive-element.js.map +1 -0
  53. package/dist/es/components/{data-table → simple-data-table}/interactive-link.js +1 -1
  54. package/dist/es/components/simple-data-table/interactive-link.js.map +1 -0
  55. package/dist/es/components/{data-table → simple-data-table}/private/cell-context.js +1 -1
  56. package/dist/es/components/simple-data-table/private/cell-context.js.map +1 -0
  57. package/dist/es/components/{data-table → simple-data-table}/private/cell-fixed.js +1 -1
  58. package/dist/es/components/simple-data-table/private/cell-fixed.js.map +1 -0
  59. package/dist/es/components/{data-table → simple-data-table}/private/context-helper.js +1 -1
  60. package/dist/es/components/simple-data-table/private/context-helper.js.map +1 -0
  61. package/dist/es/components/{data-table → simple-data-table}/private/head.js +2 -2
  62. package/dist/es/components/simple-data-table/private/head.js.map +1 -0
  63. package/dist/es/components/{data-table → simple-data-table}/private/header-cell.js +2 -2
  64. package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -0
  65. package/dist/es/components/{data-table → simple-data-table}/private/link.js +1 -1
  66. package/dist/es/components/simple-data-table/private/link.js.map +1 -0
  67. package/dist/es/components/{data-table → simple-data-table}/private/mode.js +1 -1
  68. package/dist/es/components/simple-data-table/private/mode.js.map +1 -0
  69. package/dist/es/components/{data-table → simple-data-table}/private/row.js +6 -6
  70. package/dist/es/components/simple-data-table/private/row.js.map +1 -0
  71. package/dist/es/components/{data-table → simple-data-table}/private/table-context.js +1 -1
  72. package/dist/es/components/simple-data-table/private/table-context.js.map +1 -0
  73. package/dist/es/components/{data-table → simple-data-table}/row-actions.js +2 -2
  74. package/dist/es/components/simple-data-table/row-actions.js.map +1 -0
  75. package/dist/es/components/simple-data-table.js +2 -0
  76. package/dist/es/utilities/constants.js +2 -2
  77. package/dist/es/utilities/constants.js.map +1 -1
  78. package/dist/types/components/index.d.ts +14 -14
  79. package/dist/types/components/index.d.ts.map +1 -1
  80. package/dist/types/components/page-header/index.d.ts +1 -1
  81. package/dist/types/components/page-header/index.d.ts.map +1 -1
  82. package/dist/types/components/{data-table → simple-data-table}/cell.d.ts +5 -5
  83. package/dist/types/components/simple-data-table/cell.d.ts.map +1 -0
  84. package/dist/types/components/simple-data-table/check-props.d.ts.map +1 -0
  85. package/dist/types/components/simple-data-table/column-check-props.d.ts.map +1 -0
  86. package/dist/types/components/{data-table → simple-data-table}/column.d.ts +6 -6
  87. package/dist/types/components/simple-data-table/column.d.ts.map +1 -0
  88. package/dist/types/components/simple-data-table/highlight-cell.d.ts +14 -0
  89. package/dist/types/components/simple-data-table/highlight-cell.d.ts.map +1 -0
  90. package/dist/types/components/{data-table → simple-data-table}/index.d.ts +13 -40
  91. package/dist/types/components/simple-data-table/index.d.ts.map +1 -0
  92. package/dist/types/components/simple-data-table/interactive-element.d.ts.map +1 -0
  93. package/dist/types/components/simple-data-table/interactive-link.d.ts.map +1 -0
  94. package/dist/types/components/simple-data-table/private/cell-context.d.ts.map +1 -0
  95. package/dist/types/components/simple-data-table/private/cell-fixed.d.ts.map +1 -0
  96. package/dist/types/components/simple-data-table/private/context-helper.d.ts.map +1 -0
  97. package/dist/types/components/{data-table → simple-data-table}/private/head.d.ts +6 -6
  98. package/dist/types/components/simple-data-table/private/head.d.ts.map +1 -0
  99. package/dist/types/components/{data-table → simple-data-table}/private/header-cell.d.ts +3 -3
  100. package/dist/types/components/simple-data-table/private/header-cell.d.ts.map +1 -0
  101. package/dist/types/components/simple-data-table/private/link.d.ts.map +1 -0
  102. package/dist/types/components/simple-data-table/private/mode.d.ts.map +1 -0
  103. package/dist/types/components/{data-table → simple-data-table}/private/row.d.ts +11 -11
  104. package/dist/types/components/simple-data-table/private/row.d.ts.map +1 -0
  105. package/dist/types/components/simple-data-table/private/table-context.d.ts.map +1 -0
  106. package/dist/types/components/{data-table → simple-data-table}/row-actions.d.ts +5 -5
  107. package/dist/types/components/simple-data-table/row-actions.d.ts.map +1 -0
  108. package/dist/types/components/simple-data-table/simple-data-table.d.ts +15 -0
  109. package/dist/types/components/simple-data-table/simple-data-table.d.ts.map +1 -0
  110. package/dist/types/components/{data-table → simple-data-table}/types.d.ts +56 -71
  111. package/dist/types/components/simple-data-table/types.d.ts.map +1 -0
  112. package/dist/types/components/simple-data-table.d.ts +2 -0
  113. package/dist/types/utilities/constants.d.ts +7 -7
  114. package/dist/types/utilities/constants.d.ts.map +1 -1
  115. package/package.json +3 -2
  116. package/dist/cjs/components/data-table/cell.cjs.map +0 -1
  117. package/dist/cjs/components/data-table/check-props.cjs.map +0 -1
  118. package/dist/cjs/components/data-table/column-check-props.cjs.map +0 -1
  119. package/dist/cjs/components/data-table/column.cjs +0 -2
  120. package/dist/cjs/components/data-table/column.cjs.map +0 -1
  121. package/dist/cjs/components/data-table/component.cjs +0 -2
  122. package/dist/cjs/components/data-table/component.cjs.map +0 -1
  123. package/dist/cjs/components/data-table/highlight-cell.cjs.map +0 -1
  124. package/dist/cjs/components/data-table/index.cjs +0 -2
  125. package/dist/cjs/components/data-table/index.cjs.map +0 -1
  126. package/dist/cjs/components/data-table/interactive-element.cjs.map +0 -1
  127. package/dist/cjs/components/data-table/interactive-link.cjs.map +0 -1
  128. package/dist/cjs/components/data-table/private/cell-context.cjs.map +0 -1
  129. package/dist/cjs/components/data-table/private/cell-fixed.cjs.map +0 -1
  130. package/dist/cjs/components/data-table/private/context-helper.cjs.map +0 -1
  131. package/dist/cjs/components/data-table/private/head.cjs.map +0 -1
  132. package/dist/cjs/components/data-table/private/header-cell.cjs +0 -2
  133. package/dist/cjs/components/data-table/private/header-cell.cjs.map +0 -1
  134. package/dist/cjs/components/data-table/private/link.cjs.map +0 -1
  135. package/dist/cjs/components/data-table/private/mode.cjs.map +0 -1
  136. package/dist/cjs/components/data-table/private/row.cjs +0 -2
  137. package/dist/cjs/components/data-table/private/row.cjs.map +0 -1
  138. package/dist/cjs/components/data-table/private/table-context.cjs.map +0 -1
  139. package/dist/cjs/components/data-table/row-actions.cjs.map +0 -1
  140. package/dist/cjs/components/data-table.cjs +0 -1
  141. package/dist/es/components/data-table/cell.js.map +0 -1
  142. package/dist/es/components/data-table/check-props.js.map +0 -1
  143. package/dist/es/components/data-table/column-check-props.js.map +0 -1
  144. package/dist/es/components/data-table/column.js +0 -8
  145. package/dist/es/components/data-table/column.js.map +0 -1
  146. package/dist/es/components/data-table/component.js.map +0 -1
  147. package/dist/es/components/data-table/highlight-cell.js.map +0 -1
  148. package/dist/es/components/data-table/index.js.map +0 -1
  149. package/dist/es/components/data-table/interactive-element.js.map +0 -1
  150. package/dist/es/components/data-table/interactive-link.js.map +0 -1
  151. package/dist/es/components/data-table/private/cell-context.js.map +0 -1
  152. package/dist/es/components/data-table/private/cell-fixed.js.map +0 -1
  153. package/dist/es/components/data-table/private/context-helper.js.map +0 -1
  154. package/dist/es/components/data-table/private/head.js.map +0 -1
  155. package/dist/es/components/data-table/private/header-cell.js.map +0 -1
  156. package/dist/es/components/data-table/private/link.js.map +0 -1
  157. package/dist/es/components/data-table/private/mode.js.map +0 -1
  158. package/dist/es/components/data-table/private/row.js.map +0 -1
  159. package/dist/es/components/data-table/private/table-context.js.map +0 -1
  160. package/dist/es/components/data-table/row-actions.js.map +0 -1
  161. package/dist/es/components/data-table.js +0 -2
  162. package/dist/types/components/data-table/cell.d.ts.map +0 -1
  163. package/dist/types/components/data-table/check-props.d.ts.map +0 -1
  164. package/dist/types/components/data-table/column-check-props.d.ts.map +0 -1
  165. package/dist/types/components/data-table/column.d.ts.map +0 -1
  166. package/dist/types/components/data-table/data-table.d.ts +0 -15
  167. package/dist/types/components/data-table/data-table.d.ts.map +0 -1
  168. package/dist/types/components/data-table/highlight-cell.d.ts +0 -14
  169. package/dist/types/components/data-table/highlight-cell.d.ts.map +0 -1
  170. package/dist/types/components/data-table/index.d.ts.map +0 -1
  171. package/dist/types/components/data-table/interactive-element.d.ts.map +0 -1
  172. package/dist/types/components/data-table/interactive-link.d.ts.map +0 -1
  173. package/dist/types/components/data-table/private/cell-context.d.ts.map +0 -1
  174. package/dist/types/components/data-table/private/cell-fixed.d.ts.map +0 -1
  175. package/dist/types/components/data-table/private/context-helper.d.ts.map +0 -1
  176. package/dist/types/components/data-table/private/head.d.ts.map +0 -1
  177. package/dist/types/components/data-table/private/header-cell.d.ts.map +0 -1
  178. package/dist/types/components/data-table/private/link.d.ts.map +0 -1
  179. package/dist/types/components/data-table/private/mode.d.ts.map +0 -1
  180. package/dist/types/components/data-table/private/row.d.ts.map +0 -1
  181. package/dist/types/components/data-table/private/table-context.d.ts.map +0 -1
  182. package/dist/types/components/data-table/row-actions.d.ts.map +0 -1
  183. package/dist/types/components/data-table/types.d.ts.map +0 -1
  184. package/dist/types/components/data-table.d.ts +0 -2
  185. /package/dist/cjs/components/{data-table → simple-data-table}/column-check-props.cjs +0 -0
  186. /package/dist/cjs/components/{data-table → simple-data-table}/interactive-element.cjs +0 -0
  187. /package/dist/cjs/components/{data-table → simple-data-table}/interactive-link.cjs +0 -0
  188. /package/dist/cjs/components/{data-table → simple-data-table}/private/cell-context.cjs +0 -0
  189. /package/dist/cjs/components/{data-table → simple-data-table}/private/cell-fixed.cjs +0 -0
  190. /package/dist/cjs/components/{data-table → simple-data-table}/private/context-helper.cjs +0 -0
  191. /package/dist/cjs/components/{data-table → simple-data-table}/private/link.cjs +0 -0
  192. /package/dist/cjs/components/{data-table → simple-data-table}/private/mode.cjs +0 -0
  193. /package/dist/cjs/components/{data-table → simple-data-table}/private/table-context.cjs +0 -0
  194. /package/dist/types/components/{data-table → simple-data-table}/check-props.d.ts +0 -0
  195. /package/dist/types/components/{data-table → simple-data-table}/column-check-props.d.ts +0 -0
  196. /package/dist/types/components/{data-table → simple-data-table}/interactive-element.d.ts +0 -0
  197. /package/dist/types/components/{data-table → simple-data-table}/interactive-link.d.ts +0 -0
  198. /package/dist/types/components/{data-table → simple-data-table}/private/cell-context.d.ts +0 -0
  199. /package/dist/types/components/{data-table → simple-data-table}/private/cell-fixed.d.ts +0 -0
  200. /package/dist/types/components/{data-table → simple-data-table}/private/context-helper.d.ts +0 -0
  201. /package/dist/types/components/{data-table → simple-data-table}/private/link.d.ts +0 -0
  202. /package/dist/types/components/{data-table → simple-data-table}/private/mode.d.ts +0 -0
  203. /package/dist/types/components/{data-table → simple-data-table}/private/table-context.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { DATA_TABLE as e, DATA_TABLE_HEAD as t, DATA_TABLE_ROW as n } from "../../utilities/constants.js";
1
+ import { SIMPLE_DATA_TABLE as e, SIMPLE_DATA_TABLE_HEAD as t, SIMPLE_DATA_TABLE_ROW as n } from "../../utilities/constants.js";
2
2
  import r from "../../utilities/generate-id.js";
3
3
  import i from "../../utilities/key-code.js";
4
4
  import { canUseDOM as a, canUseEventListeners as o } from "../../utilities/execution-environment.js";
@@ -22,9 +22,8 @@ import { dequal as w } from "dequal";
22
22
  import T from "lodash.assign";
23
23
  import E from "lodash.reject";
24
24
  import D from "memoize-one";
25
- import O from "column-resizer";
26
- //#region components/data-table/index.tsx
27
- var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j = {
25
+ //#region components/simple-data-table/index.tsx
26
+ var { tableBorderRadius: O } = f, k = (e) => Array.isArray(e) ? e.length : 0, A = {
28
27
  assistiveText: {
29
28
  actionsHeader: "Actions",
30
29
  columnSort: "Sort by: ",
@@ -38,19 +37,14 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
38
37
  selection: [],
39
38
  disabledSelection: [],
40
39
  hasMore: !1,
41
- loadMoreOffset: 20,
42
- resizable: !1,
43
- resizableOptions: {
44
- resizeMode: "fit",
45
- draggingClass: "slds-table-column-resizer"
46
- }
47
- }, M = D((e, t, n, r, i, a, o) => {
40
+ loadMoreOffset: 20
41
+ }, j = D((e, t, n, r, i, a, o) => {
48
42
  let s = {
49
- ...j.assistiveText,
43
+ ...A.assistiveText,
50
44
  ...e
51
45
  };
52
46
  return t && (s.actionsHeader = t), a && (s.selectAllRows = a), r && (s.columnSortedAscending = r), i && (s.columnSortedDescending = i), n && (s.columnSort = n), o && (s.selectRow = o), s;
53
- }, w), N = D((e, t, n, r, i, a) => {
47
+ }, w), M = D((e, t, n, r, i, a) => {
54
48
  let o = [], s = null;
55
49
  return b.Children.forEach(e, (e) => {
56
50
  let c = e, l = c?.type;
@@ -63,7 +57,7 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
63
57
  };
64
58
  t && (s.id = t);
65
59
  let l, u = e, d = u?.type;
66
- u && d?.displayName === "SLDSDataTableCell" ? (l = u.type, T(s, u.props)) : l = m, o.push({
60
+ u && d?.displayName === "SLDSSimpleDataTableCell" ? (l = u.type, T(s, u.props)) : l = m, o.push({
67
61
  Cell: l,
68
62
  props: s
69
63
  });
@@ -75,23 +69,20 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
75
69
  columns: o,
76
70
  RowActions: s
77
71
  };
78
- }, w), P = class extends b.Component {
72
+ }, w), N = class extends b.Component {
79
73
  static displayName = e;
80
- static defaultProps = j;
74
+ static defaultProps = A;
81
75
  generatedId;
82
76
  headerRefs;
83
- gripRefs;
84
77
  scrollerRef;
85
- fixedHeaderContainer;
86
78
  interactiveElements;
87
79
  tableRef;
88
- resizer;
89
80
  constructor(t) {
90
81
  super(t), this.generatedId = r(), this.headerRefs = {
91
82
  action: [],
92
83
  column: [],
93
84
  select: []
94
- }, this.gripRefs = [], this.scrollerRef = null, this.fixedHeaderContainer = null, this.state = {
85
+ }, this.scrollerRef = null, this.state = {
95
86
  activeCell: {
96
87
  rowIndex: 1,
97
88
  columnIndex: +!!this.props.selectRows
@@ -103,41 +94,17 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
103
94
  }, this.interactiveElements = {}, this.changeActiveCell = this.changeActiveCell.bind(this), this.changeActiveElement = this.changeActiveElement.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this), this.registerInteractiveElement = this.registerInteractiveElement.bind(this), l(e, t, u);
104
95
  }
105
96
  componentDidMount() {
106
- this.getFixedHeader() && (this.toggleFixedHeaderListeners(!0), this.resizeFixedHeaders()), this.isResizable() && this.enableResize();
97
+ this.props.fixedHeader && (this.toggleFixedHeaderListeners(!0), this.resizeFixedHeaders());
107
98
  }
108
99
  componentDidUpdate(e, t) {
109
- this.getFixedHeader() && (this.resizeFixedHeaders(), this.loadMoreIfNeeded()), this.state.allowKeyboardNavigation && !t.allowKeyboardNavigation && this.setState({ tableHasFocus: !0 }), this.isResizable() ? this.enableResize() : this.resizer && this.disableResize();
100
+ this.props.fixedHeader && (this.resizeFixedHeaders(), this.loadMoreIfNeeded()), this.state.allowKeyboardNavigation && !t.allowKeyboardNavigation && this.setState({ tableHasFocus: !0 });
110
101
  }
111
102
  componentWillUnmount() {
112
- this.toggleFixedHeaderListeners(!1), this.isResizable() && this.disableResize();
113
- }
114
- onResize() {
115
- let e = this.tableRef;
116
- if (e) {
117
- let t = this.getFixedHeader() ? e.getElementsByClassName("slds-cell-fixed") : e.getElementsByTagName("th");
118
- return Array.from(t).map((e, t) => {
119
- let { id: n, style: r } = e;
120
- return {
121
- id: n,
122
- index: t,
123
- width: parseInt(r.width, 10)
124
- };
125
- });
126
- }
127
- return [];
103
+ this.toggleFixedHeaderListeners(!1);
128
104
  }
129
105
  getId() {
130
106
  return this.props.id || this.generatedId;
131
107
  }
132
- getFixedHeader() {
133
- return this.props.fixedHeader || this.props.resizable;
134
- }
135
- getKeyboardNavigation() {
136
- return this.props.keyboardNavigation || this.props.resizable;
137
- }
138
- getFixedLayout() {
139
- return this.props.fixedLayout || this.props.resizable;
140
- }
141
108
  getFirstInteractiveElement(e, t) {
142
109
  return this.state.mode === g.ACTIONABLE && this.interactiveElements[e] && this.interactiveElements[e][t] ? this.interactiveElements[e][t][0] : null;
143
110
  }
@@ -169,22 +136,6 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
169
136
  r = t ? this.props.selectRows === "radio" ? [e] : [...this.props.selection ?? [], e] : E(this.props.selection ?? [], e), this.props.onRowChange(n, { selection: r });
170
137
  }
171
138
  };
172
- repositionResizers = () => {
173
- let e = [
174
- ...this.headerRefs.select,
175
- ...this.headerRefs.column,
176
- ...this.headerRefs.action
177
- ];
178
- if (this.gripRefs && this.tableRef) {
179
- let t = this.tableRef.getBoundingClientRect();
180
- this.gripRefs.forEach((n, r) => {
181
- let i = e[r];
182
- if (!i) return;
183
- let a = i.getBoundingClientRect(), o = a.left - t.left + a.width;
184
- n.style.left = `${o}px`;
185
- });
186
- }
187
- };
188
139
  resizeFixedHeaders = (e) => {
189
140
  let t = [
190
141
  ...this.headerRefs.select,
@@ -221,44 +172,12 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
221
172
  });
222
173
  else {
223
174
  let t = e ? "addEventListener" : "removeEventListener";
224
- o && (window[t]("resize", this.resizeFixedHeaders), window[t]("resize", this.loadMoreIfNeeded)), o && this.scrollerRef && (this.scrollerRef[t]("scroll", this.resizeFixedHeaders), this.scrollerRef[t]("scroll", this.loadMoreIfNeeded), this.scrollerRef[t]("scroll", this.repositionResizers));
175
+ o && (window[t]("resize", this.resizeFixedHeaders), window[t]("resize", this.loadMoreIfNeeded)), o && this.scrollerRef && (this.scrollerRef[t]("scroll", this.resizeFixedHeaders), this.scrollerRef[t]("scroll", this.loadMoreIfNeeded));
225
176
  }
226
177
  };
227
178
  UNSAFE_componentWillUpdate(e) {
228
179
  this.props.items !== e.items && (this.interactiveElements = {});
229
180
  }
230
- isResizable() {
231
- return this.props.fixedLayout && this.props.resizable;
232
- }
233
- resizeGrips() {
234
- let e = this.fixedHeaderContainer;
235
- if (e) {
236
- let t = Array.from(e.getElementsByClassName("grip-handle"));
237
- t.length && (this.gripRefs = t, this.gripRefs.forEach((e) => {
238
- e.style.height = `${parseInt(e.style.height, 10) + 33}px`;
239
- }));
240
- }
241
- }
242
- enableResize() {
243
- if (a) {
244
- let e = this.tableRef, t = this.getFixedHeader(), n = [];
245
- if (this.props.selectRows && n.push(0), !this.resizer) {
246
- let r = {
247
- ...j.resizableOptions,
248
- disabledColumns: n,
249
- ...this.props.resizableOptions
250
- }, i = this.props.resizableOptions?.onResize;
251
- r.onResize = (e) => {
252
- t && (this.resizeFixedHeaders(e), this.repositionResizers());
253
- let n = this.onResize();
254
- i && i(n), this.resizeGrips();
255
- }, e && (this.resizer = new O(e, r), e.classList.remove("grip-padding"), t && this.resizeFixedHeaders(), this.resizeGrips(), this.repositionResizers()), this.setState({}, () => this.state);
256
- }
257
- }
258
- }
259
- disableResize() {
260
- this.resizer && this.resizer.reset({ disable: !0 }), this.gripRefs = [];
261
- }
262
181
  changeActiveCell(e, t) {
263
182
  this.setState({
264
183
  tableHasFocus: !0,
@@ -286,66 +205,44 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
286
205
  } });
287
206
  }
288
207
  handleKeyDownUp() {
289
- if (this.state.mode === g.NAVIGATION || this.state.activeCell.rowIndex > 0 || !this.isResizable()) {
290
- let e = Math.max(this.state.activeCell.rowIndex - 1, 0), t = this.getFirstInteractiveElement(e, this.state.activeCell.columnIndex);
291
- e !== this.state.activeCell.rowIndex && (this.setState((n) => ({
292
- activeCell: {
293
- rowIndex: e,
294
- columnIndex: n.activeCell.columnIndex
295
- },
296
- activeElement: t
297
- })), this.state.mode === g.ACTIONABLE && e === 0 && !t && this.makeGripVisible(this.state.activeCell.columnIndex));
298
- }
208
+ let e = Math.max(this.state.activeCell.rowIndex - 1, 0), t = this.getFirstInteractiveElement(e, this.state.activeCell.columnIndex);
209
+ e !== this.state.activeCell.rowIndex && this.setState((n) => ({
210
+ activeCell: {
211
+ rowIndex: e,
212
+ columnIndex: n.activeCell.columnIndex
213
+ },
214
+ activeElement: t
215
+ }));
299
216
  }
300
217
  handleKeyDownDown() {
301
- if (this.state.mode === g.NAVIGATION || this.state.activeCell.rowIndex > 0 || !this.isResizable()) {
302
- let e = Math.min(this.state.activeCell.rowIndex + 1, this.props.items.length), t = this.getFirstInteractiveElement(e, this.state.activeCell.columnIndex);
303
- e !== this.state.activeCell.rowIndex && this.setState((n) => ({
304
- activeCell: {
305
- rowIndex: e,
306
- columnIndex: n.activeCell.columnIndex
307
- },
308
- activeElement: t
309
- }));
310
- }
311
- }
312
- displaceByArrowKey(e) {
313
- if (this.state.mode === g.ACTIONABLE) {
314
- let { rowIndex: t, columnIndex: n } = this.state.activeCell;
315
- if (t === 0 && this.tableRef) {
316
- let t = this.tableRef.getElementsByTagName("th");
317
- t[n].style.width = `${parseInt(t[n].style.width, 10) + e}px`, this.resizeFixedHeaders(), this.repositionResizers(), this.resizeGrips();
318
- }
319
- }
320
- }
321
- makeGripVisible(e) {
322
- this.gripRefs.forEach((t, n) => {
323
- n === e ? t.classList.add("grip-handle-active") : t.classList.remove("grip-handle-active");
324
- });
218
+ let e = Math.min(this.state.activeCell.rowIndex + 1, this.props.items.length), t = this.getFirstInteractiveElement(e, this.state.activeCell.columnIndex);
219
+ e !== this.state.activeCell.rowIndex && this.setState((n) => ({
220
+ activeCell: {
221
+ rowIndex: e,
222
+ columnIndex: n.activeCell.columnIndex
223
+ },
224
+ activeElement: t
225
+ }));
325
226
  }
326
227
  handleKeyDownLeft() {
327
- if (this.state.mode === g.NAVIGATION || this.state.activeCell.rowIndex > 0 || !this.isResizable()) {
328
- let e = Math.max(this.state.activeCell.columnIndex - 1, 0), t = this.getFirstInteractiveElement(this.state.activeCell.rowIndex, e);
329
- e !== this.state.activeCell.columnIndex && this.setState((n) => ({
330
- activeCell: {
331
- rowIndex: n.activeCell.rowIndex,
332
- columnIndex: e
333
- },
334
- activeElement: t
335
- }));
336
- } else this.displaceByArrowKey(-10);
228
+ let e = Math.max(this.state.activeCell.columnIndex - 1, 0), t = this.getFirstInteractiveElement(this.state.activeCell.rowIndex, e);
229
+ e !== this.state.activeCell.columnIndex && this.setState((n) => ({
230
+ activeCell: {
231
+ rowIndex: n.activeCell.rowIndex,
232
+ columnIndex: e
233
+ },
234
+ activeElement: t
235
+ }));
337
236
  }
338
237
  handleKeyDownRight() {
339
- if (this.state.mode === g.NAVIGATION || this.state.activeCell.rowIndex > 0 || !this.isResizable()) {
340
- let e = Math.min(this.state.activeCell.columnIndex + 1, b.Children.count(this.props.children) - +!this.props.selectRows), t = this.getFirstInteractiveElement(this.state.activeCell.rowIndex, e);
341
- e !== this.state.activeCell.columnIndex && this.setState((n) => ({
342
- activeCell: {
343
- rowIndex: n.activeCell.rowIndex,
344
- columnIndex: e
345
- },
346
- activeElement: t
347
- }));
348
- } else this.displaceByArrowKey(10);
238
+ let e = Math.min(this.state.activeCell.columnIndex + 1, b.Children.count(this.props.children) - +!this.props.selectRows), t = this.getFirstInteractiveElement(this.state.activeCell.rowIndex, e);
239
+ e !== this.state.activeCell.columnIndex && this.setState((n) => ({
240
+ activeCell: {
241
+ rowIndex: n.activeCell.rowIndex,
242
+ columnIndex: e
243
+ },
244
+ activeElement: t
245
+ }));
349
246
  }
350
247
  handleKeyDownEnter() {
351
248
  if (this.state.mode === g.NAVIGATION) {
@@ -353,14 +250,14 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
353
250
  this.interactiveElements[e] && this.interactiveElements[e][t] && ([n] = this.interactiveElements[e][t]), this.setState({
354
251
  mode: g.ACTIONABLE,
355
252
  activeElement: n
356
- }), e === 0 && !n && this.makeGripVisible(t);
253
+ });
357
254
  }
358
255
  }
359
256
  handleKeyDownEscape() {
360
- this.state.mode === g.ACTIONABLE && (this.setState({
257
+ this.state.mode === g.ACTIONABLE && this.setState({
361
258
  mode: g.NAVIGATION,
362
259
  activeElement: null
363
- }), this.makeGripVisible(null));
260
+ });
364
261
  }
365
262
  moveNext(e, t, n) {
366
263
  let r = [
@@ -385,7 +282,7 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
385
282
  let { rowIndex: t, columnIndex: n } = this.state.activeCell;
386
283
  if (this.state.mode === g.ACTIONABLE) {
387
284
  let r = this.handleNextActionable(e);
388
- if (r) this.setState({ activeElement: r }), this.isResizable() && this.makeGripVisible(null);
285
+ if (r) this.setState({ activeElement: r });
389
286
  else if (t === 0) {
390
287
  let t = [
391
288
  ...this.headerRefs.select,
@@ -397,7 +294,7 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
397
294
  activeElement: null
398
295
  }), t.forEach((e, t) => {
399
296
  e && (t === r ? (e.tabIndex = 0, e.focus()) : e.tabIndex = -1);
400
- }), this.isResizable() && this.makeGripVisible(r);
297
+ });
401
298
  } else this.moveNext(e, t, n), this.setState({
402
299
  mode: g.ACTIONABLE,
403
300
  activeElement: null
@@ -410,22 +307,22 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
410
307
  r.includes(n) || (this.interactiveElements[e][t] = [...r, n]);
411
308
  }
412
309
  render() {
413
- let e = {}, i = this.props.selection ?? [], a = this.props.disabledSelection ?? [], o = A(this.props.items), c = A(i.filter((e) => !a.includes(e))), l = A(this.props.items.filter((e) => e.type !== "header-row" && !a.includes(e))), u = this.props.selectRows && l > 0 ? this.props.selectRows : !1, f = u && l === c, m = u && l !== c && c !== 0, { columns: h, RowActions: y } = N(this.props.children, this.props.id, this.getFixedHeader(), this.props.fixedLayout, this.props.items, this.props.search), w = M(this.props.assistiveText, this.props.assistiveTextForActionsHeader, this.props.assistiveTextForSelectAllRows, this.props.assistiveTextForColumnSortedAscending, this.props.assistiveTextForColumnSortedDescending, this.props.assistiveTextForColumnSort, this.props.assistiveTextForSelectRow);
310
+ let e = {}, i = this.props.selection ?? [], a = this.props.disabledSelection ?? [], o = k(this.props.items), c = k(i.filter((e) => !a.includes(e))), l = k(this.props.items.filter((e) => e.type !== "header-row" && !a.includes(e))), u = this.props.selectRows && l > 0 ? this.props.selectRows : !1, f = u && l === c, m = u && l !== c && c !== 0, { columns: h, RowActions: y } = M(this.props.children, this.props.id, this.props.fixedHeader, this.props.fixedLayout, this.props.items, this.props.search), w = j(this.props.assistiveText, this.props.assistiveTextForActionsHeader, this.props.assistiveTextForSelectAllRows, this.props.assistiveTextForColumnSortedAscending, this.props.assistiveTextForColumnSortedDescending, this.props.assistiveTextForColumnSort, this.props.assistiveTextForSelectRow);
414
311
  this.props.selectRows && this.props.selectRows !== "radio" && (e["aria-multiselectable"] = "true"), this.headerRefs = {
415
312
  action: y ? this.headerRefs.action : [],
416
313
  column: this.headerRefs.column.slice(0, h.length),
417
314
  select: u ? this.headerRefs.select : []
418
315
  };
419
316
  let T = /* @__PURE__ */ C(b.Fragment, { children: [/* @__PURE__ */ S(p.Provider, {
420
- value: this.getTableContext(this.state, this.getKeyboardNavigation()),
317
+ value: this.getTableContext(this.state, this.props.keyboardNavigation),
421
318
  children: /* @__PURE__ */ C("table", {
422
319
  ...e,
423
320
  className: x("slds-table", {
424
- "slds-table_fixed-layout": this.getFixedLayout(),
425
- "slds-table_header-fixed": this.getFixedHeader(),
426
- "slds-table_resizable-cols": this.getFixedLayout(),
321
+ "slds-table_fixed-layout": this.props.fixedLayout,
322
+ "slds-table_header-fixed": this.props.fixedHeader,
323
+ "slds-table_resizable-cols": this.props.fixedLayout,
427
324
  "slds-table_bordered": !this.props.unborderedRow,
428
- "slds-table_cell-buffer": !this.getFixedLayout() && !this.props.unbufferedCell,
325
+ "slds-table_cell-buffer": !this.props.fixedLayout && !this.props.unbufferedCell,
429
326
  "slds-max-medium-table_stacked": this.props.stacked,
430
327
  "slds-max-medium-table_stacked-horizontal": this.props.stackedHorizontal,
431
328
  "slds-table_striped": this.props.striped,
@@ -437,20 +334,20 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
437
334
  ref: (e) => {
438
335
  e && (this.tableRef = e);
439
336
  },
440
- role: this.getFixedLayout() ? "grid" : void 0,
337
+ role: this.props.fixedLayout ? "grid" : void 0,
441
338
  onBlur: (e) => {
442
- this.tableRef && !this.tableRef.contains(e.relatedTarget) && (this.setState({
339
+ this.tableRef && !this.tableRef.contains(e.relatedTarget) && this.setState({
443
340
  tableHasFocus: !1,
444
341
  mode: g.NAVIGATION,
445
342
  activeElement: null
446
- }), this.makeGripVisible(null));
343
+ });
447
344
  },
448
345
  style: this.props.style,
449
346
  children: [/* @__PURE__ */ S(_, {
450
347
  assistiveText: w,
451
348
  allSelected: f,
452
- fixedHeader: this.getFixedHeader(),
453
- fixedLayout: this.getFixedLayout(),
349
+ fixedHeader: this.props.fixedHeader,
350
+ fixedLayout: this.props.fixedLayout,
454
351
  headerRefs: (e, t) => {
455
352
  t === "action" || t === "select" ? e ? this.headerRefs[t][0] = e : this.headerRefs[t] = [] : this.headerRefs.column[t] = e;
456
353
  },
@@ -477,7 +374,7 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
477
374
  canSelectRows: u,
478
375
  className: e.classNameRow,
479
376
  columns: h,
480
- fixedLayout: this.getFixedLayout(),
377
+ fixedLayout: this.props.fixedLayout,
481
378
  id: i,
482
379
  index: t,
483
380
  item: e,
@@ -490,7 +387,7 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
490
387
  }, i);
491
388
  }) : null })]
492
389
  })
493
- }), this.getFixedHeader() && this.props.hasMore && /* @__PURE__ */ S("div", {
390
+ }), this.props.fixedHeader && this.props.hasMore && /* @__PURE__ */ S("div", {
494
391
  className: "slds-is-relative slds-p-around_large",
495
392
  children: /* @__PURE__ */ S(s, {
496
393
  assistiveText: { label: this.props.assistiveText?.loadingMore },
@@ -499,18 +396,13 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
499
396
  variant: "brand"
500
397
  })
501
398
  })] });
502
- if (this.getFixedHeader()) {
399
+ if (this.props.fixedHeader) {
503
400
  let e = `1px solid ${d}`, t = {
504
401
  borderTop: e,
505
402
  height: "100%"
506
403
  };
507
- this.props.joined && (t.borderBottom = e, t.borderLeft = e, t.borderRight = e, t.borderTop = "none", t.borderRadius = k);
508
- let n = { height: "100%" };
509
- this.props.resizable ? (n.overflowY = "auto", n.overflowX = "hidden") : n.overflow = "auto", T = /* @__PURE__ */ S("div", {
404
+ this.props.joined && (t.borderBottom = e, t.borderLeft = e, t.borderRight = e, t.borderTop = "none", t.borderRadius = O), T = /* @__PURE__ */ S("div", {
510
405
  className: "slds-table_header-fixed_container",
511
- ref: (e) => {
512
- this.fixedHeaderContainer = e;
513
- },
514
406
  style: t,
515
407
  onScroll: (e) => {
516
408
  let t = e.target.scrollLeft;
@@ -521,7 +413,10 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
521
413
  ref: (e) => {
522
414
  this.scrollerRef = e;
523
415
  },
524
- style: n,
416
+ style: {
417
+ height: "100%",
418
+ overflow: "auto"
419
+ },
525
420
  children: T
526
421
  })
527
422
  });
@@ -530,6 +425,6 @@ var { tableBorderRadius: k } = f, A = (e) => Array.isArray(e) ? e.length : 0, j
530
425
  }
531
426
  };
532
427
  //#endregion
533
- export { P as default };
428
+ export { N as default };
534
429
 
535
430
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/simple-data-table/index.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// # Data Table Component\n\n// Implements the [Data Table design pattern](https://www.lightningdesignsystem.com/components/data-tables) in React.\n\nimport React, { type ReactElement, type ReactNode } from 'react';\n\nimport classNames from 'classnames';\nimport assign from 'lodash.assign';\nimport { dequal as isEqual } from 'dequal';\nimport memoize from 'memoize-one';\nimport reject from 'lodash.reject';\n// This component's `checkProps` which issues warnings to developers about properties when in development mode (similar to React's built in development tools)\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport {\n\tcanUseDOM,\n\tcanUseEventListeners,\n} from '../../utilities/execution-environment';\nimport { colorGray5 } from '../../utilities/design-tokens/dist/palette-colors.common';\nimport salesforceSkin from '../../utilities/design-tokens/dist/salesforce-skin.common';\n\nconst { tableBorderRadius } = salesforceSkin;\n\n// ## Children\nimport SimpleDataTableCell from './cell';\nimport SimpleDataTableColumn from './column';\nimport SimpleDataTableHead from './private/head';\nimport SimpleDataTableRow from './private/row';\nimport SimpleDataTableRowActions from './row-actions';\nimport TableContext from './private/table-context';\nimport Mode, { type ModeType } from './private/mode';\nimport Spinner from '../spinner';\n\nimport KEYS from '../../utilities/key-code';\nimport generateId from '../../utilities/generate-id';\nimport mapKeyEventCallbacks from '../../utilities/key-callbacks';\n\nimport {\n\tSIMPLE_DATA_TABLE,\n\tSIMPLE_DATA_TABLE_CELL,\n\tSIMPLE_DATA_TABLE_HEAD,\n\tSIMPLE_DATA_TABLE_ROW,\n} from '../../utilities/constants';\n\nimport type {\n\tSimpleDataTableProps,\n\tSimpleDataTableItem,\n\tSimpleDataTableColumnConfig,\n\tSimpleDataTableColumnProps,\n\tSimpleDataTableCellProps,\n\tSimpleDataTableAssistiveText,\n} from './types';\n\n// The main SimpleDataTable component's state.\ninterface SimpleDataTableState {\n\t// Currently selected cell\n\tactiveCell: { rowIndex: number; columnIndex: number };\n\t// Interactive element within a cell that receives focus when in actionable mode\n\tactiveElement: string | null;\n\t// The table can be in navigation or actionable mode\n\tmode: ModeType;\n\t// The table currently has focus\n\ttableHasFocus: boolean;\n\t// Allows for keyboard navigation\n\tallowKeyboardNavigation?: boolean;\n}\n\n// Safely get the length of an array, returning 0 for invalid input.\nconst count = (array: unknown): number =>\n\tArray.isArray(array) ? array.length : 0;\n\nconst defaultProps = {\n\tassistiveText: {\n\t\tactionsHeader: 'Actions',\n\t\tcolumnSort: 'Sort by: ',\n\t\tcolumnSortedAscending: 'Sorted Ascending',\n\t\tcolumnSortedDescending: 'Sorted Descending',\n\t\tselectAllRows: 'Select all rows',\n\t\tselectRow: 'Select row',\n\t\tselectRowGroup: 'Choose a row to select',\n\t\tloadingMore: 'Loading more',\n\t},\n\tselection: [] as SimpleDataTableItem[],\n\tdisabledSelection: [] as SimpleDataTableItem[],\n\thasMore: false,\n\tloadMoreOffset: 20,\n};\n\nconst getAssistiveText = memoize(\n\t(\n\t\tassistiveText: SimpleDataTableAssistiveText | undefined,\n\t\tactionsHeaderText: string | undefined,\n\t\tcolumnSortText: string | undefined,\n\t\tcolumnSortedAscendingText: string | undefined,\n\t\tcolumnSortedDescendingText: string | undefined,\n\t\tselectAllRowsText: string | undefined,\n\t\tselectRowText: string | undefined\n\t): SimpleDataTableAssistiveText => {\n\t\tconst result: SimpleDataTableAssistiveText = {\n\t\t\t...defaultProps.assistiveText,\n\t\t\t...assistiveText,\n\t\t};\n\t\tif (actionsHeaderText) {\n\t\t\tresult.actionsHeader = actionsHeaderText;\n\t\t}\n\t\tif (selectAllRowsText) {\n\t\t\tresult.selectAllRows = selectAllRowsText;\n\t\t}\n\t\tif (columnSortedAscendingText) {\n\t\t\tresult.columnSortedAscending = columnSortedAscendingText;\n\t\t}\n\t\tif (columnSortedDescendingText) {\n\t\t\tresult.columnSortedDescending = columnSortedDescendingText;\n\t\t}\n\t\tif (columnSortText) {\n\t\t\tresult.columnSort = columnSortText;\n\t\t}\n\t\tif (selectRowText) {\n\t\t\tresult.selectRow = selectRowText;\n\t\t}\n\t\treturn result;\n\t},\n\tisEqual\n);\n\nconst getColumnsAndRowActions = memoize(\n\t(\n\t\tchildren: ReactNode,\n\t\tid: string | undefined,\n\t\tfixedHeader: boolean | undefined,\n\t\tfixedLayout: boolean | undefined,\n\t\titems: SimpleDataTableItem[],\n\t\tsearch: string | undefined\n\t): {\n\t\tcolumns: SimpleDataTableColumnConfig[];\n\t\tRowActions: ReactElement | null;\n\t} => {\n\t\tconst columns: SimpleDataTableColumnConfig[] = [];\n\t\tlet RowActions: ReactElement | null = null;\n\n\t\tReact.Children.forEach(children, (child) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tconst element = child as ReactElement<any> | null;\n\t\t\tconst elementType = element?.type as { displayName?: string } | undefined;\n\t\t\tif (\n\t\t\t\telement &&\n\t\t\t\telementType?.displayName === SimpleDataTableColumn.displayName\n\t\t\t) {\n\t\t\t\tconst { children: columnChildren, ...columnProps } = element.props;\n\t\t\t\tconst props: Record<string, unknown> = {\n\t\t\t\t\tfixedLayout,\n\t\t\t\t\tsearch,\n\t\t\t\t\titems,\n\t\t\t\t\t...columnProps,\n\t\t\t\t};\n\t\t\t\tif (id) {\n\t\t\t\t\tprops.id = id;\n\t\t\t\t}\n\n\t\t\t\tlet Cell;\n\t\t\t\tconst cellChild = columnChildren as ReactElement | undefined;\n\t\t\t\tconst cellChildType = cellChild?.type as\n\t\t\t\t\t{ displayName?: string } | undefined;\n\t\t\t\tif (\n\t\t\t\t\tcellChild &&\n\t\t\t\t\tcellChildType?.displayName === SIMPLE_DATA_TABLE_CELL\n\t\t\t\t) {\n\t\t\t\t\tCell = cellChild.type;\n\t\t\t\t\tassign(props, cellChild.props);\n\t\t\t\t} else {\n\t\t\t\t\tCell = SimpleDataTableCell;\n\t\t\t\t}\n\n\t\t\t\tcolumns.push({\n\t\t\t\t\tCell: Cell as React.ComponentType<SimpleDataTableCellProps>,\n\t\t\t\t\tprops: props as SimpleDataTableColumnProps,\n\t\t\t\t});\n\t\t\t} else if (\n\t\t\t\telement &&\n\t\t\t\telementType?.displayName === SimpleDataTableRowActions.displayName\n\t\t\t) {\n\t\t\t\tconst { dropdown } = element.props;\n\t\t\t\tconst dropdownPropOverrides: { menuPosition?: string } = {};\n\t\t\t\tif (fixedHeader) {\n\t\t\t\t\tdropdownPropOverrides.menuPosition = 'overflowBoundaryElement';\n\t\t\t\t}\n\t\t\t\tRowActions = React.cloneElement(element, {\n\t\t\t\t\tdropdown: dropdown\n\t\t\t\t\t\t? React.cloneElement(dropdown, dropdownPropOverrides)\n\t\t\t\t\t\t: null,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\treturn { columns, RowActions };\n\t},\n\tisEqual\n);\n\n/**\n * SimpleDataTables support the display of structured data in rows and columns with an HTML table. To sort, filter or paginate the table, simply update the data passed in the items to the table and it will re-render itself appropriately. The table will throw a sort event as needed, and helper components for paging and filtering are coming soon.\n *\n * NOTE: for horizontal scrolling with `fixedHeader`-enabled SimpleDataTables, see the `style` property description\n */\nclass SimpleDataTable extends React.Component<\n\tSimpleDataTableProps,\n\tSimpleDataTableState\n> {\n\t// ### Display Name\n\t// Always use the canonical component name as the React display name.\n\tstatic displayName = SIMPLE_DATA_TABLE;\n\n\tstatic defaultProps = defaultProps;\n\n\tgeneratedId: string;\n\n\theaderRefs: {\n\t\taction: (HTMLElement | null)[];\n\t\tcolumn: (HTMLElement | null)[];\n\t\tselect: (HTMLElement | null)[];\n\t};\n\n\tscrollerRef: HTMLElement | null;\n\n\t// Map of cells to interactive elements within that cell\n\tinteractiveElements: Record<number, Record<number, string[]>>;\n\n\ttableRef?: HTMLTableElement | null;\n\n\tconstructor(props: SimpleDataTableProps) {\n\t\tsuper(props);\n\t\tthis.generatedId = generateId();\n\t\tthis.headerRefs = {\n\t\t\taction: [],\n\t\t\tcolumn: [],\n\t\t\tselect: [],\n\t\t};\n\t\tthis.scrollerRef = null;\n\t\tthis.state = {\n\t\t\t// Currently selected cell\n\t\t\tactiveCell: {\n\t\t\t\trowIndex: 1,\n\t\t\t\tcolumnIndex: this.props.selectRows ? 1 : 0,\n\t\t\t},\n\t\t\t// Interactive element within a cell that receives focus when in actionable mode\n\t\t\tactiveElement: null,\n\t\t\t// The table can be in navigation or actionable mode\n\t\t\tmode: Mode.NAVIGATION,\n\t\t\t// The table currently has focus\n\t\t\ttableHasFocus: false,\n\t\t\t// Allows for keyboard navigation. This is useful for temporarily disabling keyboard navigation\n\t\t\t// when another component requires its own focus behavior (e.g. menu dropdown).\n\t\t\tallowKeyboardNavigation: props.keyboardNavigation,\n\t\t};\n\t\t// Map of cells to interactive elements within that cell\n\t\tthis.interactiveElements = {};\n\t\tthis.changeActiveCell = this.changeActiveCell.bind(this);\n\t\tthis.changeActiveElement = this.changeActiveElement.bind(this);\n\t\tthis.handleKeyDown = this.handleKeyDown.bind(this);\n\t\tthis.registerInteractiveElement =\n\t\t\tthis.registerInteractiveElement.bind(this);\n\n\t\t// `checkProps` issues warnings to developers about properties (similar to React's built in development tools)\n\t\t(checkProps as (name: string, props: unknown, doc?: unknown) => void)(\n\t\t\tSIMPLE_DATA_TABLE,\n\t\t\tprops,\n\t\t\tcomponentDoc\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tif (this.props.fixedHeader) {\n\t\t\tthis.toggleFixedHeaderListeners(true);\n\t\t\tthis.resizeFixedHeaders();\n\t\t}\n\t}\n\n\tcomponentDidUpdate(\n\t\t_prevProps: SimpleDataTableProps,\n\t\tprevState: SimpleDataTableState\n\t) {\n\t\tif (this.props.fixedHeader) {\n\t\t\tthis.resizeFixedHeaders();\n\t\t\t// If the first page of results isn't enough to allow the user to scroll it causes\n\t\t\t// the user to get into a state where they cannot load the second page.\n\t\t\t// Simulating a scroll here will ensure that enough rows are loaded to enable scrolling\n\t\t\tthis.loadMoreIfNeeded();\n\t\t}\n\n\t\tif (\n\t\t\tthis.state.allowKeyboardNavigation &&\n\t\t\t!prevState.allowKeyboardNavigation\n\t\t) {\n\t\t\t// When re-enabling keyboard navigation (e.g. when a dropdown closes), mark that\n\t\t\t// focus has returned to the table. This must wait until after `allowKeyboardNavigation`\n\t\t\t// is set in `onClose` because the callback could focus the incorrect element (e.g. dropdown\n\t\t\t// trigger) when it executes.\n\t\t\t// eslint-disable-next-line react/no-did-update-set-state\n\t\t\tthis.setState({ tableHasFocus: true });\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.toggleFixedHeaderListeners(false);\n\t}\n\n\tgetId() {\n\t\treturn this.props.id || this.generatedId;\n\t}\n\n\tgetFirstInteractiveElement(\n\t\trowIndex: number,\n\t\tcolumnIndex: number\n\t): string | null {\n\t\tif (\n\t\t\tthis.state.mode === Mode.ACTIONABLE &&\n\t\t\tthis.interactiveElements[rowIndex] &&\n\t\t\tthis.interactiveElements[rowIndex][columnIndex]\n\t\t) {\n\t\t\treturn this.interactiveElements[rowIndex][columnIndex][0];\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetTableContext = memoize(\n\t\t(\n\t\t\tstate: SimpleDataTableState,\n\t\t\tisKeyboardNavigation: boolean | undefined\n\t\t) => ({\n\t\t\tactiveCell: state.activeCell,\n\t\t\tactiveElement: state.activeElement,\n\t\t\tmode: state.mode,\n\t\t\ttableHasFocus: state.tableHasFocus,\n\t\t\tchangeActiveCell: this.changeActiveCell,\n\t\t\tchangeActiveElement: this.changeActiveElement,\n\t\t\thandleKeyDown: this.handleKeyDown,\n\t\t\tregisterInteractiveElement: this.registerInteractiveElement,\n\t\t\tallowKeyboardNavigation: state.allowKeyboardNavigation ?? false,\n\t\t\tsetAllowKeyboardNavigation: (allowKeyboardNavigation: boolean) => {\n\t\t\t\tif (isKeyboardNavigation) {\n\t\t\t\t\tthis.setState({ allowKeyboardNavigation });\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t);\n\n\thandleToggleAll = (\n\t\te: React.SyntheticEvent,\n\t\t{ checked }: { checked: boolean }\n\t) => {\n\t\tconst selection = this.props.selection ?? [];\n\t\tconst disabledSelection = this.props.disabledSelection ?? [];\n\t\tconst selectedDisabledItems = selection.filter((item) =>\n\t\t\tdisabledSelection.includes(item)\n\t\t);\n\t\tconst enabledItems = this.props.items.filter(\n\t\t\t(item) => !disabledSelection.includes(item)\n\t\t);\n\n\t\tconst newSelection = (\n\t\t\tchecked\n\t\t\t\t? [...enabledItems, ...selectedDisabledItems]\n\t\t\t\t: [...selectedDisabledItems]\n\t\t).filter((item) => item.type !== 'header-row');\n\n\t\t// REMOVE AT NEXT BREAKING CHANGE\n\t\t// `onChange` is deprecated and replaced with `onRowChange`\n\t\tif (typeof this.props.onChange === 'function') {\n\t\t\tthis.props.onChange(newSelection, e);\n\t\t}\n\n\t\tif (typeof this.props.onRowChange === 'function') {\n\t\t\tthis.props.onRowChange(e, { selection: newSelection });\n\t\t}\n\t};\n\n\thandleRowToggle = (\n\t\titem: SimpleDataTableItem,\n\t\tselected: boolean,\n\t\te: React.SyntheticEvent\n\t) => {\n\t\t// REMOVE AT NEXT BREAKING CHANGE\n\t\t// `onChange` is deprecated and replaced with `onRowChange`\n\t\tif (typeof this.props.onChange === 'function') {\n\t\t\tlet selection;\n\n\t\t\tif (selected) {\n\t\t\t\tselection =\n\t\t\t\t\tthis.props.selectRows === 'radio'\n\t\t\t\t\t\t? [item]\n\t\t\t\t\t\t: [...(this.props.selection ?? []), item];\n\t\t\t} else {\n\t\t\t\tselection = reject(this.props.selection ?? [], item);\n\t\t\t}\n\n\t\t\tthis.props.onChange(selection, e);\n\t\t}\n\t\t// DEPRECATED CODE ENDS HERE\n\n\t\tif (typeof this.props.onRowChange === 'function') {\n\t\t\tlet selection;\n\n\t\t\tif (selected) {\n\t\t\t\tselection =\n\t\t\t\t\tthis.props.selectRows === 'radio'\n\t\t\t\t\t\t? [item]\n\t\t\t\t\t\t: [...(this.props.selection ?? []), item];\n\t\t\t} else {\n\t\t\t\tselection = reject(this.props.selection ?? [], item);\n\t\t\t}\n\n\t\t\tthis.props.onRowChange(e, { selection });\n\t\t}\n\t};\n\n\tresizeFixedHeaders = (event?: Event) => {\n\t\tconst headerRefs = [\n\t\t\t...this.headerRefs.select,\n\t\t\t...this.headerRefs.column,\n\t\t\t...this.headerRefs.action,\n\t\t];\n\n\t\tif (this.props.onFixedHeaderResize) {\n\t\t\tthis.props.onFixedHeaderResize(event ?? null, {\n\t\t\t\theaderRefs: headerRefs.filter(Boolean) as HTMLElement[],\n\t\t\t\tscrollerRef: this.scrollerRef,\n\t\t\t});\n\t\t} else if (headerRefs.length > 0) {\n\t\t\tlet documentScrollLeft = 0;\n\n\t\t\tif (canUseDOM) {\n\t\t\t\tdocumentScrollLeft = document.documentElement.scrollLeft;\n\t\t\t}\n\n\t\t\theaderRefs.forEach((column) => {\n\t\t\t\tif (column && canUseDOM) {\n\t\t\t\t\tconst columnLeft =\n\t\t\t\t\t\tcolumn.getBoundingClientRect().left + documentScrollLeft;\n\t\t\t\t\tlet wrapperLeft = 0;\n\n\t\t\t\t\tif (this.scrollerRef) {\n\t\t\t\t\t\twrapperLeft =\n\t\t\t\t\t\t\tthis.scrollerRef.getBoundingClientRect().left +\n\t\t\t\t\t\t\tdocumentScrollLeft;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cellFixed = column.querySelector(\n\t\t\t\t\t\t'.slds-cell-fixed'\n\t\t\t\t\t) as HTMLElement | null;\n\n\t\t\t\t\tif (cellFixed) {\n\t\t\t\t\t\tcellFixed.style.left = `${columnLeft - wrapperLeft}px`;\n\t\t\t\t\t\tcellFixed.style.width = `${column.offsetWidth}px`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n\tloadMoreIfNeeded = () => {\n\t\tif (this.props.hasMore && this.props.onLoadMore && this.scrollerRef) {\n\t\t\tconst { scrollTop, offsetHeight, scrollHeight } = this.scrollerRef;\n\t\t\tif (\n\t\t\t\tscrollTop + offsetHeight >\n\t\t\t\tscrollHeight - (this.props.loadMoreOffset ?? 0)\n\t\t\t) {\n\t\t\t\tthis.props.onLoadMore();\n\t\t\t}\n\t\t}\n\t};\n\n\ttoggleFixedHeaderListeners = (attach: boolean) => {\n\t\tif (this.props.onToggleFixedHeaderListeners) {\n\t\t\tthis.props.onToggleFixedHeaderListeners(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\tattach,\n\t\t\t\t\tresizeHandler: this.resizeFixedHeaders,\n\t\t\t\t\tscrollerRef: this.scrollerRef,\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tconst method = attach ? 'addEventListener' : 'removeEventListener';\n\t\t\tif (canUseEventListeners) {\n\t\t\t\twindow[method]('resize', this.resizeFixedHeaders as EventListener);\n\t\t\t\twindow[method]('resize', this.loadMoreIfNeeded as EventListener);\n\t\t\t}\n\t\t\tif (canUseEventListeners && this.scrollerRef) {\n\t\t\t\tthis.scrollerRef[method](\n\t\t\t\t\t'scroll',\n\t\t\t\t\tthis.resizeFixedHeaders as EventListener\n\t\t\t\t);\n\t\t\t\tthis.scrollerRef[method](\n\t\t\t\t\t'scroll',\n\t\t\t\t\tthis.loadMoreIfNeeded as EventListener\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n\n\t// eslint-disable-next-line camelcase\n\tUNSAFE_componentWillUpdate(nextProps: SimpleDataTableProps) {\n\t\tif (this.props.items !== nextProps.items) {\n\t\t\tthis.interactiveElements = {};\n\t\t}\n\t}\n\n\tchangeActiveCell(rowIndex: number, columnIndex: number) {\n\t\tthis.setState({\n\t\t\ttableHasFocus: true,\n\t\t\tactiveCell: { rowIndex, columnIndex },\n\t\t});\n\t}\n\n\tchangeActiveElement(activeElement: string | null) {\n\t\tthis.setState({ activeElement, mode: Mode.ACTIONABLE });\n\t}\n\n\thandleKeyDown(event: React.KeyboardEvent) {\n\t\tmapKeyEventCallbacks(event, {\n\t\t\tcallbacks: {\n\t\t\t\t[KEYS.UP]: { callback: () => this.handleKeyDownUp() },\n\t\t\t\t[KEYS.DOWN]: { callback: () => this.handleKeyDownDown() },\n\t\t\t\t[KEYS.LEFT]: { callback: () => this.handleKeyDownLeft() },\n\t\t\t\t[KEYS.RIGHT]: { callback: () => this.handleKeyDownRight() },\n\t\t\t\t[KEYS.ENTER]: { callback: () => this.handleKeyDownEnter() },\n\t\t\t\t[KEYS.ESCAPE]: { callback: () => this.handleKeyDownEscape() },\n\t\t\t\t[KEYS.TAB]:\n\t\t\t\t\tthis.state.mode === Mode.ACTIONABLE\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tcallback: (evt: React.KeyboardEvent) =>\n\t\t\t\t\t\t\t\t\tthis.handleKeyTabPress(evt),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: null,\n\t\t\t},\n\t\t});\n\t}\n\n\thandleKeyDownUp() {\n\t\tconst newRowIndex = Math.max(this.state.activeCell.rowIndex - 1, 0);\n\t\tconst activeElement = this.getFirstInteractiveElement(\n\t\t\tnewRowIndex,\n\t\t\tthis.state.activeCell.columnIndex\n\t\t);\n\t\tif (newRowIndex !== this.state.activeCell.rowIndex) {\n\t\t\tthis.setState((prevState) => ({\n\t\t\t\tactiveCell: {\n\t\t\t\t\trowIndex: newRowIndex,\n\t\t\t\t\tcolumnIndex: prevState.activeCell.columnIndex,\n\t\t\t\t},\n\t\t\t\tactiveElement,\n\t\t\t}));\n\t\t}\n\t}\n\n\thandleKeyDownDown() {\n\t\tconst newRowIndex = Math.min(\n\t\t\tthis.state.activeCell.rowIndex + 1,\n\t\t\tthis.props.items.length\n\t\t);\n\t\tconst activeElement = this.getFirstInteractiveElement(\n\t\t\tnewRowIndex,\n\t\t\tthis.state.activeCell.columnIndex\n\t\t);\n\t\tif (newRowIndex !== this.state.activeCell.rowIndex) {\n\t\t\tthis.setState((prevState) => ({\n\t\t\t\tactiveCell: {\n\t\t\t\t\trowIndex: newRowIndex,\n\t\t\t\t\tcolumnIndex: prevState.activeCell.columnIndex,\n\t\t\t\t},\n\t\t\t\tactiveElement,\n\t\t\t}));\n\t\t}\n\t}\n\n\thandleKeyDownLeft() {\n\t\tconst newColumnIndex = Math.max(this.state.activeCell.columnIndex - 1, 0);\n\t\tconst activeElement = this.getFirstInteractiveElement(\n\t\t\tthis.state.activeCell.rowIndex,\n\t\t\tnewColumnIndex\n\t\t);\n\t\tif (newColumnIndex !== this.state.activeCell.columnIndex) {\n\t\t\tthis.setState((prevState) => ({\n\t\t\t\tactiveCell: {\n\t\t\t\t\trowIndex: prevState.activeCell.rowIndex,\n\t\t\t\t\tcolumnIndex: newColumnIndex,\n\t\t\t\t},\n\t\t\t\tactiveElement,\n\t\t\t}));\n\t\t}\n\t}\n\n\thandleKeyDownRight() {\n\t\tconst newColumnIndex = Math.min(\n\t\t\tthis.state.activeCell.columnIndex + 1,\n\t\t\tReact.Children.count(this.props.children) -\n\t\t\t\t(this.props.selectRows ? 0 : 1)\n\t\t);\n\t\tconst activeElement = this.getFirstInteractiveElement(\n\t\t\tthis.state.activeCell.rowIndex,\n\t\t\tnewColumnIndex\n\t\t);\n\t\tif (newColumnIndex !== this.state.activeCell.columnIndex) {\n\t\t\tthis.setState((prevState) => ({\n\t\t\t\tactiveCell: {\n\t\t\t\t\trowIndex: prevState.activeCell.rowIndex,\n\t\t\t\t\tcolumnIndex: newColumnIndex,\n\t\t\t\t},\n\t\t\t\tactiveElement,\n\t\t\t}));\n\t\t}\n\t}\n\n\thandleKeyDownEnter() {\n\t\tif (this.state.mode === Mode.NAVIGATION) {\n\t\t\tconst { rowIndex, columnIndex } = this.state.activeCell;\n\t\t\tlet activeElement: string | null = null;\n\t\t\tif (\n\t\t\t\tthis.interactiveElements[rowIndex] &&\n\t\t\t\tthis.interactiveElements[rowIndex][columnIndex]\n\t\t\t) {\n\t\t\t\t[activeElement] = this.interactiveElements[rowIndex][columnIndex];\n\t\t\t}\n\t\t\tthis.setState({\n\t\t\t\tmode: Mode.ACTIONABLE,\n\t\t\t\tactiveElement,\n\t\t\t});\n\t\t}\n\t}\n\n\thandleKeyDownEscape() {\n\t\tif (this.state.mode === Mode.ACTIONABLE) {\n\t\t\tthis.setState({\n\t\t\t\tmode: Mode.NAVIGATION,\n\t\t\t\tactiveElement: null,\n\t\t\t});\n\t\t}\n\t}\n\n\tmoveNext(event: React.KeyboardEvent, rowIndex: number, columnIndex: number) {\n\t\tconst headers = [\n\t\t\t...this.headerRefs.select,\n\t\t\t...this.headerRefs.column,\n\t\t\t...this.headerRefs.action,\n\t\t];\n\t\tlet newRowIndex = 0;\n\t\tlet newColumnIndex = 0;\n\n\t\tif (event.shiftKey) {\n\t\t\tif (columnIndex - 1 >= 0) {\n\t\t\t\tnewColumnIndex = columnIndex - 1;\n\t\t\t\tnewRowIndex = rowIndex;\n\t\t\t} else {\n\t\t\t\tif (rowIndex > 0) newRowIndex = rowIndex - 1;\n\t\t\t\telse newRowIndex = this.props.items.length;\n\n\t\t\t\tnewColumnIndex = headers.length - 1;\n\t\t\t}\n\t\t} else if (columnIndex + 1 < headers.length) {\n\t\t\tnewColumnIndex = columnIndex + 1;\n\t\t\tnewRowIndex = rowIndex;\n\t\t} else {\n\t\t\tif (rowIndex < this.props.items.length) newRowIndex = rowIndex + 1;\n\t\t\telse newRowIndex = 0;\n\n\t\t\tnewColumnIndex = 0;\n\t\t}\n\n\t\tthis.changeActiveCell(newRowIndex, newColumnIndex);\n\t}\n\n\thandleNextActionable(event: React.KeyboardEvent): string | null {\n\t\tconst { rowIndex, columnIndex } = this.state.activeCell;\n\t\tconst currentActiveElement = this.state.activeElement;\n\t\tconst rowActiveElements =\n\t\t\tthis.interactiveElements[rowIndex] &&\n\t\t\tthis.interactiveElements[rowIndex][columnIndex]\n\t\t\t\t? this.interactiveElements[rowIndex][columnIndex]\n\t\t\t\t: null;\n\n\t\tif (rowActiveElements) {\n\t\t\tif (currentActiveElement) {\n\t\t\t\tconst index = rowActiveElements.indexOf(currentActiveElement);\n\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\treturn index > 0 ? rowActiveElements[index - 1] : null;\n\t\t\t\t}\n\t\t\t\treturn index < rowActiveElements.length - 1\n\t\t\t\t\t? rowActiveElements[index + 1]\n\t\t\t\t\t: null;\n\t\t\t}\n\t\t\treturn !event.shiftKey\n\t\t\t\t? rowActiveElements[0]\n\t\t\t\t: rowActiveElements[rowActiveElements.length - 1];\n\t\t}\n\t\treturn null;\n\t}\n\n\thandleKeyTabPress(event: React.KeyboardEvent) {\n\t\tconst { rowIndex, columnIndex } = this.state.activeCell;\n\n\t\tif (this.state.mode === Mode.ACTIONABLE) {\n\t\t\tconst nextActionable = this.handleNextActionable(event);\n\n\t\t\tif (nextActionable) {\n\t\t\t\tthis.setState({ activeElement: nextActionable });\n\t\t\t} else if (rowIndex === 0) {\n\t\t\t\tconst headers = [\n\t\t\t\t\t...this.headerRefs.select,\n\t\t\t\t\t...this.headerRefs.column,\n\t\t\t\t\t...this.headerRefs.action,\n\t\t\t\t];\n\t\t\t\tlet newIndex = 0;\n\n\t\t\t\tif (!event.shiftKey)\n\t\t\t\t\tnewIndex = columnIndex + 1 < headers.length ? columnIndex + 1 : 0;\n\t\t\t\telse\n\t\t\t\t\tnewIndex =\n\t\t\t\t\t\tcolumnIndex - 1 >= 0 ? columnIndex - 1 : headers.length - 1;\n\t\t\t\tthis.setState({\n\t\t\t\t\tmode: Mode.ACTIONABLE,\n\t\t\t\t\tactiveElement: null,\n\t\t\t\t});\n\n\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\theaders.forEach((header, index) => {\n\t\t\t\t\tif (!header) return;\n\t\t\t\t\tif (index === newIndex) {\n\t\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\t\theader.tabIndex = 0;\n\t\t\t\t\t\theader.focus();\n\t\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\t} else header.tabIndex = -1;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.moveNext(event, rowIndex, columnIndex);\n\t\t\t\tthis.setState({\n\t\t\t\t\tmode: Mode.ACTIONABLE,\n\t\t\t\t\tactiveElement: null,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tregisterInteractiveElement(\n\t\trowIndex: number,\n\t\tcolumnIndex: number,\n\t\telementId: string\n\t) {\n\t\tif (!this.interactiveElements[rowIndex]) {\n\t\t\tthis.interactiveElements[rowIndex] = {};\n\t\t}\n\t\tconst existingElements =\n\t\t\tthis.interactiveElements[rowIndex][columnIndex] || [];\n\n\t\tif (!existingElements.includes(elementId)) {\n\t\t\tthis.interactiveElements[rowIndex][columnIndex] = [\n\t\t\t\t...existingElements,\n\t\t\t\telementId,\n\t\t\t];\n\t\t}\n\t}\n\n\t// ### Render\n\trender() {\n\t\tconst ariaProps: { 'aria-multiselectable'?: 'true' } = {};\n\t\tconst numHeaderRows = 1;\n\t\tconst selection = this.props.selection ?? [];\n\t\tconst disabledSelection = this.props.disabledSelection ?? [];\n\t\tconst numRows = count(this.props.items);\n\t\tconst numSelected = count(\n\t\t\tselection.filter((item) => !disabledSelection.includes(item))\n\t\t);\n\t\tconst numNonHeaderRows = count(\n\t\t\tthis.props.items.filter(\n\t\t\t\t(item) =>\n\t\t\t\t\titem.type !== 'header-row' && !disabledSelection.includes(item)\n\t\t\t)\n\t\t);\n\t\tconst canSelectRows =\n\t\t\tthis.props.selectRows && numNonHeaderRows > 0\n\t\t\t\t? this.props.selectRows\n\t\t\t\t: false;\n\t\tconst allSelected = canSelectRows && numNonHeaderRows === numSelected;\n\t\tconst indeterminateSelected =\n\t\t\tcanSelectRows && numNonHeaderRows !== numSelected && numSelected !== 0;\n\n\t\tconst { columns, RowActions } = getColumnsAndRowActions(\n\t\t\tthis.props.children,\n\t\t\tthis.props.id,\n\t\t\tthis.props.fixedHeader,\n\t\t\tthis.props.fixedLayout,\n\t\t\tthis.props.items,\n\t\t\tthis.props.search\n\t\t);\n\n\t\tconst assistiveText = getAssistiveText(\n\t\t\tthis.props.assistiveText,\n\t\t\tthis.props.assistiveTextForActionsHeader,\n\t\t\tthis.props.assistiveTextForSelectAllRows,\n\t\t\tthis.props.assistiveTextForColumnSortedAscending,\n\t\t\tthis.props.assistiveTextForColumnSortedDescending,\n\t\t\tthis.props.assistiveTextForColumnSort,\n\t\t\tthis.props.assistiveTextForSelectRow\n\t\t);\n\n\t\tif (this.props.selectRows && this.props.selectRows !== 'radio') {\n\t\t\tariaProps['aria-multiselectable'] = 'true';\n\t\t}\n\n\t\t// This guarantees there are never any old header references if props change\n\t\tthis.headerRefs = {\n\t\t\taction: RowActions ? this.headerRefs.action : [],\n\t\t\tcolumn: this.headerRefs.column.slice(0, columns.length),\n\t\t\tselect: canSelectRows ? this.headerRefs.select : [],\n\t\t};\n\n\t\tlet component = (\n\t\t\t<React.Fragment>\n\t\t\t\t<TableContext.Provider\n\t\t\t\t\tvalue={this.getTableContext(\n\t\t\t\t\t\tthis.state,\n\t\t\t\t\t\tthis.props.keyboardNavigation\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<table\n\t\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-table',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-table_fixed-layout': this.props.fixedLayout,\n\t\t\t\t\t\t\t\t'slds-table_header-fixed': this.props.fixedHeader,\n\t\t\t\t\t\t\t\t'slds-table_resizable-cols': this.props.fixedLayout,\n\t\t\t\t\t\t\t\t'slds-table_bordered': !this.props.unborderedRow,\n\t\t\t\t\t\t\t\t'slds-table_cell-buffer':\n\t\t\t\t\t\t\t\t\t!this.props.fixedLayout && !this.props.unbufferedCell,\n\t\t\t\t\t\t\t\t'slds-max-medium-table_stacked': this.props.stacked,\n\t\t\t\t\t\t\t\t'slds-max-medium-table_stacked-horizontal':\n\t\t\t\t\t\t\t\t\tthis.props.stackedHorizontal,\n\t\t\t\t\t\t\t\t'slds-table_striped': this.props.striped,\n\t\t\t\t\t\t\t\t'slds-table_col-bordered': this.props.columnBordered,\n\t\t\t\t\t\t\t\t'slds-no-row-hover': this.props.noRowHover,\n\t\t\t\t\t\t\t\t'slds-table_header-hidden': this.props.isHeadless,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tthis.props.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tid={this.getId()}\n\t\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\tthis.tableRef = node;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\trole={this.props.fixedLayout ? 'grid' : undefined}\n\t\t\t\t\t\tonBlur={(event) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tthis.tableRef &&\n\t\t\t\t\t\t\t\t!this.tableRef.contains(event.relatedTarget as Node)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t\t\ttableHasFocus: false,\n\t\t\t\t\t\t\t\t\tmode: Mode.NAVIGATION,\n\t\t\t\t\t\t\t\t\tactiveElement: null,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tstyle={this.props.style}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SimpleDataTableHead\n\t\t\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\t\t\tallSelected={allSelected}\n\t\t\t\t\t\t\tfixedHeader={this.props.fixedHeader}\n\t\t\t\t\t\t\tfixedLayout={this.props.fixedLayout}\n\t\t\t\t\t\t\theaderRefs={(ref, index) => {\n\t\t\t\t\t\t\t\tif (index === 'action' || index === 'select') {\n\t\t\t\t\t\t\t\t\tif (ref) {\n\t\t\t\t\t\t\t\t\t\tthis.headerRefs[index][0] = ref;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tthis.headerRefs[index] = [];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.headerRefs.column[index] = ref;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tisHidden={this.props.isHeadless}\n\t\t\t\t\t\t\tindeterminateSelected={indeterminateSelected}\n\t\t\t\t\t\t\tcanSelectRows={canSelectRows}\n\t\t\t\t\t\t\tcolumns={columns}\n\t\t\t\t\t\t\tid={`${this.getId()}-${SIMPLE_DATA_TABLE_HEAD}`}\n\t\t\t\t\t\t\tonToggleAll={this.handleToggleAll}\n\t\t\t\t\t\t\tonSort={this.props.onSort}\n\t\t\t\t\t\t\tshowRowActions={!!RowActions}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t{numRows > 0\n\t\t\t\t\t\t\t\t? this.props.items.map((item, index) => {\n\t\t\t\t\t\t\t\t\t\tconst rowId =\n\t\t\t\t\t\t\t\t\t\t\tthis.getId() && item.id\n\t\t\t\t\t\t\t\t\t\t\t\t? `${this.getId()}-${SIMPLE_DATA_TABLE_ROW}-${item.id}`\n\t\t\t\t\t\t\t\t\t\t\t\t: generateId();\n\t\t\t\t\t\t\t\t\t\treturn this.props.onRenderSubHeadingRow &&\n\t\t\t\t\t\t\t\t\t\t\titem.type === 'header-row' ? (\n\t\t\t\t\t\t\t\t\t\t\tthis.props.onRenderSubHeadingRow({\n\t\t\t\t\t\t\t\t\t\t\t\tassistiveText,\n\t\t\t\t\t\t\t\t\t\t\t\tclassNameRow: item.classNameRow,\n\t\t\t\t\t\t\t\t\t\t\t\tcolumns,\n\t\t\t\t\t\t\t\t\t\t\t\tkey: rowId,\n\t\t\t\t\t\t\t\t\t\t\t\tid: rowId,\n\t\t\t\t\t\t\t\t\t\t\t\ttableId: this.getId(),\n\t\t\t\t\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<SimpleDataTableRow\n\t\t\t\t\t\t\t\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\t\t\t\t\t\t\t\tcanSelectRows={canSelectRows}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={item.classNameRow}\n\t\t\t\t\t\t\t\t\t\t\t\tcolumns={columns}\n\t\t\t\t\t\t\t\t\t\t\t\tfixedLayout={this.props.fixedLayout}\n\t\t\t\t\t\t\t\t\t\t\t\tid={rowId}\n\t\t\t\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\t\t\t\tkey={rowId}\n\t\t\t\t\t\t\t\t\t\t\t\tonToggle={this.handleRowToggle}\n\t\t\t\t\t\t\t\t\t\t\t\tselection={this.props.selection}\n\t\t\t\t\t\t\t\t\t\t\t\tdisabledSelection={this.props.disabledSelection}\n\t\t\t\t\t\t\t\t\t\t\t\trowActions={RowActions}\n\t\t\t\t\t\t\t\t\t\t\t\ttableId={this.getId()}\n\t\t\t\t\t\t\t\t\t\t\t\trowIndex={index + numHeaderRows}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t: // Someday this should be an element to render when the table is empty\n\t\t\t\t\t\t\t\t\tnull}\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</TableContext.Provider>\n\t\t\t\t{this.props.fixedHeader && this.props.hasMore && (\n\t\t\t\t\t<div className=\"slds-is-relative slds-p-around_large\">\n\t\t\t\t\t\t<Spinner\n\t\t\t\t\t\t\tassistiveText={{ label: this.props.assistiveText?.loadingMore }}\n\t\t\t\t\t\t\thasContainer={false}\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</React.Fragment>\n\t\t);\n\n\t\tif (this.props.fixedHeader) {\n\t\t\tconst border = `1px solid ${colorGray5}`;\n\t\t\tconst styles: React.CSSProperties = {\n\t\t\t\tborderTop: border,\n\t\t\t\theight: '100%',\n\t\t\t};\n\n\t\t\tif (this.props.joined) {\n\t\t\t\tstyles.borderBottom = border;\n\t\t\t\tstyles.borderLeft = border;\n\t\t\t\tstyles.borderRight = border;\n\t\t\t\tstyles.borderTop = 'none';\n\t\t\t\tstyles.borderRadius = tableBorderRadius;\n\t\t\t}\n\n\t\t\tconst fixedScrollerStyle: React.CSSProperties = {\n\t\t\t\theight: '100%',\n\t\t\t\toverflow: 'auto',\n\t\t\t};\n\n\t\t\tcomponent = (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"slds-table_header-fixed_container\"\n\t\t\t\t\tstyle={styles}\n\t\t\t\t\tonScroll={(e) => {\n\t\t\t\t\t\tconst containerScrollLeft = (e.target as HTMLElement).scrollLeft;\n\n\t\t\t\t\t\tif (containerScrollLeft > 0) {\n\t\t\t\t\t\t\t(e.target as HTMLElement).scrollLeft = 0;\n\t\t\t\t\t\t\tif (this.scrollerRef) {\n\t\t\t\t\t\t\t\tthis.scrollerRef.scrollLeft = containerScrollLeft;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"slds-table_header-fixed_scroller\"\n\t\t\t\t\t\tref={(ref) => {\n\t\t\t\t\t\t\tthis.scrollerRef = ref;\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tstyle={fixedScrollerStyle}\n\t\t\t\t\t>\n\t\t\t\t\t\t{component}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn component;\n\t}\n}\n\nexport default SimpleDataTable;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAM,EAAE,yBAAsB,GA+CxB,KAAS,MACd,MAAM,QAAQ,CAAK,IAAI,EAAM,SAAS,GAEjC,IAAe;CACpB,eAAe;EACd,eAAe;EACf,YAAY;EACZ,uBAAuB;EACvB,wBAAwB;EACxB,eAAe;EACf,WAAW;EACX,gBAAgB;EAChB,aAAa;CACd;CACA,WAAW,CAAC;CACZ,mBAAmB,CAAC;CACpB,SAAS;CACT,gBAAgB;AACjB,GAEM,IAAmB,GAEvB,GACA,GACA,GACA,GACA,GACA,GACA,MACkC;CAClC,IAAM,IAAuC;EAC5C,GAAG,EAAa;EAChB,GAAG;CACJ;CAmBA,OAlBI,MACH,EAAO,gBAAgB,IAEpB,MACH,EAAO,gBAAgB,IAEpB,MACH,EAAO,wBAAwB,IAE5B,MACH,EAAO,yBAAyB,IAE7B,MACH,EAAO,aAAa,IAEjB,MACH,EAAO,YAAY,IAEb;AACR,GACA,CACD,GAEM,IAA0B,GAE9B,GACA,GACA,GACA,GACA,GACA,MAII;CACJ,IAAM,IAAyC,CAAC,GAC5C,IAAkC;CAuDtC,OArDA,EAAM,SAAS,QAAQ,IAAW,MAAU;EAE3C,IAAM,IAAU,GACV,IAAc,GAAS;EAC7B,IACC,KACA,GAAa,gBAAgB,EAAsB,aAClD;GACD,IAAM,EAAE,UAAU,GAAgB,GAAG,MAAgB,E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 import n from "./private/table-context.js";
4
4
  import r from "./private/mode.js";
5
5
  import { Component as i } from "react";
6
6
  import { jsx as a } from "react/jsx-runtime";
7
- //#region components/data-table/interactive-element.tsx
7
+ //#region components/simple-data-table/interactive-element.tsx
8
8
  function o(o) {
9
9
  class s extends i {
10
10
  elementId;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-element.js","names":[],"sources":["../../../../components/simple-data-table/interactive-element.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport { Component, ComponentType } from 'react';\nimport Mode from './private/mode';\nimport CellContext from './private/cell-context';\nimport TableContext, { TableContextValue } from './private/table-context';\n\nimport generateId from '../../utilities/generate-id';\n\n/**\n * Wrapper for interactive elements in the table.\n *\n * The Advanced Data Table implements keyboard navigation as described in Data Tables.\n * This wrapper controls an element's focus and `tabIndex` behavior.\n *\n * The wrapped element must accept the props:\n * `onFocus`: Callback for when the element is focused.\n * `onRequestFocus`: Trigger to indicate that this element should be focused.\n * `requestFocus`: This wrapper overrides the `requestFocus` prop and provides its own value.\n * `tabIndex`: This wrapper overrides the `tabIndex` prop and provides its own value.\n */\nexport default function createInteractiveElement(\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tWrappedElement: ComponentType<any>\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tclass InteractiveElement extends Component<any> {\n\t\telementId: string;\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tconstructor(props: any) {\n\t\t\tsuper(props);\n\t\t\tthis.elementId = generateId();\n\t\t}\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tonFocus(tableContext: TableContextValue, ...args: any[]) {\n\t\t\tif (tableContext.activeElement !== this.elementId) {\n\t\t\t\ttableContext.changeActiveElement(this.elementId);\n\t\t\t}\n\t\t\tif (this.props.onFocus) {\n\t\t\t\tthis.props.onFocus(...args);\n\t\t\t}\n\t\t}\n\n\t\tonRequestFocus(\n\t\t\ttableContext: TableContextValue,\n\t\t\tnode: HTMLElement,\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t...args: any[]\n\t\t) {\n\t\t\tif (tableContext.tableHasFocus) {\n\t\t\t\tnode.focus();\n\t\t\t\tif (this.props.onRequestFocus) {\n\t\t\t\t\tthis.props.onRequestFocus(...args);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tonOpen(tableContext: TableContextValue, ...args: any[]) {\n\t\t\ttableContext.setAllowKeyboardNavigation(false);\n\t\t\tif (this.props.onOpen) {\n\t\t\t\tthis.props.onOpen(...args);\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tonClose(tableContext: TableContextValue, ...args: any[]) {\n\t\t\ttableContext.setAllowKeyboardNavigation(true);\n\t\t\tif (this.props.onClose) {\n\t\t\t\tthis.props.onClose(...args);\n\t\t\t}\n\t\t}\n\n\t\toverride render() {\n\t\t\tconst { onFocus, onRequestFocus, onOpen, onClose } = this;\n\t\t\treturn (\n\t\t\t\t<TableContext.Consumer>\n\t\t\t\t\t{(tableContext) => (\n\t\t\t\t\t\t<CellContext.Consumer>\n\t\t\t\t\t\t\t{(cellContext) => {\n\t\t\t\t\t\t\t\ttableContext.registerInteractiveElement(\n\t\t\t\t\t\t\t\t\tcellContext.rowIndex,\n\t\t\t\t\t\t\t\t\tcellContext.columnIndex,\n\t\t\t\t\t\t\t\t\tthis.elementId\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst requestFocus =\n\t\t\t\t\t\t\t\t\ttableContext.mode === Mode.ACTIONABLE &&\n\t\t\t\t\t\t\t\t\ttableContext.activeElement === this.elementId;\n\t\t\t\t\t\t\t\tconst tabIndex = tableContext.mode === Mode.ACTIONABLE ? 0 : -1;\n\t\t\t\t\t\t\t\tconst keyboardNavProps = tableContext.allowKeyboardNavigation\n\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\tonFocus: onFocus.bind(this, tableContext),\n\t\t\t\t\t\t\t\t\t\t\tonRequestFocus: onRequestFocus.bind(this, tableContext),\n\t\t\t\t\t\t\t\t\t\t\trequestFocus,\n\t\t\t\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t: {};\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<WrappedElement\n\t\t\t\t\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\t\t\t\t\t...this.props,\n\t\t\t\t\t\t\t\t\t\t\t...{\n\t\t\t\t\t\t\t\t\t\t\t\tonOpen: onOpen.bind(this, tableContext),\n\t\t\t\t\t\t\t\t\t\t\t\tonClose: onClose.bind(this, tableContext),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t...keyboardNavProps,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</CellContext.Consumer>\n\t\t\t\t\t)}\n\t\t\t\t</TableContext.Consumer>\n\t\t\t);\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(InteractiveElement as any).displayName = `InteractiveElement${\n\t\tWrappedElement.displayName || 'Unknown'\n\t}`;\n\n\treturn InteractiveElement;\n}\n"],"mappings":";;;;;;;AAsBA,SAAwB,EAEvB,GAEM;CAEN,MAAM,UAA2B,EAAe;EAC/C;EAGA,YAAY,GAAY;GAEvB,AADA,MAAM,CAAK,GACX,KAAK,YAAY,EAAW;EAC7B;EAGA,QAAQ,GAAiC,GAAG,GAAa;GAIxD,AAHI,EAAa,kBAAkB,KAAK,aACvC,EAAa,oBAAoB,KAAK,SAAS,GAE5C,KAAK,MAAM,WACd,KAAK,MAAM,QAAQ,GAAG,CAAI;EAE5B;EAEA,eACC,GACA,GAEA,GAAG,GACF;GACD,AAAI,EAAa,kBAChB,EAAK,MAAM,GACP,KAAK,MAAM,kBACd,KAAK,MAAM,eAAe,GAAG,CAAI;EAGpC;EAGA,OAAO,GAAiC,GAAG,GAAa;GAEvD,AADA,EAAa,2BAA2B,EAAK,GACzC,KAAK,MAAM,UACd,KAAK,MAAM,OAAO,GAAG,CAAI;EAE3B;EAGA,QAAQ,GAAiC,GAAG,GAAa;GAExD,AADA,EAAa,2BAA2B,EAAI,GACxC,KAAK,MAAM,WACd,KAAK,MAAM,QAAQ,GAAG,CAAI;EAE5B;EAEA,SAAkB;GACjB,IAAM,EAAE,YAAS,mBAAgB,WAAQ,eAAY;GACrD,OACC,kBAAC,EAAa,UAAd,EAAA,WACG,MACD,kBAAC,EAAY,UAAb,EAAA,WACG,MAAgB;IACjB,EAAa,2BACZ,EAAY,UACZ,EAAY,aACZ,KAAK,SACN;IACA,IAAM,IACL,EAAa,SAAS,EAAK,cAC3B,EAAa,kBAAkB,KAAK,WAC/B,IAAW,EAAa,SAAS,EAAK,aAAa,IAAI,IACvD,IAAmB,EAAa,0BACnC;KACA,SAAS,EAAQ,KAAK,MAAM,CAAY;KACxC,gBAAgB,EAAe,KAAK,MAAM,CAAY;KACtD;KACA;IACD,IACC,CAAC;IACJ,OACC,kBAAC,GAAD;KAEE,GAAG,KAAK;KAEP,QAAQ,EAAO,KAAK,MAAM,CAAY;KACtC,SAAS,EAAQ,KAAK,MAAM,CAAY;KAEzC,GAAG;IAEJ,CAAA;GAEH,EACqB,CAAA,EAED,CAAA;EAEzB;CACD;CAOA,OAJA,EAA4B,cAAc,qBACzC,EAAe,eAAe,aAGxB;AACR"}
@@ -1,6 +1,6 @@
1
1
  import e from "./private/link.js";
2
2
  import t from "./interactive-element.js";
3
- //#region components/data-table/interactive-link.tsx
3
+ //#region components/simple-data-table/interactive-link.tsx
4
4
  var n = t(e);
5
5
  //#endregion
6
6
  export { n as default };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-link.js","names":[],"sources":["../../../../components/simple-data-table/interactive-link.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport InteractiveElement from './interactive-element';\nimport Link from './private/link';\n\nexport default InteractiveElement(Link);\n"],"mappings":";;;AAMA,IAAA,IAAe,EAAmB,CAAI"}
@@ -1,5 +1,5 @@
1
1
  import e from "react";
2
- //#region components/data-table/private/cell-context.tsx
2
+ //#region components/simple-data-table/private/cell-context.tsx
3
3
  var t = e.createContext({
4
4
  rowIndex: 0,
5
5
  columnIndex: 0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cell-context.js","names":[],"sources":["../../../../../components/simple-data-table/private/cell-context.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface CellContextValue {\n\trowIndex: number;\n\tcolumnIndex: number;\n}\n\nconst CellContext = React.createContext<CellContextValue>({\n\trowIndex: 0,\n\tcolumnIndex: 0,\n});\n\nexport default CellContext;\n"],"mappings":";;AAOA,IAAM,IAAc,EAAM,cAAgC;CACzD,UAAU;CACV,aAAa;AACd,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import "react";
2
2
  import { jsx as e } from "react/jsx-runtime";
3
- //#region components/data-table/private/cell-fixed.tsx
3
+ //#region components/simple-data-table/private/cell-fixed.tsx
4
4
  var t = ({ children: t }) => /* @__PURE__ */ e("div", {
5
5
  className: "slds-cell-fixed",
6
6
  style: {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cell-fixed.js","names":[],"sources":["../../../../../components/simple-data-table/private/cell-fixed.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { ReactNode } from 'react';\n\ninterface CellFixedProps {\n\tchildren?: ReactNode;\n}\n\n/**\n * Used internally, provides fixed cell rendering\n */\nconst CellFixed: React.FC<CellFixedProps> = ({ children }) => (\n\t<div\n\t\tclassName=\"slds-cell-fixed\"\n\t\tstyle={{\n\t\t\tdisplay: 'flex',\n\t\t\tflexDirection: 'row',\n\t\t\tflexWrap: 'nowrap',\n\t\t\tlineHeight: '2rem',\n\t\t}}\n\t>\n\t\t{children}\n\t</div>\n);\n\nexport default CellFixed;\n"],"mappings":";;;AAYA,IAAM,KAAuC,EAAE,kBAC9C,kBAAC,OAAD;CACC,WAAU;CACV,OAAO;EACN,SAAS;EACT,eAAe;EACf,UAAU;EACV,YAAY;CACb;CAEC;AACG,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { useCallback as e } from "react";
2
- //#region components/data-table/private/context-helper.ts
2
+ //#region components/simple-data-table/private/context-helper.ts
3
3
  function t(t, n, r) {
4
4
  let i = t.activeCell.rowIndex === n.rowIndex && t.activeCell.columnIndex === n.columnIndex, a = !!(r && t.tableHasFocus && i), { changeActiveCell: o, handleKeyDown: s } = t, c = e(() => {
5
5
  r && t.allowKeyboardNavigation && o(n.rowIndex, n.columnIndex);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-helper.js","names":[],"sources":["../../../../../components/simple-data-table/private/context-helper.ts"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport { useCallback } from 'react';\nimport { TableContextValue } from './table-context';\nimport { CellContextValue } from './cell-context';\n\ninterface ContextHelperResult {\n\ttabIndex: number | undefined;\n\thasFocus: boolean;\n\thandleFocus: () => void;\n\thandleKeyDown: (event: React.KeyboardEvent) => void;\n}\n\n/**\n * Calculates data table keyboard navigation state based on currently selected cell\n */\nexport default function useTableContextHelper(\n\ttableContext: TableContextValue,\n\tcellContext: CellContextValue,\n\tfixedLayout?: boolean\n): ContextHelperResult {\n\tconst isActive =\n\t\ttableContext.activeCell.rowIndex === cellContext.rowIndex &&\n\t\ttableContext.activeCell.columnIndex === cellContext.columnIndex;\n\n\tconst hasFocus = Boolean(\n\t\tfixedLayout && tableContext.tableHasFocus && isActive\n\t);\n\tconst { changeActiveCell, handleKeyDown: handleTableKeyDown } = tableContext;\n\n\tconst handleFocus = useCallback(() => {\n\t\tif (fixedLayout && tableContext.allowKeyboardNavigation) {\n\t\t\tchangeActiveCell(cellContext.rowIndex, cellContext.columnIndex);\n\t\t}\n\t}, [\n\t\tfixedLayout,\n\t\ttableContext.allowKeyboardNavigation,\n\t\tchangeActiveCell,\n\t\tcellContext.rowIndex,\n\t\tcellContext.columnIndex,\n\t]);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tif (fixedLayout && tableContext.allowKeyboardNavigation) {\n\t\t\t\thandleTableKeyDown(event);\n\t\t\t}\n\t\t},\n\t\t[fixedLayout, tableContext.allowKeyboardNavigation, handleTableKeyDown]\n\t);\n\n\tconst tabIndex =\n\t\tfixedLayout &&\n\t\tisActive &&\n\t\t!tableContext.activeElement &&\n\t\ttableContext.allowKeyboardNavigation\n\t\t\t? 0\n\t\t\t: undefined;\n\n\treturn { tabIndex, hasFocus, handleFocus, handleKeyDown };\n}\n"],"mappings":";;AAiBA,SAAwB,EACvB,GACA,GACA,GACsB;CACtB,IAAM,IACL,EAAa,WAAW,aAAa,EAAY,YACjD,EAAa,WAAW,gBAAgB,EAAY,aAE/C,IAAW,GAChB,KAAe,EAAa,iBAAiB,IAExC,EAAE,qBAAkB,eAAe,MAAuB,GAE1D,IAAc,QAAkB;EACrC,AAAI,KAAe,EAAa,2BAC/B,EAAiB,EAAY,UAAU,EAAY,WAAW;CAEhE,GAAG;EACF;EACA,EAAa;EACb;EACA,EAAY;EACZ,EAAY;CACb,CAAC,GAEK,IAAgB,GACpB,MAA+B;EAC/B,AAAI,KAAe,EAAa,2BAC/B,EAAmB,CAAK;CAE1B,GACA;EAAC;EAAa,EAAa;EAAyB;CAAkB,CACvE;CAUA,OAAO;EAAE,UAPR,KACA,KACA,CAAC,EAAa,iBACd,EAAa,0BACV,IACA,KAAA;EAEe;EAAU;EAAa;CAAc;AACzD"}