@vuu-ui/vuu-table-extras 0.8.7-debug → 0.8.8-debug

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 (85) hide show
  1. package/cjs/index.js +1034 -654
  2. package/cjs/index.js.map +4 -4
  3. package/esm/index.js +1160 -671
  4. package/esm/index.js.map +4 -4
  5. package/index.css +813 -107
  6. package/index.css.map +3 -3
  7. package/package.json +13 -13
  8. package/types/vuu-data/src/array-data-source/array-data-source.d.ts +65 -0
  9. package/types/vuu-data/src/array-data-source/group-utils.d.ts +10 -0
  10. package/types/vuu-data/src/array-data-source/sort-utils.d.ts +4 -0
  11. package/types/vuu-data/src/authenticate.d.ts +1 -0
  12. package/types/vuu-data/src/connection-manager.d.ts +46 -0
  13. package/types/vuu-data/src/connectionTypes.d.ts +5 -0
  14. package/types/vuu-data/src/constants.d.ts +41 -0
  15. package/types/vuu-data/src/data-source.d.ts +172 -0
  16. package/types/vuu-data/src/index.d.ts +10 -0
  17. package/types/vuu-data/src/inlined-worker.d.ts +1 -0
  18. package/types/vuu-data/src/json-data-source.d.ts +53 -0
  19. package/types/vuu-data/src/message-utils.d.ts +26 -0
  20. package/types/vuu-data/src/remote-data-source.d.ts +56 -0
  21. package/types/vuu-data/src/server-proxy/messages.d.ts +43 -0
  22. package/types/vuu-data/src/vuuUIMessageTypes.d.ts +202 -0
  23. package/types/vuu-data/src/websocket-connection.d.ts +25 -0
  24. package/types/vuu-table-extras/src/column-list/ColumnList.d.ts +12 -0
  25. package/types/vuu-table-extras/src/column-list/index.d.ts +1 -0
  26. package/types/{index.d.ts → vuu-table-extras/src/index.d.ts} +1 -0
  27. package/types/vuu-table-extras/src/table-settings/TableSettingsPanel.d.ts +15 -0
  28. package/types/vuu-table-extras/src/table-settings/index.d.ts +2 -0
  29. package/types/vuu-table-extras/src/table-settings/useTableSettings.d.ts +14 -0
  30. package/types/table-settings/column-picker/ColumnListItem.d.ts +0 -4
  31. package/types/table-settings/column-picker/ColumnPicker.d.ts +0 -13
  32. package/types/table-settings/column-picker/index.d.ts +0 -1
  33. /package/types/{cell-renderers → vuu-table-extras/src/cell-renderers}/background-cell/BackgroundCell.d.ts +0 -0
  34. /package/types/{cell-renderers → vuu-table-extras/src/cell-renderers}/background-cell/index.d.ts +0 -0
  35. /package/types/{cell-renderers → vuu-table-extras/src/cell-renderers}/background-cell/useDirection.d.ts +0 -0
  36. /package/types/{cell-renderers → vuu-table-extras/src/cell-renderers}/index.d.ts +0 -0
  37. /package/types/{cell-renderers → vuu-table-extras/src/cell-renderers}/progress-cell/ProgressCell.d.ts +0 -0
  38. /package/types/{cell-renderers → vuu-table-extras/src/cell-renderers}/progress-cell/index.d.ts +0 -0
  39. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/ColumnExpressionInput.d.ts +0 -0
  40. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/column-function-descriptors.d.ts +0 -0
  41. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/column-language-parser/ColumnExpressionLanguage.d.ts +0 -0
  42. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/column-language-parser/ColumnExpressionTreeWalker.d.ts +0 -0
  43. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/column-language-parser/column-expression-parse-utils.d.ts +0 -0
  44. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/column-language-parser/generated/column-parser.d.ts +0 -0
  45. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/column-language-parser/generated/column-parser.terms.d.ts +0 -0
  46. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/column-language-parser/index.d.ts +0 -0
  47. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/column-language-parser/test.d.mts +0 -0
  48. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/functionDocInfo.d.ts +0 -0
  49. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/highlighting.d.ts +0 -0
  50. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/index.d.ts +0 -0
  51. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/theme.d.ts +0 -0
  52. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/useColumnAutoComplete.d.ts +0 -0
  53. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/useColumnExpressionEditor.d.ts +0 -0
  54. /package/types/{column-expression-input → vuu-table-extras/src/column-expression-input}/useColumnExpressionSuggestionProvider.d.ts +0 -0
  55. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/calculated-column-panel/CalculatedColumnPanel.d.ts +0 -0
  56. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/calculated-column-panel/index.d.ts +0 -0
  57. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/column-picker/ColumnListItem.d.ts +0 -0
  58. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/column-picker/ColumnPicker.d.ts +0 -0
  59. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/column-picker/index.d.ts +0 -0
  60. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/column-settings-panel/ColumnSettingsPanel.d.ts +0 -0
  61. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/column-settings-panel/index.d.ts +0 -0
  62. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/column-type-panel/ColumnTypePanel.d.ts +0 -0
  63. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/column-type-panel/NumericColumnPanel.d.ts +0 -0
  64. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/column-type-panel/StringColumnPanel.d.ts +0 -0
  65. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/column-type-panel/index.d.ts +0 -0
  66. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/index.d.ts +0 -0
  67. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/settings-panel/DatagridSettingsPanel.d.ts +0 -0
  68. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/settings-panel/GridSettingsPanel.d.ts +0 -0
  69. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/settings-panel/index.d.ts +0 -0
  70. /package/types/{datagrid-configuration-ui → vuu-table-extras/src/datagrid-configuration-ui}/settings-panel/useGridSettings.d.ts +0 -0
  71. /package/types/{datasource-stats → vuu-table-extras/src/datasource-stats}/DatasourceStats.d.ts +0 -0
  72. /package/types/{datasource-stats → vuu-table-extras/src/datasource-stats}/index.d.ts +0 -0
  73. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/calculated-column-panel/CalculatedColumnPanel.d.ts +0 -0
  74. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/calculated-column-panel/index.d.ts +0 -0
  75. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/column-settings-panel/ColumnSettingsPanel.d.ts +0 -0
  76. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/column-settings-panel/index.d.ts +0 -0
  77. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/column-type-panel/ColumnTypePanel.d.ts +0 -0
  78. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/column-type-panel/NumericColumnPanel.d.ts +0 -0
  79. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/column-type-panel/StringColumnPanel.d.ts +0 -0
  80. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/column-type-panel/index.d.ts +0 -0
  81. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/index.d.ts +0 -0
  82. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/settings-panel/DatagridSettingsPanel.d.ts +0 -0
  83. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/settings-panel/GridSettingsPanel.d.ts +0 -0
  84. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/settings-panel/index.d.ts +0 -0
  85. /package/types/{table-settings → vuu-table-extras/src/table-settings-deprecated}/settings-panel/useGridSettings.d.ts +0 -0
package/esm/index.js CHANGED
@@ -142,6 +142,94 @@ registerComponent2("vuu.progress", ProgressCell, "cell-renderer", {
142
142
  serverDataType: ["long", "int", "double"]
143
143
  });
144
144
 
145
+ // src/column-list/ColumnList.tsx
146
+ import {
147
+ List,
148
+ ListItem
149
+ } from "@vuu-ui/vuu-ui-controls";
150
+ import { Checkbox } from "@salt-ds/core";
151
+ import { Switch } from "@salt-ds/lab";
152
+ import cx3 from "classnames";
153
+ import { useCallback } from "react";
154
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
155
+ var classBase3 = "vuuColumnList";
156
+ var classBaseListItem = "vuuColumnListItem";
157
+ var ColumnListItem = ({
158
+ className: classNameProp,
159
+ item,
160
+ ...listItemProps
161
+ }) => {
162
+ var _a;
163
+ return /* @__PURE__ */ jsxs3(
164
+ ListItem,
165
+ {
166
+ ...listItemProps,
167
+ className: cx3(classNameProp, classBaseListItem),
168
+ "data-name": item == null ? void 0 : item.name,
169
+ children: [
170
+ /* @__PURE__ */ jsx3(Switch, { className: `${classBase3}-switch`, checked: item == null ? void 0 : item.subscribed }),
171
+ /* @__PURE__ */ jsx3("span", { className: `${classBase3}-text`, children: (_a = item == null ? void 0 : item.label) != null ? _a : item == null ? void 0 : item.name }),
172
+ /* @__PURE__ */ jsx3(
173
+ Checkbox,
174
+ {
175
+ className: `${classBase3}-checkBox`,
176
+ checked: (item == null ? void 0 : item.hidden) !== true,
177
+ disabled: (item == null ? void 0 : item.subscribed) !== true
178
+ }
179
+ )
180
+ ]
181
+ }
182
+ );
183
+ };
184
+ var ColumnList = ({
185
+ columnItems,
186
+ onChange,
187
+ onMoveListItem,
188
+ ...htmlAttributes
189
+ }) => {
190
+ const handleChange = useCallback(
191
+ (evt) => {
192
+ const input = evt.target;
193
+ const listItem = input.closest(`.${classBaseListItem}`);
194
+ const {
195
+ dataset: { name }
196
+ } = listItem;
197
+ if (name) {
198
+ const saltSwitch = input.closest(`.${classBase3}-switch`);
199
+ const saltCheckbox = input.closest(
200
+ `.${classBase3}-checkBox`
201
+ );
202
+ if (saltSwitch) {
203
+ onChange(name, "subscribed", input.checked);
204
+ } else if (saltCheckbox) {
205
+ onChange(name, "hidden", input.checked === false);
206
+ }
207
+ }
208
+ },
209
+ [onChange]
210
+ );
211
+ return /* @__PURE__ */ jsxs3("div", { ...htmlAttributes, className: classBase3, children: [
212
+ /* @__PURE__ */ jsx3("div", { className: `${classBase3}-header`, children: /* @__PURE__ */ jsx3("span", { children: "Column Selection" }) }),
213
+ /* @__PURE__ */ jsxs3("div", { className: `${classBase3}-colHeadings`, children: [
214
+ /* @__PURE__ */ jsx3("span", { children: "Column subscription" }),
215
+ /* @__PURE__ */ jsx3("span", { children: "Visibility" })
216
+ ] }),
217
+ /* @__PURE__ */ jsx3(
218
+ List,
219
+ {
220
+ ListItem: ColumnListItem,
221
+ allowDragDrop: true,
222
+ height: "100%",
223
+ onChange: handleChange,
224
+ onMoveListItem,
225
+ selectionStrategy: "none",
226
+ source: columnItems,
227
+ itemHeight: 33
228
+ }
229
+ )
230
+ ] });
231
+ };
232
+
145
233
  // src/column-expression-input/useColumnExpressionEditor.ts
146
234
  import {
147
235
  autocompletion,
@@ -788,7 +876,7 @@ import {
788
876
  getValue,
789
877
  syntaxTree
790
878
  } from "@vuu-ui/vuu-codemirror";
791
- import { useCallback } from "react";
879
+ import { useCallback as useCallback2 } from "react";
792
880
  var applyPrefix = (completions, prefix) => prefix ? completions.map((completion) => {
793
881
  var _a;
794
882
  return {
@@ -908,7 +996,7 @@ var promptToSave = (context, onSubmit) => {
908
996
  return { from: context.pos, options };
909
997
  };
910
998
  var useColumnAutoComplete = (suggestionProvider, onSubmit) => {
911
- const makeSuggestions2 = useCallback(
999
+ const makeSuggestions2 = useCallback2(
912
1000
  async (context, suggestionType, optionalArgs = {}) => {
913
1001
  const options = await suggestionProvider.getSuggestions(
914
1002
  suggestionType,
@@ -919,7 +1007,7 @@ var useColumnAutoComplete = (suggestionProvider, onSubmit) => {
919
1007
  },
920
1008
  [suggestionProvider]
921
1009
  );
922
- return useCallback(
1010
+ return useCallback2(
923
1011
  async (context) => {
924
1012
  var _a, _b;
925
1013
  const { state, pos } = context;
@@ -1323,8 +1411,8 @@ var useColumnExpressionEditor = ({
1323
1411
  };
1324
1412
 
1325
1413
  // src/column-expression-input/ColumnExpressionInput.tsx
1326
- import { jsx as jsx3 } from "react/jsx-runtime";
1327
- var classBase3 = "vuuColumnExpressionInput";
1414
+ import { jsx as jsx4 } from "react/jsx-runtime";
1415
+ var classBase4 = "vuuColumnExpressionInput";
1328
1416
  var ColumnExpressionInput = ({
1329
1417
  onChange,
1330
1418
  onSubmitExpression,
@@ -1335,7 +1423,7 @@ var ColumnExpressionInput = ({
1335
1423
  onSubmitExpression,
1336
1424
  suggestionProvider
1337
1425
  });
1338
- return /* @__PURE__ */ jsx3("div", { className: `${classBase3}`, ref: editorRef });
1426
+ return /* @__PURE__ */ jsx4("div", { className: `${classBase4}`, ref: editorRef });
1339
1427
  };
1340
1428
 
1341
1429
  // src/column-expression-input/useColumnExpressionSuggestionProvider.ts
@@ -1351,7 +1439,7 @@ import {
1351
1439
  useTypeaheadSuggestions
1352
1440
  } from "@vuu-ui/vuu-data-react";
1353
1441
  import { isNumericColumn, isTextColumn } from "@vuu-ui/vuu-utils";
1354
- import { useCallback as useCallback2, useRef as useRef3 } from "react";
1442
+ import { useCallback as useCallback3, useRef as useRef3 } from "react";
1355
1443
 
1356
1444
  // src/column-expression-input/column-function-descriptors.ts
1357
1445
  var columnFunctionDescriptors = [
@@ -1772,13 +1860,13 @@ var useColumnExpressionSuggestionProvider = ({
1772
1860
  columns,
1773
1861
  table
1774
1862
  }) => {
1775
- const findColumn = useCallback2(
1863
+ const findColumn3 = useCallback3(
1776
1864
  (name) => name ? columns.find((col) => col.name === name) : void 0,
1777
1865
  [columns]
1778
1866
  );
1779
1867
  const latestSuggestionsRef = useRef3();
1780
1868
  const getTypeaheadSuggestions = useTypeaheadSuggestions();
1781
- const getSuggestions = useCallback2(
1869
+ const getSuggestions = useCallback3(
1782
1870
  async (suggestionType, options = NONE) => {
1783
1871
  const { columnName, functionName, operator, prefix } = options;
1784
1872
  switch (suggestionType) {
@@ -1793,18 +1881,18 @@ var useColumnExpressionSuggestionProvider = ({
1793
1881
  return latestSuggestionsRef.current = withApplySpace(suggestions);
1794
1882
  }
1795
1883
  case "operator": {
1796
- const suggestions = await getOperators(findColumn(columnName));
1884
+ const suggestions = await getOperators(findColumn3(columnName));
1797
1885
  return latestSuggestionsRef.current = withApplySpace(suggestions);
1798
1886
  }
1799
1887
  case "relational-operator": {
1800
1888
  const suggestions = await getRelationalOperators(
1801
- findColumn(columnName)
1889
+ findColumn3(columnName)
1802
1890
  );
1803
1891
  return latestSuggestionsRef.current = withApplySpace(suggestions);
1804
1892
  }
1805
1893
  case "condition-operator":
1806
1894
  {
1807
- const column = findColumn(columnName);
1895
+ const column = findColumn3(columnName);
1808
1896
  if (column) {
1809
1897
  const suggestions = await getConditionOperators(column);
1810
1898
  if (suggestions) {
@@ -1841,9 +1929,9 @@ var useColumnExpressionSuggestionProvider = ({
1841
1929
  }
1842
1930
  return [];
1843
1931
  },
1844
- [columns, findColumn, getTypeaheadSuggestions, table]
1932
+ [columns, findColumn3, getTypeaheadSuggestions, table]
1845
1933
  );
1846
- const isPartialMatch = useCallback2(
1934
+ const isPartialMatch = useCallback3(
1847
1935
  async (valueType, columnName, pattern) => {
1848
1936
  const { current: latestSuggestions } = latestSuggestionsRef;
1849
1937
  let maybe = false;
@@ -1868,221 +1956,30 @@ var useColumnExpressionSuggestionProvider = ({
1868
1956
  };
1869
1957
 
1870
1958
  // src/datagrid-configuration-ui/settings-panel/DatagridSettingsPanel.tsx
1871
- import { Button as Button3, Panel as Panel5 } from "@salt-ds/core";
1959
+ import { Button as Button2, Panel as Panel5 } from "@salt-ds/core";
1872
1960
  import cx6 from "classnames";
1873
1961
  import {
1874
1962
  useCallback as useCallback8,
1875
- useState as useState4
1963
+ useState as useState3
1876
1964
  } from "react";
1877
1965
 
1878
- // src/datagrid-configuration-ui/column-picker/ColumnPicker.tsx
1879
- import { List } from "@salt-ds/lab";
1880
- import { Button, Text, useIdMemo as useId } from "@salt-ds/core";
1881
- import { useCallback as useCallback3, useState } from "react";
1882
-
1883
- // src/datagrid-configuration-ui/column-picker/ColumnListItem.tsx
1884
- import { ListItem } from "@salt-ds/lab";
1885
- import cx3 from "classnames";
1886
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1887
- var classBase4 = "vuuColumnListItem";
1888
- var ColumnListItem = ({
1889
- className: classNameProp,
1890
- item,
1891
- label,
1892
- style: styleProp,
1893
- ...restProps
1894
- }) => {
1895
- const className = cx3(classBase4, classNameProp, {
1896
- [`${classBase4}-calculated`]: item == null ? void 0 : item.expression,
1897
- [`${classBase4}-hidden`]: item == null ? void 0 : item.hidden
1898
- });
1899
- return /* @__PURE__ */ jsxs3(ListItem, { className, ...restProps, children: [
1900
- /* @__PURE__ */ jsx4("span", { className: `${classBase4}-iconType` }),
1901
- /* @__PURE__ */ jsx4("label", { className: `${classBase4}-label`, children: label }),
1902
- /* @__PURE__ */ jsx4("span", { className: `${classBase4}-iconHidden` })
1903
- ] });
1904
- };
1905
-
1906
- // src/datagrid-configuration-ui/column-picker/ColumnPicker.tsx
1907
- import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
1908
- var classBase5 = "vuuColumnPicker";
1909
- var removeSelectedColumns = (availableColumns, selectedColumns) => {
1910
- return availableColumns.filter(
1911
- (column) => selectedColumns.find((col) => col.name === column.name) == null
1912
- );
1913
- };
1914
- var ColumnPicker = ({
1915
- availableColumns,
1916
- id: idProp,
1917
- dispatchColumnAction: dispatch,
1918
- onAddCalculatedColumnClick,
1919
- onSelectionChange,
1920
- chosenColumns,
1921
- selectedColumn
1922
- }) => {
1923
- const [selected1, setSelected1] = useState([]);
1924
- const id = useId(idProp);
1925
- const unusedColumns = removeSelectedColumns(availableColumns, chosenColumns);
1926
- const addColumn2 = useCallback3(() => {
1927
- if (selected1.length > 0) {
1928
- setSelected1([]);
1929
- dispatch({ type: "addColumn", columns: selected1 });
1930
- }
1931
- }, [dispatch, selected1]);
1932
- const removeColumn2 = useCallback3(
1933
- () => selectedColumn && dispatch({ type: "removeColumn", column: selectedColumn }),
1934
- [selectedColumn, dispatch]
1935
- );
1936
- const moveColumnUp = useCallback3(
1937
- () => selectedColumn && dispatch({ type: "moveColumn", column: selectedColumn, moveBy: -1 }),
1938
- [dispatch, selectedColumn]
1939
- );
1940
- const moveColumnDown = useCallback3(
1941
- () => selectedColumn && dispatch({ type: "moveColumn", column: selectedColumn, moveBy: 1 }),
1942
- [dispatch, selectedColumn]
1943
- );
1944
- const handleSelectionChange1 = useCallback3(
1945
- (evt, selected) => setSelected1(selected),
1946
- []
1947
- );
1948
- const handleSelectionChange2 = useCallback3(
1949
- (evt, selected) => onSelectionChange == null ? void 0 : onSelectionChange(selected),
1950
- [onSelectionChange]
1951
- );
1952
- return /* @__PURE__ */ jsxs4("div", { className: classBase5, id, children: [
1953
- /* @__PURE__ */ jsxs4("div", { className: `${classBase5}-listColumn`, children: [
1954
- /* @__PURE__ */ jsx5("label", { htmlFor: `available-${id}`, children: /* @__PURE__ */ jsx5(Text, { as: "h4", children: "Available Columns" }) }),
1955
- /* @__PURE__ */ jsx5(
1956
- "div",
1957
- {
1958
- className: `${classBase5}-listContainer`,
1959
- style: { flex: 1, overflow: "hidden" },
1960
- children: /* @__PURE__ */ jsx5(
1961
- List,
1962
- {
1963
- borderless: true,
1964
- checkable: false,
1965
- height: "100%",
1966
- id: `available-${id}`,
1967
- itemHeight: 24,
1968
- itemToString: (item) => item.name,
1969
- onSelectionChange: handleSelectionChange1,
1970
- selected: selected1,
1971
- selectionStrategy: "extended",
1972
- source: unusedColumns
1973
- }
1974
- )
1975
- }
1976
- ),
1977
- /* @__PURE__ */ jsx5(
1978
- "div",
1979
- {
1980
- style: {
1981
- display: "flex",
1982
- alignItems: "center",
1983
- flex: "0 0 32px",
1984
- marginTop: "var(--salt-size-basis-unit)"
1985
- },
1986
- children: /* @__PURE__ */ jsxs4(Button, { onClick: addColumn2, disabled: selected1.length === 0, children: [
1987
- "Show",
1988
- /* @__PURE__ */ jsx5("span", { "data-icon": "arrow-thin-right", style: { marginLeft: 8 } })
1989
- ] })
1990
- }
1991
- )
1992
- ] }),
1993
- /* @__PURE__ */ jsxs4("div", { className: `${classBase5}-listColumn`, children: [
1994
- /* @__PURE__ */ jsx5("label", { htmlFor: `selected-${id}`, children: /* @__PURE__ */ jsx5(Text, { as: "h4", children: "Included Columns" }) }),
1995
- /* @__PURE__ */ jsx5(
1996
- "div",
1997
- {
1998
- className: `${classBase5}-listContainer`,
1999
- style: { flex: 1, overflow: "hidden" },
2000
- children: /* @__PURE__ */ jsx5(
2001
- List,
2002
- {
2003
- ListItem: ColumnListItem,
2004
- borderless: true,
2005
- height: "100%",
2006
- id: `selected-${id}`,
2007
- itemHeight: 24,
2008
- itemToString: (item) => item.name,
2009
- onSelectionChange: handleSelectionChange2,
2010
- selected: selectedColumn,
2011
- style: { flex: 1 },
2012
- source: chosenColumns
2013
- }
2014
- )
2015
- }
2016
- ),
2017
- /* @__PURE__ */ jsxs4(
2018
- "div",
2019
- {
2020
- style: {
2021
- alignItems: "center",
2022
- flex: "0 0 32px",
2023
- display: "flex",
2024
- gap: 6,
2025
- marginTop: "var(--salt-size-basis-unit)"
2026
- },
2027
- children: [
2028
- /* @__PURE__ */ jsxs4(Button, { onClick: removeColumn2, disabled: selectedColumn === null, children: [
2029
- /* @__PURE__ */ jsx5("span", { "data-icon": "arrow-thin-left", style: { marginRight: 8 } }),
2030
- "Hide"
2031
- ] }),
2032
- /* @__PURE__ */ jsx5(
2033
- Button,
2034
- {
2035
- "aria-label": "Move column up",
2036
- onClick: moveColumnUp,
2037
- disabled: selectedColumn === null || (chosenColumns == null ? void 0 : chosenColumns.indexOf(selectedColumn)) === 0,
2038
- style: { width: 28 },
2039
- children: /* @__PURE__ */ jsx5("span", { "data-icon": "arrow-thin-up" })
2040
- }
2041
- ),
2042
- /* @__PURE__ */ jsx5(
2043
- Button,
2044
- {
2045
- "aria-label": "Move column down",
2046
- onClick: moveColumnDown,
2047
- disabled: selectedColumn === null || chosenColumns.indexOf(selectedColumn) === chosenColumns.length - 1,
2048
- style: { width: 28 },
2049
- children: /* @__PURE__ */ jsx5("span", { "data-icon": "arrow-thin-down" })
2050
- }
2051
- ),
2052
- /* @__PURE__ */ jsx5(
2053
- Button,
2054
- {
2055
- "aria-label": "Add calculated column",
2056
- className: `${classBase5}-addCalculatedColumn`,
2057
- onClick: onAddCalculatedColumnClick,
2058
- variant: "primary",
2059
- children: /* @__PURE__ */ jsx5("span", { "data-icon": "add" })
2060
- }
2061
- )
2062
- ]
2063
- }
2064
- )
2065
- ] })
2066
- ] });
2067
- };
2068
-
2069
1966
  // src/datagrid-configuration-ui/column-settings-panel/ColumnSettingsPanel.tsx
2070
1967
  import { Stack } from "@vuu-ui/vuu-layout";
2071
1968
  import { StepperInput as StepperInput2 } from "@salt-ds/lab";
2072
1969
  import {
2073
- Checkbox,
1970
+ Checkbox as Checkbox2,
2074
1971
  FormField as FormField2,
2075
1972
  FormFieldLabel as FormFieldLabel2,
2076
1973
  Input,
2077
1974
  Panel as Panel2,
2078
1975
  RadioButton,
2079
1976
  RadioButtonGroup,
2080
- Text as Text3
1977
+ Text as Text2
2081
1978
  } from "@salt-ds/core";
2082
1979
  import cx5 from "classnames";
2083
1980
  import {
2084
1981
  useCallback as useCallback5,
2085
- useState as useState2
1982
+ useState
2086
1983
  } from "react";
2087
1984
 
2088
1985
  // src/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.tsx
@@ -2093,10 +1990,10 @@ import cx4 from "classnames";
2093
1990
  import { useMemo as useMemo2 } from "react";
2094
1991
 
2095
1992
  // src/datagrid-configuration-ui/column-type-panel/NumericColumnPanel.tsx
2096
- import { StepperInput, Switch } from "@salt-ds/lab";
2097
- import { FormField, FormFieldLabel, Text as Text2 } from "@salt-ds/core";
1993
+ import { StepperInput, Switch as Switch2 } from "@salt-ds/lab";
1994
+ import { FormField, FormFieldLabel, Text } from "@salt-ds/core";
2098
1995
  import { useCallback as useCallback4 } from "react";
2099
- import { Fragment, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
1996
+ import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
2100
1997
  var defaultValues = {
2101
1998
  alignOnDecimals: false,
2102
1999
  decimals: 4,
@@ -2138,60 +2035,58 @@ var NumericColumnPanel = ({
2138
2035
  [dispatchUpdate]
2139
2036
  );
2140
2037
  const handleChangeAlignOnDecimals = useCallback4(
2141
- (evt, value) => dispatchUpdate({ alignOnDecimals: value }),
2038
+ (evt) => dispatchUpdate({ alignOnDecimals: Boolean(evt.target.value) }),
2142
2039
  [dispatchUpdate]
2143
2040
  );
2144
2041
  const handleChangeZeroPad = useCallback4(
2145
- (evt, value) => dispatchUpdate({ zeroPad: value }),
2042
+ (evt) => dispatchUpdate({ zeroPad: Boolean(evt.target.value) }),
2146
2043
  [dispatchUpdate]
2147
2044
  );
2148
2045
  switch (column.serverDataType) {
2149
2046
  case "double":
2150
- return /* @__PURE__ */ jsxs5(Fragment, { children: [
2151
- /* @__PURE__ */ jsxs5(FormField, { labelPlacement: "top", children: [
2152
- /* @__PURE__ */ jsx6(FormFieldLabel, { children: "No of Decimals" }),
2153
- /* @__PURE__ */ jsx6(StepperInput, { value: decimals, onChange: handleChangeDecimals })
2047
+ return /* @__PURE__ */ jsxs4(Fragment, { children: [
2048
+ /* @__PURE__ */ jsxs4(FormField, { labelPlacement: "top", children: [
2049
+ /* @__PURE__ */ jsx5(FormFieldLabel, { children: "No of Decimals" }),
2050
+ /* @__PURE__ */ jsx5(StepperInput, { value: decimals, onChange: handleChangeDecimals })
2154
2051
  ] }),
2155
- /* @__PURE__ */ jsx6(
2156
- Switch,
2052
+ /* @__PURE__ */ jsx5(
2053
+ Switch2,
2157
2054
  {
2158
2055
  checked: alignOnDecimals,
2159
2056
  label: "Align on decimals",
2160
- LabelProps: { className: "vuuColumnPanelSwitch" },
2161
2057
  onChange: handleChangeAlignOnDecimals
2162
2058
  }
2163
2059
  ),
2164
- /* @__PURE__ */ jsx6(
2165
- Switch,
2060
+ /* @__PURE__ */ jsx5(
2061
+ Switch2,
2166
2062
  {
2167
2063
  checked: zeroPad,
2168
2064
  label: "Zero pad",
2169
- LabelProps: { className: "vuuColumnPanelSwitch" },
2170
2065
  onChange: handleChangeZeroPad
2171
2066
  }
2172
2067
  )
2173
2068
  ] });
2174
2069
  case "long":
2175
2070
  case "int":
2176
- return /* @__PURE__ */ jsx6(Fragment, { children: /* @__PURE__ */ jsx6(Text2, { children: "Work in progress" }) });
2071
+ return /* @__PURE__ */ jsx5(Fragment, { children: /* @__PURE__ */ jsx5(Text, { children: "Work in progress" }) });
2177
2072
  default:
2178
2073
  return null;
2179
2074
  }
2180
2075
  };
2181
2076
 
2182
2077
  // src/datagrid-configuration-ui/column-type-panel/StringColumnPanel.tsx
2183
- import { Fragment as Fragment2, jsx as jsx7 } from "react/jsx-runtime";
2078
+ import { Fragment as Fragment2, jsx as jsx6 } from "react/jsx-runtime";
2184
2079
  var StringColumnPanel = ({
2185
2080
  column,
2186
2081
  dispatchColumnAction
2187
2082
  }) => {
2188
2083
  console.log({ column, dispatchColumnAction });
2189
- return /* @__PURE__ */ jsx7(Fragment2, { children: "what" });
2084
+ return /* @__PURE__ */ jsx6(Fragment2, { children: "what" });
2190
2085
  };
2191
2086
 
2192
2087
  // src/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.tsx
2193
- import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
2194
- var classBase6 = "vuuColumnTypePanel";
2088
+ import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
2089
+ var classBase5 = "vuuColumnTypePanel";
2195
2090
  var integerCellRenderers = ["Default Renderer (int, long)"];
2196
2091
  var doubleCellRenderers = ["Default Renderer (double)"];
2197
2092
  var stringCellRenderers = ["Default Renderer (string)"];
@@ -2223,7 +2118,7 @@ var ColumnTypePanel = ({
2223
2118
  case "double":
2224
2119
  case "int":
2225
2120
  case "long":
2226
- return /* @__PURE__ */ jsx8(
2121
+ return /* @__PURE__ */ jsx7(
2227
2122
  NumericColumnPanel,
2228
2123
  {
2229
2124
  column,
@@ -2231,7 +2126,7 @@ var ColumnTypePanel = ({
2231
2126
  }
2232
2127
  );
2233
2128
  default:
2234
- return /* @__PURE__ */ jsx8(
2129
+ return /* @__PURE__ */ jsx7(
2235
2130
  StringColumnPanel,
2236
2131
  {
2237
2132
  column,
@@ -2242,21 +2137,21 @@ var ColumnTypePanel = ({
2242
2137
  }, [column, dispatchColumnAction]);
2243
2138
  const { serverDataType = "string" } = column;
2244
2139
  const availableRenderers = getAvailableCellRenderers(column);
2245
- return /* @__PURE__ */ jsxs6(Fragment3, { children: [
2246
- /* @__PURE__ */ jsx8(
2140
+ return /* @__PURE__ */ jsxs5(Fragment3, { children: [
2141
+ /* @__PURE__ */ jsx7(
2247
2142
  Dropdown,
2248
2143
  {
2249
- className: cx4(`${classBase6}-renderer`),
2144
+ className: cx4(`${classBase5}-renderer`),
2250
2145
  fullWidth: true,
2251
2146
  selected: availableRenderers[0],
2252
2147
  source: availableRenderers
2253
2148
  }
2254
2149
  ),
2255
- /* @__PURE__ */ jsx8(
2150
+ /* @__PURE__ */ jsx7(
2256
2151
  Panel,
2257
2152
  {
2258
2153
  ...props,
2259
- className: cx4(classBase6, className, `${classBase6}-${serverDataType}`),
2154
+ className: cx4(classBase5, className, `${classBase5}-${serverDataType}`),
2260
2155
  children: content
2261
2156
  }
2262
2157
  )
@@ -2264,8 +2159,8 @@ var ColumnTypePanel = ({
2264
2159
  };
2265
2160
 
2266
2161
  // src/datagrid-configuration-ui/column-settings-panel/ColumnSettingsPanel.tsx
2267
- import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
2268
- var classBase7 = "vuuColumnSettingsPanel";
2162
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
2163
+ var classBase6 = "vuuColumnSettingsPanel";
2269
2164
  var tabstripProps = {
2270
2165
  className: "salt-density-high"
2271
2166
  };
@@ -2276,7 +2171,7 @@ var ColumnSettingsPanel = ({
2276
2171
  ...props
2277
2172
  }) => {
2278
2173
  var _a, _b, _c, _d;
2279
- const [activeTab, setActiveTab] = useState2(0);
2174
+ const [activeTab, setActiveTab] = useState(0);
2280
2175
  const dispatchUpdate = useCallback5(
2281
2176
  (values) => dispatchColumnAction({
2282
2177
  type: "updateColumnProp",
@@ -2305,38 +2200,38 @@ var ColumnSettingsPanel = ({
2305
2200
  (value) => dispatchUpdate({ width: parseInt(value.toString(), 10) }),
2306
2201
  [dispatchUpdate]
2307
2202
  );
2308
- return /* @__PURE__ */ jsxs7(
2203
+ return /* @__PURE__ */ jsxs6(
2309
2204
  "div",
2310
2205
  {
2311
- className: classBase7,
2206
+ className: classBase6,
2312
2207
  ...props,
2313
2208
  style: {
2314
2209
  ...styleProp
2315
2210
  },
2316
2211
  children: [
2317
- /* @__PURE__ */ jsx9(Text3, { as: "h4", children: "Column Settings" }),
2318
- /* @__PURE__ */ jsxs7(
2212
+ /* @__PURE__ */ jsx8(Text2, { as: "h4", children: "Column Settings" }),
2213
+ /* @__PURE__ */ jsxs6(
2319
2214
  Stack,
2320
2215
  {
2321
2216
  active: activeTab,
2322
- className: cx5(`${classBase7}-columnTabs`),
2217
+ className: cx5(`${classBase6}-columnTabs`),
2323
2218
  onTabSelectionChanged: setActiveTab,
2324
2219
  TabstripProps: tabstripProps,
2325
2220
  children: [
2326
- /* @__PURE__ */ jsxs7(Panel2, { title: "Column", children: [
2327
- /* @__PURE__ */ jsxs7(FormField2, { labelPlacement: "left", children: [
2328
- /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "Hidden" }),
2329
- /* @__PURE__ */ jsx9(
2330
- Checkbox,
2221
+ /* @__PURE__ */ jsxs6(Panel2, { title: "Column", children: [
2222
+ /* @__PURE__ */ jsxs6(FormField2, { labelPlacement: "left", children: [
2223
+ /* @__PURE__ */ jsx8(FormFieldLabel2, { children: "Hidden" }),
2224
+ /* @__PURE__ */ jsx8(
2225
+ Checkbox2,
2331
2226
  {
2332
2227
  checked: column.hidden === true,
2333
2228
  onChange: handleChangeHidden
2334
2229
  }
2335
2230
  )
2336
2231
  ] }),
2337
- /* @__PURE__ */ jsxs7(FormField2, { labelPlacement: "left", children: [
2338
- /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "Label" }),
2339
- /* @__PURE__ */ jsx9(
2232
+ /* @__PURE__ */ jsxs6(FormField2, { labelPlacement: "left", children: [
2233
+ /* @__PURE__ */ jsx8(FormFieldLabel2, { children: "Label" }),
2234
+ /* @__PURE__ */ jsx8(
2340
2235
  Input,
2341
2236
  {
2342
2237
  value: (_a = column.label) != null ? _a : column.name,
@@ -2344,9 +2239,9 @@ var ColumnSettingsPanel = ({
2344
2239
  }
2345
2240
  )
2346
2241
  ] }),
2347
- /* @__PURE__ */ jsxs7(FormField2, { labelPlacement: "left", children: [
2348
- /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "Width" }),
2349
- /* @__PURE__ */ jsx9(
2242
+ /* @__PURE__ */ jsxs6(FormField2, { labelPlacement: "left", children: [
2243
+ /* @__PURE__ */ jsx8(FormFieldLabel2, { children: "Width" }),
2244
+ /* @__PURE__ */ jsx8(
2350
2245
  StepperInput2,
2351
2246
  {
2352
2247
  value: (_b = column.width) != null ? _b : 100,
@@ -2354,39 +2249,39 @@ var ColumnSettingsPanel = ({
2354
2249
  }
2355
2250
  )
2356
2251
  ] }),
2357
- /* @__PURE__ */ jsxs7(FormField2, { labelPlacement: "left", children: [
2358
- /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "ALign" }),
2359
- /* @__PURE__ */ jsxs7(
2252
+ /* @__PURE__ */ jsxs6(FormField2, { labelPlacement: "left", children: [
2253
+ /* @__PURE__ */ jsx8(FormFieldLabel2, { children: "ALign" }),
2254
+ /* @__PURE__ */ jsxs6(
2360
2255
  RadioButtonGroup,
2361
2256
  {
2362
2257
  "aria-label": "Column Align",
2363
2258
  value: (_c = column.align) != null ? _c : "left",
2364
2259
  onChange: handleChangeAlign,
2365
2260
  children: [
2366
- /* @__PURE__ */ jsx9(RadioButton, { label: "Left", value: "left" }),
2367
- /* @__PURE__ */ jsx9(RadioButton, { label: "Right", value: "right" })
2261
+ /* @__PURE__ */ jsx8(RadioButton, { label: "Left", value: "left" }),
2262
+ /* @__PURE__ */ jsx8(RadioButton, { label: "Right", value: "right" })
2368
2263
  ]
2369
2264
  }
2370
2265
  )
2371
2266
  ] }),
2372
- /* @__PURE__ */ jsxs7(FormField2, { labelPlacement: "left", children: [
2373
- /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "Pin Column" }),
2374
- /* @__PURE__ */ jsxs7(
2267
+ /* @__PURE__ */ jsxs6(FormField2, { labelPlacement: "left", children: [
2268
+ /* @__PURE__ */ jsx8(FormFieldLabel2, { children: "Pin Column" }),
2269
+ /* @__PURE__ */ jsxs6(
2375
2270
  RadioButtonGroup,
2376
2271
  {
2377
2272
  "aria-label": "Pin Column",
2378
2273
  value: (_d = column.pin) != null ? _d : "",
2379
2274
  onChange: handleChangePin,
2380
2275
  children: [
2381
- /* @__PURE__ */ jsx9(RadioButton, { label: "Do not pin", value: "" }),
2382
- /* @__PURE__ */ jsx9(RadioButton, { label: "Left", value: "left" }),
2383
- /* @__PURE__ */ jsx9(RadioButton, { label: "Right", value: "right" })
2276
+ /* @__PURE__ */ jsx8(RadioButton, { label: "Do not pin", value: "" }),
2277
+ /* @__PURE__ */ jsx8(RadioButton, { label: "Left", value: "left" }),
2278
+ /* @__PURE__ */ jsx8(RadioButton, { label: "Right", value: "right" })
2384
2279
  ]
2385
2280
  }
2386
2281
  )
2387
2282
  ] })
2388
2283
  ] }),
2389
- /* @__PURE__ */ jsx9(
2284
+ /* @__PURE__ */ jsx8(
2390
2285
  ColumnTypePanel,
2391
2286
  {
2392
2287
  column,
@@ -2394,14 +2289,14 @@ var ColumnSettingsPanel = ({
2394
2289
  title: "Data Cell"
2395
2290
  }
2396
2291
  ),
2397
- /* @__PURE__ */ jsxs7(Panel2, { title: "Vuu", variant: "secondary", children: [
2398
- /* @__PURE__ */ jsxs7(FormField2, { labelPlacement: "top", readOnly: true, children: [
2399
- /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "Name" }),
2400
- /* @__PURE__ */ jsx9(Input, { value: column.name })
2292
+ /* @__PURE__ */ jsxs6(Panel2, { title: "Vuu", variant: "secondary", children: [
2293
+ /* @__PURE__ */ jsxs6(FormField2, { labelPlacement: "top", readOnly: true, children: [
2294
+ /* @__PURE__ */ jsx8(FormFieldLabel2, { children: "Name" }),
2295
+ /* @__PURE__ */ jsx8(Input, { value: column.name })
2401
2296
  ] }),
2402
- /* @__PURE__ */ jsxs7(FormField2, { labelPlacement: "top", readOnly: true, children: [
2403
- /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "Vuu Type" }),
2404
- /* @__PURE__ */ jsx9(Input, { value: column.serverDataType })
2297
+ /* @__PURE__ */ jsxs6(FormField2, { labelPlacement: "top", readOnly: true, children: [
2298
+ /* @__PURE__ */ jsx8(FormFieldLabel2, { children: "Vuu Type" }),
2299
+ /* @__PURE__ */ jsx8(Input, { value: column.serverDataType })
2405
2300
  ] })
2406
2301
  ] })
2407
2302
  ]
@@ -2419,12 +2314,12 @@ import {
2419
2314
  Panel as Panel3,
2420
2315
  RadioButton as RadioButton2,
2421
2316
  RadioButtonGroup as RadioButtonGroup2,
2422
- Text as Text4
2317
+ Text as Text3
2423
2318
  } from "@salt-ds/core";
2424
2319
  import { StepperInput as StepperInput3 } from "@salt-ds/lab";
2425
2320
  import { useCallback as useCallback6 } from "react";
2426
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
2427
- var classBase8 = "vuuGridSettingsPanel";
2321
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
2322
+ var classBase7 = "vuuGridSettingsPanel";
2428
2323
  var GridSettingsPanel = ({
2429
2324
  config,
2430
2325
  dispatchColumnAction,
@@ -2449,36 +2344,36 @@ var GridSettingsPanel = ({
2449
2344
  (value) => dispatchUpdate({ columnDefaultWidth: parseInt(value.toString(), 10) }),
2450
2345
  [dispatchUpdate]
2451
2346
  );
2452
- return /* @__PURE__ */ jsxs8(
2347
+ return /* @__PURE__ */ jsxs7(
2453
2348
  "div",
2454
2349
  {
2455
- className: classBase8,
2350
+ className: classBase7,
2456
2351
  ...props,
2457
2352
  style: {
2458
2353
  ...styleProp
2459
2354
  },
2460
2355
  children: [
2461
- /* @__PURE__ */ jsx10(Text4, { as: "h4", children: "Grid Settings" }),
2462
- /* @__PURE__ */ jsxs8(Panel3, { children: [
2463
- /* @__PURE__ */ jsxs8(FormField3, { labelPlacement: "left", children: [
2464
- /* @__PURE__ */ jsx10(FormFieldLabel3, { children: "Format column labels" }),
2465
- /* @__PURE__ */ jsxs8(
2356
+ /* @__PURE__ */ jsx9(Text3, { as: "h4", children: "Grid Settings" }),
2357
+ /* @__PURE__ */ jsxs7(Panel3, { children: [
2358
+ /* @__PURE__ */ jsxs7(FormField3, { labelPlacement: "left", children: [
2359
+ /* @__PURE__ */ jsx9(FormFieldLabel3, { children: "Format column labels" }),
2360
+ /* @__PURE__ */ jsxs7(
2466
2361
  RadioButtonGroup2,
2467
2362
  {
2468
2363
  "aria-label": "Format column labels",
2469
2364
  value: config.columnFormatHeader,
2470
2365
  onChange: handleChangeLabelFormatting,
2471
2366
  children: [
2472
- /* @__PURE__ */ jsx10(RadioButton2, { label: "No Formatting", value: void 0 }),
2473
- /* @__PURE__ */ jsx10(RadioButton2, { label: "Capitalize", value: "capitalize" }),
2474
- /* @__PURE__ */ jsx10(RadioButton2, { label: "Uppercase", value: "uppercase" })
2367
+ /* @__PURE__ */ jsx9(RadioButton2, { label: "No Formatting", value: void 0 }),
2368
+ /* @__PURE__ */ jsx9(RadioButton2, { label: "Capitalize", value: "capitalize" }),
2369
+ /* @__PURE__ */ jsx9(RadioButton2, { label: "Uppercase", value: "uppercase" })
2475
2370
  ]
2476
2371
  }
2477
2372
  )
2478
2373
  ] }),
2479
- /* @__PURE__ */ jsxs8(FormField3, { labelPlacement: "left", children: [
2480
- /* @__PURE__ */ jsx10(FormFieldLabel3, { children: "Default Column Width" }),
2481
- /* @__PURE__ */ jsx10(
2374
+ /* @__PURE__ */ jsxs7(FormField3, { labelPlacement: "left", children: [
2375
+ /* @__PURE__ */ jsx9(FormFieldLabel3, { children: "Default Column Width" }),
2376
+ /* @__PURE__ */ jsx9(
2482
2377
  StepperInput3,
2483
2378
  {
2484
2379
  value: (_a = config.columnDefaultWidth) != null ? _a : 100,
@@ -2654,26 +2549,26 @@ import { Stack as Stack2 } from "@vuu-ui/vuu-layout";
2654
2549
 
2655
2550
  // src/datagrid-configuration-ui/calculated-column-panel/CalculatedColumnPanel.tsx
2656
2551
  import {
2657
- Button as Button2,
2552
+ Button,
2658
2553
  FormField as FormField4,
2659
2554
  FormFieldLabel as FormFieldLabel4,
2660
2555
  Input as Input2,
2661
2556
  Panel as Panel4,
2662
- Text as Text5
2557
+ Text as Text4
2663
2558
  } from "@salt-ds/core";
2664
2559
  import {
2665
2560
  useCallback as useCallback7,
2666
2561
  useRef as useRef4,
2667
- useState as useState3
2562
+ useState as useState2
2668
2563
  } from "react";
2669
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
2564
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
2670
2565
  var CalculatedColumnPanel = ({
2671
2566
  columns,
2672
2567
  dispatchColumnAction,
2673
2568
  table
2674
2569
  }) => {
2675
- const [columnName, setColumnName] = useState3("");
2676
- const [, setExpression] = useState3();
2570
+ const [columnName, setColumnName] = useState2("");
2571
+ const [, setExpression] = useState2();
2677
2572
  const sourceRef = useRef4("");
2678
2573
  const suggestionProvider = useColumnExpressionSuggestionProvider({
2679
2574
  columns,
@@ -2709,13 +2604,13 @@ var CalculatedColumnPanel = ({
2709
2604
  });
2710
2605
  }
2711
2606
  }, [columnName, dispatchColumnAction]);
2712
- return /* @__PURE__ */ jsxs9(Panel4, { className: "vuuCalculatedColumnPanel", title: "Define Computed Column", children: [
2713
- /* @__PURE__ */ jsx11(Text5, { styleAs: "h4", children: "Define Computed Column" }),
2714
- /* @__PURE__ */ jsxs9(FormField4, { labelPlacement: "left", children: [
2715
- /* @__PURE__ */ jsx11(FormFieldLabel4, { children: "Column Name" }),
2716
- /* @__PURE__ */ jsx11(Input2, { value: columnName, onChange: handleChangeName })
2607
+ return /* @__PURE__ */ jsxs8(Panel4, { className: "vuuCalculatedColumnPanel", title: "Define Computed Column", children: [
2608
+ /* @__PURE__ */ jsx10(Text4, { styleAs: "h4", children: "Define Computed Column" }),
2609
+ /* @__PURE__ */ jsxs8(FormField4, { labelPlacement: "left", children: [
2610
+ /* @__PURE__ */ jsx10(FormFieldLabel4, { children: "Column Name" }),
2611
+ /* @__PURE__ */ jsx10(Input2, { value: columnName, onChange: handleChangeName })
2717
2612
  ] }),
2718
- /* @__PURE__ */ jsx11(
2613
+ /* @__PURE__ */ jsx10(
2719
2614
  ColumnExpressionInput,
2720
2615
  {
2721
2616
  onChange: handleChangeExpression,
@@ -2723,13 +2618,13 @@ var CalculatedColumnPanel = ({
2723
2618
  suggestionProvider
2724
2619
  }
2725
2620
  ),
2726
- /* @__PURE__ */ jsx11("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsx11(Button2, { onClick: handleSave, children: "Add Column" }) })
2621
+ /* @__PURE__ */ jsx10("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsx10(Button, { onClick: handleSave, children: "Add Column" }) })
2727
2622
  ] });
2728
2623
  };
2729
2624
 
2730
2625
  // src/datagrid-configuration-ui/settings-panel/DatagridSettingsPanel.tsx
2731
- import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
2732
- var classBase9 = "vuuDatagridSettingsPanel";
2626
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
2627
+ var classBase8 = "vuuDatagridSettingsPanel";
2733
2628
  var getTabLabel = () => void 0;
2734
2629
  var icons = [
2735
2630
  "table-settings",
@@ -2748,9 +2643,9 @@ var DatagridSettingsPanel = ({
2748
2643
  }) => {
2749
2644
  var _a;
2750
2645
  console.log(`DatagridSettingsPanel render`);
2751
- const [selectedTabIndex, setSelectedTabIndex] = useState4(0);
2646
+ const [selectedTabIndex, setSelectedTabIndex] = useState3(0);
2752
2647
  const { gridSettings, dispatchColumnAction } = useGridSettings(gridConfig);
2753
- const [selectedColumnName, setSelectedColumnName] = useState4(
2648
+ const [selectedColumnName, setSelectedColumnName] = useState3(
2754
2649
  null
2755
2650
  );
2756
2651
  const handleColumnSelected = useCallback8(
@@ -2774,7 +2669,7 @@ var DatagridSettingsPanel = ({
2774
2669
  [handleApply]
2775
2670
  );
2776
2671
  const selectedColumn = selectedColumnName === null ? null : (_a = gridSettings.columns.find((col) => col.name === selectedColumnName)) != null ? _a : null;
2777
- const tabstripProps3 = {
2672
+ const tabstripProps2 = {
2778
2673
  activeTabIndex: selectedTabIndex,
2779
2674
  allowRenameTab: false,
2780
2675
  orientation: "vertical"
@@ -2784,47 +2679,34 @@ var DatagridSettingsPanel = ({
2784
2679
  []
2785
2680
  );
2786
2681
  const panelShift = selectedTabIndex === 2 ? "right" : void 0;
2787
- return /* @__PURE__ */ jsxs10("div", { ...props, className: cx6(classBase9, className), children: [
2788
- /* @__PURE__ */ jsxs10(
2682
+ return /* @__PURE__ */ jsxs9("div", { ...props, className: cx6(classBase8, className), children: [
2683
+ /* @__PURE__ */ jsxs9(
2789
2684
  Stack2,
2790
2685
  {
2791
- TabstripProps: tabstripProps3,
2792
- className: `${classBase9}-stack`,
2686
+ TabstripProps: tabstripProps2,
2687
+ className: `${classBase8}-stack`,
2793
2688
  getTabIcon,
2794
2689
  getTabLabel,
2795
2690
  active: selectedTabIndex === 2 ? 1 : selectedTabIndex,
2796
2691
  onTabSelectionChanged: handleTabSelectionChanged,
2797
2692
  children: [
2798
- /* @__PURE__ */ jsx12(
2693
+ /* @__PURE__ */ jsx11(
2799
2694
  GridSettingsPanel,
2800
2695
  {
2801
2696
  config: gridSettings,
2802
2697
  dispatchColumnAction
2803
2698
  }
2804
2699
  ),
2805
- /* @__PURE__ */ jsxs10("div", { className: `${classBase9}-columnPanels`, "data-align": panelShift, children: [
2806
- /* @__PURE__ */ jsx12(
2807
- ColumnPicker,
2808
- {
2809
- availableColumns,
2810
- chosenColumns: gridSettings.columns,
2811
- dispatchColumnAction,
2812
- onSelectionChange: handleColumnSelected,
2813
- onAddCalculatedColumnClick: handleAddCalculatedColumn,
2814
- selectedColumn
2815
- }
2816
- ),
2817
- selectedColumn === null ? /* @__PURE__ */ jsx12(Panel5, { className: "vuuColumnSettingsPanel", children: "Select a column" }) : /* @__PURE__ */ jsx12(
2818
- ColumnSettingsPanel,
2819
- {
2820
- column: selectedColumn,
2821
- dispatchColumnAction,
2822
- style: { background: "white", flex: "1 0 150px" }
2823
- }
2824
- )
2825
- ] }),
2826
- /* @__PURE__ */ jsx12("div", { title: "Column Settings", children: "Column Settings" }),
2827
- /* @__PURE__ */ jsx12(
2700
+ /* @__PURE__ */ jsx11("div", { className: `${classBase8}-columnPanels`, "data-align": panelShift, children: selectedColumn === null ? /* @__PURE__ */ jsx11(Panel5, { className: "vuuColumnSettingsPanel", children: "Select a column" }) : /* @__PURE__ */ jsx11(
2701
+ ColumnSettingsPanel,
2702
+ {
2703
+ column: selectedColumn,
2704
+ dispatchColumnAction,
2705
+ style: { background: "white", flex: "1 0 150px" }
2706
+ }
2707
+ ) }),
2708
+ /* @__PURE__ */ jsx11("div", { title: "Column Settings", children: "Column Settings" }),
2709
+ /* @__PURE__ */ jsx11(
2828
2710
  CalculatedColumnPanel,
2829
2711
  {
2830
2712
  columns: gridSettings.columns,
@@ -2835,405 +2717,1012 @@ var DatagridSettingsPanel = ({
2835
2717
  ]
2836
2718
  }
2837
2719
  ),
2838
- /* @__PURE__ */ jsxs10("div", { className: `${classBase9}-buttonBar`, children: [
2839
- /* @__PURE__ */ jsx12(Button3, { onClick: onCancel, children: "Cancel" }),
2840
- /* @__PURE__ */ jsx12(Button3, { onClick: handleApply, children: "Apply" }),
2841
- /* @__PURE__ */ jsx12(Button3, { onClick: handleSave, children: "Save" })
2720
+ /* @__PURE__ */ jsxs9("div", { className: `${classBase8}-buttonBar`, children: [
2721
+ /* @__PURE__ */ jsx11(Button2, { onClick: onCancel, children: "Cancel" }),
2722
+ /* @__PURE__ */ jsx11(Button2, { onClick: handleApply, children: "Apply" }),
2723
+ /* @__PURE__ */ jsx11(Button2, { onClick: handleSave, children: "Save" })
2842
2724
  ] })
2843
2725
  ] });
2844
2726
  };
2845
2727
 
2846
2728
  // src/datasource-stats/DatasourceStats.tsx
2847
- import { useEffect as useEffect3, useState as useState5 } from "react";
2729
+ import { useEffect as useEffect3, useState as useState4 } from "react";
2848
2730
  import cx7 from "classnames";
2849
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
2850
- var classBase10 = "vuuDatasourceStats";
2731
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
2732
+ var classBase9 = "vuuDatasourceStats";
2851
2733
  var numberFormatter = new Intl.NumberFormat();
2852
2734
  var DataSourceStats = ({
2853
2735
  className: classNameProp,
2854
2736
  dataSource
2855
2737
  }) => {
2856
- const [range, setRange] = useState5(dataSource.range);
2857
- const [size, setSize] = useState5(dataSource.size);
2738
+ const [range, setRange] = useState4(dataSource.range);
2739
+ const [size, setSize] = useState4(dataSource.size);
2858
2740
  useEffect3(() => {
2859
2741
  setSize(dataSource.size);
2860
2742
  dataSource.on("resize", setSize);
2861
2743
  dataSource.on("range", setRange);
2862
2744
  }, [dataSource]);
2863
- const className = cx7(classBase10, classNameProp);
2745
+ const className = cx7(classBase9, classNameProp);
2864
2746
  const from = numberFormatter.format(range.from);
2865
2747
  const to = numberFormatter.format(range.to - 1);
2866
2748
  const value = numberFormatter.format(size);
2867
- return /* @__PURE__ */ jsxs11("div", { className, children: [
2868
- /* @__PURE__ */ jsx13("span", { children: "Showing rows" }),
2869
- /* @__PURE__ */ jsx13("span", { className: `${classBase10}-range`, children: from }),
2870
- /* @__PURE__ */ jsx13("span", { className: `${classBase10}-range`, children: to }),
2871
- /* @__PURE__ */ jsx13("span", { children: "of" }),
2872
- /* @__PURE__ */ jsx13("span", { className: `${classBase10}-size`, children: value })
2749
+ return /* @__PURE__ */ jsxs10("div", { className, children: [
2750
+ /* @__PURE__ */ jsx12("span", { children: "Showing rows" }),
2751
+ /* @__PURE__ */ jsx12("span", { className: `${classBase9}-range`, children: from }),
2752
+ /* @__PURE__ */ jsx12("span", { className: `${classBase9}-range`, children: to }),
2753
+ /* @__PURE__ */ jsx12("span", { children: "of" }),
2754
+ /* @__PURE__ */ jsx12("span", { className: `${classBase9}-size`, children: value })
2873
2755
  ] });
2874
2756
  };
2875
2757
 
2876
- // src/table-settings/column-settings-panel/ColumnSettingsPanel.tsx
2877
- import { Stack as Stack3 } from "@vuu-ui/vuu-layout";
2878
- import { StepperInput as StepperInput5 } from "@salt-ds/lab";
2758
+ // src/table-settings/TableSettingsPanel.tsx
2879
2759
  import {
2880
- Checkbox as Checkbox2,
2881
- FormField as FormField6,
2882
- FormFieldLabel as FormFieldLabel6,
2760
+ FormField as FormField5,
2761
+ FormFieldLabel as FormFieldLabel5,
2883
2762
  Input as Input3,
2884
- Panel as Panel7,
2885
- RadioButton as RadioButton3,
2886
- RadioButtonGroup as RadioButtonGroup3,
2887
- Text as Text7
2763
+ ToggleButton,
2764
+ ToggleButtonGroup
2888
2765
  } from "@salt-ds/core";
2766
+
2767
+ // src/table-settings/useTableSettings.ts
2768
+ import { useLayoutEffectSkipFirst as useLayoutEffectSkipFirst2 } from "@vuu-ui/vuu-layout";
2769
+
2770
+ // ../vuu-table/src/table/ColumnResizer.tsx
2771
+ import { useCallback as useCallback9, useRef as useRef5 } from "react";
2772
+ import { jsx as jsx13 } from "react/jsx-runtime";
2773
+
2774
+ // ../vuu-table/src/table/context-menu/buildContextMenuDescriptors.ts
2775
+ import { isNumericColumn as isNumericColumn2 } from "@vuu-ui/vuu-utils";
2776
+
2777
+ // ../vuu-table/src/table/context-menu/useTableContextMenu.ts
2778
+ import { removeColumnFromFilter } from "@vuu-ui/vuu-utils";
2779
+ import {
2780
+ addGroupColumn,
2781
+ addSortColumn,
2782
+ AggregationType,
2783
+ setAggregations,
2784
+ setSortColumn
2785
+ } from "@vuu-ui/vuu-utils";
2786
+ var { Average, Count, Distinct, High, Low, Sum } = AggregationType;
2787
+
2788
+ // ../vuu-table/src/table/Table.tsx
2789
+ import { ContextMenuProvider } from "@vuu-ui/vuu-popups";
2790
+ import { Button as Button3, useIdMemo } from "@salt-ds/core";
2791
+
2792
+ // ../vuu-table/src/table/RowBasedTable.tsx
2793
+ import {
2794
+ buildColumnMap,
2795
+ getColumnStyle as getColumnStyle3,
2796
+ isGroupColumn as isGroupColumn2,
2797
+ metadataKeys as metadataKeys5,
2798
+ notHidden as notHidden2,
2799
+ visibleColumnAtIndex
2800
+ } from "@vuu-ui/vuu-utils";
2801
+ import { useCallback as useCallback16, useMemo as useMemo3 } from "react";
2802
+
2803
+ // ../vuu-table/src/table/TableRow.tsx
2804
+ import {
2805
+ isGroupColumn,
2806
+ isJsonColumn,
2807
+ isJsonGroup,
2808
+ metadataKeys as metadataKeys4,
2809
+ notHidden
2810
+ } from "@vuu-ui/vuu-utils";
2889
2811
  import cx9 from "classnames";
2812
+ import { memo as memo2, useCallback as useCallback12 } from "react";
2813
+
2814
+ // ../vuu-table/src/table/TableCell.tsx
2815
+ import { getColumnStyle, metadataKeys as metadataKeys2 } from "@vuu-ui/vuu-utils";
2816
+ import { EditableLabel } from "@vuu-ui/vuu-ui-controls";
2817
+ import cx8 from "classnames";
2890
2818
  import {
2819
+ memo,
2891
2820
  useCallback as useCallback10,
2892
- useState as useState6
2821
+ useRef as useRef6,
2822
+ useState as useState5
2893
2823
  } from "react";
2824
+ import { jsx as jsx14 } from "react/jsx-runtime";
2825
+ var { KEY: KEY2 } = metadataKeys2;
2826
+ var TableCell = memo(
2827
+ ({
2828
+ className: classNameProp,
2829
+ column,
2830
+ columnMap,
2831
+ onClick,
2832
+ row
2833
+ }) => {
2834
+ const labelFieldRef = useRef6(null);
2835
+ const {
2836
+ align,
2837
+ CellRenderer,
2838
+ key,
2839
+ pin,
2840
+ editable,
2841
+ resizing,
2842
+ valueFormatter
2843
+ } = column;
2844
+ const [editing, setEditing] = useState5(false);
2845
+ const value = valueFormatter(row[key]);
2846
+ const [editableValue, setEditableValue] = useState5(value);
2847
+ const handleTitleMouseDown = () => {
2848
+ var _a;
2849
+ (_a = labelFieldRef.current) == null ? void 0 : _a.focus();
2850
+ };
2851
+ const handleTitleKeyDown = (evt) => {
2852
+ if (evt.key === "Enter") {
2853
+ setEditing(true);
2854
+ }
2855
+ };
2856
+ const handleClick = useCallback10(
2857
+ (evt) => {
2858
+ onClick == null ? void 0 : onClick(evt, column);
2859
+ },
2860
+ [column, onClick]
2861
+ );
2862
+ const handleEnterEditMode = () => {
2863
+ setEditing(true);
2864
+ };
2865
+ const handleExitEditMode = (originalValue = "", finalValue = "", allowDeactivation = true, editCancelled = false) => {
2866
+ var _a;
2867
+ setEditing(false);
2868
+ if (editCancelled) {
2869
+ setEditableValue(originalValue);
2870
+ } else if (finalValue !== originalValue) {
2871
+ setEditableValue(finalValue);
2872
+ }
2873
+ if (allowDeactivation === false) {
2874
+ (_a = labelFieldRef.current) == null ? void 0 : _a.focus();
2875
+ }
2876
+ };
2877
+ const className = cx8(classNameProp, {
2878
+ vuuAlignRight: align === "right",
2879
+ vuuPinFloating: pin === "floating",
2880
+ vuuPinLeft: pin === "left",
2881
+ vuuPinRight: pin === "right",
2882
+ "vuuTableCell-resizing": resizing
2883
+ }) || void 0;
2884
+ const style = getColumnStyle(column);
2885
+ return editable ? /* @__PURE__ */ jsx14(
2886
+ "div",
2887
+ {
2888
+ className,
2889
+ "data-editable": true,
2890
+ role: "cell",
2891
+ style,
2892
+ onKeyDown: handleTitleKeyDown,
2893
+ children: /* @__PURE__ */ jsx14(
2894
+ EditableLabel,
2895
+ {
2896
+ editing,
2897
+ value: editableValue,
2898
+ onChange: setEditableValue,
2899
+ onMouseDownCapture: handleTitleMouseDown,
2900
+ onEnterEditMode: handleEnterEditMode,
2901
+ onExitEditMode: handleExitEditMode,
2902
+ onKeyDown: handleTitleKeyDown,
2903
+ ref: labelFieldRef,
2904
+ tabIndex: 0
2905
+ },
2906
+ "title"
2907
+ )
2908
+ }
2909
+ ) : /* @__PURE__ */ jsx14(
2910
+ "div",
2911
+ {
2912
+ className,
2913
+ role: "cell",
2914
+ style,
2915
+ onClick: handleClick,
2916
+ children: CellRenderer ? /* @__PURE__ */ jsx14(CellRenderer, { column, columnMap, row }) : value
2917
+ }
2918
+ );
2919
+ },
2920
+ cellValuesAreEqual
2921
+ );
2922
+ TableCell.displayName = "TableCell";
2923
+ function cellValuesAreEqual(prev, next) {
2924
+ return prev.column === next.column && prev.onClick === next.onClick && prev.row[KEY2] === next.row[KEY2] && prev.row[prev.column.key] === next.row[next.column.key];
2925
+ }
2894
2926
 
2895
- // src/table-settings/column-type-panel/ColumnTypePanel.tsx
2896
- import { getRegisteredCellRenderers as getRegisteredCellRenderers2 } from "@vuu-ui/vuu-utils";
2897
- import { Dropdown as Dropdown2 } from "@salt-ds/lab";
2898
- import { Panel as Panel6 } from "@salt-ds/core";
2899
- import cx8 from "classnames";
2900
- import { useMemo as useMemo3 } from "react";
2901
-
2902
- // src/table-settings/column-type-panel/NumericColumnPanel.tsx
2903
- import { StepperInput as StepperInput4, Switch as Switch2 } from "@salt-ds/lab";
2927
+ // ../vuu-table/src/table/TableGroupCell.tsx
2904
2928
  import {
2905
- FormField as FormField5,
2906
- FormFieldLabel as FormFieldLabel5,
2907
- Text as Text6
2908
- } from "@salt-ds/core";
2909
- import { useCallback as useCallback9 } from "react";
2910
- import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
2911
- var defaultValues2 = {
2912
- alignOnDecimals: false,
2913
- decimals: 4,
2914
- zeroPad: false
2915
- };
2916
- var getColumnValues2 = (columnType, gridDefaultValues) => {
2917
- const columnValue = typeof columnType === "object" && columnType.formatting ? columnType.formatting : {};
2918
- const properties = ["alignOnDecimals", "decimals", "zeroPad"];
2919
- return properties.reduce((configValues, property) => {
2920
- if (columnValue[property] !== void 0) {
2921
- return {
2922
- ...configValues,
2923
- [property]: columnValue[property]
2924
- };
2925
- } else if ((gridDefaultValues == null ? void 0 : gridDefaultValues[property]) !== void 0) {
2926
- return {
2927
- ...configValues,
2928
- [property]: gridDefaultValues[property]
2929
- };
2929
+ getColumnStyle as getColumnStyle2,
2930
+ getGroupValueAndOffset,
2931
+ metadataKeys as metadataKeys3
2932
+ } from "@vuu-ui/vuu-utils";
2933
+ import { useCallback as useCallback11 } from "react";
2934
+ import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
2935
+ var { IS_LEAF } = metadataKeys3;
2936
+ var TableGroupCell = ({ column, onClick, row }) => {
2937
+ const { columns } = column;
2938
+ const [value, offset] = getGroupValueAndOffset(columns, row);
2939
+ const handleClick = useCallback11(
2940
+ (evt) => {
2941
+ onClick == null ? void 0 : onClick(evt, column);
2942
+ },
2943
+ [column, onClick]
2944
+ );
2945
+ const style = getColumnStyle2(column);
2946
+ const isLeaf = row[IS_LEAF];
2947
+ const spacers = Array(offset).fill(0).map((n, i) => /* @__PURE__ */ jsx15("span", { className: "vuuTableGroupCell-spacer" }, i));
2948
+ return /* @__PURE__ */ jsxs11(
2949
+ "div",
2950
+ {
2951
+ className: "vuuTableGroupCell vuuPinLeft",
2952
+ onClick: isLeaf ? void 0 : handleClick,
2953
+ role: "cell",
2954
+ style,
2955
+ children: [
2956
+ spacers,
2957
+ isLeaf ? null : /* @__PURE__ */ jsx15("span", { className: "vuuTableGroupCell-toggle", "data-icon": "triangle-right" }),
2958
+ /* @__PURE__ */ jsx15("span", { children: value })
2959
+ ]
2930
2960
  }
2931
- return configValues;
2932
- }, defaultValues2);
2933
- };
2934
- var NumericColumnPanel2 = ({
2935
- column,
2936
- dispatchColumnAction
2937
- }) => {
2938
- const { decimals, alignOnDecimals, zeroPad } = getColumnValues2(column == null ? void 0 : column.type);
2939
- const dispatchUpdate = useCallback9(
2940
- (values) => dispatchColumnAction({
2941
- type: "updateColumnTypeFormatting",
2942
- column,
2943
- ...values
2944
- }),
2945
- [column, dispatchColumnAction]
2946
2961
  );
2947
- const handleChangeDecimals = useCallback9(
2948
- (value) => dispatchUpdate({ decimals: parseInt(value.toString(), 10) }),
2949
- [dispatchUpdate]
2962
+ };
2963
+
2964
+ // ../vuu-table/src/table/TableRow.tsx
2965
+ import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
2966
+ var { IDX, IS_EXPANDED, SELECTED } = metadataKeys4;
2967
+ var classBase10 = "vuuTableRow";
2968
+ var TableRow = memo2(function Row({
2969
+ columnMap,
2970
+ columns,
2971
+ offset,
2972
+ onClick,
2973
+ onToggleGroup,
2974
+ virtualColSpan = 0,
2975
+ row
2976
+ }) {
2977
+ const {
2978
+ [IDX]: rowIndex,
2979
+ [IS_EXPANDED]: isExpanded,
2980
+ [SELECTED]: isSelected
2981
+ } = row;
2982
+ const className = cx9(classBase10, {
2983
+ [`${classBase10}-even`]: rowIndex % 2 === 0,
2984
+ [`${classBase10}-expanded`]: isExpanded,
2985
+ [`${classBase10}-preSelected`]: isSelected === 2
2986
+ });
2987
+ const handleRowClick = useCallback12(
2988
+ (evt) => {
2989
+ const rangeSelect = evt.shiftKey;
2990
+ const keepExistingSelection = evt.ctrlKey || evt.metaKey;
2991
+ onClick == null ? void 0 : onClick(row, rangeSelect, keepExistingSelection);
2992
+ },
2993
+ [onClick, row]
2950
2994
  );
2951
- const handleChangeAlignOnDecimals = useCallback9(
2952
- (evt, value) => dispatchUpdate({ alignOnDecimals: value }),
2953
- [dispatchUpdate]
2995
+ const handleGroupCellClick = useCallback12(
2996
+ (evt, column) => {
2997
+ if (isGroupColumn(column) || isJsonGroup(column, row)) {
2998
+ evt.stopPropagation();
2999
+ onToggleGroup == null ? void 0 : onToggleGroup(row, column);
3000
+ }
3001
+ },
3002
+ [onToggleGroup, row]
2954
3003
  );
2955
- const handleChangeZeroPad = useCallback9(
2956
- (evt, value) => dispatchUpdate({ zeroPad: value }),
2957
- [dispatchUpdate]
3004
+ return /* @__PURE__ */ jsxs12(
3005
+ "div",
3006
+ {
3007
+ "aria-selected": isSelected === 1 ? true : void 0,
3008
+ "aria-rowindex": rowIndex,
3009
+ className,
3010
+ onClick: handleRowClick,
3011
+ role: "row",
3012
+ style: {
3013
+ transform: `translate3d(0px, ${offset}px, 0px)`
3014
+ },
3015
+ children: [
3016
+ virtualColSpan > 0 ? /* @__PURE__ */ jsx16("div", { role: "cell", style: { width: virtualColSpan } }) : null,
3017
+ columns.filter(notHidden).map((column) => {
3018
+ const isGroup = isGroupColumn(column);
3019
+ const isJsonCell = isJsonColumn(column);
3020
+ const Cell = isGroup ? TableGroupCell : TableCell;
3021
+ return /* @__PURE__ */ jsx16(
3022
+ Cell,
3023
+ {
3024
+ column,
3025
+ columnMap,
3026
+ onClick: isGroup || isJsonCell ? handleGroupCellClick : void 0,
3027
+ row
3028
+ },
3029
+ column.name
3030
+ );
3031
+ })
3032
+ ]
3033
+ }
2958
3034
  );
2959
- switch (column.serverDataType) {
2960
- case "double":
2961
- return /* @__PURE__ */ jsxs12(Fragment4, { children: [
2962
- /* @__PURE__ */ jsxs12(FormField5, { labelPlacement: "top", children: [
2963
- /* @__PURE__ */ jsx14(FormFieldLabel5, { children: "No of Decimals" }),
2964
- /* @__PURE__ */ jsx14(StepperInput4, { value: decimals, onChange: handleChangeDecimals })
2965
- ] }),
2966
- /* @__PURE__ */ jsx14(
2967
- Switch2,
2968
- {
2969
- checked: alignOnDecimals,
2970
- label: "Align on decimals",
2971
- LabelProps: { className: "vuuColumnPanelSwitch" },
2972
- onChange: handleChangeAlignOnDecimals
2973
- }
2974
- ),
2975
- /* @__PURE__ */ jsx14(
2976
- Switch2,
2977
- {
2978
- checked: zeroPad,
2979
- label: "Zero pad",
2980
- LabelProps: { className: "vuuColumnPanelSwitch" },
2981
- onChange: handleChangeZeroPad
2982
- }
2983
- )
2984
- ] });
2985
- case "long":
2986
- case "int":
2987
- return /* @__PURE__ */ jsx14(Fragment4, { children: /* @__PURE__ */ jsx14(Text6, { children: "Work in progress" }) });
2988
- default:
2989
- return null;
2990
- }
2991
- };
3035
+ });
2992
3036
 
2993
- // src/table-settings/column-type-panel/StringColumnPanel.tsx
2994
- import { Fragment as Fragment5, jsx as jsx15 } from "react/jsx-runtime";
2995
- var StringColumnPanel2 = ({
2996
- column,
2997
- dispatchColumnAction
2998
- }) => {
2999
- console.log(column, dispatchColumnAction);
3000
- return /* @__PURE__ */ jsx15(Fragment5, { children: "what" });
3001
- };
3002
-
3003
- // src/table-settings/column-type-panel/ColumnTypePanel.tsx
3004
- import { Fragment as Fragment6, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
3005
- var classBase11 = "vuuColumnTypePanel";
3006
- var integerCellRenderers2 = ["Default Renderer (int, long)"];
3007
- var doubleCellRenderers2 = ["Default Renderer (double)"];
3008
- var stringCellRenderers2 = ["Default Renderer (string)"];
3009
- var getAvailableCellRenderers2 = (column) => {
3010
- const customCellRenderers = getRegisteredCellRenderers2(column.serverDataType);
3011
- const customRendererNames = customCellRenderers.map((r) => r.name);
3012
- console.log({ customRendererNames });
3013
- switch (column.serverDataType) {
3014
- case "char":
3015
- case "string":
3016
- return stringCellRenderers2;
3017
- case "int":
3018
- case "long":
3019
- return integerCellRenderers2;
3020
- case "double":
3021
- return doubleCellRenderers2.concat(customRendererNames);
3022
- default:
3023
- return stringCellRenderers2;
3037
+ // ../vuu-table/src/table/TableGroupHeaderCell.tsx
3038
+ import cx10 from "classnames";
3039
+ import { useRef as useRef8 } from "react";
3040
+
3041
+ // ../vuu-table/src/table/useTableColumnResize.tsx
3042
+ import { useCallback as useCallback13, useRef as useRef7 } from "react";
3043
+
3044
+ // ../vuu-table/src/table/TableGroupHeaderCell.tsx
3045
+ import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
3046
+
3047
+ // ../vuu-table/src/table/TableHeaderCell.tsx
3048
+ import cx13 from "classnames";
3049
+ import { useCallback as useCallback15, useRef as useRef9 } from "react";
3050
+
3051
+ // ../vuu-table/src/table/SortIndicator.tsx
3052
+ import cx11 from "classnames";
3053
+
3054
+ // ../vuu-table/src/table/TableHeaderCell.tsx
3055
+ import { useContextMenu as useContextMenu2 } from "@vuu-ui/vuu-popups";
3056
+
3057
+ // ../vuu-table/src/table/filter-indicator.tsx
3058
+ import { useContextMenu } from "@vuu-ui/vuu-popups";
3059
+ import cx12 from "classnames";
3060
+ import { useCallback as useCallback14 } from "react";
3061
+ import { jsx as jsx18 } from "react/jsx-runtime";
3062
+
3063
+ // ../vuu-table/src/table/TableHeaderCell.tsx
3064
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
3065
+
3066
+ // ../vuu-table/src/table/RowBasedTable.tsx
3067
+ import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
3068
+ var { RENDER_IDX } = metadataKeys5;
3069
+
3070
+ // ../vuu-table/src/table/useTable.ts
3071
+ import { useContextMenu as usePopupContextMenu } from "@vuu-ui/vuu-popups";
3072
+ import {
3073
+ applySort,
3074
+ buildColumnMap as buildColumnMap2,
3075
+ isJsonGroup as isJsonGroup2,
3076
+ metadataKeys as metadataKeys9,
3077
+ moveItem as moveItem3
3078
+ } from "@vuu-ui/vuu-utils";
3079
+ import {
3080
+ useCallback as useCallback26,
3081
+ useEffect as useEffect8,
3082
+ useMemo as useMemo9,
3083
+ useRef as useRef19,
3084
+ useState as useState9
3085
+ } from "react";
3086
+
3087
+ // ../vuu-table/src/table/useDataSource.ts
3088
+ import {
3089
+ isVuuFeatureAction,
3090
+ isVuuFeatureInvocation
3091
+ } from "@vuu-ui/vuu-data-react";
3092
+ import { getFullRange, metadataKeys as metadataKeys6, WindowRange } from "@vuu-ui/vuu-utils";
3093
+ import { useCallback as useCallback17, useEffect as useEffect4, useMemo as useMemo4, useRef as useRef10, useState as useState6 } from "react";
3094
+ var { SELECTED: SELECTED2 } = metadataKeys6;
3095
+
3096
+ // ../vuu-table/src/table/useDraggableColumn.ts
3097
+ import { useDragDropNext as useDragDrop } from "@vuu-ui/vuu-ui-controls";
3098
+ import { useCallback as useCallback18, useRef as useRef11 } from "react";
3099
+
3100
+ // ../vuu-table/src/table/useKeyboardNavigation.ts
3101
+ import { withinRange } from "@vuu-ui/vuu-utils";
3102
+ import {
3103
+ useCallback as useCallback19,
3104
+ useEffect as useEffect5,
3105
+ useLayoutEffect,
3106
+ useMemo as useMemo5,
3107
+ useRef as useRef12
3108
+ } from "react";
3109
+
3110
+ // ../vuu-table/src/table/keyUtils.ts
3111
+ function union(set1, ...sets) {
3112
+ const result = new Set(set1);
3113
+ for (let set of sets) {
3114
+ for (let element of set) {
3115
+ result.add(element);
3116
+ }
3024
3117
  }
3025
- };
3026
- var ColumnTypePanel2 = ({
3027
- className,
3028
- column,
3029
- dispatchColumnAction,
3030
- ...props
3031
- }) => {
3032
- const content = useMemo3(() => {
3033
- switch (column.serverDataType) {
3034
- case "double":
3035
- case "int":
3036
- case "long":
3037
- return /* @__PURE__ */ jsx16(
3038
- NumericColumnPanel2,
3039
- {
3040
- column,
3041
- dispatchColumnAction
3042
- }
3043
- );
3044
- default:
3045
- return /* @__PURE__ */ jsx16(
3046
- StringColumnPanel2,
3047
- {
3048
- column,
3049
- dispatchColumnAction
3050
- }
3118
+ return result;
3119
+ }
3120
+ var ArrowUp = "ArrowUp";
3121
+ var ArrowDown = "ArrowDown";
3122
+ var ArrowLeft = "ArrowLeft";
3123
+ var ArrowRight = "ArrowRight";
3124
+ var Home = "Home";
3125
+ var End = "End";
3126
+ var PageUp = "PageUp";
3127
+ var PageDown = "PageDown";
3128
+ var actionKeys = /* @__PURE__ */ new Set(["Enter", "Delete", " "]);
3129
+ var focusKeys = /* @__PURE__ */ new Set(["Tab"]);
3130
+ var arrowLeftRightKeys = /* @__PURE__ */ new Set(["ArrowRight", "ArrowLeft"]);
3131
+ var navigationKeys = /* @__PURE__ */ new Set([
3132
+ Home,
3133
+ End,
3134
+ PageUp,
3135
+ PageDown,
3136
+ ArrowDown,
3137
+ ArrowLeft,
3138
+ ArrowRight,
3139
+ ArrowUp
3140
+ ]);
3141
+ var functionKeys = /* @__PURE__ */ new Set([
3142
+ "F1",
3143
+ "F2",
3144
+ "F3",
3145
+ "F4",
3146
+ "F5",
3147
+ "F6",
3148
+ "F7",
3149
+ "F8",
3150
+ "F9",
3151
+ "F10",
3152
+ "F11",
3153
+ "F12"
3154
+ ]);
3155
+ var specialKeys = union(
3156
+ actionKeys,
3157
+ navigationKeys,
3158
+ arrowLeftRightKeys,
3159
+ functionKeys,
3160
+ focusKeys
3161
+ );
3162
+
3163
+ // ../vuu-table/src/table/useMeasuredContainer.ts
3164
+ import { isValidNumber as isValidNumber2 } from "@vuu-ui/vuu-utils";
3165
+ import { useCallback as useCallback21, useMemo as useMemo6, useRef as useRef14, useState as useState7 } from "react";
3166
+
3167
+ // ../vuu-table/src/table/useResizeObserver.ts
3168
+ import { useCallback as useCallback20, useEffect as useEffect6, useRef as useRef13 } from "react";
3169
+ var observedMap = /* @__PURE__ */ new Map();
3170
+ var getTargetSize = (element, size, dimension) => {
3171
+ switch (dimension) {
3172
+ case "height":
3173
+ return size.height;
3174
+ case "clientHeight":
3175
+ return element.clientHeight;
3176
+ case "clientWidth":
3177
+ return element.clientWidth;
3178
+ case "contentHeight":
3179
+ return size.contentHeight;
3180
+ case "contentWidth":
3181
+ return size.contentWidth;
3182
+ case "scrollHeight":
3183
+ return Math.ceil(element.scrollHeight);
3184
+ case "scrollWidth":
3185
+ return Math.ceil(element.scrollWidth);
3186
+ case "width":
3187
+ return size.width;
3188
+ default:
3189
+ return 0;
3190
+ }
3191
+ };
3192
+ var resizeObserver = new ResizeObserver((entries) => {
3193
+ for (const entry of entries) {
3194
+ const { target, borderBoxSize, contentBoxSize } = entry;
3195
+ const observedTarget = observedMap.get(target);
3196
+ if (observedTarget) {
3197
+ const [{ blockSize: height, inlineSize: width }] = borderBoxSize;
3198
+ const [{ blockSize: contentHeight, inlineSize: contentWidth }] = contentBoxSize;
3199
+ const { onResize, measurements } = observedTarget;
3200
+ let sizeChanged = false;
3201
+ for (const [dimension, size] of Object.entries(measurements)) {
3202
+ const newSize = getTargetSize(
3203
+ target,
3204
+ { height, width, contentHeight, contentWidth },
3205
+ dimension
3051
3206
  );
3052
- }
3053
- }, [column, dispatchColumnAction]);
3054
- const { serverDataType = "string" } = column;
3055
- const availableRenderers = getAvailableCellRenderers2(column);
3056
- return /* @__PURE__ */ jsxs13(Fragment6, { children: [
3057
- /* @__PURE__ */ jsx16(
3058
- Dropdown2,
3059
- {
3060
- className: cx8(`${classBase11}-renderer`),
3061
- fullWidth: true,
3062
- selected: availableRenderers[0],
3063
- source: availableRenderers
3207
+ if (newSize !== size) {
3208
+ sizeChanged = true;
3209
+ measurements[dimension] = newSize;
3210
+ }
3064
3211
  }
3065
- ),
3066
- /* @__PURE__ */ jsx16(
3067
- Panel6,
3068
- {
3069
- ...props,
3070
- className: cx8(classBase11, className, `${classBase11}-${serverDataType}`),
3071
- children: content
3212
+ if (sizeChanged) {
3213
+ onResize && onResize(measurements);
3072
3214
  }
3073
- )
3074
- ] });
3215
+ }
3216
+ }
3217
+ });
3218
+
3219
+ // ../vuu-table/src/table/useSelection.ts
3220
+ import {
3221
+ deselectItem,
3222
+ isRowSelected,
3223
+ metadataKeys as metadataKeys7,
3224
+ selectItem
3225
+ } from "@vuu-ui/vuu-utils";
3226
+ import { useCallback as useCallback22, useRef as useRef15 } from "react";
3227
+ var { IDX: IDX2 } = metadataKeys7;
3228
+
3229
+ // ../vuu-table/src/table/useTableModel.ts
3230
+ import {
3231
+ applyFilterToColumns,
3232
+ applyGroupByToColumns,
3233
+ applySortToColumns,
3234
+ findColumn,
3235
+ getCellRenderer,
3236
+ getColumnName as getColumnName2,
3237
+ getTableHeadings,
3238
+ getValueFormatter,
3239
+ isFilteredColumn,
3240
+ isGroupColumn as isGroupColumn3,
3241
+ isPinned,
3242
+ isTypeDescriptor as isTypeDescriptor4,
3243
+ metadataKeys as metadataKeys8,
3244
+ updateColumn,
3245
+ sortPinnedColumns,
3246
+ stripFilterFromColumns,
3247
+ moveItem as moveItem2
3248
+ } from "@vuu-ui/vuu-utils";
3249
+ import { useReducer as useReducer2 } from "react";
3250
+ var KEY_OFFSET = metadataKeys8.count;
3251
+
3252
+ // ../vuu-table/src/table/useTableScroll.ts
3253
+ import { useCallback as useCallback23, useRef as useRef16 } from "react";
3254
+
3255
+ // ../vuu-table/src/table/useTableViewport.ts
3256
+ import { useCallback as useCallback24, useMemo as useMemo7, useRef as useRef17 } from "react";
3257
+ import {
3258
+ actualRowPositioning,
3259
+ virtualRowPositioning
3260
+ } from "@vuu-ui/vuu-utils";
3261
+
3262
+ // ../vuu-table/src/table/useVirtualViewport.ts
3263
+ import {
3264
+ getColumnsInViewport,
3265
+ itemsChanged
3266
+ } from "@vuu-ui/vuu-utils";
3267
+ import { useCallback as useCallback25, useEffect as useEffect7, useMemo as useMemo8, useRef as useRef18, useState as useState8 } from "react";
3268
+
3269
+ // ../vuu-table/src/table/useTable.ts
3270
+ var { KEY: KEY3, IS_EXPANDED: IS_EXPANDED2, IS_LEAF: IS_LEAF2 } = metadataKeys9;
3271
+
3272
+ // ../vuu-table/src/table/Table.tsx
3273
+ import cx14 from "classnames";
3274
+ import { isDataLoading } from "@vuu-ui/vuu-utils";
3275
+ import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
3276
+
3277
+ // ../vuu-table/src/table/cell-renderers/json-cell/JsonCell.tsx
3278
+ import cx15 from "classnames";
3279
+ import {
3280
+ isJsonAttribute,
3281
+ metadataKeys as metadataKeys10,
3282
+ registerComponent as registerComponent3
3283
+ } from "@vuu-ui/vuu-utils";
3284
+ import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
3285
+ var classBase11 = "vuuJsonCell";
3286
+ var { IS_EXPANDED: IS_EXPANDED3, KEY: KEY4 } = metadataKeys10;
3287
+ var localKey = (key) => {
3288
+ const pos = key.lastIndexOf("|");
3289
+ if (pos === -1) {
3290
+ return "";
3291
+ } else {
3292
+ return key.slice(pos + 1);
3293
+ }
3294
+ };
3295
+ var JsonCell = ({ column, row }) => {
3296
+ const {
3297
+ key: columnKey
3298
+ /*, type, valueFormatter */
3299
+ } = column;
3300
+ let value = row[columnKey];
3301
+ let isToggle = false;
3302
+ if (isJsonAttribute(value)) {
3303
+ value = value.slice(0, -1);
3304
+ isToggle = true;
3305
+ }
3306
+ const rowKey = localKey(row[KEY4]);
3307
+ const className = cx15({
3308
+ [`${classBase11}-name`]: rowKey === value,
3309
+ [`${classBase11}-value`]: rowKey !== value,
3310
+ [`${classBase11}-group`]: isToggle
3311
+ });
3312
+ if (isToggle) {
3313
+ const toggleIcon = row[IS_EXPANDED3] ? "minus-box" : "plus-box";
3314
+ return /* @__PURE__ */ jsxs17("span", { className, children: [
3315
+ /* @__PURE__ */ jsx22("span", { className: `${classBase11}-value`, children: value }),
3316
+ /* @__PURE__ */ jsx22("span", { className: `${classBase11}-toggle`, "data-icon": toggleIcon })
3317
+ ] });
3318
+ } else if (value) {
3319
+ return /* @__PURE__ */ jsx22("span", { className, children: value });
3320
+ } else {
3321
+ return null;
3322
+ }
3075
3323
  };
3324
+ registerComponent3("json", JsonCell, "cell-renderer", {});
3076
3325
 
3077
- // src/table-settings/column-settings-panel/ColumnSettingsPanel.tsx
3078
- import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
3079
- var classBase12 = "vuuColumnSettingsPanel";
3080
- var tabstripProps2 = {
3081
- className: "salt-density-high"
3326
+ // ../vuu-table/src/table-next/TableNext.tsx
3327
+ import { ContextMenuProvider as ContextMenuProvider2 } from "@vuu-ui/vuu-popups";
3328
+ import { metadataKeys as metadataKeys14, notHidden as notHidden4 } from "@vuu-ui/vuu-utils";
3329
+
3330
+ // ../vuu-table/src/table-next/HeaderCell.tsx
3331
+ import { useCallback as useCallback30, useRef as useRef23 } from "react";
3332
+
3333
+ // ../vuu-table/src/table-next/useCell.ts
3334
+ import { getColumnStyle as getColumnStyle4 } from "@vuu-ui/vuu-utils";
3335
+ import cx16 from "classnames";
3336
+ import { useMemo as useMemo10 } from "react";
3337
+ var useCell = (column, classBase14, isHeader) => (
3338
+ // TODO measure perf without the memo, might not be worth the cost
3339
+ useMemo10(() => {
3340
+ const className = cx16(classBase14, {
3341
+ vuuPinFloating: column.pin === "floating",
3342
+ vuuPinLeft: column.pin === "left",
3343
+ vuuPinRight: column.pin === "right",
3344
+ vuuEndPin: isHeader && column.endPin,
3345
+ [`${classBase14}-resizing`]: column.resizing,
3346
+ [`${classBase14}-right`]: column.align === "right"
3347
+ });
3348
+ const style = getColumnStyle4(column);
3349
+ return {
3350
+ className,
3351
+ style
3352
+ };
3353
+ }, [column, classBase14, isHeader])
3354
+ );
3355
+
3356
+ // ../vuu-table/src/table-next/ColumnMenu.tsx
3357
+ import { useContextMenu as useContextMenu3 } from "@vuu-ui/vuu-popups";
3358
+ import cx17 from "classnames";
3359
+ import {
3360
+ useCallback as useCallback27,
3361
+ useRef as useRef20,
3362
+ useState as useState10
3363
+ } from "react";
3364
+ import { jsx as jsx23 } from "react/jsx-runtime";
3365
+
3366
+ // ../vuu-table/src/table-next/column-resizing/ColumnResizer.tsx
3367
+ import { useCallback as useCallback28, useRef as useRef21 } from "react";
3368
+ import { jsx as jsx24 } from "react/jsx-runtime";
3369
+
3370
+ // ../vuu-table/src/table-next/column-resizing/useTableColumnResize.tsx
3371
+ import { useCallback as useCallback29, useRef as useRef22 } from "react";
3372
+
3373
+ // ../vuu-table/src/table-next/HeaderCell.tsx
3374
+ import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
3375
+
3376
+ // ../vuu-table/src/table-next/Row.tsx
3377
+ import {
3378
+ isGroupColumn as isGroupColumn4,
3379
+ metadataKeys as metadataKeys12,
3380
+ notHidden as notHidden3,
3381
+ RowSelected
3382
+ } from "@vuu-ui/vuu-utils";
3383
+ import cx18 from "classnames";
3384
+ import { memo as memo3, useCallback as useCallback32 } from "react";
3385
+
3386
+ // ../vuu-table/src/table-next/TableCell.tsx
3387
+ import { jsx as jsx26 } from "react/jsx-runtime";
3388
+ var TableCell2 = ({ column, row }) => {
3389
+ const { className, style } = useCell(column, "vuuTableNextCell");
3390
+ return /* @__PURE__ */ jsx26("div", { className, role: "cell", style, children: row[column.key] });
3082
3391
  };
3083
- var ColumnSettingsPanel2 = ({
3084
- column,
3085
- dispatchColumnAction,
3086
- style: styleProp,
3087
- ...props
3088
- }) => {
3089
- var _a, _b, _c, _d;
3090
- const [activeTab, setActiveTab] = useState6(0);
3091
- const dispatchUpdate = useCallback10(
3092
- (values) => dispatchColumnAction({
3093
- type: "updateColumnProp",
3094
- column,
3095
- ...values
3096
- }),
3097
- [column, dispatchColumnAction]
3098
- );
3099
- const handleChangeAlign = useCallback10(
3100
- (evt) => dispatchUpdate({ align: evt.target.value }),
3101
- [dispatchUpdate]
3102
- );
3103
- const handleChangePin = useCallback10(
3104
- (evt) => dispatchUpdate({ pin: evt.target.value }),
3105
- [dispatchUpdate]
3106
- );
3107
- const handleChangeHidden = useCallback10(
3108
- (evt) => dispatchUpdate({ hidden: evt.target.checked }),
3109
- [dispatchUpdate]
3110
- );
3111
- const handleChangeLabel = useCallback10(
3112
- (evt) => dispatchUpdate({ label: evt.target.value }),
3113
- [dispatchUpdate]
3114
- );
3115
- const handleChangeWidth = useCallback10(
3116
- (value) => dispatchUpdate({ width: parseInt(value.toString(), 10) }),
3117
- [dispatchUpdate]
3392
+
3393
+ // ../vuu-table/src/table-next/TableGroupCell.tsx
3394
+ import { getGroupValueAndOffset as getGroupValueAndOffset2, metadataKeys as metadataKeys11 } from "@vuu-ui/vuu-utils";
3395
+ import { useCallback as useCallback31 } from "react";
3396
+ import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
3397
+ var { IS_LEAF: IS_LEAF3 } = metadataKeys11;
3398
+ var TableGroupCell2 = ({ column, onClick, row }) => {
3399
+ const { columns } = column;
3400
+ const [value, offset] = getGroupValueAndOffset2(columns, row);
3401
+ const { className, style } = useCell(column, "vuuTable2-groupCell");
3402
+ const handleClick = useCallback31(
3403
+ (evt) => {
3404
+ onClick == null ? void 0 : onClick(evt, column);
3405
+ },
3406
+ [column, onClick]
3118
3407
  );
3119
- return /* @__PURE__ */ jsxs14(
3408
+ const isLeaf = row[IS_LEAF3];
3409
+ const spacers = Array(offset).fill(0).map((n, i) => /* @__PURE__ */ jsx27("span", { className: "vuuTable2-groupCell-spacer" }, i));
3410
+ return /* @__PURE__ */ jsxs19(
3120
3411
  "div",
3121
3412
  {
3122
- className: classBase12,
3123
- ...props,
3124
- style: {
3125
- ...styleProp
3126
- },
3413
+ className,
3414
+ role: "cell",
3415
+ style,
3416
+ onClick: isLeaf ? void 0 : handleClick,
3127
3417
  children: [
3128
- /* @__PURE__ */ jsx17(Text7, { as: "h4", children: "Column Settings" }),
3129
- /* @__PURE__ */ jsxs14(
3130
- Stack3,
3418
+ spacers,
3419
+ isLeaf ? null : /* @__PURE__ */ jsx27(
3420
+ "span",
3131
3421
  {
3132
- active: activeTab,
3133
- className: cx9(`${classBase12}-columnTabs`),
3134
- onTabSelectionChanged: setActiveTab,
3135
- TabstripProps: tabstripProps2,
3136
- children: [
3137
- /* @__PURE__ */ jsxs14(Panel7, { title: "Column", children: [
3138
- /* @__PURE__ */ jsxs14(FormField6, { labelPlacement: "left", children: [
3139
- /* @__PURE__ */ jsx17(FormFieldLabel6, { children: "Hidden" }),
3140
- /* @__PURE__ */ jsx17(
3141
- Checkbox2,
3142
- {
3143
- checked: column.hidden === true,
3144
- onChange: handleChangeHidden
3145
- }
3146
- )
3147
- ] }),
3148
- /* @__PURE__ */ jsxs14(FormField6, { labelPlacement: "left", children: [
3149
- /* @__PURE__ */ jsx17(FormFieldLabel6, { children: "Label" }),
3150
- /* @__PURE__ */ jsx17(
3151
- Input3,
3152
- {
3153
- value: (_a = column.label) != null ? _a : column.name,
3154
- onChange: handleChangeLabel
3155
- }
3156
- )
3157
- ] }),
3158
- /* @__PURE__ */ jsxs14(FormField6, { labelPlacement: "left", children: [
3159
- /* @__PURE__ */ jsx17(FormFieldLabel6, { children: "Width" }),
3160
- /* @__PURE__ */ jsx17(
3161
- StepperInput5,
3162
- {
3163
- value: (_b = column.width) != null ? _b : 100,
3164
- onChange: handleChangeWidth
3165
- }
3166
- )
3167
- ] }),
3168
- /* @__PURE__ */ jsxs14(FormField6, { labelPlacement: "left", children: [
3169
- /* @__PURE__ */ jsx17(FormFieldLabel6, { children: "Align" }),
3170
- /* @__PURE__ */ jsxs14(
3171
- RadioButtonGroup3,
3172
- {
3173
- "aria-label": "Column Align",
3174
- value: (_c = column.align) != null ? _c : "left",
3175
- onChange: handleChangeAlign,
3176
- children: [
3177
- /* @__PURE__ */ jsx17(RadioButton3, { label: "Left", value: "left" }),
3178
- /* @__PURE__ */ jsx17(RadioButton3, { label: "Right", value: "right" })
3179
- ]
3180
- }
3181
- )
3182
- ] }),
3183
- /* @__PURE__ */ jsxs14(FormField6, { labelPlacement: "left", children: [
3184
- /* @__PURE__ */ jsx17(FormFieldLabel6, { children: "Pin Column" }),
3185
- /* @__PURE__ */ jsxs14(
3186
- RadioButtonGroup3,
3187
- {
3188
- "aria-label": "Pin Column",
3189
- value: (_d = column.pin) != null ? _d : "",
3190
- onChange: handleChangePin,
3191
- children: [
3192
- /* @__PURE__ */ jsx17(RadioButton3, { label: "Do not pin", value: "" }),
3193
- /* @__PURE__ */ jsx17(RadioButton3, { label: "Left", value: "left" }),
3194
- /* @__PURE__ */ jsx17(RadioButton3, { label: "Right", value: "right" })
3195
- ]
3196
- }
3197
- )
3198
- ] })
3199
- ] }),
3200
- /* @__PURE__ */ jsx17(
3201
- ColumnTypePanel2,
3202
- {
3203
- column,
3204
- dispatchColumnAction,
3205
- title: "Data Cell"
3206
- }
3207
- ),
3208
- /* @__PURE__ */ jsxs14(Panel7, { title: "Vuu", variant: "secondary", children: [
3209
- /* @__PURE__ */ jsxs14(FormField6, { labelPlacement: "top", readOnly: true, children: [
3210
- /* @__PURE__ */ jsx17(FormFieldLabel6, { children: "Name" }),
3211
- /* @__PURE__ */ jsx17(Input3, { value: column.name })
3212
- ] }),
3213
- /* @__PURE__ */ jsxs14(FormField6, { labelPlacement: "top", readOnly: true, children: [
3214
- /* @__PURE__ */ jsx17(FormFieldLabel6, { children: "Vuu Type" }),
3215
- /* @__PURE__ */ jsx17(Input3, { value: column.serverDataType })
3216
- ] })
3217
- ] })
3218
- ]
3422
+ className: "vuuTable2-groupCell-toggle",
3423
+ "data-icon": "vuu-triangle-right"
3219
3424
  }
3220
- )
3425
+ ),
3426
+ /* @__PURE__ */ jsx27("span", { children: value })
3221
3427
  ]
3222
3428
  }
3223
3429
  );
3224
3430
  };
3431
+
3432
+ // ../vuu-table/src/table-next/Row.tsx
3433
+ import { jsx as jsx28 } from "react/jsx-runtime";
3434
+ import { createElement } from "react";
3435
+ var { IDX: IDX3, IS_EXPANDED: IS_EXPANDED4, SELECTED: SELECTED3 } = metadataKeys12;
3436
+ var classBase12 = "vuuTableNextRow";
3437
+ var Row2 = memo3(
3438
+ ({
3439
+ className: classNameProp,
3440
+ columnMap,
3441
+ columns,
3442
+ row,
3443
+ offset,
3444
+ onClick,
3445
+ onToggleGroup,
3446
+ ...htmlAttributes
3447
+ }) => {
3448
+ const {
3449
+ [IDX3]: rowIndex,
3450
+ [IS_EXPANDED4]: isExpanded,
3451
+ [SELECTED3]: selectionStatus
3452
+ } = row;
3453
+ const handleRowClick = useCallback32(
3454
+ (evt) => {
3455
+ const rangeSelect = evt.shiftKey;
3456
+ const keepExistingSelection = evt.ctrlKey || evt.metaKey;
3457
+ onClick == null ? void 0 : onClick(row, rangeSelect, keepExistingSelection);
3458
+ },
3459
+ [onClick, row]
3460
+ );
3461
+ const { True, First, Last } = RowSelected;
3462
+ const className = cx18(classBase12, classNameProp, {
3463
+ [`${classBase12}-even`]: rowIndex % 2 === 0,
3464
+ [`${classBase12}-expanded`]: isExpanded,
3465
+ [`${classBase12}-selected`]: selectionStatus & True,
3466
+ [`${classBase12}-selectedStart`]: selectionStatus & First,
3467
+ [`${classBase12}-selectedEnd`]: selectionStatus & Last
3468
+ });
3469
+ const style = typeof offset === "number" ? { transform: `translate3d(0px, ${offset}px, 0px)` } : void 0;
3470
+ return /* @__PURE__ */ createElement(
3471
+ "div",
3472
+ {
3473
+ ...htmlAttributes,
3474
+ key: `row-${row[0]}`,
3475
+ role: "row",
3476
+ className,
3477
+ onClick: handleRowClick,
3478
+ style
3479
+ },
3480
+ /* @__PURE__ */ jsx28("span", { className: `${classBase12}-selectionDecorator vuuStickyLeft` }),
3481
+ columns.filter(notHidden3).map((column) => {
3482
+ const isGroup = isGroupColumn4(column);
3483
+ const Cell = isGroup ? TableGroupCell2 : TableCell2;
3484
+ return /* @__PURE__ */ jsx28(Cell, { column, row }, column.key);
3485
+ }),
3486
+ /* @__PURE__ */ jsx28("span", { className: `${classBase12}-selectionDecorator vuuStickyRight` })
3487
+ );
3488
+ }
3489
+ );
3490
+ Row2.displayName = "Row";
3491
+
3492
+ // ../vuu-table/src/table-next/useTableNext.ts
3493
+ import {
3494
+ useLayoutEffectSkipFirst,
3495
+ useLayoutProviderDispatch
3496
+ } from "@vuu-ui/vuu-layout";
3497
+ import { useContextMenu as usePopupContextMenu2 } from "@vuu-ui/vuu-popups";
3498
+ import {
3499
+ applySort as applySort2,
3500
+ buildColumnMap as buildColumnMap3,
3501
+ isValidNumber as isValidNumber3,
3502
+ updateColumn as updateColumn2,
3503
+ visibleColumnAtIndex as visibleColumnAtIndex2
3504
+ } from "@vuu-ui/vuu-utils";
3505
+ import { useCallback as useCallback36, useMemo as useMemo13, useState as useState12 } from "react";
3506
+
3507
+ // ../vuu-table/src/table-next/table-config.ts
3508
+ var updateTableConfig = (config, action) => {
3509
+ switch (action.type) {
3510
+ case "col-size":
3511
+ return {
3512
+ ...config,
3513
+ columns: config.columns.map(
3514
+ (col) => col.name === action.column.name ? { ...col, width: action.width } : col
3515
+ )
3516
+ };
3517
+ case "column-prop":
3518
+ return {
3519
+ ...config,
3520
+ columns: config.columns.map(
3521
+ (col) => col.name === action.column.name ? { ...col, [action.property]: action.value } : col
3522
+ )
3523
+ };
3524
+ default:
3525
+ return config;
3526
+ }
3527
+ };
3528
+
3529
+ // ../vuu-table/src/table-next/useDataSource.ts
3530
+ import { useCallback as useCallback33, useMemo as useMemo11, useState as useState11 } from "react";
3531
+
3532
+ // ../vuu-table/src/table-next/useInitialValue.ts
3533
+ import { useMemo as useMemo12, useRef as useRef24 } from "react";
3534
+
3535
+ // ../vuu-table/src/table-next/useTableModel.ts
3536
+ import { moveItem as moveItem4 } from "@vuu-ui/vuu-ui-controls";
3537
+ import {
3538
+ applyFilterToColumns as applyFilterToColumns2,
3539
+ applyGroupByToColumns as applyGroupByToColumns2,
3540
+ applySortToColumns as applySortToColumns2,
3541
+ findColumn as findColumn2,
3542
+ getCellRenderer as getCellRenderer2,
3543
+ getColumnName as getColumnName3,
3544
+ getTableHeadings as getTableHeadings2,
3545
+ getValueFormatter as getValueFormatter2,
3546
+ isFilteredColumn as isFilteredColumn2,
3547
+ isGroupColumn as isGroupColumn5,
3548
+ isPinned as isPinned2,
3549
+ isTypeDescriptor as isTypeDescriptor5,
3550
+ logger,
3551
+ metadataKeys as metadataKeys13,
3552
+ sortPinnedColumns as sortPinnedColumns2,
3553
+ stripFilterFromColumns as stripFilterFromColumns2
3554
+ } from "@vuu-ui/vuu-utils";
3555
+ import { useReducer as useReducer3 } from "react";
3556
+ var { info } = logger("useTableModel");
3557
+ var KEY_OFFSET2 = metadataKeys13.count;
3558
+
3559
+ // ../vuu-table/src/table-next/useTableScroll.ts
3560
+ import { useCallback as useCallback34, useRef as useRef25 } from "react";
3561
+
3562
+ // ../vuu-table/src/table-next/useVirtualViewport.ts
3563
+ import { useCallback as useCallback35, useRef as useRef26 } from "react";
3564
+
3565
+ // ../vuu-table/src/table-next/TableNext.tsx
3566
+ import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
3567
+ var { IDX: IDX4, RENDER_IDX: RENDER_IDX2 } = metadataKeys14;
3568
+
3569
+ // src/table-settings/useTableSettings.ts
3570
+ import { useCallback as useCallback37, useMemo as useMemo14, useState as useState13 } from "react";
3571
+ var buildColumnItems = (availableColumns, configuredColumns) => {
3572
+ return availableColumns.map(({ name, serverDataType }) => {
3573
+ const configuredColumn = configuredColumns.find((col) => col.name === name);
3574
+ return {
3575
+ hidden: configuredColumn == null ? void 0 : configuredColumn.hidden,
3576
+ label: configuredColumn == null ? void 0 : configuredColumn.label,
3577
+ name,
3578
+ serverDataType,
3579
+ subscribed: configuredColumn !== void 0
3580
+ };
3581
+ });
3582
+ };
3583
+ var useTableSettings = ({
3584
+ availableColumns,
3585
+ onConfigChange,
3586
+ tableConfig: tableConfigProp
3587
+ }) => {
3588
+ const [tableConfig, setTableConfig] = useState13(tableConfigProp);
3589
+ const columnItems = useMemo14(
3590
+ () => buildColumnItems(availableColumns, tableConfig.columns),
3591
+ [availableColumns, tableConfig.columns]
3592
+ );
3593
+ const handleMoveListItem = useCallback37(
3594
+ (fromIndex, toIndex) => {
3595
+ console.log(`move list item from ${fromIndex} to ${toIndex}`);
3596
+ },
3597
+ []
3598
+ );
3599
+ const handleColumnChange = useCallback37(
3600
+ (name, property, value) => {
3601
+ const columnItem = columnItems.find((col) => col.name === name);
3602
+ if (property === "subscribed") {
3603
+ console.log(`unsubscribe from ${name}`);
3604
+ } else if (columnItem == null ? void 0 : columnItem.subscribed) {
3605
+ const column = tableConfig.columns.find((col) => col.name === name);
3606
+ if (column) {
3607
+ const newConfig = updateTableConfig(tableConfig, {
3608
+ type: "column-prop",
3609
+ property,
3610
+ column,
3611
+ value
3612
+ });
3613
+ setTableConfig(newConfig);
3614
+ }
3615
+ }
3616
+ },
3617
+ [columnItems, tableConfig]
3618
+ );
3619
+ const handleChangeColumnLabels = useCallback37((evt) => {
3620
+ const { value } = evt.target;
3621
+ const columnFormatHeader = value === "0" ? void 0 : value === "1" ? "capitalize" : "uppercase";
3622
+ setTableConfig((config) => ({
3623
+ ...config,
3624
+ columnFormatHeader
3625
+ }));
3626
+ }, []);
3627
+ useLayoutEffectSkipFirst2(() => {
3628
+ onConfigChange == null ? void 0 : onConfigChange(tableConfig);
3629
+ }, [onConfigChange, tableConfig]);
3630
+ const columnLabelsValue = tableConfig.columnFormatHeader === void 0 ? 0 : tableConfig.columnFormatHeader === "capitalize" ? 1 : 2;
3631
+ return {
3632
+ columnItems,
3633
+ columnLabelsValue,
3634
+ onChangeColumnLabels: handleChangeColumnLabels,
3635
+ onColumnChange: handleColumnChange,
3636
+ onMoveListItem: handleMoveListItem
3637
+ };
3638
+ };
3639
+
3640
+ // src/table-settings/TableSettingsPanel.tsx
3641
+ import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
3642
+ var classBase13 = "vuuTableSettingsPanel";
3643
+ var TableSettingsPanel = ({
3644
+ availableColumns,
3645
+ onConfigChange,
3646
+ tableConfig,
3647
+ ...htmlAttributes
3648
+ }) => {
3649
+ const {
3650
+ columnItems,
3651
+ columnLabelsValue,
3652
+ onChangeColumnLabels,
3653
+ onColumnChange,
3654
+ onMoveListItem
3655
+ } = useTableSettings({
3656
+ availableColumns,
3657
+ onConfigChange,
3658
+ tableConfig
3659
+ });
3660
+ return /* @__PURE__ */ jsxs21("div", { ...htmlAttributes, className: classBase13, children: [
3661
+ /* @__PURE__ */ jsxs21(FormField5, { children: [
3662
+ /* @__PURE__ */ jsx30(FormFieldLabel5, { children: "Column Labels" }),
3663
+ /* @__PURE__ */ jsxs21(
3664
+ ToggleButtonGroup,
3665
+ {
3666
+ className: "vuuToggleButtonGroup",
3667
+ onChange: onChangeColumnLabels,
3668
+ value: columnLabelsValue,
3669
+ children: [
3670
+ /* @__PURE__ */ jsx30(
3671
+ ToggleButton,
3672
+ {
3673
+ className: "vuuIconToggleButton",
3674
+ "data-icon": "text-strikethrough",
3675
+ value: 0
3676
+ }
3677
+ ),
3678
+ /* @__PURE__ */ jsx30(
3679
+ ToggleButton,
3680
+ {
3681
+ className: "vuuIconToggleButton",
3682
+ "data-icon": "text-Tt",
3683
+ value: 1
3684
+ }
3685
+ ),
3686
+ /* @__PURE__ */ jsx30(
3687
+ ToggleButton,
3688
+ {
3689
+ className: "vuuIconToggleButton",
3690
+ "data-icon": "text-T",
3691
+ value: 2
3692
+ }
3693
+ )
3694
+ ]
3695
+ }
3696
+ )
3697
+ ] }),
3698
+ /* @__PURE__ */ jsxs21(FormField5, { children: [
3699
+ /* @__PURE__ */ jsx30(FormFieldLabel5, { children: "Default Column Width" }),
3700
+ /* @__PURE__ */ jsx30(Input3, { className: "vuuInput" })
3701
+ ] }),
3702
+ /* @__PURE__ */ jsx30(
3703
+ ColumnList,
3704
+ {
3705
+ columnItems,
3706
+ onChange: onColumnChange,
3707
+ onMoveListItem
3708
+ }
3709
+ )
3710
+ ] });
3711
+ };
3225
3712
  export {
3226
3713
  ColumnExpressionInput,
3714
+ ColumnList,
3227
3715
  ColumnNamedTerms,
3228
- ColumnSettingsPanel2 as ColumnSettingsPanel,
3229
3716
  DataSourceStats,
3230
3717
  DatagridSettingsPanel,
3718
+ TableSettingsPanel,
3231
3719
  columnExpressionLanguageSupport,
3232
3720
  isCompleteExpression,
3233
3721
  isCompleteRelationalExpression,
3234
3722
  lastNamedChild,
3235
3723
  useColumnExpressionEditor,
3236
3724
  useColumnExpressionSuggestionProvider,
3725
+ useTableSettings,
3237
3726
  walkTree
3238
3727
  };
3239
3728
  //# sourceMappingURL=index.js.map