@fluentui/react-table 9.0.0-alpha.11 → 9.0.0-alpha.13

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 (135) hide show
  1. package/CHANGELOG.json +191 -1
  2. package/CHANGELOG.md +44 -2
  3. package/dist/index.d.ts +108 -58
  4. package/lib/components/DataGrid/DataGrid.types.js.map +1 -1
  5. package/lib/components/DataGrid/useDataGrid.js +27 -5
  6. package/lib/components/DataGrid/useDataGrid.js.map +1 -1
  7. package/lib/components/DataGrid/useDataGridContextValues.js +4 -1
  8. package/lib/components/DataGrid/useDataGridContextValues.js.map +1 -1
  9. package/lib/components/DataGridBody/useDataGridBody.js +12 -2
  10. package/lib/components/DataGridBody/useDataGridBody.js.map +1 -1
  11. package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js +24 -2
  12. package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  13. package/lib/components/DataGridRow/DataGridRow.types.js.map +1 -1
  14. package/lib/components/DataGridRow/renderDataGridRow.js +9 -2
  15. package/lib/components/DataGridRow/renderDataGridRow.js.map +1 -1
  16. package/lib/components/DataGridRow/useDataGridRow.js +57 -4
  17. package/lib/components/DataGridRow/useDataGridRow.js.map +1 -1
  18. package/lib/components/DataGridRow/useDataGridRowStyles.js +7 -1
  19. package/lib/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  20. package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js +36 -1
  21. package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  22. package/lib/components/Table/Table.types.js.map +1 -1
  23. package/lib/components/TableCell/TableCell.types.js.map +1 -1
  24. package/lib/components/TableCell/useTableCell.js +4 -2
  25. package/lib/components/TableCell/useTableCell.js.map +1 -1
  26. package/lib/components/TableCell/useTableCellStyles.js +31 -5
  27. package/lib/components/TableCell/useTableCellStyles.js.map +1 -1
  28. package/lib/components/TableCellActions/useTableCellActions.js +2 -3
  29. package/lib/components/TableCellActions/useTableCellActions.js.map +1 -1
  30. package/lib/components/TableCellActions/useTableCellActionsStyles.js +2 -8
  31. package/lib/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  32. package/lib/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
  33. package/lib/components/TableCellLayout/useTableCellLayout.js +3 -2
  34. package/lib/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  35. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js +20 -6
  36. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  37. package/lib/components/TableHeader/useTableHeader.js +1 -8
  38. package/lib/components/TableHeader/useTableHeader.js.map +1 -1
  39. package/lib/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
  40. package/lib/components/TableHeaderCell/useTableHeaderCell.js +6 -2
  41. package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  42. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +6 -5
  43. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  44. package/lib/components/TableRow/TableRow.types.js.map +1 -1
  45. package/lib/components/TableRow/useTableRow.js +3 -2
  46. package/lib/components/TableRow/useTableRow.js.map +1 -1
  47. package/lib/components/TableRow/useTableRowStyles.js +19 -30
  48. package/lib/components/TableRow/useTableRowStyles.js.map +1 -1
  49. package/lib/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
  50. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js +3 -5
  51. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  52. package/lib/contexts/columnIdContext.js +10 -0
  53. package/lib/contexts/columnIdContext.js.map +1 -0
  54. package/lib/contexts/dataGridContext.js +3 -0
  55. package/lib/contexts/dataGridContext.js.map +1 -1
  56. package/lib/contexts/rowIdContext.js +10 -0
  57. package/lib/contexts/rowIdContext.js.map +1 -0
  58. package/lib/hooks/index.js +3 -3
  59. package/lib/hooks/index.js.map +1 -1
  60. package/lib/hooks/selectionManager.js +16 -16
  61. package/lib/hooks/selectionManager.js.map +1 -1
  62. package/lib/hooks/types.js.map +1 -1
  63. package/lib/hooks/{useTable.js → useTableFeatures.js} +4 -4
  64. package/lib/hooks/useTableFeatures.js.map +1 -0
  65. package/lib/hooks/{useSelection.js → useTableSelection.js} +16 -12
  66. package/lib/hooks/useTableSelection.js.map +1 -0
  67. package/lib/hooks/{useSort.js → useTableSort.js} +8 -8
  68. package/lib/hooks/useTableSort.js.map +1 -0
  69. package/lib/index.js +1 -1
  70. package/lib/index.js.map +1 -1
  71. package/lib-commonjs/components/DataGrid/useDataGrid.js +27 -5
  72. package/lib-commonjs/components/DataGrid/useDataGrid.js.map +1 -1
  73. package/lib-commonjs/components/DataGrid/useDataGridContextValues.js +4 -1
  74. package/lib-commonjs/components/DataGrid/useDataGridContextValues.js.map +1 -1
  75. package/lib-commonjs/components/DataGridBody/useDataGridBody.js +15 -2
  76. package/lib-commonjs/components/DataGridBody/useDataGridBody.js.map +1 -1
  77. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js +28 -2
  78. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  79. package/lib-commonjs/components/DataGridRow/renderDataGridRow.js +10 -2
  80. package/lib-commonjs/components/DataGridRow/renderDataGridRow.js.map +1 -1
  81. package/lib-commonjs/components/DataGridRow/useDataGridRow.js +64 -4
  82. package/lib-commonjs/components/DataGridRow/useDataGridRow.js.map +1 -1
  83. package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js +7 -1
  84. package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  85. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js +40 -1
  86. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  87. package/lib-commonjs/components/TableCell/useTableCell.js +4 -2
  88. package/lib-commonjs/components/TableCell/useTableCell.js.map +1 -1
  89. package/lib-commonjs/components/TableCell/useTableCellStyles.js +32 -5
  90. package/lib-commonjs/components/TableCell/useTableCellStyles.js.map +1 -1
  91. package/lib-commonjs/components/TableCellActions/useTableCellActions.js +1 -3
  92. package/lib-commonjs/components/TableCellActions/useTableCellActions.js.map +1 -1
  93. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js +2 -9
  94. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  95. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js +3 -2
  96. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  97. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js +21 -6
  98. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  99. package/lib-commonjs/components/TableHeader/useTableHeader.js +1 -9
  100. package/lib-commonjs/components/TableHeader/useTableHeader.js.map +1 -1
  101. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +6 -2
  102. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  103. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +6 -5
  104. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  105. package/lib-commonjs/components/TableRow/useTableRow.js +2 -1
  106. package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -1
  107. package/lib-commonjs/components/TableRow/useTableRowStyles.js +19 -30
  108. package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -1
  109. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js +3 -5
  110. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  111. package/lib-commonjs/contexts/columnIdContext.js +21 -0
  112. package/lib-commonjs/contexts/columnIdContext.js.map +1 -0
  113. package/lib-commonjs/contexts/dataGridContext.js +3 -0
  114. package/lib-commonjs/contexts/dataGridContext.js.map +1 -1
  115. package/lib-commonjs/contexts/rowIdContext.js +21 -0
  116. package/lib-commonjs/contexts/rowIdContext.js.map +1 -0
  117. package/lib-commonjs/hooks/index.js +3 -3
  118. package/lib-commonjs/hooks/index.js.map +1 -1
  119. package/lib-commonjs/hooks/selectionManager.js +16 -16
  120. package/lib-commonjs/hooks/selectionManager.js.map +1 -1
  121. package/lib-commonjs/hooks/{useTable.js → useTableFeatures.js} +10 -10
  122. package/lib-commonjs/hooks/useTableFeatures.js.map +1 -0
  123. package/lib-commonjs/hooks/{useSelection.js → useTableSelection.js} +19 -15
  124. package/lib-commonjs/hooks/useTableSelection.js.map +1 -0
  125. package/lib-commonjs/hooks/{useSort.js → useTableSort.js} +11 -11
  126. package/lib-commonjs/hooks/useTableSort.js.map +1 -0
  127. package/lib-commonjs/index.js +7 -7
  128. package/lib-commonjs/index.js.map +1 -1
  129. package/package.json +9 -9
  130. package/lib/hooks/useSelection.js.map +0 -1
  131. package/lib/hooks/useSort.js.map +0 -1
  132. package/lib/hooks/useTable.js.map +0 -1
  133. package/lib-commonjs/hooks/useSelection.js.map +0 -1
  134. package/lib-commonjs/hooks/useSort.js.map +0 -1
  135. package/lib-commonjs/hooks/useTable.js.map +0 -1
@@ -5,9 +5,23 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useDataGridRow_unstable = void 0;
7
7
 
8
+ const React = /*#__PURE__*/require("react");
9
+
8
10
  const useTableRow_1 = /*#__PURE__*/require("../TableRow/useTableRow");
9
11
 
10
12
  const dataGridContext_1 = /*#__PURE__*/require("../../contexts/dataGridContext");
13
+
14
+ const columnIdContext_1 = /*#__PURE__*/require("../../contexts/columnIdContext");
15
+
16
+ const DataGridSelectionCell_1 = /*#__PURE__*/require("../DataGridSelectionCell/DataGridSelectionCell");
17
+
18
+ const rowIdContext_1 = /*#__PURE__*/require("../../contexts/rowIdContext");
19
+
20
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
21
+
22
+ const tableHeaderContext_1 = /*#__PURE__*/require("../../contexts/tableHeaderContext");
23
+
24
+ const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
11
25
  /**
12
26
  * Create the state required to render DataGridRow.
13
27
  *
@@ -20,15 +34,61 @@ const dataGridContext_1 = /*#__PURE__*/require("../../contexts/dataGridContext")
20
34
 
21
35
 
22
36
  const useDataGridRow_unstable = (props, ref) => {
37
+ const rowId = rowIdContext_1.useRowIdContext();
38
+ const isHeader = tableHeaderContext_1.useIsInTableHeader();
23
39
  const columnDefs = dataGridContext_1.useDataGridContext_unstable(ctx => ctx.columns);
40
+ const selectable = dataGridContext_1.useDataGridContext_unstable(ctx => ctx.selectableRows);
41
+ const selected = dataGridContext_1.useDataGridContext_unstable(ctx => ctx.selection.isRowSelected(rowId));
42
+ const appearance = dataGridContext_1.useDataGridContext_unstable(ctx => {
43
+ if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {
44
+ return ctx.selectionAppearance;
45
+ }
46
+
47
+ return 'none';
48
+ });
49
+ const toggleRow = dataGridContext_1.useDataGridContext_unstable(ctx => ctx.selection.toggleRow);
24
50
  const cellRenderFunction = props.children;
25
- const children = columnDefs.map(columnDef => {
26
- return cellRenderFunction(columnDef);
51
+ const cells = columnDefs.map(columnDef => {
52
+ return React.createElement(columnIdContext_1.ColumnIdContextProvider, {
53
+ value: columnDef.columnId,
54
+ key: columnDef.columnId
55
+ }, cellRenderFunction(columnDef));
56
+ });
57
+ const onClick = react_utilities_1.useEventCallback(e => {
58
+ var _a;
59
+
60
+ if (selectable && !isHeader) {
61
+ toggleRow(e, rowId);
62
+ }
63
+
64
+ (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
65
+ });
66
+ const onKeyDown = react_utilities_1.useEventCallback(e => {
67
+ var _a;
68
+
69
+ if (selectable && !isHeader && e.key === ' ') {
70
+ toggleRow(e, rowId);
71
+ }
72
+
73
+ (_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
27
74
  });
28
- return useTableRow_1.useTableRow_unstable({ ...props,
29
- children,
75
+ const baseState = useTableRow_1.useTableRow_unstable({
76
+ appearance,
77
+ 'aria-selected': selectable ? selected : undefined,
78
+ ...props,
79
+ onClick,
80
+ onKeyDown,
81
+ children: cells,
30
82
  as: 'div'
31
83
  }, ref);
84
+ return { ...baseState,
85
+ components: { ...baseState.components,
86
+ selectionCell: DataGridSelectionCell_1.DataGridSelectionCell
87
+ },
88
+ selectionCell: react_utilities_2.resolveShorthand(props.selectionCell, {
89
+ required: selectable
90
+ })
91
+ };
32
92
  };
33
93
 
34
94
  exports.useDataGridRow_unstable = useDataGridRow_unstable;
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridRow/useDataGridRow.ts"],"names":[],"mappings":";;;;;;;AAEA,MAAA,aAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;EAChH,MAAM,UAAU,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAAI,GAAG,CAAC,OAAvC,CAAnB;EAEA,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAjC;EACA,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAX,CAAe,SAAS,IAAG;IAC1C,OAAO,kBAAkB,CAAC,SAAD,CAAzB;EACD,CAFgB,CAAjB;EAIA,OAAO,aAAA,CAAA,oBAAA,CAAqB,EAAE,GAAG,KAAL;IAAY,QAAZ;IAAsB,EAAE,EAAE;EAA1B,CAArB,EAAwD,GAAxD,CAAP;AACD,CATM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import * as React from 'react';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\nimport { useTableRow_unstable } from '../TableRow/useTableRow';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\n\n/**\n * Create the state required to render DataGridRow.\n *\n * The returned state can be modified with hooks such as useDataGridRowStyles_unstable,\n * before being passed to renderDataGridRow_unstable.\n *\n * @param props - props from this instance of DataGridRow\n * @param ref - reference to root HTMLElement of DataGridRow\n */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\n const columnDefs = useDataGridContext_unstable(ctx => ctx.columns);\n\n const cellRenderFunction = props.children;\n const children = columnDefs.map(columnDef => {\n return cellRenderFunction(columnDef);\n });\n\n return useTableRow_unstable({ ...props, children, as: 'div' }, ref);\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridRow/useDataGridRow.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,MAAA,aAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,gDAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,oBAAA,gBAAA,OAAA,CAAA,mCAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;EAChH,MAAM,KAAK,GAAG,cAAA,CAAA,eAAA,EAAd;EACA,MAAM,QAAQ,GAAG,oBAAA,CAAA,kBAAA,EAAjB;EACA,MAAM,UAAU,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAAI,GAAG,CAAC,OAAvC,CAAnB;EACA,MAAM,UAAU,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAAI,GAAG,CAAC,cAAvC,CAAnB;EACA,MAAM,QAAQ,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAAI,GAAG,CAAC,SAAJ,CAAc,aAAd,CAA4B,KAA5B,CAAnC,CAAjB;EACA,MAAM,UAAU,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAAG;IACnD,IAAI,CAAC,QAAD,IAAa,UAAb,IAA2B,GAAG,CAAC,SAAJ,CAAc,aAAd,CAA4B,KAA5B,CAA/B,EAAmE;MACjE,OAAO,GAAG,CAAC,mBAAX;IACD;;IAED,OAAO,MAAP;EACD,CANkB,CAAnB;EAOA,MAAM,SAAS,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAAI,GAAG,CAAC,SAAJ,CAAc,SAAjD,CAAlB;EAEA,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAjC;EACA,MAAM,KAAK,GAAG,UAAU,CAAC,GAAX,CAAe,SAAS,IAAG;IACvC,OACE,KAAA,CAAA,aAAA,CAAC,iBAAA,CAAA,uBAAD,EAAwB;MAAC,KAAK,EAAE,SAAS,CAAC,QAAlB;MAA4B,GAAG,EAAE,SAAS,CAAC;IAA3C,CAAxB,EACG,kBAAkB,CAAC,SAAD,CADrB,CADF;EAKD,CANa,CAAd;EAQA,MAAM,OAAO,GAAG,iBAAA,CAAA,gBAAA,CAAkB,CAAD,IAA6C;;;IAC5E,IAAI,UAAU,IAAI,CAAC,QAAnB,EAA6B;MAC3B,SAAS,CAAC,CAAD,EAAI,KAAJ,CAAT;IACD;;IAED,CAAA,EAAA,GAAA,KAAK,CAAC,OAAN,MAAa,IAAb,IAAa,EAAA,KAAA,KAAA,CAAb,GAAa,KAAA,CAAb,GAAa,EAAA,CAAA,IAAA,CAAb,KAAa,EAAG,CAAH,CAAb;EACD,CANe,CAAhB;EAQA,MAAM,SAAS,GAAG,iBAAA,CAAA,gBAAA,CAAkB,CAAD,IAAgD;;;IACjF,IAAI,UAAU,IAAI,CAAC,QAAf,IAA2B,CAAC,CAAC,GAAF,KAAU,GAAzC,EAA8C;MAC5C,SAAS,CAAC,CAAD,EAAI,KAAJ,CAAT;IACD;;IAED,CAAA,EAAA,GAAA,KAAK,CAAC,SAAN,MAAe,IAAf,IAAe,EAAA,KAAA,KAAA,CAAf,GAAe,KAAA,CAAf,GAAe,EAAA,CAAA,IAAA,CAAf,KAAe,EAAG,CAAH,CAAf;EACD,CANiB,CAAlB;EAQA,MAAM,SAAS,GAAG,aAAA,CAAA,oBAAA,CAChB;IACE,UADF;IAEE,iBAAiB,UAAU,GAAG,QAAH,GAAc,SAF3C;IAGE,GAAG,KAHL;IAIE,OAJF;IAKE,SALF;IAME,QAAQ,EAAE,KANZ;IAOE,EAAE,EAAE;EAPN,CADgB,EAUhB,GAVgB,CAAlB;EAaA,OAAO,EACL,GAAG,SADE;IAEL,UAAU,EAAE,EACV,GAAG,SAAS,CAAC,UADH;MAEV,aAAa,EAAE,uBAAA,CAAA;IAFL,CAFP;IAML,aAAa,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,aAAvB,EAAsC;MAAE,QAAQ,EAAE;IAAZ,CAAtC;EANV,CAAP;AAQD,CA7DM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import * as React from 'react';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\nimport { useTableRow_unstable } from '../TableRow/useTableRow';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { ColumnIdContextProvider } from '../../contexts/columnIdContext';\nimport { DataGridSelectionCell } from '../DataGridSelectionCell/DataGridSelectionCell';\nimport { useRowIdContext } from '../../contexts/rowIdContext';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { resolveShorthand } from '@fluentui/react-utilities';\n\n/**\n * Create the state required to render DataGridRow.\n *\n * The returned state can be modified with hooks such as useDataGridRowStyles_unstable,\n * before being passed to renderDataGridRow_unstable.\n *\n * @param props - props from this instance of DataGridRow\n * @param ref - reference to root HTMLElement of DataGridRow\n */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\n const rowId = useRowIdContext();\n const isHeader = useIsInTableHeader();\n const columnDefs = useDataGridContext_unstable(ctx => ctx.columns);\n const selectable = useDataGridContext_unstable(ctx => ctx.selectableRows);\n const selected = useDataGridContext_unstable(ctx => ctx.selection.isRowSelected(rowId));\n const appearance = useDataGridContext_unstable(ctx => {\n if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {\n return ctx.selectionAppearance;\n }\n\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable(ctx => ctx.selection.toggleRow);\n\n const cellRenderFunction = props.children;\n const cells = columnDefs.map(columnDef => {\n return (\n <ColumnIdContextProvider value={columnDef.columnId} key={columnDef.columnId}>\n {cellRenderFunction(columnDef)}\n </ColumnIdContextProvider>\n );\n });\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader) {\n toggleRow(e, rowId);\n }\n\n props.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader && e.key === ' ') {\n toggleRow(e, rowId);\n }\n\n props.onKeyDown?.(e);\n });\n\n const baseState = useTableRow_unstable(\n {\n appearance,\n 'aria-selected': selectable ? selected : undefined,\n ...props,\n onClick,\n onKeyDown,\n children: cells,\n as: 'div',\n },\n ref,\n );\n\n return {\n ...baseState,\n components: {\n ...baseState.components,\n selectionCell: DataGridSelectionCell,\n },\n selectionCell: resolveShorthand(props.selectionCell, { required: selectable }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -10,7 +10,8 @@ const react_1 = /*#__PURE__*/require("@griffel/react");
10
10
  const useTableRowStyles_1 = /*#__PURE__*/require("../TableRow/useTableRowStyles");
11
11
 
12
12
  exports.dataGridRowClassNames = {
13
- root: 'fui-DataGridRow'
13
+ root: 'fui-DataGridRow',
14
+ selectionCell: 'fui-DataGridRow__selectionCell'
14
15
  };
15
16
  /**
16
17
  * Apply styling to the DataGridRow slots based on the state
@@ -19,6 +20,11 @@ exports.dataGridRowClassNames = {
19
20
  const useDataGridRowStyles_unstable = state => {
20
21
  useTableRowStyles_1.useTableRowStyles_unstable(state);
21
22
  state.root.className = react_1.mergeClasses(exports.dataGridRowClassNames.root, state.root.className);
23
+
24
+ if (state.selectionCell) {
25
+ state.selectionCell.className = react_1.mergeClasses(exports.dataGridRowClassNames.selectionCell, state.selectionCell.className);
26
+ }
27
+
22
28
  return state;
23
29
  };
24
30
 
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridRow/useDataGridRowStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,mBAAA,gBAAA,OAAA,CAAA,+BAAA,CAAA;;AAEa,OAAA,CAAA,qBAAA,GAA0D;EACrE,IAAI,EAAE;AAD+D,CAA1D;AAIb;;AAEG;;AACI,MAAM,6BAA6B,GAAI,KAAD,IAA8C;EACzF,mBAAA,CAAA,0BAAA,CAA2B,KAA3B;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,qBAAA,CAAsB,IAAnC,EAAyC,KAAK,CAAC,IAAN,CAAW,SAApD,CAAvB;EAEA,OAAO,KAAP;AACD,CALM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridRowSlots, DataGridRowState } from './DataGridRow.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles';\n\nexport const dataGridRowClassNames: SlotClassNames<DataGridRowSlots> = {\n root: 'fui-DataGridRow',\n};\n\n/**\n * Apply styling to the DataGridRow slots based on the state\n */\nexport const useDataGridRowStyles_unstable = (state: DataGridRowState): DataGridRowState => {\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridRow/useDataGridRowStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,mBAAA,gBAAA,OAAA,CAAA,+BAAA,CAAA;;AAEa,OAAA,CAAA,qBAAA,GAA0D;EACrE,IAAI,EAAE,iBAD+D;EAErE,aAAa,EAAE;AAFsD,CAA1D;AAKb;;AAEG;;AACI,MAAM,6BAA6B,GAAI,KAAD,IAA8C;EACzF,mBAAA,CAAA,0BAAA,CAA2B,KAA3B;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,qBAAA,CAAsB,IAAnC,EAAyC,KAAK,CAAC,IAAN,CAAW,SAApD,CAAvB;;EACA,IAAI,KAAK,CAAC,aAAV,EAAyB;IACvB,KAAK,CAAC,aAAN,CAAoB,SAApB,GAAgC,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,qBAAA,CAAsB,aAAnC,EAAkD,KAAK,CAAC,aAAN,CAAoB,SAAtE,CAAhC;EACD;;EAED,OAAO,KAAP;AACD,CARM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridRowSlots, DataGridRowState } from './DataGridRow.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles';\n\nexport const dataGridRowClassNames: SlotClassNames<DataGridRowSlots> = {\n root: 'fui-DataGridRow',\n selectionCell: 'fui-DataGridRow__selectionCell',\n};\n\n/**\n * Apply styling to the DataGridRow slots based on the state\n */\nexport const useDataGridRowStyles_unstable = (state: DataGridRowState): DataGridRowState => {\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className);\n if (state.selectionCell) {\n state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -5,6 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useDataGridSelectionCell_unstable = void 0;
7
7
 
8
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
+
10
+ const dataGridContext_1 = /*#__PURE__*/require("../../contexts/dataGridContext");
11
+
12
+ const rowIdContext_1 = /*#__PURE__*/require("../../contexts/rowIdContext");
13
+
14
+ const tableHeaderContext_1 = /*#__PURE__*/require("../../contexts/tableHeaderContext");
15
+
8
16
  const useTableSelectionCell_1 = /*#__PURE__*/require("../TableSelectionCell/useTableSelectionCell");
9
17
  /**
10
18
  * Create the state required to render DataGridSelectionCell.
@@ -18,10 +26,41 @@ const useTableSelectionCell_1 = /*#__PURE__*/require("../TableSelectionCell/useT
18
26
 
19
27
 
20
28
  const useDataGridSelectionCell_unstable = (props, ref) => {
29
+ const isHeader = tableHeaderContext_1.useIsInTableHeader();
30
+ const rowId = rowIdContext_1.useRowIdContext();
31
+ const multiselect = dataGridContext_1.useDataGridContext_unstable(ctx => ctx.selection.selectionMode === 'multiselect');
32
+ const subtle = dataGridContext_1.useDataGridContext_unstable(ctx => ctx.subtleSelection);
33
+ const checked = dataGridContext_1.useDataGridContext_unstable(ctx => {
34
+ if (isHeader && multiselect) {
35
+ return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;
36
+ }
37
+
38
+ return ctx.selection.isRowSelected(rowId);
39
+ });
40
+ const toggleAllRows = dataGridContext_1.useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);
41
+ const type = dataGridContext_1.useDataGridContext_unstable(ctx => ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio');
42
+ const onClick = react_utilities_1.useEventCallback(e => {
43
+ var _a;
44
+
45
+ if (isHeader) {
46
+ toggleAllRows(e);
47
+ }
48
+
49
+ (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
50
+ });
21
51
  return useTableSelectionCell_1.useTableSelectionCell_unstable({
22
52
  as: 'div',
23
53
  role: 'gridcell',
24
- ...props
54
+ checked,
55
+ type,
56
+ tabIndex: 0,
57
+ hidden: isHeader && !multiselect,
58
+ subtle,
59
+ checkboxIndicator: {
60
+ tabIndex: -1
61
+ },
62
+ ...props,
63
+ onClick
25
64
  }, ref);
26
65
  };
27
66
 
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridSelectionCell/useDataGridSelectionCell.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,6CAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,iCAAiC,GAAG,CAC/C,KAD+C,EAE/C,GAF+C,KAGjB;EAC9B,OAAO,uBAAA,CAAA,8BAAA,CAA+B;IAAE,EAAE,EAAE,KAAN;IAAa,IAAI,EAAE,UAAnB;IAA+B,GAAG;EAAlC,CAA/B,EAA0E,GAA1E,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,iCAAA,GAAiC,iCAAjC","sourcesContent":["import * as React from 'react';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n return useTableSelectionCell_unstable({ as: 'div', role: 'gridcell', ...props }, ref);\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridSelectionCell/useDataGridSelectionCell.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,oBAAA,gBAAA,OAAA,CAAA,mCAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,6CAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,iCAAiC,GAAG,CAC/C,KAD+C,EAE/C,GAF+C,KAGjB;EAC9B,MAAM,QAAQ,GAAG,oBAAA,CAAA,kBAAA,EAAjB;EACA,MAAM,KAAK,GAAG,cAAA,CAAA,eAAA,EAAd;EACA,MAAM,WAAW,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAAI,GAAG,CAAC,SAAJ,CAAc,aAAd,KAAgC,aAAnE,CAApB;EACA,MAAM,MAAM,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAAI,GAAG,CAAC,eAAvC,CAAf;EACA,MAAM,OAAO,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAAG;IAChD,IAAI,QAAQ,IAAI,WAAhB,EAA6B;MAC3B,OAAO,GAAG,CAAC,SAAJ,CAAc,eAAd,GAAgC,IAAhC,GAAuC,GAAG,CAAC,SAAJ,CAAc,gBAAd,GAAiC,OAAjC,GAA2C,KAAzF;IACD;;IAED,OAAO,GAAG,CAAC,SAAJ,CAAc,aAAd,CAA4B,KAA5B,CAAP;EACD,CANe,CAAhB;EAQA,MAAM,aAAa,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAAI,GAAG,CAAC,SAAJ,CAAc,aAAjD,CAAtB;EACA,MAAM,IAAI,GAAG,iBAAA,CAAA,2BAAA,CAA4B,GAAG,IAC1C,GAAG,CAAC,SAAJ,CAAc,aAAd,KAAgC,aAAhC,GAAgD,UAAhD,GAA6D,OADlD,CAAb;EAIA,MAAM,OAAO,GAAG,iBAAA,CAAA,gBAAA,CAAkB,CAAD,IAA8C;;;IAC7E,IAAI,QAAJ,EAAc;MACZ,aAAa,CAAC,CAAD,CAAb;IACD;;IAED,CAAA,EAAA,GAAA,KAAK,CAAC,OAAN,MAAa,IAAb,IAAa,EAAA,KAAA,KAAA,CAAb,GAAa,KAAA,CAAb,GAAa,EAAA,CAAA,IAAA,CAAb,KAAa,EAAG,CAAH,CAAb;EACD,CANe,CAAhB;EAQA,OAAO,uBAAA,CAAA,8BAAA,CACL;IACE,EAAE,EAAE,KADN;IAEE,IAAI,EAAE,UAFR;IAGE,OAHF;IAIE,IAJF;IAKE,QAAQ,EAAE,CALZ;IAME,MAAM,EAAE,QAAQ,IAAI,CAAC,WANvB;IAOE,MAPF;IAQE,iBAAiB,EAAE;MAAE,QAAQ,EAAE,CAAC;IAAb,CARrB;IASE,GAAG,KATL;IAUE;EAVF,CADK,EAaL,GAbK,CAAP;AAeD,CA5CM;;AAAM,OAAA,CAAA,iCAAA,GAAiC,iCAAjC","sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n const isHeader = useIsInTableHeader();\n const rowId = useRowIdContext();\n const multiselect = useDataGridContext_unstable(ctx => ctx.selection.selectionMode === 'multiselect');\n const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const checked = useDataGridContext_unstable(ctx => {\n if (isHeader && multiselect) {\n return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;\n }\n\n return ctx.selection.isRowSelected(rowId);\n });\n\n const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);\n const type = useDataGridContext_unstable(ctx =>\n ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio',\n );\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableCellElement>) => {\n if (isHeader) {\n toggleAllRows(e);\n }\n\n props.onClick?.(e);\n });\n\n return useTableSelectionCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n checked,\n type,\n tabIndex: 0,\n hidden: isHeader && !multiselect,\n subtle,\n checkboxIndicator: { tabIndex: -1 },\n ...props,\n onClick,\n },\n ref,\n );\n};\n"],"sourceRoot":"../src/"}
@@ -23,7 +23,8 @@ const useTableCell_unstable = (props, ref) => {
23
23
  var _a;
24
24
 
25
25
  const {
26
- noNativeElements
26
+ noNativeElements,
27
+ size
27
28
  } = tableContext_1.useTableContext();
28
29
  const rootComponent = ((_a = props.as) !== null && _a !== void 0 ? _a : noNativeElements) ? 'div' : 'td';
29
30
  return {
@@ -35,7 +36,8 @@ const useTableCell_unstable = (props, ref) => {
35
36
  role: rootComponent === 'div' ? 'cell' : undefined,
36
37
  ...props
37
38
  }),
38
- noNativeElements
39
+ noNativeElements,
40
+ size
39
41
  };
40
42
  };
41
43
 
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/TableCell/useTableCell.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,qBAAqB,GAAG,CAAC,KAAD,EAAwB,GAAxB,KAAuE;;;EAC1G,MAAM;IAAE;EAAF,IAAuB,cAAA,CAAA,eAAA,EAA7B;EAEA,MAAM,aAAa,GAAG,CAAA,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,gBAAZ,IAA+B,KAA/B,GAAuC,IAA7D;EAEA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,aAAtB,EAAqC;MACzC,GADyC;MAEzC,IAAI,EAAE,aAAa,KAAK,KAAlB,GAA0B,MAA1B,GAAmC,SAFA;MAGzC,GAAG;IAHsC,CAArC,CAJD;IASL;EATK,CAAP;AAWD,CAhBM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { TableCellProps, TableCellState } from './TableCell.types';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render TableCell.\n *\n * The returned state can be modified with hooks such as useTableCellStyles_unstable,\n * before being passed to renderTableCell_unstable.\n *\n * @param props - props from this instance of TableCell\n * @param ref - reference to root HTMLElement of TableCell\n */\nexport const useTableCell_unstable = (props: TableCellProps, ref: React.Ref<HTMLElement>): TableCellState => {\n const { noNativeElements } = useTableContext();\n\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'td';\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref,\n role: rootComponent === 'div' ? 'cell' : undefined,\n ...props,\n }),\n noNativeElements,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-table/src/components/TableCell/useTableCell.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,qBAAqB,GAAG,CAAC,KAAD,EAAwB,GAAxB,KAAuE;;;EAC1G,MAAM;IAAE,gBAAF;IAAoB;EAApB,IAA6B,cAAA,CAAA,eAAA,EAAnC;EAEA,MAAM,aAAa,GAAG,CAAA,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,gBAAZ,IAA+B,KAA/B,GAAuC,IAA7D;EAEA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,aAAtB,EAAqC;MACzC,GADyC;MAEzC,IAAI,EAAE,aAAa,KAAK,KAAlB,GAA0B,MAA1B,GAAmC,SAFA;MAGzC,GAAG;IAHsC,CAArC,CAJD;IASL,gBATK;IAUL;EAVK,CAAP;AAYD,CAjBM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { TableCellProps, TableCellState } from './TableCell.types';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render TableCell.\n *\n * The returned state can be modified with hooks such as useTableCellStyles_unstable,\n * before being passed to renderTableCell_unstable.\n *\n * @param props - props from this instance of TableCell\n * @param ref - reference to root HTMLElement of TableCell\n */\nexport const useTableCell_unstable = (props: TableCellProps, ref: React.Ref<HTMLElement>): TableCellState => {\n const { noNativeElements, size } = useTableContext();\n\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'td';\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref,\n role: rootComponent === 'div' ? 'cell' : undefined,\n ...props,\n }),\n noNativeElements,\n size,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -9,6 +9,8 @@ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
10
  const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
11
 
12
+ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
13
+
12
14
  exports.tableCellClassName = 'fui-TableCell';
13
15
  exports.tableCellClassNames = {
14
16
  root: exports.tableCellClassName
@@ -18,9 +20,18 @@ const useTableLayoutStyles = /*#__PURE__*/react_1.__styles({
18
20
  "root": {
19
21
  "mc9l5x": "f15pt5es",
20
22
  "ha4doy": "fmrv4ls"
23
+ },
24
+ "medium": {
25
+ "Bqenvij": "f1ft4266"
26
+ },
27
+ "small": {
28
+ "Bqenvij": "fbsu25e"
29
+ },
30
+ "extra-small": {
31
+ "Bqenvij": "frvgh55"
21
32
  }
22
33
  }, {
23
- "d": [".f15pt5es{display:table-cell;}", ".fmrv4ls{vertical-align:middle;}"]
34
+ "d": [".f15pt5es{display:table-cell;}", ".fmrv4ls{vertical-align:middle;}", ".f1ft4266{height:44px;}", ".fbsu25e{height:34px;}", ".frvgh55{height:24px;}"]
24
35
  });
25
36
 
26
37
  const useFlexLayoutStyles = /*#__PURE__*/react_1.__styles({
@@ -31,9 +42,18 @@ const useFlexLayoutStyles = /*#__PURE__*/react_1.__styles({
31
42
  "Bh6795r": "fqerorx",
32
43
  "Bnnss6s": "f1neuvcm",
33
44
  "xawz": "fkjuxzh"
45
+ },
46
+ "medium": {
47
+ "sshi5w": "f5pgtk9"
48
+ },
49
+ "small": {
50
+ "sshi5w": "fcep9tg"
51
+ },
52
+ "extra-small": {
53
+ "sshi5w": "f1pha7fy"
34
54
  }
35
55
  }, {
36
- "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f10tiqix{min-width:0px;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1neuvcm{-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".fkjuxzh{-webkit-flex-basis:0px;-ms-flex-preferred-size:0px;flex-basis:0px;}"]
56
+ "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f10tiqix{min-width:0px;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1neuvcm{-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".fkjuxzh{-webkit-flex-basis:0px;-ms-flex-preferred-size:0px;flex-basis:0px;}", ".f5pgtk9{min-height:44px;}", ".fcep9tg{min-height:34px;}", ".f1pha7fy{min-height:24px;}"]
37
57
  });
38
58
  /**
39
59
  * Styles for the root slot
@@ -46,10 +66,17 @@ const useStyles = /*#__PURE__*/react_1.__styles({
46
66
  "z8tnut": "f1nbblvp",
47
67
  "z189sj": ["f1vdfbxk", "f1f5gg8d"],
48
68
  "Byoj8tv": "f1ov4xf1",
49
- "uwmqm3": ["f1f5gg8d", "f1vdfbxk"]
69
+ "uwmqm3": ["f1f5gg8d", "f1vdfbxk"],
70
+ "Bn4voq9": "fz36nt7",
71
+ "g9k6zt": "f9znhxp",
72
+ "Bfpq7zp": "fqrak0z",
73
+ "kdpuga": ["f1o2ludy", "f1kjnpwc"],
74
+ "Bw81rd7": ["f1kjnpwc", "f1o2ludy"],
75
+ "B6xbmo0": ["fxmnebo", "f1witrsb"],
76
+ "dm238s": ["f1witrsb", "fxmnebo"]
50
77
  }
51
78
  }, {
52
- "d": [".f10pi13n{position:relative;}", ".f1nbblvp{padding-top:0px;}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1ov4xf1{padding-bottom:0px;}"]
79
+ "d": [".f10pi13n{position:relative;}", ".f1nbblvp{padding-top:0px;}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1ov4xf1{padding-bottom:0px;}", ".fz36nt7[data-fui-focus-visible]{outline-width:2px;}", ".f9znhxp[data-fui-focus-visible]{outline-style:solid;}", ".fqrak0z[data-fui-focus-visible]{outline-color:var(--colorStrokeFocus2);}", ".f1o2ludy[data-fui-focus-visible]{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1kjnpwc[data-fui-focus-visible]{border-bottom-left-radius:var(--borderRadiusMedium);}", ".fxmnebo[data-fui-focus-visible]{border-top-right-radius:var(--borderRadiusMedium);}", ".f1witrsb[data-fui-focus-visible]{border-top-left-radius:var(--borderRadiusMedium);}"]
53
80
  });
54
81
  /**
55
82
  * Apply styling to the TableCell slots based on the state
@@ -62,7 +89,7 @@ const useTableCellStyles_unstable = state => {
62
89
  table: useTableLayoutStyles(),
63
90
  flex: useFlexLayoutStyles()
64
91
  };
65
- state.root.className = react_1.mergeClasses(exports.tableCellClassNames.root, styles.root, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.root.className);
92
+ state.root.className = react_1.mergeClasses(exports.tableCellClassNames.root, styles.root, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.noNativeElements ? layoutStyles.flex[state.size] : layoutStyles.table[state.size], state.root.className);
66
93
  return state;
67
94
  };
68
95
 
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/TableCell/useTableCellStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,kBAAA,GAAqB,eAArB;AACA,OAAA,CAAA,mBAAA,GAAsD;EACjE,IAAI,EAAE,OAAA,CAAA;AAD2D,CAAtD;;AAIb,MAAM,oBAAoB,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA7B;;AAOA,MAAM,mBAAmB,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA5B;AASA;;AAEG;;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAOA;;AAEG;;;AACI,MAAM,2BAA2B,GAAI,KAAD,IAA0C;EACnF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,oBAAoB,EADR;IAEnB,IAAI,EAAE,mBAAmB;EAFN,CAArB;EAIA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,mBAAA,CAAoB,IADC,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,gBAAN,GAAyB,YAAY,CAAC,IAAb,CAAkB,IAA3C,GAAkD,YAAY,CAAC,KAAb,CAAmB,IAHhD,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;EAMA,OAAO,KAAP;AACD,CAbM;;AAAM,OAAA,CAAA,2BAAA,GAA2B,2BAA3B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableCellSlots, TableCellState } from './TableCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tableCellClassName = 'fui-TableCell';\nexport const tableCellClassNames: SlotClassNames<TableCellSlots> = {\n root: tableCellClassName,\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-cell',\n verticalAlign: 'middle',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n minWidth: '0px',\n alignItems: 'center',\n ...shorthands.flex(1, 1, '0px'),\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'relative',\n ...shorthands.padding('0px', tokens.spacingHorizontalS),\n },\n});\n\n/**\n * Apply styling to the TableCell slots based on the state\n */\nexport const useTableCellStyles_unstable = (state: TableCellState): TableCellState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableCellClassNames.root,\n styles.root,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.root.className,\n );\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-table/src/components/TableCell/useTableCellStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAIa,OAAA,CAAA,kBAAA,GAAqB,eAArB;AACA,OAAA,CAAA,mBAAA,GAAsD;EACjE,IAAI,EAAE,OAAA,CAAA;AAD2D,CAAtD;;AAIb,MAAM,oBAAoB,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA7B;;AAmBA,MAAM,mBAAmB,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA5B;AAqBA;;AAEG;;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAeA;;AAEG;;;AACI,MAAM,2BAA2B,GAAI,KAAD,IAA0C;EACnF,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,oBAAoB,EADR;IAEnB,IAAI,EAAE,mBAAmB;EAFN,CAArB;EAIA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,mBAAA,CAAoB,IADC,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,gBAAN,GAAyB,YAAY,CAAC,IAAb,CAAkB,IAA3C,GAAkD,YAAY,CAAC,KAAb,CAAmB,IAHhD,EAIrB,KAAK,CAAC,gBAAN,GAAyB,YAAY,CAAC,IAAb,CAAkB,KAAK,CAAC,IAAxB,CAAzB,GAAyD,YAAY,CAAC,KAAb,CAAmB,KAAK,CAAC,IAAzB,CAJpC,EAKrB,KAAK,CAAC,IAAN,CAAW,SALU,CAAvB;EAOA,OAAO,KAAP;AACD,CAdM;;AAAM,OAAA,CAAA,2BAAA,GAA2B,2BAA3B","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport type { TableCellSlots, TableCellState } from './TableCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tableCellClassName = 'fui-TableCell';\nexport const tableCellClassNames: SlotClassNames<TableCellSlots> = {\n root: tableCellClassName,\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-cell',\n verticalAlign: 'middle',\n },\n\n medium: {\n height: '44px',\n },\n\n small: {\n height: '34px',\n },\n\n 'extra-small': {\n height: '24px',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n minWidth: '0px',\n alignItems: 'center',\n ...shorthands.flex(1, 1, '0px'),\n },\n\n medium: {\n minHeight: '44px',\n },\n\n small: {\n minHeight: '34px',\n },\n\n 'extra-small': {\n minHeight: '24px',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'relative',\n ...shorthands.padding('0px', tokens.spacingHorizontalS),\n\n ...createCustomFocusIndicatorStyle(\n {\n ...shorthands.outline('2px', 'solid', tokens.colorStrokeFocus2),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n { selector: 'focus', enableOutline: true },\n ),\n },\n});\n\n/**\n * Apply styling to the TableCell slots based on the state\n */\nexport const useTableCellStyles_unstable = (state: TableCellState): TableCellState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableCellClassNames.root,\n styles.root,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.noNativeElements ? layoutStyles.flex[state.size] : layoutStyles.table[state.size],\n state.root.className,\n );\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useTableCellActions_unstable = void 0;
7
7
 
8
8
  const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
-
10
- const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
9
  /**
12
10
  * Create the state required to render TableCellActions.
13
11
  *
@@ -27,7 +25,7 @@ const useTableCellActions_unstable = (props, ref) => {
27
25
  root: 'div'
28
26
  },
29
27
  root: react_utilities_1.getNativeElementProps('div', {
30
- ref: react_utilities_1.useMergedRefs(ref, react_tabster_1.useFocusWithin()),
28
+ ref,
31
29
  ...props
32
30
  }),
33
31
  visible: (_a = props.visible) !== null && _a !== void 0 ? _a : false
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/TableCellActions/useTableCellActions.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,4BAA4B,GAAG,CAC1C,KAD0C,EAE1C,GAF0C,KAGjB;;;EACzB,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MACjC,GAAG,EAAE,iBAAA,CAAA,aAAA,CAAc,GAAd,EAAmB,eAAA,CAAA,cAAA,EAAnB,CAD4B;MAEjC,GAAG;IAF8B,CAA7B,CAJD;IAQL,OAAO,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,OAAN,MAAa,IAAb,IAAa,EAAA,KAAA,KAAA,CAAb,GAAa,EAAb,GAAiB;EARrB,CAAP;AAUD,CAdM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport type { TableCellActionsProps, TableCellActionsState } from './TableCellActions.types';\n\n/**\n * Create the state required to render TableCellActions.\n *\n * The returned state can be modified with hooks such as useTableCellActionsStyles_unstable,\n * before being passed to renderTableCellActions_unstable.\n *\n * @param props - props from this instance of TableCellActions\n * @param ref - reference to root HTMLElement of TableCellActions\n */\nexport const useTableCellActions_unstable = (\n props: TableCellActionsProps,\n ref: React.Ref<HTMLElement>,\n): TableCellActionsState => {\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, useFocusWithin()),\n ...props,\n }),\n visible: props.visible ?? false,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-table/src/components/TableCellActions/useTableCellActions.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,4BAA4B,GAAG,CAC1C,KAD0C,EAE1C,GAF0C,KAGjB;;;EACzB,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MACjC,GADiC;MAEjC,GAAG;IAF8B,CAA7B,CAJD;IAQL,OAAO,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,OAAN,MAAa,IAAb,IAAa,EAAA,KAAA,KAAA,CAAb,GAAa,EAAb,GAAiB;EARrB,CAAP;AAUD,CAdM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { TableCellActionsProps, TableCellActionsState } from './TableCellActions.types';\n\n/**\n * Create the state required to render TableCellActions.\n *\n * The returned state can be modified with hooks such as useTableCellActionsStyles_unstable,\n * before being passed to renderTableCellActions_unstable.\n *\n * @param props - props from this instance of TableCellActions\n * @param ref - reference to root HTMLElement of TableCellActions\n */\nexport const useTableCellActions_unstable = (\n props: TableCellActionsProps,\n ref: React.Ref<HTMLElement>,\n): TableCellActionsState => {\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n visible: props.visible ?? false,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -7,8 +7,6 @@ exports.useTableCellActionsStyles_unstable = exports.tableCellActionsClassNames
7
7
 
8
8
  const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
- const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
-
12
10
  exports.tableCellActionsClassNames = {
13
11
  root: 'fui-TableCellActions'
14
12
  };
@@ -23,18 +21,13 @@ const useStyles = /*#__PURE__*/react_1.__styles({
23
21
  "Bhzewxz": "f1i1t8d1",
24
22
  "Bz10aip": "f188r07x",
25
23
  "abs64n": "fk73vx1",
26
- "Frg6f3": ["fcgxt0o", "f1ujusj6"],
27
- "Brovlpu": "ftqa4ok",
28
- "B486eqv": "f2hkw1w",
29
- "B113ap8": "f1upwfw9"
24
+ "Frg6f3": ["fcgxt0o", "f1ujusj6"]
30
25
  },
31
26
  "visible": {
32
27
  "abs64n": "f5p0z4x"
33
28
  }
34
29
  }, {
35
- "d": [".f1euv43f{position:absolute;}", ".f10k790i{right:0px;}", ".f1xynx9j{left:0px;}", ".f1i1t8d1{top:50%;}", ".f188r07x{-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}", ".fk73vx1{opacity:0;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}", ".f1upwfw9[data-fui-focus-visible]:focus-within{opacity:1;}", ".f5p0z4x{opacity:1;}"],
36
- "f": [".ftqa4ok:focus{outline-style:none;}"],
37
- "i": [".f2hkw1w:focus-visible{outline-style:none;}"]
30
+ "d": [".f1euv43f{position:absolute;}", ".f10k790i{right:0px;}", ".f1xynx9j{left:0px;}", ".f1i1t8d1{top:50%;}", ".f188r07x{-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}", ".fk73vx1{opacity:0;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}", ".f5p0z4x{opacity:1;}"]
38
31
  });
39
32
  /**
40
33
  * Apply styling to the TableCellActions slots based on the state
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/TableCellActions/useTableCellActionsStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAEa,OAAA,CAAA,0BAAA,GAAoE;EAC/E,IAAI,EAAE;AADyE,CAApE;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EAAlB;AAsBA;;AAEG;;;AACI,MAAM,kCAAkC,GAAI,KAAD,IAAwD;EACxG,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,0BAAA,CAA2B,IADN,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,OAAN,IAAiB,MAAM,CAAC,OAHH,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;EAOA,OAAO,KAAP;AACD,CAVM;;AAAM,OAAA,CAAA,kCAAA,GAAkC,kCAAlC","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport type { TableCellActionsSlots, TableCellActionsState } from './TableCellActions.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\n\nexport const tableCellActionsClassNames: SlotClassNames<TableCellActionsSlots> = {\n root: 'fui-TableCellActions',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'absolute',\n right: '0px',\n top: '50%',\n transform: 'translateY(-50%)',\n opacity: 0,\n marginLeft: 'auto',\n\n ...createCustomFocusIndicatorStyle(\n {\n opacity: 1,\n },\n { selector: 'focus-within' },\n ),\n },\n\n visible: {\n opacity: 1,\n },\n});\n\n/**\n * Apply styling to the TableCellActions slots based on the state\n */\nexport const useTableCellActionsStyles_unstable = (state: TableCellActionsState): TableCellActionsState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n tableCellActionsClassNames.root,\n styles.root,\n state.visible && styles.visible,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-table/src/components/TableCellActions/useTableCellActionsStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAIa,OAAA,CAAA,0BAAA,GAAoE;EAC/E,IAAI,EAAE;AADyE,CAApE;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAeA;;AAEG;;;AACI,MAAM,kCAAkC,GAAI,KAAD,IAAwD;EACxG,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,0BAAA,CAA2B,IADN,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,OAAN,IAAiB,MAAM,CAAC,OAHH,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;EAOA,OAAO,KAAP;AACD,CAVM;;AAAM,OAAA,CAAA,kCAAA,GAAkC,kCAAlC","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport type { TableCellActionsSlots, TableCellActionsState } from './TableCellActions.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tableCellActionsClassNames: SlotClassNames<TableCellActionsSlots> = {\n root: 'fui-TableCellActions',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'absolute',\n right: '0px',\n top: '50%',\n transform: 'translateY(-50%)',\n opacity: 0,\n marginLeft: 'auto',\n },\n\n visible: {\n opacity: 1,\n },\n});\n\n/**\n * Apply styling to the TableCellActions slots based on the state\n */\nexport const useTableCellActionsStyles_unstable = (state: TableCellActionsState): TableCellActionsState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n tableCellActionsClassNames.root,\n styles.root,\n state.visible && styles.visible,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -12,7 +12,7 @@ const tableContext_1 = /*#__PURE__*/require("../../contexts/tableContext");
12
12
  const tableAvatarSizeMap = {
13
13
  medium: 32,
14
14
  small: 24,
15
- smaller: 20
15
+ 'extra-small': 20
16
16
  };
17
17
  /**
18
18
  * Create the state required to render TableCellLayout.
@@ -49,7 +49,8 @@ const useTableCellLayout_unstable = (props, ref) => {
49
49
  wrapper: react_utilities_1.resolveShorthand(props.wrapper, {
50
50
  required: !!props.description || !!props.children
51
51
  }),
52
- avatarSize: tableAvatarSizeMap[size]
52
+ avatarSize: tableAvatarSizeMap[size],
53
+ size
53
54
  };
54
55
  };
55
56
 
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/TableCellLayout/useTableCellLayout.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,MAAM,kBAAkB,GAAG;EACzB,MAAM,EAAE,EADiB;EAEzB,KAAK,EAAE,EAFkB;EAGzB,OAAO,EAAE;AAHgB,CAA3B;AAMA;;;;;;;;AAQG;;AACI,MAAM,2BAA2B,GAAG,CACzC,KADyC,EAEzC,GAFyC,KAGjB;EACxB,MAAM;IAAE;EAAF,IAAW,cAAA,CAAA,eAAA,EAAjB;EAEA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,IAAI,EAAE,MAFI;MAGV,WAAW,EAAE,MAHH;MAIV,OAAO,EAAE,KAJC;MAKV,KAAK,EAAE;IALG,CADP;IAQL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MAAE,GAAF;MAAO,GAAG;IAAV,CAA7B,CARD;IASL,UAAU,EAAE,KAAK,CAAC,UATb;IAUL,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,IAAvB,EAA6B;MAAE,QAAQ,EAAE;IAAZ,CAA7B,CAVD;IAWL,KAAK,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,KAAvB,CAXF;IAYL,WAAW,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,WAAvB,CAZR;IAaL,OAAO,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,OAAvB,EAAgC;MAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,WAAR,IAAuB,CAAC,CAAC,KAAK,CAAC;IAA3C,CAAhC,CAbJ;IAcL,UAAU,EAAE,kBAAkB,CAAC,IAAD;EAdzB,CAAP;AAgBD,CAtBM;;AAAM,OAAA,CAAA,2BAAA,GAA2B,2BAA3B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { TableCellLayoutProps, TableCellLayoutState } from './TableCellLayout.types';\nimport { useTableContext } from '../../contexts/tableContext';\n\nconst tableAvatarSizeMap = {\n medium: 32,\n small: 24,\n smaller: 20,\n} as const;\n\n/**\n * Create the state required to render TableCellLayout.\n *\n * The returned state can be modified with hooks such as useTableCellLayoutStyles_unstable,\n * before being passed to renderTableCellLayout_unstable.\n *\n * @param props - props from this instance of TableCellLayout\n * @param ref - reference to root HTMLElement of TableCellLayout\n */\nexport const useTableCellLayout_unstable = (\n props: TableCellLayoutProps,\n ref: React.Ref<HTMLElement>,\n): TableCellLayoutState => {\n const { size } = useTableContext();\n\n return {\n components: {\n root: 'div',\n main: 'span',\n description: 'span',\n wrapper: 'div',\n media: 'span',\n },\n root: getNativeElementProps('div', { ref, ...props }),\n appearance: props.appearance,\n main: resolveShorthand(props.main, { required: true }),\n media: resolveShorthand(props.media),\n description: resolveShorthand(props.description),\n wrapper: resolveShorthand(props.wrapper, { required: !!props.description || !!props.children }),\n avatarSize: tableAvatarSizeMap[size],\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-table/src/components/TableCellLayout/useTableCellLayout.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,MAAM,kBAAkB,GAAG;EACzB,MAAM,EAAE,EADiB;EAEzB,KAAK,EAAE,EAFkB;EAGzB,eAAe;AAHU,CAA3B;AAMA;;;;;;;;AAQG;;AACI,MAAM,2BAA2B,GAAG,CACzC,KADyC,EAEzC,GAFyC,KAGjB;EACxB,MAAM;IAAE;EAAF,IAAW,cAAA,CAAA,eAAA,EAAjB;EAEA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,IAAI,EAAE,MAFI;MAGV,WAAW,EAAE,MAHH;MAIV,OAAO,EAAE,KAJC;MAKV,KAAK,EAAE;IALG,CADP;IAQL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MAAE,GAAF;MAAO,GAAG;IAAV,CAA7B,CARD;IASL,UAAU,EAAE,KAAK,CAAC,UATb;IAUL,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,IAAvB,EAA6B;MAAE,QAAQ,EAAE;IAAZ,CAA7B,CAVD;IAWL,KAAK,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,KAAvB,CAXF;IAYL,WAAW,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,WAAvB,CAZR;IAaL,OAAO,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,OAAvB,EAAgC;MAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,WAAR,IAAuB,CAAC,CAAC,KAAK,CAAC;IAA3C,CAAhC,CAbJ;IAcL,UAAU,EAAE,kBAAkB,CAAC,IAAD,CAdzB;IAeL;EAfK,CAAP;AAiBD,CAvBM;;AAAM,OAAA,CAAA,2BAAA,GAA2B,2BAA3B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { TableCellLayoutProps, TableCellLayoutState } from './TableCellLayout.types';\nimport { useTableContext } from '../../contexts/tableContext';\n\nconst tableAvatarSizeMap = {\n medium: 32,\n small: 24,\n 'extra-small': 20,\n} as const;\n\n/**\n * Create the state required to render TableCellLayout.\n *\n * The returned state can be modified with hooks such as useTableCellLayoutStyles_unstable,\n * before being passed to renderTableCellLayout_unstable.\n *\n * @param props - props from this instance of TableCellLayout\n * @param ref - reference to root HTMLElement of TableCellLayout\n */\nexport const useTableCellLayout_unstable = (\n props: TableCellLayoutProps,\n ref: React.Ref<HTMLElement>,\n): TableCellLayoutState => {\n const { size } = useTableContext();\n\n return {\n components: {\n root: 'div',\n main: 'span',\n description: 'span',\n wrapper: 'div',\n media: 'span',\n },\n root: getNativeElementProps('div', { ref, ...props }),\n appearance: props.appearance,\n main: resolveShorthand(props.main, { required: true }),\n media: resolveShorthand(props.media),\n description: resolveShorthand(props.description),\n wrapper: resolveShorthand(props.wrapper, { required: !!props.description || !!props.children }),\n avatarSize: tableAvatarSizeMap[size],\n size,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -9,6 +9,8 @@ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
10
  const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
11
 
12
+ const react_theme_2 = /*#__PURE__*/require("@fluentui/react-theme");
13
+
12
14
  exports.tableCellLayoutClassNames = {
13
15
  root: 'fui-TableCellLayout',
14
16
  media: 'fui-TableCellLayout__media',
@@ -38,19 +40,27 @@ const useStyles = /*#__PURE__*/react_1.__styles({
38
40
  "mc9l5x": "f22iagw",
39
41
  "Bt984gj": "f122n59"
40
42
  },
43
+ "mediaExtraSmall": {
44
+ "Be2twd7": "f4ybsrx"
45
+ },
46
+ "mediaSmallAndMedium": {
47
+ "Be2twd7": "fe5j1ua"
48
+ },
41
49
  "mediaPrimary": {
42
- "B5pe6w7": "fqgjdyf",
43
- "p4uzdd": "fppfxz8"
50
+ "Be2twd7": "f1rt2boy"
44
51
  },
45
52
  "mainPrimary": {
46
53
  "Bhrd7zp": "fl43uef"
47
54
  },
48
55
  "description": {
49
- "Be2twd7": "fkhj508",
50
- "sj55zd": "fkfq4zb"
56
+ "sj55zd": "fkfq4zb",
57
+ "Bahqtrf": "fk6fouc",
58
+ "Be2twd7": "fy9rknc",
59
+ "Bhrd7zp": "figsok6",
60
+ "Bg96gwp": "fwrc4pm"
51
61
  }
52
62
  }, {
53
- "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fsnqrgy{-webkit-column-gap:var(--spacingHorizontalS);column-gap:var(--spacingHorizontalS);}", ".fylz90v{row-gap:var(--spacingHorizontalS);}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1neuvcm{-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".fkjuxzh{-webkit-flex-basis:0px;-ms-flex-preferred-size:0px;flex-basis:0px;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".fqgjdyf svg{width:28px;}", ".fppfxz8 svg{height:28px;}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}"]
63
+ "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fsnqrgy{-webkit-column-gap:var(--spacingHorizontalS);column-gap:var(--spacingHorizontalS);}", ".fylz90v{row-gap:var(--spacingHorizontalS);}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1neuvcm{-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".fkjuxzh{-webkit-flex-basis:0px;-ms-flex-preferred-size:0px;flex-basis:0px;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f4ybsrx{font-size:16px;}", ".fe5j1ua{font-size:20px;}", ".f1rt2boy{font-size:24px;}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}"]
54
64
  });
55
65
  /**
56
66
  * Apply styling to the TableCellLayout slots based on the state
@@ -63,7 +73,12 @@ const useTableCellLayoutStyles_unstable = state => {
63
73
  const primary = state.appearance === 'primary';
64
74
 
65
75
  if (state.media) {
66
- state.media.className = react_1.mergeClasses(exports.tableCellLayoutClassNames.media, styles.media, primary && styles.mediaPrimary, state.media.className);
76
+ const mediaSizedStyles = {
77
+ small: styles.mediaSmallAndMedium,
78
+ medium: styles.mediaSmallAndMedium,
79
+ 'extra-small': styles.mediaExtraSmall
80
+ };
81
+ state.media.className = react_1.mergeClasses(exports.tableCellLayoutClassNames.media, styles.media, mediaSizedStyles[state.size], primary && styles.mediaPrimary, state.media.className);
67
82
  }
68
83
 
69
84
  if (state.main) {
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/TableCellLayout/useTableCellLayoutStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,yBAAA,GAAkE;EAC7E,IAAI,EAAE,qBADuE;EAE7E,KAAK,EAAE,4BAFsE;EAG7E,IAAI,EAAE,2BAHuE;EAI7E,WAAW,EAAE,kCAJgE;EAK7E,OAAO,EAAE;AALoE,CAAlE;AAQb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAkCA;;AAEG;;;AACI,MAAM,iCAAiC,GAAI,KAAD,IAAsD;EACrG,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,yBAAA,CAA0B,IAAvC,EAA6C,MAAM,CAAC,IAApD,EAA0D,KAAK,CAAC,IAAN,CAAW,SAArE,CAAvB;EACA,MAAM,OAAO,GAAG,KAAK,CAAC,UAAN,KAAqB,SAArC;;EAEA,IAAI,KAAK,CAAC,KAAV,EAAiB;IACf,KAAK,CAAC,KAAN,CAAY,SAAZ,GAAwB,OAAA,CAAA,YAAA,CACtB,OAAA,CAAA,yBAAA,CAA0B,KADJ,EAEtB,MAAM,CAAC,KAFe,EAGtB,OAAO,IAAI,MAAM,CAAC,YAHI,EAItB,KAAK,CAAC,KAAN,CAAY,SAJU,CAAxB;EAMD;;EAED,IAAI,KAAK,CAAC,IAAV,EAAgB;IACd,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,yBAAA,CAA0B,IADL,EAErB,OAAO,IAAI,MAAM,CAAC,WAFG,EAGrB,KAAK,CAAC,IAAN,CAAW,SAHU,CAAvB;EAKD;;EAED,IAAI,KAAK,CAAC,WAAV,EAAuB;IACrB,KAAK,CAAC,WAAN,CAAkB,SAAlB,GAA8B,OAAA,CAAA,YAAA,CAC5B,OAAA,CAAA,yBAAA,CAA0B,WADE,EAE5B,MAAM,CAAC,WAFqB,EAG5B,KAAK,CAAC,WAAN,CAAkB,SAHU,CAA9B;EAKD;;EAED,IAAI,KAAK,CAAC,OAAV,EAAmB;IACjB,KAAK,CAAC,OAAN,CAAc,SAAd,GAA0B,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,yBAAA,CAA0B,OAAvC,EAAgD,MAAM,CAAC,OAAvD,EAAgE,KAAK,CAAC,OAAN,CAAc,SAA9E,CAA1B;EACD;;EAED,OAAO,KAAP;AACD,CAnCM;;AAAM,OAAA,CAAA,iCAAA,GAAiC,iCAAjC","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableCellLayoutSlots, TableCellLayoutState } from './TableCellLayout.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tableCellLayoutClassNames: SlotClassNames<TableCellLayoutSlots> = {\n root: 'fui-TableCellLayout',\n media: 'fui-TableCellLayout__media',\n main: 'fui-TableCellLayout__main',\n description: 'fui-TableCellLayout__description',\n wrapper: 'fui-TableCellLayout__wrapper',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n ...shorthands.gap(tokens.spacingHorizontalS),\n ...shorthands.flex(1, 1, '0px'),\n },\n wrapper: {\n display: 'flex',\n flexDirection: 'column',\n },\n\n media: {\n display: 'flex',\n alignItems: 'center',\n },\n\n mediaPrimary: {\n '& svg': {\n width: '28px',\n height: '28px',\n },\n },\n\n mainPrimary: {\n fontWeight: tokens.fontWeightSemibold,\n },\n\n description: {\n fontSize: tokens.fontSizeBase300,\n color: tokens.colorNeutralForeground2,\n },\n});\n\n/**\n * Apply styling to the TableCellLayout slots based on the state\n */\nexport const useTableCellLayoutStyles_unstable = (state: TableCellLayoutState): TableCellLayoutState => {\n const styles = useStyles();\n state.root.className = mergeClasses(tableCellLayoutClassNames.root, styles.root, state.root.className);\n const primary = state.appearance === 'primary';\n\n if (state.media) {\n state.media.className = mergeClasses(\n tableCellLayoutClassNames.media,\n styles.media,\n primary && styles.mediaPrimary,\n state.media.className,\n );\n }\n\n if (state.main) {\n state.main.className = mergeClasses(\n tableCellLayoutClassNames.main,\n primary && styles.mainPrimary,\n state.main.className,\n );\n }\n\n if (state.description) {\n state.description.className = mergeClasses(\n tableCellLayoutClassNames.description,\n styles.description,\n state.description.className,\n );\n }\n\n if (state.wrapper) {\n state.wrapper.className = mergeClasses(tableCellLayoutClassNames.wrapper, styles.wrapper, state.wrapper.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-table/src/components/TableCellLayout/useTableCellLayoutStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAGA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAEa,OAAA,CAAA,yBAAA,GAAkE;EAC7E,IAAI,EAAE,qBADuE;EAE7E,KAAK,EAAE,4BAFsE;EAG7E,IAAI,EAAE,2BAHuE;EAI7E,WAAW,EAAE,kCAJgE;EAK7E,OAAO,EAAE;AALoE,CAAlE;AAQb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAuCA;;AAEG;;;AACI,MAAM,iCAAiC,GAAI,KAAD,IAAsD;EACrG,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,yBAAA,CAA0B,IAAvC,EAA6C,MAAM,CAAC,IAApD,EAA0D,KAAK,CAAC,IAAN,CAAW,SAArE,CAAvB;EACA,MAAM,OAAO,GAAG,KAAK,CAAC,UAAN,KAAqB,SAArC;;EAEA,IAAI,KAAK,CAAC,KAAV,EAAiB;IACf,MAAM,gBAAgB,GAAG;MACvB,KAAK,EAAE,MAAM,CAAC,mBADS;MAEvB,MAAM,EAAE,MAAM,CAAC,mBAFQ;MAGvB,eAAe,MAAM,CAAC;IAHC,CAAzB;IAMA,KAAK,CAAC,KAAN,CAAY,SAAZ,GAAwB,OAAA,CAAA,YAAA,CACtB,OAAA,CAAA,yBAAA,CAA0B,KADJ,EAEtB,MAAM,CAAC,KAFe,EAGtB,gBAAgB,CAAC,KAAK,CAAC,IAAP,CAHM,EAItB,OAAO,IAAI,MAAM,CAAC,YAJI,EAKtB,KAAK,CAAC,KAAN,CAAY,SALU,CAAxB;EAOD;;EAED,IAAI,KAAK,CAAC,IAAV,EAAgB;IACd,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,yBAAA,CAA0B,IADL,EAErB,OAAO,IAAI,MAAM,CAAC,WAFG,EAGrB,KAAK,CAAC,IAAN,CAAW,SAHU,CAAvB;EAKD;;EAED,IAAI,KAAK,CAAC,WAAV,EAAuB;IACrB,KAAK,CAAC,WAAN,CAAkB,SAAlB,GAA8B,OAAA,CAAA,YAAA,CAC5B,OAAA,CAAA,yBAAA,CAA0B,WADE,EAE5B,MAAM,CAAC,WAFqB,EAG5B,KAAK,CAAC,WAAN,CAAkB,SAHU,CAA9B;EAKD;;EAED,IAAI,KAAK,CAAC,OAAV,EAAmB;IACjB,KAAK,CAAC,OAAN,CAAc,SAAd,GAA0B,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,yBAAA,CAA0B,OAAvC,EAAgD,MAAM,CAAC,OAAvD,EAAgE,KAAK,CAAC,OAAN,CAAc,SAA9E,CAA1B;EACD;;EAED,OAAO,KAAP;AACD,CA1CM;;AAAM,OAAA,CAAA,iCAAA,GAAiC,iCAAjC","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableCellLayoutSlots, TableCellLayoutState } from './TableCellLayout.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\n\nexport const tableCellLayoutClassNames: SlotClassNames<TableCellLayoutSlots> = {\n root: 'fui-TableCellLayout',\n media: 'fui-TableCellLayout__media',\n main: 'fui-TableCellLayout__main',\n description: 'fui-TableCellLayout__description',\n wrapper: 'fui-TableCellLayout__wrapper',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n ...shorthands.gap(tokens.spacingHorizontalS),\n ...shorthands.flex(1, 1, '0px'),\n },\n wrapper: {\n display: 'flex',\n flexDirection: 'column',\n },\n\n media: {\n display: 'flex',\n alignItems: 'center',\n },\n\n mediaExtraSmall: {\n fontSize: '16px',\n },\n\n mediaSmallAndMedium: {\n fontSize: '20px',\n },\n\n mediaPrimary: {\n fontSize: '24px',\n },\n\n mainPrimary: {\n fontWeight: tokens.fontWeightSemibold,\n },\n\n description: {\n color: tokens.colorNeutralForeground2,\n ...typographyStyles.caption1,\n },\n});\n\n/**\n * Apply styling to the TableCellLayout slots based on the state\n */\nexport const useTableCellLayoutStyles_unstable = (state: TableCellLayoutState): TableCellLayoutState => {\n const styles = useStyles();\n state.root.className = mergeClasses(tableCellLayoutClassNames.root, styles.root, state.root.className);\n const primary = state.appearance === 'primary';\n\n if (state.media) {\n const mediaSizedStyles = {\n small: styles.mediaSmallAndMedium,\n medium: styles.mediaSmallAndMedium,\n 'extra-small': styles.mediaExtraSmall,\n };\n\n state.media.className = mergeClasses(\n tableCellLayoutClassNames.media,\n styles.media,\n mediaSizedStyles[state.size],\n primary && styles.mediaPrimary,\n state.media.className,\n );\n }\n\n if (state.main) {\n state.main.className = mergeClasses(\n tableCellLayoutClassNames.main,\n primary && styles.mainPrimary,\n state.main.className,\n );\n }\n\n if (state.description) {\n state.description.className = mergeClasses(\n tableCellLayoutClassNames.description,\n styles.description,\n state.description.className,\n );\n }\n\n if (state.wrapper) {\n state.wrapper.className = mergeClasses(tableCellLayoutClassNames.wrapper, styles.wrapper, state.wrapper.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -7,8 +7,6 @@ exports.useTableHeader_unstable = void 0;
7
7
 
8
8
  const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
9
 
10
- const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
-
12
10
  const tableContext_1 = /*#__PURE__*/require("../../contexts/tableContext");
13
11
  /**
14
12
  * Create the state required to render TableHeader.
@@ -25,13 +23,8 @@ const useTableHeader_unstable = (props, ref) => {
25
23
  var _a;
26
24
 
27
25
  const {
28
- noNativeElements,
29
- sortable
26
+ noNativeElements
30
27
  } = tableContext_1.useTableContext();
31
- const keyboardNavAttr = react_tabster_1.useArrowNavigationGroup({
32
- axis: 'horizontal',
33
- circular: true
34
- });
35
28
  const rootComponent = ((_a = props.as) !== null && _a !== void 0 ? _a : noNativeElements) ? 'div' : 'thead';
36
29
  return {
37
30
  components: {
@@ -40,7 +33,6 @@ const useTableHeader_unstable = (props, ref) => {
40
33
  root: react_utilities_1.getNativeElementProps(rootComponent, {
41
34
  ref,
42
35
  role: rootComponent === 'div' ? 'rowgroup' : undefined,
43
- ...(sortable && keyboardNavAttr),
44
36
  ...props
45
37
  }),
46
38
  noNativeElements
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/TableHeader/useTableHeader.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;;;EAChH,MAAM;IAAE,gBAAF;IAAoB;EAApB,IAAiC,cAAA,CAAA,eAAA,EAAvC;EACA,MAAM,eAAe,GAAG,eAAA,CAAA,uBAAA,CAAwB;IAAE,IAAI,EAAE,YAAR;IAAsB,QAAQ,EAAE;EAAhC,CAAxB,CAAxB;EAEA,MAAM,aAAa,GAAG,CAAA,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,gBAAZ,IAA+B,KAA/B,GAAuC,OAA7D;EACA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,aAAtB,EAAqC;MACzC,GADyC;MAEzC,IAAI,EAAE,aAAa,KAAK,KAAlB,GAA0B,UAA1B,GAAuC,SAFJ;MAGzC,IAAI,QAAQ,IAAI,eAAhB,CAHyC;MAIzC,GAAG;IAJsC,CAArC,CAJD;IAUL;EAVK,CAAP;AAYD,CAjBM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport type { TableHeaderProps, TableHeaderState } from './TableHeader.types';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render TableHeader.\n *\n * The returned state can be modified with hooks such as useTableHeaderStyles_unstable,\n * before being passed to renderTableHeader_unstable.\n *\n * @param props - props from this instance of TableHeader\n * @param ref - reference to root HTMLElement of TableHeader\n */\nexport const useTableHeader_unstable = (props: TableHeaderProps, ref: React.Ref<HTMLElement>): TableHeaderState => {\n const { noNativeElements, sortable } = useTableContext();\n const keyboardNavAttr = useArrowNavigationGroup({ axis: 'horizontal', circular: true });\n\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'thead';\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref,\n role: rootComponent === 'div' ? 'rowgroup' : undefined,\n ...(sortable && keyboardNavAttr),\n ...props,\n }),\n noNativeElements,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-table/src/components/TableHeader/useTableHeader.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,cAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAEA;;;;;;;;AAQG;;;AACI,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;;;EAChH,MAAM;IAAE;EAAF,IAAuB,cAAA,CAAA,eAAA,EAA7B;EAEA,MAAM,aAAa,GAAG,CAAA,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,gBAAZ,IAA+B,KAA/B,GAAuC,OAA7D;EACA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,aAAtB,EAAqC;MACzC,GADyC;MAEzC,IAAI,EAAE,aAAa,KAAK,KAAlB,GAA0B,UAA1B,GAAuC,SAFJ;MAGzC,GAAG;IAHsC,CAArC,CAJD;IASL;EATK,CAAP;AAWD,CAfM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { TableHeaderProps, TableHeaderState } from './TableHeader.types';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render TableHeader.\n *\n * The returned state can be modified with hooks such as useTableHeaderStyles_unstable,\n * before being passed to renderTableHeader_unstable.\n *\n * @param props - props from this instance of TableHeader\n * @param ref - reference to root HTMLElement of TableHeader\n */\nexport const useTableHeader_unstable = (props: TableHeaderProps, ref: React.Ref<HTMLElement>): TableHeaderState => {\n const { noNativeElements } = useTableContext();\n\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'thead';\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref,\n role: rootComponent === 'div' ? 'rowgroup' : undefined,\n ...props,\n }),\n noNativeElements,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -16,8 +16,12 @@ const tableContext_1 = /*#__PURE__*/require("../../contexts/tableContext");
16
16
  const react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
17
17
 
18
18
  const sortIcons = {
19
- ascending: /*#__PURE__*/React.createElement(react_icons_1.ArrowUpRegular, null),
20
- descending: /*#__PURE__*/React.createElement(react_icons_1.ArrowDownRegular, null)
19
+ ascending: /*#__PURE__*/React.createElement(react_icons_1.ArrowUpRegular, {
20
+ fontSize: 12
21
+ }),
22
+ descending: /*#__PURE__*/React.createElement(react_icons_1.ArrowDownRegular, {
23
+ fontSize: 12
24
+ })
21
25
  };
22
26
  /**
23
27
  * Create the state required to render TableHeaderCell.