@headless-adminapp/fluent 0.0.17-alpha.53 → 0.0.17-alpha.55

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 (179) hide show
  1. package/App/App.js +11 -7
  2. package/App/AppHeaderContianer.js +50 -44
  3. package/App/AppLogo.js +12 -9
  4. package/App/AppStringContext.js +13 -9
  5. package/App/AppUI.js +15 -11
  6. package/App/LayoutProvider.js +16 -24
  7. package/App/NavigationContainer.js +28 -28
  8. package/App/QuickActionItem.js +10 -6
  9. package/App/index.js +5 -1
  10. package/App/utils.d.ts +1 -1
  11. package/App/utils.js +7 -5
  12. package/CommandBar/Button.js +17 -14
  13. package/CommandBar/Divider.js +9 -6
  14. package/CommandBar/IconButton.js +16 -13
  15. package/CommandBar/Label.js +11 -8
  16. package/CommandBar/MenuButton.js +20 -17
  17. package/CommandBar/MenuItem.js +19 -16
  18. package/CommandBar/MenuItems.js +10 -10
  19. package/CommandBar/MenuList.js +12 -9
  20. package/CommandBar/Wrapper.js +10 -7
  21. package/CommandBar/index.js +15 -13
  22. package/DataForm/SectionControl.js +7 -4
  23. package/DataGrid/ActionCell.js +14 -11
  24. package/DataGrid/CommandContainer.js +10 -6
  25. package/DataGrid/CustomizeColumns/AddColumns.js +61 -59
  26. package/DataGrid/CustomizeColumns/ColumnItem.js +23 -19
  27. package/DataGrid/CustomizeColumns/CustomizeColumns.js +41 -36
  28. package/DataGrid/CustomizeColumns/index.js +5 -1
  29. package/DataGrid/FormSubgridCommandContainer.js +17 -13
  30. package/DataGrid/FormSubgridViewSelector.js +21 -21
  31. package/DataGrid/GridColumnHeader/ConditionValueControl.js +33 -33
  32. package/DataGrid/GridColumnHeader/FilterForm.js +28 -27
  33. package/DataGrid/GridColumnHeader/OperatorSelect.js +19 -13
  34. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +35 -31
  35. package/DataGrid/GridColumnHeader/index.js +5 -1
  36. package/DataGrid/GridColumnHeader/utils.js +6 -2
  37. package/DataGrid/GridHeaderContainer.js +8 -4
  38. package/DataGrid/GridHeaderDesktop.js +28 -28
  39. package/DataGrid/GridHeaderMobile.js +20 -19
  40. package/DataGrid/GridListContainer.js +50 -44
  41. package/DataGrid/GridPaginationContainer.js +16 -13
  42. package/DataGrid/GridTableContainer.js +98 -89
  43. package/DataGrid/TableCell/TableCellAction.js +15 -11
  44. package/DataGrid/TableCell/TableCellBase.js +13 -4
  45. package/DataGrid/TableCell/TableCellCheckbox.js +11 -8
  46. package/DataGrid/TableCell/TableCellChoice.js +15 -13
  47. package/DataGrid/TableCell/TableCellLink.js +14 -11
  48. package/DataGrid/TableCell/TableCellText.js +10 -7
  49. package/DataGrid/TableCell/index.js +20 -4
  50. package/DataGrid/index.js +11 -4
  51. package/DataGrid/types.js +2 -1
  52. package/DataGrid/useTableColumns.js +98 -103
  53. package/DataGrid/utils.js +5 -1
  54. package/DialogContainer/AlertDialog.js +11 -11
  55. package/DialogContainer/ConfirmDialog.js +13 -14
  56. package/DialogContainer/DialogContainer.js +19 -26
  57. package/DialogContainer/ErrorDialog.js +15 -15
  58. package/DialogContainer/PromptDialog.js +76 -58
  59. package/DialogContainer/index.js +5 -1
  60. package/Insights/CommandBarContainer.js +17 -11
  61. package/Insights/FilterBarContainer.js +32 -37
  62. package/Insights/Grid.js +13 -9
  63. package/Insights/InsightsContainer.js +22 -19
  64. package/Insights/WidgetChartContainer.js +34 -30
  65. package/Insights/WidgetDataGridContainer.js +45 -33
  66. package/Insights/WidgetTableContainer.js +29 -26
  67. package/Insights/WidgetTileContainer.js +16 -12
  68. package/Insights/WidgetTitleBar.js +15 -10
  69. package/Insights/Widgets.js +28 -25
  70. package/Insights/charts/AreaChart.js +15 -12
  71. package/Insights/charts/BarChart.js +15 -12
  72. package/Insights/charts/ComposedChart.js +15 -13
  73. package/Insights/charts/CustomTooltipContent.js +13 -9
  74. package/Insights/charts/GaugeChart.js +6 -3
  75. package/Insights/charts/LineChart.js +15 -12
  76. package/Insights/charts/OhlcChart.js +46 -40
  77. package/Insights/charts/PieChart.js +25 -26
  78. package/Insights/charts/RadarChart.js +19 -17
  79. package/Insights/charts/ScatterChart.js +26 -28
  80. package/Insights/charts/constants.js +4 -1
  81. package/Insights/charts/formatters.js +33 -23
  82. package/Insights/charts/index.js +2 -1
  83. package/Insights/charts/renderers.js +36 -26
  84. package/Insights/hooks/useQueriesData.js +27 -30
  85. package/Insights/hooks/useWidgetDetail.js +24 -15
  86. package/OverflowCommandBar/OverflowCommandBar.js +19 -12
  87. package/OverflowCommandBar/OverflowMenu.js +22 -30
  88. package/OverflowCommandBar/OverflowMenuDivider.js +10 -6
  89. package/OverflowCommandBar/index.js +9 -3
  90. package/OverflowCommandBar/render.js +15 -10
  91. package/OverflowCommandBar/utils.js +6 -4
  92. package/PageBoard/BoardColumn.js +8 -5
  93. package/PageBoard/BoardColumnCard.d.ts +1 -1
  94. package/PageBoard/BoardColumnCard.js +15 -11
  95. package/PageBoard/BoardColumnUI.js +45 -46
  96. package/PageBoard/BoardingColumnCardLoading.js +13 -10
  97. package/PageBoard/Header.js +23 -28
  98. package/PageBoard/PageBoard.js +28 -26
  99. package/PageBoard/index.js +5 -1
  100. package/PageEntityForm/CommandContainer.js +25 -21
  101. package/PageEntityForm/FormTabRelated.js +20 -17
  102. package/PageEntityForm/PageEntityForm.js +20 -16
  103. package/PageEntityForm/PageEntityFormDesktopContainer.js +77 -70
  104. package/PageEntityForm/PageEntityFormStringContext.js +9 -5
  105. package/PageEntityForm/ProcessFlow.js +24 -21
  106. package/PageEntityForm/RecordCard.js +31 -24
  107. package/PageEntityForm/RecordCardLoading.js +13 -11
  108. package/PageEntityForm/RecordSetNavigatorContainer.js +34 -31
  109. package/PageEntityForm/RelatedViewSelector.js +34 -36
  110. package/PageEntityForm/SectionContainer.js +35 -31
  111. package/PageEntityForm/StandardControl.js +84 -76
  112. package/PageEntityForm/SubgridControl.js +23 -21
  113. package/PageEntityForm/index.js +5 -1
  114. package/PageEntityView/FormSubgridContainer.js +26 -22
  115. package/PageEntityView/PageEntityView.js +19 -15
  116. package/PageEntityView/PageEntityViewDesktopContainer.js +13 -9
  117. package/PageEntityView/PageEntityViewDesktopFrame.js +21 -17
  118. package/PageEntityView/PageEntityViewMobileContainer.js +13 -9
  119. package/PageEntityView/PageEntityViewStringContext.js +9 -5
  120. package/PageEntityView/index.js +5 -1
  121. package/PageInsights/PageInsights.js +13 -9
  122. package/PageInsights/index.js +6 -1
  123. package/ProgressIndicatorContainer/index.js +14 -10
  124. package/ToastNotificationContainer/index.js +18 -15
  125. package/componentStore.js +5 -2
  126. package/components/BodyLoading.js +11 -7
  127. package/components/DialogLogin.js +8 -5
  128. package/components/DndProvider.d.ts +12 -0
  129. package/components/DndProvider.js +68 -0
  130. package/components/LoginForm.js +46 -36
  131. package/components/PageBroken.js +8 -5
  132. package/components/PageLoading.js +8 -5
  133. package/components/PageLogin.js +17 -14
  134. package/form/FormControl.js +44 -50
  135. package/form/FormControlLoading.js +8 -4
  136. package/form/controls/AttachmentControl.js +72 -77
  137. package/form/controls/AttachmentsControl.js +24 -30
  138. package/form/controls/CurrencyControl.js +16 -13
  139. package/form/controls/DateControl.js +24 -18
  140. package/form/controls/DateRangeControl.js +22 -18
  141. package/form/controls/DateTimeControl.js +49 -43
  142. package/form/controls/DecimalControl.js +14 -11
  143. package/form/controls/DurationControl.js +18 -14
  144. package/form/controls/EmailControl.js +14 -11
  145. package/form/controls/IntegerControl.js +11 -8
  146. package/form/controls/LookupControl.js +58 -56
  147. package/form/controls/MultiSelectControl.js +12 -9
  148. package/form/controls/MultiSelectLookupControl.js +55 -53
  149. package/form/controls/PasswordControl.js +11 -8
  150. package/form/controls/RichTextControl.js +32 -5
  151. package/form/controls/SelectControl.js +15 -13
  152. package/form/controls/SwitchControl.js +7 -4
  153. package/form/controls/TelephoneControl.js +10 -7
  154. package/form/controls/TextAreaControl.js +11 -8
  155. package/form/controls/TextControl.js +12 -9
  156. package/form/controls/UrlControl.js +10 -7
  157. package/form/controls/types.js +2 -1
  158. package/form/controls/useLookupData.js +43 -54
  159. package/form/layout/FormBody/FormBody.js +10 -6
  160. package/form/layout/FormBody/index.js +17 -1
  161. package/form/layout/FormSection/FormSection.js +31 -20
  162. package/form/layout/FormSection/FormSectionColumn.js +7 -3
  163. package/form/layout/FormSection/FormSectionLoading.js +5 -1
  164. package/form/layout/FormSection/index.js +5 -1
  165. package/form/layout/FormTab/FormTab.js +21 -17
  166. package/form/layout/FormTab/FormTabColumn.js +9 -5
  167. package/form/layout/FormTab/index.js +5 -1
  168. package/form/layout/TabContext.js +5 -2
  169. package/form/layout/index.js +9 -3
  170. package/form/types.js +2 -1
  171. package/package.json +4 -12
  172. package/types/index.js +2 -1
  173. package/utils/avatar.js +4 -1
  174. package/DataGrid/ScrollbarWithMoreDataRequest.d.ts +0 -9
  175. package/DataGrid/ScrollbarWithMoreDataRequest.js +0 -33
  176. package/form/controls/NumberControl.d.ts +0 -4
  177. package/form/controls/NumberControl.js +0 -16
  178. package/form/controls/utils.d.ts +0 -4
  179. package/form/controls/utils.js +0 -42
@@ -1,17 +1,20 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Dialog, DialogBody, DialogSurface, DialogTitle, makeStyles, Menu, MenuDivider, MenuItem, MenuList, MenuPopover, MenuTrigger, mergeClasses, TableHeaderCell, tokens, } from '@fluentui/react-components';
3
- import { useDataGridSchema, useGridColumnFilter, } from '@headless-adminapp/app/datagrid/hooks';
4
- import { useMetadata } from '@headless-adminapp/app/metadata/hooks';
5
- import { Icons } from '@headless-adminapp/icons';
6
- import { Fragment, useMemo, useRef, useState, } from 'react';
7
- import { usePageEntityViewStrings } from '../../PageEntityView/PageEntityViewStringContext';
8
- import { FilterForm } from './FilterForm';
9
- const useStyles = makeStyles({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableHeaderFilterCell = 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/datagrid/hooks");
7
+ const hooks_2 = require("@headless-adminapp/app/metadata/hooks");
8
+ const icons_1 = require("@headless-adminapp/icons");
9
+ const react_1 = require("react");
10
+ const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
11
+ const FilterForm_1 = require("./FilterForm");
12
+ const useStyles = (0, react_components_1.makeStyles)({
10
13
  root: {
11
14
  cursor: 'pointer',
12
15
  userSelect: 'none',
13
16
  '&:active': {
14
- backgroundColor: tokens.colorSubtleBackgroundPressed,
17
+ backgroundColor: react_components_1.tokens.colorSubtleBackgroundPressed,
15
18
  },
16
19
  '&:hover [data-id="resize-handle"]': {
17
20
  opacity: 0.5,
@@ -38,7 +41,7 @@ const useStyles = makeStyles({
38
41
  },
39
42
  resizeHandleInner: {
40
43
  width: '2px',
41
- background: tokens.colorNeutralForeground1,
44
+ background: react_components_1.tokens.colorNeutralForeground1,
42
45
  // borderLeft: `1px solid ${tokens.colorNeutralForeground1}`,
43
46
  // borderRight: `1px solid ${tokens.colorNeutralForeground1}`,
44
47
  },
@@ -48,7 +51,7 @@ const useStyles = makeStyles({
48
51
  },
49
52
  },
50
53
  });
51
- export const TableHeaderFilterCell = ({ children, sortDirection,
54
+ const TableHeaderFilterCell = ({ children, sortDirection,
52
55
  // onChangeFilterCondition,
53
56
  onChangeSortDirection,
54
57
  // attribute,
@@ -56,11 +59,11 @@ onChangeSortDirection,
56
59
  minWidth,
57
60
  // onChangeWidth,
58
61
  column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) => {
59
- const [visible, setVisible] = useState(false);
60
- const schema = useDataGridSchema();
61
- const { schemaStore } = useMetadata();
62
- const strings = usePageEntityViewStrings();
63
- const attribute = useMemo(() => {
62
+ const [visible, setVisible] = (0, react_1.useState)(false);
63
+ const schema = (0, hooks_1.useDataGridSchema)();
64
+ const { schemaStore } = (0, hooks_2.useMetadata)();
65
+ const strings = (0, PageEntityViewStringContext_1.usePageEntityViewStrings)();
66
+ const attribute = (0, react_1.useMemo)(() => {
64
67
  const _attribute = schema.attributes[column.name];
65
68
  if (!column.expandedKey) {
66
69
  return _attribute;
@@ -71,7 +74,7 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
71
74
  const lookupSchema = schemaStore.getSchema(_attribute.entity);
72
75
  return lookupSchema.attributes[column.expandedKey];
73
76
  }, [column.expandedKey, column.name, schemaStore, schema.attributes]);
74
- const align = useMemo(() => {
77
+ const align = (0, react_1.useMemo)(() => {
75
78
  switch (attribute.type) {
76
79
  case 'money':
77
80
  case 'number':
@@ -81,14 +84,14 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
81
84
  }
82
85
  }, [attribute.type]);
83
86
  const styles = useStyles();
84
- const isResizingRef = useRef(false);
85
- const [columnFilters, setColumnFilters] = useGridColumnFilter();
87
+ const isResizingRef = (0, react_1.useRef)(false);
88
+ const [columnFilters, setColumnFilters] = (0, hooks_1.useGridColumnFilter)();
86
89
  const filterCondition = columnFilters[column.id];
87
90
  const onChangeFilterCondition = (condition) => {
88
91
  setColumnFilters(column.id, condition);
89
92
  };
90
- const sortMenuItems = (_jsxs(_Fragment, { children: [_jsx(MenuItem, { icon: _jsx(Icons.ArrowUp, { size: 16 }), onClick: () => onChangeSortDirection === null || onChangeSortDirection === void 0 ? void 0 : onChangeSortDirection('asc'), children: strings.sortByAscending }), _jsx(MenuItem, { icon: _jsx(Icons.ArrowDown, { size: 16 }), onClick: () => onChangeSortDirection === null || onChangeSortDirection === void 0 ? void 0 : onChangeSortDirection('desc'), children: strings.sortByDescending })] }));
91
- const filterMenuItems = (_jsxs(_Fragment, { children: [_jsx(MenuItem, { icon: _jsx(Icons.Filter, { size: 16 }), onClick: () => setVisible(!visible), children: strings.filter }), !!filterCondition && (_jsx(MenuItem, { icon: _jsx(Icons.FilterDismiss, { size: 16 }), onClick: () => {
93
+ const sortMenuItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ArrowUp, { size: 16 }), onClick: () => onChangeSortDirection?.('asc'), children: strings.sortByAscending }), (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ArrowDown, { size: 16 }), onClick: () => onChangeSortDirection?.('desc'), children: strings.sortByDescending })] }));
94
+ const filterMenuItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Filter, { size: 16 }), onClick: () => setVisible(!visible), children: strings.filter }), !!filterCondition && ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.FilterDismiss, { size: 16 }), onClick: () => {
92
95
  onChangeFilterCondition(undefined);
93
96
  }, children: strings.clearFilter }))] }));
94
97
  const menuItems = [];
@@ -98,36 +101,36 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
98
101
  if (!disableFilter) {
99
102
  menuItems.push(filterMenuItems);
100
103
  }
101
- const headerCell = (_jsxs(TableHeaderCell, { as: "div", className: mergeClasses(styles.root, align === 'right' && styles.right), style: {
104
+ const headerCell = ((0, jsx_runtime_1.jsxs)(react_components_1.TableHeaderCell, { as: "div", className: (0, react_components_1.mergeClasses)(styles.root, align === 'right' && styles.right), style: {
102
105
  textAlign: align,
103
106
  width: minWidth,
104
107
  minWidth: minWidth,
105
108
  maxWidth: minWidth,
106
109
  display: 'flex',
107
110
  alignItems: 'center',
108
- fontWeight: tokens.fontWeightMedium,
111
+ fontWeight: react_components_1.tokens.fontWeightMedium,
109
112
  // pointerEvents: disableFilter && disableSort ? 'none' : 'auto',
110
113
  }, onClick: (event) => {
111
114
  event.preventDefault();
112
- }, aside: resizable ? (_jsx("div", { className: mergeClasses(styles.resizeHandle), "data-id": "resize-handle", onClick: (event) => {
115
+ }, aside: resizable ? ((0, jsx_runtime_1.jsx)("div", { className: (0, react_components_1.mergeClasses)(styles.resizeHandle), "data-id": "resize-handle", onClick: (event) => {
113
116
  event.stopPropagation();
114
117
  event.preventDefault();
115
118
  }, onDoubleClick: (event) => {
116
119
  event.stopPropagation();
117
120
  event.preventDefault();
118
- onResetSize === null || onResetSize === void 0 ? void 0 : onResetSize();
121
+ onResetSize?.();
119
122
  }, onMouseDown: (event) => {
120
123
  event.stopPropagation();
121
124
  event.preventDefault();
122
- resizeHandler === null || resizeHandler === void 0 ? void 0 : resizeHandler(event);
125
+ resizeHandler?.(event);
123
126
  }, onMouseUp: (event) => {
124
127
  event.stopPropagation();
125
128
  event.preventDefault();
126
129
  }, onTouchStart: (event) => {
127
130
  event.stopPropagation();
128
131
  event.preventDefault();
129
- resizeHandler === null || resizeHandler === void 0 ? void 0 : resizeHandler(event);
130
- }, children: _jsx("div", { className: mergeClasses(styles.resizeHandleInner) }) })) : null, onMouseUp: (event) => {
132
+ resizeHandler?.(event);
133
+ }, children: (0, jsx_runtime_1.jsx)("div", { className: (0, react_components_1.mergeClasses)(styles.resizeHandleInner) }) })) : null, onMouseUp: (event) => {
131
134
  event.preventDefault();
132
135
  if (isResizingRef.current) {
133
136
  return;
@@ -135,15 +138,16 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
135
138
  isResizingRef.current = false;
136
139
  }, sortable: !disableSort,
137
140
  // sortDirection="ascending"
138
- sortDirection: getSortDirection(sortDirection), children: [children, !!filterCondition && (_jsx("div", { style: { marginTop: 2, color: tokens.colorNeutralForeground1 }, children: _jsx(Icons.Filter, { size: 16 }) }))] }));
141
+ sortDirection: getSortDirection(sortDirection), children: [children, !!filterCondition && ((0, jsx_runtime_1.jsx)("div", { style: { marginTop: 2, color: react_components_1.tokens.colorNeutralForeground1 }, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Filter, { size: 16 }) }))] }));
139
142
  if (disableFilter && disableSort) {
140
143
  return headerCell;
141
144
  }
142
- return (_jsxs("th", { children: [_jsxs(Menu, { positioning: "below-start", children: [_jsx(MenuTrigger, { children: headerCell }), _jsx(MenuPopover, { children: _jsx(MenuList, { children: menuItems.map((x, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx(MenuDivider, {}), x] }, i))) }) })] }), _jsx(Dialog, { open: visible, onOpenChange: () => setVisible(false), children: _jsx(DialogSurface, { style: { maxWidth: 400 }, children: _jsxs(DialogBody, { children: [_jsx(DialogTitle, { children: strings.filterBy }), _jsx(FilterForm, { attribute: attribute, defaultValue: filterCondition, onApply: (condition) => {
145
+ return ((0, jsx_runtime_1.jsxs)("th", { children: [(0, jsx_runtime_1.jsxs)(react_components_1.Menu, { positioning: "below-start", children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: headerCell }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: menuItems.map((x, i) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [i > 0 && (0, jsx_runtime_1.jsx)(react_components_1.MenuDivider, {}), x] }, i))) }) })] }), (0, jsx_runtime_1.jsx)(react_components_1.Dialog, { open: visible, onOpenChange: () => setVisible(false), children: (0, jsx_runtime_1.jsx)(react_components_1.DialogSurface, { style: { maxWidth: 400 }, children: (0, jsx_runtime_1.jsxs)(react_components_1.DialogBody, { children: [(0, jsx_runtime_1.jsx)(react_components_1.DialogTitle, { children: strings.filterBy }), (0, jsx_runtime_1.jsx)(FilterForm_1.FilterForm, { attribute: attribute, defaultValue: filterCondition, onApply: (condition) => {
143
146
  onChangeFilterCondition(condition);
144
147
  setVisible(false);
145
148
  }, onCancel: () => setVisible(false) })] }) }) })] }));
146
149
  };
150
+ exports.TableHeaderFilterCell = TableHeaderFilterCell;
147
151
  const getSortDirection = (direction) => {
148
152
  if (direction === 'asc') {
149
153
  return 'ascending';
@@ -1 +1,5 @@
1
- export { TableHeaderFilterCell } from './TableHeaderFilterCell';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableHeaderFilterCell = void 0;
4
+ var TableHeaderFilterCell_1 = require("./TableHeaderFilterCell");
5
+ Object.defineProperty(exports, "TableHeaderFilterCell", { enumerable: true, get: function () { return TableHeaderFilterCell_1.TableHeaderFilterCell; } });
@@ -1,4 +1,8 @@
1
- export function getDefaultOperator(operator, attributeType) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDefaultOperator = getDefaultOperator;
4
+ exports.getDefaultValues = getDefaultValues;
5
+ function getDefaultOperator(operator, attributeType) {
2
6
  if (operator) {
3
7
  return operator;
4
8
  }
@@ -10,7 +14,7 @@ export function getDefaultOperator(operator, attributeType) {
10
14
  }
11
15
  return 'eq';
12
16
  }
13
- export function getDefaultValues(operator, value, _attributeType) {
17
+ function getDefaultValues(operator, value, _attributeType) {
14
18
  if (!value)
15
19
  return [];
16
20
  return Array.isArray(value) ? value : [value];
@@ -1,5 +1,9 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { GridHeaderDesktop } from './GridHeaderDesktop';
3
- export const GridHeaderContainer = () => {
4
- return _jsx(GridHeaderDesktop, {});
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GridHeaderContainer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const GridHeaderDesktop_1 = require("./GridHeaderDesktop");
6
+ const GridHeaderContainer = () => {
7
+ return (0, jsx_runtime_1.jsx)(GridHeaderDesktop_1.GridHeaderDesktop, {});
5
8
  };
9
+ exports.GridHeaderContainer = GridHeaderContainer;
@@ -1,38 +1,38 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Input, Menu, MenuItem, MenuList, MenuPopover, MenuTrigger, tokens, } from '@fluentui/react-components';
3
- import { useChangeView, useGridViewLookupData, useSearchText, useSelectedView, } from '@headless-adminapp/app/datagrid/hooks';
4
- import { useLocale } from '@headless-adminapp/app/locale';
5
- import { Icons } from '@headless-adminapp/icons';
6
- import { useState } from 'react';
7
- import { useAppStrings } from '../App/AppStringContext';
8
- import { usePageEntityViewStrings } from '../PageEntityView/PageEntityViewStringContext';
9
- import { CustomizeColumns } from './CustomizeColumns';
10
- export const GridHeaderDesktop = (props) => {
11
- var _a, _b;
12
- const viewLookup = useGridViewLookupData();
13
- const selectedView = useSelectedView();
14
- const changeView = useChangeView();
15
- const [searchText, setSearchText] = useSearchText();
16
- const [isColumnCustomizationOpen, setIsColumnCustomizationOpen] = useState(false);
17
- const { language } = useLocale();
18
- const strings = usePageEntityViewStrings();
19
- const appStrings = useAppStrings();
20
- return (_jsxs("div", { style: {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GridHeaderDesktop = 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/datagrid/hooks");
7
+ const locale_1 = require("@headless-adminapp/app/locale");
8
+ const icons_1 = require("@headless-adminapp/icons");
9
+ const react_1 = require("react");
10
+ const AppStringContext_1 = require("../App/AppStringContext");
11
+ const PageEntityViewStringContext_1 = require("../PageEntityView/PageEntityViewStringContext");
12
+ const CustomizeColumns_1 = require("./CustomizeColumns");
13
+ const GridHeaderDesktop = (props) => {
14
+ const viewLookup = (0, hooks_1.useGridViewLookupData)();
15
+ const selectedView = (0, hooks_1.useSelectedView)();
16
+ const changeView = (0, hooks_1.useChangeView)();
17
+ const [searchText, setSearchText] = (0, hooks_1.useSearchText)();
18
+ const [isColumnCustomizationOpen, setIsColumnCustomizationOpen] = (0, react_1.useState)(false);
19
+ const { language } = (0, locale_1.useLocale)();
20
+ const strings = (0, PageEntityViewStringContext_1.usePageEntityViewStrings)();
21
+ const appStrings = (0, AppStringContext_1.useAppStrings)();
22
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
21
23
  alignItems: 'center',
22
24
  paddingInline: 8,
23
25
  gap: 16,
24
26
  display: 'flex',
25
- }, children: [_jsx(CustomizeColumns, { opened: isColumnCustomizationOpen, onClose: () => setIsColumnCustomizationOpen(false) }), _jsx("div", { style: {
27
+ }, children: [(0, jsx_runtime_1.jsx)(CustomizeColumns_1.CustomizeColumns, { opened: isColumnCustomizationOpen, onClose: () => setIsColumnCustomizationOpen(false) }), (0, jsx_runtime_1.jsx)("div", { style: {
26
28
  flex: 1,
27
29
  alignItems: 'center',
28
30
  gap: 16,
29
31
  justifyContent: 'space-between',
30
32
  display: 'flex',
31
- }, children: _jsxs(Menu, { children: [_jsx(MenuTrigger, { children: _jsx(Button, { appearance: "subtle", icon: _jsx(Icons.ChevronDown, {}), iconPosition: "after", style: {
32
- fontSize: tokens.fontSizeBase400,
33
- fontWeight: tokens.fontWeightMedium,
34
- }, children: (_b = (_a = selectedView.localizedNames) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : selectedView.name }) }), _jsx(MenuPopover, { children: _jsx(MenuList, { children: viewLookup.map((view) => {
35
- var _a, _b;
36
- return (_jsx(MenuItem, { onClick: () => changeView(view.id), children: (_b = (_a = view.localizedNames) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : view.name }, view.id));
37
- }) }) })] }) }), _jsxs("div", { style: { alignItems: 'center', display: 'flex', gap: 16 }, children: [props.headingRight, _jsx(Button, { appearance: "subtle", icon: _jsx(Icons.EditColumns, { size: 24 }), onClick: () => setIsColumnCustomizationOpen(true), children: strings.editColumns }), _jsx(Input, { contentBefore: _jsx(Icons.Search, { size: 16 }), placeholder: appStrings.searchPlaceholder, value: searchText, onChange: (e) => setSearchText(e.target.value), appearance: "filled-darker" })] })] }));
33
+ }, children: (0, jsx_runtime_1.jsxs)(react_components_1.Menu, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ChevronDown, {}), iconPosition: "after", style: {
34
+ fontSize: react_components_1.tokens.fontSizeBase400,
35
+ fontWeight: react_components_1.tokens.fontWeightMedium,
36
+ }, children: selectedView.localizedNames?.[language] ?? selectedView.name }) }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: viewLookup.map((view) => ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { onClick: () => changeView(view.id), children: view.localizedNames?.[language] ?? view.name }, view.id))) }) })] }) }), (0, jsx_runtime_1.jsxs)("div", { style: { alignItems: 'center', display: 'flex', gap: 16 }, children: [props.headingRight, (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.EditColumns, { size: 24 }), onClick: () => setIsColumnCustomizationOpen(true), children: strings.editColumns }), (0, jsx_runtime_1.jsx)(react_components_1.Input, { contentBefore: (0, jsx_runtime_1.jsx)(icons_1.Icons.Search, { size: 16 }), placeholder: appStrings.searchPlaceholder, value: searchText, onChange: (e) => setSearchText(e.target.value), appearance: "filled-darker" })] })] }));
38
37
  };
38
+ exports.GridHeaderDesktop = GridHeaderDesktop;
@@ -1,28 +1,29 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Input, Menu, MenuItem, MenuList, MenuPopover, MenuTrigger, } from '@fluentui/react-components';
3
- import { useChangeView, useGridViewLookupData, useSearchText, useSelectedView, } from '@headless-adminapp/app/datagrid/hooks';
4
- import { useLocale } from '@headless-adminapp/app/locale';
5
- import { Icons } from '@headless-adminapp/icons';
6
- import { useAppStrings } from '../App/AppStringContext';
7
- export const GridHeaderMobile = () => {
8
- const viewLookup = useGridViewLookupData();
9
- const selectedView = useSelectedView();
10
- const changeView = useChangeView();
11
- const [searchText, setSearchText] = useSearchText();
12
- const { language } = useLocale();
13
- const appStrings = useAppStrings();
14
- return (_jsxs("div", { style: {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GridHeaderMobile = 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/datagrid/hooks");
7
+ const locale_1 = require("@headless-adminapp/app/locale");
8
+ const icons_1 = require("@headless-adminapp/icons");
9
+ const AppStringContext_1 = require("../App/AppStringContext");
10
+ const GridHeaderMobile = () => {
11
+ const viewLookup = (0, hooks_1.useGridViewLookupData)();
12
+ const selectedView = (0, hooks_1.useSelectedView)();
13
+ const changeView = (0, hooks_1.useChangeView)();
14
+ const [searchText, setSearchText] = (0, hooks_1.useSearchText)();
15
+ const { language } = (0, locale_1.useLocale)();
16
+ const appStrings = (0, AppStringContext_1.useAppStrings)();
17
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
15
18
  alignItems: 'center',
16
19
  paddingInline: 8,
17
20
  gap: 8,
18
21
  display: 'flex',
19
- }, children: [_jsx("div", { style: { alignItems: 'center', display: 'flex', gap: 16, flex: 1 }, children: _jsx(Input, { contentBefore: _jsx(Icons.Search, { size: 16 }), placeholder: appStrings.searchPlaceholder, value: searchText, onChange: (e) => setSearchText(e.target.value), style: { flex: 1 } }) }), _jsx("div", { style: {
22
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: { alignItems: 'center', display: 'flex', gap: 16, flex: 1 }, children: (0, jsx_runtime_1.jsx)(react_components_1.Input, { contentBefore: (0, jsx_runtime_1.jsx)(icons_1.Icons.Search, { size: 16 }), placeholder: appStrings.searchPlaceholder, value: searchText, onChange: (e) => setSearchText(e.target.value), style: { flex: 1 } }) }), (0, jsx_runtime_1.jsx)("div", { style: {
20
23
  alignItems: 'center',
21
24
  gap: 16,
22
25
  justifyContent: 'space-between',
23
26
  display: 'flex',
24
- }, children: _jsxs(Menu, { hasIcons: true, children: [_jsx(MenuTrigger, { children: _jsx(Button, { appearance: "subtle", icon: _jsx(Icons.Filter, {}), iconPosition: "after" }) }), _jsx(MenuPopover, { children: _jsx(MenuList, { children: viewLookup.map((view) => {
25
- var _a, _b;
26
- return (_jsx(MenuItem, { onClick: () => changeView(view.id), icon: selectedView.id === view.id ? (_jsx(Icons.Checkmark, {})) : undefined, children: (_b = (_a = view.localizedNames) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : view.name }, view.id));
27
- }) }) })] }) })] }));
27
+ }, children: (0, jsx_runtime_1.jsxs)(react_components_1.Menu, { hasIcons: true, children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Filter, {}), iconPosition: "after" }) }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: viewLookup.map((view) => ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { onClick: () => changeView(view.id), icon: selectedView.id === view.id ? ((0, jsx_runtime_1.jsx)(icons_1.Icons.Checkmark, {})) : undefined, children: view.localizedNames?.[language] ?? view.name }, view.id))) }) })] }) })] }));
28
28
  };
29
+ exports.GridHeaderMobile = GridHeaderMobile;
@@ -1,87 +1,93 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { makeStyles, mergeClasses, tokens } from '@fluentui/react-components';
3
- import { ScrollbarWithMoreDataRequest } from '@headless-adminapp/app/components/ScrollbarWithMoreDataRequest';
4
- import { GridContext } from '@headless-adminapp/app/datagrid';
5
- import { useDataGridSchema, useGridData, useGridDataState, useSelectedView, } from '@headless-adminapp/app/datagrid/hooks';
6
- import { useLocale } from '@headless-adminapp/app/locale';
7
- import { useContextSelector } from '@headless-adminapp/app/mutable';
8
- import { useOpenForm } from '@headless-adminapp/app/navigation';
9
- import { useRecordSetSetter } from '@headless-adminapp/app/recordset/hooks';
10
- import { useVirtualizer } from '@tanstack/react-virtual';
11
- import { useCallback, useMemo, useRef } from 'react';
12
- import { v4 as uuid } from 'uuid';
13
- import { RecordCard } from '../PageEntityForm/RecordCard';
14
- import { RecordCardLoading } from '../PageEntityForm/RecordCardLoading';
15
- const useStyles = makeStyles({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GridListContainer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const ScrollbarWithMoreDataRequest_1 = require("@headless-adminapp/app/components/ScrollbarWithMoreDataRequest");
7
+ const datagrid_1 = require("@headless-adminapp/app/datagrid");
8
+ const hooks_1 = require("@headless-adminapp/app/datagrid/hooks");
9
+ const locale_1 = require("@headless-adminapp/app/locale");
10
+ const mutable_1 = require("@headless-adminapp/app/mutable");
11
+ const navigation_1 = require("@headless-adminapp/app/navigation");
12
+ const hooks_2 = require("@headless-adminapp/app/recordset/hooks");
13
+ const react_virtual_1 = require("@tanstack/react-virtual");
14
+ const react_1 = require("react");
15
+ const uuid_1 = require("uuid");
16
+ const RecordCard_1 = require("../PageEntityForm/RecordCard");
17
+ const RecordCardLoading_1 = require("../PageEntityForm/RecordCardLoading");
18
+ const useStyles = (0, react_components_1.makeStyles)({
16
19
  root: {
17
20
  '&:hover': {
18
- background: tokens.colorNeutralBackground1Hover,
21
+ background: react_components_1.tokens.colorNeutralBackground1Hover,
19
22
  },
20
23
  },
21
24
  });
22
25
  const fallbackData = [];
23
- export const GridListContainer = () => {
26
+ const GridListContainer = () => {
24
27
  const styles = useStyles();
25
- const data = useGridData();
26
- const dataState = useGridDataState();
27
- const fetchNextPage = useContextSelector(GridContext, (state) => state.fetchNextPage);
28
- const schema = useDataGridSchema();
29
- const view = useSelectedView();
30
- const tableWrapperRef = useRef(null);
31
- const { direction } = useLocale();
32
- const dataRef = useRef(data);
28
+ const data = (0, hooks_1.useGridData)();
29
+ const dataState = (0, hooks_1.useGridDataState)();
30
+ const fetchNextPage = (0, mutable_1.useContextSelector)(datagrid_1.GridContext, (state) => state.fetchNextPage);
31
+ const schema = (0, hooks_1.useDataGridSchema)();
32
+ const view = (0, hooks_1.useSelectedView)();
33
+ const tableWrapperRef = (0, react_1.useRef)(null);
34
+ const { direction } = (0, locale_1.useLocale)();
35
+ const dataRef = (0, react_1.useRef)(data);
33
36
  dataRef.current = data;
34
- const uniqueRecords = useMemo(() => {
35
- var _a;
36
- return ((_a = data === null || data === void 0 ? void 0 : data.records.map((record) => (Object.assign(Object.assign({}, record), { __uuid: uuid() })))) !== null && _a !== void 0 ? _a : fallbackData);
37
- }, [data === null || data === void 0 ? void 0 : data.records]);
37
+ const uniqueRecords = (0, react_1.useMemo)(() => {
38
+ return (data?.records.map((record) => ({
39
+ ...record,
40
+ __uuid: (0, uuid_1.v4)(),
41
+ })) ?? fallbackData);
42
+ }, [data?.records]);
38
43
  const rows = uniqueRecords;
39
- const virtualizer = useVirtualizer({
44
+ const virtualizer = (0, react_virtual_1.useVirtualizer)({
40
45
  count: rows.length,
41
- 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; },
46
+ getScrollElement: () => tableWrapperRef.current?.parentElement?.parentElement,
42
47
  estimateSize: () => 40,
43
48
  overscan: 5,
44
49
  enabled: true,
45
50
  });
46
51
  const virtualItems = virtualizer.getVirtualItems();
47
52
  const virtualSize = virtualizer.getTotalSize();
48
- const recordSetSetter = useRecordSetSetter();
49
- const openFormInternal = useOpenForm();
50
- const openRecord = useCallback((id) => {
51
- var _a, _b;
52
- 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 : []);
53
+ const recordSetSetter = (0, hooks_2.useRecordSetSetter)();
54
+ const openFormInternal = (0, navigation_1.useOpenForm)();
55
+ const openRecord = (0, react_1.useCallback)((id) => {
56
+ recordSetSetter(schema.logicalName, dataRef.current?.records.map((x) => x[schema.idAttribute]) ??
57
+ []);
53
58
  openFormInternal({
54
59
  logicalName: schema.logicalName,
55
60
  id,
56
61
  });
57
62
  }, [openFormInternal, recordSetSetter, schema.idAttribute, schema.logicalName]);
58
- return (_jsx("div", { style: { display: 'flex', flex: 1, flexDirection: 'column' }, children: _jsx(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: () => {
63
+ 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?.records, hasMore: dataState?.hasNextPage, rtl: direction === 'rtl', onRequestMore: () => {
59
64
  fetchNextPage();
60
- }, children: _jsx("div", { style: {
65
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: {
61
66
  position: 'relative',
62
- }, ref: tableWrapperRef, children: _jsxs("div", { style: {
67
+ }, ref: tableWrapperRef, children: (0, jsx_runtime_1.jsxs)("div", { style: {
63
68
  display: 'flex',
64
69
  flexDirection: 'column',
65
70
  width: '100%',
66
71
  height: virtualizer.getTotalSize(),
67
- }, children: [_jsx("div", { style: {
72
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
68
73
  display: 'flex',
69
74
  flexDirection: 'column',
70
75
  }, children: virtualItems.map((virtualRow) => {
71
76
  const row = rows[virtualRow.index];
72
- return (_jsx("div", { ref: virtualizer.measureElement, "data-index": virtualRow.index, className: mergeClasses(styles.root), style: {
77
+ return ((0, jsx_runtime_1.jsx)("div", { ref: virtualizer.measureElement, "data-index": virtualRow.index, className: (0, react_components_1.mergeClasses)(styles.root), style: {
73
78
  width: '100%',
74
79
  position: 'absolute',
75
80
  transform: `translateY(${virtualRow.start}px)`,
76
81
  }, onClick: () => {
77
82
  const id = row[schema.idAttribute];
78
83
  openRecord(id);
79
- }, children: _jsx(RecordCard, { cardView: view.experience.card, record: row, schema: schema, selected: false }) }, virtualRow.key));
80
- }) }), dataState.isFetching && (_jsx("div", { style: {
84
+ }, children: (0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: view.experience.card, record: row, schema: schema, selected: false }) }, virtualRow.key));
85
+ }) }), dataState.isFetching && ((0, jsx_runtime_1.jsx)("div", { style: {
81
86
  display: 'flex',
82
87
  flexDirection: 'column',
83
88
  width: '100%',
84
89
  position: 'absolute',
85
90
  transform: `translateY(${virtualSize}px)`,
86
- }, children: Array.from({ length: 10 }).map((_, index) => (_jsx(RecordCardLoading, { cardView: view.experience.card, schema: schema }, index))) }))] }) }) }) }));
91
+ }, children: Array.from({ length: 10 }).map((_, index) => ((0, jsx_runtime_1.jsx)(RecordCardLoading_1.RecordCardLoading, { cardView: view.experience.card, schema: schema }, index))) }))] }) }) }) }));
87
92
  };
93
+ exports.GridListContainer = GridListContainer;
@@ -1,16 +1,19 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { Body1, tokens } from '@fluentui/react-components';
3
- import { useGridData, useGridSelection, } from '@headless-adminapp/app/datagrid/hooks';
4
- import { Fragment } from 'react';
5
- import { usePageEntityViewStrings } from '../PageEntityView/PageEntityViewStringContext';
6
- export const GridPaginationContainer = () => {
7
- var _a, _b, _c;
8
- const data = useGridData();
9
- const [selectedIds] = useGridSelection();
10
- const strings = usePageEntityViewStrings();
11
- return (_jsx("div", { children: _jsxs(Body1, { style: {
12
- color: tokens.colorNeutralForeground3,
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GridPaginationContainer = 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/datagrid/hooks");
7
+ const react_1 = require("react");
8
+ const PageEntityViewStringContext_1 = require("../PageEntityView/PageEntityViewStringContext");
9
+ const GridPaginationContainer = () => {
10
+ const data = (0, hooks_1.useGridData)();
11
+ const [selectedIds] = (0, hooks_1.useGridSelection)();
12
+ const strings = (0, PageEntityViewStringContext_1.usePageEntityViewStrings)();
13
+ return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(react_components_1.Body1, { style: {
14
+ color: react_components_1.tokens.colorNeutralForeground3,
13
15
  display: 'flex',
14
16
  gap: 8,
15
- }, children: [_jsxs("span", { children: [strings.records, ": ", (_a = data === null || data === void 0 ? void 0 : data.count) !== null && _a !== void 0 ? _a : '-'] }), _jsx("span", { children: "|" }), _jsxs("span", { children: [strings.loaded, ": ", (_b = data === null || data === void 0 ? void 0 : data.records.length) !== null && _b !== void 0 ? _b : '-'] }), (selectedIds.length > 0 || ((_c = data === null || data === void 0 ? void 0 : data.count) !== null && _c !== void 0 ? _c : 0) > 0) && (_jsxs(Fragment, { children: [_jsx("span", { children: "|" }), _jsxs("span", { children: [strings.selected, ": ", selectedIds.length] })] }))] }) }));
17
+ }, children: [(0, jsx_runtime_1.jsxs)("span", { children: [strings.records, ": ", data?.count ?? '-'] }), (0, jsx_runtime_1.jsx)("span", { children: "|" }), (0, jsx_runtime_1.jsxs)("span", { children: [strings.loaded, ": ", data?.records.length ?? '-'] }), (selectedIds.length > 0 || (data?.count ?? 0) > 0) && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { children: "|" }), (0, jsx_runtime_1.jsxs)("span", { children: [strings.selected, ": ", selectedIds.length] })] }))] }) }));
16
18
  };
19
+ exports.GridPaginationContainer = GridPaginationContainer;