@headless-adminapp/fluent 0.0.17-alpha.1

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 (244) hide show
  1. package/App/App.d.ts +6 -0
  2. package/App/App.js +12 -0
  3. package/App/AppHeaderContianer.d.ts +2 -0
  4. package/App/AppHeaderContianer.js +67 -0
  5. package/App/AppLogo.d.ts +8 -0
  6. package/App/AppLogo.js +17 -0
  7. package/App/AppProvider.d.ts +9 -0
  8. package/App/AppProvider.js +50 -0
  9. package/App/AppStringContext.d.ts +16 -0
  10. package/App/AppStringContext.js +23 -0
  11. package/App/AppUI.d.ts +2 -0
  12. package/App/AppUI.js +16 -0
  13. package/App/NavigationContainer.d.ts +1 -0
  14. package/App/NavigationContainer.js +63 -0
  15. package/App/QuickActionItem.d.ts +10 -0
  16. package/App/QuickActionItem.js +32 -0
  17. package/App/index.d.ts +1 -0
  18. package/App/index.js +5 -0
  19. package/App/utils.d.ts +14 -0
  20. package/App/utils.js +27 -0
  21. package/CommandBar/Button.d.ts +11 -0
  22. package/CommandBar/Button.js +36 -0
  23. package/CommandBar/Divider.d.ts +2 -0
  24. package/CommandBar/Divider.js +10 -0
  25. package/CommandBar/IconButton.d.ts +9 -0
  26. package/CommandBar/IconButton.js +32 -0
  27. package/CommandBar/Label.d.ts +7 -0
  28. package/CommandBar/Label.js +23 -0
  29. package/CommandBar/MenuButton.d.ts +13 -0
  30. package/CommandBar/MenuButton.js +43 -0
  31. package/CommandBar/MenuItem.d.ts +11 -0
  32. package/CommandBar/MenuItem.js +37 -0
  33. package/CommandBar/MenuItems.d.ts +6 -0
  34. package/CommandBar/MenuItems.js +11 -0
  35. package/CommandBar/MenuList.d.ts +6 -0
  36. package/CommandBar/MenuList.js +13 -0
  37. package/CommandBar/Wrapper.d.ts +8 -0
  38. package/CommandBar/Wrapper.js +24 -0
  39. package/CommandBar/index.d.ts +9 -0
  40. package/CommandBar/index.js +17 -0
  41. package/CommandBar/types.d.ts +0 -0
  42. package/CommandBar/types.js +1 -0
  43. package/DataForm/SectionControl.d.ts +10 -0
  44. package/DataForm/SectionControl.js +8 -0
  45. package/DataGrid/ActionCell.d.ts +8 -0
  46. package/DataGrid/ActionCell.js +11 -0
  47. package/DataGrid/CommandContainer.d.ts +2 -0
  48. package/DataGrid/CommandContainer.js +11 -0
  49. package/DataGrid/CustomizeColumns/AddColumns.d.ts +10 -0
  50. package/DataGrid/CustomizeColumns/AddColumns.js +94 -0
  51. package/DataGrid/CustomizeColumns/ColumnItem.d.ts +16 -0
  52. package/DataGrid/CustomizeColumns/ColumnItem.js +86 -0
  53. package/DataGrid/CustomizeColumns/CustomizeColumns.d.ts +6 -0
  54. package/DataGrid/CustomizeColumns/CustomizeColumns.js +80 -0
  55. package/DataGrid/CustomizeColumns/index.d.ts +1 -0
  56. package/DataGrid/CustomizeColumns/index.js +5 -0
  57. package/DataGrid/FormSubgridCommandContainer.d.ts +2 -0
  58. package/DataGrid/FormSubgridCommandContainer.js +24 -0
  59. package/DataGrid/FormSubgridViewSelector.d.ts +2 -0
  60. package/DataGrid/FormSubgridViewSelector.js +41 -0
  61. package/DataGrid/GridColumnHeader/ConditionValueControl.d.ts +9 -0
  62. package/DataGrid/GridColumnHeader/ConditionValueControl.js +89 -0
  63. package/DataGrid/GridColumnHeader/FilterForm.d.ts +11 -0
  64. package/DataGrid/GridColumnHeader/FilterForm.js +55 -0
  65. package/DataGrid/GridColumnHeader/OperatorSelect.d.ts +9 -0
  66. package/DataGrid/GridColumnHeader/OperatorSelect.js +21 -0
  67. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.d.ts +22 -0
  68. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +152 -0
  69. package/DataGrid/GridColumnHeader/index.d.ts +1 -0
  70. package/DataGrid/GridColumnHeader/index.js +5 -0
  71. package/DataGrid/GridColumnHeader/utils.d.ts +5 -0
  72. package/DataGrid/GridColumnHeader/utils.js +18 -0
  73. package/DataGrid/GridHeaderContainer.d.ts +2 -0
  74. package/DataGrid/GridHeaderContainer.js +9 -0
  75. package/DataGrid/GridHeaderDesktop.d.ts +6 -0
  76. package/DataGrid/GridHeaderDesktop.js +40 -0
  77. package/DataGrid/GridPaginationContainer.d.ts +2 -0
  78. package/DataGrid/GridPaginationContainer.js +20 -0
  79. package/DataGrid/GridTableContainer.d.ts +12 -0
  80. package/DataGrid/GridTableContainer.js +248 -0
  81. package/DataGrid/ScrollbarWithMoreDataRequest.d.ts +9 -0
  82. package/DataGrid/ScrollbarWithMoreDataRequest.js +33 -0
  83. package/DataGrid/TableCell/TableCellAction.d.ts +8 -0
  84. package/DataGrid/TableCell/TableCellAction.js +41 -0
  85. package/DataGrid/TableCell/TableCellBase.d.ts +7 -0
  86. package/DataGrid/TableCell/TableCellBase.js +9 -0
  87. package/DataGrid/TableCell/TableCellCheckbox.d.ts +6 -0
  88. package/DataGrid/TableCell/TableCellCheckbox.js +14 -0
  89. package/DataGrid/TableCell/TableCellLink.d.ts +8 -0
  90. package/DataGrid/TableCell/TableCellLink.js +33 -0
  91. package/DataGrid/TableCell/TableCellText.d.ts +7 -0
  92. package/DataGrid/TableCell/TableCellText.js +24 -0
  93. package/DataGrid/TableCell/index.d.ts +4 -0
  94. package/DataGrid/TableCell/index.js +20 -0
  95. package/DataGrid/getAttributeFormattedValue.d.ts +16 -0
  96. package/DataGrid/getAttributeFormattedValue.js +92 -0
  97. package/DataGrid/index.d.ts +4 -0
  98. package/DataGrid/index.js +11 -0
  99. package/DataGrid/useTableColumns.d.ts +10 -0
  100. package/DataGrid/useTableColumns.js +251 -0
  101. package/DataGrid/utils.d.ts +2 -0
  102. package/DataGrid/utils.js +15 -0
  103. package/DialogContainer/AlertDialog.d.ts +10 -0
  104. package/DialogContainer/AlertDialog.js +15 -0
  105. package/DialogContainer/ConfirmDialog.d.ts +12 -0
  106. package/DialogContainer/ConfirmDialog.js +18 -0
  107. package/DialogContainer/DialogContainer.d.ts +1 -0
  108. package/DialogContainer/DialogContainer.js +43 -0
  109. package/DialogContainer/ErrorDialog.d.ts +10 -0
  110. package/DialogContainer/ErrorDialog.js +22 -0
  111. package/DialogContainer/PromptDialog.d.ts +27 -0
  112. package/DialogContainer/PromptDialog.js +99 -0
  113. package/DialogContainer/index.d.ts +1 -0
  114. package/DialogContainer/index.js +5 -0
  115. package/LICENSE +21 -0
  116. package/OverflowCommandBar/OverflowCommandBar.d.ts +10 -0
  117. package/OverflowCommandBar/OverflowCommandBar.js +32 -0
  118. package/OverflowCommandBar/OverflowMenu.d.ts +4 -0
  119. package/OverflowCommandBar/OverflowMenu.js +45 -0
  120. package/OverflowCommandBar/OverflowMenuDivider.d.ts +4 -0
  121. package/OverflowCommandBar/OverflowMenuDivider.js +14 -0
  122. package/OverflowCommandBar/index.d.ts +3 -0
  123. package/OverflowCommandBar/index.js +9 -0
  124. package/OverflowCommandBar/render.d.ts +2 -0
  125. package/OverflowCommandBar/render.js +26 -0
  126. package/OverflowCommandBar/utils.d.ts +4 -0
  127. package/OverflowCommandBar/utils.js +17 -0
  128. package/PageEntityForm/CommandContainer.d.ts +2 -0
  129. package/PageEntityForm/CommandContainer.js +49 -0
  130. package/PageEntityForm/FormTabRelated.d.ts +6 -0
  131. package/PageEntityForm/FormTabRelated.js +41 -0
  132. package/PageEntityForm/PageEntityForm.d.ts +8 -0
  133. package/PageEntityForm/PageEntityForm.js +30 -0
  134. package/PageEntityForm/PageEntityFormDesktopContainer.d.ts +2 -0
  135. package/PageEntityForm/PageEntityFormDesktopContainer.js +120 -0
  136. package/PageEntityForm/PageEntityFormStringContext.d.ts +8 -0
  137. package/PageEntityForm/PageEntityFormStringContext.js +15 -0
  138. package/PageEntityForm/RecordCard.d.ts +10 -0
  139. package/PageEntityForm/RecordCard.js +134 -0
  140. package/PageEntityForm/RecordSetNavigatorContainer.d.ts +2 -0
  141. package/PageEntityForm/RecordSetNavigatorContainer.js +72 -0
  142. package/PageEntityForm/RelatedViewSelector.d.ts +15 -0
  143. package/PageEntityForm/RelatedViewSelector.js +78 -0
  144. package/PageEntityForm/SectionContainer.d.ts +6 -0
  145. package/PageEntityForm/SectionContainer.js +62 -0
  146. package/PageEntityForm/StandardControl.d.ts +24 -0
  147. package/PageEntityForm/StandardControl.js +227 -0
  148. package/PageEntityForm/SubgridControl.d.ts +13 -0
  149. package/PageEntityForm/SubgridControl.js +66 -0
  150. package/PageEntityForm/index.d.ts +1 -0
  151. package/PageEntityForm/index.js +5 -0
  152. package/PageEntityView/FormSubgridContainer.d.ts +7 -0
  153. package/PageEntityView/FormSubgridContainer.js +65 -0
  154. package/PageEntityView/PageEntityView.d.ts +8 -0
  155. package/PageEntityView/PageEntityView.js +22 -0
  156. package/PageEntityView/PageEntityViewDesktopContainer.d.ts +2 -0
  157. package/PageEntityView/PageEntityViewDesktopContainer.js +14 -0
  158. package/PageEntityView/PageEntityViewDesktopFrame.d.ts +9 -0
  159. package/PageEntityView/PageEntityViewDesktopFrame.js +48 -0
  160. package/PageEntityView/PageEntityViewStringContext.d.ts +23 -0
  161. package/PageEntityView/PageEntityViewStringContext.js +30 -0
  162. package/PageEntityView/index.d.ts +1 -0
  163. package/PageEntityView/index.js +5 -0
  164. package/ProgressIndicatorContainer/index.d.ts +1 -0
  165. package/ProgressIndicatorContainer/index.js +30 -0
  166. package/ToastNotificationContainer/index.d.ts +1 -0
  167. package/ToastNotificationContainer/index.js +44 -0
  168. package/components/BodyLoading.d.ts +6 -0
  169. package/components/BodyLoading.js +19 -0
  170. package/components/DialogLogin.d.ts +6 -0
  171. package/components/DialogLogin.js +9 -0
  172. package/components/LoginForm.d.ts +6 -0
  173. package/components/LoginForm.js +101 -0
  174. package/components/PageBroken.d.ts +8 -0
  175. package/components/PageBroken.js +15 -0
  176. package/components/PageLoading.d.ts +5 -0
  177. package/components/PageLoading.js +15 -0
  178. package/components/PageLogin.d.ts +7 -0
  179. package/components/PageLogin.js +46 -0
  180. package/form/FormControl.d.ts +6 -0
  181. package/form/FormControl.js +95 -0
  182. package/form/FormControlLoading.d.ts +2 -0
  183. package/form/FormControlLoading.js +9 -0
  184. package/form/controls/CurrencyControl.d.ts +4 -0
  185. package/form/controls/CurrencyControl.js +16 -0
  186. package/form/controls/DateControl.d.ts +6 -0
  187. package/form/controls/DateControl.js +21 -0
  188. package/form/controls/DateRangeControl.d.ts +6 -0
  189. package/form/controls/DateRangeControl.js +49 -0
  190. package/form/controls/DateTimeControl.d.ts +6 -0
  191. package/form/controls/DateTimeControl.js +23 -0
  192. package/form/controls/EmailControl.d.ts +6 -0
  193. package/form/controls/EmailControl.js +22 -0
  194. package/form/controls/LookupControl.d.ts +26 -0
  195. package/form/controls/LookupControl.js +134 -0
  196. package/form/controls/MultiSelectControl.d.ts +6 -0
  197. package/form/controls/MultiSelectControl.js +17 -0
  198. package/form/controls/MultiSelectLookupControl.d.ts +26 -0
  199. package/form/controls/MultiSelectLookupControl.js +187 -0
  200. package/form/controls/NumberControl.d.ts +4 -0
  201. package/form/controls/NumberControl.js +15 -0
  202. package/form/controls/PasswordControl.d.ts +6 -0
  203. package/form/controls/PasswordControl.js +13 -0
  204. package/form/controls/SelectControl.d.ts +9 -0
  205. package/form/controls/SelectControl.js +29 -0
  206. package/form/controls/SwitchControl.d.ts +4 -0
  207. package/form/controls/SwitchControl.js +6 -0
  208. package/form/controls/TelephoneControl.d.ts +5 -0
  209. package/form/controls/TelephoneControl.js +16 -0
  210. package/form/controls/TextAreaControl.d.ts +6 -0
  211. package/form/controls/TextAreaControl.js +16 -0
  212. package/form/controls/TextControl.d.ts +10 -0
  213. package/form/controls/TextControl.js +24 -0
  214. package/form/controls/types.d.ts +14 -0
  215. package/form/controls/types.js +2 -0
  216. package/form/controls/useLookupData.d.ts +19 -0
  217. package/form/controls/useLookupData.js +104 -0
  218. package/form/layout/FormBody/FormBody.d.ts +2 -0
  219. package/form/layout/FormBody/FormBody.js +11 -0
  220. package/form/layout/FormBody/index.d.ts +1 -0
  221. package/form/layout/FormBody/index.js +17 -0
  222. package/form/layout/FormSection/FormSection.d.ts +16 -0
  223. package/form/layout/FormSection/FormSection.js +83 -0
  224. package/form/layout/FormSection/FormSectionColumn.d.ts +6 -0
  225. package/form/layout/FormSection/FormSectionColumn.js +15 -0
  226. package/form/layout/FormSection/FormSectionLoading.d.ts +6 -0
  227. package/form/layout/FormSection/FormSectionLoading.js +7 -0
  228. package/form/layout/FormSection/index.d.ts +1 -0
  229. package/form/layout/FormSection/index.js +5 -0
  230. package/form/layout/FormTab/FormTab.d.ts +13 -0
  231. package/form/layout/FormTab/FormTab.js +82 -0
  232. package/form/layout/FormTab/FormTabColumn.d.ts +6 -0
  233. package/form/layout/FormTab/FormTabColumn.js +15 -0
  234. package/form/layout/FormTab/index.d.ts +1 -0
  235. package/form/layout/FormTab/index.js +5 -0
  236. package/form/layout/TabContext.d.ts +6 -0
  237. package/form/layout/TabContext.js +5 -0
  238. package/form/layout/index.d.ts +3 -0
  239. package/form/layout/index.js +11 -0
  240. package/form/types.d.ts +74 -0
  241. package/form/types.js +5 -0
  242. package/package.json +30 -0
  243. package/types/index.d.ts +32 -0
  244. package/types/index.js +2 -0
@@ -0,0 +1,248 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GridTableContainer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const datagrid_1 = require("@headless-adminapp/app/datagrid");
7
+ const hooks_1 = require("@headless-adminapp/app/datagrid/hooks");
8
+ const locale_1 = require("@headless-adminapp/app/locale");
9
+ const mutable_1 = require("@headless-adminapp/app/mutable");
10
+ const hooks_2 = require("@headless-adminapp/app/recordset/hooks");
11
+ const hooks_3 = require("@headless-adminapp/app/route/hooks");
12
+ const app_1 = require("@headless-adminapp/core/experience/app");
13
+ const react_table_1 = require("@tanstack/react-table");
14
+ const react_virtual_1 = require("@tanstack/react-virtual");
15
+ const react_1 = require("react");
16
+ const ScrollbarWithMoreDataRequest_1 = require("./ScrollbarWithMoreDataRequest");
17
+ const useTableColumns_1 = require("./useTableColumns");
18
+ const utils_1 = require("./utils");
19
+ const useStyles = (0, react_components_1.makeStyles)({
20
+ root: {
21
+ '&:hover': {
22
+ // background: tokens.colorNeutralForeground1Hover,
23
+ '& .fui-TableSelectionCell': {
24
+ background: 'inherit',
25
+ },
26
+ '& .tableCellAction': {
27
+ background: 'inherit !important',
28
+ },
29
+ },
30
+ '& .tableCellAction': {
31
+ background: react_components_1.tokens.colorNeutralBackground1,
32
+ },
33
+ borderBottom: `${react_components_1.tokens.strokeWidthThin} solid ${react_components_1.tokens.colorNeutralStroke3}`,
34
+ '& .fui-TableCell': {
35
+ // borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke3}`,
36
+ // borderBottom: 'none !important',
37
+ },
38
+ },
39
+ selectionCell: {
40
+ position: 'sticky',
41
+ left: 0,
42
+ background: react_components_1.tokens.colorNeutralBackground1,
43
+ zIndex: 1,
44
+ display: 'flex',
45
+ alignItems: 'center',
46
+ },
47
+ table: {
48
+ color: 'yellow',
49
+ '&:after': {
50
+ content: ' ',
51
+ display: 'block',
52
+ height: '32px',
53
+ },
54
+ },
55
+ });
56
+ const fallbackData = [];
57
+ const GridTableContainer = ({ noPadding, disableColumnFilter, disableColumnSort, disableColumnResize, disableContextMenu, disableSelection, }) => {
58
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
59
+ const styles = useStyles();
60
+ const data = (0, hooks_1.useGridData)();
61
+ const dataState = (0, hooks_1.useGridDataState)();
62
+ const fetchNextPage = (0, mutable_1.useContextSelector)(datagrid_1.GridContext, (state) => state.fetchNextPage);
63
+ const columns = (0, hooks_1.useGridColumns)();
64
+ const [sorting] = (0, hooks_1.useGridSorting)();
65
+ const schema = (0, hooks_1.useDataGridSchema)();
66
+ const [selectedIds, setSelectedIds] = (0, hooks_1.useGridSelection)();
67
+ const setSelectedIdsRef = (0, react_1.useRef)(setSelectedIds);
68
+ setSelectedIdsRef.current = setSelectedIds;
69
+ const sortingState = (0, react_1.useMemo)(() => {
70
+ return sorting.map((sort) => ({
71
+ id: sort.field,
72
+ desc: sort.order === 'desc',
73
+ }));
74
+ }, [sorting]);
75
+ const tableWrapperRef = (0, react_1.useRef)(null);
76
+ const routeResolver = (0, hooks_3.useRouteResolver)();
77
+ const router = (0, hooks_3.useRouter)();
78
+ const recordSetSetter = (0, hooks_2.useRecordSetSetter)();
79
+ const openRecord = (0, react_1.useCallback)((id) => {
80
+ var _a, _b;
81
+ const path = routeResolver({
82
+ logicalName: schema.logicalName,
83
+ type: app_1.PageType.EntityForm,
84
+ id,
85
+ });
86
+ recordSetSetter(schema.logicalName, (_b = (_a = dataRef.current) === null || _a === void 0 ? void 0 : _a.records.map((x) => x[schema.idAttribute])) !== null && _b !== void 0 ? _b : []);
87
+ router.push(path);
88
+ }, [
89
+ recordSetSetter,
90
+ routeResolver,
91
+ router,
92
+ schema.idAttribute,
93
+ schema.logicalName,
94
+ ]);
95
+ const { direction } = (0, locale_1.useLocale)();
96
+ const dataRef = (0, react_1.useRef)(data);
97
+ dataRef.current = data;
98
+ const tableColumns = (0, useTableColumns_1.useTableColumns)({
99
+ disableColumnFilter,
100
+ disableColumnResize,
101
+ disableColumnSort,
102
+ disableContextMenu,
103
+ disableSelection,
104
+ tableWrapperRef,
105
+ });
106
+ const rowSelection = (0, react_1.useMemo)(() => {
107
+ return selectedIds.reduce((acc, id) => {
108
+ acc[id] = true;
109
+ return acc;
110
+ }, {});
111
+ }, [selectedIds]);
112
+ const table = (0, react_table_1.useReactTable)({
113
+ data: (_a = data === null || data === void 0 ? void 0 : data.records) !== null && _a !== void 0 ? _a : fallbackData,
114
+ columns: tableColumns,
115
+ getRowId: (row) => row[schema.idAttribute],
116
+ enableRowSelection: true,
117
+ getCoreRowModel: (0, react_table_1.getCoreRowModel)(),
118
+ columnResizeMode: 'onChange',
119
+ columnResizeDirection: 'ltr',
120
+ onRowSelectionChange: () => {
121
+ // do nothing
122
+ },
123
+ state: {
124
+ rowSelection,
125
+ sorting: sortingState,
126
+ },
127
+ });
128
+ const tableRef = (0, react_1.useRef)(table);
129
+ tableRef.current = table;
130
+ (0, react_1.useEffect)(() => {
131
+ tableRef.current.resetColumnSizing();
132
+ }, [columns]);
133
+ const rows = table.getRowModel().rows;
134
+ const virtualizer = (0, react_virtual_1.useVirtualizer)({
135
+ count: rows.length,
136
+ getScrollElement: () => { var _a, _b; return (_b = (_a = tableWrapperRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement; },
137
+ estimateSize: () => 44,
138
+ overscan: 30,
139
+ paddingStart: 33,
140
+ });
141
+ const tableElementRef = (0, react_1.useRef)(null);
142
+ const virtualItems = virtualizer.getVirtualItems();
143
+ const virtualSize = virtualizer.getTotalSize();
144
+ const [isScrollNearBottom, setIsScrollNearBottom] = (0, react_1.useState)(false);
145
+ // callback to adjust the height of the pseudo element
146
+ const handlePseudoResize = (0, react_1.useCallback)(() => {
147
+ return (0, utils_1.adjustTableHeight)(tableElementRef, virtualSize);
148
+ }, [virtualSize]);
149
+ // callback to handle scrolling, checking if we are near the bottom
150
+ const handleScroll = (0, react_1.useCallback)(() => {
151
+ var _a, _b, _c, _d, _e, _f, _g, _h;
152
+ if ((_b = (_a = tableWrapperRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) {
153
+ const scrollPosition = (_e = (_d = (_c = tableWrapperRef.current) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.parentElement) === null || _e === void 0 ? void 0 : _e.scrollTop;
154
+ const visibleHeight = (_h = (_g = (_f = tableWrapperRef.current) === null || _f === void 0 ? void 0 : _f.parentElement) === null || _g === void 0 ? void 0 : _g.parentElement) === null || _h === void 0 ? void 0 : _h.clientHeight;
155
+ setIsScrollNearBottom(scrollPosition > virtualSize * 0.95 - visibleHeight);
156
+ }
157
+ }, [virtualSize]);
158
+ // add an event listener on the scrollable parent container and resize the
159
+ // pseudo element whenever the table renders with new data
160
+ (0, react_1.useEffect)(() => {
161
+ var _a, _b;
162
+ const scrollable = (_b = (_a = tableWrapperRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement;
163
+ if (scrollable)
164
+ scrollable.addEventListener('scroll', handleScroll);
165
+ handlePseudoResize();
166
+ return () => {
167
+ if (scrollable)
168
+ scrollable.removeEventListener('scroll', handleScroll);
169
+ };
170
+ }, [data, handleScroll, handlePseudoResize]);
171
+ // if we are near the bottom of the table, resize the pseudo element each time
172
+ // the length of virtual items changes (which is effectively the number of table
173
+ // rows rendered to the DOM). This ensures we don't scroll too far or too short.
174
+ (0, react_1.useEffect)(() => {
175
+ if (isScrollNearBottom)
176
+ handlePseudoResize();
177
+ }, [isScrollNearBottom, virtualItems.length, handlePseudoResize]);
178
+ const isScrolledToRight = ((_d = (_c = (_b = tableWrapperRef.current) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.scrollLeft) ===
179
+ ((_h = (_g = (_f = (_e = tableWrapperRef.current) === null || _e === void 0 ? void 0 : _e.parentElement) === null || _f === void 0 ? void 0 : _f.parentElement) === null || _g === void 0 ? void 0 : _g.scrollWidth) !== null && _h !== void 0 ? _h : 0) -
180
+ ((_m = (_l = (_k = (_j = tableWrapperRef.current) === null || _j === void 0 ? void 0 : _j.parentElement) === null || _k === void 0 ? void 0 : _k.parentElement) === null || _l === void 0 ? void 0 : _l.clientWidth) !== null && _m !== void 0 ? _m : 0);
181
+ return ((0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, flexDirection: 'column' }, children: (0, jsx_runtime_1.jsx)(ScrollbarWithMoreDataRequest_1.ScrollbarWithMoreDataRequest, { data: data === null || data === void 0 ? void 0 : data.records, hasMore: dataState === null || dataState === void 0 ? void 0 : dataState.hasNextPage, rtl: direction === 'rtl', onRequestMore: () => {
182
+ fetchNextPage();
183
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: {
184
+ paddingInline: noPadding ? 0 : 8,
185
+ position: 'relative',
186
+ }, ref: tableWrapperRef, children: (0, jsx_runtime_1.jsxs)(react_components_1.Table, { style: {
187
+ display: 'flex',
188
+ flexDirection: 'column',
189
+ borderCollapse: 'collapse',
190
+ width: '100%',
191
+ height: virtualizer.getTotalSize() + 33,
192
+ ['--action-shadow']: !isScrolledToRight
193
+ ? '-2px 0px 6px rgba(0, 0, 0, 0.12)'
194
+ : 'none',
195
+ }, ref: tableElementRef, className: "table-pseduo", children: [(0, jsx_runtime_1.jsx)(react_components_1.TableHeader, { style: {
196
+ display: 'flex',
197
+ position: 'sticky',
198
+ top: 0,
199
+ background: react_components_1.tokens.colorNeutralBackground3,
200
+ zIndex: 2,
201
+ }, children: table.getHeaderGroups().map((headerGroup) => ((0, jsx_runtime_1.jsx)(react_components_1.TableRow, { style: {
202
+ position: 'sticky',
203
+ top: 0,
204
+ display: 'flex',
205
+ minWidth: 'calc(100% - 16px)',
206
+ }, children: headerGroup.headers.map((header) => header.isPlaceholder
207
+ ? null
208
+ : (0, react_table_1.flexRender)(header.column.columnDef.header, Object.assign(Object.assign({}, header.getContext()), { key: header.id }))) }, headerGroup.id))) }), (0, jsx_runtime_1.jsx)(react_components_1.TableBody, { style: {
209
+ display: 'flex',
210
+ flexDirection: 'column',
211
+ transform: 'translateY(-33px)',
212
+ }, children: virtualItems.map((virtualRow) => {
213
+ const row = rows[virtualRow.index];
214
+ return ((0, jsx_runtime_1.jsx)(react_components_1.TableRow, { className: (0, react_components_1.mergeClasses)(styles.root), style: {
215
+ display: 'flex',
216
+ height: `${virtualRow.size}px`,
217
+ minWidth: 'calc(100% - 16px)',
218
+ position: 'absolute',
219
+ transform: `translateY(${virtualRow.start}px)`,
220
+ }, onClick: () => {
221
+ setSelectedIdsRef.current(() => {
222
+ const id = row.original[schema.idAttribute];
223
+ return [id];
224
+ });
225
+ }, onDoubleClick: () => {
226
+ const id = row.original[schema.idAttribute];
227
+ openRecord(id);
228
+ }, children: row.getVisibleCells().map((cell) => (0, react_table_1.flexRender)(cell.column.columnDef.cell, Object.assign(Object.assign({}, cell.getContext()), { key: cell.column.id }))) }, row.id));
229
+ }) }), dataState.isFetching && ((0, jsx_runtime_1.jsx)(react_components_1.TableBody, { style: {
230
+ display: 'flex',
231
+ flexDirection: 'column',
232
+ position: 'absolute',
233
+ transform: `translateY(${virtualSize}px)`,
234
+ }, children: Array.from({ length: 10 }).map((_, index) => ((0, jsx_runtime_1.jsx)(react_components_1.TableRow, { style: {
235
+ display: 'flex',
236
+ height: 44,
237
+ alignItems: 'center',
238
+ }, children: table.getAllColumns().map((column, index) => {
239
+ if (!column.getIsVisible())
240
+ return null;
241
+ return ((0, jsx_runtime_1.jsx)(react_components_1.TableCell, { style: {
242
+ display: 'flex',
243
+ alignItems: 'center',
244
+ width: column.getSize(),
245
+ }, children: (0, jsx_runtime_1.jsx)(react_components_1.SkeletonItem, { size: 16 }) }, index));
246
+ }) }, index))) }))] }) }) }) }));
247
+ };
248
+ exports.GridTableContainer = GridTableContainer;
@@ -0,0 +1,9 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ interface ScrollbarWithMoreDataRequest {
3
+ data: any;
4
+ hasMore: boolean;
5
+ onRequestMore: () => void;
6
+ rtl?: boolean;
7
+ }
8
+ export declare const ScrollbarWithMoreDataRequest: FC<PropsWithChildren<ScrollbarWithMoreDataRequest>>;
9
+ export {};
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScrollbarWithMoreDataRequest = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ScrollView_1 = require("@headless-adminapp/app/components/ScrollView");
6
+ const react_1 = require("react");
7
+ function getReaminingSpace(div) {
8
+ return div.scrollHeight - div.scrollTop - div.clientHeight;
9
+ }
10
+ const ScrollbarWithMoreDataRequest = ({ data, onRequestMore, hasMore, children, rtl }) => {
11
+ const divRef = (0, react_1.useRef)(null);
12
+ const onRequestMoreRef = (0, react_1.useRef)(onRequestMore);
13
+ onRequestMoreRef.current = onRequestMore;
14
+ (0, react_1.useEffect)(() => {
15
+ var _a;
16
+ const div = (_a = divRef.current) === null || _a === void 0 ? void 0 : _a.parentElement;
17
+ if (!div) {
18
+ return;
19
+ }
20
+ const remainingSpace = getReaminingSpace(div);
21
+ if (remainingSpace <= 0 && hasMore) {
22
+ onRequestMoreRef.current();
23
+ }
24
+ }, [data, hasMore]);
25
+ return ((0, jsx_runtime_1.jsx)(ScrollView_1.ScrollView, { autoHide: true, rtl: rtl, onScroll: (e) => {
26
+ const div = e.target;
27
+ const remainingSpace = getReaminingSpace(div);
28
+ if (remainingSpace <= 0 && hasMore) {
29
+ onRequestMoreRef.current();
30
+ }
31
+ }, children: (0, jsx_runtime_1.jsx)("div", { ref: divRef, children: children }) }));
32
+ };
33
+ exports.ScrollbarWithMoreDataRequest = ScrollbarWithMoreDataRequest;
@@ -0,0 +1,8 @@
1
+ import { ArrayGroupWithAtLeastOne } from '@headless-adminapp/core/types';
2
+ import { FC } from 'react';
3
+ import { MenuItemProps } from '../../CommandBar/MenuItem';
4
+ export interface TableCellActionProps {
5
+ items: ArrayGroupWithAtLeastOne<MenuItemProps>;
6
+ onOpen?: () => void;
7
+ }
8
+ export declare const TableCellAction: FC<TableCellActionProps>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableCellAction = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const icons_1 = require("@headless-adminapp/icons");
7
+ const MenuList_1 = require("../../CommandBar/MenuList");
8
+ const useStyles = (0, react_components_1.makeStyles)({
9
+ button: {
10
+ '&:hover': {
11
+ background: react_components_1.tokens.colorNeutralBackground5,
12
+ },
13
+ },
14
+ });
15
+ const TableCellAction = ({ items, onOpen, }) => {
16
+ const styles = useStyles();
17
+ return ((0, jsx_runtime_1.jsx)(react_components_1.TableCell, { className: "tableCellAction", style: {
18
+ display: 'flex',
19
+ padding: 0,
20
+ // width: 32,
21
+ minWidth: 32,
22
+ // maxWidth: 32,
23
+ flex: 1,
24
+ flexShrink: 0,
25
+ position: 'sticky',
26
+ right: 0,
27
+ // top: 0,
28
+ zIndex: 1,
29
+ justifyContent: 'right',
30
+ // background: 'white',
31
+ // boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)',
32
+ borderBottom: `${react_components_1.tokens.strokeWidthThin} solid ${react_components_1.tokens.colorNeutralStroke3}`,
33
+ }, children: (0, jsx_runtime_1.jsxs)(react_components_1.Menu, { positioning: "before-top", children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "transparent", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.MoreVertical, {}), onClick: onOpen, className: styles.button, style: {
34
+ // background: 'white',
35
+ // boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)',
36
+ boxShadow: 'var(--action-shadow)',
37
+ borderRadius: 0,
38
+ // background: tokens.colorNeutralBackground1,
39
+ } }) }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(MenuList_1.MenuList, { items: items }) })] }) }));
40
+ };
41
+ exports.TableCellAction = TableCellAction;
@@ -0,0 +1,7 @@
1
+ import { CSSProperties, FC, MouseEventHandler, ReactNode } from 'react';
2
+ export interface TableCellBaseProps {
3
+ children?: ReactNode;
4
+ onClick?: MouseEventHandler | undefined;
5
+ style?: CSSProperties | undefined;
6
+ }
7
+ export declare const TableCellBase: FC<TableCellBaseProps>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableCellBase = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const TableCellBase = ({ children, onClick, style, }) => {
7
+ return ((0, jsx_runtime_1.jsx)(react_components_1.TableCell, { onClick: onClick, style: Object.assign({ display: 'flex', alignItems: 'center' }, style), children: children }));
8
+ };
9
+ exports.TableCellBase = TableCellBase;
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ export interface TableCellCheckboxProps {
3
+ checked?: boolean;
4
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
5
+ }
6
+ export declare const TableCellCheckbox: FC<TableCellCheckboxProps>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableCellCheckbox = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const TableCellCheckbox = ({ checked, onChange, }) => {
7
+ return ((0, jsx_runtime_1.jsx)(react_components_1.TableCell, { style: { display: 'flex', alignItems: 'center' }, onClick: (event) => {
8
+ event.stopPropagation();
9
+ }, children: (0, jsx_runtime_1.jsx)(react_components_1.Checkbox, { checked: checked !== null && checked !== void 0 ? checked : false, onChange: (event) => {
10
+ event.stopPropagation();
11
+ onChange === null || onChange === void 0 ? void 0 : onChange(event);
12
+ } }) }));
13
+ };
14
+ exports.TableCellCheckbox = TableCellCheckbox;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ export interface TableCellLinkProps {
3
+ value: string | undefined | null;
4
+ href?: string;
5
+ onClick?: () => void;
6
+ width: number;
7
+ }
8
+ export declare const TableCellLink: FC<TableCellLinkProps>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableCellLink = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const hooks_1 = require("@headless-adminapp/app/route/hooks");
7
+ const TableCellLink = ({ value, href, onClick, width, }) => {
8
+ const router = (0, hooks_1.useRouter)();
9
+ return ((0, jsx_runtime_1.jsx)(react_components_1.TableCell, { style: {
10
+ textOverflow: 'ellipsis',
11
+ overflow: 'hidden',
12
+ whiteSpace: 'nowrap',
13
+ width,
14
+ minWidth: width,
15
+ maxWidth: width,
16
+ display: 'flex',
17
+ alignItems: 'center',
18
+ }, children: (0, jsx_runtime_1.jsx)(react_components_1.Link, { as: "a", href: href, onClick: (event) => {
19
+ if (event.metaKey || event.ctrlKey) {
20
+ return;
21
+ }
22
+ if (onClick) {
23
+ event.preventDefault();
24
+ onClick();
25
+ return;
26
+ }
27
+ if (href === null || href === void 0 ? void 0 : href.startsWith('/')) {
28
+ router.push(href);
29
+ event.preventDefault();
30
+ }
31
+ }, children: value }) }));
32
+ };
33
+ exports.TableCellLink = TableCellLink;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ export interface TableCellTextProps {
3
+ value: string;
4
+ width: number;
5
+ textAlignment?: 'left' | 'center' | 'right';
6
+ }
7
+ export declare const TableCellText: FC<TableCellTextProps>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableCellText = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const TableCellBase_1 = require("./TableCellBase");
6
+ const TableCellText = ({ value, width, textAlignment, }) => {
7
+ return ((0, jsx_runtime_1.jsx)(TableCellBase_1.TableCellBase, { style: {
8
+ textAlign: textAlignment || 'left',
9
+ textOverflow: 'ellipsis',
10
+ overflow: 'hidden',
11
+ whiteSpace: 'nowrap',
12
+ // maxWidth: 50,
13
+ // width: 50,
14
+ // width: '100%',
15
+ width,
16
+ minWidth: width,
17
+ maxWidth: width,
18
+ // minWidth: 200,
19
+ // display: 'flex',
20
+ // alignItems: 'center',
21
+ // borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke3}`,
22
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: { overflow: 'hidden', textOverflow: 'ellipsis', width: '100%' }, children: value }) }));
23
+ };
24
+ exports.TableCellText = TableCellText;
@@ -0,0 +1,4 @@
1
+ export * from './TableCellBase';
2
+ export * from './TableCellText';
3
+ export * from './TableCellAction';
4
+ export * from './TableCellCheckbox';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./TableCellBase"), exports);
18
+ __exportStar(require("./TableCellText"), exports);
19
+ __exportStar(require("./TableCellAction"), exports);
20
+ __exportStar(require("./TableCellCheckbox"), exports);
@@ -0,0 +1,16 @@
1
+ import { Attribute, InferredAttributeType } from '@headless-adminapp/core/attributes';
2
+ interface AttributeFormattedValueStringsSet {
3
+ yes: string;
4
+ no: string;
5
+ }
6
+ /*** @todo move to app */
7
+ export declare function getAttributeFormattedValue<A extends Attribute = Attribute>(attribute: Attribute, value: InferredAttributeType<A> | null | undefined, options?: {
8
+ maxCount?: number;
9
+ strings?: AttributeFormattedValueStringsSet;
10
+ dateFormat?: string;
11
+ locale?: string;
12
+ currency?: string;
13
+ currencySign?: 'accounting' | 'standard';
14
+ currencyDisplay?: 'symbol' | 'narrowSymbol' | 'code';
15
+ }): string | null | undefined;
16
+ export {};
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getAttributeFormattedValue = getAttributeFormattedValue;
7
+ const dayjs_1 = __importDefault(require("dayjs"));
8
+ const defaultAttributeFormattedValueStrings = {
9
+ yes: 'Yes',
10
+ no: 'No',
11
+ };
12
+ const defaultDateFormat = 'YYYY-MM-DD';
13
+ const defaultLocale = 'en-US';
14
+ const defaultCurrency = 'USD';
15
+ const defaultCurrencySign = 'accounting';
16
+ const defaultCurrencyDisplay = 'symbol';
17
+ /*** @todo move to app */
18
+ function getAttributeFormattedValue(attribute, value, options) {
19
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
20
+ if (value === null || value === undefined) {
21
+ return null;
22
+ }
23
+ const strings = (_a = options === null || options === void 0 ? void 0 : options.strings) !== null && _a !== void 0 ? _a : defaultAttributeFormattedValueStrings;
24
+ const dateFormat = (_b = options === null || options === void 0 ? void 0 : options.dateFormat) !== null && _b !== void 0 ? _b : defaultDateFormat;
25
+ const locale = (_c = options === null || options === void 0 ? void 0 : options.locale) !== null && _c !== void 0 ? _c : defaultLocale;
26
+ const currency = (_d = options === null || options === void 0 ? void 0 : options.currency) !== null && _d !== void 0 ? _d : defaultCurrency;
27
+ const currencySign = (_e = options === null || options === void 0 ? void 0 : options.currencySign) !== null && _e !== void 0 ? _e : defaultCurrencySign;
28
+ const currencyDisplay = (_f = options === null || options === void 0 ? void 0 : options.currencyDisplay) !== null && _f !== void 0 ? _f : defaultCurrencyDisplay;
29
+ switch (attribute.type) {
30
+ case 'boolean':
31
+ return value
32
+ ? (_g = attribute.trueLabel) !== null && _g !== void 0 ? _g : strings.yes
33
+ : (_h = attribute.falseLabel) !== null && _h !== void 0 ? _h : strings.no;
34
+ case 'choice':
35
+ return ((_j = attribute.options.find((option) => option.value === value)) !== null && _j !== void 0 ? _j : {
36
+ label: '',
37
+ }).label;
38
+ case 'choices':
39
+ return value
40
+ .map((v) => {
41
+ var _a;
42
+ return ((_a = attribute.options.find((option) => option.value === v)) !== null && _a !== void 0 ? _a : {
43
+ label: '',
44
+ }).label;
45
+ })
46
+ .join(', ');
47
+ case 'date':
48
+ return (0, dayjs_1.default)(value).format(dateFormat);
49
+ case 'daterange':
50
+ if (!value)
51
+ return null;
52
+ const from = value[0];
53
+ const to = value[1];
54
+ if (!from && !to) {
55
+ return null;
56
+ }
57
+ if (from && to) {
58
+ return ((0, dayjs_1.default)(from).format(dateFormat) + ' - ' + (0, dayjs_1.default)(to).format(dateFormat));
59
+ }
60
+ if (from) {
61
+ return 'After ' + (0, dayjs_1.default)(from).format(dateFormat);
62
+ }
63
+ if (to) {
64
+ return 'Before ' + (0, dayjs_1.default)(to).format(dateFormat);
65
+ }
66
+ return null;
67
+ case 'lookup':
68
+ return value === null || value === void 0 ? void 0 : value.name;
69
+ case 'lookups':
70
+ const items = value === null || value === void 0 ? void 0 : value.map((v) => v.name);
71
+ if ((options === null || options === void 0 ? void 0 : options.maxCount) && (items === null || items === void 0 ? void 0 : items.length) > options.maxCount) {
72
+ return (items.slice(0, options.maxCount).join(', ') +
73
+ ` (+${items.length - options.maxCount})`);
74
+ }
75
+ else {
76
+ return items === null || items === void 0 ? void 0 : items.join(', ');
77
+ }
78
+ case 'money':
79
+ return new Intl.NumberFormat(locale, {
80
+ style: 'currency',
81
+ currency,
82
+ currencySign,
83
+ currencyDisplay,
84
+ }).format(value);
85
+ case 'number':
86
+ return new Intl.NumberFormat(locale).format(value);
87
+ default:
88
+ return typeof value === 'object'
89
+ ? JSON.stringify(value)
90
+ : value;
91
+ }
92
+ }
@@ -0,0 +1,4 @@
1
+ export { CommandContainer } from './CommandContainer';
2
+ export { GridHeaderContainer } from './GridHeaderContainer';
3
+ export { GridPaginationContainer } from './GridPaginationContainer';
4
+ export { GridTableContainer } from './GridTableContainer';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GridTableContainer = exports.GridPaginationContainer = exports.GridHeaderContainer = exports.CommandContainer = void 0;
4
+ var CommandContainer_1 = require("./CommandContainer");
5
+ Object.defineProperty(exports, "CommandContainer", { enumerable: true, get: function () { return CommandContainer_1.CommandContainer; } });
6
+ var GridHeaderContainer_1 = require("./GridHeaderContainer");
7
+ Object.defineProperty(exports, "GridHeaderContainer", { enumerable: true, get: function () { return GridHeaderContainer_1.GridHeaderContainer; } });
8
+ var GridPaginationContainer_1 = require("./GridPaginationContainer");
9
+ Object.defineProperty(exports, "GridPaginationContainer", { enumerable: true, get: function () { return GridPaginationContainer_1.GridPaginationContainer; } });
10
+ var GridTableContainer_1 = require("./GridTableContainer");
11
+ Object.defineProperty(exports, "GridTableContainer", { enumerable: true, get: function () { return GridTableContainer_1.GridTableContainer; } });
@@ -0,0 +1,10 @@
1
+ import { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
2
+ import { Data } from '@headless-adminapp/core/transport';
3
+ export declare function useTableColumns({ disableSelection, disableContextMenu, disableColumnResize, disableColumnFilter, disableColumnSort, tableWrapperRef, }: {
4
+ disableSelection?: boolean;
5
+ disableContextMenu?: boolean;
6
+ disableColumnResize?: boolean;
7
+ disableColumnFilter?: boolean;
8
+ disableColumnSort?: boolean;
9
+ tableWrapperRef: React.RefObject<HTMLDivElement>;
10
+ }): import("@tanstack/react-table").AccessorFnColumnDef<Data<InferredSchemaType<SchemaAttributes>>, unknown>[];